@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/index.js
CHANGED
|
@@ -9095,7 +9095,7 @@ function getThumbUrl(file) {
|
|
|
9095
9095
|
return `data:${file.type};base64,${file.contents}`;
|
|
9096
9096
|
}
|
|
9097
9097
|
function UploadWrapper(props) {
|
|
9098
|
-
const _a = props, { files, dragAndDropFiles, onFilesChange } = _a, rest = __objRest(_a, ["files", "dragAndDropFiles", "onFilesChange"]);
|
|
9098
|
+
const _a = props, { files, dragAndDropFiles, onFilesChange, maxCount } = _a, rest = __objRest(_a, ["files", "dragAndDropFiles", "onFilesChange", "maxCount"]);
|
|
9099
9099
|
const filesRef = React.useRef();
|
|
9100
9100
|
filesRef.current = files;
|
|
9101
9101
|
const [previewFileId, setPreviewFileId] = React.useState();
|
|
@@ -9113,16 +9113,18 @@ function UploadWrapper(props) {
|
|
|
9113
9113
|
lastModified: file.lastModified
|
|
9114
9114
|
};
|
|
9115
9115
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9116
|
-
...(_a2 = filesRef.current) != null ? _a2 : [],
|
|
9116
|
+
...((_a2 = filesRef.current) != null ? _a2 : []).slice(0, (maxCount || Infinity) - 1),
|
|
9117
9117
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9118
9118
|
status: "uploading"
|
|
9119
9119
|
})
|
|
9120
9120
|
]);
|
|
9121
9121
|
const reader = new FileReader();
|
|
9122
9122
|
reader.onload = () => {
|
|
9123
|
-
var _a3;
|
|
9123
|
+
var _a3, _b;
|
|
9124
|
+
if (!((_a3 = filesRef.current) == null ? void 0 : _a3.map((f) => f.uid).includes(metadata.uid)))
|
|
9125
|
+
return;
|
|
9124
9126
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9125
|
-
...((
|
|
9127
|
+
...((_b = filesRef.current) != null ? _b : []).filter((f) => f.uid !== file.uid),
|
|
9126
9128
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9127
9129
|
contents: reader.result.replace(
|
|
9128
9130
|
/^data:[^;]+;base64,/,
|
|
@@ -9133,9 +9135,11 @@ function UploadWrapper(props) {
|
|
|
9133
9135
|
]);
|
|
9134
9136
|
};
|
|
9135
9137
|
reader.onerror = (error) => {
|
|
9136
|
-
var _a3;
|
|
9138
|
+
var _a3, _b;
|
|
9139
|
+
if (!((_a3 = filesRef.current) == null ? void 0 : _a3.map((f) => f.uid).includes(metadata.uid)))
|
|
9140
|
+
return;
|
|
9137
9141
|
onFilesChange == null ? void 0 : onFilesChange([
|
|
9138
|
-
...((
|
|
9142
|
+
...((_b = filesRef.current) != null ? _b : []).filter((f) => f.uid !== file.uid),
|
|
9139
9143
|
__spreadProps(__spreadValues({}, metadata), {
|
|
9140
9144
|
status: "error"
|
|
9141
9145
|
})
|