qidian-vue-ui 2.0.54 → 2.0.56

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.
@@ -5,7 +5,7 @@ declare const _default: <FD extends Data = Data>(__VLS_props: NonNullable<Awaite
5
5
  readonly "onUpdate:visible"?: ((args_0: boolean | undefined) => any) | undefined;
6
6
  readonly "onUpdate:data"?: ((args_0: FD | undefined) => any) | undefined;
7
7
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:visible" | "onUpdate:data"> & QdDialogFormProps<FD> & Partial<{}>> & import("vue").PublicProps;
8
- expose(exposed: import("vue").ShallowUnwrapRef<QdDialogFormInstanceFunctions<Data>>): void;
8
+ expose(exposed: import("vue").ShallowUnwrapRef<QdDialogFormInstanceFunctions<FD>>): void;
9
9
  attrs: any;
10
10
  slots: {
11
11
  [x: string]: ((props: any) => any) | undefined;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, mergeDefaults, useTemplateRef, ref, computed, createBlock, openBlock, mergeProps, unref, isRef, createSlots, withCtx, createVNode, renderList, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, createElementBlock, resolveDynamicComponent, Fragment } from "vue";
2
2
  import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
3
- import { suspectedWrapperPromise, isEmpty, easyCopy, extractSlotsWithPrefix, extractSlotsWithoutPrefix } from "qidian-shared";
3
+ import { suspectedWrapperPromise, createExposeProxy, extractSlotsWithPrefix, extractSlotsWithoutPrefix, isEmpty, easyCopy } from "qidian-shared";
4
4
  import { Button } from "tdesign-vue-next";
5
5
  import { useConfig } from "../config-provider/useConfig.mjs";
6
6
  import _sfc_main$1 from "./index.vue.mjs";
@@ -110,7 +110,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
110
110
  wrapper.onBeforeOpen?.();
111
111
  },
