antd-mobile 5.42.0-alpha.1 → 5.42.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 (40) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +18 -15
  2. package/2x/bundle/antd-mobile.cjs.js +5 -5
  3. package/2x/bundle/antd-mobile.es.development.js +18 -15
  4. package/2x/bundle/antd-mobile.es.js +576 -573
  5. package/2x/bundle/antd-mobile.umd.development.js +18 -15
  6. package/2x/bundle/antd-mobile.umd.js +5 -5
  7. package/2x/bundle/style.css +1 -1
  8. package/2x/cjs/components/image-uploader/image-uploader.js +2 -2
  9. package/2x/cjs/components/image-viewer/image-viewer.d.ts +3 -0
  10. package/2x/cjs/components/image-viewer/image-viewer.js +14 -12
  11. package/2x/cjs/components/virtual-input/virtual-input.css +1 -1
  12. package/2x/cjs/components/virtual-input/virtual-input.js +2 -1
  13. package/2x/es/components/image-uploader/image-uploader.js +2 -2
  14. package/2x/es/components/image-viewer/image-viewer.d.ts +3 -0
  15. package/2x/es/components/image-viewer/image-viewer.js +14 -12
  16. package/2x/es/components/virtual-input/virtual-input.css +1 -1
  17. package/2x/es/components/virtual-input/virtual-input.js +2 -1
  18. package/2x/package.json +1 -1
  19. package/bundle/antd-mobile.cjs.development.js +18 -15
  20. package/bundle/antd-mobile.cjs.js +5 -5
  21. package/bundle/antd-mobile.compatible.umd.js +1 -1
  22. package/bundle/antd-mobile.es.development.js +18 -15
  23. package/bundle/antd-mobile.es.js +576 -573
  24. package/bundle/antd-mobile.umd.development.js +18 -15
  25. package/bundle/antd-mobile.umd.js +5 -5
  26. package/bundle/style.css +1 -1
  27. package/cjs/components/image-uploader/image-uploader.js +2 -2
  28. package/cjs/components/image-viewer/image-viewer.css +1 -1
  29. package/cjs/components/image-viewer/image-viewer.d.ts +3 -0
  30. package/cjs/components/image-viewer/image-viewer.js +14 -12
  31. package/cjs/components/virtual-input/virtual-input.css +1 -1
  32. package/cjs/components/virtual-input/virtual-input.js +2 -1
  33. package/es/components/image-uploader/image-uploader.js +2 -2
  34. package/es/components/image-viewer/image-viewer.css +1 -1
  35. package/es/components/image-viewer/image-viewer.d.ts +3 -0
  36. package/es/components/image-viewer/image-viewer.js +14 -12
  37. package/es/components/virtual-input/virtual-input.css +1 -1
  38. package/es/components/virtual-input/virtual-input.js +2 -1
  39. package/package.json +1 -1
  40. package/umd/antd-mobile.js +1 -1
@@ -21886,17 +21886,18 @@ const defaultProps$z = {
21886
21886
  visible: false
21887
21887
  };
