antd-mobile 5.10.4 → 5.11.2

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 (194) hide show
  1. package/2x/cjs/components/button/button.d.ts +6 -4
  2. package/2x/cjs/components/button/button.js +31 -7
  3. package/2x/cjs/components/calendar/calendar.css +2 -2
  4. package/2x/cjs/components/calendar/calendar.d.ts +2 -0
  5. package/2x/cjs/components/calendar/calendar.js +6 -1
  6. package/2x/cjs/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  7. package/2x/cjs/components/cascade-picker/cascade-picker-utils.js +37 -16
  8. package/2x/cjs/components/cascade-picker/cascade-picker.js +2 -7
  9. package/2x/cjs/components/cascade-picker-view/cascade-picker-view.js +2 -7
  10. package/2x/cjs/components/date-picker/date-picker.js +1 -0
  11. package/2x/cjs/components/dialog/dialog-action-button.js +3 -26
  12. package/2x/cjs/components/floating-panel/floating-panel.js +1 -1
  13. package/2x/cjs/components/form/context.d.ts +1 -0
  14. package/2x/cjs/components/form/context.js +2 -1
  15. package/2x/cjs/components/form/form-item.css +1 -1
  16. package/2x/cjs/components/form/form-item.js +3 -1
  17. package/2x/cjs/components/form/form.d.ts +0 -3
  18. package/2x/cjs/components/form/form.js +4 -2
  19. package/2x/cjs/components/form/index.css +1 -1
  20. package/2x/cjs/components/form/index.d.ts +2 -2
  21. package/2x/cjs/components/form/index.js +2 -1
  22. package/2x/cjs/components/image-uploader/image-uploader.js +9 -2
  23. package/2x/cjs/components/index-bar/panel.d.ts +1 -0
  24. package/2x/cjs/components/input/input.css +4 -0
  25. package/2x/cjs/components/input/input.d.ts +2 -0
  26. package/2x/cjs/components/input/input.js +13 -2
  27. package/2x/cjs/components/list/list-item.js +7 -5
  28. package/2x/cjs/components/modal/modal-action-button.js +3 -26
  29. package/2x/cjs/components/search-bar/search-bar.d.ts +2 -0
  30. package/2x/cjs/components/search-bar/search-bar.js +2 -0
  31. package/2x/cjs/components/text-area/text-area.js +1 -1
  32. package/2x/cjs/components/virtual-input/virtual-input.js +2 -1
  33. package/2x/cjs/global/index.js +2 -0
  34. package/2x/cjs/locales/base.d.ts +1 -0
  35. package/2x/cjs/locales/base.js +2 -1
  36. package/2x/cjs/locales/en-US.d.ts +1 -0
  37. package/2x/cjs/locales/es-ES.d.ts +1 -0
  38. package/2x/cjs/locales/fa-IR.d.ts +1 -0
  39. package/2x/cjs/locales/ko-KR.d.ts +1 -0
  40. package/2x/cjs/locales/zh-CN.d.ts +1 -0
  41. package/2x/cjs/locales/zh-CN.js +2 -1
  42. package/2x/cjs/locales/zh-HK.d.ts +1 -0
  43. package/2x/cjs/locales/zh-TW.d.ts +1 -0
  44. package/2x/cjs/utils/is-node-with-content.d.ts +4 -0
  45. package/2x/cjs/utils/is-node-with-content.js +10 -0
  46. package/2x/es/components/button/button.d.ts +6 -4
  47. package/2x/es/components/button/button.js +30 -8
  48. package/2x/es/components/calendar/calendar.css +2 -2
  49. package/2x/es/components/calendar/calendar.d.ts +2 -0
  50. package/2x/es/components/calendar/calendar.js +6 -2
  51. package/2x/es/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  52. package/2x/es/components/cascade-picker/cascade-picker-utils.js +35 -15
  53. package/2x/es/components/cascade-picker/cascade-picker.js +3 -7
  54. package/2x/es/components/cascade-picker-view/cascade-picker-view.js +3 -7
  55. package/2x/es/components/date-picker/date-picker.js +1 -0
  56. package/2x/es/components/dialog/dialog-action-button.js +3 -21
  57. package/2x/es/components/floating-panel/floating-panel.js +1 -1
  58. package/2x/es/components/form/context.d.ts +1 -0
  59. package/2x/es/components/form/context.js +2 -1
  60. package/2x/es/components/form/form-item.css +1 -1
  61. package/2x/es/components/form/form-item.js +3 -1
  62. package/2x/es/components/form/form.d.ts +0 -3
  63. package/2x/es/components/form/form.js +4 -2
  64. package/2x/es/components/form/index.css +1 -1
  65. package/2x/es/components/form/index.d.ts +2 -2
  66. package/2x/es/components/form/index.js +3 -2
  67. package/2x/es/components/image-uploader/image-uploader.js +8 -2
  68. package/2x/es/components/index-bar/panel.d.ts +1 -0
  69. package/2x/es/components/input/input.css +4 -0
  70. package/2x/es/components/input/input.d.ts +2 -0
  71. package/2x/es/components/input/input.js +13 -2
  72. package/2x/es/components/list/list-item.js +6 -5
  73. package/2x/es/components/modal/modal-action-button.js +3 -21
  74. package/2x/es/components/search-bar/search-bar.d.ts +2 -0
  75. package/2x/es/components/search-bar/search-bar.js +2 -0
  76. package/2x/es/components/text-area/text-area.js +2 -2
  77. package/2x/es/components/virtual-input/virtual-input.js +2 -1
  78. package/2x/es/global/index.js +2 -0
  79. package/2x/es/locales/base.d.ts +1 -0
  80. package/2x/es/locales/base.js +2 -1
  81. package/2x/es/locales/en-US.d.ts +1 -0
  82. package/2x/es/locales/es-ES.d.ts +1 -0
  83. package/2x/es/locales/fa-IR.d.ts +1 -0
  84. package/2x/es/locales/ko-KR.d.ts +1 -0
  85. package/2x/es/locales/zh-CN.d.ts +1 -0
  86. package/2x/es/locales/zh-CN.js +2 -1
  87. package/2x/es/locales/zh-HK.d.ts +1 -0
  88. package/2x/es/locales/zh-TW.d.ts +1 -0
  89. package/2x/es/utils/is-node-with-content.d.ts +4 -0
  90. package/2x/es/utils/is-node-with-content.js +3 -0
  91. package/2x/package.json +2 -2
  92. package/bundle/antd-mobile.cjs.js +122 -106
  93. package/bundle/antd-mobile.es.js +124 -108
  94. package/bundle/style.css +6 -3
  95. package/cjs/components/button/button.d.ts +6 -4
  96. package/cjs/components/button/button.js +31 -7
  97. package/cjs/components/calendar/calendar.css +2 -2
  98. package/cjs/components/calendar/calendar.d.ts +2 -0
  99. package/cjs/components/calendar/calendar.js +6 -1
  100. package/cjs/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  101. package/cjs/components/cascade-picker/cascade-picker-utils.js +37 -16
  102. package/cjs/components/cascade-picker/cascade-picker.js +2 -7
  103. package/cjs/components/cascade-picker-view/cascade-picker-view.js +2 -7
  104. package/cjs/components/date-picker/date-picker.js +1 -0
  105. package/cjs/components/dialog/dialog-action-button.js +3 -26
  106. package/cjs/components/floating-panel/floating-panel.js +1 -1
  107. package/cjs/components/form/context.d.ts +1 -0
  108. package/cjs/components/form/context.js +2 -1
  109. package/cjs/components/form/form-item.css +1 -1
  110. package/cjs/components/form/form-item.js +3 -1
  111. package/cjs/components/form/form.d.ts +0 -3
  112. package/cjs/components/form/form.js +4 -2
  113. package/cjs/components/form/index.css +1 -1
  114. package/cjs/components/form/index.d.ts +2 -2
  115. package/cjs/components/form/index.js +2 -1
  116. package/cjs/components/image-uploader/image-uploader.js +9 -2
  117. package/cjs/components/index-bar/panel.d.ts +1 -0
  118. package/cjs/components/input/input.css +3 -0
  119. package/cjs/components/input/input.d.ts +2 -0
  120. package/cjs/components/input/input.js +13 -2
  121. package/cjs/components/list/list-item.js +7 -5
  122. package/cjs/components/modal/modal-action-button.js +3 -26
  123. package/cjs/components/search-bar/search-bar.d.ts +2 -0
  124. package/cjs/components/search-bar/search-bar.js +2 -0
  125. package/cjs/components/text-area/text-area.js +1 -1
  126. package/cjs/components/virtual-input/virtual-input.js +2 -1
  127. package/cjs/global/index.js +2 -0
  128. package/cjs/locales/base.d.ts +1 -0
  129. package/cjs/locales/base.js +2 -1
  130. package/cjs/locales/en-US.d.ts +1 -0
  131. package/cjs/locales/es-ES.d.ts +1 -0
  132. package/cjs/locales/fa-IR.d.ts +1 -0
  133. package/cjs/locales/ko-KR.d.ts +1 -0
  134. package/cjs/locales/zh-CN.d.ts +1 -0
  135. package/cjs/locales/zh-CN.js +2 -1
  136. package/cjs/locales/zh-HK.d.ts +1 -0
  137. package/cjs/locales/zh-TW.d.ts +1 -0
  138. package/cjs/utils/is-node-with-content.d.ts +4 -0
  139. package/cjs/utils/is-node-with-content.js +10 -0
  140. package/es/components/button/button.d.ts +6 -4
  141. package/es/components/button/button.js +30 -8
  142. package/es/components/calendar/calendar.css +2 -2
  143. package/es/components/calendar/calendar.d.ts +2 -0
  144. package/es/components/calendar/calendar.js +6 -2
  145. package/es/components/cascade-picker/cascade-picker-utils.d.ts +2 -2
  146. package/es/components/cascade-picker/cascade-picker-utils.js +35 -15
  147. package/es/components/cascade-picker/cascade-picker.js +3 -7
  148. package/es/components/cascade-picker-view/cascade-picker-view.js +3 -7
  149. package/es/components/date-picker/date-picker.js +1 -0
  150. package/es/components/dialog/dialog-action-button.js +3 -21
  151. package/es/components/floating-panel/floating-panel.js +1 -1
  152. package/es/components/form/context.d.ts +1 -0
  153. package/es/components/form/context.js +2 -1
  154. package/es/components/form/form-item.css +1 -1
  155. package/es/components/form/form-item.js +3 -1
  156. package/es/components/form/form.d.ts +0 -3
  157. package/es/components/form/form.js +4 -2
  158. package/es/components/form/index.css +1 -1
  159. package/es/components/form/index.d.ts +2 -2
  160. package/es/components/form/index.js +3 -2
  161. package/es/components/image-uploader/image-uploader.js +8 -2
  162. package/es/components/index-bar/panel.d.ts +1 -0
  163. package/es/components/input/input.css +3 -0
  164. package/es/components/input/input.d.ts +2 -0
  165. package/es/components/input/input.js +13 -2
  166. package/es/components/list/list-item.js +6 -5
  167. package/es/components/modal/modal-action-button.js +3 -21
  168. package/es/components/search-bar/search-bar.d.ts +2 -0
  169. package/es/components/search-bar/search-bar.js +2 -0
  170. package/es/components/text-area/text-area.js +2 -2
  171. package/es/components/virtual-input/virtual-input.js +2 -1
  172. package/es/global/index.js +2 -0
  173. package/es/locales/base.d.ts +1 -0
  174. package/es/locales/base.js +2 -1
  175. package/es/locales/en-US.d.ts +1 -0
  176. package/es/locales/es-ES.d.ts +1 -0
  177. package/es/locales/fa-IR.d.ts +1 -0
  178. package/es/locales/ko-KR.d.ts +1 -0
  179. package/es/locales/zh-CN.d.ts +1 -0
  180. package/es/locales/zh-CN.js +2 -1
  181. package/es/locales/zh-HK.d.ts +1 -0
  182. package/es/locales/zh-TW.d.ts +1 -0
  183. package/es/utils/is-node-with-content.d.ts +4 -0
  184. package/es/utils/is-node-with-content.js +3 -0
  185. package/package.json +2 -2
  186. package/umd/antd-mobile.js +1 -1
  187. package/2x/cjs/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  188. package/2x/cjs/components/cascade-picker/use-cascade-picker-options.js +0 -40
  189. package/2x/es/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  190. package/2x/es/components/cascade-picker/use-cascade-picker-options.js +0 -32
  191. package/cjs/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  192. package/cjs/components/cascade-picker/use-cascade-picker-options.js +0 -40
  193. package/es/components/cascade-picker/use-cascade-picker-options.d.ts +0 -5
  194. package/es/components/cascade-picker/use-cascade-picker-options.js +0 -32
@@ -1323,7 +1323,8 @@ const base = {
1323
1323
  }
1324
1324
  },
1325
1325
  ImageUploader: {
1326
- uploading: "Uploading..."
1326
+ uploading: "Uploading...",
1327
+ upload: "Upload"
1327
1328
  },
1328
1329
  InfiniteScroll: {
1329
1330
  noMore: "No more"
@@ -1428,7 +1429,8 @@ const zhCN = mergeLocale(base, {
1428
1429
  }
1429
1430
  },
1430
1431
  ImageUploader: {
1431
- uploading: "\u4E0A\u4F20\u4E2D..."
1432
+ uploading: "\u4E0A\u4F20\u4E2D...",
1433
+ upload: "\u4E0A\u4F20"
1432
1434
  },
1433
1435
  InfiniteScroll: {
1434
1436
  noMore: "\u6CA1\u6709\u66F4\u591A\u4E86"
@@ -8445,29 +8447,52 @@ const DotLoading = React$1.memo((p) => {
8445
8447
  keyTimes: "0; 0.1; 0.3; 0.4; 1"
8446
8448
  }))))))))));
8447
8449
  });
8450
+ function isPromise(obj) {
8451
+ return !!obj && typeof obj === "object" && typeof obj.then === "function";
8452
+ }
8448
8453
  const classPrefix$1d = `adm-button`;
8449
8454
  const defaultProps$W = {
8450
8455
  color: "default",
8451
8456
  fill: "solid",
8452
8457
  block: false,
8453
8458
  loading: false,
8459
+ loadingIcon: React__default["default"].createElement(DotLoading, {
8460
+ color: "currentColor"
8461
+ }),
8454
8462
  type: "button",
8455
8463
  shape: "default",
8456
8464
  size: "middle"
8457
8465
  };
8458
8466
  const Button = React$1.forwardRef((p, ref) => {
8459
8467
  const props = mergeProps(defaultProps$W, p);
8460
- const disabled = props.disabled || props.loading;
8468
+ const [innerLoading, setInnerLoading] = React$1.useState(false);
8461
8469
  const nativeButtonRef = React$1.useRef(null);
8470
+ const loading = props.loading === "auto" ? innerLoading : props.loading;
8471
+ const disabled = props.disabled || loading;
8462
8472
  React$1.useImperativeHandle(ref, () => ({
8463
8473
  get nativeElement() {
8464
8474
  return nativeButtonRef.current;
8465
8475
  }
8466
8476
  }));
8477
+ const handleClick = (e) => tslib.__awaiter(void 0, void 0, void 0, function* () {
8478
+ if (!props.onClick)
8479
+ return;
8480
+ const promise = props.onClick(e);
8481
+ if (isPromise(promise)) {
8482
+ try {
8483
+ setInnerLoading(true);
8484
+ yield promise;
8485
+ setInnerLoading(false);
8486
+ } catch (e2) {
8487
+ setInnerLoading(false);
8488
+ throw e2;
8489
+ }
8490
+ }
8491
+ });
8467
8492
  return withNativeProps(props, React__default["default"].createElement("button", {
8468
8493
  ref: nativeButtonRef,
8469
8494
  type: props.type,
8470
- onClick: props.onClick,
8495
+ onClick: handleClick,
8471
8496
  className: classNames__default["default"](classPrefix$1d, props.color ? `${classPrefix$1d}-${props.color}` : null, {
8472
8497
  [`${classPrefix$1d}-block`]: props.block,
8473
8498
  [`${classPrefix$1d}-disabled`]: disabled,
@@ -8476,14 +8501,12 @@ const Button = React$1.forwardRef((p, ref) => {
8476
8501
  [`${classPrefix$1d}-mini`]: props.size === "mini",
8477
8502
  [`${classPrefix$1d}-small`]: props.size === "small",
8478
8503
  [`${classPrefix$1d}-large`]: props.size === "large",
8479
- [`${classPrefix$1d}-loading`]: props.loading
8504
+ [`${classPrefix$1d}-loading`]: loading
8480
8505
  }, `${classPrefix$1d}-shape-${props.shape}`),
8481
8506
  disabled
8482
- }, props.loading ? React__default["default"].createElement("div", {
8507
+ }, loading ? React__default["default"].createElement("div", {
8483
8508
  className: `${classPrefix$1d}-loading-wrapper`
8484
- }, React__default["default"].createElement(DotLoading, {
8485
- color: "currentColor"
8486
- }), props.loadingText) : props.children));
8509
+ }, props.loadingIcon, props.loadingText) : props.children));
8487
8510
  });
8488
8511
  var safeArea = "";
8489
8512
  const classPrefix$1c = "adm-safe-area";
@@ -8914,6 +8937,8 @@ const Calendar = React$1.forwardRef((p, ref) => {
8914
8937
  setCurrent(current.add(1, "year"));
8915
8938
  }
8916
8939
  }, React__default["default"].createElement(ArrowLeftDouble, null)));
8940
+ const maxDay = React$1.useMemo(() => props.max && dayjs__default["default"](props.max), [props.max]);
8941
+ const minDay = React$1.useMemo(() => props.min && dayjs__default["default"](props.min), [props.min]);
8917
8942
  function renderCells() {
8918
8943
  var _a;
8919
8944
  const cells = [];
@@ -8933,9 +8958,10 @@ const Calendar = React$1.forwardRef((p, ref) => {
8933
8958
  isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
8934
8959
  }
8935
8960
  const inThisMonth = d.month() === current.month();
8961
+ const disabled = !inThisMonth || maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
8936
8962
  cells.push(React__default["default"].createElement("div", {
8937
8963
  key: d.valueOf(),
8938
- className: classNames__default["default"](`${classPrefix$17}-cell`, inThisMonth ? `${classPrefix$17}-cell-in` : `${classPrefix$17}-cell-out`, inThisMonth && {
8964
+ className: classNames__default["default"](`${classPrefix$17}-cell`, disabled && `${classPrefix$17}-cell-disabled`, inThisMonth && {
8939
8965
  [`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
8940
8966
  [`${classPrefix$17}-cell-selected`]: isSelect,
8941
8967
  [`${classPrefix$17}-cell-selected-begin`]: isBegin,
@@ -8944,6 +8970,8 @@ const Calendar = React$1.forwardRef((p, ref) => {
8944
8970
  onClick: () => {
8945
8971
  if (!props.selectionMode)
8946
8972
  return;
8973
+ if (disabled)
8974
+ return;
8947
8975
  const date = d.toDate();
8948
8976
  if (!inThisMonth) {
8949
8977
  setCurrent(d.clone().date(1));
@@ -9990,62 +10018,52 @@ function prompt$3(props) {
9990
10018
  var Picker = attachPropertiesToComponent(Picker$1, {
9991
10019
  prompt: prompt$3
9992
10020
  });
9993
- function useCascadePickerOptions(options) {
9994
- return React$1.useMemo(() => {
9995
- let depth = 1;
9996
- const subOptionsRecord = {};
9997
- function traverse(option, currentDepth) {
9998
- if (!option.children) {
9999
- return;
10000
- }
10001
- subOptionsRecord[option.value] = option.children;
10021
+ function useColumnsFn(options) {
10022
+ const depth = React$1.useMemo(() => {
10023
+ let depth2 = 0;
10024
+ function traverse(options2, currentDepth) {
10025
+ if (currentDepth > depth2)
10026
+ depth2 = currentDepth;
10002
10027
  const nextDepth = currentDepth + 1;
10003
- if (nextDepth > depth) {
10004
- depth = nextDepth;
10005
- }
10006
- option.children.forEach((option2) => {
10007
- traverse(option2, nextDepth);
10028
+ options2.forEach((option) => {
10029
+ if (option.children) {
10030
+ traverse(option.children, nextDepth);
10031
+ }
10008
10032
  });
10009
10033
  }
10010
- options.forEach((option) => {
10011
- traverse(option, 1);
10012
- });
10013
- return {
10014
- depth,
10015
- subOptionsRecord
10016
- };
10034
+ traverse(options, 1);
10035
+ return depth2;
10017
10036
  }, [options]);
10018
- }
10019
- function generateCascadePickerColumns(value, options, depth, subOptionsRecord) {
10020
- const columns = [];
10021
- columns.push(options.map((option) => ({
10022
- label: option.label,
10023
- value: option.value
10024
- })));
10025
- for (let i = 0; i < depth - 1; i++) {
10026
- const x = value[i];
10027
- const subOptions = subOptionsRecord[x];
10028
- if (!subOptions) {
10029
- columns.push([]);
10030
- } else {
10031
- columns.push(subOptions.map((option) => ({
10037
+ return (selected) => {
10038
+ const columns = [];
10039
+ let currentOptions = options;
10040
+ let i = 0;
10041
+ while (true) {
10042
+ columns.push(currentOptions.map((option) => ({
10032
10043
  label: option.label,
10033
10044
  value: option.value
10034
10045
  })));
10046
+ const x = selected[i];
10047
+ const targetOptions = currentOptions.find((option) => option.value === x);
10048
+ if (!targetOptions || !targetOptions.children)
10049
+ break;
10050
+ currentOptions = targetOptions.children;
10051
+ i++;
10035
10052
  }
10036
- }
10037
- return columns;
10053
+ while (i < depth - 1) {
10054
+ columns.push([]);
10055
+ i++;
10056
+ }
10057
+ return columns;
10058
+ };
10038
10059
  }
10039
10060
  const CascadePicker = (props) => {
10040
10061
  const {
10041
10062
  options
10042
10063
  } = props, pickerProps = tslib.__rest(props, ["options"]);
10043
- const {
10044
- depth,
10045
- subOptionsRecord
10046
- } = useCascadePickerOptions(options);
10064
+ const columnsFn = useColumnsFn(options);
10047
10065
  return React__default["default"].createElement(Picker, Object.assign({}, pickerProps, {
10048
- columns: (selected) => generateCascadePickerColumns(selected, options, depth, subOptionsRecord)
10066
+ columns: columnsFn
10049
10067
  }));
10050
10068
  };
10051
10069
  function prompt$2(props) {
@@ -10085,12 +10103,9 @@ const CascadePickerView = (props) => {
10085
10103
  const {
10086
10104
  options
10087
10105
  } = props, pickerProps = tslib.__rest(props, ["options"]);
10088
- const {
10089
- depth,
10090
- subOptionsRecord
10091
- } = useCascadePickerOptions(options);
10106
+ const columnsFn = useColumnsFn(options);
10092
10107
  return React__default["default"].createElement(PickerView, Object.assign({}, pickerProps, {
10093
- columns: (selected) => generateCascadePickerColumns(selected, options, depth, subOptionsRecord)
10108
+ columns: columnsFn
10094
10109
  }));
10095
10110
  };
10096
10111
  var cascaderView = "";
@@ -10341,6 +10356,9 @@ const List$1 = (p) => {
10341
10356
  className: `${classPrefix$$}-body-inner`
10342
10357
  }, props.children))));
10343
10358
  };
10359
+ function isNodeWithContent(node) {
10360
+ return node !== void 0 && node !== null && node !== false;
10361
+ }
10344
10362
  const classPrefix$_ = `adm-list-item`;
10345
10363
  const ListItem = (props) => {
10346
10364
  var _a;
@@ -10348,17 +10366,17 @@ const ListItem = (props) => {
10348
10366
  const arrow = props.arrow === void 0 ? clickable : props.arrow;
10349
10367
  const content = React__default["default"].createElement("div", {
10350
10368
  className: `${classPrefix$_}-content`
10351
- }, props.prefix && React__default["default"].createElement("div", {
10369
+ }, isNodeWithContent(props.prefix) && React__default["default"].createElement("div", {
10352
10370
  className: `${classPrefix$_}-content-prefix`
10353
10371
  }, props.prefix), React__default["default"].createElement("div", {
10354
10372
  className: `${classPrefix$_}-content-main`
10355
- }, props.title && React__default["default"].createElement("div", {
10373
+ }, isNodeWithContent(props.title) && React__default["default"].createElement("div", {
10356
10374
  className: `${classPrefix$_}-title`
10357
- }, props.title), props.children, props.description && React__default["default"].createElement("div", {
10375
+ }, props.title), props.children, isNodeWithContent(props.description) && React__default["default"].createElement("div", {
10358
10376
  className: `${classPrefix$_}-description`
10359
- }, props.description)), props.extra && React__default["default"].createElement("div", {
10377
+ }, props.description)), isNodeWithContent(props.extra) && React__default["default"].createElement("div", {
10360
10378
  className: `${classPrefix$_}-content-extra`
10361
- }, props.extra), arrow && React__default["default"].createElement("div", {
10379
+ }, props.extra), isNodeWithContent(arrow) && React__default["default"].createElement("div", {
10362
10380
  className: `${classPrefix$_}-content-arrow`
10363
10381
  }, arrow === true ? React__default["default"].createElement(antdMobileIcons.RightOutline, null) : arrow));
10364
10382
  return withNativeProps(props, React__default["default"].createElement(clickable ? "a" : "div", {
@@ -11401,6 +11419,7 @@ const DatePicker = (p) => {
11401
11419
  value: pickerValue,
11402
11420
  onCancel: props.onCancel,
11403
11421
  onClose: props.onClose,
11422
+ closeOnMaskClick: props.closeOnMaskClick,
11404
11423
  visible: props.visible,
11405
11424
  confirmText: props.confirmText,
11406
11425
  cancelText: props.cancelText,
@@ -11486,23 +11505,9 @@ const DialogActionButton = (props) => {
11486
11505
  const {
11487
11506
  action
11488
11507
  } = props;
11489
- const [loading, setLoading] = React$1.useState(false);
11490
- function handleClick() {
11491
- return tslib.__awaiter(this, void 0, void 0, function* () {
11492
- setLoading(true);
11493
- try {
11494
- const promise = props.onAction();
11495
- yield promise;
11496
- setLoading(false);
11497
- } catch (e) {
11498
- setLoading(false);
11499
- throw e;
11500
- }
11501
- });
11502
- }
11503
11508
  return withNativeProps(props.action, React__default["default"].createElement(Button, {
11504
11509
  key: action.key,
11505
- onClick: handleClick,
11510
+ onClick: props.onAction,
11506
11511
  className: classNames__default["default"]("adm-dialog-button", {
11507
11512
  "adm-dialog-button-bold": action.bold
11508
11513
  }),
@@ -11510,7 +11515,7 @@ const DialogActionButton = (props) => {
11510
11515
  shape: "rectangular",
11511
11516
  block: true,
11512
11517
  color: action.danger ? "danger" : "primary",
11513
- loading,
11518
+ loading: "auto",
11514
11519
  disabled: action.disabled
11515
11520
  }, action.text));
11516
11521
  };
@@ -12783,7 +12788,7 @@ const FloatingPanel = React$1.forwardRef((p, ref) => {
12783
12788
  tension: 300
12784
12789
  },
12785
12790
  onChange: (result2) => {
12786
- onHeightChange(result2.value.y, y2.isAnimating);
12791
+ onHeightChange(-result2.value.y, y2.isAnimating);
12787
12792
  }
12788
12793
  }));
12789
12794
  react.useDrag((state) => {
@@ -12877,7 +12882,8 @@ const defaultFormContext = {
12877
12882
  name: void 0,
12878
12883
  hasFeedback: true,
12879
12884
  layout: "vertical",
12880
- requiredMarkStyle: "asterisk"
12885
+ requiredMarkStyle: "asterisk",
12886
+ disabled: false
12881
12887
  };
12882
12888
  const FormContext = React__default["default"].createContext(defaultFormContext);
12883
12889
  const NoStyleItemContext = React__default["default"].createContext(null);
@@ -12926,8 +12932,9 @@ const Form$1 = React$1.forwardRef((p, ref) => {
12926
12932
  layout,
12927
12933
  footer,
12928
12934
  mode,
12935
+ disabled,
12929
12936
  requiredMarkStyle
12930
- } = props, formProps = tslib.__rest(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode", "requiredMarkStyle"]);
12937
+ } = props, formProps = tslib.__rest(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode", "disabled", "requiredMarkStyle"]);
12931
12938
  const {
12932
12939
  locale
12933
12940
  } = useConfig();
@@ -12974,7 +12981,8 @@ const Form$1 = React$1.forwardRef((p, ref) => {
12974
12981
  name: formProps.name,
12975
12982
  hasFeedback,
12976
12983
  layout,
12977
- requiredMarkStyle
12984
+ requiredMarkStyle,
12985
+ disabled
12978
12986
  }
12979
12987
  }, lists), footer && React__default["default"].createElement("div", {
12980
12988
  className: `${classPrefix$K}-footer`
@@ -13126,7 +13134,9 @@ var Context = /* @__PURE__ */ React.createContext({
13126
13134
  registerField: warningFunc,
13127
13135
  useSubscribe: warningFunc,
13128
13136
  setInitialValues: warningFunc,
13137
+ destroyForm: warningFunc,
13129
13138
  setCallbacks: warningFunc,
13139
+ registerWatch: warningFunc,
13130
13140
  getFields: warningFunc,
13131
13141
  setValidateMessages: warningFunc,
13132
13142
  setPreserve: warningFunc,
@@ -13401,6 +13411,7 @@ const MemoInput = React__default["default"].memo(({
13401
13411
  children
13402
13412
  }) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
13403
13413
  const FormItemLayout = (props) => {
13414
+ var _a;
13404
13415
  const {
13405
13416
  className,
13406
13417
  style,
@@ -13408,7 +13419,6 @@ const FormItemLayout = (props) => {
13408
13419
  label,
13409
13420
  help,
13410
13421
  required,
13411
- disabled,
13412
13422
  children,
13413
13423
  htmlFor,
13414
13424
  hidden,
@@ -13421,6 +13431,7 @@ const FormItemLayout = (props) => {
13421
13431
  } = useConfig();
13422
13432
  const hasFeedback = props.hasFeedback !== void 0 ? props.hasFeedback : context.hasFeedback;
13423
13433
  const layout = props.layout || context.layout;
13434
+ const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
13424
13435
  const requiredMark = (() => {
13425
13436
  const {
13426
13437
  requiredMarkStyle
@@ -13657,7 +13668,8 @@ var Form = attachPropertiesToComponent(Form$1, {
13657
13668
  Subscribe: FormSubscribe,
13658
13669
  Header,
13659
13670
  Array: FormArray,
13660
- useForm: RcForm.useForm
13671
+ useForm: RcForm.useForm,
13672
+ useWatch: RcForm.useWatch
13661
13673
  });
13662
13674
  var grid = "";
13663
13675
  const classPrefix$G = `adm-grid`;
@@ -14159,6 +14171,9 @@ const defaultProps$t = {
14159
14171
  imageFit: "cover"
14160
14172
  };
14161
14173
  const ImageUploader = (p) => {
14174
+ const {
14175
+ locale
14176
+ } = useConfig();
14162
14177
  const props = mergeProps(defaultProps$t, p);
14163
14178
  const [value, setValue] = usePropsValue(props);
14164
14179
  const updateValue = ahooks.useMemoizedFn((updater) => {
@@ -14315,7 +14330,8 @@ const ImageUploader = (p) => {
14315
14330
  className: `${classPrefix$z}-upload-button-wrap`
14316
14331
  }, props.children ? props.children : React__default["default"].createElement("span", {
14317
14332
  className: `${classPrefix$z}-cell ${classPrefix$z}-upload-button`,
14318
- role: "button"
14333
+ role: "button",
14334
+ "aria-label": locale.ImageUploader.upload
14319
14335
  }, React__default["default"].createElement("span", {
14320
14336
  className: `${classPrefix$z}-upload-button-icon`
14321
14337
  }, React__default["default"].createElement(antdMobileIcons.AddOutline, null))), !props.disableUpload && React__default["default"].createElement("input", {
@@ -14324,7 +14340,8 @@ const ImageUploader = (p) => {
14324
14340
  multiple: props.multiple,
14325
14341
  type: "file",
14326
14342
  className: `${classPrefix$z}-input`,
14327
- onChange
14343
+ onChange,
14344
+ "aria-hidden": true
14328
14345
  })))));
14329
14346
  };
14330
14347
  var imageUploader = "";
@@ -14563,7 +14580,8 @@ const InfiniteScroll = (p) => {
14563
14580
  var input = "";
14564
14581
  const classPrefix$v = `adm-input`;
14565
14582
  const defaultProps$r = {
14566
- defaultValue: ""
14583
+ defaultValue: "",
14584
+ onlyShowClearWhenFocus: true
14567
14585
  };
14568
14586
  const Input = React$1.forwardRef((p, ref) => {
14569
14587
  const props = mergeProps(defaultProps$r, p);
@@ -14612,6 +14630,15 @@ const Input = React$1.forwardRef((p, ref) => {
14612
14630
  setValue(nextValue);
14613
14631
  }
14614
14632
  }
14633
+ const shouldShowClear = (() => {
14634
+ if (!props.clearable || !value || props.readOnly)
14635
+ return false;
14636
+ if (props.onlyShowClearWhenFocus) {
14637
+ return hasFocus;
14638
+ } else {
14639
+ return true;
14640
+ }
14641
+ })();
14615
14642
  return withNativeProps(props, React__default["default"].createElement("div", {
14616
14643
  className: classNames__default["default"](`${classPrefix$v}`, props.disabled && `${classPrefix$v}-disabled`)
14617
14644
  }, React__default["default"].createElement("input", {
@@ -14652,7 +14679,7 @@ const Input = React$1.forwardRef((p, ref) => {
14652
14679
  onCompositionStart: props.onCompositionStart,
14653
14680
  onCompositionEnd: props.onCompositionEnd,
14654
14681
  onClick: props.onClick
14655
- }), props.clearable && !!value && !props.readOnly && hasFocus && React__default["default"].createElement("div", {
14682
+ }), shouldShowClear && React__default["default"].createElement("div", {
14656
14683
  className: `${classPrefix$v}-clear`,
14657
14684
  onMouseDown: (e) => {
14658
14685
  e.preventDefault();
@@ -14765,23 +14792,9 @@ const ModalActionButton = (props) => {
14765
14792
  const {
14766
14793
  action
14767
14794
  } = props;
14768
- const [loading, setLoading] = React$1.useState(false);
14769
- function handleClick() {
14770
- return tslib.__awaiter(this, void 0, void 0, function* () {
14771
- setLoading(true);
14772
- try {
14773
- const promise = props.onAction();
14774
- yield promise;
14775
- setLoading(false);
14776
- } catch (e) {
14777
- setLoading(false);
14778
- throw e;
14779
- }
14780
- });
14781
- }
14782
14795
  return withNativeProps(props.action, React__default["default"].createElement(Button, {
14783
14796
  key: action.key,
14784
- onClick: handleClick,
14797
+ onClick: props.onAction,
14785
14798
  className: classNames__default["default"]("adm-modal-button", {
14786
14799
  "adm-modal-button-primary": props.action.primary
14787
14800
  }),
@@ -14789,7 +14802,7 @@ const ModalActionButton = (props) => {
14789
14802
  size: props.action.primary ? "large" : "middle",
14790
14803
  block: true,
14791
14804
  color: action.danger ? "danger" : "primary",
14792
- loading,
14805
+ loading: "auto",
14793
14806
  disabled: action.disabled
14794
14807
  }, action.text));
14795
14808
  };
@@ -15766,6 +15779,7 @@ var searchBar = "";
15766
15779
  const classPrefix$i = `adm-search-bar`;
15767
15780
  const defaultProps$f = {
15768
15781
  clearable: true,
15782
+ onlyShowClearWhenFocus: false,
15769
15783
  showCancelButton: false,
15770
15784
  defaultValue: "",
15771
15785
  clearOnCancel: true,
@@ -15845,6 +15859,7 @@ const SearchBar = React$1.forwardRef((p, ref) => {
15845
15859
  maxLength: props.maxLength,
15846
15860
  placeholder: props.placeholder,
15847
15861
  clearable: props.clearable,
15862
+ onlyShowClearWhenFocus: props.onlyShowClearWhenFocus,
15848
15863
  onFocus: (e) => {
15849
15864
  var _a;
15850
15865
  setHasFocus(true);
@@ -17184,7 +17199,7 @@ const TextArea = React$1.forwardRef((p, ref) => {
17184
17199
  (_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
17185
17200
  }
17186
17201
  }));
17187
- React$1.useEffect(() => {
17202
+ React$1.useLayoutEffect(() => {
17188
17203
  if (!autoSize)
17189
17204
  return;
17190
17205
  const textArea2 = nativeTextAreaRef.current;
@@ -17820,7 +17835,8 @@ const VirtualInput = React$1.forwardRef((p, ref) => {
17820
17835
  var _a, _b, _c;
17821
17836
  (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
17822
17837
  (_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
17823
- }
17838
+ },
17839
+ getContainer: null
17824
17840
  });
17825
17841
  return withNativeProps(props, React__default["default"].createElement("div", {
17826
17842
  ref: rootRef,