antd-mobile 5.17.1 → 5.19.0

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 (219) hide show
  1. package/2x/bundle/antd-mobile.cjs.js +47 -19173
  2. package/2x/bundle/antd-mobile.compatible.umd.js +25752 -0
  3. package/2x/bundle/antd-mobile.es.js +16416 -17055
  4. package/2x/bundle/antd-mobile.umd.js +64 -0
  5. package/2x/bundle/style.css +240 -277
  6. package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
  7. package/2x/cjs/components/button/button.js +1 -1
  8. package/2x/cjs/components/calendar/calendar.d.ts +3 -3
  9. package/2x/cjs/components/calendar/index.d.ts +1 -1
  10. package/2x/cjs/components/cascader/cascader.d.ts +2 -0
  11. package/2x/cjs/components/cascader/index.d.ts +1 -0
  12. package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
  13. package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
  14. package/2x/cjs/components/dialog/show.d.ts +1 -1
  15. package/2x/cjs/components/floating-panel/floating-panel.css +4 -4
  16. package/2x/cjs/components/form/form-item.js +6 -4
  17. package/2x/cjs/components/image-viewer/slide.js +75 -56
  18. package/2x/cjs/components/input/input.js +9 -2
  19. package/2x/cjs/components/modal/show.d.ts +1 -1
  20. package/2x/cjs/components/notice-bar/notice-bar.css +9 -0
  21. package/2x/cjs/components/notice-bar/notice-bar.js +5 -3
  22. package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
  23. package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
  24. package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
  25. package/2x/cjs/components/passcode-input/index.d.ts +1 -1
  26. package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
  27. package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
  28. package/2x/cjs/components/picker-view/wheel.js +1 -1
  29. package/2x/cjs/components/rate/rate.js +7 -2
  30. package/2x/cjs/components/rate/star.js +0 -10
  31. package/2x/cjs/components/result/result.d.ts +1 -1
  32. package/2x/cjs/components/result/result.js +7 -1
  33. package/2x/cjs/components/search-bar/search-bar.js +12 -2
  34. package/2x/cjs/components/switch/switch.d.ts +2 -1
  35. package/2x/cjs/components/switch/switch.js +16 -3
  36. package/2x/cjs/components/text-area/text-area.js +1 -0
  37. package/2x/cjs/locales/base.d.ts +9 -0
  38. package/2x/cjs/locales/base.js +9 -0
  39. package/2x/cjs/locales/en-US.d.ts +9 -0
  40. package/2x/cjs/locales/es-ES.d.ts +9 -0
  41. package/2x/cjs/locales/fa-IR.d.ts +9 -0
  42. package/2x/cjs/locales/fr-FR.d.ts +9 -0
  43. package/2x/cjs/locales/id-ID.d.ts +9 -0
  44. package/2x/cjs/locales/kk-KZ.d.ts +9 -0
  45. package/2x/cjs/locales/ko-KR.d.ts +9 -0
  46. package/2x/cjs/locales/zh-CN.d.ts +9 -0
  47. package/2x/cjs/locales/zh-CN.js +9 -0
  48. package/2x/cjs/locales/zh-HK.d.ts +9 -0
  49. package/2x/cjs/locales/zh-TW.d.ts +9 -0
  50. package/2x/cjs/utils/matrix.d.ts +10 -0
  51. package/2x/cjs/utils/matrix.js +60 -0
  52. package/2x/cjs/utils/merge-locale.d.ts +1 -1
  53. package/2x/cjs/utils/merge-locale.js +15 -5
  54. package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  55. package/2x/cjs/utils/use-props-value.js +1 -1
  56. package/2x/cjs/utils/with-default-props.js +2 -6
  57. package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
  58. package/2x/es/components/button/button.js +1 -1
  59. package/2x/es/components/calendar/calendar.d.ts +3 -3
  60. package/2x/es/components/calendar/index.d.ts +1 -1
  61. package/2x/es/components/cascader/cascader.d.ts +2 -0
  62. package/2x/es/components/cascader/index.d.ts +1 -0
  63. package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
  64. package/2x/es/components/cascader-view/cascader-view.js +2 -1
  65. package/2x/es/components/dialog/show.d.ts +1 -1
  66. package/2x/es/components/floating-panel/floating-panel.css +4 -4
  67. package/2x/es/components/form/form-item.js +5 -4
  68. package/2x/es/components/image-viewer/slide.js +73 -56
  69. package/2x/es/components/input/input.js +8 -2
  70. package/2x/es/components/modal/show.d.ts +1 -1
  71. package/2x/es/components/notice-bar/notice-bar.css +9 -0
  72. package/2x/es/components/notice-bar/notice-bar.js +5 -3
  73. package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
  74. package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
  75. package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
  76. package/2x/es/components/passcode-input/index.d.ts +1 -1
  77. package/2x/es/components/passcode-input/passcode-input.css +12 -12
  78. package/2x/es/components/passcode-input/passcode-input.js +15 -8
  79. package/2x/es/components/picker-view/wheel.js +1 -1
  80. package/2x/es/components/rate/rate.js +7 -2
  81. package/2x/es/components/rate/star.js +0 -10
  82. package/2x/es/components/result/result.d.ts +1 -1
  83. package/2x/es/components/result/result.js +6 -1
  84. package/2x/es/components/search-bar/search-bar.js +12 -2
  85. package/2x/es/components/switch/switch.d.ts +2 -1
  86. package/2x/es/components/switch/switch.js +15 -3
  87. package/2x/es/components/text-area/text-area.js +1 -0
  88. package/2x/es/locales/base.d.ts +9 -0
  89. package/2x/es/locales/base.js +9 -0
  90. package/2x/es/locales/en-US.d.ts +9 -0
  91. package/2x/es/locales/es-ES.d.ts +9 -0
  92. package/2x/es/locales/fa-IR.d.ts +9 -0
  93. package/2x/es/locales/fr-FR.d.ts +9 -0
  94. package/2x/es/locales/id-ID.d.ts +9 -0
  95. package/2x/es/locales/kk-KZ.d.ts +9 -0
  96. package/2x/es/locales/ko-KR.d.ts +9 -0
  97. package/2x/es/locales/zh-CN.d.ts +9 -0
  98. package/2x/es/locales/zh-CN.js +9 -0
  99. package/2x/es/locales/zh-HK.d.ts +9 -0
  100. package/2x/es/locales/zh-TW.d.ts +9 -0
  101. package/2x/es/utils/matrix.d.ts +10 -0
  102. package/2x/es/utils/matrix.js +27 -0
  103. package/2x/es/utils/merge-locale.d.ts +1 -1
  104. package/2x/es/utils/merge-locale.js +17 -3
  105. package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
  106. package/2x/es/utils/use-props-value.js +1 -1
  107. package/2x/es/utils/with-default-props.js +2 -4
  108. package/2x/package.json +4 -4
  109. package/2x/umd/antd-mobile.js +25752 -2
  110. package/bundle/antd-mobile.cjs.js +47 -19173
  111. package/bundle/antd-mobile.compatible.umd.js +25752 -0
  112. package/bundle/antd-mobile.es.js +16416 -17055
  113. package/bundle/antd-mobile.umd.js +64 -0
  114. package/bundle/style.css +1 -4080
  115. package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
  116. package/cjs/components/button/button.js +1 -1
  117. package/cjs/components/calendar/calendar.d.ts +3 -3
  118. package/cjs/components/calendar/index.d.ts +1 -1
  119. package/cjs/components/cascader/cascader.d.ts +2 -0
  120. package/cjs/components/cascader/index.d.ts +1 -0
  121. package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
  122. package/cjs/components/cascader-view/cascader-view.js +2 -1
  123. package/cjs/components/dialog/show.d.ts +1 -1
  124. package/cjs/components/floating-panel/floating-panel.css +4 -4
  125. package/cjs/components/form/form-item.js +6 -4
  126. package/cjs/components/image-viewer/slide.js +75 -56
  127. package/cjs/components/input/input.js +9 -2
  128. package/cjs/components/modal/show.d.ts +1 -1
  129. package/cjs/components/notice-bar/notice-bar.css +8 -0
  130. package/cjs/components/notice-bar/notice-bar.js +5 -3
  131. package/cjs/components/number-keyboard/number-keyboard.css +11 -14
  132. package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
  133. package/cjs/components/number-keyboard/number-keyboard.js +19 -17
  134. package/cjs/components/passcode-input/index.d.ts +1 -1
  135. package/cjs/components/passcode-input/passcode-input.css +12 -12
  136. package/cjs/components/passcode-input/passcode-input.js +16 -8
  137. package/cjs/components/picker-view/wheel.js +1 -1
  138. package/cjs/components/rate/rate.js +7 -2
  139. package/cjs/components/rate/star.js +0 -10
  140. package/cjs/components/result/result.d.ts +1 -1
  141. package/cjs/components/result/result.js +7 -1
  142. package/cjs/components/search-bar/search-bar.js +12 -2
  143. package/cjs/components/switch/switch.d.ts +2 -1
  144. package/cjs/components/switch/switch.js +16 -3
  145. package/cjs/components/text-area/text-area.js +1 -0
  146. package/cjs/locales/base.d.ts +9 -0
  147. package/cjs/locales/base.js +9 -0
  148. package/cjs/locales/en-US.d.ts +9 -0
  149. package/cjs/locales/es-ES.d.ts +9 -0
  150. package/cjs/locales/fa-IR.d.ts +9 -0
  151. package/cjs/locales/fr-FR.d.ts +9 -0
  152. package/cjs/locales/id-ID.d.ts +9 -0
  153. package/cjs/locales/kk-KZ.d.ts +9 -0
  154. package/cjs/locales/ko-KR.d.ts +9 -0
  155. package/cjs/locales/zh-CN.d.ts +9 -0
  156. package/cjs/locales/zh-CN.js +9 -0
  157. package/cjs/locales/zh-HK.d.ts +9 -0
  158. package/cjs/locales/zh-TW.d.ts +9 -0
  159. package/cjs/utils/matrix.d.ts +10 -0
  160. package/cjs/utils/matrix.js +60 -0
  161. package/cjs/utils/merge-locale.d.ts +1 -1
  162. package/cjs/utils/merge-locale.js +15 -5
  163. package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  164. package/cjs/utils/use-props-value.js +1 -1
  165. package/cjs/utils/with-default-props.js +2 -6
  166. package/es/components/action-sheet/action-sheet.d.ts +1 -1
  167. package/es/components/button/button.js +1 -1
  168. package/es/components/calendar/calendar.d.ts +3 -3
  169. package/es/components/calendar/index.d.ts +1 -1
  170. package/es/components/cascader/cascader.d.ts +2 -0
  171. package/es/components/cascader/index.d.ts +1 -0
  172. package/es/components/cascader-view/cascader-view.d.ts +2 -1
  173. package/es/components/cascader-view/cascader-view.js +2 -1
  174. package/es/components/dialog/show.d.ts +1 -1
  175. package/es/components/floating-panel/floating-panel.css +4 -4
  176. package/es/components/form/form-item.js +5 -4
  177. package/es/components/image-viewer/slide.js +73 -56
  178. package/es/components/input/input.js +8 -2
  179. package/es/components/modal/show.d.ts +1 -1
  180. package/es/components/notice-bar/notice-bar.css +8 -0
  181. package/es/components/notice-bar/notice-bar.js +5 -3
  182. package/es/components/number-keyboard/number-keyboard.css +11 -14
  183. package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
  184. package/es/components/number-keyboard/number-keyboard.js +19 -17
  185. package/es/components/passcode-input/index.d.ts +1 -1
  186. package/es/components/passcode-input/passcode-input.css +12 -12
  187. package/es/components/passcode-input/passcode-input.js +15 -8
  188. package/es/components/picker-view/wheel.js +1 -1
  189. package/es/components/rate/rate.js +7 -2
  190. package/es/components/rate/star.js +0 -10
  191. package/es/components/result/result.d.ts +1 -1
  192. package/es/components/result/result.js +6 -1
  193. package/es/components/search-bar/search-bar.js +12 -2
  194. package/es/components/switch/switch.d.ts +2 -1
  195. package/es/components/switch/switch.js +15 -3
  196. package/es/components/text-area/text-area.js +1 -0
  197. package/es/locales/base.d.ts +9 -0
  198. package/es/locales/base.js +9 -0
  199. package/es/locales/en-US.d.ts +9 -0
  200. package/es/locales/es-ES.d.ts +9 -0
  201. package/es/locales/fa-IR.d.ts +9 -0
  202. package/es/locales/fr-FR.d.ts +9 -0
  203. package/es/locales/id-ID.d.ts +9 -0
  204. package/es/locales/kk-KZ.d.ts +9 -0
  205. package/es/locales/ko-KR.d.ts +9 -0
  206. package/es/locales/zh-CN.d.ts +9 -0
  207. package/es/locales/zh-CN.js +9 -0
  208. package/es/locales/zh-HK.d.ts +9 -0
  209. package/es/locales/zh-TW.d.ts +9 -0
  210. package/es/utils/matrix.d.ts +10 -0
  211. package/es/utils/matrix.js +27 -0
  212. package/es/utils/merge-locale.d.ts +1 -1
  213. package/es/utils/merge-locale.js +17 -3
  214. package/es/utils/use-drag-and-pinch.d.ts +1 -1
  215. package/es/utils/use-props-value.js +1 -1
  216. package/es/utils/with-default-props.js +2 -4
  217. package/package.json +4 -4
  218. package/umd/antd-mobile.js +1 -1
  219. package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
