@tuya-miniapp/smart-ui 2.12.1-beta-5 → 2.12.1-beta-6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/bottom-sheet/index.js +5 -0
  2. package/dist/bottom-sheet/index.wxml +8 -6
  3. package/dist/cascader/index.js +4 -0
  4. package/dist/cascader/index.wxml +2 -0
  5. package/dist/field/cell-input.wxml +8 -1
  6. package/dist/field/index.js +6 -0
  7. package/dist/grid-item/index.js +4 -0
  8. package/dist/grid-item/index.wxml +2 -0
  9. package/dist/icon/index.js +8 -0
  10. package/dist/icon/index.wxml +2 -0
  11. package/dist/nav-bar/index.js +12 -0
  12. package/dist/nav-bar/index.wxml +6 -0
  13. package/dist/notice-bar/index.js +4 -0
  14. package/dist/notice-bar/index.wxml +2 -0
  15. package/dist/popup/index.js +4 -0
  16. package/dist/popup/popup.wxml +2 -0
  17. package/dist/stepper/index.js +8 -0
  18. package/dist/stepper/index.wxml +4 -0
  19. package/dist/tag/index.js +4 -0
  20. package/dist/tag/index.wxml +3 -1
  21. package/lib/bottom-sheet/index.js +5 -0
  22. package/lib/bottom-sheet/index.wxml +8 -6
  23. package/lib/cascader/index.js +4 -0
  24. package/lib/cascader/index.wxml +2 -0
  25. package/lib/field/cell-input.wxml +8 -1
  26. package/lib/field/index.js +6 -0
  27. package/lib/grid-item/index.js +4 -0
  28. package/lib/grid-item/index.wxml +2 -0
  29. package/lib/icon/index.js +8 -0
  30. package/lib/icon/index.wxml +2 -0
  31. package/lib/nav-bar/index.js +12 -0
  32. package/lib/nav-bar/index.wxml +6 -0
  33. package/lib/notice-bar/index.js +4 -0
  34. package/lib/notice-bar/index.wxml +2 -0
  35. package/lib/popup/index.js +4 -0
  36. package/lib/popup/popup.wxml +2 -0
  37. package/lib/stepper/index.js +8 -0
  38. package/lib/stepper/index.wxml +4 -0
  39. package/lib/tag/index.js +4 -0
  40. package/lib/tag/index.wxml +3 -1
  41. package/package.json +1 -1
