@plasmicpkgs/antd5 0.0.189 → 0.0.190
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/dist/.tsbuildinfo +1 -1
- package/dist/antd.esm.js +10 -6
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skinny/registerUpload.cjs.js +10 -6
- package/skinny/registerUpload.cjs.js.map +1 -1
- package/skinny/registerUpload.esm.js +10 -6
- package/skinny/registerUpload.esm.js.map +1 -1
package/dist/antd.esm.js
CHANGED
|
@@ -9078,7 +9078,7 @@ function getThumbUrl(file) {
|
|
|
9078
9078
|
return `data:${file.type};base64,${file.contents}`;
|
|
9079
9079
|
}
|
|
9080
9080
|
function UploadWrapper(props) {
|
|
9081
|
-
const _a = props, { files, dragAndDropFiles, onFilesChange } = _a, rest = __objRest(_a, ["files", "dragAndDropFiles", "onFilesChange"]);
|
|
9081
|
+
const _a = props, { files, dragAndDropFiles, onFilesChange, maxCount } = _a, rest = __objRest(_a, ["files", "dragAndDropFiles", "onFilesChange", "maxCount"]);
|
|
9082
9082
|
const filesRef = useRef();
|
|
9083
9083
|
filesRef.current = files;
|
|
9084
9084
|
const [previewFileId, setPreviewFileId] = useState();
|
|
@@ -9096,16 +9096,18 @@ function UploadWrapper(props) {
|
|
|
9096
9096
|
lastModified: file.lastModified
|
|
9097
9097
|
};
|
|
9098
9098
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9099
|
-
...(_a2 = filesRef.current) != null ? _a2 : [],
|
|
9099
|
+
...((_a2 = filesRef.current) != null ? _a2 : []).slice(0, (maxCount || Infinity) - 1),
|
|
9100
9100
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9101
9101
|
status: "uploading"
|
|
9102
9102
|
})
|
|
9103
9103
|
]);
|
|
9104
9104
|
const reader = new FileReader();
|
|
9105
9105
|
reader.onload = () => {
|
|
9106
|
-
var _a3;
|
|
9106
|
+
var _a3, _b;
|
|
9107
|
+
if (!((_a3 = filesRef.current) == null ? void 0 : _a3.map((f) => f.uid).includes(metadata.uid)))
|
|
9108
|
+
return;
|
|
9107
9109
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9108
|
-
...((
|
|
9110
|
+
...((_b = filesRef.current) != null ? _b : []).filter((f) => f.uid !== file.uid),
|
|
9109
9111
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9110
9112
|
contents: reader.result.replace(
|
|
9111
9113
|
/^data:[^;]+;base64,/,
|
|
@@ -9116,9 +9118,11 @@ function UploadWrapper(props) {
|
|
|
9116
9118
|
]);
|
|
9117
9119
|
};
|
|
9118
9120
|
reader.onerror = (error) => {
|
|
9119
|
-
var _a3;
|
|
9121
|
+
var _a3, _b;
|
|
9122
|
+
if (!((_a3 = filesRef.current) == null ? void 0 : _a3.map((f) => f.uid).includes(metadata.uid)))
|
|
9123
|
+
return;
|
|
9120
9124
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9121
|
-
...((
|
|
9125
|
+
...((_b = filesRef.current) != null ? _b : []).filter((f) => f.uid !== file.uid),
|
|
9122
9126
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9123
9127
|
status: "error"
|
|
9124
9128
|
})
|