vft 0.0.506 → 0.0.509
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/index.css +1 -1
- package/es/components/cascader/cascader.vue2.js +203 -202
- package/es/components/cascader-panel/menu.vue2.js +50 -49
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
- package/es/components/color-picker/color-picker.vue2.js +134 -133
- package/es/components/config-provider/config-provider.vue.d.ts +2 -0
- package/es/components/config-provider/config-provider.vue2.js +5 -4
- package/es/components/config-provider/constants.d.ts +1 -0
- package/es/components/config-provider/constants.js +3 -2
- package/es/components/config-provider/hooks/use-global-config.js +33 -30
- package/es/components/config-provider/index.d.ts +9 -0
- package/es/components/config-provider/index.js +6 -5
- package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
- package/es/components/date-picker/composables/use-month-range-header.js +15 -14
- package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
- package/es/components/date-time-select/date-time-select.vue2.js +39 -36
- package/es/components/dropdown/dropdown.vue2.js +68 -67
- package/es/components/empty/empty.vue2.js +39 -38
- package/es/components/full-screen/full-screen.vue2.js +18 -17
- package/es/components/image/image.vue2.js +60 -59
- package/es/components/image-viewer/image-viewer.vue2.js +45 -44
- package/es/components/index.js +161 -160
- package/es/components/input/index.d.ts +5 -0
- package/es/components/input/input.vue.d.ts +2 -0
- package/es/components/input/input.vue2.js +42 -41
- package/es/components/md-container/md-container.vue2.js +75 -74
- package/es/components/md-container/toc.js +37 -36
- package/es/components/modal/modal-footer-action.vue2.js +25 -24
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
- package/es/components/pagination/components/jumper.vue2.js +29 -28
- package/es/components/pagination/components/sizes.vue2.js +21 -20
- package/es/components/pagination/components/total.vue2.js +11 -10
- package/es/components/popconfirm/popconfirm.vue2.js +40 -39
- package/es/components/search/search.vue2.js +79 -77
- package/es/components/select/useSelect.js +232 -231
- package/es/components/super-form/super-form-action.vue2.js +41 -40
- package/es/components/super-form/super-form-item.vue2.js +206 -203
- package/es/components/super-form/use/helper.d.ts +1 -1
- package/es/components/super-form/use/helper.js +62 -62
- package/es/components/table/field.js +130 -110
- package/es/components/table/table.vue2.js +152 -150
- package/es/components/table/use/use-columns.js +29 -26
- package/es/components/table/use/use-data-source.js +87 -86
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
- package/es/components/transfer/transfer-panel.vue2.js +57 -56
- package/es/components/transfer/transfer.vue2.js +70 -69
- package/es/components/tree/tree.vue2.js +60 -59
- package/es/components/upload/index.d.ts +3 -3
- package/es/components/upload/upload-content.vue.d.ts +2 -2
- package/es/components/upload/upload-content.vue2.js +78 -75
- package/es/components/upload/upload-list.vue2.js +46 -45
- package/es/components/upload/upload.vue.d.ts +2 -2
- package/es/components/upload/upload.vue2.js +87 -85
- package/es/components/upload/utils.js +29 -29
- package/es/constants/date.d.ts +1 -1
- package/es/constants/date.js +9 -1
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +1 -0
- package/es/index.js +5 -1
- package/es/locale/index.d.js +1 -0
- package/es/locale/index.d.ts +26 -0
- package/es/locale/index.js +10 -0
- package/es/locale/lang/en.d.ts +183 -0
- package/es/locale/lang/en.js +241 -0
- package/es/locale/lang/zh-cn.d.ts +183 -0
- package/es/locale/lang/zh-cn.js +241 -0
- package/es/locale/lang/zh-tw.d.ts +183 -0
- package/es/locale/lang/zh-tw.js +241 -0
- package/es/locale/use-locale.d.ts +17 -0
- package/es/locale/use-locale.js +56 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +1 -0
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +9 -0
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/index.d.ts +5 -0
- package/lib/components/input/input.vue.d.ts +2 -0
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/use/use-columns.cjs +1 -1
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/index.d.ts +3 -3
- package/lib/components/upload/upload-content.vue.d.ts +2 -2
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue.d.ts +2 -2
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/upload/utils.cjs +1 -1
- package/lib/constants/date.cjs +1 -1
- package/lib/constants/date.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/locale/index.cjs +1 -0
- package/lib/locale/index.d.cjs +1 -0
- package/lib/locale/index.d.ts +26 -0
- package/lib/locale/lang/en.cjs +1 -0
- package/lib/locale/lang/en.d.ts +183 -0
- package/lib/locale/lang/zh-cn.cjs +1 -0
- package/lib/locale/lang/zh-cn.d.ts +183 -0
- package/lib/locale/lang/zh-tw.cjs +1 -0
- package/lib/locale/lang/zh-tw.d.ts +183 -0
- package/lib/locale/use-locale.cjs +1 -0
- package/lib/locale/use-locale.d.ts +17 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/super-form.scss +0 -1
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as D, shallowRef as I, createElementBlock as
|
|
1
|
+
import { defineComponent as D, shallowRef as I, computed as A, createElementBlock as N, openBlock as q, withKeys as X, normalizeClass as L, withModifiers as T, unref as g, createBlock as G, renderSlot as w, createElementVNode as J, withCtx as Q, nextTick as Y } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
|
-
import { isObject as O, entriesOf as
|
|
5
|
-
import { debugWarn as
|
|
4
|
+
import { isObject as O, entriesOf as Z } from "@vft/utils";
|
|
5
|
+
import { debugWarn as _ } from "../../utils/error.js";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
|
-
import { cloneDeep as F, isEqual as
|
|
8
|
-
import { useNamespace as
|
|
7
|
+
import { cloneDeep as F, isEqual as ee } from "lodash-es";
|
|
8
|
+
import { useNamespace as te } from "../../hooks/use-namespace/index.js";
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
12
|
+
import { useLocale as oe } from "../../locale/use-locale.js";
|
|
13
|
+
import { ajaxUpload as ae } from "./ajax.js";
|
|
14
|
+
import { genFileId as ie } from "./constants.js";
|
|
15
|
+
import ne from "./upload-dragger.vue2.js";
|
|
16
|
+
import { validateFileType as P, isImageOrVideo as le, validateFileSize as se } from "./utils.js";
|
|
17
|
+
import { useFormDisabled as re } from "../form/hooks/use-form-common-props.js";
|
|
18
|
+
import { useFormItem as de } from "../form/hooks/use-form-item.js";
|
|
19
|
+
const ce = ["onKeydown"], fe = ["name", "multiple", "accept"], ue = D({
|
|
19
20
|
name: "VftUploadContent",
|
|
20
21
|
inheritAttrs: !1
|
|
21
|
-
}),
|
|
22
|
-
...
|
|
22
|
+
}), Te = /* @__PURE__ */ D({
|
|
23
|
+
...ue,
|
|
23
24
|
props: {
|
|
24
25
|
fileList: { default: [] },
|
|
25
26
|
replaceOnLimit: { type: Boolean, default: !1 },
|
|
@@ -36,11 +37,11 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
|
36
37
|
type: { default: "select" },
|
|
37
38
|
autoUpload: { type: Boolean, default: !1 },
|
|
38
39
|
listType: { default: "text" },
|
|
39
|
-
httpRequest: { type: Function, default:
|
|
40
|
+
httpRequest: { type: Function, default: ae },
|
|
40
41
|
disabled: { type: Boolean },
|
|
41
42
|
limit: {},
|
|
42
43
|
maxSize: { default: void 0 },
|
|
43
|
-
sizeExceedMessage: { default:
|
|
44
|
+
sizeExceedMessage: { default: void 0 },
|
|
44
45
|
sizeWidth: { default: void 0 },
|
|
45
46
|
sizeHeight: { default: void 0 },
|
|
46
47
|
onSizeInvalid: {},
|
|
@@ -55,14 +56,16 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
|
55
56
|
onSizeExceed: {}
|
|
56
57
|
},
|
|
57
58
|
setup(r, { expose: K }) {
|
|
58
|
-
const
|
|
59
|
+
const { t: M } = oe(), n = r, v = te("upload"), k = re(), { formItem: V } = de(), u = I(
|
|
59
60
|
{}
|
|
60
|
-
), b = I()
|
|
61
|
+
), b = I();
|
|
62
|
+
A(() => n.sizeExceedMessage || M("vft.upload.sizeExceed"));
|
|
63
|
+
const B = async (e) => {
|
|
61
64
|
if (e.length === 0) return;
|
|
62
65
|
const {
|
|
63
66
|
autoUpload: o,
|
|
64
67
|
limit: a,
|
|
65
|
-
fileList:
|
|
68
|
+
fileList: l,
|
|
66
69
|
multiple: p,
|
|
67
70
|
onStart: m,
|
|
68
71
|
onExceed: E,
|
|
@@ -71,75 +74,75 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
|
71
74
|
onSizeExceed: z,
|
|
72
75
|
sizeWidth: h,
|
|
73
76
|
sizeHeight: y,
|
|
74
|
-
onSizeInvalid:
|
|
77
|
+
onSizeInvalid: c,
|
|
75
78
|
accept: s,
|
|
76
|
-
onTypeInvalid:
|
|
77
|
-
} =
|
|
79
|
+
onTypeInvalid: f
|
|
80
|
+
} = n;
|
|
78
81
|
if (s) {
|
|
79
|
-
const
|
|
82
|
+
const i = e.filter(
|
|
80
83
|
(t) => !P(t, s)
|
|
81
84
|
);
|
|
82
|
-
if (
|
|
83
|
-
|
|
85
|
+
if (i.length > 0 && (i.forEach((t) => {
|
|
86
|
+
f && f(t, s);
|
|
84
87
|
}), e = e.filter((t) => P(t, s)), e.length === 0))
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
87
90
|
if (d) {
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
91
|
+
const i = e.filter((t) => t.size > d);
|
|
92
|
+
if (i.length > 0 && (i.forEach((t) => {
|
|
90
93
|
z && z(t, d);
|
|
91
94
|
}), e = e.filter((t) => t.size <= d), e.length === 0))
|
|
92
95
|
return;
|
|
93
96
|
}
|
|
94
97
|
if (h && y) {
|
|
95
|
-
const
|
|
98
|
+
const i = [];
|
|
96
99
|
for (const t of e)
|
|
97
|
-
if (
|
|
100
|
+
if (le(t))
|
|
98
101
|
try {
|
|
99
|
-
const { isValid: x, width:
|
|
102
|
+
const { isValid: x, width: W, height: $ } = await se(
|
|
100
103
|
t,
|
|
101
104
|
h,
|
|
102
105
|
y
|
|
103
106
|
);
|
|
104
|
-
x ?
|
|
107
|
+
x ? i.push(t) : c && c(t, W, $, h, y);
|
|
105
108
|
} catch (x) {
|
|
106
|
-
console.error("
|
|
109
|
+
console.error("Size validation failed:", x);
|
|
107
110
|
}
|
|
108
111
|
else
|
|
109
|
-
|
|
110
|
-
if (e =
|
|
112
|
+
i.push(t);
|
|
113
|
+
if (e = i, e.length === 0) return;
|
|
111
114
|
}
|
|
112
|
-
if (a &&
|
|
113
|
-
E?.(e,
|
|
115
|
+
if (a && l && l.length + e.length > a && !(a === 1 && S)) {
|
|
116
|
+
E?.(e, l);
|
|
114
117
|
return;
|
|
115
118
|
}
|
|
116
119
|
p || (e = e.slice(0, 1));
|
|
117
|
-
for (const
|
|
118
|
-
const t =
|
|
119
|
-
t.uid =
|
|
120
|
+
for (const i of e) {
|
|
121
|
+
const t = i;
|
|
122
|
+
t.uid = ie(), m?.(t), o && C(t);
|
|
120
123
|
}
|
|
121
124
|
}, C = async (e) => {
|
|
122
|
-
if (b.value.value = "", !
|
|
125
|
+
if (b.value.value = "", !n.beforeUpload)
|
|
123
126
|
return R(e);
|
|
124
127
|
let o, a = {};
|
|
125
128
|
try {
|
|
126
|
-
const p =
|
|
127
|
-
a = O(
|
|
129
|
+
const p = n.data, m = n.beforeUpload(e);
|
|
130
|
+
a = O(n.data) ? F(n.data) : n.data, o = await m, O(n.data) && ee(p, a) && (a = F(n.data));
|
|
128
131
|
} catch {
|
|
129
132
|
o = !1;
|
|
130
133
|
}
|
|
131
134
|
if (o === !1) {
|
|
132
|
-
|
|
135
|
+
n.onRemove?.(e);
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
|
-
let
|
|
136
|
-
o instanceof Blob && (o instanceof File ?
|
|
138
|
+
let l = e;
|
|
139
|
+
o instanceof Blob && (o instanceof File ? l = o : l = new File([o], e.name, {
|
|
137
140
|
type: e.type
|
|
138
|
-
})), R(Object.assign(
|
|
141
|
+
})), R(Object.assign(l, { uid: e.uid }), a);
|
|
139
142
|
}, R = (e, o) => {
|
|
140
143
|
const {
|
|
141
144
|
headers: a,
|
|
142
|
-
data:
|
|
145
|
+
data: l,
|
|
143
146
|
method: p,
|
|
144
147
|
withCredentials: m,
|
|
145
148
|
name: E,
|
|
@@ -148,29 +151,29 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
|
148
151
|
onSuccess: z,
|
|
149
152
|
onError: h,
|
|
150
153
|
httpRequest: y
|
|
151
|
-
} =
|
|
154
|
+
} = n, { uid: c } = e, s = {
|
|
152
155
|
headers: a || {},
|
|
153
156
|
withCredentials: m,
|
|
154
157
|
file: e,
|
|
155
|
-
data: o ?? (
|
|
158
|
+
data: o ?? (l || {}),
|
|
156
159
|
method: p,
|
|
157
160
|
filename: E,
|
|
158
161
|
action: S,
|
|
159
|
-
onProgress: (
|
|
160
|
-
d?.(
|
|
162
|
+
onProgress: (i) => {
|
|
163
|
+
d?.(i, e);
|
|
161
164
|
},
|
|
162
|
-
onSuccess: (
|
|
163
|
-
z?.(
|
|
165
|
+
onSuccess: (i) => {
|
|
166
|
+
z?.(i, e), delete u.value[c];
|
|
164
167
|
},
|
|
165
|
-
onError: (
|
|
166
|
-
h?.(
|
|
168
|
+
onError: (i) => {
|
|
169
|
+
h?.(i, e), delete u.value[c];
|
|
167
170
|
}
|
|
168
|
-
},
|
|
169
|
-
u.value[
|
|
171
|
+
}, f = y(s);
|
|
172
|
+
u.value[c] = f, f instanceof Promise && f.then(s.onSuccess, s.onError);
|
|
170
173
|
}, j = async (e) => {
|
|
171
174
|
const o = e.target.files;
|
|
172
|
-
o && (await B(Array.from(o)),
|
|
173
|
-
V?.validate("change").catch((a) =>
|
|
175
|
+
o && (await B(Array.from(o)), Y(() => {
|
|
176
|
+
V?.validate("change").catch((a) => _(a));
|
|
174
177
|
}));
|
|
175
178
|
}, U = () => {
|
|
176
179
|
k.value || (b.value.value = "", b.value.click());
|
|
@@ -179,44 +182,44 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
|
179
182
|
};
|
|
180
183
|
return K({
|
|
181
184
|
abort: (e) => {
|
|
182
|
-
|
|
185
|
+
Z(u.value).filter(
|
|
183
186
|
e ? ([a]) => String(e.uid) === a : () => !0
|
|
184
|
-
).forEach(([a,
|
|
185
|
-
|
|
187
|
+
).forEach(([a, l]) => {
|
|
188
|
+
l instanceof XMLHttpRequest && l.abort(), delete u.value[a];
|
|
186
189
|
});
|
|
187
190
|
},
|
|
188
191
|
upload: C
|
|
189
|
-
}), (e, o) => (q(),
|
|
190
|
-
class:
|
|
192
|
+
}), (e, o) => (q(), N("div", {
|
|
193
|
+
class: L([g(v).b(), g(v).m(r.listType), g(v).is("drag", r.drag)]),
|
|
191
194
|
tabindex: "0",
|
|
192
195
|
onClick: U,
|
|
193
|
-
onKeydown:
|
|
196
|
+
onKeydown: X(T(H, ["self"]), ["enter", "space"])
|
|
194
197
|
}, [
|
|
195
|
-
r.drag ? (q(),
|
|
198
|
+
r.drag ? (q(), G(ne, {
|
|
196
199
|
key: 0,
|
|
197
200
|
disabled: g(k),
|
|
198
201
|
onFile: o[0] || (o[0] = (a) => B(a.file))
|
|
199
202
|
}, {
|
|
200
|
-
default:
|
|
201
|
-
|
|
203
|
+
default: Q(() => [
|
|
204
|
+
w(e.$slots, "default")
|
|
202
205
|
]),
|
|
203
206
|
_: 3
|
|
204
|
-
}, 8, ["disabled"])) :
|
|
205
|
-
|
|
207
|
+
}, 8, ["disabled"])) : w(e.$slots, "default", { key: 1 }),
|
|
208
|
+
J("input", {
|
|
206
209
|
ref_key: "inputRef",
|
|
207
210
|
ref: b,
|
|
208
|
-
class:
|
|
211
|
+
class: L(g(v).e("input")),
|
|
209
212
|
name: r.name,
|
|
210
213
|
multiple: r.multiple,
|
|
211
214
|
accept: r.accept,
|
|
212
215
|
type: "file",
|
|
213
216
|
onChange: j,
|
|
214
|
-
onClick: o[1] || (o[1] =
|
|
217
|
+
onClick: o[1] || (o[1] = T(() => {
|
|
215
218
|
}, ["stop"]))
|
|
216
|
-
}, null, 42,
|
|
217
|
-
], 42,
|
|
219
|
+
}, null, 42, fe)
|
|
220
|
+
], 42, ce));
|
|
218
221
|
}
|
|
219
222
|
});
|
|
220
223
|
export {
|
|
221
|
-
|
|
224
|
+
Te as default
|
|
222
225
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as C, ref as
|
|
1
|
+
import { defineComponent as C, ref as N, createBlock as p, openBlock as n, TransitionGroup as z, unref as e, normalizeClass as t, withCtx as I, createElementBlock as m, renderSlot as h, Fragment as K, renderList as L, withKeys as P, createCommentVNode as a, createElementVNode as v, withModifiers as S, createVNode as f, toDisplayString as T, normalizeStyle as D, nextTick as E } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import { VftIcon as u } from "../icon/index.js";
|
|
4
|
-
import { VftProgress as
|
|
4
|
+
import { VftProgress as U } from "../progress/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "@vft/utils";
|
|
7
|
-
import { debugWarn as
|
|
7
|
+
import { debugWarn as G } from "../../utils/error.js";
|
|
8
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
9
9
|
import "lodash-es";
|
|
10
10
|
import { useNamespace as g } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import { useLocale as M } from "../../locale/use-locale.js";
|
|
15
|
+
import { useFormDisabled as R } from "../form/hooks/use-form-common-props.js";
|
|
16
|
+
import { useFormItem as W } from "../form/hooks/use-form-item.js";
|
|
17
|
+
const j = ["onKeydown"], q = ["src"], A = ["onClick"], H = ["onClick"], J = ["onClick"], O = C({
|
|
17
18
|
name: "VftUploadList"
|
|
18
|
-
}),
|
|
19
|
-
...
|
|
19
|
+
}), ue = /* @__PURE__ */ C({
|
|
20
|
+
...O,
|
|
20
21
|
props: {
|
|
21
22
|
files: { default: [] },
|
|
22
23
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -25,23 +26,23 @@ const R = ["onKeydown"], W = ["src"], j = ["onClick"], q = ["onClick"], A = ["on
|
|
|
25
26
|
listType: { default: "text" }
|
|
26
27
|
},
|
|
27
28
|
emits: ["remove"],
|
|
28
|
-
setup(l, { emit:
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
setup(l, { emit: w }) {
|
|
30
|
+
const $ = w, i = g("upload"), o = g("icon"), V = g("list"), { t: x } = M(), d = R(), { formItem: B } = W(), y = N(!1), b = (k) => {
|
|
31
|
+
$("remove", k), E(() => {
|
|
32
|
+
B?.validate("change").catch((c) => G(c));
|
|
32
33
|
});
|
|
33
34
|
};
|
|
34
|
-
return (k,
|
|
35
|
+
return (k, c) => (n(), p(z, {
|
|
35
36
|
tag: "ul",
|
|
36
37
|
class: t([
|
|
37
38
|
e(i).b("list"),
|
|
38
39
|
e(i).bm("list", l.listType),
|
|
39
40
|
e(i).is("disabled", e(d))
|
|
40
41
|
]),
|
|
41
|
-
name: e(
|
|
42
|
+
name: e(V).b()
|
|
42
43
|
}, {
|
|
43
|
-
default:
|
|
44
|
-
(n(!0), m(
|
|
44
|
+
default: I(() => [
|
|
45
|
+
(n(!0), m(K, null, L(l.files, (s, F) => (n(), m("li", {
|
|
45
46
|
key: s.uid || s.name,
|
|
46
47
|
class: t([
|
|
47
48
|
e(i).be("list", "item"),
|
|
@@ -49,94 +50,94 @@ const R = ["onKeydown"], W = ["src"], j = ["onClick"], q = ["onClick"], A = ["on
|
|
|
49
50
|
{ focusing: y.value }
|
|
50
51
|
]),
|
|
51
52
|
tabindex: "0",
|
|
52
|
-
onKeydown: P((r) => !e(d) &&
|
|
53
|
-
onFocus:
|
|
54
|
-
onBlur:
|
|
55
|
-
onClick:
|
|
53
|
+
onKeydown: P((r) => !e(d) && b(s), ["delete"]),
|
|
54
|
+
onFocus: c[0] || (c[0] = (r) => y.value = !0),
|
|
55
|
+
onBlur: c[1] || (c[1] = (r) => y.value = !1),
|
|
56
|
+
onClick: c[2] || (c[2] = (r) => y.value = !1)
|
|
56
57
|
}, [
|
|
57
58
|
h(k.$slots, "default", {
|
|
58
59
|
file: s,
|
|
59
|
-
index:
|
|
60
|
+
index: F
|
|
60
61
|
}, () => [
|
|
61
62
|
l.listType === "picture" || s.status !== "uploading" && l.listType === "picture-card" ? (n(), m("img", {
|
|
62
63
|
key: 0,
|
|
63
64
|
class: t(e(i).be("list", "item-thumbnail")),
|
|
64
65
|
src: s.url,
|
|
65
66
|
alt: ""
|
|
66
|
-
}, null, 10,
|
|
67
|
+
}, null, 10, q)) : a("", !0),
|
|
67
68
|
s.status === "uploading" || l.listType !== "picture-card" ? (n(), m("div", {
|
|
68
69
|
key: 1,
|
|
69
70
|
class: t(e(i).be("list", "item-info"))
|
|
70
71
|
}, [
|
|
71
|
-
|
|
72
|
+
v("a", {
|
|
72
73
|
class: t(e(i).be("list", "item-name")),
|
|
73
|
-
onClick:
|
|
74
|
+
onClick: S((r) => l.handlePreview(s), ["prevent"])
|
|
74
75
|
}, [
|
|
75
76
|
f(e(u), {
|
|
76
|
-
class: t(e(
|
|
77
|
+
class: t(e(o).m("document")),
|
|
77
78
|
icon: "icon-document"
|
|
78
79
|
}, null, 8, ["class"]),
|
|
79
|
-
|
|
80
|
+
v("span", {
|
|
80
81
|
class: t(e(i).be("list", "item-file-name"))
|
|
81
|
-
},
|
|
82
|
-
], 10,
|
|
83
|
-
s.status === "uploading" ? (n(), p(e(
|
|
82
|
+
}, T(s.name), 3)
|
|
83
|
+
], 10, A),
|
|
84
|
+
s.status === "uploading" ? (n(), p(e(U), {
|
|
84
85
|
key: 0,
|
|
85
86
|
type: l.listType === "picture-card" ? "circle" : "line",
|
|
86
87
|
"stroke-width": l.listType === "picture-card" ? 6 : 2,
|
|
87
88
|
percentage: Number(s.percentage),
|
|
88
|
-
style:
|
|
89
|
+
style: D(l.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
89
90
|
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : a("", !0)
|
|
90
91
|
], 2)) : a("", !0),
|
|
91
|
-
|
|
92
|
+
v("label", {
|
|
92
93
|
class: t(e(i).be("list", "item-status-label"))
|
|
93
94
|
}, [
|
|
94
95
|
l.listType === "text" ? (n(), p(e(u), {
|
|
95
96
|
key: 0,
|
|
96
97
|
icon: "icon-circle-check",
|
|
97
|
-
class: t([e(
|
|
98
|
+
class: t([e(o).m("upload-success"), e(o).m("circle-check")])
|
|
98
99
|
}, null, 8, ["class"])) : ["picture-card", "picture"].includes(l.listType) ? (n(), p(e(u), {
|
|
99
100
|
key: 1,
|
|
100
101
|
icon: "icon-check",
|
|
101
|
-
class: t([e(
|
|
102
|
+
class: t([e(o).m("upload-success"), e(o).m("check")])
|
|
102
103
|
}, null, 8, ["class"])) : a("", !0)
|
|
103
104
|
], 2),
|
|
104
105
|
e(d) ? a("", !0) : (n(), p(e(u), {
|
|
105
106
|
key: 2,
|
|
106
107
|
icon: "icon-close",
|
|
107
|
-
class: t(e(
|
|
108
|
-
onClick: (r) =>
|
|
108
|
+
class: t(e(o).m("close")),
|
|
109
|
+
onClick: (r) => b(s)
|
|
109
110
|
}, null, 8, ["class", "onClick"])),
|
|
110
111
|
e(d) ? a("", !0) : (n(), m("i", {
|
|
111
112
|
key: 3,
|
|
112
|
-
class: t(e(
|
|
113
|
-
}, "
|
|
113
|
+
class: t(e(o).m("close-tip"))
|
|
114
|
+
}, T(e(x)("vft.upload.deleteKeyTip")), 3)),
|
|
114
115
|
l.listType === "picture-card" ? (n(), m("span", {
|
|
115
116
|
key: 4,
|
|
116
117
|
class: t(e(i).be("list", "item-actions"))
|
|
117
118
|
}, [
|
|
118
|
-
|
|
119
|
+
v("span", {
|
|
119
120
|
class: t(e(i).be("list", "item-preview")),
|
|
120
121
|
onClick: (r) => l.handlePreview(s)
|
|
121
122
|
}, [
|
|
122
123
|
f(e(u), {
|
|
123
124
|
icon: "icon-zoom-in",
|
|
124
|
-
class: t(e(
|
|
125
|
+
class: t(e(o).m("zoom-in"))
|
|
125
126
|
}, null, 8, ["class"])
|
|
126
|
-
], 10,
|
|
127
|
+
], 10, H),
|
|
127
128
|
e(d) ? a("", !0) : (n(), m("span", {
|
|
128
129
|
key: 0,
|
|
129
130
|
class: t(e(i).be("list", "item-delete")),
|
|
130
|
-
onClick: (r) =>
|
|
131
|
+
onClick: (r) => b(s)
|
|
131
132
|
}, [
|
|
132
133
|
f(e(u), {
|
|
133
134
|
icon: "icon-delete",
|
|
134
|
-
class: t(e(
|
|
135
|
+
class: t(e(o).m("delete"))
|
|
135
136
|
}, null, 8, ["class"])
|
|
136
|
-
], 10,
|
|
137
|
+
], 10, J))
|
|
137
138
|
], 2)) : a("", !0)
|
|
138
139
|
])
|
|
139
|
-
], 42,
|
|
140
|
+
], 42, j))), 128)),
|
|
140
141
|
h(k.$slots, "append")
|
|
141
142
|
]),
|
|
142
143
|
_: 3
|
|
@@ -144,5 +145,5 @@ const R = ["onKeydown"], W = ["src"], j = ["onClick"], q = ["onClick"], A = ["on
|
|
|
144
145
|
}
|
|
145
146
|
});
|
|
146
147
|
export {
|
|
147
|
-
|
|
148
|
+
ue as default
|
|
148
149
|
};
|
|
@@ -23,7 +23,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
23
23
|
fileList: never[];
|
|
24
24
|
replaceOnLimit: boolean;
|
|
25
25
|
maxSize: undefined;
|
|
26
|
-
sizeExceedMessage:
|
|
26
|
+
sizeExceedMessage: undefined;
|
|
27
27
|
sizeWidth: undefined;
|
|
28
28
|
sizeHeight: undefined;
|
|
29
29
|
onExceed: () => void;
|
|
@@ -91,7 +91,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
91
91
|
fileList: never[];
|
|
92
92
|
replaceOnLimit: boolean;
|
|
93
93
|
maxSize: undefined;
|
|
94
|
-
sizeExceedMessage:
|
|
94
|
+
sizeExceedMessage: undefined;
|
|
95
95
|
sizeWidth: undefined;
|
|
96
96
|
sizeHeight: undefined;
|
|
97
97
|
onExceed: () => void;
|