21888
21888
  const ImageViewer$1 = (p) => {
21889
- var _a, _b, _c;
21889
+ var _a, _b, _c, _d;
21890
21890
  const props = mergeProps(defaultProps$z, p);
21891
21891
  const node = React__default.createElement(Mask, {
21892
21892
  visible: props.visible,
21893
+ afterClose: props === null || props === void 0 ? void 0 : props.afterClose,
21894
+ className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask,
21895
+ onMaskClick: (_b = props.mask) === null || _b === void 0 ? void 0 : _b.onClick,
21893
21896
  disableBodyScroll: false,
21894
21897
  opacity: "thick",
21895
- afterClose: props.afterClose,
21896
- destroyOnClose: true,
21897
- className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask
21898
+ destroyOnClose: true
21898
21899
  }, React__default.createElement("div", {
21899
- className: classNames(`${classPrefix$I}-content`, (_b = props === null || props === void 0 ? void 0 : props.classNames) === null || _b === void 0 ? void 0 : _b.body)
21900
+ className: classNames(`${classPrefix$I}-content`, (_c = props === null || props === void 0 ? void 0 : props.classNames) === null || _c === void 0 ? void 0 : _c.body)
21900
21901
  }, (props.image || typeof props.imageRender === "function") && React__default.createElement(Slide, {
21901
21902
  image: props.image,
21902
21903
  onTap: props.onClose,
@@ -21904,7 +21905,7 @@ const ImageViewer$1 = (p) => {
21904
21905
  imageRender: props.imageRender
21905
21906
  })), props.image && React__default.createElement("div", {
21906
21907
  className: `${classPrefix$I}-footer`
21907
- }, (_c = props.renderFooter) === null || _c === void 0 ? void 0 : _c.call(props, props.image), React__default.createElement(SafeArea, {
21908
+ }, (_d = props.renderFooter) === null || _d === void 0 ? void 0 : _d.call(props, props.image), React__default.createElement(SafeArea, {
21908
21909
  position: "bottom"
21909
21910
  })));
21910
21911
  return renderToContainer(props.getContainer, node);
@@ -21913,7 +21914,7 @@ const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
21913
21914
  defaultIndex: 0
21914
21915
  });
21915
21916
  const MultiImageViewer = forwardRef((p, ref2) => {
21916
- var _a, _b, _c;
21917
+ var _a, _b, _c, _d;
21917
21918
  const props = mergeProps(multiDefaultProps, p);
21918
21919
  const [index2, setIndex] = useState(props.defaultIndex);
21919
21920
  const slidesRef = useRef(null);
@@ -21933,13 +21934,14 @@ const MultiImageViewer = forwardRef((p, ref2) => {
21933
21934
  }, [props.onIndexChange, index2]);
21934
21935
  const node = React__default.createElement(Mask, {
21935
21936
  visible: props.visible,
21937
+ afterClose: props === null || props === void 0 ? void 0 : props.afterClose,
21938
+ className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask,
21939
+ onMaskClick: (_b = props.mask) === null || _b === void 0 ? void 0 : _b.onClick,
21936
21940
  disableBodyScroll: false,
21937
21941
  opacity: "thick",
21938
- afterClose: props.afterClose,
21939
- destroyOnClose: true,
21940
- className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask
21942
+ destroyOnClose: true
21941
21943
  }, React__default.createElement("div", {
21942
- className: classNames(`${classPrefix$I}-content`, (_b = props === null || props === void 0 ? void 0 : props.classNames) === null || _b === void 0 ? void 0 : _b.body)
21944
+ className: classNames(`${classPrefix$I}-content`, (_c = props === null || props === void 0 ? void 0 : props.classNames) === null || _c === void 0 ? void 0 : _c.body)
21943
21945
  }, props.images && React__default.createElement(Slides, {
21944
21946
  ref: slidesRef,
21945
21947
  defaultIndex: index2,
@@ -21950,7 +21952,7 @@ const MultiImageViewer = forwardRef((p, ref2) => {
21950
21952
  imageRender: props.imageRender
21951
21953
  })), props.images && React__default.createElement("div", {
21952
21954
  className: `${classPrefix$I}-footer`
21953
- }, (_c = props.renderFooter) === null || _c === void 0 ? void 0 : _c.call(props, props.images[index2], index2), React__default.createElement(SafeArea, {
21955
+ }, (_d = props.renderFooter) === null || _d === void 0 ? void 0 : _d.call(props, props.images[index2], index2), React__default.createElement(SafeArea, {
21954
21956
  position: "bottom"
21955
21957
  })));
21956
21958
  return renderToContainer(props.getContainer, node);
@@ -22149,6 +22151,7 @@ const ImageUploader = forwardRef((p, ref2) => {
22149
22151
  function getFinalTasks(tasks2) {
22150
22152
  return props.showFailed ? tasks2 : tasks2.filter((task) => task.status !== "fail");
22151
22153
  }
22154
+ const finalTasks = getFinalTasks(tasks);
22152
22155
  function onChange(e2) {
22153
22156
  var _a;
22154
22157
  return __awaiter(this, void 0, void 0, function* () {
@@ -22170,7 +22173,7 @@ const ImageUploader = forwardRef((p, ref2) => {
22170
22173
  return;
22171
22174
  }
22172
22175
  if (maxCount > 0) {
22173
- const exceed = value.length + files.length - maxCount;
22176
+ const exceed = value.length + files.length + finalTasks.length - maxCount;
22174
22177
  if (exceed > 0) {
22175
22178
  files = files.slice(0, files.length - exceed);
22176
22179
  (_a = props.onCountExceed) === null || _a === void 0 ? void 0 : _a.call(props, exceed);
@@ -22229,7 +22232,6 @@ const ImageUploader = forwardRef((p, ref2) => {
22229
22232
  var _a;
22230
22233
  (_a = imageViewerHandlerRef.current) === null || _a === void 0 ? void 0 : _a.close();
22231
22234
  });
22232
- const finalTasks = getFinalTasks(tasks);
22233
22235
  const showUpload = props.showUpload && (maxCount === 0 || value.length + finalTasks.length < maxCount);
22234
22236
  const renderImages = () => {
22235
22237
  return value.map((fileItem, index2) => {
@@ -27719,6 +27721,7 @@ const VirtualInput = forwardRef((props, ref2) => {
27719
27721
  (_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
27720
27722
  }
27721
27723
  (_c = mergedProps.onClick) === null || _c === void 0 ? void 0 : _c.call(mergedProps, e2);
27724
+ setFocus();
27722
27725
  };
27723
27726
  const changeCaretPosition = (index2) => (e2) => {
27724
27727
  var _a, _b, _c;
@@ -27792,7 +27795,7 @@ const VirtualInput = forwardRef((props, ref2) => {
27792
27795
  className: `${classPrefix$2}-content`,
27793
27796
  ref: contentRef,
27794
27797
  "aria-disabled": mergedProps.disabled,
27795
- "aria-label": value || mergedProps.placeholder,
27798
+ "aria-label": value ? void 0 : mergedProps.placeholder,
27796
27799
  role: "textbox",
27797
27800
  tabIndex: mergedProps.disabled ? void 0 : 0,
27798
27801
  // note: 这里增加 onFocus 有两个目的: