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.
- package/2x/bundle/antd-mobile.cjs.development.js +18 -15
- package/2x/bundle/antd-mobile.cjs.js +5 -5
- package/2x/bundle/antd-mobile.es.development.js +18 -15
- package/2x/bundle/antd-mobile.es.js +576 -573
- package/2x/bundle/antd-mobile.umd.development.js +18 -15
- package/2x/bundle/antd-mobile.umd.js +5 -5
- package/2x/bundle/style.css +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +2 -2
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +3 -0
- package/2x/cjs/components/image-viewer/image-viewer.js +14 -12
- package/2x/cjs/components/virtual-input/virtual-input.css +1 -1
- package/2x/cjs/components/virtual-input/virtual-input.js +2 -1
- package/2x/es/components/image-uploader/image-uploader.js +2 -2
- package/2x/es/components/image-viewer/image-viewer.d.ts +3 -0
- package/2x/es/components/image-viewer/image-viewer.js +14 -12
- package/2x/es/components/virtual-input/virtual-input.css +1 -1
- package/2x/es/components/virtual-input/virtual-input.js +2 -1
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +18 -15
- package/bundle/antd-mobile.cjs.js +5 -5
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +18 -15
- package/bundle/antd-mobile.es.js +576 -573
- package/bundle/antd-mobile.umd.development.js +18 -15
- package/bundle/antd-mobile.umd.js +5 -5
- package/bundle/style.css +1 -1
- package/cjs/components/image-uploader/image-uploader.js +2 -2
- package/cjs/components/image-viewer/image-viewer.css +1 -1
- package/cjs/components/image-viewer/image-viewer.d.ts +3 -0
- package/cjs/components/image-viewer/image-viewer.js +14 -12
- package/cjs/components/virtual-input/virtual-input.css +1 -1
- package/cjs/components/virtual-input/virtual-input.js +2 -1
- package/es/components/image-uploader/image-uploader.js +2 -2
- package/es/components/image-viewer/image-viewer.css +1 -1
- package/es/components/image-viewer/image-viewer.d.ts +3 -0
- package/es/components/image-viewer/image-viewer.js +14 -12
- package/es/components/virtual-input/virtual-input.css +1 -1
- package/es/components/virtual-input/virtual-input.js +2 -1
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -21904,17 +21904,18 @@ const defaultProps$z = {
|
|
|
21904
21904
|
visible: false
|
|
21905
21905
|
};
|
|
21906
21906
|
const ImageViewer$1 = (p) => {
|
|
21907
|
-
var _a, _b, _c;
|
|
21907
|
+
var _a, _b, _c, _d;
|
|
21908
21908
|
const props = mergeProps(defaultProps$z, p);
|
|
21909
21909
|
const node = React$3.createElement(Mask, {
|
|
21910
21910
|
visible: props.visible,
|
|
21911
|
+
afterClose: props === null || props === void 0 ? void 0 : props.afterClose,
|
|
21912
|
+
className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask,
|
|
21913
|
+
onMaskClick: (_b = props.mask) === null || _b === void 0 ? void 0 : _b.onClick,
|
|
21911
21914
|
disableBodyScroll: false,
|
|
21912
21915
|
opacity: "thick",
|
|
21913
|
-
|
|
21914
|
-
destroyOnClose: true,
|
|
21915
|
-
className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask
|
|
21916
|
+
destroyOnClose: true
|
|
21916
21917
|
}, React$3.createElement("div", {
|
|
21917
|
-
className: classNames(`${classPrefix$I}-content`, (
|
|
21918
|
+
className: classNames(`${classPrefix$I}-content`, (_c = props === null || props === void 0 ? void 0 : props.classNames) === null || _c === void 0 ? void 0 : _c.body)
|
|
21918
21919
|
}, (props.image || typeof props.imageRender === "function") && React$3.createElement(Slide, {
|
|
21919
21920
|
image: props.image,
|
|
21920
21921
|
onTap: props.onClose,
|
|
@@ -21922,7 +21923,7 @@ const ImageViewer$1 = (p) => {
|
|
|
21922
21923
|
imageRender: props.imageRender
|
|
21923
21924
|
})), props.image && React$3.createElement("div", {
|
|
21924
21925
|
className: `${classPrefix$I}-footer`
|
|
21925
|
-
}, (
|
|
21926
|
+
}, (_d = props.renderFooter) === null || _d === void 0 ? void 0 : _d.call(props, props.image), React$3.createElement(SafeArea, {
|
|
21926
21927
|
position: "bottom"
|
|
21927
21928
|
})));
|
|
21928
21929
|
return renderToContainer(props.getContainer, node);
|
|
@@ -21931,7 +21932,7 @@ const multiDefaultProps = Object.assign(Object.assign({}, defaultProps$z), {
|
|
|
21931
21932
|
defaultIndex: 0
|
|
21932
21933
|
});
|
|
21933
21934
|
const MultiImageViewer = React$3.forwardRef((p, ref2) => {
|
|
21934
|
-
var _a, _b, _c;
|
|
21935
|
+
var _a, _b, _c, _d;
|
|
21935
21936
|
const props = mergeProps(multiDefaultProps, p);
|
|
21936
21937
|
const [index2, setIndex] = React$3.useState(props.defaultIndex);
|
|
21937
21938
|
const slidesRef = React$3.useRef(null);
|
|
@@ -21951,13 +21952,14 @@ const MultiImageViewer = React$3.forwardRef((p, ref2) => {
|
|
|
21951
21952
|
}, [props.onIndexChange, index2]);
|
|
21952
21953
|
const node = React$3.createElement(Mask, {
|
|
21953
21954
|
visible: props.visible,
|
|
21955
|
+
afterClose: props === null || props === void 0 ? void 0 : props.afterClose,
|
|
21956
|
+
className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask,
|
|
21957
|
+
onMaskClick: (_b = props.mask) === null || _b === void 0 ? void 0 : _b.onClick,
|
|
21954
21958
|
disableBodyScroll: false,
|
|
21955
21959
|
opacity: "thick",
|
|
21956
|
-
|
|
21957
|
-
destroyOnClose: true,
|
|
21958
|
-
className: (_a = props === null || props === void 0 ? void 0 : props.classNames) === null || _a === void 0 ? void 0 : _a.mask
|
|
21960
|
+
destroyOnClose: true
|
|
21959
21961
|
}, React$3.createElement("div", {
|
|
21960
|
-
className: classNames(`${classPrefix$I}-content`, (
|
|
21962
|
+
className: classNames(`${classPrefix$I}-content`, (_c = props === null || props === void 0 ? void 0 : props.classNames) === null || _c === void 0 ? void 0 : _c.body)
|
|
21961
21963
|
}, props.images && React$3.createElement(Slides, {
|
|
21962
21964
|
ref: slidesRef,
|
|
21963
21965
|
defaultIndex: index2,
|
|
@@ -21968,7 +21970,7 @@ const MultiImageViewer = React$3.forwardRef((p, ref2) => {
|
|
|
21968
21970
|
imageRender: props.imageRender
|
|
21969
21971
|
})), props.images && React$3.createElement("div", {
|
|
21970
21972
|
className: `${classPrefix$I}-footer`
|
|
21971
|
-
}, (
|
|
21973
|
+
}, (_d = props.renderFooter) === null || _d === void 0 ? void 0 : _d.call(props, props.images[index2], index2), React$3.createElement(SafeArea, {
|
|
21972
21974
|
position: "bottom"
|
|
21973
21975
|
})));
|
|
21974
21976
|
return renderToContainer(props.getContainer, node);
|
|
@@ -22167,6 +22169,7 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
|
|
|
22167
22169
|
function getFinalTasks(tasks2) {
|
|
22168
22170
|
return props.showFailed ? tasks2 : tasks2.filter((task) => task.status !== "fail");
|
|
22169
22171
|
}
|
|
22172
|
+
const finalTasks = getFinalTasks(tasks);
|
|
22170
22173
|
function onChange(e2) {
|
|
22171
22174
|
var _a;
|
|
22172
22175
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -22188,7 +22191,7 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
|
|
|
22188
22191
|
return;
|
|
22189
22192
|
}
|
|
22190
22193
|
if (maxCount > 0) {
|
|
22191
|
-
const exceed = value.length + files.length - maxCount;
|
|
22194
|
+
const exceed = value.length + files.length + finalTasks.length - maxCount;
|
|
22192
22195
|
if (exceed > 0) {
|
|
22193
22196
|
files = files.slice(0, files.length - exceed);
|
|
22194
22197
|
(_a = props.onCountExceed) === null || _a === void 0 ? void 0 : _a.call(props, exceed);
|
|
@@ -22247,7 +22250,6 @@ const ImageUploader = React$3.forwardRef((p, ref2) => {
|
|
|
22247
22250
|
var _a;
|
|
22248
22251
|
(_a = imageViewerHandlerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
22249
22252
|
});
|
|
22250
|
-
const finalTasks = getFinalTasks(tasks);
|
|
22251
22253
|
const showUpload = props.showUpload && (maxCount === 0 || value.length + finalTasks.length < maxCount);
|
|
22252
22254
|
const renderImages = () => {
|
|
22253
22255
|
return value.map((fileItem, index2) => {
|
|
@@ -27737,6 +27739,7 @@ const VirtualInput = React$3.forwardRef((props, ref2) => {
|
|
|
27737
27739
|
(_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
|
|
27738
27740
|
}
|
|
27739
27741
|
(_c = mergedProps.onClick) === null || _c === void 0 ? void 0 : _c.call(mergedProps, e2);
|
|
27742
|
+
setFocus();
|
|
27740
27743
|
};
|
|
27741
27744
|
const changeCaretPosition = (index2) => (e2) => {
|
|
27742
27745
|
var _a, _b, _c;
|
|
@@ -27810,7 +27813,7 @@ const VirtualInput = React$3.forwardRef((props, ref2) => {
|
|
|
27810
27813
|
className: `${classPrefix$2}-content`,
|
|
27811
27814
|
ref: contentRef,
|
|
27812
27815
|
"aria-disabled": mergedProps.disabled,
|
|
27813
|
-
"aria-label": value
|
|
27816
|
+
"aria-label": value ? void 0 : mergedProps.placeholder,
|
|
27814
27817
|
role: "textbox",
|
|
27815
27818
|
tabIndex: mergedProps.disabled ? void 0 : 0,
|
|
27816
27819
|
// note: 这里增加 onFocus 有两个目的:
|