Skip to content

Commit

Permalink
Merge branch 'develop' into style/back-top
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim authored Dec 7, 2022
2 parents 7d98449 + fbe7925 commit 0f63071
Show file tree
Hide file tree
Showing 46 changed files with 386 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-dep/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
nodeVersion:
required: false
type: string
default: '12'
default: '14'

runs:
using: "composite"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
else
echo "不属于 release pr 的 comment" && exit 1
fi
echo "::set-output name=branch::${BASH_REMATCH[1]}"
echo "branch=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
# zsh $match[1]
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-assignees.temp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- run: |
contributors=${{ steps.assignees.outputs.contributors }}
contributorstring=${contributors//,/ @}
echo "::set-output name=string::@$contributorstring"
echo "string=@$contributorstring" >> $GITHUB_OUTPUT
id: contributors
- name: 通知贡献者
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: PREVIEW

on:
issue_comment:
types: [created]

jobs:
request-preview:
runs-on: ubuntu-latest
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == '预览'
steps:
- run: |
timestamp=$(date +%s)
echo "timestamp=${timestamp}" >> $GITHUB_OUTPUT
id: time
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
正在构建预览的二维码,请稍等...
comment_tag: ${{steps.time.outputs.timestamp}}
- uses: LeeJim/pull-request-comment-branch@main
id: comment-branch
- uses: actions/checkout@v3
if: success()
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
repository: ${{ steps.comment-branch.outputs.head_repo_name_with_owner }}
- uses: ./.github/actions/install-dep
- run: npm run build
shell: bash
- name: get preview qrcode
id: preview
uses: LeeJim/setup-miniprogram@main
with:
project_type: miniProgram
action_type: preview
project_path: ./_example
es6: true
es7: true
minify: true
env:
MINI_APP_ID: ${{ secrets.TDESIGN_APP_ID }}
MINI_APP_PRIVATE_KEY: ${{ secrets.TDESIGN_MINI_KEY }}
- name: Upload qrcode to Tencent COS
uses: LeeJim/tencent-cos-action@main
id: cos
with:
secretId: ${{ secrets.TENCENT_COS_SECRET_ID }}
secretKey: ${{ secrets.TENCENT_COS_SECRET_KEY }}
bucket: mp-qrcode-1255404841
region: ap-guangzhou
content: ${{ steps.preview.outputs.preview-qrcode }}
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
<img alt="qrcode" src="${{ steps.cos.outputs.url }}" width="256" />
comment_tag: ${{steps.time.outputs.timestamp}}
8 changes: 4 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: MAIN_PULL_REQUEST

on:
pull_request:
pull_request:
branches: [develop, main]
types: [opened, synchronize, reopened]

jobs:
check:
check-email:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -19,12 +19,12 @@ jobs:
- name: check_local_email
run: |
log_emails=$(git log --pretty=format:"%ae %ce" -1) && if [[ ${log_emails} =~ '@tencent.com' ]];then echo "本地提交邮箱 $log_emails 校验非法,需要本地更改重新提交" && exit 2;else echo "邮箱 $log_emails 校验通过";fi
MAIN_PULL_REQUEST:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-dep
- name: lint 检查
run: npm run lint
- name: unit test
run: npm run test:unit
run: npm run test:unit
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ toc: false
docClass: timeline
---

## 🌈 0.29.0 `2022-12-05`
### ❗ BREAKING CHANGES
- `Loading`: `theme = spinner` 默认颜色改成黑色 @LeeJim ([#1152](https://github.com/Tencent/tdesign-miniprogram/pull/1152))
- `Loading`: 简化 DOM @LeeJim ([#1152](https://github.com/Tencent/tdesign-miniprogram/pull/1152))

### 🚀 Features
- `ActionSheet`: 视觉升级 @LeeJim ([#1142](https://github.com/Tencent/tdesign-miniprogram/pull/1142))
- `Drawer`: 视觉升级 @LeeJim ([#1147](https://github.com/Tencent/tdesign-miniprogram/pull/1147))
- `Search`: 支持无障碍访问 @Isabella327 ([#1132](https://github.com/Tencent/tdesign-miniprogram/pull/1132))
- `Message`: 支持无障碍访问 @zhangpaopao0609 ([#1150](https://github.com/Tencent/tdesign-miniprogram/pull/1150))
- `Stepper`: 支持无障碍访问 @zhangpaopao0609 ([#1144](https://github.com/Tencent/tdesign-miniprogram/pull/1144))
- `Progress`: 支持无障碍访问 @yaogengzhu ([#1156](https://github.com/Tencent/tdesign-miniprogram/pull/1156))
- `Image`: 支持无障碍访问 @zhangpaopao0609 ([#1136](https://github.com/Tencent/tdesign-miniprogram/pull/1136))
- `Radio`: 支持无障碍访问 @byq1213 ([#1139](https://github.com/Tencent/tdesign-miniprogram/pull/1139))
- `Avatar`: 支持无障碍访问 @byq1213 ([#1137](https://github.com/Tencent/tdesign-miniprogram/pull/1137))
- `ActionSheet`: 新增 description 和 align 属性 @LeeJim ([#1142](https://github.com/Tencent/tdesign-miniprogram/pull/1142))
- `Loading`: 支持默认插槽、CSS Variables @LeeJim ([#1152](https://github.com/Tencent/tdesign-miniprogram/pull/1152))
- `Drawer`: 新增支持 titile 属性,footer 插槽 @LeeJim ([#1147](https://github.com/Tencent/tdesign-miniprogram/pull/1147))
- `ActionSheet`: 新增支持 CSS Variables @LeeJim ([#1142](https://github.com/Tencent/tdesign-miniprogram/pull/1142))

### 🐞 Bug Fixes
- `Checkbox`: 修复数组图标无法使用的问题 @LeeJim ([#1135](https://github.com/Tencent/tdesign-miniprogram/pull/1135))
- `Cascader`: 修复重置 `options = []` 时报错的问题 @LeeJim ([#1163](https://github.com/Tencent/tdesign-miniprogram/pull/1163))

## 🌈 0.28.0 `2022-11-28`
### ❗ BREAKING CHANGES
- `Radio`: 调整 icon 属性,新增 dot 类型,并简化原有命名 @LeeJim ([#1098](https://github.com/Tencent/tdesign-miniprogram/pull/1098))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-miniprogram",
"purename": "tdesign",
"version": "0.28.0-beta.1",
"version": "0.29.0",
"description": "tdesign-miniprogram",
"title": "tdesign-miniprogram",
"main": "miniprogram_dist/index.js",
Expand Down
8 changes: 8 additions & 0 deletions src/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ export default class Calendar extends SuperComponent {
};

observers = {
'firstDayOfWeek,minDate,maxDate'(firstDayOfWeek, minDate, maxDate) {
if (this.base) {
this.base.firstDayOfWeek = firstDayOfWeek;
this.base.minDate = minDate;
this.base.maxDate = maxDate;
this.calcMonths();
}
},
value(v) {
if (this.base) {
this.base.value = v;
Expand Down
4 changes: 4 additions & 0 deletions src/checkbox/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ exports[`Checkbox Checkbox special demo works fine 1`] = `
class="card card--active"
>
<t-icon
ariaHidden="{{true}}"
class="card__icon"
name="check"
/>
Expand All @@ -180,6 +181,7 @@ exports[`Checkbox Checkbox special demo works fine 1`] = `
class="card card--active"
>
<t-icon
ariaHidden="{{true}}"
class="card__icon"
name="check"
/>
Expand Down Expand Up @@ -223,6 +225,7 @@ exports[`Checkbox Checkbox special demo works fine 1`] = `
class="card card--active"
>
<t-icon
ariaHidden="{{true}}"
class="card__icon"
name="check"
/>
Expand All @@ -237,6 +240,7 @@ exports[`Checkbox Checkbox special demo works fine 1`] = `
class="card card--active"
>
<t-icon
ariaHidden="{{true}}"
class="card__icon"
name="check"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/checkbox/_example/special/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<t-checkbox-group value="{{value}}" bind:change="onChange">
<view wx:for="{{3}}" class="card {{_.contain(value, index) ? 'card--active' : value.indexOf(index)}}">
<t-icon wx:if="{{_.contain(value, index)}}" name="check" class="card__icon" />
<t-icon wx:if="{{_.contain(value, index)}}" name="check" class="card__icon" ariaHidden="{{true}}" />
<t-checkbox
value="{{index}}"
label="多选"
Expand All @@ -17,7 +17,7 @@

<t-checkbox-group t-class="horizontal-box" value="{{value1}}" bind:change="onChange1">
<view wx:for="{{3}}" class="card {{_.contain(value1, index) ? 'card--active' : ''}}">
<t-icon wx:if="{{_.contain(value1, index)}}" name="check" class="card__icon" />
<t-icon wx:if="{{_.contain(value1, index)}}" name="check" class="card__icon" ariaHidden="{{true}}" />
<t-checkbox value="{{index}}" label="多选" icon="none" borderless />
</view>
</t-checkbox-group>
3 changes: 3 additions & 0 deletions src/common/src/instantiationDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const toComponent = function toComponent(options: Record<string, any>) {
{ key: 'ariaHidden', type: Boolean },
{ key: 'ariaRole', type: String },
{ key: 'ariaLabel', type: String },
{ key: 'ariaLabelledby', type: String },
{ key: 'ariaDescribedby', type: String },
{ key: 'ariaBusy', type: Boolean },
];
ariaProps.forEach(({ key, type }) => {
options.properties[key] = {
Expand Down
1 change: 1 addition & 0 deletions src/common/style/_variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
@shadow-1: 0 1px 10px rgba(0, 0, 0, 5%), 0 4px 5px rgba(0, 0, 0, 8%), 0 2px 4px -1px rgba(0, 0, 0, 12%);
@shadow-2: 0 3px 14px 2px rgba(0, 0, 0, 5%), 0 8px 10px 1px rgba(0, 0, 0, 6%), 0 5px 5px -3px rgba(0, 0, 0, 10%);
@shadow-3: 0 6px 30px 5px rgba(0, 0, 0, 5%), 0 16px 24px 2px rgba(0, 0, 0, 4%), 0 8px 10px -5px rgba(0, 0, 0, 8%);
@shadow-4: 0 2px 8px 0 rgba(0, 0, 0, 0.06);

// 容器
@bg-color-page: @gray-color-1;
Expand Down
8 changes: 4 additions & 4 deletions src/common/template/icon.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
name="{{name}}"
size="{{size}}"
color="{{color}}"
ariaHidden="{{ariaHidden}}"
ariaLabel="{{ariaLabel}}"
ariaRole="{{ariaRole}}"
bind:click="{{onTplClick}}"
aria-hidden="{{ariaHidden}}"
aria-label="{{ariaLabel}}"
aria-role="{{ariaRole}}"
bind:click="onTplClick"
/>
</template>
9 changes: 9 additions & 0 deletions src/image-viewer/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`image-viewer :base 1`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="t-class t-image t-image__mask t-image--loading t-image--shape-square"
style=" "
>
Expand Down Expand Up @@ -49,6 +50,8 @@ exports[`image-viewer :base 1`] = `
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-class t-image t-image--shape-square"
hidden="{{true}}"
id="image"
Expand All @@ -73,6 +76,7 @@ exports[`image-viewer :base 2`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="t-class t-image t-image__mask t-image--loading t-image--shape-square"
style=" "
>
Expand Down Expand Up @@ -113,6 +117,8 @@ exports[`image-viewer :base 2`] = `
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-class t-image t-image--shape-square"
hidden="{{true}}"
id="image"
Expand All @@ -137,6 +143,7 @@ exports[`image-viewer :base 3`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="t-class t-image t-image__mask t-image--loading t-image--shape-square"
style=" "
>
Expand Down Expand Up @@ -177,6 +184,8 @@ exports[`image-viewer :base 3`] = `
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-class t-image t-image--shape-square"
hidden="{{true}}"
id="image"
Expand Down
6 changes: 6 additions & 0 deletions src/image/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`Image Image base demo works fine 1`] = `
裁切
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
mode="aspectFill"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
Expand All @@ -29,6 +30,7 @@ exports[`Image Image base demo works fine 1`] = `
适应高
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
mode="heightFix"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
Expand All @@ -44,6 +46,7 @@ exports[`Image Image base demo works fine 1`] = `
拉伸
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
width="72"
Expand All @@ -62,6 +65,7 @@ exports[`Image Image base demo works fine 1`] = `
方形
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
mode="aspectFill"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
Expand All @@ -77,6 +81,7 @@ exports[`Image Image base demo works fine 1`] = `
圆角方形
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
shape="round"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
Expand All @@ -92,6 +97,7 @@ exports[`Image Image base demo works fine 1`] = `
圆形
</wx-view>
<t-image
ariaLabel="一个放置在墙角的黄色行李箱"
height="72"
shape="circle"
src="https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/image/image-2.jpg"
Expand Down
9 changes: 7 additions & 2 deletions src/image/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`image :base 1`] = `
<main>
<t-image>
<wx-view
ariaHidden="{{false}}"
class="t-class t-image t-image__mask t-image--faild t-image--shape-square"
style=" "
>
Expand All @@ -14,8 +15,8 @@ exports[`image :base 1`] = `
<t-icon>
<wx-view
ariaHidden="{{false}}"
ariaLabel=""
ariaRole=""
ariaLabel="加载失败"
ariaRole="img"
class="t-icon t-class"
style=""
bind:tap="onTap"
Expand All @@ -28,6 +29,8 @@ exports[`image :base 1`] = `
</wx-view>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-class t-image t-image--shape-square"
hidden="{{true}}"
id="image"
Expand All @@ -51,6 +54,8 @@ exports[`image :success 1`] = `
bind:load="handleLoad"
>
<wx-image
ariaHidden="{{false}}"
ariaLabel=""
class="t-class t-image t-image--shape-square"
hidden="{{false}}"
id="image"
Expand Down
Loading

0 comments on commit 0f63071

Please sign in to comment.