@@ -21,6 +21,11 @@ SmartComponent({
21
21
  type: Boolean,
22
22
  value: true,
23
23
  },
24
+ /** 关闭图标读屏文案;不传则仅有 button 角色,由业务自行多语言传入 */
25
+ closeIconAriaLabel: {
26
+ type: String,
27
+ value: '',
28
+ },
24
29
  contentHeight: null,
25
30
  round: {
26
31
  type: Boolean,
@@ -51,12 +51,14 @@
51
51
  <block wx:else>
52
52
  <view class="smart-bottom-sheet__header">
53
53
  <view wx:if="{{ title }}">{{ title }}</view>
54
- <smart-icon
55
- wx:if="{{ title && showClose }}"
56
- name="{{ xmarkIcon }}"
57
- class="smart-bottom-sheet__icon"
58
- size="{{ iconSize }}"
59
- color="{{ xmarkIconColor }}"
54
+ <smart-icon
55
+ wx:if="{{ title && showClose }}"
56
+ name="{{ xmarkIcon }}"
57
+ class="smart-bottom-sheet__icon"
58
+ size="{{ iconSize }}"
59
+ color="{{ xmarkIconColor }}"
60
+ ariaRole="button"
61
+ ariaLabel="{{ closeIconAriaLabel }}"
60
62
  bind:click="onClose"
61
63
  />
62
64
  <slot name="title" />
@@ -42,6 +42,10 @@ SmartComponent({
42
42
  type: String,
43
43
  value: closeIcon,
44
44
  },
45
+ closeIconAriaLabel: {
46
+ type: String,
47
+ value: '',
48
+ },
45
49
  useTitleSlot: Boolean,
46
50
  },
47
51
  data: {
@@ -6,7 +6,9 @@
6
6
  <smart-icon
7
7
  wx:if="{{ closeable }}"
8
8
  name="{{ closeIcon }}"
9
+ aria-role="button"
9
10
  class="smart-cascader__close-icon"
11
+ aria-label="{{ closeIconAriaLabel }}"
10
12
  bind:tap="onClose"
11
13
  />
12
14
  </view>
@@ -36,9 +36,16 @@
36
36
  wx:if="{{ showClear }}"
37
37
  name="{{ clearIcon }}"
38
38
  class="smart-field__clear-root smart-field__icon-root"
39
+ aria-label="{{ clearIconAriaLabel }}"
40
+ aria-role="button"
39
41
  catch:touchstart="onClear"
40
42
  />
41
- <view class="smart-field__icon-container" bind:tap="onClickIcon">
43
+ <view
44
+ class="smart-field__icon-container"
45
+ bind:tap="onClickIcon"
46
+ aria-role="button"
47
+ aria-label="{{ rightIconButtonAriaLabel }}"
48
+ >
42
49
  <smart-icon
43
50
  wx:if="{{ rightIcon || icon }}"
44
51
  name="{{ rightIcon || icon }}"
@@ -36,6 +36,12 @@ SmartComponent({
36
36
  }, locale: {
37
37
  type: String,
38
38
  value: '',
39
+ }, clearIconAriaLabel: {
40
+ type: String,
41
+ value: '',
42
+ }, rightIconButtonAriaLabel: {
43
+ type: String,
44
+ value: '',
39
45
  } }),
40
46
  data: {
41
47
  focused: false,
@@ -17,6 +17,10 @@ SmartComponent({
17
17
  badge: null,
18
18
  text: String,
19
19
  useSlot: Boolean,
20
+ ariaLabel: {
21
+ type: String,
22
+ value: '',
23
+ },
20
24
  },
21
25
  data: {
22
26
  viewStyle: '',
@@ -4,6 +4,8 @@
4
4
  <view
5
5
  class="custom-class {{ utils.bem('grid-item', { square }) }}"
6
6
  style="{{ computed.wrapperStyle({ square, gutter, columnNum, index }) }}"
7
+ aria-role="button"
8
+ aria-label="{{ ariaLabel }}"
7
9
  bindtap="onClick"
8
10
  >
9
11
  <view
@@ -12,6 +12,14 @@ SmartComponent({
12
12
  value: 'smart-icon',
13
13
  },
14
14
  name: String,
15
+ ariaLabel: {
16
+ type: String,
17
+ value: '',
18
+ },
19
+ ariaRole: {
20
+ type: String,
21
+ value: '',
22
+ },
15
23
  },
16
24
  methods: {
17
25
  onClick(event) {
@@ -4,6 +4,8 @@
4
4
  class="{{ computed.rootClass({ classPrefix, name }) }}"
5
5
  style="{{ computed.rootStyle({ customStyle, color, size }) }}"
6
6
  bindtap="onClick"
7
+ aria-role="{{ ariaRole }}"
8
+ aria-label="{{ ariaLabel }}"
7
9
  >
8
10
  <smart-info
9
11
  wx:if="{{ info !== null || dot }}"
@@ -54,6 +54,18 @@ SmartComponent({
54
54
  type: Boolean,
55
55
  value: true,
56
56
  },
57
+ leftArrowAriaLabel: {
58
+ type: String,
59
+ value: '',
60
+ },
61
+ leftIconAriaLabel: {
62
+ type: String,
63
+ value: '',
64
+ },
65
+ rightIconAriaLabel: {
66
+ type: String,
67
+ value: '',
68
+ },
57
69
  },
58
70
  data: {
59
71
  leftArrowIcon: Left,
@@ -19,6 +19,8 @@
19
19
  hover-stay-time="70"
20
20
  name="{{ leftArrowIcon }}"
21
21
  data-type="leftArrow"
22
+ aria-role="button"
23
+ aria-label="{{ leftArrowAriaLabel }}"
22
24
  custom-class="smart-nav-bar__arrow"
23
25
  />
24
26
  <view
@@ -28,6 +30,8 @@
28
30
  hover-stay-time="70"
29
31
  class="smart-nav-bar__icon-wrap"
30
32
  catch:tap="onClickLeftIcon"
33
+ aria-role="button"
34
+ aria-label="{{ leftIconAriaLabel }}"
31
35
  >
32
36
  <smart-icon
33
37
  class="left-icon-class"
@@ -60,6 +64,8 @@
60
64
  hover-stay-time="70"
61
65
  class="smart-nav-bar__icon-wrap"
62
66
  bind:tap="onClickRightIcon"
67
+ aria-role="button"
68
+ aria-label="{{ rightIconAriaLabel }}"
63
69
  >
64
70
  <smart-icon class="right-icon-class" custom-class="smart-nav-bar__icon" size="{{ rightIconSize }}" name="{{ rightIcon }}" color="{{ rightIconColor }}" />
65
71
  </view>
@@ -47,6 +47,10 @@ SmartComponent({
47
47
  type: Number,
48
48
  value: 1,
49
49
  },
50
+ closeIconAriaLabel: {
51
+ type: String,
52
+ value: '',
53
+ },
50
54
  customStyle: {
51
55
  type: String,
52
56
  value: '',
@@ -39,6 +39,8 @@
39
39
  name="{{ Xmark }}"
40
40
  style="{{ computed.rootStyle(rightIconStyle) }}"
41
41
  color=" {{ rightIconColor }} "
42
+ aria-role="button"
43
+ aria-label="{{ closeIconAriaLabel }}"
42
44
  catch:tap="onClickIcon"
43
45
  />
44
46
  <smart-icon
@@ -34,6 +34,10 @@ SmartComponent({
34
34
  type: String,
35
35
  value: closeIcon,
36
36
  },
37
+ closeIconAriaLabel: {
38
+ type: String,
39
+ value: '',
40
+ },
37
41
  closeIconPosition: {
38
42
  type: String,
39
43
  value: 'top-right',
@@ -11,6 +11,8 @@
11
11
  wx:if="{{ closeable }}"
12
12
  name="{{ closeIcon }}"
13
13
  class="close-icon-class smart-popup__close-icon smart-popup__close-icon--{{ closeIconPosition }}"
14
+ aria-role="button"
15
+ aria-label="{{ closeIconAriaLabel }}"
14
16
  bind:tap="onClickCloseIcon"
15
17
  />
16
18
  </view>
@@ -64,6 +64,14 @@ SmartComponent({
64
64
  },
65
65
  theme: String,
66
66
  alwaysEmbed: Boolean,
67
+ minusAriaLabel: {
68
+ type: String,
69
+ value: '',
70
+ },
71
+ plusAriaLabel: {
72
+ type: String,
73
+ value: '',
74
+ },
67
75
  },
68
76
  data: {
69
77
  currentValue: '',
@@ -9,6 +9,8 @@
9
9
  class="minus-class {{ utils.bem('stepper__minus', { disabled: computed.checkMin({ min, currentValue, disabled, disableMinus }) }) }}"
10
10
  hover-class="smart-stepper__minus--hover"
11
11
  hover-stay-time="70"
12
+ aria-role="button"
13
+ aria-label="{{ minusAriaLabel }}"
12
14
  bind:tap="onTap"
13
15
  bind:touchstart="onTouchStart"
14
16
  bind:touchend="onTouchEnd"
@@ -34,6 +36,8 @@
34
36
  class="plus-class {{ utils.bem('stepper__plus', { disabled: computed.checkMax({ max, currentValue, disabled, disablePlus }) }) }}"
35
37
  hover-class="smart-stepper__plus--hover"
36
38
  hover-stay-time="70"
39
+ aria-role="button"
40
+ aria-label="{{ plusAriaLabel }}"
37
41
  bind:tap="onTap"
38
42
  bind:touchstart="onTouchStart"
39
43
  bind:touchend="onTouchEnd"
package/dist/tag/index.js CHANGED
@@ -16,6 +16,10 @@ SmartComponent({
16
16
  value: 'default',
17
17
  },
18
18
  closeable: Boolean,
19
+ closeIconAriaLabel: {
20
+ type: String,
21
+ value: '',
22
+ },
19
23
  },
20
24
  data: {
21
25
  crossIcon: Xmark,
@@ -10,8 +10,10 @@
10
10
  wx:if="{{ closeable }}"
11
11
  name="{{crossIcon}}"
12
12
  custom-class="smart-tag__close"
13
+ ariaRole="button"
14
+ ariaLabel="{{ closeIconAriaLabel }}"
13
15
  bind:click="onClose"
14
16
  color="{{textColor || closeColor}}"
15
- />
17
+ />
16
18
 
17
19
  </view>
@@ -26,6 +26,11 @@ var idListRef = {
26
26
  type: Boolean,
27
27
  value: true,
28
28
  },
29
+ /** 关闭图标读屏文案;不传则仅有 button 角色,由业务自行多语言传入 */
30
+ closeIconAriaLabel: {
31
+ type: String,
32
+ value: '',
33
+ },
29
34
  contentHeight: null,
30
35
  round: {
31
36
  type: Boolean,
@@ -51,12 +51,14 @@
51
51
  <block wx:else>
52
52
  <view class="smart-bottom-sheet__header">
53
53
  <view wx:if="{{ title }}">{{ title }}</view>
54
- <smart-icon
55
- wx:if="{{ title && showClose }}"
56
- name="{{ xmarkIcon }}"
57
- class="smart-bottom-sheet__icon"
58
- size="{{ iconSize }}"
59
- color="{{ xmarkIconColor }}"
54
+ <smart-icon
55
+ wx:if="{{ title && showClose }}"
56
+ name="{{ xmarkIcon }}"
57
+ class="smart-bottom-sheet__icon"
58
+ size="{{ iconSize }}"
59
+ color="{{ xmarkIconColor }}"
60
+ ariaRole="button"
61
+ ariaLabel="{{ closeIconAriaLabel }}"
60
62
  bind:click="onClose"
61
63
  />
62
64
  <slot name="title" />
@@ -56,6 +56,10 @@ var Xmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Xmark"));
56
56
  type: String,
57
57
  value: Xmark_1.default,
58
58
  },
59
+ closeIconAriaLabel: {
60
+ type: String,
61
+ value: '',
62
+ },
59
63
  useTitleSlot: Boolean,
60
64
  },
61
65
  data: {
@@ -6,7 +6,9 @@
6
6
  <smart-icon
7
7
  wx:if="{{ closeable }}"
8
8
  name="{{ closeIcon }}"
9
+ aria-role="button"
9
10
  class="smart-cascader__close-icon"
11
+ aria-label="{{ closeIconAriaLabel }}"
10
12
  bind:tap="onClose"
11
13
  />
12
14
  </view>
@@ -36,9 +36,16 @@
36
36
  wx:if="{{ showClear }}"
37
37
  name="{{ clearIcon }}"
38
38
  class="smart-field__clear-root smart-field__icon-root"
39
+ aria-label="{{ clearIconAriaLabel }}"
40
+ aria-role="button"
39
41
  catch:touchstart="onClear"
40
42
  />
41
- <view class="smart-field__icon-container" bind:tap="onClickIcon">
43
+ <view
44
+ class="smart-field__icon-container"
45
+ bind:tap="onClickIcon"
46
+ aria-role="button"
47
+ aria-label="{{ rightIconButtonAriaLabel }}"
48
+ >
42
49
  <smart-icon
43
50
  wx:if="{{ rightIcon || icon }}"
44
51
  name="{{ rightIcon || icon }}"
@@ -52,6 +52,12 @@ var numberFormat_1 = require("./numberFormat");
52
52
  }, locale: {
53
53
  type: String,
54
54
  value: '',
55
+ }, clearIconAriaLabel: {
56
+ type: String,
57
+ value: '',
58
+ }, rightIconButtonAriaLabel: {
59
+ type: String,
60
+ value: '',
55
61
  } }),
56
62
  data: {
57
63
  focused: false,
@@ -19,6 +19,10 @@ var link_1 = require("../mixins/link");
19
19
  badge: null,
20
20
  text: String,
21
21
  useSlot: Boolean,
22
+ ariaLabel: {
23
+ type: String,
24
+ value: '',
25
+ },
22
26
  },
23
27
  data: {
24
28
  viewStyle: '',
@@ -4,6 +4,8 @@
4
4
  <view
5
5
  class="custom-class {{ utils.bem('grid-item', { square }) }}"
6
6
  style="{{ computed.wrapperStyle({ square, gutter, columnNum, index }) }}"
7
+ aria-role="button"
8
+ aria-label="{{ ariaLabel }}"
7
9
  bindtap="onClick"
8
10
  >
9
11
  <view
package/lib/icon/index.js CHANGED
@@ -14,6 +14,14 @@ var component_1 = require("../common/component");
14
14
  value: 'smart-icon',
15
15
  },
16
16
  name: String,
17
+ ariaLabel: {
18
+ type: String,
19
+ value: '',
20
+ },
21
+ ariaRole: {
22
+ type: String,
23
+ value: '',
24
+ },
17
25
  },
18
26
  methods: {
19
27
  onClick: function (event) {
@@ -4,6 +4,8 @@
4
4
  class="{{ computed.rootClass({ classPrefix, name }) }}"
5
5
  style="{{ computed.rootStyle({ customStyle, color, size }) }}"
6
6
  bindtap="onClick"
7
+ aria-role="{{ ariaRole }}"
8
+ aria-label="{{ ariaLabel }}"
7
9
  >
8
10
  <smart-info
9
11
  wx:if="{{ info !== null || dot }}"
@@ -59,6 +59,18 @@ var component_1 = require("../common/component");
59
59
  type: Boolean,
60
60
  value: true,
61
61
  },
62
+ leftArrowAriaLabel: {
63
+ type: String,
64
+ value: '',
65
+ },
66
+ leftIconAriaLabel: {
67
+ type: String,
68
+ value: '',
69
+ },
70
+ rightIconAriaLabel: {
71
+ type: String,
72
+ value: '',
73
+ },
62
74
  },
63
75
  data: {
64
76
  leftArrowIcon: Left_1.default,
@@ -19,6 +19,8 @@
19
19
  hover-stay-time="70"
20
20
  name="{{ leftArrowIcon }}"
21
21
  data-type="leftArrow"
22
+ aria-role="button"
23
+ aria-label="{{ leftArrowAriaLabel }}"
22
24
  custom-class="smart-nav-bar__arrow"
23
25
  />
24
26
  <view
@@ -28,6 +30,8 @@
28
30
  hover-stay-time="70"
29
31
  class="smart-nav-bar__icon-wrap"
30
32
  catch:tap="onClickLeftIcon"
33
+ aria-role="button"
34
+ aria-label="{{ leftIconAriaLabel }}"
31
35
  >
32
36
  <smart-icon
33
37
  class="left-icon-class"
@@ -60,6 +64,8 @@
60
64
  hover-stay-time="70"
61
65
  class="smart-nav-bar__icon-wrap"
62
66
  bind:tap="onClickRightIcon"
67
+ aria-role="button"
68
+ aria-label="{{ rightIconAriaLabel }}"
63
69
  >
64
70
  <smart-icon class="right-icon-class" custom-class="smart-nav-bar__icon" size="{{ rightIconSize }}" name="{{ rightIcon }}" color="{{ rightIconColor }}" />
65
71
  </view>
@@ -52,6 +52,10 @@ var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
52
52
  type: Number,
53
53
  value: 1,
54
54
  },
55
+ closeIconAriaLabel: {
56
+ type: String,
57
+ value: '',
58
+ },
55
59
  customStyle: {
56
60
  type: String,
57
61
  value: '',
@@ -39,6 +39,8 @@
39
39
  name="{{ Xmark }}"
40
40
  style="{{ computed.rootStyle(rightIconStyle) }}"
41
41
  color=" {{ rightIconColor }} "
42
+ aria-role="button"
43
+ aria-label="{{ closeIconAriaLabel }}"
42
44
  catch:tap="onClickIcon"
43
45
  />
44
46
  <smart-icon
@@ -39,6 +39,10 @@ var utils_1 = require("../common/utils");
39
39
  type: String,
40
40
  value: Xmark_1.default,
41
41
  },
42
+ closeIconAriaLabel: {
43
+ type: String,
44
+ value: '',
45
+ },
42
46
  closeIconPosition: {
43
47
  type: String,
44
48
  value: 'top-right',
@@ -11,6 +11,8 @@
11
11
  wx:if="{{ closeable }}"
12
12
  name="{{ closeIcon }}"
13
13
  class="close-icon-class smart-popup__close-icon smart-popup__close-icon--{{ closeIconPosition }}"
14
+ aria-role="button"
15
+ aria-label="{{ closeIconAriaLabel }}"
14
16
  bind:tap="onClickCloseIcon"
15
17
  />
16
18
  </view>
@@ -80,6 +80,14 @@ function equal(value1, value2) {
80
80
  },
81
81
  theme: String,
82
82
  alwaysEmbed: Boolean,
83
+ minusAriaLabel: {
84
+ type: String,
85
+ value: '',
86
+ },
87
+ plusAriaLabel: {
88
+ type: String,
89
+ value: '',
90
+ },
83
91
  },
84
92
  data: {
85
93
  currentValue: '',
@@ -9,6 +9,8 @@
9
9
  class="minus-class {{ utils.bem('stepper__minus', { disabled: computed.checkMin({ min, currentValue, disabled, disableMinus }) }) }}"
10
10
  hover-class="smart-stepper__minus--hover"
11
11
  hover-stay-time="70"
12
+ aria-role="button"
13
+ aria-label="{{ minusAriaLabel }}"
12
14
  bind:tap="onTap"
13
15
  bind:touchstart="onTouchStart"
14
16
  bind:touchend="onTouchEnd"
@@ -34,6 +36,8 @@
34
36
  class="plus-class {{ utils.bem('stepper__plus', { disabled: computed.checkMax({ max, currentValue, disabled, disablePlus }) }) }}"
35
37
  hover-class="smart-stepper__plus--hover"
36
38
  hover-stay-time="70"
39
+ aria-role="button"
40
+ aria-label="{{ plusAriaLabel }}"
37
41
  bind:tap="onTap"
38
42
  bind:touchstart="onTouchStart"
39
43
  bind:touchend="onTouchEnd"
package/lib/tag/index.js CHANGED
@@ -21,6 +21,10 @@ var component_1 = require("../common/component");
21
21
  value: 'default',
22
22
  },
23
23
  closeable: Boolean,
24
+ closeIconAriaLabel: {
25
+ type: String,
26
+ value: '',
27
+ },
24
28
  },
25
29
  data: {
26
30
  crossIcon: Xmark_1.default,
@@ -10,8 +10,10 @@
10
10
  wx:if="{{ closeable }}"
11
11
  name="{{crossIcon}}"
12
12
  custom-class="smart-tag__close"
13
+ ariaRole="button"
14
+ ariaLabel="{{ closeIconAriaLabel }}"
13
15
  bind:click="onClose"
14
16
  color="{{textColor || closeColor}}"
15
- />
17
+ />
16
18
 
17
19
  </view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.12.1-beta-5",
3
+ "version": "2.12.1-beta-6",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",