knt-shared 1.10.3 → 1.10.4
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/components/Upload/BasicUpload.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +10 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +32 -32
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicUpload.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Upload/BasicUpload.vue"],"names":[],"mappings":"AAwJA;AAGA,OAAO,EAEL,MAAM,IAAI,OAAO,EAGlB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EACV,gBAAgB,EAEhB,cAAc,EAEd,iBAAiB,EAClB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"BasicUpload.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Upload/BasicUpload.vue"],"names":[],"mappings":"AAwJA;AAGA,OAAO,EAEL,MAAM,IAAI,OAAO,EAGlB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EACV,gBAAgB,EAEhB,cAAc,EAEd,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAy2BjB,iBAAS,cAAc;mBAqhBK,GAAG;6BACQ,GAAG;qBACZ,GAAG;iBACP,GAAG;;;QACF,GAAG;EAG7B;AAsCD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAhxBK,cAAc;;uBAiBhB,cAAc,EAAE;uBAOd,cAAc;4BAOT,OAAO,CAAC,gBAAgB,CAAC;yBAO5B,cAAc,EAAE;oBAQrB,cAAc;2BAQP,cAAc;2BAad,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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958
2958
|
emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed", "sortChange"],
|
|
2959
2959
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2960
2960
|
vue.useCssVars((_ctx) => ({
|
|
2961
|
-
"
|
|
2961
|
+
"v74ec8601": cardSizeValue.value
|
|
2962
2962
|
}));
|
|
2963
2963
|
const MAX_SIZE_UNIT_BYTES = {
|
|
2964
2964
|
B: 1,
|
|
@@ -2973,6 +2973,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
2973
2973
|
const propsRef = vue.ref({});
|
|
2974
2974
|
const hasShownActionError = vue.ref(false);
|
|
2975
2975
|
const processedFiles = vue.ref(/* @__PURE__ */ new Map());
|
|
2976
|
+
const pendingCount = vue.ref(0);
|
|
2976
2977
|
const previewVisible = vue.ref(false);
|
|
2977
2978
|
const previewImageUrl = vue.ref("");
|
|
2978
2979
|
const previewVideoUrl = vue.ref("");
|
|
@@ -3085,7 +3086,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
3085
3086
|
if (!validateFileType(file)) {
|
|
3086
3087
|
return false;
|
|
3087
3088
|
}
|
|
3088
|
-
if (propsData.maxCount && fileListRef.value.length >= propsData.maxCount) {
|
|
3089
|
+
if (propsData.maxCount && fileListRef.value.length + pendingCount.value >= propsData.maxCount) {
|
|
3089
3090
|
ArcoVue.Message.error(`最多只能上传 ${propsData.maxCount} 个文件`);
|
|
3090
3091
|
emit("exceed", [file], fileListRef.value);
|
|
3091
3092
|
return false;
|
|
@@ -3093,12 +3094,13 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
3093
3094
|
if (propsData.beforeUpload) {
|
|
3094
3095
|
try {
|
|
3095
3096
|
const result = await propsData.beforeUpload(file);
|
|
3096
|
-
return
|
|
3097
|
+
if (!result) return false;
|
|
3097
3098
|
} catch (error) {
|
|
3098
3099
|
console.error("beforeUpload error:", error);
|
|
3099
3100
|
return false;
|
|
3100
3101
|
}
|
|
3101
3102
|
}
|
|
3103
|
+
pendingCount.value++;
|
|
3102
3104
|
return true;
|
|
3103
3105
|
};
|
|
3104
3106
|
const handleCustomRequest = (options) => {
|
|
@@ -3265,6 +3267,10 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
3265
3267
|
const handleChange = (fileList, currentFile) => {
|
|
3266
3268
|
const oldLength = fileListRef.value.length;
|
|
3267
3269
|
const newLength = fileList.length;
|
|
3270
|
+
if (newLength > oldLength) {
|
|
3271
|
+
const added = newLength - oldLength;
|
|
3272
|
+
pendingCount.value = Math.max(0, pendingCount.value - added);
|
|
3273
|
+
}
|
|
3268
3274
|
fileListRef.value = fileList;
|
|
3269
3275
|
addVideoFileClass();
|
|
3270
3276
|
emit("change", fileList);
|
|
@@ -3613,7 +3619,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
3613
3619
|
};
|
|
3614
3620
|
}
|
|
3615
3621
|
});
|
|
3616
|
-
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
3622
|
+
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-d316e747"]]);
|
|
3617
3623
|
function useUpload(props) {
|
|
3618
3624
|
const uploadRef = vue.ref(null);
|
|
3619
3625
|
const fileListRef = vue.ref((props == null ? void 0 : props.defaultFileList) || []);
|