antd-mobile 5.15.0 → 5.15.1

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 (184) hide show
  1. package/2x/bundle/antd-mobile.cjs.js +54 -34
  2. package/2x/bundle/antd-mobile.es.js +54 -34
  3. package/2x/cjs/components/button/button.d.ts +5 -1
  4. package/2x/cjs/components/center-popup/center-popup.d.ts +1 -0
  5. package/2x/cjs/components/center-popup/center-popup.js +3 -1
  6. package/2x/cjs/components/checkbox/checkbox.d.ts +5 -1
  7. package/2x/cjs/components/checkbox/index.d.ts +5 -1
  8. package/2x/cjs/components/checkbox/native-input.js +10 -8
  9. package/2x/cjs/components/date-picker/date-picker-date-utils.js +12 -15
  10. package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -15
  11. package/2x/cjs/components/date-picker/date-picker.d.ts +5 -1
  12. package/2x/cjs/components/date-picker/index.d.ts +5 -1
  13. package/2x/cjs/components/dialog/dialog.js +3 -1
  14. package/2x/cjs/components/dropdown/dropdown.d.ts +5 -1
  15. package/2x/cjs/components/dropdown/index.d.ts +5 -1
  16. package/2x/cjs/components/floating-panel/floating-panel.d.ts +5 -1
  17. package/2x/cjs/components/form/form.d.ts +5 -1
  18. package/2x/cjs/components/form/index.d.ts +5 -1
  19. package/2x/cjs/components/index-bar/index-bar.d.ts +5 -1
  20. package/2x/cjs/components/index-bar/index.d.ts +5 -1
  21. package/2x/cjs/components/input/input.d.ts +5 -1
  22. package/2x/cjs/components/passcode-input/passcode-input.d.ts +5 -1
  23. package/2x/cjs/components/picker/index.d.ts +10 -2
  24. package/2x/cjs/components/picker/picker.d.ts +5 -1
  25. package/2x/cjs/components/popover/index.d.ts +5 -1
  26. package/2x/cjs/components/popover/popover.d.ts +5 -1
  27. package/2x/cjs/components/radio/radio.js +3 -3
  28. package/2x/cjs/components/search-bar/search-bar.d.ts +5 -1
  29. package/2x/cjs/components/swipe-action/swipe-action.d.ts +5 -1
  30. package/2x/cjs/components/swiper/index.d.ts +10 -2
  31. package/2x/cjs/components/swiper/swiper.d.ts +5 -1
  32. package/2x/cjs/components/switch/switch.js +10 -1
  33. package/2x/cjs/components/text-area/text-area.d.ts +5 -1
  34. package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -1
  35. package/2x/cjs/locales/base.d.ts +3 -0
  36. package/2x/cjs/locales/base.js +3 -0
  37. package/2x/cjs/locales/en-US.d.ts +3 -0
  38. package/2x/cjs/locales/es-ES.d.ts +3 -0
  39. package/2x/cjs/locales/fa-IR.d.ts +3 -0
  40. package/2x/cjs/locales/fr-FR.d.ts +3 -0
  41. package/2x/cjs/locales/ko-KR.d.ts +3 -0
  42. package/2x/cjs/locales/zh-CN.d.ts +3 -0
  43. package/2x/cjs/locales/zh-CN.js +3 -0
  44. package/2x/cjs/locales/zh-HK.d.ts +3 -0
  45. package/2x/cjs/locales/zh-TW.d.ts +3 -0
  46. package/2x/cjs/utils/native-props.d.ts +3 -3
  47. package/2x/es/components/button/button.d.ts +5 -1
  48. package/2x/es/components/center-popup/center-popup.d.ts +1 -0
  49. package/2x/es/components/center-popup/center-popup.js +3 -1
  50. package/2x/es/components/checkbox/checkbox.d.ts +5 -1
  51. package/2x/es/components/checkbox/index.d.ts +5 -1
  52. package/2x/es/components/checkbox/native-input.js +9 -8
  53. package/2x/es/components/date-picker/date-picker-date-utils.js +12 -15
  54. package/2x/es/components/date-picker/date-picker-week-utils.js +12 -15
  55. package/2x/es/components/date-picker/date-picker.d.ts +5 -1
  56. package/2x/es/components/date-picker/index.d.ts +5 -1
  57. package/2x/es/components/dialog/dialog.js +3 -1
  58. package/2x/es/components/dropdown/dropdown.d.ts +5 -1
  59. package/2x/es/components/dropdown/index.d.ts +5 -1
  60. package/2x/es/components/floating-panel/floating-panel.d.ts +5 -1
  61. package/2x/es/components/form/form.d.ts +5 -1
  62. package/2x/es/components/form/index.d.ts +5 -1
  63. package/2x/es/components/index-bar/index-bar.d.ts +5 -1
  64. package/2x/es/components/index-bar/index.d.ts +5 -1
  65. package/2x/es/components/input/input.d.ts +5 -1
  66. package/2x/es/components/passcode-input/passcode-input.d.ts +5 -1
  67. package/2x/es/components/picker/index.d.ts +10 -2
  68. package/2x/es/components/picker/picker.d.ts +5 -1
  69. package/2x/es/components/popover/index.d.ts +5 -1
  70. package/2x/es/components/popover/popover.d.ts +5 -1
  71. package/2x/es/components/radio/radio.js +3 -3
  72. package/2x/es/components/search-bar/search-bar.d.ts +5 -1
  73. package/2x/es/components/swipe-action/swipe-action.d.ts +5 -1
  74. package/2x/es/components/swiper/index.d.ts +10 -2
  75. package/2x/es/components/swiper/swiper.d.ts +5 -1
  76. package/2x/es/components/switch/switch.js +9 -1
  77. package/2x/es/components/text-area/text-area.d.ts +5 -1
  78. package/2x/es/components/virtual-input/virtual-input.d.ts +5 -1
  79. package/2x/es/locales/base.d.ts +3 -0
  80. package/2x/es/locales/base.js +3 -0
  81. package/2x/es/locales/en-US.d.ts +3 -0
  82. package/2x/es/locales/es-ES.d.ts +3 -0
  83. package/2x/es/locales/fa-IR.d.ts +3 -0
  84. package/2x/es/locales/fr-FR.d.ts +3 -0
  85. package/2x/es/locales/ko-KR.d.ts +3 -0
  86. package/2x/es/locales/zh-CN.d.ts +3 -0
  87. package/2x/es/locales/zh-CN.js +3 -0
  88. package/2x/es/locales/zh-HK.d.ts +3 -0
  89. package/2x/es/locales/zh-TW.d.ts +3 -0
  90. package/2x/es/utils/native-props.d.ts +3 -3
  91. package/2x/package.json +1 -1
  92. package/2x/umd/antd-mobile.js +1 -1
  93. package/bundle/antd-mobile.cjs.js +54 -34
  94. package/bundle/antd-mobile.es.js +54 -34
  95. package/cjs/components/button/button.d.ts +5 -1
  96. package/cjs/components/center-popup/center-popup.d.ts +1 -0
  97. package/cjs/components/center-popup/center-popup.js +3 -1
  98. package/cjs/components/checkbox/checkbox.d.ts +5 -1
  99. package/cjs/components/checkbox/index.d.ts +5 -1
  100. package/cjs/components/checkbox/native-input.js +10 -8
  101. package/cjs/components/date-picker/date-picker-date-utils.js +12 -15
  102. package/cjs/components/date-picker/date-picker-week-utils.js +12 -15
  103. package/cjs/components/date-picker/date-picker.d.ts +5 -1
  104. package/cjs/components/date-picker/index.d.ts +5 -1
  105. package/cjs/components/dialog/dialog.js +3 -1
  106. package/cjs/components/dropdown/dropdown.d.ts +5 -1
  107. package/cjs/components/dropdown/index.d.ts +5 -1
  108. package/cjs/components/floating-panel/floating-panel.d.ts +5 -1
  109. package/cjs/components/form/form.d.ts +5 -1
  110. package/cjs/components/form/index.d.ts +5 -1
  111. package/cjs/components/index-bar/index-bar.d.ts +5 -1
  112. package/cjs/components/index-bar/index.d.ts +5 -1
  113. package/cjs/components/input/input.d.ts +5 -1
  114. package/cjs/components/passcode-input/passcode-input.d.ts +5 -1
  115. package/cjs/components/picker/index.d.ts +10 -2
  116. package/cjs/components/picker/picker.d.ts +5 -1
  117. package/cjs/components/popover/index.d.ts +5 -1
  118. package/cjs/components/popover/popover.d.ts +5 -1
  119. package/cjs/components/radio/radio.js +3 -3
  120. package/cjs/components/search-bar/search-bar.d.ts +5 -1
  121. package/cjs/components/swipe-action/swipe-action.d.ts +5 -1
  122. package/cjs/components/swiper/index.d.ts +10 -2
  123. package/cjs/components/swiper/swiper.d.ts +5 -1
  124. package/cjs/components/switch/switch.js +10 -1
  125. package/cjs/components/text-area/text-area.d.ts +5 -1
  126. package/cjs/components/virtual-input/virtual-input.d.ts +5 -1
  127. package/cjs/locales/base.d.ts +3 -0
  128. package/cjs/locales/base.js +3 -0
  129. package/cjs/locales/en-US.d.ts +3 -0
  130. package/cjs/locales/es-ES.d.ts +3 -0
  131. package/cjs/locales/fa-IR.d.ts +3 -0
  132. package/cjs/locales/fr-FR.d.ts +3 -0
  133. package/cjs/locales/ko-KR.d.ts +3 -0
  134. package/cjs/locales/zh-CN.d.ts +3 -0
  135. package/cjs/locales/zh-CN.js +3 -0
  136. package/cjs/locales/zh-HK.d.ts +3 -0
  137. package/cjs/locales/zh-TW.d.ts +3 -0
  138. package/cjs/utils/native-props.d.ts +3 -3
  139. package/es/components/button/button.d.ts +5 -1
  140. package/es/components/center-popup/center-popup.d.ts +1 -0
  141. package/es/components/center-popup/center-popup.js +3 -1
  142. package/es/components/checkbox/checkbox.d.ts +5 -1
  143. package/es/components/checkbox/index.d.ts +5 -1
  144. package/es/components/checkbox/native-input.js +9 -8
  145. package/es/components/date-picker/date-picker-date-utils.js +12 -15
  146. package/es/components/date-picker/date-picker-week-utils.js +12 -15
  147. package/es/components/date-picker/date-picker.d.ts +5 -1
  148. package/es/components/date-picker/index.d.ts +5 -1
  149. package/es/components/dialog/dialog.js +3 -1
  150. package/es/components/dropdown/dropdown.d.ts +5 -1
  151. package/es/components/dropdown/index.d.ts +5 -1
  152. package/es/components/floating-panel/floating-panel.d.ts +5 -1
  153. package/es/components/form/form.d.ts +5 -1
  154. package/es/components/form/index.d.ts +5 -1
  155. package/es/components/index-bar/index-bar.d.ts +5 -1
  156. package/es/components/index-bar/index.d.ts +5 -1
  157. package/es/components/input/input.d.ts +5 -1
  158. package/es/components/passcode-input/passcode-input.d.ts +5 -1
  159. package/es/components/picker/index.d.ts +10 -2
  160. package/es/components/picker/picker.d.ts +5 -1
  161. package/es/components/popover/index.d.ts +5 -1
  162. package/es/components/popover/popover.d.ts +5 -1
  163. package/es/components/radio/radio.js +3 -3
  164. package/es/components/search-bar/search-bar.d.ts +5 -1
  165. package/es/components/swipe-action/swipe-action.d.ts +5 -1
  166. package/es/components/swiper/index.d.ts +10 -2
  167. package/es/components/swiper/swiper.d.ts +5 -1
  168. package/es/components/switch/switch.js +9 -1
  169. package/es/components/text-area/text-area.d.ts +5 -1
  170. package/es/components/virtual-input/virtual-input.d.ts +5 -1
  171. package/es/locales/base.d.ts +3 -0
  172. package/es/locales/base.js +3 -0
  173. package/es/locales/en-US.d.ts +3 -0
  174. package/es/locales/es-ES.d.ts +3 -0
  175. package/es/locales/fa-IR.d.ts +3 -0
  176. package/es/locales/fr-FR.d.ts +3 -0
  177. package/es/locales/ko-KR.d.ts +3 -0
  178. package/es/locales/zh-CN.d.ts +3 -0
  179. package/es/locales/zh-CN.js +3 -0
  180. package/es/locales/zh-HK.d.ts +3 -0
  181. package/es/locales/zh-TW.d.ts +3 -0
  182. package/es/utils/native-props.d.ts +3 -3
  183. package/package.json +1 -1
  184. package/umd/antd-mobile.js +1 -1
@@ -1357,6 +1357,9 @@ const base = {
1357
1357
  pulling: "Scroll down to refresh",
1358
1358
  canRelease: "Release to refresh immediately",
1359
1359
  complete: "Refresh successful"
1360
+ },
1361
+ Switch: {
1362
+ name: "Switch"
1360
1363
  }
1361
1364
  };
1362
1365
  const typeTemplate = "${label}\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684${type}";
@@ -1465,6 +1468,9 @@ const zhCN = mergeLocale(base, {
1465
1468
  pulling: "\u4E0B\u62C9\u5237\u65B0",
1466
1469
  canRelease: "\u91CA\u653E\u7ACB\u5373\u5237\u65B0",
1467
1470
  complete: "\u5237\u65B0\u6210\u529F"
1471
+ },
1472
+ Switch: {
1473
+ name: "\u5F00\u5173"
1468
1474
  }
1469
1475
  });
1470
1476
  const defaultConfigRef = {
@@ -11608,7 +11614,9 @@ const CenterPopup = (p2) => {
11608
11614
  className: classNames__default["default"]("adm-center-popup-mask", props.maskClassName),
11609
11615
  disableBodyScroll: false
11610
11616
  }), React__default["default"].createElement("div", {
11611
- className: "adm-center-popup-wrap"
11617
+ className: "adm-center-popup-wrap",
11618
+ role: props.role,
11619
+ "aria-label": props["aria-label"]
11612
11620
  }, React__default["default"].createElement(web.animated.div, {
11613
11621
  style,
11614
11622
  ref
@@ -11659,17 +11667,20 @@ const IndeterminateIcon = React$1.memo((props) => {
11659
11667
  });
11660
11668
  const NativeInput = (props) => {
11661
11669
  const inputRef = React$1.useRef(null);
11670
+ const handleClick = ahooks.useMemoizedFn((e2) => {
11671
+ e2.stopPropagation();
11672
+ e2.stopImmediatePropagation();
11673
+ const latestChecked = e2.target.checked;
11674
+ if (latestChecked === props.checked)
11675
+ return;
11676
+ props.onChange(latestChecked);
11677
+ });
11662
11678
  React$1.useEffect(() => {
11663
11679
  if (props.disabled)
11664
11680
  return;
11665
11681
  if (!inputRef.current)
11666
11682
  return;
11667
11683
  const input2 = inputRef.current;
11668
- function handleClick(e2) {
11669
- e2.stopPropagation();
11670
- e2.stopImmediatePropagation();
11671
- props.onChange(input2.checked);
11672
- }
11673
11684
  input2.addEventListener("click", handleClick);
11674
11685
  return () => {
11675
11686
  input2.removeEventListener("click", handleClick);
@@ -11677,7 +11688,7 @@ const NativeInput = (props) => {
11677
11688
  }, [props.disabled, props.onChange]);
11678
11689
  return React__default["default"].createElement("input", {
11679
11690
  ref: inputRef,
11680
- type: "checkbox",
11691
+ type: props.type,
11681
11692
  checked: props.checked,
11682
11693
  onChange: () => {
11683
11694
  },
@@ -11967,17 +11978,6 @@ function generateDatePickerColumns$2(selected, min, max, precision, renderLabel,
11967
11978
  const maxMinute = max.getMinutes();
11968
11979
  const maxSecond = max.getSeconds();
11969
11980
  const rank = precisionRankRecord$1[precision];
11970
- if (rank >= precisionRankRecord$1.year) {
11971
- const years = [];
11972
- for (let i = minYear; i <= maxYear; i++) {
11973
- const value = i.toString();
11974
- years.push({
11975
- label: renderLabel ? renderLabel("year", i) : value,
11976
- value
11977
- });
11978
- }
11979
- ret.push(years);
11980
- }
11981
11981
  const selectedYear = parseInt(selected[0]);
11982
11982
  const firstDayInSelectedMonth = dayjs__default["default"](convertStringArrayToDate$2([selected[0], selected[1], "1"]));
11983
11983
  const selectedMonth = parseInt(selected[1]);
@@ -12011,6 +12011,17 @@ function generateDatePickerColumns$2(selected, min, max, precision, renderLabel,
12011
12011
  }
12012
12012
  return column;
12013
12013
  };
12014
+ if (rank >= precisionRankRecord$1.year) {
12015
+ const lower = minYear;
12016
+ const upper = maxYear;
12017
+ const years = generateColumn(lower, upper, "year");
12018
+ ret.push(years.map((v) => {
12019
+ return {
12020
+ label: renderLabel("year", v),
12021
+ value: v.toString()
12022
+ };
12023
+ }));
12024
+ }
12014
12025
  if (rank >= precisionRankRecord$1.month) {
12015
12026
  const lower = isInMinYear ? minMonth : 1;
12016
12027
  const upper = isInMaxYear ? maxMonth : 12;
@@ -12099,17 +12110,6 @@ function generateDatePickerColumns$1(selected, min, max, precision, renderLabel,
12099
12110
  const minYear = min.getFullYear();
12100
12111
  const maxYear = max.getFullYear();
12101
12112
  const rank = precisionRankRecord[precision];
12102
- if (rank >= precisionRankRecord.year) {
12103
- const years = [];
12104
- for (let i = minYear; i <= maxYear; i++) {
12105
- const value = i.toString();
12106
- years.push({
12107
- label: renderLabel ? renderLabel("year", i) : value,
12108
- value
12109
- });
12110
- }
12111
- ret.push(years);
12112
- }
12113
12113
  const selectedYear = parseInt(selected[0]);
12114
12114
  const isInMinYear = selectedYear === minYear;
12115
12115
  const isInMaxYear = selectedYear === maxYear;
@@ -12140,6 +12140,17 @@ function generateDatePickerColumns$1(selected, min, max, precision, renderLabel,
12140
12140
  }
12141
12141
  return column;
12142
12142
  };
12143
+ if (rank >= precisionRankRecord.year) {
12144
+ const lower = minYear;
12145
+ const upper = maxYear;
12146
+ const years = generateColumn(lower, upper, "year");
12147
+ ret.push(years.map((v) => {
12148
+ return {
12149
+ label: renderLabel("year", v),
12150
+ value: v.toString()
12151
+ };
12152
+ }));
12153
+ }
12143
12154
  if (rank >= precisionRankRecord.week) {
12144
12155
  const lower = isInMinYear ? minWeek : 1;
12145
12156
  const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
@@ -12524,7 +12535,9 @@ const Dialog = (p2) => {
12524
12535
  stopPropagation: props.stopPropagation,
12525
12536
  disableBodyScroll: props.disableBodyScroll,
12526
12537
  destroyOnClose: props.destroyOnClose,
12527
- forceRender: props.forceRender
12538
+ forceRender: props.forceRender,
12539
+ role: "dialog",
12540
+ "aria-label": props["aria-label"]
12528
12541
  }, element);
12529
12542
  };
12530
12543
  function cls$1(name = "") {
@@ -16630,14 +16643,14 @@ const Radio = (p2) => {
16630
16643
  } = props;
16631
16644
  if (groupContext && value !== void 0) {
16632
16645
  checked = groupContext.value.includes(value);
16633
- setChecked = (checked2) => {
16646
+ setChecked = (innerChecked) => {
16634
16647
  var _a;
16635
- if (checked2) {
16648
+ if (innerChecked) {
16636
16649
  groupContext.check(value);
16637
16650
  } else {
16638
16651
  groupContext.uncheck(value);
16639
16652
  }
16640
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, checked2);
16653
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
16641
16654
  };
16642
16655
  disabled = disabled || groupContext.disabled;
16643
16656
  }
@@ -18001,6 +18014,9 @@ const Switch = (p2) => {
18001
18014
  const props = mergeProps(defaultProps$8, p2);
18002
18015
  const disabled = props.disabled || props.loading || false;
18003
18016
  const [changing, setChanging] = React$1.useState(false);
18017
+ const {
18018
+ locale
18019
+ } = useConfig();
18004
18020
  const [checked, setChecked] = usePropsValue({
18005
18021
  value: props.checked,
18006
18022
  defaultValue: props.defaultChecked,
@@ -18032,7 +18048,11 @@ const Switch = (p2) => {
18032
18048
  className: classNames__default["default"](classPrefix$8, {
18033
18049
  [`${classPrefix$8}-checked`]: checked,
18034
18050
  [`${classPrefix$8}-disabled`]: disabled || changing
18035
- })
18051
+ }),
18052
+ role: "switch",
18053
+ "aria-label": locale.Switch.name,
18054
+ "aria-checked": checked,
18055
+ "aria-disabled": disabled
18036
18056
  }, React__default["default"].createElement("div", {
18037
18057
  className: `${classPrefix$8}-checkbox`
18038
18058
  }, React__default["default"].createElement("div", {
@@ -1347,6 +1347,9 @@ const base = {
1347
1347
  pulling: "Scroll down to refresh",
1348
1348
  canRelease: "Release to refresh immediately",
1349
1349
  complete: "Refresh successful"
1350
+ },
1351
+ Switch: {
1352
+ name: "Switch"
1350
1353
  }
1351
1354
  };
1352
1355
  const typeTemplate = "${label}\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684${type}";
@@ -1455,6 +1458,9 @@ const zhCN = mergeLocale(base, {
1455
1458
  pulling: "\u4E0B\u62C9\u5237\u65B0",
1456
1459
  canRelease: "\u91CA\u653E\u7ACB\u5373\u5237\u65B0",
1457
1460
  complete: "\u5237\u65B0\u6210\u529F"
1461
+ },
1462
+ Switch: {
1463
+ name: "\u5F00\u5173"
1458
1464
  }
1459
1465
  });
1460
1466
  const defaultConfigRef = {
@@ -11598,7 +11604,9 @@ const CenterPopup = (p2) => {
11598
11604
  className: classNames("adm-center-popup-mask", props.maskClassName),
11599
11605
  disableBodyScroll: false
11600
11606
  }), React$1.createElement("div", {
11601
- className: "adm-center-popup-wrap"
11607
+ className: "adm-center-popup-wrap",
11608
+ role: props.role,
11609
+ "aria-label": props["aria-label"]
11602
11610
  }, React$1.createElement(animated.div, {
11603
11611
  style,
11604
11612
  ref
@@ -11649,17 +11657,20 @@ const IndeterminateIcon = memo((props) => {
11649
11657
  });
11650
11658
  const NativeInput = (props) => {
11651
11659
  const inputRef = useRef(null);
11660
+ const handleClick = useMemoizedFn((e2) => {
11661
+ e2.stopPropagation();
11662
+ e2.stopImmediatePropagation();
11663
+ const latestChecked = e2.target.checked;
11664
+ if (latestChecked === props.checked)
11665
+ return;
11666
+ props.onChange(latestChecked);
11667
+ });
11652
11668
  useEffect(() => {
11653
11669
  if (props.disabled)
11654
11670
  return;
11655
11671
  if (!inputRef.current)
11656
11672
  return;
11657
11673
  const input2 = inputRef.current;
11658
- function handleClick(e2) {
11659
- e2.stopPropagation();
11660
- e2.stopImmediatePropagation();
11661
- props.onChange(input2.checked);
11662
- }
11663
11674
  input2.addEventListener("click", handleClick);
11664
11675
  return () => {
11665
11676
  input2.removeEventListener("click", handleClick);
@@ -11667,7 +11678,7 @@ const NativeInput = (props) => {
11667
11678
  }, [props.disabled, props.onChange]);
11668
11679
  return React$1.createElement("input", {
11669
11680
  ref: inputRef,
11670
- type: "checkbox",
11681
+ type: props.type,
11671
11682
  checked: props.checked,
11672
11683
  onChange: () => {
11673
11684
  },
@@ -11957,17 +11968,6 @@ function generateDatePickerColumns$2(selected, min, max, precision, renderLabel,
11957
11968
  const maxMinute = max.getMinutes();
11958
11969
  const maxSecond = max.getSeconds();
11959
11970
  const rank = precisionRankRecord$1[precision];
11960
- if (rank >= precisionRankRecord$1.year) {
11961
- const years = [];
11962
- for (let i = minYear; i <= maxYear; i++) {
11963
- const value = i.toString();
11964
- years.push({
11965
- label: renderLabel ? renderLabel("year", i) : value,
11966
- value
11967
- });
11968
- }
11969
- ret.push(years);
11970
- }
11971
11971
  const selectedYear = parseInt(selected[0]);
11972
11972
  const firstDayInSelectedMonth = dayjs(convertStringArrayToDate$2([selected[0], selected[1], "1"]));
11973
11973
  const selectedMonth = parseInt(selected[1]);
@@ -12001,6 +12001,17 @@ function generateDatePickerColumns$2(selected, min, max, precision, renderLabel,
12001
12001
  }
12002
12002
  return column;
12003
12003
  };
12004
+ if (rank >= precisionRankRecord$1.year) {
12005
+ const lower = minYear;
12006
+ const upper = maxYear;
12007
+ const years = generateColumn(lower, upper, "year");
12008
+ ret.push(years.map((v) => {
12009
+ return {
12010
+ label: renderLabel("year", v),
12011
+ value: v.toString()
12012
+ };
12013
+ }));
12014
+ }
12004
12015
  if (rank >= precisionRankRecord$1.month) {
12005
12016
  const lower = isInMinYear ? minMonth : 1;
12006
12017
  const upper = isInMaxYear ? maxMonth : 12;
@@ -12089,17 +12100,6 @@ function generateDatePickerColumns$1(selected, min, max, precision, renderLabel,
12089
12100
  const minYear = min.getFullYear();
12090
12101
  const maxYear = max.getFullYear();
12091
12102
  const rank = precisionRankRecord[precision];
12092
- if (rank >= precisionRankRecord.year) {
12093
- const years = [];
12094
- for (let i = minYear; i <= maxYear; i++) {
12095
- const value = i.toString();
12096
- years.push({
12097
- label: renderLabel ? renderLabel("year", i) : value,
12098
- value
12099
- });
12100
- }
12101
- ret.push(years);
12102
- }
12103
12103
  const selectedYear = parseInt(selected[0]);
12104
12104
  const isInMinYear = selectedYear === minYear;
12105
12105
  const isInMaxYear = selectedYear === maxYear;
@@ -12130,6 +12130,17 @@ function generateDatePickerColumns$1(selected, min, max, precision, renderLabel,
12130
12130
  }
12131
12131
  return column;
12132
12132
  };
12133
+ if (rank >= precisionRankRecord.year) {
12134
+ const lower = minYear;
12135
+ const upper = maxYear;
12136
+ const years = generateColumn(lower, upper, "year");
12137
+ ret.push(years.map((v) => {
12138
+ return {
12139
+ label: renderLabel("year", v),
12140
+ value: v.toString()
12141
+ };
12142
+ }));
12143
+ }
12133
12144
  if (rank >= precisionRankRecord.week) {
12134
12145
  const lower = isInMinYear ? minWeek : 1;
12135
12146
  const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
@@ -12514,7 +12525,9 @@ const Dialog = (p2) => {
12514
12525
  stopPropagation: props.stopPropagation,
12515
12526
  disableBodyScroll: props.disableBodyScroll,
12516
12527
  destroyOnClose: props.destroyOnClose,
12517
- forceRender: props.forceRender
12528
+ forceRender: props.forceRender,
12529
+ role: "dialog",
12530
+ "aria-label": props["aria-label"]
12518
12531
  }, element);
12519
12532
  };
12520
12533
  function cls$1(name = "") {
@@ -16620,14 +16633,14 @@ const Radio = (p2) => {
16620
16633
  } = props;
16621
16634
  if (groupContext && value !== void 0) {
16622
16635
  checked = groupContext.value.includes(value);
16623
- setChecked = (checked2) => {
16636
+ setChecked = (innerChecked) => {
16624
16637
  var _a;
16625
- if (checked2) {
16638
+ if (innerChecked) {
16626
16639
  groupContext.check(value);
16627
16640
  } else {
16628
16641
  groupContext.uncheck(value);
16629
16642
  }
16630
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, checked2);
16643
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
16631
16644
  };
16632
16645
  disabled = disabled || groupContext.disabled;
16633
16646
  }
@@ -17991,6 +18004,9 @@ const Switch = (p2) => {
17991
18004
  const props = mergeProps(defaultProps$8, p2);
17992
18005
  const disabled = props.disabled || props.loading || false;
17993
18006
  const [changing, setChanging] = useState(false);
18007
+ const {
18008
+ locale
18009
+ } = useConfig();
17994
18010
  const [checked, setChecked] = usePropsValue({
17995
18011
  value: props.checked,
17996
18012
  defaultValue: props.defaultChecked,
@@ -18022,7 +18038,11 @@ const Switch = (p2) => {
18022
18038
  className: classNames(classPrefix$8, {
18023
18039
  [`${classPrefix$8}-checked`]: checked,
18024
18040
  [`${classPrefix$8}-disabled`]: disabled || changing
18025
- })
18041
+ }),
18042
+ role: "switch",
18043
+ "aria-label": locale.Switch.name,
18044
+ "aria-checked": checked,
18045
+ "aria-disabled": disabled
18026
18046
  }, React$1.createElement("div", {
18027
18047
  className: `${classPrefix$8}-checkbox`
18028
18048
  }, React$1.createElement("div", {
@@ -31,5 +31,9 @@ export declare const Button: React.ForwardRefExoticComponent<{
31
31
  type?: "reset" | "submit" | "button" | undefined;
32
32
  shape?: "default" | "rounded" | "rectangular" | undefined;
33
33
  children?: React.ReactNode;
34
- } & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
34
+ } & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
35
+ className?: string | undefined;
36
+ style?: (React.CSSProperties & Partial<Record<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
37
+ tabIndex?: number | undefined;
38
+ } & React.AriaAttributes & React.RefAttributes<ButtonRef>>;
35
39
  export {};
@@ -19,5 +19,6 @@ export declare type CenterPopupProps = PropsWithChildren<{
19
19
  onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
20
20
  stopPropagation?: PropagationEvent[];
21
21
  visible?: boolean;
22
+ role?: string;
22
23
  }> & NativeProps<'--background-color' | '--border-radius' | '--max-width' | '--min-width' | '--z-index'>;
23
24
  export declare const CenterPopup: FC<CenterPopupProps>;
@@ -101,7 +101,9 @@ const CenterPopup = p => {
101
101
  className: (0, _classnames.default)('adm-center-popup-mask', props.maskClassName),
102
102
  disableBodyScroll: false
103
103
  }), _react.default.createElement("div", {
104
- className: 'adm-center-popup-wrap'
104
+ className: 'adm-center-popup-wrap',
105
+ role: props.role,
106
+ "aria-label": props['aria-label']
105
107
  }, _react.default.createElement(_web.animated.div, {
106
108
  style: style,
107
109
  ref: ref
@@ -29,4 +29,8 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
29
29
  id?: string | undefined;
30
30
  icon?: ((checked: boolean, indeterminate: boolean) => React.ReactNode) | undefined;
31
31
  children?: React.ReactNode;
32
- } & NativeProps<"--font-size" | "--icon-size" | "--gap"> & React.RefAttributes<CheckboxRef>>;
32
+ } & {
33
+ className?: string | undefined;
34
+ style?: (React.CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
35
+ tabIndex?: number | undefined;
36
+ } & React.AriaAttributes & React.RefAttributes<CheckboxRef>>;
@@ -13,7 +13,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
13
13
  id?: string | undefined;
14
14
  icon?: ((checked: boolean, indeterminate: boolean) => import("react").ReactNode) | undefined;
15
15
  children?: import("react").ReactNode;
16
- } & import("../../utils/native-props").NativeProps<"--font-size" | "--icon-size" | "--gap"> & import("react").RefAttributes<import("./checkbox").CheckboxRef>> & {
16
+ } & {
17
+ className?: string | undefined;
18
+ style?: (import("react").CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
19
+ tabIndex?: number | undefined;
20
+ } & import("react").AriaAttributes & import("react").RefAttributes<import("./checkbox").CheckboxRef>> & {
17
21
  Group: import("react").FC<import("./group").CheckboxGroupProps>;
18
22
  };
19
23
  export default _default;
@@ -7,23 +7,25 @@ exports.NativeInput = void 0;
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
10
+ var _ahooks = require("ahooks");
11
+
10
12
  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); }
11
13
 
12
14
  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; }
13
15
 
14
16
  const NativeInput = props => {
15
17
  const inputRef = (0, _react.useRef)(null);
18
+ const handleClick = (0, _ahooks.useMemoizedFn)(e => {
19
+ e.stopPropagation();
20
+ e.stopImmediatePropagation();
21
+ const latestChecked = e.target.checked;
22
+ if (latestChecked === props.checked) return;
23
+ props.onChange(latestChecked);
24
+ });
16
25
  (0, _react.useEffect)(() => {
17
26
  if (props.disabled) return;
18
27
  if (!inputRef.current) return;
19
28
  const input = inputRef.current;
20
-
21
- function handleClick(e) {
22
- e.stopPropagation();
23
- e.stopImmediatePropagation();
24
- props.onChange(input.checked);
25
- }
26
-
27
29
  input.addEventListener('click', handleClick);
28
30
  return () => {
29
31
  input.removeEventListener('click', handleClick);
@@ -31,7 +33,7 @@ const NativeInput = props => {
31
33
  }, [props.disabled, props.onChange]);
32
34
  return _react.default.createElement("input", {
33
35
  ref: inputRef,
34
- type: 'checkbox',
36
+ type: props.type,
35
37
  checked: props.checked,
36
38
  onChange: () => {},
37
39
  disabled: props.disabled,
@@ -60,21 +60,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
60
60
  const maxMinute = max.getMinutes();
61
61
  const maxSecond = max.getSeconds();
62
62
  const rank = precisionRankRecord[precision];
63
-
64
- if (rank >= precisionRankRecord.year) {
65
- const years = [];
66
-
67
- for (let i = minYear; i <= maxYear; i++) {
68
- const value = i.toString();
69
- years.push({
70
- label: renderLabel ? renderLabel('year', i) : value,
71
- value
72
- });
73
- }
74
-
75
- ret.push(years);
76
- }
77
-
78
63
  const selectedYear = parseInt(selected[0]);
79
64
  const firstDayInSelectedMonth = (0, _dayjs.default)(convertStringArrayToDate([selected[0], selected[1], '1']));
80
65
  const selectedMonth = parseInt(selected[1]);
@@ -115,6 +100,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
115
100
  return column;
116
101
  };
117
102
 
103
+ if (rank >= precisionRankRecord.year) {
104
+ const lower = minYear;
105
+ const upper = maxYear;
106
+ const years = generateColumn(lower, upper, 'year');
107
+ ret.push(years.map(v => {
108
+ return {
109
+ label: renderLabel('year', v),
110
+ value: v.toString()
111
+ };
112
+ }));
113
+ }
114
+
118
115
  if (rank >= precisionRankRecord.month) {
119
116
  const lower = isInMinYear ? minMonth : 1;
120
117
  const upper = isInMaxYear ? maxMonth : 12;
@@ -39,21 +39,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
39
39
  const minYear = min.getFullYear();
40
40
  const maxYear = max.getFullYear();
41
41
  const rank = precisionRankRecord[precision];
42
-
43
- if (rank >= precisionRankRecord.year) {
44
- const years = [];
45
-
46
- for (let i = minYear; i <= maxYear; i++) {
47
- const value = i.toString();
48
- years.push({
49
- label: renderLabel ? renderLabel('year', i) : value,
50
- value
51
- });
52
- }
53
-
54
- ret.push(years);
55
- }
56
-
57
42
  const selectedYear = parseInt(selected[0]);
58
43
  const isInMinYear = selectedYear === minYear;
59
44
  const isInMaxYear = selectedYear === maxYear;
@@ -91,6 +76,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
91
76
  return column;
92
77
  };
93
78
 
79
+ if (rank >= precisionRankRecord.year) {
80
+ const lower = minYear;
81
+ const upper = maxYear;
82
+ const years = generateColumn(lower, upper, 'year');
83
+ ret.push(years.map(v => {
84
+ return {
85
+ label: renderLabel('year', v),
86
+ value: v.toString()
87
+ };
88
+ }));
89
+ }
90
+
94
91
  if (rank >= precisionRankRecord.week) {
95
92
  const lower = isInMinYear ? minWeek : 1;
96
93
  const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
@@ -28,4 +28,8 @@ export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProp
28
28
  filter?: Partial<Record<Precision, (val: number, extend: {
29
29
  date: Date;
30
30
  }) => boolean>> | undefined;
31
- } & NativeProps<never> & React.RefAttributes<PickerActions>>;
31
+ } & {
32
+ className?: string | undefined;
33
+ style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
34
+ tabIndex?: number | undefined;
35
+ } & React.AriaAttributes & React.RefAttributes<PickerActions>>;
@@ -16,7 +16,11 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import(".
16
16
  filter?: Partial<Record<import("./date-picker-utils").Precision, (val: number, extend: {
17
17
  date: Date;
18
18
  }) => boolean>> | undefined;
19
- } & import("../../utils/native-props").NativeProps<never> & import("react").RefAttributes<import("../picker").PickerActions>> & {
19
+ } & {
20
+ className?: string | undefined;
21
+ style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
22
+ tabIndex?: number | undefined;
23
+ } & import("react").AriaAttributes & import("react").RefAttributes<import("../picker").PickerActions>> & {
20
24
  prompt: typeof prompt;
21
25
  };
22
26
  export default _default;
@@ -85,7 +85,9 @@ const Dialog = p => {
85
85
  stopPropagation: props.stopPropagation,
86
86
  disableBodyScroll: props.disableBodyScroll,
87
87
  destroyOnClose: props.destroyOnClose,
88
- forceRender: props.forceRender
88
+ forceRender: props.forceRender,
89
+ role: 'dialog',
90
+ "aria-label": props['aria-label']
89
91
  }, element);
90
92
  };
91
93
 
@@ -18,7 +18,11 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
18
18
  closeOnClickAway?: boolean | undefined;
19
19
  onChange?: ((key: string | null) => void) | undefined;
20
20
  arrow?: React.ReactNode;
21
- } & NativeProps<never> & {
21
+ } & {
22
+ className?: string | undefined;
23
+ style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
24
+ tabIndex?: number | undefined;
25
+ } & React.AriaAttributes & {
22
26
  children?: React.ReactNode;
23
27
  } & React.RefAttributes<DropdownRef>>;
24
28
  export default Dropdown;
@@ -9,7 +9,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
9
9
  closeOnClickAway?: boolean | undefined;
10
10
  onChange?: ((key: string | null) => void) | undefined;
11
11
  arrow?: import("react").ReactNode;
12
- } & import("../../utils/native-props").NativeProps<never> & {
12
+ } & {
13
+ className?: string | undefined;
14
+ style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
15
+ tabIndex?: number | undefined;
16
+ } & import("react").AriaAttributes & {
13
17
  children?: import("react").ReactNode;
14
18
  } & import("react").RefAttributes<import("./dropdown").DropdownRef>> & {
15
19
  Item: import("react").FC<import("./item").DropdownItemProps>;
@@ -16,4 +16,8 @@ export declare const FloatingPanel: React.ForwardRefExoticComponent<{
16
16
  children: ReactNode;
17
17
  onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
18
18
  handleDraggingOfContent?: boolean | undefined;
19
- } & NativeProps<"--z-index" | "--border-radius" | "--header-height"> & React.RefAttributes<FloatingPanelRef>>;
19
+ } & {
20
+ className?: string | undefined;
21
+ style?: (React.CSSProperties & Partial<Record<"--z-index" | "--border-radius" | "--header-height", string>>) | undefined;
22
+ tabIndex?: number | undefined;
23
+ } & React.AriaAttributes & React.RefAttributes<FloatingPanelRef>>;
@@ -8,7 +8,11 @@ export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'na
8
8
  footer?: ReactNode;
9
9
  mode?: ListProps['mode'];
10
10
  };
11
- export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<"--border-bottom" | "--border-inner" | "--border-top"> & Partial<FormContextType> & {
11
+ export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
12
+ className?: string | undefined;
13
+ style?: (React.CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top", string>>) | undefined;
14
+ tabIndex?: number | undefined;
15
+ } & React.AriaAttributes & Partial<FormContextType> & {
12
16
  footer?: ReactNode;
13
17
  mode?: ListProps['mode'];
14
18
  } & React.RefAttributes<FormInstance>>;
@@ -7,7 +7,11 @@ export type { FormItemProps } from './form-item';
7
7
  export type { FormSubscribeProps } from './form-subscribe';
8
8
  export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
9
9
  export type { FormArrayField, FormArrayOperation, FormArrayProps, } from './form-array';
10
- declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<"--border-bottom" | "--border-inner" | "--border-top"> & Partial<import("./context").FormContextType> & {
10
+ declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
11
+ className?: string | undefined;
12
+ style?: (import("react").CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top", string>>) | undefined;
13
+ tabIndex?: number | undefined;
14
+ } & import("react").AriaAttributes & Partial<import("./context").FormContextType> & {
11
15
  footer?: import("react").ReactNode;
12
16
  mode?: "default" | "card" | undefined;
13
17
  } & import("react").RefAttributes<import("./form").FormInstance>> & {