112
112
  onOpened: () => {
113
- Object.assign(expose, formRef.value);
114
113
  formRef.value?.clearValidate();
115
114
  opened.value = true;
116
115
  wrapper.onOpened?.();
@@ -152,11 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
152
151
  function hide() {
153
152
  visible.value = false;
154
153
  }
155
- const expose = {
156
- show,
157
- hide
158
- };
159
- __expose(expose);
154
+ __expose(createExposeProxy({ show, hide }, formRef));
160
155
  return (_ctx, _cache) => {
161
156
  return openBlock(), createBlock(_sfc_main$1, mergeProps({
162
157
  visible: unref(visible),
@@ -1,103 +1,139 @@
1
- .qd-upload[data-v-afd4a5dd] {
1
+ .qd-upload[data-v-4684f8e9] {
2
2
  width: 100%;
3
3
  outline: none;
4
4
  }
5
- .qd-upload[data-v-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .t-upload__flow-card-area,
27
- .qd-upload[data-v-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .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-afd4a5dd] .t-upload__flow-table th:last-child,
67
- .qd-upload__popup-upload--disabled[data-v-afd4a5dd] .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-afd4a5dd]:focus .t-upload__flow-card-area,
71
- .qd-upload[data-v-afd4a5dd]: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 {
83
+ border-color: var(--td-brand-color);
84
+ }
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 {
72
108
  border-color: var(--td-brand-color);
73
109
  }
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 {
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-afd4a5dd] .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-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 {
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-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 {
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--uploading[data-v-afd4a5dd] .t-upload__single-input-clear {
126
+ .qd-upload--uploading[data-v-4684f8e9] .t-upload__single-input-clear {
91
127
  display: none;
92
128
  }
93
- .qd-upload--hide-manual-upload[data-v-afd4a5dd] .t-upload__flow-bottom {
129
+ .qd-upload--hide-manual-upload[data-v-4684f8e9] .t-upload__flow-bottom {
94
130
  display: none;
95
131
  margin-top: 0;
96
132
  }
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 {
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 {
99
135
  display: none;
100
136
  }
101
- .qd-upload--disabled[data-v-afd4a5dd] .t-upload__flow-card-area {
137
+ .qd-upload--disabled[data-v-4684f8e9] .t-upload__flow-card-area {
102
138
  border-color: var(--td-component-border);
103
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-afd4a5dd"]]);
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
  ...{
@@ -210,6 +214,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
210
214
  ...uploadOptions
211
215
  } = props;
212
216
  const globalUploadPropsV = globalUploadProps.value;
217
+ const uploadDisabled = onlyView || tdDisabled.value || tdReadonly.value;
218
+ const popupTheme = isPopupTheme(theme);
213
219
  const reAction = action || globalUploadPropsV?.action;
214
220
  const actionUrl = typeof reAction === "string" ? reAction : reAction?.(bucketConfigKey);
215
221
  const useUploadTimeout = timeout === void 0 || timeout > 0;
@@ -365,7 +371,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
365
371
  sizeLimit: reSizeLimit,
366
372
  accept: acceptStr,
367
373
  multiple: multiple ?? props.max !== 1,
368
- disabled: onlyView ? true : tdDisabled.value || tdReadonly.value,
374
+ disabled: uploadDisabled,
369
375
  beforeUpload: reBeforeUpload,
370
376
  onValidate: reOnValidate,
371
377
  formatResponse: useRequestMethod ? void 0 : reFormatResponse,
@@ -377,7 +383,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
377
383
  showImageFileName: onlyView ? false : showImageFileName,
378
384
  showUploadProgress: onlyView ? false : showUploadProgress,
379
385
  showThumbnail: onlyView ? true : showThumbnail,
380
- draggable: onlyView ? false : draggable
386
+ draggable: uploadDisabled ? false : popupTheme ? draggable ?? true : draggable
381
387
  };
382
388
  if (globalUploadPropsV) {
383
389
  const excludeKeys = ["action", "listOssByIds", "listOssByUrls", "del"];
@@ -424,6 +430,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
424
430
  }
425
431
  });
426
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
+ }
427
444
  const uploadFiles = (options) => {
428
445
  const currentUploadFiles = options?.files ?? (props.autoUpload ? waitingUploadFiles.value : fileList.value);
429
446
  currentUploadFiles.forEach((file) => {
@@ -720,127 +737,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
720
737
  files: fileList.value,
721
738
  "onUpdate:files": _cache[3] || (_cache[3] = ($event) => fileList.value = $event),
722
739
  tabindex: reProps.value.onlyView || reProps.value.uploadOptions.disabled ? "" : "0"
723
- }, reProps.value.uploadOptions), createSlots({
724
- default: withCtx(() => [
725
- ["btn-file-popup", "btn-image-popup"].includes(__props.theme) ? (openBlock(), createBlock(unref(Space), {
726
- key: 0,
727
- align: "center",
728
- size: "small"
729
- }, {
730
- default: withCtx(() => [
731
- !reProps.value.onlyView ? (openBlock(), createBlock(unref(Button), {
732
- key: 0,
733
- variant: "outline",
734
- disabled: reProps.value.uploadOptions.disabled
735
- }, {
736
- icon: withCtx(() => [
737
- createVNode(unref(UploadIcon))
738
- ]),
739
- default: withCtx(() => [
740
- createTextVNode(" " + toDisplayString(autoTriggerUploadText.value), 1)
741
- ]),
742
- _: 1
743
- }, 8, ["disabled"])) : createCommentVNode("", true),
744
- popupFileList.value.length ? (openBlock(), createBlock(unref(Popup), {
745
- key: 1,
746
- visible: popupVisible.value,
747
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => popupVisible.value = $event),
748
- "show-arrow": "",
749
- trigger: "click"
750
- }, {
751
- content: withCtx(() => [
752
- createVNode(unref(Upload), {
753
- class: normalizeClass([
754
- "qd-upload__popup-upload",
755
- reProps.value.uploadOptions.disabled ? "qd-upload__popup-upload--disabled" : ""
756
- ]),
757
- files: popupFileList.value,
758
- "onUpdate:files": _cache[1] || (_cache[1] = ($event) => popupFileList.value = $event),
759
- theme: popupUploadTheme.value,
760
- multiple: reProps.value.uploadOptions.multiple,
761
- disabled: reProps.value.uploadOptions.disabled,
762
- "on-remove": reProps.value.handlePopupRemove,
763
- "on-preview": reProps.value.uploadOptions.onPreview,
764
- "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
765
- "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
766
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress
767
- }, {
768
- trigger: withCtx(() => [..._cache[4] || (_cache[4] = [
769
- createElementVNode("span", { style: { "display": "none" } }, null, -1)
770
- ])]),
771
- "file-list-display": withCtx(({
772
- files,
773
- locale,
774
- onPreview,
775
- onRemove,
776
- dragEvents,
777
- triggerUpload
778
- }) => [
779
- popupUploadTheme.value === "image" ? (openBlock(), createBlock(unref(_sfc_main$1), {
780
- key: 0,
781
- locale,
782
- files,
783
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
784
- "show-image-file-name": reProps.value.uploadOptions.showImageFileName,
785
- "abridge-name": reProps.value.uploadOptions.abridgeName,
786
- disabled: reProps.value.uploadOptions.disabled,
787
- max: reProps.value.uploadOptions.max,
788
- multiple: reProps.value.uploadOptions.multiple,
789
- trigger: false,
790
- "trigger-upload": triggerUpload,
791
- "on-preview": onPreview,
792
- "on-remove": onRemove
793
- }, 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), {
794
- key: 1,
795
- locale,
796
- files,
797
- "show-thumbnail": reProps.value.uploadOptions.showThumbnail,
798
- "show-upload-progress": reProps.value.uploadOptions.showUploadProgress,
799
- "abridge-name": reProps.value.uploadOptions.abridgeName,
800
- "is-batch-upload": reProps.value.uploadOptions.isBatchUpload,
801
- disabled: reProps.value.uploadOptions.disabled,
802
- "drag-events": dragEvents,
803
- "on-preview": onPreview,
804
- "on-remove": onRemove
805
- }, null, 8, ["locale", "files", "show-thumbnail", "show-upload-progress", "abridge-name", "is-batch-upload", "disabled", "drag-events", "on-preview", "on-remove"])),
806
- createVNode(unref(_sfc_main$2), {
807
- ref: "multiFileViewer",
808
- files: viewerFiles.value
809
- }, null, 8, ["files"])
810
- ]),
811
- _: 1
812
- }, 8, ["class", "files", "theme", "multiple", "disabled", "on-remove", "on-preview", "show-thumbnail", "show-image-file-name", "show-upload-progress"])
813
- ]),
814
- default: withCtx(() => [
815
- createVNode(unref(Badge), {
816
- count: popupFileList.value.length,
817
- size: "small",
818
- offset: [2, 2],
819
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
820
- }, ["stop"]))
821
- }, {
822
- default: withCtx(() => [
823
- createVNode(unref(Button), { variant: "outline" }, {
824
- icon: withCtx(() => [
825
- createVNode(unref(BrowseIcon))
826
- ]),
827
- default: withCtx(() => [
828
- createTextVNode(" " + toDisplayString(unref(t)("viewFileText")), 1)
829
- ]),
830
- _: 1
831
- })
832
- ]),
833
- _: 1
834
- }, 8, ["count"])
835
- ]),
836
- _: 1
837
- }, 8, ["visible"])) : createCommentVNode("", true)
838
- ]),
839
- _: 1
840
- })) : createCommentVNode("", true)
841
- ]),
842
- _: 2
843
- }, [
740
+ }, reProps.value.uploadOptions, { onClickCapture: handlePopupClickCapture }), createSlots({ _: 2 }, [
844
741
  _ctx.$slots.trigger ? {
845
742
  name: "trigger",
846
743
  fn: withCtx((slotProps) => [
@@ -851,6 +748,131 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
851
748
  ]),
852
749
  key: "0"
853
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,
854
876
  __props.theme === "image-flow" ? {
855
877
  name: "file-list-display",
856
878
  fn: withCtx(({ files, locale, onPreview, onRemove }) => [
@@ -877,7 +899,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
877
899
  files: viewerFiles.value
878
900
  }, null, 8, ["files"])
879
901
  ]),
880
- key: "1"
902
+ key: "2"
881
903
  } : __props.theme === "file-flow" ? {
882
904
  name: "file-list-display",
883
905
  fn: withCtx(({ files, locale, onPreview, onRemove, dragEvents }) => [
@@ -907,7 +929,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
907
929
  files: viewerFiles.value
908
930
  }, null, 8, ["files"])
909
931
  ]),
910
- key: "2"
932
+ key: "3"
911
933
  } : __props.theme === "image" ? {
912
934
  name: "file-list-display",
913
935
  fn: withCtx(({ files, locale, onPreview, onRemove, triggerUpload }) => [
@@ -939,7 +961,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
939
961
  files: viewerFiles.value
940
962
  }, null, 8, ["files"])
941
963
  ]),
942
- key: "3"
964
+ key: "4"
943
965
  } : void 0,
944
966
  renderList(unref(filterSlots)(_ctx.$slots, ["trigger"]), (name) => {
945
967
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.54",
3
+ "version": "2.0.56",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",