antd-mobile 5.38.1 → 5.39.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 (110) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +158 -124
  2. package/2x/bundle/antd-mobile.cjs.js +7 -7
  3. package/2x/bundle/antd-mobile.es.development.js +158 -124
  4. package/2x/bundle/antd-mobile.es.js +3726 -3707
  5. package/2x/bundle/antd-mobile.umd.development.js +158 -124
  6. package/2x/bundle/antd-mobile.umd.js +7 -7
  7. package/2x/bundle/style.css +16 -2
  8. package/2x/cjs/components/calendar-picker/calendar-picker.d.ts +9 -9
  9. package/2x/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +5 -4
  10. package/2x/cjs/components/calendar-picker-view/calendar-picker-view.js +18 -11
  11. package/2x/cjs/components/date-picker/date-picker-week-utils.js +2 -2
  12. package/2x/cjs/components/ellipsis/useMeasure.js +7 -3
  13. package/2x/cjs/components/floating-panel/floating-panel.css +16 -2
  14. package/2x/cjs/components/floating-panel/floating-panel.d.ts +3 -1
  15. package/2x/cjs/components/floating-panel/floating-panel.js +43 -30
  16. package/2x/cjs/components/image-uploader/image-uploader.d.ts +3 -3
  17. package/2x/cjs/components/image-uploader/image-uploader.js +11 -11
  18. package/2x/cjs/components/image-viewer/image-viewer.d.ts +13 -4
  19. package/2x/cjs/components/image-viewer/image-viewer.js +8 -6
  20. package/2x/cjs/components/image-viewer/index.d.ts +4 -1
  21. package/2x/cjs/components/image-viewer/slide.d.ts +5 -1
  22. package/2x/cjs/components/image-viewer/slide.js +10 -5
  23. package/2x/cjs/components/image-viewer/slides.d.ts +4 -1
  24. package/2x/cjs/components/image-viewer/slides.js +14 -12
  25. package/2x/cjs/components/passcode-input/passcode-input.d.ts +7 -5
  26. package/2x/cjs/components/passcode-input/passcode-input.js +7 -6
  27. package/2x/cjs/components/popover/popover.d.ts +2 -2
  28. package/2x/cjs/components/popover/popover.js +11 -11
  29. package/2x/cjs/components/swipe-action/swipe-action.d.ts +3 -1
  30. package/2x/cjs/components/swipe-action/swipe-action.js +25 -23
  31. package/2x/es/components/calendar-picker/calendar-picker.d.ts +9 -9
  32. package/2x/es/components/calendar-picker-view/calendar-picker-view.d.ts +5 -4
  33. package/2x/es/components/calendar-picker-view/calendar-picker-view.js +18 -11
  34. package/2x/es/components/date-picker/date-picker-week-utils.js +2 -2
  35. package/2x/es/components/ellipsis/useMeasure.js +7 -3
  36. package/2x/es/components/floating-panel/floating-panel.css +16 -2
  37. package/2x/es/components/floating-panel/floating-panel.d.ts +3 -1
  38. package/2x/es/components/floating-panel/floating-panel.js +31 -19
  39. package/2x/es/components/image-uploader/image-uploader.d.ts +3 -3
  40. package/2x/es/components/image-uploader/image-uploader.js +11 -11
  41. package/2x/es/components/image-viewer/image-viewer.d.ts +13 -4
  42. package/2x/es/components/image-viewer/image-viewer.js +8 -6
  43. package/2x/es/components/image-viewer/index.d.ts +4 -1
  44. package/2x/es/components/image-viewer/slide.d.ts +5 -1
  45. package/2x/es/components/image-viewer/slide.js +11 -6
  46. package/2x/es/components/image-viewer/slides.d.ts +4 -1
  47. package/2x/es/components/image-viewer/slides.js +6 -4
  48. package/2x/es/components/passcode-input/passcode-input.d.ts +7 -5
  49. package/2x/es/components/passcode-input/passcode-input.js +6 -5
  50. package/2x/es/components/popover/popover.d.ts +2 -2
  51. package/2x/es/components/popover/popover.js +10 -10
  52. package/2x/es/components/swipe-action/swipe-action.d.ts +3 -1
  53. package/2x/es/components/swipe-action/swipe-action.js +9 -7
  54. package/2x/package.json +1 -1
  55. package/bundle/antd-mobile.cjs.development.js +158 -124
  56. package/bundle/antd-mobile.cjs.js +7 -7
  57. package/bundle/antd-mobile.compatible.umd.js +1 -1
  58. package/bundle/antd-mobile.es.development.js +158 -124
  59. package/bundle/antd-mobile.es.js +3726 -3707
  60. package/bundle/antd-mobile.umd.development.js +158 -124
  61. package/bundle/antd-mobile.umd.js +7 -7
  62. package/bundle/style.css +1 -1
  63. package/cjs/components/calendar-picker/calendar-picker.d.ts +9 -9
  64. package/cjs/components/calendar-picker-view/calendar-picker-view.d.ts +5 -4
  65. package/cjs/components/calendar-picker-view/calendar-picker-view.js +18 -11
  66. package/cjs/components/date-picker/date-picker-week-utils.js +2 -2
  67. package/cjs/components/ellipsis/useMeasure.js +7 -3
  68. package/cjs/components/floating-panel/floating-panel.css +12 -2
  69. package/cjs/components/floating-panel/floating-panel.d.ts +3 -1
  70. package/cjs/components/floating-panel/floating-panel.js +43 -30
  71. package/cjs/components/image-uploader/image-uploader.d.ts +3 -3
  72. package/cjs/components/image-uploader/image-uploader.js +11 -11
  73. package/cjs/components/image-viewer/image-viewer.d.ts +13 -4
  74. package/cjs/components/image-viewer/image-viewer.js +8 -6
  75. package/cjs/components/image-viewer/index.d.ts +4 -1
  76. package/cjs/components/image-viewer/slide.d.ts +5 -1
  77. package/cjs/components/image-viewer/slide.js +10 -5
  78. package/cjs/components/image-viewer/slides.d.ts +4 -1
  79. package/cjs/components/image-viewer/slides.js +14 -12
  80. package/cjs/components/passcode-input/passcode-input.d.ts +7 -5
  81. package/cjs/components/passcode-input/passcode-input.js +7 -6
  82. package/cjs/components/popover/popover.d.ts +2 -2
  83. package/cjs/components/popover/popover.js +11 -11
  84. package/cjs/components/swipe-action/swipe-action.d.ts +3 -1
  85. package/cjs/components/swipe-action/swipe-action.js +25 -23
  86. package/es/components/calendar-picker/calendar-picker.d.ts +9 -9
  87. package/es/components/calendar-picker-view/calendar-picker-view.d.ts +5 -4
  88. package/es/components/calendar-picker-view/calendar-picker-view.js +18 -11
  89. package/es/components/date-picker/date-picker-week-utils.js +2 -2
  90. package/es/components/ellipsis/useMeasure.js +7 -3
  91. package/es/components/floating-panel/floating-panel.css +12 -2
  92. package/es/components/floating-panel/floating-panel.d.ts +3 -1
  93. package/es/components/floating-panel/floating-panel.js +31 -19
  94. package/es/components/image-uploader/image-uploader.d.ts +3 -3
  95. package/es/components/image-uploader/image-uploader.js +11 -11
  96. package/es/components/image-viewer/image-viewer.d.ts +13 -4
  97. package/es/components/image-viewer/image-viewer.js +8 -6
  98. package/es/components/image-viewer/index.d.ts +4 -1
  99. package/es/components/image-viewer/slide.d.ts +5 -1
  100. package/es/components/image-viewer/slide.js +11 -6
  101. package/es/components/image-viewer/slides.d.ts +4 -1
  102. package/es/components/image-viewer/slides.js +6 -4
  103. package/es/components/passcode-input/passcode-input.d.ts +7 -5
  104. package/es/components/passcode-input/passcode-input.js +6 -5
  105. package/es/components/popover/popover.d.ts +2 -2
  106. package/es/components/popover/popover.js +10 -10
  107. package/es/components/swipe-action/swipe-action.d.ts +3 -1
  108. package/es/components/swipe-action/swipe-action.js +9 -7
  109. package/package.json +1 -1
  110. package/umd/antd-mobile.js +1 -1
@@ -10148,7 +10148,6 @@ const CalendarPickerView = React$1.forwardRef((p, ref) => {
10148
10148
  })), React$1.createElement("div", {
10149
10149
  className: `${classPrefix$1f}-cells`
10150
10150
  }, presetEmptyCells, Array(monthIterator.daysInMonth()).fill(null).map((_, index2) => {
10151
- var _a3;
10152
10151
  const d = monthIterator.date(index2 + 1);
10153
10152
  let isSelect = false;
10154
10153
  let isBegin = false;
@@ -10167,22 +10166,36 @@ const CalendarPickerView = React$1.forwardRef((p, ref) => {
10167
10166
  }
10168
10167
  const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
10169
10168
  const renderTop = () => {
10170
- var _a4;
10171
- const top = (_a4 = props.renderTop) === null || _a4 === void 0 ? void 0 : _a4.call(props, d.toDate());
10169
+ var _a3;
10170
+ if (props.renderTop === false)
10171
+ return null;
10172
+ const contentWrapper = (content) => React$1.createElement("div", {
10173
+ className: `${classPrefix$1f}-cell-top`
10174
+ }, content);
10175
+ const top = (_a3 = props.renderTop) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate());
10172
10176
  if (top) {
10173
- return top;
10177
+ return contentWrapper(top);
10174
10178
  }
10175
10179
  if (props.selectionMode === "range") {
10176
10180
  if (isBegin) {
10177
- return locale.Calendar.start;
10181
+ return contentWrapper(locale.Calendar.start);
10178
10182
  }
10179
10183
  if (isEnd) {
10180
- return locale.Calendar.end;
10184
+ return contentWrapper(locale.Calendar.end);
10181
10185
  }
10182
10186
  }
10183
10187
  if (d.isSame(today, "day") && !isSelect) {
10184
- return locale.Calendar.today;
10188
+ return contentWrapper(locale.Calendar.today);
10185
10189
  }
10190
+ return contentWrapper(null);
10191
+ };
10192
+ const renderBottom = () => {
10193
+ var _a3;
10194
+ if (props.renderBottom === false)
10195
+ return null;
10196
+ return React$1.createElement("div", {
10197
+ className: `${classPrefix$1f}-cell-bottom`
10198
+ }, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate()));
10186
10199
  };
10187
10200
  return React$1.createElement("div", {
10188
10201
  key: d.valueOf(),
@@ -10236,13 +10249,9 @@ const CalendarPickerView = React$1.forwardRef((p, ref) => {
10236
10249
  }
10237
10250
  }
10238
10251
  }
10239
- }, React$1.createElement("div", {
10240
- className: `${classPrefix$1f}-cell-top`
10241
- }, renderTop()), React$1.createElement("div", {
10252
+ }, renderTop(), React$1.createElement("div", {
10242
10253
  className: `${classPrefix$1f}-cell-date`
10243
- }, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React$1.createElement("div", {
10244
- className: `${classPrefix$1f}-cell-bottom`
10245
- }, (_a3 = props.renderBottom) === null || _a3 === void 0 ? void 0 : _a3.call(props, d.toDate())));
10254
+ }, props.renderDate ? props.renderDate(d.toDate()) : d.date()), renderBottom());
10246
10255
  }))));
10247
10256
  monthIterator = monthIterator.add(1, "month");
10248
10257
  }
@@ -13183,7 +13192,7 @@ function convertStringArrayToDate$1(value) {
13183
13192
  const yearString = (_a = value[0]) !== null && _a !== void 0 ? _a : "1900";
13184
13193
  const weekString = (_b = value[1]) !== null && _b !== void 0 ? _b : "1";
13185
13194
  const weekdayString = (_c = value[2]) !== null && _c !== void 0 ? _c : "1";
13186
- const day = dayjs().year(parseInt(yearString)).isoWeek(parseInt(weekString)).isoWeekday(parseInt(weekdayString)).hour(0).minute(0).second(0);
13195
+ const day = dayjs(`${parseInt(yearString)}-01-01`).isoWeek(parseInt(weekString)).isoWeekday(parseInt(weekdayString)).hour(0).minute(0).second(0);
13187
13196
  return day.toDate();
13188
13197
  }
13189
13198
  const precisionLengthRecord = {
@@ -13794,11 +13803,13 @@ function useMeasure(containerRef, content, rows, direction, expanded, expandNode
13794
13803
  const fullMeasureRef = React$1.useRef(null);
13795
13804
  const midMeasureRef = React$1.useRef(null);
13796
13805
  const startMeasure = useEvent(() => {
13797
- setStatus(
13798
- 1
13799
- /* PREPARE */
13800
- );
13801
- setWalkingIndexes([0, direction === "middle" ? Math.ceil(contentChars.length / 2) : contentChars.length]);
13806
+ ReactDOM.unstable_batchedUpdates(() => {
13807
+ setStatus(
13808
+ 1
13809
+ /* PREPARE */
13810
+ );
13811
+ setWalkingIndexes([0, direction === "middle" ? Math.ceil(contentChars.length / 2) : contentChars.length]);
13812
+ });
13802
13813
  });
13803
13814
  React$1.useLayoutEffect(() => {
13804
13815
  startMeasure();
@@ -13808,7 +13819,7 @@ function useMeasure(containerRef, content, rows, direction, expanded, expandNode
13808
13819
  if (status === 1) {
13809
13820
  const fullMeasureHeight = ((_a = fullMeasureRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;
13810
13821
  const singleRowMeasureHeight = ((_b = singleRowMeasureRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
13811
- const rowMeasureHeight = singleRowMeasureHeight * rows;
13822
+ const rowMeasureHeight = singleRowMeasureHeight * (rows + 0.5);
13812
13823
  if (fullMeasureHeight <= rowMeasureHeight) {
13813
13824
  setStatus(
13814
13825
  100
@@ -14634,25 +14645,27 @@ const FloatingPanel = React$1.forwardRef((p, ref) => {
14634
14645
  var _a, _b;
14635
14646
  const props = mergeProps(defaultProps$C, p);
14636
14647
  const {
14637
- anchors
14648
+ anchors,
14649
+ placement = "bottom"
14638
14650
  } = props;
14639
14651
  const maxHeight = (_a = anchors[anchors.length - 1]) !== null && _a !== void 0 ? _a : window.innerHeight;
14640
- const possibles = anchors.map((x) => -x);
14652
+ const isBottomPlacement = placement !== "top";
14653
+ const possibles = isBottomPlacement ? anchors.map((x) => -x) : anchors;
14641
14654
  const elementRef = React$1.useRef(null);
14642
14655
  const headerRef = React$1.useRef(null);
14643
14656
  const contentRef = React$1.useRef(null);
14644
14657
  const [pulling, setPulling] = React$1.useState(false);
14645
14658
  const pullingRef = React$1.useRef(false);
14646
14659
  const bounds = {
14647
- top: possibles[possibles.length - 1],
14648
- bottom: possibles[0]
14660
+ top: Math.min(...possibles),
14661
+ bottom: Math.max(...possibles)
14649
14662
  };
14650
14663
  const onHeightChange = useMemoizedFn((_b = props.onHeightChange) !== null && _b !== void 0 ? _b : () => {
14651
14664
  });
14652
14665
  const [{
14653
14666
  y
14654
14667
  }, api] = useSpring(() => ({
14655
- y: bounds.bottom,
14668
+ y: isBottomPlacement ? bounds.bottom : bounds.top,
14656
14669
  config: {
14657
14670
  tension: 300
14658
14671
  },
@@ -14724,27 +14737,36 @@ const FloatingPanel = React$1.forwardRef((p, ref) => {
14724
14737
  }
14725
14738
  }), [api]);
14726
14739
  useLockScroll(elementRef, true);
14740
+ const HeaderNode = React$1.createElement("div", {
14741
+ className: `${classPrefix$Q}-header`,
14742
+ ref: headerRef
14743
+ }, React$1.createElement("div", {
14744
+ className: `${classPrefix$Q}-bar`
14745
+ }));
14727
14746
  return withNativeProps(props, React$1.createElement(animated.div, {
14728
14747
  ref: elementRef,
14729
- className: classPrefix$Q,
14748
+ className: classNames(classPrefix$Q, `${classPrefix$Q}-${placement}`),
14730
14749
  style: {
14731
14750
  height: Math.round(maxHeight),
14732
- translateY: y.to((y2) => `calc(100% + (${Math.round(y2)}px))`)
14751
+ translateY: y.to((y2) => {
14752
+ if (isBottomPlacement) {
14753
+ return `calc(100% + (${Math.round(y2)}px))`;
14754
+ }
14755
+ if (placement === "top") {
14756
+ return `calc(-100% + (${Math.round(y2)}px))`;
14757
+ }
14758
+ return y2;
14759
+ })
14733
14760
  }
14734
14761
  }, React$1.createElement("div", {
14735
14762
  className: `${classPrefix$Q}-mask`,
14736
14763
  style: {
14737
14764
  display: pulling ? "block" : "none"
14738
14765
  }
14739
- }), React$1.createElement("div", {
14740
- className: `${classPrefix$Q}-header`,
14741
- ref: headerRef
14742
- }, React$1.createElement("div", {
14743
- className: `${classPrefix$Q}-bar`
14744
- })), React$1.createElement("div", {
14766
+ }), isBottomPlacement && HeaderNode, React$1.createElement("div", {
14745
14767
  className: `${classPrefix$Q}-content`,
14746
14768
  ref: contentRef
14747
- }, props.children)));
14769
+ }, props.children), placement === "top" && HeaderNode));
14748
14770
  });
14749
14771
  function _extends$1() {
14750
14772
  _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
@@ -18743,15 +18765,6 @@ function undefinedFallback(...items) {
18743
18765
  }
18744
18766
  return items[i2];
18745
18767
  }
18746
- const Arrow = React$1.memo((props) => {
18747
- return withNativeProps(props, React$1.createElement("svg", {
18748
- viewBox: "0 0 30 16"
18749
- }, React$1.createElement("g", {
18750
- fill: "currentColor"
18751
- }, React$1.createElement("path", {
18752
- d: "M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z"
18753
- }))));
18754
- });
18755
18768
  const sides = ["top", "right", "bottom", "left"];
18756
18769
  const min = Math.min;
18757
18770
  const max = Math.max;
@@ -20120,40 +20133,6 @@ const computePosition = (reference, floating, options) => {
20120
20133
  platform: platformWithCache
20121
20134
  });
20122
20135
  };
20123
- class Wrapper extends React$1.Component {
20124
- constructor() {
20125
- super(...arguments);
20126
- this.element = null;
20127
- }
20128
- componentDidMount() {
20129
- this.componentDidUpdate();
20130
- }
20131
- componentDidUpdate() {
20132
- const node = ReactDOM.findDOMNode(this);
20133
- if (node instanceof Element) {
20134
- this.element = node;
20135
- } else {
20136
- this.element = null;
20137
- }
20138
- }
20139
- render() {
20140
- return React$1.Children.only(this.props.children);
20141
- }
20142
- }
20143
- const record = {
20144
- "topLeft": "top-start",
20145
- "topRight": "top-end",
20146
- "bottomLeft": "bottom-start",
20147
- "bottomRight": "bottom-end",
20148
- "leftTop": "left-start",
20149
- "leftBottom": "left-end",
20150
- "rightTop": "right-start",
20151
- "rightBottom": "right-end"
20152
- };
20153
- function normalizePlacement(placement) {
20154
- var _a;
20155
- return (_a = record[placement]) !== null && _a !== void 0 ? _a : placement;
20156
- }
20157
20136
  let tenPxTester = null;
20158
20137
  let tester = null;
20159
20138
  if (canUseDom$1) {
@@ -20179,6 +20158,49 @@ function convertPx(px) {
20179
20158
  tester.style.setProperty("--size", px.toString());
20180
20159
  return tester.getBoundingClientRect().height;
20181
20160
  }
20161
+ const Arrow = React$1.memo((props) => {
20162
+ return withNativeProps(props, React$1.createElement("svg", {
20163
+ viewBox: "0 0 30 16"
20164
+ }, React$1.createElement("g", {
20165
+ fill: "currentColor"
20166
+ }, React$1.createElement("path", {
20167
+ d: "M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z"
20168
+ }))));
20169
+ });
20170
+ const record = {
20171
+ "topLeft": "top-start",
20172
+ "topRight": "top-end",
20173
+ "bottomLeft": "bottom-start",
20174
+ "bottomRight": "bottom-end",
20175
+ "leftTop": "left-start",
20176
+ "leftBottom": "left-end",
20177
+ "rightTop": "right-start",
20178
+ "rightBottom": "right-end"
20179
+ };
20180
+ function normalizePlacement(placement) {
20181
+ var _a;
20182
+ return (_a = record[placement]) !== null && _a !== void 0 ? _a : placement;
20183
+ }
20184
+ class Wrapper extends React$1.Component {
20185
+ constructor() {
20186
+ super(...arguments);
20187
+ this.element = null;
20188
+ }
20189
+ componentDidMount() {
20190
+ this.componentDidUpdate();
20191
+ }
20192
+ componentDidUpdate() {
20193
+ const node = ReactDOM.findDOMNode(this);
20194
+ if (node instanceof Element) {
20195
+ this.element = node;
20196
+ } else {
20197
+ this.element = null;
20198
+ }
20199
+ }
20200
+ render() {
20201
+ return React$1.Children.only(this.props.children);
20202
+ }
20203
+ }
20182
20204
  const classPrefix$O = `adm-popover`;
20183
20205
  const defaultProps$A = {
20184
20206
  placement: "top",
@@ -20293,12 +20315,12 @@ const Popover$1 = React$1.forwardRef((p, ref) => {
20293
20315
  }, [targetElement, props.trigger]);
20294
20316
  React$1.useEffect(() => {
20295
20317
  const floatingElement = floatingRef.current;
20296
- if (!targetElement || !floatingElement)
20318
+ if (!targetElement || !floatingElement || !visible)
20297
20319
  return;
20298
20320
  return autoUpdate(targetElement, floatingElement, update2, {
20299
20321
  elementResize: typeof ResizeObserver !== "undefined"
20300
20322
  });
20301
- }, [targetElement]);
20323
+ }, [targetElement, visible]);
20302
20324
  useClickAway(() => {
20303
20325
  if (!props.trigger)
20304
20326
  return;
@@ -20735,7 +20757,6 @@ const GridItem = (p) => {
20735
20757
  const Grid = attachPropertiesToComponent(Grid$1, {
20736
20758
  Item: GridItem
20737
20759
  });
20738
- const useDragAndPinch = createUseGesture([dragAction, pinchAction]);
20739
20760
  const create = () => {
20740
20761
  return [1, 0, 0, 1, 0, 0];
20741
20762
  };
@@ -20760,11 +20781,14 @@ const apply = (m, [ox, oy]) => {
20760
20781
  const multiply = (m1, m2) => {
20761
20782
  return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
20762
20783
  };
20784
+ const useDragAndPinch = createUseGesture([dragAction, pinchAction]);
20763
20785
  const classPrefix$K = `adm-image-viewer`;
20764
20786
  const Slide = (props) => {
20765
20787
  const {
20766
20788
  dragLockRef,
20767
- maxZoom
20789
+ maxZoom,
20790
+ imageRender,
20791
+ index: index2
20768
20792
  } = props;
20769
20793
  const initialMartix = React$1.useRef([]);
20770
20794
  const controlRef = React$1.useRef(null);
@@ -20969,6 +20993,9 @@ const Slide = (props) => {
20969
20993
  }
20970
20994
  }
20971
20995
  });
20996
+ const customRendering = typeof imageRender === "function" && imageRender(props.image, {
20997
+ index: index2
20998
+ });
20972
20999
  return React$1.createElement("div", {
20973
21000
  className: `${classPrefix$K}-slide`
20974
21001
  }, React$1.createElement("div", {
@@ -20979,7 +21006,7 @@ const Slide = (props) => {
20979
21006
  style: {
20980
21007
  matrix
20981
21008
  }
20982
- }, React$1.createElement("img", {
21009
+ }, customRendering ? customRendering : React$1.createElement("img", {
20983
21010
  ref: imgRef,
20984
21011
  src: props.image,
20985
21012
  draggable: false,
@@ -21057,6 +21084,8 @@ const Slides = React$1.forwardRef((props, ref) => {
21057
21084
  image,
21058
21085
  onTap: props.onTap,
21059
21086
  maxZoom: props.maxZoom,
21087
+ imageRender: props.imageRender,
21088
+ index: index2,
21060
21089
  onZoomChange: (zoom) => {
21061
21090
  if (zoom !== 1) {
21062
21091
  const index3 = Math.round(x.get() / slideWidth);
@@ -21086,10 +21115,11 @@ const ImageViewer$1 = (p) => {
21086
21115
  className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask
21087
21116
  }, React$1.createElement("div", {
21088
21117
  className: classNames(`${classPrefix$I}-content`, (_b = props === null || props === void 0 ? void 0 : props.classNames) === null || _b === void 0 ? void 0 : _b.body)
21089
- }, props.image && React$1.createElement(Slide, {
21118
+ }, (props.image || typeof props.imageRender === "function") && React$1.createElement(Slide, {
21090
21119
  image: props.image,
21091
21120
  onTap: props.onClose,
21092
- maxZoom: props.maxZoom
21121
+ maxZoom: props.maxZoom,
21122
+ imageRender: props.imageRender
21093
21123
  })), props.image && React$1.createElement("div", {
21094
21124
  className: `${classPrefix$I}-footer`
21095
21125
  }, (_c = props.renderFooter) === null || _c === void 0 ? void 0 : _c.call(props, props.image), React$1.createElement(SafeArea, {
@@ -21134,7 +21164,8 @@ const MultiImageViewer = React$1.forwardRef((p, ref) => {
21134
21164
  onIndexChange: onSlideChange,
21135
21165
  images: props.images,
21136
21166
  onTap: props.onClose,
21137
- maxZoom: props.maxZoom
21167
+ maxZoom: props.maxZoom,
21168
+ imageRender: props.imageRender
21138
21169
  })), props.images && React$1.createElement("div", {
21139
21170
  className: `${classPrefix$I}-footer`
21140
21171
  }, (_c = props.renderFooter) === null || _c === void 0 ? void 0 : _c.call(props, props.images[index2], index2), React$1.createElement(SafeArea, {
@@ -21181,7 +21212,32 @@ const ImageViewer = attachPropertiesToComponent(ImageViewer$1, {
21181
21212
  show: showImageViewer,
21182
21213
  clear: clearImageViewer
21183
21214
  });
21184
- const classPrefix$H = `adm-image-uploader`;
21215
+ const classPrefix$H = `adm-space`;
21216
+ const defaultProps$y = {
21217
+ direction: "horizontal"
21218
+ };
21219
+ const Space = (p) => {
21220
+ const props = mergeProps(defaultProps$y, p);
21221
+ const {
21222
+ direction,
21223
+ onClick
21224
+ } = props;
21225
+ return withNativeProps(props, React$1.createElement("div", {
21226
+ className: classNames(classPrefix$H, {
21227
+ [`${classPrefix$H}-wrap`]: props.wrap,
21228
+ [`${classPrefix$H}-block`]: props.block,
21229
+ [`${classPrefix$H}-${direction}`]: true,
21230
+ [`${classPrefix$H}-align-${props.align}`]: !!props.align,
21231
+ [`${classPrefix$H}-justify-${props.justify}`]: !!props.justify
21232
+ }),
21233
+ onClick
21234
+ }, React$1.Children.map(props.children, (child) => {
21235
+ return child !== null && child !== void 0 && React$1.createElement("div", {
21236
+ className: `${classPrefix$H}-item`
21237
+ }, child);
21238
+ })));
21239
+ };
21240
+ const classPrefix$G = `adm-image-uploader`;
21185
21241
  const PreviewItem = (props) => {
21186
21242
  const {
21187
21243
  locale
@@ -21211,56 +21267,31 @@ const PreviewItem = (props) => {
21211
21267
  }, [src, file]);
21212
21268
  function renderLoading() {
21213
21269
  return props.status === "pending" && React$1.createElement("div", {
21214
- className: `${classPrefix$H}-cell-mask`
21270
+ className: `${classPrefix$G}-cell-mask`
21215
21271
  }, React$1.createElement("span", {
21216
- className: `${classPrefix$H}-cell-loading`
21272
+ className: `${classPrefix$G}-cell-loading`
21217
21273
  }, React$1.createElement(SpinLoading, {
21218
21274
  color: "white"
21219
21275
  }), React$1.createElement("span", {
21220
- className: `${classPrefix$H}-cell-mask-message`
21276
+ className: `${classPrefix$G}-cell-mask-message`
21221
21277
  }, locale.ImageUploader.uploading)));
21222
21278
  }
21223
21279
  function renderDelete() {
21224
21280
  return deletable && React$1.createElement("span", {
21225
- className: `${classPrefix$H}-cell-delete`,
21281
+ className: `${classPrefix$G}-cell-delete`,
21226
21282
  onClick: onDelete
21227
21283
  }, deleteIcon);
21228
21284
  }
21229
21285
  return React$1.createElement("div", {
21230
- className: classNames(`${classPrefix$H}-cell`, props.status === "fail" && `${classPrefix$H}-cell-fail`)
21286
+ className: classNames(`${classPrefix$G}-cell`, props.status === "fail" && `${classPrefix$G}-cell-fail`)
21231
21287
  }, React$1.createElement(Image$1, {
21232
- className: `${classPrefix$H}-cell-image`,
21288
+ className: `${classPrefix$G}-cell-image`,
21233
21289
  src,
21234
21290
  fit: imageFit,
21235
21291
  onClick: props.onClick
21236
21292
  }), renderLoading(), renderDelete());
21237
21293
  };
21238
21294
  const PreviewItem$1 = PreviewItem;
21239
- const classPrefix$G = `adm-space`;
21240
- const defaultProps$y = {
21241
- direction: "horizontal"
21242
- };
21243
- const Space = (p) => {
21244
- const props = mergeProps(defaultProps$y, p);
21245
- const {
21246
- direction,
21247
- onClick
21248
- } = props;
21249
- return withNativeProps(props, React$1.createElement("div", {
21250
- className: classNames(classPrefix$G, {
21251
- [`${classPrefix$G}-wrap`]: props.wrap,
21252
- [`${classPrefix$G}-block`]: props.block,
21253
- [`${classPrefix$G}-${direction}`]: true,
21254
- [`${classPrefix$G}-align-${props.align}`]: !!props.align,
21255
- [`${classPrefix$G}-justify-${props.justify}`]: !!props.justify
21256
- }),
21257
- onClick
21258
- }, React$1.Children.map(props.children, (child) => {
21259
- return child !== null && child !== void 0 && React$1.createElement("div", {
21260
- className: `${classPrefix$G}-item`
21261
- }, child);
21262
- })));
21263
- };
21264
21295
  const classPrefix$F = `adm-image-uploader`;
21265
21296
  const defaultProps$x = {
21266
21297
  disableUpload: false,
@@ -21396,10 +21427,10 @@ const ImageUploader = React$1.forwardRef((p, ref) => {
21396
21427
  return task;
21397
21428
  });
21398
21429
  });
21399
- throw e3;
21430
+ console.error(e3);
21400
21431
  }
21401
- }))).catch((error) => console.error(error));
21402
- setValue((prev) => prev.concat(newVal));
21432
+ })));
21433
+ setValue((prev) => prev.concat(newVal).filter(Boolean));
21403
21434
  });
21404
21435
  }
21405
21436
  const imageViewerHandlerRef = React$1.useRef(null);
@@ -22534,7 +22565,8 @@ const defaultProps$o = {
22534
22565
  plain: false,
22535
22566
  error: false,
22536
22567
  seperated: false,
22537
- caret: true
22568
+ caret: true,
22569
+ inputMode: "numeric"
22538
22570
  };
22539
22571
  const PasscodeInput = React$1.forwardRef((p, ref) => {
22540
22572
  const props = mergeProps(defaultProps$o, p);
@@ -22629,7 +22661,7 @@ const PasscodeInput = React$1.forwardRef((p, ref) => {
22629
22661
  value,
22630
22662
  type: "text",
22631
22663
  pattern: "[0-9]*",
22632
- inputMode: "numeric",
22664
+ inputMode: props.inputMode,
22633
22665
  onChange: (e2) => {
22634
22666
  setValue(e2.target.value.slice(0, props.length));
22635
22667
  },
@@ -25451,12 +25483,14 @@ const SwipeAction = React$1.forwardRef((p, ref) => {
25451
25483
  },
25452
25484
  triggerAllEvents: true
25453
25485
  });
25454
- function close() {
25486
+ const close = () => {
25487
+ var _a;
25455
25488
  api.start({
25456
25489
  x: 0
25457
25490
  });
25458
25491
  forceCancelDrag();
25459
- }
25492
+ (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
25493
+ };
25460
25494
  React$1.useImperativeHandle(ref, () => ({
25461
25495
  show: (side = "right") => {
25462
25496
  var _a;