qidian-vue-ui 2.0.52 → 2.0.54

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.
@@ -1,4 +1,4 @@
1
- .qd-upload__flow-table-wrapper[data-v-ed2255b0] {
1
+ .qd-upload__flow-table-wrapper[data-v-27becaca] {
2
2
  max-width: 100%;
3
3
  overflow-x: auto;
4
4
  }
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
5
- const QdUploadFileFlowFileListDisplay = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ed2255b0"]]);
5
+ const QdUploadFileFlowFileListDisplay = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-27becaca"]]);
6
6
  export {
7
7
  QdUploadFileFlowFileListDisplay as default
8
8
  };
@@ -126,7 +126,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
126
126
  }, toDisplayString(getStatusText(file)), 3)
127
127
  ])
128
128
  ]),
129
- !__props.disabled && (!__props.isBatchUpload || !allSuccess.value || index === 0) ? (openBlock(), createElementBlock("td", {
129
+ !__props.disabled && file.status !== "progress" && (!__props.isBatchUpload || !allSuccess.value || index === 0) ? (openBlock(), createElementBlock("td", {
130
130
  key: 0,
131
131
  rowspan: __props.isBatchUpload && allSuccess.value ? __props.files.length : void 0
132
132
  }, [
@@ -113,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
113
113
  onRemove: props.onRemove,
114
114
  disabled: __props.disabled
115
115
  }),
116
- !__props.disabled ? (openBlock(), createElementBlock("span", {
116
+ !__props.disabled && file.status !== "progress" ? (openBlock(), createElementBlock("span", {
117
117
  key: 1,
118
118
  class: "t-upload__card-mask-item t-upload__delete",
119
119
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
@@ -1,100 +1,103 @@
1
- .qd-upload[data-v-e13e6ed6] {
1
+ .qd-upload[data-v-afd4a5dd] {
2
2
  width: 100%;
3
3
  outline: none;
4
4
  }
5
- .qd-upload[data-v-e13e6ed6] .t-image-viewer__trigger {
5
+ .qd-upload[data-v-afd4a5dd] .t-image-viewer__trigger {
6
6
  display: none;
7
7
  }
8
- .qd-upload[data-v-e13e6ed6] .t-upload__dragger {
8
+ .qd-upload[data-v-afd4a5dd] .t-upload__dragger {
9
9
  min-width: auto;
10
10
  min-height: 144px;
11
11
  width: 100%;
12
12
  height: 100%;
13
13
  }
14
- .qd-upload[data-v-e13e6ed6] .t-upload__dragger-btns > .t-size-s {
14
+ .qd-upload[data-v-afd4a5dd] .t-upload__dragger-btns > .t-size-s {
15
15
  display: inline-flex;
16
16
  }
17
- .qd-upload[data-v-e13e6ed6] .t-upload__flow {
17
+ .qd-upload[data-v-afd4a5dd] .t-upload__flow {
18
18
  width: 100%;
19
19
  min-width: auto;
20
20
  max-width: 100%;
21
21
  }
22
- .qd-upload[data-v-e13e6ed6] .t-upload__flow-empty {
22
+ .qd-upload[data-v-afd4a5dd] .t-upload__flow-empty {
23
23
  height: auto;
24
24
  min-height: 144px;
25
25
  }
26
- .qd-upload[data-v-e13e6ed6] .t-upload__flow-card-area,
27
- .qd-upload[data-v-e13e6ed6] .t-upload__flow-table {
26
+ .qd-upload[data-v-afd4a5dd] .t-upload__flow-card-area,
27
+ .qd-upload[data-v-afd4a5dd] .t-upload__flow-table {
28
28
  margin-top: var(--td-comp-margin-s);
29
29
  }
30
- .qd-upload[data-v-e13e6ed6] .t-upload__file-name__container {
30
+ .qd-upload[data-v-afd4a5dd] .t-upload__file-name__container {
31
31
  display: flex;
32
32
  align-items: center;
33
33
  }
34
- .qd-upload[data-v-e13e6ed6] .t-upload__file-name-text {
34
+ .qd-upload[data-v-afd4a5dd] .t-upload__file-name-text {
35
35
  cursor: pointer;
36
36
  }
37
- .qd-upload[data-v-e13e6ed6] .t-upload__file-thumbnail {
37
+ .qd-upload[data-v-afd4a5dd] .t-upload__file-thumbnail {
38
38
  width: var(--td-comp-size-m);
39
39
  height: var(--td-comp-size-m);
40
40
  }
41
- .qd-upload[data-v-e13e6ed6] .t-upload__card-image {
41
+ .qd-upload[data-v-afd4a5dd] .t-upload__card-image {
42
42
  width: 100%;
43
43
  height: 100%;
44
44
  }
45
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-image-viewer__trigger {
45
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-image-viewer__trigger {
46
46
  display: none;
47
47
  }
48
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-upload__flow-table {
48
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-upload__flow-table {
49
49
  margin-top: 0;
50
50
  }
51
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-upload__file-name__container {
51
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-upload__file-name__container {
52
52
  display: flex;
53
53
  align-items: center;
54
54
  }
55
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-upload__file-name-text {
55
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-upload__file-name-text {
56
56
  cursor: pointer;
57
57
  }
58
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-upload__file-thumbnail {
58
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-upload__file-thumbnail {
59
59
  width: var(--td-comp-size-m);
60
60
  height: var(--td-comp-size-m);
61
61
  }
62
- .qd-upload__popup-upload[data-v-e13e6ed6] .t-upload__card-image {
62
+ .qd-upload__popup-upload[data-v-afd4a5dd] .t-upload__card-image {
63
63
  width: 100%;
64
64
  height: 100%;
65
65
  }
66
- .qd-upload__popup-upload--disabled[data-v-e13e6ed6] .t-upload__flow-table th:last-child,
67
- .qd-upload__popup-upload--disabled[data-v-e13e6ed6] .t-upload__flow-table td:last-child {
66
+ .qd-upload__popup-upload--disabled[data-v-afd4a5dd] .t-upload__flow-table th:last-child,
67
+ .qd-upload__popup-upload--disabled[data-v-afd4a5dd] .t-upload__flow-table td:last-child {
68
68
  display: none;
69
69
  }
70
- .qd-upload[data-v-e13e6ed6]:focus .t-upload__flow-card-area,
71
- .qd-upload[data-v-e13e6ed6]:focus .t-upload__flow-table {
70
+ .qd-upload[data-v-afd4a5dd]:focus .t-upload__flow-card-area,
71
+ .qd-upload[data-v-afd4a5dd]:focus .t-upload__flow-table {
72
72
  border-color: var(--td-brand-color);
73
73
  }
74
- .qd-upload--only-view[data-v-e13e6ed6] .t-upload__flow-empty,
75
- .qd-upload--only-view[data-v-e13e6ed6] .t-upload__card-mask-item-divider {
74
+ .qd-upload--only-view[data-v-afd4a5dd] .t-upload__flow-empty,
75
+ .qd-upload--only-view[data-v-afd4a5dd] .t-upload__card-mask-item-divider {
76
76
  display: none;
77
77
  }
78
- .qd-upload--only-view[data-v-e13e6ed6] .t-upload__flow-card-area {
78
+ .qd-upload--only-view[data-v-afd4a5dd] .t-upload__flow-card-area {
79
79
  border-color: var(--td-component-border);
80
80
  }
81
- .qd-upload--only-view[data-v-e13e6ed6]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
82
- .qd-upload--only-view[data-v-e13e6ed6]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
83
- .qd-upload--only-view[data-v-e13e6ed6]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
81
+ .qd-upload--only-view[data-v-afd4a5dd]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
82
+ .qd-upload--only-view[data-v-afd4a5dd]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
83
+ .qd-upload--only-view[data-v-afd4a5dd]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
84
84
  display: none;
85
85
  }
86
- .qd-upload--only-view[data-v-e13e6ed6]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
87
- .qd-upload--only-view[data-v-e13e6ed6]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
86
+ .qd-upload--only-view[data-v-afd4a5dd]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
87
+ .qd-upload--only-view[data-v-afd4a5dd]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
88
88
  margin-top: 0;
89
89
  }
90
- .qd-upload--hide-manual-upload[data-v-e13e6ed6] .t-upload__flow-bottom {
90
+ .qd-upload--uploading[data-v-afd4a5dd] .t-upload__single-input-clear {
91
+ display: none;
92
+ }
93
+ .qd-upload--hide-manual-upload[data-v-afd4a5dd] .t-upload__flow-bottom {
91
94
  display: none;
92
95
  margin-top: 0;
93
96
  }
94
- .qd-upload--hide-progress[data-v-e13e6ed6] .t-upload__flow-table th:last-child,
95
- .qd-upload--hide-progress[data-v-e13e6ed6] .t-upload__flow-table td:last-child {
97
+ .qd-upload--hide-progress[data-v-afd4a5dd] .t-upload__flow-table th:last-child,
98
+ .qd-upload--hide-progress[data-v-afd4a5dd] .t-upload__flow-table td:last-child {
96
99
  display: none;
97
100
  }
98
- .qd-upload--disabled[data-v-e13e6ed6] .t-upload__flow-card-area {
101
+ .qd-upload--disabled[data-v-afd4a5dd] .t-upload__flow-card-area {
99
102
  border-color: var(--td-component-border);
100
103
  }
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const QdUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e13e6ed6"]]);
5
+ const QdUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-afd4a5dd"]]);
6
6
  export {
7
7
  QdUpload as default
8
8
  };
@@ -144,14 +144,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
144
  let isSyncingUploadModelValue = false;
145
145
  let isSyncingFiles = false;
146
146
  const tempUrlMap = /* @__PURE__ */ new WeakMap();
147
+ const removedUploadingFileValues = /* @__PURE__ */ new Set();
147
148
  const tempModelValueSet = /* @__PURE__ */ new Set();
148
149
  const ossListAbortReason = /* @__PURE__ */ Symbol("abort");
149
150
  let ossListAbort;
150
151
  const delList = ref([]);
152
+ const isUploading = computed(() => getDisplayFiles().some((file) => file.status === "progress"));
151
153
  const popupFileList = computed({
152
- get: () => [...fileList.value],
154
+ get: () => [...getDisplayFiles()],
153
155
  set: (files) => {
154
- fileList.value = files;
156
+ if (!props.autoUpload) {
157
+ fileList.value = files;
158
+ return;
159
+ }
160
+ const waitingFiles = waitingUploadFiles.value;
161
+ fileList.value = files.filter((file) => !waitingFiles.includes(file));
162
+ waitingUploadFiles.value = waitingFiles.filter((file) => files.includes(file));
155
163
  }
156
164
  });
157
165
  const popupVisible = ref(false);
@@ -307,11 +315,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
307
315
  }
308
316
  };
309
317
  const reOnSuccess = (context) => {
318
+ const nextFileList = fileList.value.filter((file) => {
319
+ const fileValue = file.response?.[reProps.value.valueMode];
320
+ return typeof fileValue !== "string" || !removedUploadingFileValues.has(fileValue);
321
+ });
322
+ if (nextFileList.length !== fileList.value.length) fileList.value = nextFileList;
310
323
  onSuccess?.(context);
311
324
  revokeTempUrl(context.file);
312
325
  updateTempModelValue(fileList.value);
313
326
  };
314
327
  const reOnRemove = (context) => {
328
+ const fileValue = context.file?.response?.[reProps.value.valueMode];
329
+ if (isUploading.value && typeof fileValue === "string") {
330
+ removedUploadingFileValues.add(fileValue);
331
+ }
315
332
  onRemove?.(context);
316
333
  revokeTempUrl(context.file);
317
334
  const { ossId } = context.file?.response || {};
@@ -582,6 +599,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
582
599
  }
583
600
  function clear() {
584
601
  revokeAllTempUrls();
602
+ removedUploadingFileValues.clear();
585
603
  reModelValue.value = [];
586
604
  fileList.value = [];
587
605
  waitingUploadFiles.value = [];
@@ -693,6 +711,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
693
711
  class: [
694
712
  "qd-upload",
695
713
  `qd-upload--${reProps.value.theme}`,
714
+ isUploading.value ? "qd-upload--uploading" : "",
696
715
  reProps.value.onlyView ? "qd-upload--only-view" : "",
697
716
  !reProps.value.uploadOptions.showUploadProgress && reProps.value.onlyView ? "qd-upload--hide-progress" : "",
698
717
  !reProps.value.uploadOptions.autoUpload && reProps.value.showManualButton ? "" : "qd-upload--hide-manual-upload",
@@ -722,7 +741,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
722
741
  ]),
723
742
  _: 1
724
743
  }, 8, ["disabled"])) : createCommentVNode("", true),
725
- fileList.value.length ? (openBlock(), createBlock(unref(Popup), {
744
+ popupFileList.value.length ? (openBlock(), createBlock(unref(Popup), {
726
745
  key: 1,
727
746
  visible: popupVisible.value,
728
747
  "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => popupVisible.value = $event),
@@ -738,6 +757,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
738
757
  files: popupFileList.value,
739
758
  "onUpdate:files": _cache[1] || (_cache[1] = ($event) => popupFileList.value = $event),
740
759
  theme: popupUploadTheme.value,
760
+ multiple: reProps.value.uploadOptions.multiple,
741
761
  disabled: reProps.value.uploadOptions.disabled,
742
762
  "on-remove": reProps.value.handlePopupRemove,
743
763
  "on-preview": reProps.value.uploadOptions.onPreview,
@@ -789,11 +809,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
789
809
  }, null, 8, ["files"])
790
810
  ]),
791
811
  _: 1
792
- }, 8, ["class", "files", "theme", "disabled", "on-remove", "on-preview", "show-thumbnail", "show-image-file-name", "show-upload-progress"])
812
+ }, 8, ["class", "files", "theme", "multiple", "disabled", "on-remove", "on-preview", "show-thumbnail", "show-image-file-name", "show-upload-progress"])
793
813
  ]),
794
814
  default: withCtx(() => [
795
815
  createVNode(unref(Badge), {
796
- count: fileList.value.length,
816
+ count: popupFileList.value.length,
797
817
  size: "small",
798
818
  offset: [2, 2],
799
819
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",