qidian-vue-ui 2.0.53 → 2.0.55

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,139 @@
1
- .qd-upload[data-v-44d65bb1] {
1
+ .qd-upload[data-v-4684f8e9] {
2
2
  width: 100%;
3
3
  outline: none;
4
4
  }
5
- .qd-upload[data-v-44d65bb1] .t-image-viewer__trigger {
5
+ .qd-upload[data-v-4684f8e9] .t-image-viewer__trigger {
6
6
  display: none;
7
7
  }
8
- .qd-upload[data-v-44d65bb1] .t-upload__dragger {
8
+ .qd-upload[data-v-4684f8e9] .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-44d65bb1] .t-upload__dragger-btns > .t-size-s {
14
+ .qd-upload[data-v-4684f8e9] .t-upload__dragger-btns > .t-size-s {
15
15
  display: inline-flex;
16
16
  }
17
- .qd-upload[data-v-44d65bb1] .t-upload__flow {
17
+ .qd-upload[data-v-4684f8e9] .t-upload__flow {
18
18
  width: 100%;
19
19
  min-width: auto;
20
20
  max-width: 100%;
21
21
  }
22
- .qd-upload[data-v-44d65bb1] .t-upload__flow-empty {
22
+ .qd-upload[data-v-4684f8e9] .t-upload__flow-empty {
23
23
  height: auto;
24
24
  min-height: 144px;
25
25
  }
26
- .qd-upload[data-v-44d65bb1] .t-upload__flow-card-area,
27
- .qd-upload[data-v-44d65bb1] .t-upload__flow-table {
26
+ .qd-upload[data-v-4684f8e9] .t-upload__flow-card-area,
27
+ .qd-upload[data-v-4684f8e9] .t-upload__flow-table {
28
28
  margin-top: var(--td-comp-margin-s);
29
29
  }
30
- .qd-upload[data-v-44d65bb1] .t-upload__file-name__container {
30
+ .qd-upload[data-v-4684f8e9] .t-upload__file-name__container {
31
31
  display: flex;
32
32
  align-items: center;
33
33
  }
34
- .qd-upload[data-v-44d65bb1] .t-upload__file-name-text {
34
+ .qd-upload[data-v-4684f8e9] .t-upload__file-name-text {
35
35
  cursor: pointer;
36
36
  }
37
- .qd-upload[data-v-44d65bb1] .t-upload__file-thumbnail {
37
+ .qd-upload[data-v-4684f8e9] .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-44d65bb1] .t-upload__card-image {
41
+ .qd-upload[data-v-4684f8e9] .t-upload__card-image {
42
42
  width: 100%;
43
43
  height: 100%;
44
44
  }
45
- .qd-upload__popup-upload[data-v-44d65bb1] .t-image-viewer__trigger {
45
+ .qd-upload__popup-upload[data-v-4684f8e9] .t-image-viewer__trigger {
46
46
  display: none;
47
47
  }
48
- .qd-upload__popup-upload[data-v-44d65bb1] .t-upload__flow-table {
48
+ .qd-upload__popup-upload[data-v-4684f8e9] .t-upload__flow-table {
49
49
  margin-top: 0;
50
50
  }
51
- .qd-upload__popup-upload[data-v-44d65bb1] .t-upload__file-name__container {
51
+ .qd-upload__popup-upload[data-v-4684f8e9] .t-upload__file-name__container {
52
52
  display: flex;
53
53
  align-items: center;
54
54
  }
55
- .qd-upload__popup-upload[data-v-44d65bb1] .t-upload__file-name-text {
55
+ .qd-upload__popup-upload[data-v-4684f8e9] .t-upload__file-name-text {
56
56
  cursor: pointer;
57
57
  }
58
- .qd-upload__popup-upload[data-v-44d65bb1] .t-upload__file-thumbnail {
58
+ .qd-upload__popup-upload[data-v-4684f8e9] .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-44d65bb1] .t-upload__card-image {
62
+ .qd-upload__popup-upload[data-v-4684f8e9] .t-upload__card-image {
63
63
  width: 100%;
64
64
  height: 100%;
65
65
  }
66
- .qd-upload__popup-upload--disabled[data-v-44d65bb1] .t-upload__flow-table th:last-child,
67
- .qd-upload__popup-upload--disabled[data-v-44d65bb1] .t-upload__flow-table td:last-child {
66
+ .qd-upload__popup-upload--disabled[data-v-4684f8e9] .t-upload__flow-table th:last-child,
67
+ .qd-upload__popup-upload--disabled[data-v-4684f8e9] .t-upload__flow-table td:last-child {
68
68
  display: none;
69
69
  }
70
- .qd-upload[data-v-44d65bb1]:focus .t-upload__flow-card-area,
71
- .qd-upload[data-v-44d65bb1]:focus .t-upload__flow-table {
70
+ .qd-upload__popup-actions[data-v-4684f8e9] {
71
+ display: inline-flex;
72
+ }
73
+ .qd-upload__popup-drag-text[data-v-4684f8e9] {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ width: 100%;
78
+ height: 100%;
79
+ color: var(--td-text-color-placeholder);
80
+ }
81
+ .qd-upload[data-v-4684f8e9]:focus .t-upload__flow-card-area,
82
+ .qd-upload[data-v-4684f8e9]:focus .t-upload__flow-table {
72
83
  border-color: var(--td-brand-color);
73
84
  }
74
- .qd-upload--only-view[data-v-44d65bb1] .t-upload__flow-empty,
75
- .qd-upload--only-view[data-v-44d65bb1] .t-upload__card-mask-item-divider {
85
+ .qd-upload--btn-image-popup[data-v-4684f8e9],
86
+ .qd-upload--btn-file-popup[data-v-4684f8e9] {
87
+ padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
88
+ border: 1px dashed var(--td-component-border);
89
+ transition: border 0.2s linear;
90
+ }
91
+ .qd-upload--btn-image-popup[data-v-4684f8e9] .t-upload__dragger,
92
+ .qd-upload--btn-file-popup[data-v-4684f8e9] .t-upload__dragger {
93
+ min-height: auto;
94
+ padding: 0;
95
+ border: 0;
96
+ overflow: visible;
97
+ justify-content: flex-start;
98
+ align-items: flex-start;
99
+ cursor: default;
100
+ }
101
+ .qd-upload--btn-image-popup[data-v-4684f8e9] .t-upload__dragger > .t-upload__trigger,
102
+ .qd-upload--btn-file-popup[data-v-4684f8e9] .t-upload__dragger > .t-upload__trigger {
103
+ width: 100%;
104
+ height: 100%;
105
+ }
106
+ .qd-upload--btn-image-popup[data-v-4684f8e9]:focus-within,
107
+ .qd-upload--btn-file-popup[data-v-4684f8e9]:focus-within {
108
+ border-color: var(--td-brand-color);
109
+ }
110
+ .qd-upload--only-view[data-v-4684f8e9] .t-upload__flow-empty,
111
+ .qd-upload--only-view[data-v-4684f8e9] .t-upload__card-mask-item-divider {
76
112
  display: none;
77
113
  }
78
- .qd-upload--only-view[data-v-44d65bb1] .t-upload__flow-card-area {
114
+ .qd-upload--only-view[data-v-4684f8e9] .t-upload__flow-card-area {
79
115
  border-color: var(--td-component-border);
80
116
  }
81
- .qd-upload--only-view[data-v-44d65bb1]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
82
- .qd-upload--only-view[data-v-44d65bb1]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
83
- .qd-upload--only-view[data-v-44d65bb1]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
117
+ .qd-upload--only-view[data-v-4684f8e9]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
118
+ .qd-upload--only-view[data-v-4684f8e9]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
119
+ .qd-upload--only-view[data-v-4684f8e9]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
84
120
  display: none;
85
121
  }
86
- .qd-upload--only-view[data-v-44d65bb1]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
87
- .qd-upload--only-view[data-v-44d65bb1]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
122
+ .qd-upload--only-view[data-v-4684f8e9]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
123
+ .qd-upload--only-view[data-v-4684f8e9]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
88
124
  margin-top: 0;
89
125
  }
90
- .qd-upload--hide-manual-upload[data-v-44d65bb1] .t-upload__flow-bottom {
126
+ .qd-upload--uploading[data-v-4684f8e9] .t-upload__single-input-clear {
127
+ display: none;
128
+ }
129
+ .qd-upload--hide-manual-upload[data-v-4684f8e9] .t-upload__flow-bottom {
91
130
  display: none;
92
131
  margin-top: 0;
93
132
  }
94
- .qd-upload--hide-progress[data-v-44d65bb1] .t-upload__flow-table th:last-child,
95
- .qd-upload--hide-progress[data-v-44d65bb1] .t-upload__flow-table td:last-child {
133
+ .qd-upload--hide-progress[data-v-4684f8e9] .t-upload__flow-table th:last-child,
134
+ .qd-upload--hide-progress[data-v-4684f8e9] .t-upload__flow-table td:last-child {
96
135
  display: none;
97
136
  }
98
- .qd-upload--disabled[data-v-44d65bb1] .t-upload__flow-card-area {
137
+ .qd-upload--disabled[data-v-4684f8e9] .t-upload__flow-card-area {
99
138
  border-color: var(--td-component-border);
100
139
  }
@@ -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-44d65bb1"]]);
5
+ const QdUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4684f8e9"]]);
6
6
  export {
7
7
  QdUpload as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import './index.css'
2
- import { defineComponent, mergeDefaults, getCurrentInstance, ref, computed, inject, useTemplateRef, watch, nextTick, onMounted, onUnmounted, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, createCommentVNode, createTextVNode, toDisplayString, createVNode, withModifiers, normalizeClass, createElementVNode, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { defineComponent, mergeDefaults, getCurrentInstance, ref, computed, inject, useTemplateRef, watch, nextTick, onMounted, onUnmounted, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, renderList, renderSlot, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, createVNode, withModifiers, normalizeClass, createElementVNode, normalizeProps, guardReactiveProps } from "vue";
3
3
  import { useVModel } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
4
4
  import dayjs from "../../_virtual/dayjs.min.mjs";
5
5
  import { isEmpty, useTimer, easyCopy, checkSameObject, abortWrapper, to, filterSlots, isTypeByName, suspectedWrapperPromise } from "qidian-shared";
@@ -20,6 +20,10 @@ import _sfc_main$3 from "./image-flow-file-list-display/index.vue.mjs";
20
20
  import { useReadonly } from "../../hooks/useReadonly.mjs";
21
21
  import { useDisabled } from "../../hooks/useDisabled.mjs";
22
22
  import { useModal } from "../../hooks/useModal.mjs";
23
+ const _hoisted_1 = {
24
+ key: 1,
25
+ class: "qd-upload__popup-drag-text"
26
+ };
23
27
  const tempOssIdPrefix = "__qd_upload_temp_";
24
28
  const _sfc_main = /* @__PURE__ */ defineComponent({
25
29
  ...{
@@ -144,14 +148,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
148
  let isSyncingUploadModelValue = false;
145
149
  let isSyncingFiles = false;
146
150
  const tempUrlMap = /* @__PURE__ */ new WeakMap();
151
+ const removedUploadingFileValues = /* @__PURE__ */ new Set();
147
152
  const tempModelValueSet = /* @__PURE__ */ new Set();
148
153
  const ossListAbortReason = /* @__PURE__ */ Symbol("abort");
149
154
  let ossListAbort;
150
155
  const delList = ref([]);
156
+ const isUploading = computed(() => getDisplayFiles().some((file) => file.status === "progress"));
151
157
  const popupFileList = computed({
152
- get: () => [...fileList.value],
158
+ get: () => [...getDisplayFiles()],
153
159
  set: (files) => {
154
- fileList.value = files;
160
+ if (!props.autoUpload) {
161
+ fileList.value = files;
162
+ return;
163
+ }
164
+ const waitingFiles = waitingUploadFiles.value;
165
+ fileList.value = files.filter((file) => !waitingFiles.includes(file));
166
+ waitingUploadFiles.value = waitingFiles.filter((file) => files.includes(file));
155
167
  }
156
168
  });
157
169
  const popupVisible = ref(false);
@@ -202,6 +214,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
202
214
  ...uploadOptions
203
215
  } = props;
204
216
  const globalUploadPropsV = globalUploadProps.value;
217
+ const uploadDisabled = onlyView || tdDisabled.value || tdReadonly.value;
218
+ const popupTheme = isPopupTheme(theme);
205
219
  const reAction = action || globalUploadPropsV?.action;
206
220
  const actionUrl = typeof reAction === "string" ? reAction : reAction?.(bucketConfigKey);
207
221
  const useUploadTimeout = timeout === void 0 || timeout > 0;
@@ -307,11 +321,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
307
321
  }
308
322
  };
309
323
  const reOnSuccess = (context) => {
324
+ const nextFileList = fileList.value.filter((file) => {
325
+ const fileValue = file.response?.[reProps.value.valueMode];
326
+ return typeof fileValue !== "string" || !removedUploadingFileValues.has(fileValue);
327
+ });
328
+ if (nextFileList.length !== fileList.value.length) fileList.value = nextFileList;
310
329
  onSuccess?.(context);
311
330
  revokeTempUrl(context.file);
312
331
  updateTempModelValue(fileList.value);
313
332
  };
314
333
  const reOnRemove = (context) => {
334
+ const fileValue = context.file?.response?.[reProps.value.valueMode];
335
+ if (isUploading.value && typeof fileValue === "string") {
336
+ removedUploadingFileValues.add(fileValue);
337
+ }
315
338
  onRemove?.(context);
316
339
  revokeTempUrl(context.file);
317
340
  const { ossId } = context.file?.response || {};
@@ -348,7 +371,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
348
371
  sizeLimit: reSizeLimit,
349
372
  accept: acceptStr,
350
373
  multiple: multiple ?? props.max !== 1,
351
- disabled: onlyView ? true : tdDisabled.value || tdReadonly.value,
374
+ disabled: uploadDisabled,
352
375
  beforeUpload: reBeforeUpload,
353
376
  onValidate: reOnValidate,
354
377
  formatResponse: useRequestMethod ? void 0 : reFormatResponse,
@@ -360,7 +383,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
360
383
  showImageFileName: onlyView ? false : showImageFileName,
361
384
  showUploadProgress: onlyView ? false : showUploadProgress,
362
385
  showThumbnail: onlyView ? true : showThumbnail,
363
- draggable: onlyView ? false : draggable
386
+ draggable: uploadDisabled ? false : popupTheme ? draggable ?? true : draggable
364
387
  };
365
388
  if (globalUploadPropsV) {
366
389
  const excludeKeys = ["action", "listOssByIds", "listOssByUrls", "del"];
@@ -407,6 +430,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
407
430
  }
408
431
  });
409
432
  const expose = {};
433
+ function isPopupTheme(theme) {
434
+ return theme === "btn-file-popup" || theme === "btn-image-popup";
435
+ }
436
+ function handlePopupClickCapture(event) {
437
+ if (!isPopupTheme(props.theme)) return;
438
+ const target = event.target;
439
+ if (target instanceof Element && target.closest(".qd-upload__popup-upload-action, .qd-upload__popup-view-action")) {
440
+ return;
441
+ }
442
+ event.stopPropagation();
443
+ }
410
444
  const uploadFiles = (options) => {
411
445
  const currentUploadFiles = options?.files ?? (props.autoUpload ? waitingUploadFiles.value : fileList.value);
412
446
  currentUploadFiles.forEach((file) => {
@@ -582,6 +616,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
582
616
  }
583
617
  function clear() {
584
618
  revokeAllTempUrls();
619
+ removedUploadingFileValues.clear();
585
620
  reModelValue.value = [];
586
621
  fileList.value = [];
587
622
  waitingUploadFiles.value = [];
@@ -693,6 +728,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
693
728
  class: [
694
729
  "qd-upload",
695
730
  `qd-upload--${reProps.value.theme}`,
731
+ isUploading.value ? "qd-upload--uploading" : "",
696
732
  reProps.value.onlyView ? "qd-upload--only-view" : "",
697
733
  !reProps.value.uploadOptions.showUploadProgress && reProps.value.onlyView ? "qd-upload--hide-progress" : "",
698
734
  !reProps.value.uploadOptions.autoUpload && reProps.value.showManualButton ? "" : "qd-upload--hide-manual-upload",
@@ -701,127 +737,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
701
737
  files: fileList.value,
702
738
  "onUpdate:files": _cache[3] || (_cache[3] = ($event) => fileList.value = $event),
703
739
  tabindex: reProps.value.onlyView || reProps.value.uploadOptions.disabled ? "" : "0"
704
- }, reProps.value.uploadOptions), createSlots({
705
- default: withCtx(() => [
706
- ["btn-file-popup", "btn-image-popup"].includes(__props.theme) ? (openBlock(), createBlock(unref(Space), {
707
- key: 0,
708
- align: "center",
709
- size: "small"
710
- }, {
711
- default: withCtx(() => [
712
- !reProps.value.onlyView ? (openBlock(), createBlock(unref(Button), {
713
- key: 0,
714
- variant: "outline",
715
- disabled: reProps.value.uploadOptions.disabled
716
- }, {
717
- icon: withCtx(() => [
718
- createVNode(unref(UploadIcon))
719
- ]),
720
- default: withCtx(() => [
721
- createTextVNode(" " + toDisplayString(autoTriggerUploadText.value), 1)
722
- ]),
723
- _: 1
724
- }, 8, ["disabled"])) : createCommentVNode("", true),
725
- fileList.value.length ? (openBlock(), createBlock(unref(Popup), {
726
- key: 1,
727
- visible: popupVisible.value,
728
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => popupVisible.value = $event),
729
- "show-arrow": "",
730
- trigger: "click"
731
- }, {
732
- content: withCtx(() => [
733
- createVNode(unref(Upload), {
734
- class: normalizeClass([
735
- "qd-upload__popup-upload",
736
- reProps.value.uploadOptions.disabled ? "qd-upload__popup-upload--disabled" : ""
737
- ]),
738
- files: popupFileList.value,
739
- "onUpdate:files": _cache[1] || (_cache[1] = ($event) => popupFileList.value = $event),
740
- theme: popupUploadTheme.value,
741
- multiple: reProps.value.uploadOptions.multiple,
742
- disabled: reProps.value.uploadOptions.disabled,
743
- "on-remove": reProps.value.handlePopupRemove,
744
- "on-preview": reProps.value.uploadOptions.onPreview,
745
- "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
746
- "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
747
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress
748
- }, {
749
- trigger: withCtx(() => [..._cache[4] || (_cache[4] = [
750
- createElementVNode("span", { style: { "display": "none" } }, null, -1)
751
- ])]),
752
- "file-list-display": withCtx(({
753
- files,
754
- locale,
755
- onPreview,
756
- onRemove,
757
- dragEvents,
758
- triggerUpload
759
- }) => [
760
- popupUploadTheme.value === "image" ? (openBlock(), createBlock(unref(_sfc_main$1), {
761
- key: 0,
762
- locale,
763
- files,
764
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
765
- "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
766
- "abridge-name": reProps.value.uploadOptions.abridgeName,
767
- disabled: reProps.value.uploadOptions.disabled,
768
- max: reProps.value.uploadOptions.max,
769
- multiple: reProps.value.uploadOptions.multiple,
770
- trigger: false,
771
- "trigger-upload": triggerUpload,
772
- "on-preview": onPreview,
773
- "on-remove": onRemove
774
- }, null, 8, ["locale", "files", "show-upload-progress", "show-image-file-name", "abridge-name", "disabled", "max", "multiple", "trigger-upload", "on-preview", "on-remove"])) : (openBlock(), createBlock(unref(QdUploadFileFlowFileListDisplay), {
775
- key: 1,
776
- locale,
777
- files,
778
- "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
779
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
780
- "abridge-name": reProps.value.uploadOptions.abridgeName,
781
- "is-batch-upload": reProps.value.uploadOptions.isBatchUpload,
782
- disabled: reProps.value.uploadOptions.disabled,
783
- "drag-events": dragEvents,
784
- "on-preview": onPreview,
785
- "on-remove": onRemove
786
- }, null, 8, ["locale", "files", "show-thumbnail", "show-upload-progress", "abridge-name", "is-batch-upload", "disabled", "drag-events", "on-preview", "on-remove"])),
787
- createVNode(unref(_sfc_main$2), {
788
- ref: "multiFileViewer",
789
- files: viewerFiles.value
790
- }, null, 8, ["files"])
791
- ]),
792
- _: 1
793
- }, 8, ["class", "files", "theme", "multiple", "disabled", "on-remove", "on-preview", "show-thumbnail", "show-image-file-name", "show-upload-progress"])
794
- ]),
795
- default: withCtx(() => [
796
- createVNode(unref(Badge), {
797
- count: fileList.value.length,
798
- size: "small",
799
- offset: [2, 2],
800
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
801
- }, ["stop"]))
802
- }, {
803
- default: withCtx(() => [
804
- createVNode(unref(Button), { variant: "outline" }, {
805
- icon: withCtx(() => [
806
- createVNode(unref(BrowseIcon))
807
- ]),
808
- default: withCtx(() => [
809
- createTextVNode(" " + toDisplayString(unref(t)("viewFileText")), 1)
810
- ]),
811
- _: 1
812
- })
813
- ]),
814
- _: 1
815
- }, 8, ["count"])
816
- ]),
817
- _: 1
818
- }, 8, ["visible"])) : createCommentVNode("", true)
819
- ]),
820
- _: 1
821
- })) : createCommentVNode("", true)
822
- ]),
823
- _: 2
824
- }, [
740
+ }, reProps.value.uploadOptions, { onClickCapture: handlePopupClickCapture }), createSlots({ _: 2 }, [
825
741
  _ctx.$slots.trigger ? {
826
742
  name: "trigger",
827
743
  fn: withCtx((slotProps) => [
@@ -832,6 +748,131 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
832
748
  ]),
833
749
  key: "0"
834
750
  } : void 0,
751
+ isPopupTheme(__props.theme) ? {
752
+ name: "default",
753
+ fn: withCtx(({ dragActive }) => [
754
+ !dragActive ? (openBlock(), createBlock(unref(Space), {
755
+ key: 0,
756
+ class: "qd-upload__popup-actions",
757
+ align: "center",
758
+ size: "small"
759
+ }, {
760
+ default: withCtx(() => [
761
+ !reProps.value.onlyView ? (openBlock(), createBlock(unref(Button), {
762
+ key: 0,
763
+ class: "qd-upload__popup-upload-action",
764
+ variant: "outline",
765
+ disabled: reProps.value.uploadOptions.disabled
766
+ }, {
767
+ icon: withCtx(() => [
768
+ createVNode(unref(UploadIcon))
769
+ ]),
770
+ default: withCtx(() => [
771
+ createTextVNode(" " + toDisplayString(autoTriggerUploadText.value), 1)
772
+ ]),
773
+ _: 1
774
+ }, 8, ["disabled"])) : createCommentVNode("", true),
775
+ popupFileList.value.length ? (openBlock(), createBlock(unref(Popup), {
776
+ key: 1,
777
+ visible: popupVisible.value,
778
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => popupVisible.value = $event),
779
+ "show-arrow": "",
780
+ trigger: "click"
781
+ }, {
782
+ content: withCtx(() => [
783
+ createVNode(unref(Upload), {
784
+ class: normalizeClass([
785
+ "qd-upload__popup-upload",
786
+ reProps.value.uploadOptions.disabled ? "qd-upload__popup-upload--disabled" : ""
787
+ ]),
788
+ files: popupFileList.value,
789
+ "onUpdate:files": _cache[1] || (_cache[1] = ($event) => popupFileList.value = $event),
790
+ theme: popupUploadTheme.value,
791
+ multiple: reProps.value.uploadOptions.multiple,
792
+ disabled: reProps.value.uploadOptions.disabled,
793
+ "on-remove": reProps.value.handlePopupRemove,
794
+ "on-preview": reProps.value.uploadOptions.onPreview,
795
+ "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
796
+ "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
797
+ "show-upload-progress": reProps.value.uploadOptions.showUploadProgress
798
+ }, {
799
+ trigger: withCtx(() => [..._cache[4] || (_cache[4] = [
800
+ createElementVNode("span", { style: { "display": "none" } }, null, -1)
801
+ ])]),
802
+ "file-list-display": withCtx(({
803
+ files,
804
+ locale,
805
+ onPreview,
806
+ onRemove,
807
+ dragEvents,
808
+ triggerUpload
809
+ }) => [
810
+ popupUploadTheme.value === "image" ? (openBlock(), createBlock(unref(_sfc_main$1), {
811
+ key: 0,
812
+ locale,
813
+ files,
814
+ "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
815
+ "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
816
+ "abridge-name": reProps.value.uploadOptions.abridgeName,
817
+ disabled: reProps.value.uploadOptions.disabled,
818
+ max: reProps.value.uploadOptions.max,
819
+ multiple: reProps.value.uploadOptions.multiple,
820
+ trigger: false,
821
+ "trigger-upload": triggerUpload,
822
+ "on-preview": onPreview,
823
+ "on-remove": onRemove
824
+ }, null, 8, ["locale", "files", "show-upload-progress", "show-image-file-name", "abridge-name", "disabled", "max", "multiple", "trigger-upload", "on-preview", "on-remove"])) : (openBlock(), createBlock(unref(QdUploadFileFlowFileListDisplay), {
825
+ key: 1,
826
+ locale,
827
+ files,
828
+ "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
829
+ "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
830
+ "abridge-name": reProps.value.uploadOptions.abridgeName,
831
+ "is-batch-upload": reProps.value.uploadOptions.isBatchUpload,
832
+ disabled: reProps.value.uploadOptions.disabled,
833
+ "drag-events": dragEvents,
834
+ "on-preview": onPreview,
835
+ "on-remove": onRemove
836
+ }, null, 8, ["locale", "files", "show-thumbnail", "show-upload-progress", "abridge-name", "is-batch-upload", "disabled", "drag-events", "on-preview", "on-remove"])),
837
+ createVNode(unref(_sfc_main$2), {
838
+ ref: "multiFileViewer",
839
+ files: viewerFiles.value
840
+ }, null, 8, ["files"])
841
+ ]),
842
+ _: 1
843
+ }, 8, ["class", "files", "theme", "multiple", "disabled", "on-remove", "on-preview", "show-thumbnail", "show-image-file-name", "show-upload-progress"])
844
+ ]),
845
+ default: withCtx(() => [
846
+ createVNode(unref(Badge), {
847
+ class: "qd-upload__popup-view-action",
848
+ count: popupFileList.value.length,
849
+ size: "small",
850
+ offset: [2, 2],
851
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
852
+ }, ["stop"]))
853
+ }, {
854
+ default: withCtx(() => [
855
+ createVNode(unref(Button), { variant: "outline" }, {
856
+ icon: withCtx(() => [
857
+ createVNode(unref(BrowseIcon))
858
+ ]),
859
+ default: withCtx(() => [
860
+ createTextVNode(" " + toDisplayString(unref(t)("viewFileText")), 1)
861
+ ]),
862
+ _: 1
863
+ })
864
+ ]),
865
+ _: 1
866
+ }, 8, ["count"])
867
+ ]),
868
+ _: 1
869
+ }, 8, ["visible"])) : createCommentVNode("", true)
870
+ ]),
871
+ _: 1
872
+ })) : (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(unref(t)("dragger").dragDropText), 1))
873
+ ]),
874
+ key: "1"
875
+ } : void 0,
835
876
  __props.theme === "image-flow" ? {
836
877
  name: "file-list-display",
837
878
  fn: withCtx(({ files, locale, onPreview, onRemove }) => [
@@ -858,7 +899,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
858
899
  files: viewerFiles.value
859
900
  }, null, 8, ["files"])
860
901
  ]),
861
- key: "1"
902
+ key: "2"
862
903
  } : __props.theme === "file-flow" ? {
863
904
  name: "file-list-display",
864
905
  fn: withCtx(({ files, locale, onPreview, onRemove, dragEvents }) => [
@@ -888,7 +929,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
888
929
  files: viewerFiles.value
889
930
  }, null, 8, ["files"])
890
931
  ]),
891
- key: "2"
932
+ key: "3"
892
933
  } : __props.theme === "image" ? {
893
934
  name: "file-list-display",
894
935
  fn: withCtx(({ files, locale, onPreview, onRemove, triggerUpload }) => [
@@ -920,7 +961,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
920
961
  files: viewerFiles.value
921
962
  }, null, 8, ["files"])
922
963
  ]),
923
- key: "3"
964
+ key: "4"
924
965
  } : void 0,
925
966
  renderList(unref(filterSlots)(_ctx.$slots, ["trigger"]), (name) => {
926
967
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.53",
3
+ "version": "2.0.55",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",