@@ -57,13 +57,18 @@ const NumberKeyboard = p => {
57
57
  const keys = (0, _react.useMemo)(() => {
58
58
  const defaultKeys = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
59
59
  const keyList = randomOrder ? (0, _shuffle.shuffle)(defaultKeys) : defaultKeys;
60
+ const customKeys = Array.isArray(customKey) ? customKey : [customKey];
60
61
  keyList.push('0');
61
62
 
62
63
  if (confirmText) {
63
- keyList.push(customKey || '');
64
+ if (customKeys.length === 2) {
65
+ keyList.splice(9, 0, customKeys.pop());
66
+ }
67
+
68
+ keyList.push(customKeys[0] || '');
64
69
  } else {
65
- keyList.splice(9, 0, customKey || '');
66
- keyList.push('BACKSPACE');
70
+ keyList.splice(9, 0, customKeys[0] || '');
71
+ keyList.push(customKeys[1] || 'BACKSPACE');
67
72
  }
68
73
 
69
74
  return keyList;
@@ -86,8 +91,7 @@ const NumberKeyboard = p => {
86
91
  const onBackspacePressEnd = () => {
87
92
  clearTimeout(timeoutRef.current);
88
93
  clearInterval(intervalRef.current);
89
- }; // 点击键盘按键
90
-
94
+ };
91
95
 
92
96
  const onKeyPress = (e, key) => {
93
97
  var _a, _b;
@@ -109,18 +113,17 @@ const NumberKeyboard = p => {
109
113
  break;
110
114
 
111
115
  default:
112
- // customKey 不存在时,点击该键不应该触发 onInput
116
+ // onInput should't be called when customKey doesn't exist
113
117
  if (key !== '') onInput === null || onInput === void 0 ? void 0 : onInput(key);
114
118
  break;
115
119
  }
116
- }; // 渲染 title 和 close button
117
-
120
+ };
118
121
 
119
122
  const renderHeader = () => {
120
123
  if (!showCloseButton && !title) return null;
121
124
  return _react.default.createElement("div", {
122
125
  className: (0, _classnames.default)(`${classPrefix}-header`, {
123
- 'with-title': !!title
126
+ [`${classPrefix}-header-with-title`]: !!title
124
127
  })
125
128
  }, title && _react.default.createElement("div", {
126
129
  className: `${classPrefix}-title`
@@ -134,15 +137,14 @@ const NumberKeyboard = p => {
134
137
  role: 'button',
135
138
  title: 'CLOSE'
136
139
  }, _react.default.createElement(_antdMobileIcons.DownOutline, null)));
137
- }; // 渲染基础键盘按键
138
-
140
+ };
139
141
 
140
142
  const renderKey = (key, index) => {
141
143
  const isNumberKey = /^\d$/.test(key);
142
144
  const className = (0, _classnames.default)(`${classPrefix}-key`, {
143
- 'number-key': isNumberKey,
144
- 'sign-key': !isNumberKey && key,
145
- 'mid-key': index === 9 && !!confirmText
145
+ [`${classPrefix}-key-number`]: isNumberKey,
146
+ [`${classPrefix}-key-sign`]: !isNumberKey && key,
147
+ [`${classPrefix}-key-mid`]: index === 9 && !!confirmText && keys.length < 12
146
148
  });
147
149
  const ariaProps = key ? {
148
150
  role: 'button',
@@ -186,12 +188,12 @@ const NumberKeyboard = p => {
186
188
  className: `${classPrefix}-wrapper`
187
189
  }, _react.default.createElement("div", {
188
190
  className: (0, _classnames.default)(`${classPrefix}-main`, {
189
- 'confirmed-style': !!confirmText
191
+ [`${classPrefix}-main-confirmed-style`]: !!confirmText
190
192
  })
191
193
  }, keys.map(renderKey)), !!confirmText && _react.default.createElement("div", {
192
194
  className: `${classPrefix}-confirm`
193
195
  }, _react.default.createElement("div", {
194
- className: `${classPrefix}-key extra-key bs-key`,
196
+ className: `${classPrefix}-key ${classPrefix}-key-extra ${classPrefix}-key-bs`,
195
197
  onTouchStart: () => {
196
198
  onBackspacePressStart();
197
199
  },
@@ -202,7 +204,7 @@ const NumberKeyboard = p => {
202
204
  title: 'BACKSPACE',
203
205
  role: 'button'
204
206
  }, _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null)), _react.default.createElement("div", {
205
- className: `${classPrefix}-key extra-key ok-key`,
207
+ className: `${classPrefix}-key ${classPrefix}-key-extra ${classPrefix}-key-ok`,
206
208
  onTouchEnd: e => onKeyPress(e, 'OK'),
207
209
  role: 'button'
208
210
  }, confirmText))), props.safeArea && _react.default.createElement("div", {
@@ -1,4 +1,4 @@
1
1
  import './passcode-input.less';
2
2
  import { PasscodeInput } from './passcode-input';
3
- export type { PasscodeInputProps } from './passcode-input';
3
+ export type { PasscodeInputProps, PasscodeInputRef } from './passcode-input';
4
4
  export default PasscodeInput;
@@ -25,56 +25,56 @@
25
25
  background: var(--adm-color-background);
26
26
  }
27
27
 
28
- .adm-passcode-input:not(.seperated) {
28
+ .adm-passcode-input:not(.adm-passcode-input-seperated) {
29
29
  border-radius: var(--border-radius);
30
30
  overflow: hidden;
31
31
  border: 2px solid var(--border-color);
32
32
  }
33
33
 
34
- .adm-passcode-input:not(.seperated) .adm-passcode-input-cell:not(:last-child) {
34
+ .adm-passcode-input:not(.adm-passcode-input-seperated) .adm-passcode-input-cell:not(:last-child) {
35
35
  border-right: 2px solid var(--border-color);
36
36
  }
37
37
 
38
- .adm-passcode-input:not(.seperated).focused {
38
+ .adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-focused {
39
39
  border-color: var(--adm-color-primary);
40
40
  box-shadow: 0 0 4px 0 var(--adm-color-primary);
41
41
  outline: none;
42
42
  }
43
43
 
44
- .adm-passcode-input:not(.seperated).error {
44
+ .adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-error {
45
45
  border-color: var(--adm-color-danger);
46
46
  box-shadow: 0 0 4px 0 var(--adm-color-danger);
47
47
  animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
48
48
  }
49
49
 
50
- .adm-passcode-input.seperated .adm-passcode-input-cell {
50
+ .adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell {
51
51
  border-radius: var(--border-radius);
52
52
  border: 2px solid var(--border-color);
53
53
  }
54
54
 
55
- .adm-passcode-input.seperated .adm-passcode-input-cell:not(:last-child) {
55
+ .adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell:not(:last-child) {
56
56
  margin-right: var(--cell-gap);
57
57
  }
58
58
 
59
- .adm-passcode-input.seperated .adm-passcode-input-cell.focused {
59
+ .adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell-focused {
60
60
  border-color: var(--adm-color-primary);
61
61
  box-shadow: 0 0 4px 0 var(--adm-color-primary);
62
62
  }
63
63
 
64
- .adm-passcode-input.seperated.focused {
64
+ .adm-passcode-input-seperated.adm-passcode-input-focused {
65
65
  outline: none;
66
66
  }
67
67
 
68
- .adm-passcode-input.seperated.error {
68
+ .adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error {
69
69
  animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
70
70
  }
71
71
 
72
- .adm-passcode-input.seperated.error .adm-passcode-input-cell {
72
+ .adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error .adm-passcode-input-cell {
73
73
  border-color: var(--adm-color-danger);
74
74
  box-shadow: 0 0 4px 0 var(--adm-color-danger);
75
75
  }
76
76
 
77
- .adm-passcode-input-cell.dot::before {
77
+ .adm-passcode-input-cell-dot::before {
78
78
  content: '';
79
79
  width: var(--dot-size);
80
80
  height: var(--dot-size);
@@ -82,7 +82,7 @@
82
82
  background: var(--adm-color-text);
83
83
  }
84
84
 
85
- .adm-passcode-input-cell.caret::after {
85
+ .adm-passcode-input-cell-caret::after {
86
86
  content: '';
87
87
  width: 4px;
88
88
  height: 1.1em;
@@ -17,6 +17,8 @@ var _bound = require("../../utils/bound");
17
17
 
18
18
  var _usePropsValue = require("../../utils/use-props-value");
19
19
 
20
+ var _configProvider = require("../config-provider");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -36,6 +38,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
36
38
  const props = (0, _withDefaultProps.mergeProps)(defaultProps, p); // 防止 length 值不合法
37
39
 
38
40
  const cellLength = props.length > 0 && props.length < Infinity ? Math.floor(props.length) : defaultProps.length;
41
+ const {
42
+ locale
43
+ } = (0, _configProvider.useConfig)();
39
44
  const [focused, setFocused] = (0, _react.useState)(false);
40
45
  const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
41
46
  const rootRef = (0, _react.useRef)(null);
@@ -106,9 +111,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
106
111
  for (let i = 0; i < cellLength; i++) {
107
112
  cells.push(_react.default.createElement("div", {
108
113
  className: (0, _classnames.default)(`${classPrefix}-cell`, {
109
- caret: props.caret && caretIndex === i && focused,
110
- focused: focusedIndex === i && focused,
111
- dot: !props.plain && chars[i]
114
+ [`${classPrefix}-cell-caret`]: props.caret && caretIndex === i && focused,
115
+ [`${classPrefix}-cell-focused`]: focusedIndex === i && focused,
116
+ [`${classPrefix}-cell-dot`]: !props.plain && chars[i]
112
117
  }),
113
118
  key: i
114
119
  }, chars[i] && props.plain ? chars[i] : ''));
@@ -118,16 +123,18 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
118
123
  };
119
124
 
120
125
  const cls = (0, _classnames.default)(classPrefix, {
121
- focused: focused,
122
- error: props.error,
123
- seperated: props.seperated
126
+ [`${classPrefix}-focused`]: focused,
127
+ [`${classPrefix}-error`]: props.error,
128
+ [`${classPrefix}-seperated`]: props.seperated
124
129
  });
125
130
  return _react.default.createElement(_react.default.Fragment, null, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
126
131
  ref: rootRef,
127
132
  tabIndex: 0,
128
133
  className: cls,
129
134
  onFocus: onFocus,
130
- onBlur: onBlur
135
+ onBlur: onBlur,
136
+ role: 'button',
137
+ "aria-label": locale.PasscodeInput.name
131
138
  }, _react.default.createElement("div", {
132
139
  className: `${classPrefix}-cell-container`
133
140
  }, renderCells()), _react.default.createElement("input", {
@@ -139,7 +146,8 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
139
146
  inputMode: 'numeric',
140
147
  onChange: e => {
141
148
  setValue(e.target.value.slice(0, props.length));
142
- }
149
+ },
150
+ "aria-hidden": true
143
151
  }))), props.keyboard && _react.default.cloneElement(props.keyboard, {
144
152
  visible: focused,
145
153
  onInput: v => {
@@ -62,7 +62,7 @@ const Wheel = (0, _react.memo)(props => {
62
62
  });
63
63
  (0, _ahooks.useIsomorphicLayoutEffect)(() => {
64
64
  if (draggingRef.current) return;
65
- if (!value) return;
65
+ if (value === null) return;
66
66
  const targetIndex = column.findIndex(item => item.value === value);
67
67
  if (targetIndex < 0) return;
68
68
  const finalPosition = targetIndex * -itemHeight.current;
@@ -49,12 +49,17 @@ const Rate = p => {
49
49
  } else {
50
50
  setValue(v);
51
51
  }
52
- }
52
+ },
53
+ role: 'radio',
54
+ "aria-checked": value >= v,
55
+ "aria-label": '' + v
53
56
  }, props.character);
54
57
  }
55
58
 
56
59
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
57
- className: classPrefix
60
+ className: classPrefix,
61
+ role: 'radiogroup',
62
+ "aria-readonly": props.readOnly
58
63
  }, starList.map((_, i) => _react.default.createElement("div", {
59
64
  key: i,
60
65
  className: (0, _classnames.default)(`${classPrefix}-box`)
@@ -10,16 +10,6 @@ var _react = _interopRequireDefault(require("react"));
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
12
  const Star = () => {
13
- // return (
14
- // <svg height='1em' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'>
15
- // <title>{'star-fill\u5907\u4EFD 71'}</title>
16
- // <path
17
- // d='m24 36-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L42.815 16a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L24 36Z'
18
- // fill='#E5E5E5'
19
- // fillRule='evenodd'
20
- // />
21
- // </svg>
22
- // )
23
13
  return _react.default.createElement("svg", {
24
14
  viewBox: '0 0 42 40',
25
15
  height: '1em',
@@ -1,7 +1,7 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type ResultProps = {
4
- status: 'success' | 'error' | 'info' | 'waiting' | 'warning';
4
+ status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
5
5
  title: ReactNode;
6
6
  description?: ReactNode;
7
7
  icon?: ReactNode;
@@ -13,6 +13,8 @@ var _antdMobileIcons = require("antd-mobile-icons");
13
13
 
14
14
  var _nativeProps = require("../../utils/native-props");
15
15
 
16
+ var _withDefaultProps = require("../../utils/with-default-props");
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
20
  const classPrefix = `adm-result`;
@@ -23,8 +25,12 @@ const iconRecord = {
23
25
  waiting: _antdMobileIcons.ClockCircleFill,
24
26
  warning: _antdMobileIcons.ExclamationCircleFill
25
27
  };
28
+ const defaultProps = {
29
+ status: 'info'
30
+ };
26
31
 
27
- const Result = props => {
32
+ const Result = p => {
33
+ const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
28
34
  const {
29
35
  status,
30
36
  title,
@@ -48,6 +48,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
48
48
  const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
49
49
  const [hasFocus, setHasFocus] = (0, _react.useState)(false);
50
50
  const inputRef = (0, _react.useRef)(null);
51
+ const composingRef = (0, _react.useRef)(false);
51
52
  (0, _react.useImperativeHandle)(ref, () => ({
52
53
  clear: () => {
53
54
  var _a;
@@ -140,8 +141,17 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
140
141
  onEnterPress: () => {
141
142
  var _a, _b;
142
143
 
143
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
144
- (_b = props.onSearch) === null || _b === void 0 ? void 0 : _b.call(props, value);
144
+ if (!composingRef.current) {
145
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
146
+ (_b = props.onSearch) === null || _b === void 0 ? void 0 : _b.call(props, value);
147
+ }
148
+ },
149
+ "aria-label": locale.SearchBar.name,
150
+ onCompositionStart: () => {
151
+ composingRef.current = true;
152
+ },
153
+ onCompositionEnd: () => {
154
+ composingRef.current = false;
145
155
  }
146
156
  })), renderCancelButton()));
147
157
  });
@@ -5,8 +5,9 @@ export declare type SwitchProps = {
5
5
  disabled?: boolean;
6
6
  checked?: boolean;
7
7
  defaultChecked?: boolean;
8
+ /** @deprecated use `onChange` instead */
8
9
  beforeChange?: (val: boolean) => Promise<void>;
9
- onChange?: (checked: boolean) => void;
10
+ onChange?: (checked: boolean) => void | Promise<void>;
10
11
  checkedText?: ReactNode;
11
12
  uncheckedText?: ReactNode;
12
13
  } & NativeProps<'--checked-color' | '--width' | '--height' | '--border-width'>;
@@ -21,6 +21,8 @@ var _spinIcon = require("./spin-icon");
21
21
 
22
22
  var _configProvider = require("../config-provider");
23
23
 
24
+ var _validate = require("../../utils/validate");
25
+
24
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
27
 
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -58,14 +60,25 @@ const Switch = p => {
58
60
 
59
61
  try {
60
62
  yield props.beforeChange(nextChecked);
61
- setChecked(nextChecked);
62
63
  setChanging(false);
63
64
  } catch (e) {
64
65
  setChanging(false);
65
66
  throw e;
66
67
  }
67
- } else {
68
- setChecked(nextChecked);
68
+ }
69
+
70
+ const result = setChecked(nextChecked);
71
+
72
+ if ((0, _validate.isPromise)(result)) {
73
+ setChanging(true);
74
+
75
+ try {
76
+ yield result;
77
+ setChanging(false);
78
+ } catch (e) {
79
+ setChanging(false);
80
+ throw e;
81
+ }
69
82
  }
70
83
  });
71
84
  }
@@ -68,6 +68,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
68
68
  if (!autoSize) return;
69
69
  const textArea = nativeTextAreaRef.current;
70
70
  if (!textArea) return;
71
+ textArea.style.height = 'auto';
71
72
  let height = textArea.scrollHeight;
72
73
 
73
74
  if (typeof autoSize === 'object') {
@@ -93,17 +93,26 @@ export declare const base: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -100,17 +100,26 @@ const base = {
100
100
  failedToLoad: 'Failed to load',
101
101
  retry: 'Retry'
102
102
  },
103
+ Input: {
104
+ clear: 'clear'
105
+ },
103
106
  Mask: {
104
107
  name: 'Mask'
105
108
  },
106
109
  Modal: {
107
110
  ok: 'OK'
108
111
  },
112
+ PasscodeInput: {
113
+ name: 'Passcode Input'
114
+ },
109
115
  PullToRefresh: {
110
116
  pulling: 'Scroll down to refresh',
111
117
  canRelease: 'Release to refresh immediately',
112
118
  complete: 'Refresh successful'
113
119
  },
120
+ SearchBar: {
121
+ name: 'Search Bar'
122
+ },
114
123
  Slider: {
115
124
  name: 'Slider'
116
125
  },
@@ -93,17 +93,26 @@ declare const enUS: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const esES: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const faIR: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const frFR: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const idID: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const kkKZ: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };
@@ -93,17 +93,26 @@ declare const koKR: {
93
93
  failedToLoad: string;
94
94
  retry: string;
95
95
  };
96
+ Input: {
97
+ clear: string;
98
+ };
96
99
  Mask: {
97
100
  name: string;
98
101
  };
99
102
  Modal: {
100
103
  ok: string;
101
104
  };
105
+ PasscodeInput: {
106
+ name: string;
107
+ };
102
108
  PullToRefresh: {
103
109
  pulling: string;
104
110
  canRelease: string;
105
111
  complete: string;
106
112
  };
113
+ SearchBar: {
114
+ name: string;
115
+ };
107
116
  Slider: {
108
117
  name: string;
109
118
  };