From e5ce4fd26c5a4e8f0c0b06cb01dd6b9b0d5a7d28 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 14:33:02 +0800 Subject: [PATCH 01/13] feat(picker): support aria --- src/picker-item/picker-item.ts | 11 +++++++++++ src/picker-item/picker-item.wxml | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/picker-item/picker-item.ts b/src/picker-item/picker-item.ts index 46ab74c11..c0c9e9212 100644 --- a/src/picker-item/picker-item.ts +++ b/src/picker-item/picker-item.ts @@ -61,6 +61,17 @@ export default class PickerItem extends SuperComponent { offset: range(StartOffset + deltaY, -(this.getCount() * itemHeight), 0), duration: DefaultDuration, }); + + const { offset } = this.data; + + if (offset === this.StartOffset) { + return; + } + // 调整偏移量 + const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); + this.setData({ + curIndex: index, + }); }, onTouchEnd() { diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index 805e6e9f6..786232c7d 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -7,6 +7,7 @@ catch:touchmove="onTouchMove" bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd" + aria-role="listbox" > {{option.label}} From 10d1509dfc8fb73b065850ee035f46a4b1f36618 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 14:33:25 +0800 Subject: [PATCH 02/13] feat(picker): alert --- src/picker-item/picker-item.wxml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index 786232c7d..f1d10c122 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -21,8 +21,10 @@ data-index="{{ index }}" aria-role="option" aria-hidden="{{curIndex !== index}}" + aria-label="{{option.label + ',按住后上下滑动选择'}}" > {{option.label}} + {{ options[curIndex].label }} From a0a67f48d8eb9bc09016992ca28fdf78fbd3acd3 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 14:36:53 +0800 Subject: [PATCH 03/13] feat(picker): button --- src/picker/picker.wxml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/picker/picker.wxml b/src/picker/picker.wxml index 86e71d8c3..a7dd6359d 100644 --- a/src/picker/picker.wxml +++ b/src/picker/picker.wxml @@ -3,13 +3,23 @@ - {{cancelBtn}} + {{cancelBtn}} + {{title}} - {{confirmBtn}} + {{confirmBtn}} + From 09abaa15542a3e0ee75820ecadef1b7a41662943 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 14:43:52 +0800 Subject: [PATCH 04/13] test(picker): update snap --- .../__test__/__snapshots__/index.test.js.snap | 151 +++++++++++++++++- .../__test__/__snapshots__/index.test.js.snap | 43 ++++- 2 files changed, 190 insertions(+), 4 deletions(-) diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index 3ef2dbac1..3dc841d4f 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -38,10 +38,13 @@ exports[`date-time-picker :base 1`] = ` class="t-picker__toolbar" > - 取消 + + 取消 + - 确定 + + 确定 + @@ -83,6 +93,9 @@ exports[`date-time-picker :base 1`] = ` @@ -91,6 +104,9 @@ exports[`date-time-picker :base 1`] = ` @@ -99,6 +115,9 @@ exports[`date-time-picker :base 1`] = ` @@ -107,6 +126,9 @@ exports[`date-time-picker :base 1`] = ` @@ -115,6 +137,9 @@ exports[`date-time-picker :base 1`] = ` @@ -123,6 +148,9 @@ exports[`date-time-picker :base 1`] = ` @@ -131,6 +159,9 @@ exports[`date-time-picker :base 1`] = ` @@ -139,6 +170,9 @@ exports[`date-time-picker :base 1`] = ` @@ -147,6 +181,9 @@ exports[`date-time-picker :base 1`] = ` @@ -155,6 +192,9 @@ exports[`date-time-picker :base 1`] = ` @@ -163,6 +203,9 @@ exports[`date-time-picker :base 1`] = ` @@ -171,6 +214,9 @@ exports[`date-time-picker :base 1`] = ` @@ -179,6 +225,9 @@ exports[`date-time-picker :base 1`] = ` @@ -187,6 +236,9 @@ exports[`date-time-picker :base 1`] = ` @@ -195,6 +247,9 @@ exports[`date-time-picker :base 1`] = ` @@ -203,6 +258,9 @@ exports[`date-time-picker :base 1`] = ` @@ -211,6 +269,9 @@ exports[`date-time-picker :base 1`] = ` @@ -219,6 +280,9 @@ exports[`date-time-picker :base 1`] = ` @@ -227,6 +291,9 @@ exports[`date-time-picker :base 1`] = ` @@ -235,6 +302,9 @@ exports[`date-time-picker :base 1`] = ` @@ -243,6 +313,9 @@ exports[`date-time-picker :base 1`] = ` @@ -251,6 +324,9 @@ exports[`date-time-picker :base 1`] = ` @@ -259,6 +335,9 @@ exports[`date-time-picker :base 1`] = ` @@ -267,6 +346,9 @@ exports[`date-time-picker :base 1`] = ` @@ -275,6 +357,9 @@ exports[`date-time-picker :base 1`] = ` @@ -283,6 +368,9 @@ exports[`date-time-picker :base 1`] = ` @@ -291,6 +379,9 @@ exports[`date-time-picker :base 1`] = ` @@ -299,6 +390,9 @@ exports[`date-time-picker :base 1`] = ` @@ -307,6 +401,9 @@ exports[`date-time-picker :base 1`] = ` @@ -315,6 +412,9 @@ exports[`date-time-picker :base 1`] = ` @@ -323,6 +423,11 @@ exports[`date-time-picker :base 1`] = ` + + 2021年 + @@ -350,6 +459,9 @@ exports[`date-time-picker :base 1`] = ` @@ -358,6 +470,9 @@ exports[`date-time-picker :base 1`] = ` @@ -366,6 +481,9 @@ exports[`date-time-picker :base 1`] = ` @@ -374,6 +492,9 @@ exports[`date-time-picker :base 1`] = ` @@ -382,6 +503,9 @@ exports[`date-time-picker :base 1`] = ` @@ -390,6 +514,9 @@ exports[`date-time-picker :base 1`] = ` @@ -398,6 +525,9 @@ exports[`date-time-picker :base 1`] = ` @@ -406,6 +536,9 @@ exports[`date-time-picker :base 1`] = ` @@ -414,6 +547,9 @@ exports[`date-time-picker :base 1`] = ` @@ -422,6 +558,9 @@ exports[`date-time-picker :base 1`] = ` @@ -430,6 +569,9 @@ exports[`date-time-picker :base 1`] = ` @@ -438,6 +580,11 @@ exports[`date-time-picker :base 1`] = ` + + 9月 + - 取消 + + 取消 + - 确认 + + 确认 + @@ -77,6 +87,9 @@ exports[`picker :base 1`] = ` @@ -85,6 +98,9 @@ exports[`picker :base 1`] = ` @@ -93,10 +109,16 @@ exports[`picker :base 1`] = ` + + 2021年 + @@ -117,6 +142,9 @@ exports[`picker :base 1`] = ` @@ -125,6 +153,9 @@ exports[`picker :base 1`] = ` @@ -133,6 +164,9 @@ exports[`picker :base 1`] = ` @@ -141,6 +175,11 @@ exports[`picker :base 1`] = ` + + 春 + Date: Thu, 2 Mar 2023 15:12:10 +0800 Subject: [PATCH 05/13] feat(picker): change logic --- src/picker-item/picker-item.ts | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/picker-item/picker-item.ts b/src/picker-item/picker-item.ts index c0c9e9212..e6808e343 100644 --- a/src/picker-item/picker-item.ts +++ b/src/picker-item/picker-item.ts @@ -56,37 +56,25 @@ export default class PickerItem extends SuperComponent { // touch偏移增量 const touchDeltaY = event.touches[0].clientY - StartY; const deltaY = this.calculateViewDeltaY(touchDeltaY); + const offset = range(StartOffset + deltaY, -(this.getCount() * itemHeight), 0); + const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); this.setData({ - offset: range(StartOffset + deltaY, -(this.getCount() * itemHeight), 0), + offset, duration: DefaultDuration, - }); - - const { offset } = this.data; - - if (offset === this.StartOffset) { - return; - } - // 调整偏移量 - const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); - this.setData({ curIndex: index, }); }, onTouchEnd() { - const { offset } = this.data; + const { offset, index } = this.data; const { options } = this.properties; if (offset === this.StartOffset) { return; } - // 调整偏移量 - const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); - this.setData({ - curIndex: index, - offset: -index * this.itemHeight, - }); + + this.setData({ offset: -index * this.itemHeight }); if (index === this._selectedIndex) { return; From 04deb91a052ed7b1ee3fa4c0d4f9cc6992f2b6b4 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 15:19:04 +0800 Subject: [PATCH 06/13] fix(picker): offset logic --- src/picker-item/picker-item.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/picker-item/picker-item.ts b/src/picker-item/picker-item.ts index e6808e343..14459f53c 100644 --- a/src/picker-item/picker-item.ts +++ b/src/picker-item/picker-item.ts @@ -67,14 +67,18 @@ export default class PickerItem extends SuperComponent { }, onTouchEnd() { - const { offset, index } = this.data; + const { offset } = this.data; const { options } = this.properties; if (offset === this.StartOffset) { return; } - - this.setData({ offset: -index * this.itemHeight }); + // 调整偏移量 + const index = range(Math.round(-offset / this.itemHeight), 0, this.getCount() - 1); + this.setData({ + curIndex: index, + offset: -index * this.itemHeight, + }); if (index === this._selectedIndex) { return; From c26553406b65c1368b66b97d4dfd780747243bef Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 19:33:16 +0800 Subject: [PATCH 07/13] feat(picker): aria content hidden --- src/picker-item/picker-item.less | 6 ++++++ src/picker-item/picker-item.wxml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/picker-item/picker-item.less b/src/picker-item/picker-item.less index 5ba7b3d87..54bbe063e 100644 --- a/src/picker-item/picker-item.less +++ b/src/picker-item/picker-item.less @@ -18,6 +18,7 @@ overflow: hidden; flex: 1; z-index: 1; + position: relative; } &__wrapper { @@ -38,4 +39,9 @@ font-weight: 600; } } + + &__aria__content { + position: absolute; + top: 100%; + } } diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index f1d10c122..1e1a00367 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -26,5 +26,5 @@ {{option.label}} - {{ options[curIndex].label }} + {{ options[curIndex].label }} From bb5b31ff21014d1da17060c24425d4d97ef16166 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 19:42:22 +0800 Subject: [PATCH 08/13] test: update snap --- .../index.test.js.snap | 50 +- .../index.test.js.snap | 1426 ++++++++--------- .../index.test.js.snap | 80 +- .../index.test.js.snap | 260 ++- .../index.test.js.snap | 64 +- .../__test__/__snapshots__/index.test.js.snap | 2 + .../index.test.js.snap | 855 +++++----- .../index.test.js.snap | 74 +- .../index.test.js.snap | 18 +- .../index.test.js.snap | 16 +- .../index.test.js.snap | 255 +-- .../index.test.js.snap | 103 +- .../index.test.js.snap | 324 ++-- .../index.test.js.snap | 142 +- .../index.test.js.snap | 210 ++- .../index.test.js.snap | 116 +- .../index.test.js.snap | 20 +- .../__test__/__snapshots__/index.test.js.snap | 2 + .../index.test.js.snap | 279 ++-- .../index.test.js.snap | 78 +- .../index.test.js.snap | 216 ++- .../index.test.js.snap | 104 +- .../index.test.js.snap | 30 +- .../index.test.js.snap | 88 +- 24 files changed, 2318 insertions(+), 2494 deletions(-) diff --git a/src/avatar/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/avatar/__test__/__virtualHostSnapshot__/index.test.js.snap index c292c83f6..5cd6176dc 100644 --- a/src/avatar/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/avatar/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,45 +2,35 @@ exports[`Avatar & Avatar Groups Avatar Props : style && customStyle 1`] = `
-
- - - - - + class="t-avatar__text t-class-content" + /> - + -
+
`; diff --git a/src/calendar/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/calendar/__test__/__virtualHostSnapshot__/index.test.js.snap index 56c5f98c3..8651f4a34 100644 --- a/src/calendar/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/calendar/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,809 +2,777 @@ exports[`calendar :base 1`] = `
- - + + - + 请选择日期 + + + + + + + 日 + + + 一 + + + 二 + + + 三 + + + 四 + + + 五 + + + 六 + + + + + 2022 年 10 月 + + + + + + + + - - 请选择日期 - - - - - - - - - - 日 - - - 一 - - - 二 - - - 三 - - - 四 - - - 五 - - - 六 - - - - - 2022 年 10 月 - - - - - - - - - - + ariaDisabled="{{false}}" + ariaLabel="10月1日, 星期六" + ariaRole="button" + class="t-calendar__dates-item t-calendar__dates-item--" + data-date="{{ + Object { + "date": Object {}, + "day": 1, + "type": "", + } + }}" + data-month="{{9}}" + data-year="{{2022}}" + bind:tap="handleSelect" + > + 1 - - - + + + 2 - - - + + + 3 - - - + + + 4 - - - + + + 5 - - - + + + 6 - - - + + + 7 - - - + + + 8 - - - + + + 9 - - - + + + 10 - - - + + + 11 - - - + + + 12 - - - + + + 13 - - - + + + 14 - - - + + + 15 - - - + + + 16 - - - + + + 17 - - - + + + 18 - - - + + + 19 - - - + + + 20 - - - + + + 21 - - - + + + 22 - - - + + + 23 - - - + + + 24 - - - + + + 25 - - - + + + 26 - - - + + + 27 - - - + + + 28 - - - + + + 29 - - - + + + 30 - - - + + + 31 - - - - - - - - - 确定 - - - + + + + + + 确定 + + - - - - - + + +
`; diff --git a/src/cell/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/cell/__test__/__virtualHostSnapshot__/index.test.js.snap index 049933a34..9bfb5aec0 100644 --- a/src/cell/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/cell/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,66 +2,56 @@ exports[`cell :base 1`] = `
-
+ - - - - + + + - - - - - + -
+
`; exports[`cell :with group 1`] = `
-
- -
+
`; diff --git a/src/collapse/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/collapse/__test__/__virtualHostSnapshot__/index.test.js.snap index 3c2af13a0..bbad0465c 100644 --- a/src/collapse/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/collapse/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -1,183 +1,151 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`collapse :defaultExpandAll 1`] = ` - - + + - - - - - - first - - - - - - - - - - - - - + first + + + - - - - 内容1 + - - + + + + + + + 内容1 + + + + + + - - - - - - second - - - - - - - - - - - - - + second + + + - - - - 内容2 + - + + + + + + + 内容2 + + - + `; diff --git a/src/count-down/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/count-down/__test__/__virtualHostSnapshot__/index.test.js.snap index 311f3161a..c4b88938b 100644 --- a/src/count-down/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/count-down/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,58 +2,48 @@ exports[`countdown :autoStart 1`] = `
- - - 00 : 00 : 01 - - + + 00 : 00 : 01 +
`; exports[`countdown :base 1`] = `
- - - 00 : 00 : 01 - - + + 00 : 00 : 01 +
`; exports[`countdown :base 2`] = `
- - - 00 : 00 : 00 - - + + 00 : 00 : 00 +
`; exports[`countdown :millisecond 1`] = `
- - - 00 : 00 : 00 - - + 00 : 00 : 00 +
`; diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index 3dc841d4f..fce787c67 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -425,6 +425,7 @@ exports[`date-time-picker :base 1`] = ` 2021年 @@ -582,6 +583,7 @@ exports[`date-time-picker :base 1`] = ` 9月 diff --git a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 3ef2dbac1..f11884db8 100644 --- a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,474 +2,591 @@ exports[`date-time-picker :base 1`] = `
- - + - + + + 取消 + + + + 选择日期 + + + + 确定 + + + + + - - - 取消 - - - 选择日期 - - - 确定 - - - - - - - - + ariaHidden="{{true}}" + ariaLabel="2000年,按住后上下滑动选择" + ariaRole="option" + class="t-picker-item__item" + data-index="{{0}}" + > + 2000年 - - - + + + 2001年 - - - + + + 2002年 - - - + + + 2003年 - - - + + + 2004年 - - - + + + 2005年 - - - + + + 2006年 - - - + + + 2007年 - - - + + + 2008年 - - - + + + 2009年 - - - + + + 2010年 - - - + + + 2011年 - - - + + + 2012年 - - - + + + 2013年 - - - + + + 2014年 - - - + + + 2015年 - - - + + + 2016年 - - - + + + 2017年 - - - + + + 2018年 - - - + + + 2019年 - - - + + + 2020年 - - - + + + 2021年 - - - + + + 2022年 - - - + + + 2023年 - - - + + + 2024年 - - - + + + 2025年 - - - + + + 2026年 - - - + + + 2027年 - - - + + + 2028年 - - - + + + 2029年 - - - + + + 2030年 - - - - - - - - - + + + + 2021年 + + + + + + 1月 - - - + + + 2月 - - - + + + 3月 - - - + + + 4月 - - - + + + 5月 - - - + + + 6月 - - - + + + 7月 - - - + + + 8月 - - - + + + 9月 - - - + + + 10月 - - - + + + 11月 - - - + + + 12月 - - - - - - - + + 9月 + - - - - - - + + + + + + +
`; diff --git a/src/dialog/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/dialog/__test__/__virtualHostSnapshot__/index.test.js.snap index 77099656f..4b12e1fb4 100644 --- a/src/dialog/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/dialog/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,57 +2,41 @@ exports[`dialog :base 1`] = `
- - + - - - - - - - - + class="t-dialog__content t-class-content" + /> - - - + + + +
`; diff --git a/src/divider/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/divider/__test__/__virtualHostSnapshot__/index.test.js.snap index 473ce46af..4fd1b24d2 100644 --- a/src/divider/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/divider/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,21 +2,17 @@ exports[`Divider :base 1`] = `
- - - + class="t-class-content t-divider__content" + /> - +
`; diff --git a/src/footer/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/footer/__test__/__virtualHostSnapshot__/index.test.js.snap index a75d29e0d..663b4673d 100644 --- a/src/footer/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/footer/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,17 +2,15 @@ exports[`Footer :base 1`] = `
-
+ - - - + -
+
`; diff --git a/src/image-viewer/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/image-viewer/__test__/__virtualHostSnapshot__/index.test.js.snap index 66610fc4f..cf5dd0611 100644 --- a/src/image-viewer/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/image-viewer/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -1,196 +1,115 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`image-viewer :base 1`] = ` - - - - - - - - - - + class="t-loading__dot" + style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;" + /> + + + + - + `; exports[`image-viewer :base 2`] = ` - - - - - - - - - - + class="t-loading__dot" + style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;" + /> + + + + - + `; exports[`image-viewer :base 3`] = ` - - - - - - - - - - + class="t-loading__dot" + style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;" + /> + + + + - + `; diff --git a/src/image/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/image/__test__/__virtualHostSnapshot__/index.test.js.snap index 445831548..73c7d73ee 100644 --- a/src/image/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/image/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,72 +2,63 @@ exports[`image :base 1`] = `
- + - - - - - + - + +
`; exports[`image :success 1`] = `
- - +
`; diff --git a/src/input/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/input/__test__/__virtualHostSnapshot__/index.test.js.snap index 3f0a13637..49f56aaa9 100644 --- a/src/input/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/input/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -1,214 +1,194 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`input props : clearable && label && suffix 1`] = ` - + - - - - tdesign - - + tdesign + + + + - - - - - - - - - - 后置内容 - + + + + + 后置内容 + + + - - - - - + - + `; exports[`input slots : label 1`] = ` - + - - + 标签文字 - 标签文字 - - * - + * - + + + + - - - - + class="t-input__wrap--suffix t-class-suffix" + bind:tap="onSuffixClick" + /> + - + `; diff --git a/src/message/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/message/__test__/__virtualHostSnapshot__/index.test.js.snap index 67aa8f6c8..8d7f31dc6 100644 --- a/src/message/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/message/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,98 +2,82 @@ exports[`message props : style && customStyle 1`] = `
- - - - - - + + + - - 这是一条带关闭的消息通知 - + 这是一条带关闭的消息通知 + + - - - - - + - +
`; diff --git a/src/navbar/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/navbar/__test__/__virtualHostSnapshot__/index.test.js.snap index 141416919..42fd5f2c3 100644 --- a/src/navbar/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/navbar/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,175 +2,165 @@ exports[`navbar :base 1`] = `
- + + - - - - + + + - - test - - + test + - +
`; exports[`navbar :base 2`] = `
- + + - - - - + + + - - test - - + test + - +
`; exports[`navbar :base 3`] = `
- + + - - - - + + + - - test - - + test + - +
`; exports[`navbar :fixed 1`] = `
- + + - - - - + + + - - test - - + test + - +
`; exports[`navbar :menu button 1`] = `
- + + - - - - + + + - - test - - + test + - +
`; diff --git a/src/notice-bar/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/notice-bar/__test__/__virtualHostSnapshot__/index.test.js.snap index 7dd7671db..e190e8a3e 100644 --- a/src/notice-bar/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/notice-bar/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,79 +2,69 @@ exports[`notice-bar props : marquee 1`] = `
- - - - - - + + + - - 提示文字描述提示文字描述提示文字描述提示文字描述文 - - + }, + ], + } + }}" + class="t-notice-bar__content t-class-content " + > + 提示文字描述提示文字描述提示文字描述提示文字描述文 + - - + +
`; diff --git a/src/overlay/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/overlay/__test__/__virtualHostSnapshot__/index.test.js.snap index 7a06bb8be..3288499cb 100644 --- a/src/overlay/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/overlay/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,16 +2,14 @@ exports[`overlay :base 1`] = `
- - - +
`; diff --git a/src/picker/__test__/__snapshots__/index.test.js.snap b/src/picker/__test__/__snapshots__/index.test.js.snap index eed6f7843..9020ee1a5 100644 --- a/src/picker/__test__/__snapshots__/index.test.js.snap +++ b/src/picker/__test__/__snapshots__/index.test.js.snap @@ -111,6 +111,7 @@ exports[`picker :base 1`] = ` 2021年 @@ -177,6 +178,7 @@ exports[`picker :base 1`] = ` diff --git a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 7e9ca22d2..3c9b1048c 100644 --- a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -1,176 +1,185 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`picker :base 1`] = ` - - + + ariaRole="button" + class="t-picker__cancel t-class-cancel" + bind:tap="onCancel" + > + + 取消 + + + + + + + + 确认 + + + + - 取消 + + 2021年 + + 2020年 + - 确认 + + 2019年 + - - - - - - 2021年 - - - - - 2020年 - - - - - 2019年 - - - - - - - - - - + 2021年 + + + + + + 春 - - - + + + 夏 - - - + + + 秋 - - - + + + 冬 - - - - - - - + + + + 春 + + + - - - - - + + `; diff --git a/src/search/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/search/__test__/__virtualHostSnapshot__/index.test.js.snap index f3abf4ef5..e48ef901d 100644 --- a/src/search/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/search/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,58 +2,50 @@ exports[`search Props :base 1`] = `
- - - - - - - - - + + + + 提交 - - +
`; diff --git a/src/skeleton/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/skeleton/__test__/__virtualHostSnapshot__/index.test.js.snap index 129491bfe..1ba7501a8 100644 --- a/src/skeleton/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/skeleton/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,162 +2,150 @@ exports[`skeleton Props :inner rowCol 1`] = `
- - - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:24%;height:32rpx;margin-right:32rpx" + /> - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:76%;height:32rpx" + /> + + + - +
`; exports[`skeleton Props :text rowCol 1`] = `
- - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:686rpx;height:32rpx" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="height:16px" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="height:16px" + /> + + + - - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:38rpx;height:32rpx" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:440rpx;height:16px" + /> - +
`; exports[`skeleton Props :text rowCol2 1`] = `
- - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:343px;height:16px" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="height:16px" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="height:16px" + /> + + + - - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:small;height:small" + /> + + - - + class="t-skeleton__col t-skeleton--type-text t-skeleton--animation-none t-class-col" + style="width:220px;height:16px" + /> - +
`; diff --git a/src/stepper/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/stepper/__test__/__virtualHostSnapshot__/index.test.js.snap index 24d454a7f..cd20881f7 100644 --- a/src/stepper/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/stepper/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -12,22 +12,18 @@ exports[`stepper event : input 1`] = ` class="t-stepper__minus t-stepper__minus--normal t-stepper__icon--medium t-class-minus" catch:tap="minusValue" > - - - - - + + - - - - - + + `; @@ -82,22 +74,18 @@ exports[`stepper event : input 2`] = ` class="t-stepper__minus t-stepper__minus--normal t-stepper__icon--medium t-class-minus" catch:tap="minusValue" > - - - - - + + - - - - - + + `; diff --git a/src/switch/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/switch/__test__/__virtualHostSnapshot__/index.test.js.snap index 4f9ce97ac..938cc604e 100644 --- a/src/switch/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/switch/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -2,28 +2,26 @@ exports[`switch Props :base 1`] = `
- + - - + class="t-switch__label t-switch__label--medium t-class-label" + /> - +
`; diff --git a/src/textarea/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/textarea/__test__/__virtualHostSnapshot__/index.test.js.snap index 3e3ba44f9..5da505a7c 100644 --- a/src/textarea/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/textarea/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -1,55 +1,51 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`textarea slots : label 1`] = ` - - - - 标签文字 - - - - - + 标签文字 + + + + - + `; From e06b2d5499d46a54eb893518bf6eb1fb2621334b Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Thu, 2 Mar 2023 20:27:46 +0800 Subject: [PATCH 09/13] feat(picker): aira conten hidden --- src/picker-item/picker-item.less | 2 +- src/picker-item/picker-item.ts | 3 +++ src/picker-item/picker-item.wxml | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/picker-item/picker-item.less b/src/picker-item/picker-item.less index 54bbe063e..cca5dd9e7 100644 --- a/src/picker-item/picker-item.less +++ b/src/picker-item/picker-item.less @@ -42,6 +42,6 @@ &__aria__content { position: absolute; - top: 100%; + bottom: -100%; } } diff --git a/src/picker-item/picker-item.ts b/src/picker-item/picker-item.ts index 14459f53c..2f0e7190c 100644 --- a/src/picker-item/picker-item.ts +++ b/src/picker-item/picker-item.ts @@ -41,6 +41,7 @@ export default class PickerItem extends SuperComponent { duration: 0, // 滚动动画延迟 value: '', curIndex: 0, + isScrolling: false, }; methods = { @@ -63,6 +64,7 @@ export default class PickerItem extends SuperComponent { offset, duration: DefaultDuration, curIndex: index, + isScrolling: true, }); }, @@ -78,6 +80,7 @@ export default class PickerItem extends SuperComponent { this.setData({ curIndex: index, offset: -index * this.itemHeight, + isScrolling: false, }); if (index === this._selectedIndex) { diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index 1e1a00367..5cad0dc96 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -26,5 +26,7 @@ {{option.label}} - {{ options[curIndex].label }} + {{ options[curIndex].label }} From 04d16a1a39b6886b02df044a4b1ef483c76e9fb7 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Fri, 3 Mar 2023 10:16:28 +0800 Subject: [PATCH 10/13] test(picker): update snap --- src/date-time-picker/__test__/__snapshots__/index.test.js.snap | 2 ++ .../__test__/__virtualHostSnapshot__/index.test.js.snap | 2 ++ src/picker/__test__/__snapshots__/index.test.js.snap | 2 ++ src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index fce787c67..f13ac7d17 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -424,6 +424,7 @@ exports[`date-time-picker :base 1`] = ` @@ -582,6 +583,7 @@ exports[`date-time-picker :base 1`] = ` diff --git a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap index f11884db8..6d9aab040 100644 --- a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -407,6 +407,7 @@ exports[`date-time-picker :base 1`] = ` @@ -560,6 +561,7 @@ exports[`date-time-picker :base 1`] = ` diff --git a/src/picker/__test__/__snapshots__/index.test.js.snap b/src/picker/__test__/__snapshots__/index.test.js.snap index 9020ee1a5..aee9c38d8 100644 --- a/src/picker/__test__/__snapshots__/index.test.js.snap +++ b/src/picker/__test__/__snapshots__/index.test.js.snap @@ -110,6 +110,7 @@ exports[`picker :base 1`] = ` @@ -177,6 +178,7 @@ exports[`picker :base 1`] = ` diff --git a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 3c9b1048c..54eb1e096 100644 --- a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -98,6 +98,7 @@ exports[`picker :base 1`] = ` @@ -163,6 +164,7 @@ exports[`picker :base 1`] = ` From 37bdcf3bd97afe73941b6d88c02ec36160006dea Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Mon, 6 Mar 2023 15:24:23 +0800 Subject: [PATCH 11/13] feat(picker): style --- src/picker-item/picker-item.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/picker-item/picker-item.less b/src/picker-item/picker-item.less index cca5dd9e7..76f79cd2c 100644 --- a/src/picker-item/picker-item.less +++ b/src/picker-item/picker-item.less @@ -43,5 +43,9 @@ &__aria__content { position: absolute; bottom: -100%; + opacity: 0; + width: 1px; + height: 1px; + overflow: hidden; } } From 592b6843a9893ece16aff5422172175e9351a4dd Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Mon, 20 Mar 2023 19:43:34 +0800 Subject: [PATCH 12/13] chore(picker): style --- src/picker-item/picker-item.wxml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/picker-item/picker-item.wxml b/src/picker-item/picker-item.wxml index 348a9c497..7f11a5823 100644 --- a/src/picker-item/picker-item.wxml +++ b/src/picker-item/picker-item.wxml @@ -26,7 +26,7 @@ {{option[labelAlias]}} - {{ options[curIndex].label }} + + {{ options[curIndex].label }} + From 0ae0ff7c9d3431f86f02f4824610f85915ec1102 Mon Sep 17 00:00:00 2001 From: zhangpaopao Date: Tue, 21 Mar 2023 10:26:58 +0800 Subject: [PATCH 13/13] chore(picker): update snap --- .../__test__/__snapshots__/index.test.js.snap | 8 ++++++-- .../__test__/__virtualHostSnapshot__/index.test.js.snap | 8 ++++++-- src/picker/__test__/__snapshots__/index.test.js.snap | 8 ++++++-- .../__test__/__virtualHostSnapshot__/index.test.js.snap | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index e4c4af53c..6dca08382 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -424,7 +424,9 @@ exports[`date-time-picker :base 1`] = ` ariaRole="alert" class="t-picker-item__aria__content" > - 2021年 + + 2021年 + @@ -583,7 +585,9 @@ exports[`date-time-picker :base 1`] = ` ariaRole="alert" class="t-picker-item__aria__content" > - 9月 + + 9月 + diff --git a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap index d549d4b71..6029784b4 100644 --- a/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/date-time-picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -407,7 +407,9 @@ exports[`date-time-picker :base 1`] = ` ariaRole="alert" class="t-picker-item__aria__content" > - 2021年 + + 2021年 + - 9月 + + 9月 + - 2021年 + + 2021年 + @@ -178,7 +180,9 @@ exports[`picker :base 1`] = ` ariaRole="alert" class="t-picker-item__aria__content" > - 春 + + 春 + diff --git a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap index 83de856f4..814634c6e 100644 --- a/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap +++ b/src/picker/__test__/__virtualHostSnapshot__/index.test.js.snap @@ -98,7 +98,9 @@ exports[`picker :base 1`] = ` ariaRole="alert" class="t-picker-item__aria__content" > - 2021年 + + 2021年 + - 春 + + 春 +