@treeui/vue 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TAppShell.cjs.map +1 -1
- package/dist/components/TAppShell.js.map +1 -1
- package/dist/components/TAppShell.vue.d.ts +25 -0
- package/dist/components/TAppShell.vue.d.ts.map +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.js +166 -104
- package/dist/components/TAppShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TButton.cjs.map +1 -1
- package/dist/components/TButton.js.map +1 -1
- package/dist/components/TButton.vue.d.ts +8 -2
- package/dist/components/TButton.vue.d.ts.map +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.js +12 -3
- package/dist/components/TButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TChart.cjs.map +1 -1
- package/dist/components/TChart.js.map +1 -1
- package/dist/components/TChart.vue.d.ts.map +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.js +58 -58
- package/dist/components/TChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TColorSwatch.cjs +2 -0
- package/dist/components/TColorSwatch.cjs.map +1 -0
- package/dist/components/TColorSwatch.js +7 -0
- package/dist/components/TColorSwatch.js.map +1 -0
- package/dist/components/TColorSwatch.vue.d.ts +33 -0
- package/dist/components/TColorSwatch.vue.d.ts.map +1 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/TColorSwatch.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TDropdown.vue.d.ts +1 -1
- package/dist/components/TDropdown.vue.d.ts.map +1 -1
- package/dist/components/TFileUpload.cjs.map +1 -1
- package/dist/components/TFileUpload.js.map +1 -1
- package/dist/components/TFileUpload.vue.d.ts +77 -10
- package/dist/components/TFileUpload.vue.d.ts.map +1 -1
- package/dist/components/TFileUpload.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TFileUpload.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TFileUpload.vue_vue_type_script_setup_true_lang.js +393 -144
- package/dist/components/TFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TInput.cjs.map +1 -1
- package/dist/components/TInput.js.map +1 -1
- package/dist/components/TInput.vue.d.ts +4 -1
- package/dist/components/TInput.vue.d.ts.map +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TKbd.cjs +2 -0
- package/dist/components/TKbd.cjs.map +1 -0
- package/dist/components/TKbd.js +7 -0
- package/dist/components/TKbd.js.map +1 -0
- package/dist/components/TKbd.vue.d.ts +18 -0
- package/dist/components/TKbd.vue.d.ts.map +1 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.js +12 -0
- package/dist/components/TKbd.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TNavMenu.cjs.map +1 -1
- package/dist/components/TNavMenu.js.map +1 -1
- package/dist/components/TNavMenu.vue.d.ts +9 -0
- package/dist/components/TNavMenu.vue.d.ts.map +1 -1
- package/dist/components/TNavMenu.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TNavMenu.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TNavMenu.vue_vue_type_script_setup_true_lang.js +67 -55
- package/dist/components/TNavMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TPage.cjs +2 -0
- package/dist/components/TPage.cjs.map +1 -0
- package/dist/components/TPage.js +7 -0
- package/dist/components/TPage.js.map +1 -0
- package/dist/components/TPage.vue.d.ts +35 -0
- package/dist/components/TPage.vue.d.ts.map +1 -0
- package/dist/components/TPage.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TPage.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TPage.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/TPage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TPageHeader.cjs +2 -0
- package/dist/components/TPageHeader.cjs.map +1 -0
- package/dist/components/TPageHeader.js +7 -0
- package/dist/components/TPageHeader.js.map +1 -0
- package/dist/components/TPageHeader.vue.d.ts +40 -0
- package/dist/components/TPageHeader.vue.d.ts.map +1 -0
- package/dist/components/TPageHeader.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TPageHeader.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TPageHeader.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/components/TPageHeader.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TPopover.vue.d.ts +1 -1
- package/dist/components/TPopover.vue.d.ts.map +1 -1
- package/dist/components/TSelect.cjs.map +1 -1
- package/dist/components/TSelect.js.map +1 -1
- package/dist/components/TSelect.vue.d.ts +4 -1
- package/dist/components/TSelect.vue.d.ts.map +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TSidebar.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TSidebar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TSidebar.vue_vue_type_script_setup_true_lang.js +1 -4
- package/dist/components/TSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TSpacer.cjs +2 -0
- package/dist/components/TSpacer.cjs.map +1 -0
- package/dist/components/TSpacer.js +7 -0
- package/dist/components/TSpacer.js.map +1 -0
- package/dist/components/TSpacer.vue.d.ts +8 -0
- package/dist/components/TSpacer.vue.d.ts.map +1 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/TSpacer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TSplit.cjs +2 -0
- package/dist/components/TSplit.cjs.map +1 -0
- package/dist/components/TSplit.js +7 -0
- package/dist/components/TSplit.js.map +1 -0
- package/dist/components/TSplit.vue.d.ts +38 -0
- package/dist/components/TSplit.vue.d.ts.map +1 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/TSplit.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TStack.cjs.map +1 -1
- package/dist/components/TStack.js.map +1 -1
- package/dist/components/TStack.vue.d.ts +3 -0
- package/dist/components/TStack.vue.d.ts.map +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.js +6 -1
- package/dist/components/TStack.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/TStackItem.cjs +2 -0
- package/dist/components/TStackItem.cjs.map +1 -0
- package/dist/components/TStackItem.js +7 -0
- package/dist/components/TStackItem.js.map +1 -0
- package/dist/components/TStackItem.vue.d.ts +38 -0
- package/dist/components/TStackItem.vue.d.ts.map +1 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/TStackItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TText.cjs +2 -0
- package/dist/components/TText.cjs.map +1 -0
- package/dist/components/TText.js +7 -0
- package/dist/components/TText.js.map +1 -0
- package/dist/components/TText.vue.d.ts +39 -0
- package/dist/components/TText.vue.d.ts.map +1 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/TText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/TTextarea.cjs.map +1 -1
- package/dist/components/TTextarea.js.map +1 -1
- package/dist/components/TTextarea.vue.d.ts +4 -1
- package/dist/components/TTextarea.vue.d.ts.map +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/TTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/index.d.ts +12 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/useTheme.cjs +2 -0
- package/dist/composables/useTheme.cjs.map +1 -0
- package/dist/composables/useTheme.d.ts +38 -0
- package/dist/composables/useTheme.d.ts.map +1 -0
- package/dist/composables/useTheme.js +54 -0
- package/dist/composables/useTheme.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -55
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +113 -97
- package/dist/plugin.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/contracts.cjs +1 -1
- package/dist/types/contracts.cjs.map +1 -1
- package/dist/types/contracts.d.ts +8 -1
- package/dist/types/contracts.d.ts.map +1 -1
- package/dist/types/contracts.js +8 -2
- package/dist/types/contracts.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,34 +1,63 @@
|
|
|
1
1
|
import e from "./TSpinner.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import t from "./TProgress.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as ee, useAttrs as te, useSlots as ne, watch as b } from "vue";
|
|
4
|
+
import { createId as re, isActivationKey as ie } from "@treeui/utils";
|
|
4
5
|
//#region src/components/TFileUpload.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var ae = [
|
|
6
7
|
"id",
|
|
7
8
|
"accept",
|
|
8
9
|
"multiple",
|
|
9
10
|
"disabled"
|
|
10
|
-
],
|
|
11
|
+
], oe = [
|
|
11
12
|
"aria-busy",
|
|
12
13
|
"aria-controls",
|
|
13
14
|
"aria-describedby",
|
|
14
15
|
"aria-disabled",
|
|
15
16
|
"aria-invalid",
|
|
16
17
|
"tabindex"
|
|
17
|
-
],
|
|
18
|
+
], se = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "t-file-upload__icon",
|
|
20
21
|
"aria-hidden": "true"
|
|
21
|
-
},
|
|
22
|
+
}, ce = { class: "t-file-upload__content" }, le = { class: "t-file-upload__label" }, ue = { class: "t-file-upload__browse" }, de = {
|
|
23
|
+
class: "t-file-upload__status-log t-visually-hidden",
|
|
24
|
+
role: "log",
|
|
25
|
+
"aria-live": "polite"
|
|
26
|
+
}, fe = {
|
|
22
27
|
key: 1,
|
|
23
28
|
class: "t-file-upload__files"
|
|
24
|
-
},
|
|
29
|
+
}, pe = { class: "t-file-upload__files-header" }, me = ["disabled"], he = { class: "t-file-upload__list" }, ge = ["aria-busy"], _e = {
|
|
30
|
+
class: "t-file-upload__thumb",
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
}, ve = ["src"], ye = {
|
|
33
|
+
key: 1,
|
|
34
|
+
class: "t-file-upload__thumb-fallback"
|
|
35
|
+
}, be = { class: "t-file-upload__file-copy" }, xe = { class: "t-file-upload__file-name" }, Se = { class: "t-file-upload__file-meta" }, Ce = {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "t-file-upload__file-progress"
|
|
38
|
+
}, we = {
|
|
39
|
+
key: 1,
|
|
40
|
+
class: "t-file-upload__file-status"
|
|
41
|
+
}, Te = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "t-file-upload__proof",
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}, Ee = ["id"], De = [
|
|
46
|
+
"data-t-retry",
|
|
47
|
+
"disabled",
|
|
48
|
+
"aria-describedby",
|
|
49
|
+
"onFocus",
|
|
50
|
+
"onBlur",
|
|
51
|
+
"onClick"
|
|
52
|
+
], Oe = [
|
|
53
|
+
"data-t-remove",
|
|
25
54
|
"disabled",
|
|
26
55
|
"aria-label",
|
|
27
56
|
"onClick"
|
|
28
|
-
],
|
|
57
|
+
], ke = {
|
|
29
58
|
key: 2,
|
|
30
59
|
class: "t-file-upload__actions"
|
|
31
|
-
},
|
|
60
|
+
}, x = /*@__PURE__*/ u({
|
|
32
61
|
inheritAttrs: !1,
|
|
33
62
|
__name: "TFileUpload",
|
|
34
63
|
props: {
|
|
@@ -68,32 +97,71 @@ var x = [
|
|
|
68
97
|
showFileList: {
|
|
69
98
|
type: Boolean,
|
|
70
99
|
default: !0
|
|
71
|
-
}
|
|
100
|
+
},
|
|
101
|
+
uploadState: {
|
|
102
|
+
type: [Map, Function],
|
|
103
|
+
default: void 0
|
|
104
|
+
},
|
|
105
|
+
dragLabel: { default: "Release to upload" },
|
|
106
|
+
dragRejectLabel: { default: "This file type is not accepted" },
|
|
107
|
+
thumbnails: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: !0
|
|
110
|
+
},
|
|
111
|
+
maxThumbnailSize: { default: 10 * 1024 * 1024 },
|
|
112
|
+
retryLabel: { default: "Retry" },
|
|
113
|
+
resumeLabel: {
|
|
114
|
+
type: Function,
|
|
115
|
+
default: (e) => `Resume from ${e}%`
|
|
116
|
+
},
|
|
117
|
+
remainingTimeFormat: {
|
|
118
|
+
type: Function,
|
|
119
|
+
default: (e) => {
|
|
120
|
+
if (e < 5e3) return "Less than 5s left";
|
|
121
|
+
let t = Math.round(e / 1e3);
|
|
122
|
+
if (t < 60) return `About ${t}s left`;
|
|
123
|
+
let n = Math.round(t / 60);
|
|
124
|
+
return n < 60 ? `About ${n} min left` : `About ${Math.round(n / 60)}h left`;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
statusLabels: { default: () => ({}) }
|
|
72
128
|
},
|
|
73
129
|
emits: [
|
|
74
130
|
"update:modelValue",
|
|
75
131
|
"files-accepted",
|
|
76
|
-
"files-rejected"
|
|
132
|
+
"files-rejected",
|
|
133
|
+
"retry",
|
|
134
|
+
"cancel"
|
|
77
135
|
],
|
|
78
|
-
setup(
|
|
79
|
-
let
|
|
136
|
+
setup(u, { emit: x }) {
|
|
137
|
+
let Ae = {
|
|
138
|
+
pending: "Waiting",
|
|
139
|
+
uploading: "Uploading",
|
|
140
|
+
paused: "Paused",
|
|
141
|
+
error: "Upload failed",
|
|
142
|
+
success: "Uploaded"
|
|
143
|
+
}, je = ne(), S = u, C = x, w = te(), T = g(null), E = g(null), D = g(!1), O = g(!1), k = g(!1), A = g(0), j = g([]), M = g([]), N = 0, P = g(null), F = g(/* @__PURE__ */ new Map()), I = re("t-file-upload"), L = `${I}-description`, R = `${I}-feedback`, z = `${I}-files`, B = r(() => S.disabled), V = r(() => S.modelValue.length > 0), Me = r(() => !!je.default), Ne = r(() => ({
|
|
144
|
+
...Ae,
|
|
145
|
+
...S.statusLabels
|
|
146
|
+
})), H = r(() => S.multiple ? typeof S.maxFiles == "number" ? Math.max(S.maxFiles, 0) : Infinity : 1), Pe = r(() => [
|
|
80
147
|
"t-file-upload",
|
|
81
|
-
`t-file-upload--${
|
|
148
|
+
`t-file-upload--${S.size}`,
|
|
82
149
|
{
|
|
83
|
-
"is-disabled":
|
|
84
|
-
"is-invalid":
|
|
85
|
-
"is-loading":
|
|
86
|
-
"is-drag-active":
|
|
87
|
-
"
|
|
150
|
+
"is-disabled": B.value,
|
|
151
|
+
"is-invalid": S.invalid,
|
|
152
|
+
"is-loading": S.loading,
|
|
153
|
+
"is-drag-active": D.value,
|
|
154
|
+
"is-drag-reject": O.value,
|
|
155
|
+
"has-files": V.value
|
|
88
156
|
},
|
|
89
|
-
|
|
90
|
-
]),
|
|
91
|
-
let { class: e, style: t, ...n } =
|
|
157
|
+
w.class
|
|
158
|
+
]), Fe = r(() => w.style), Ie = r(() => {
|
|
159
|
+
let { class: e, style: t, ...n } = w;
|
|
92
160
|
return n;
|
|
93
|
-
}),
|
|
161
|
+
}), Le = r(() => {
|
|
94
162
|
let e = [];
|
|
95
|
-
return
|
|
96
|
-
}),
|
|
163
|
+
return S.description && !Me.value && e.push(L), j.value.length > 0 && e.push(R), S.showFileList && V.value && e.push(z), e.length > 0 ? e.join(" ") : void 0;
|
|
164
|
+
}), Re = r(() => `${S.filesLabel} (${S.modelValue.length})`), ze = r(() => O.value ? S.dragRejectLabel : D.value ? S.dragLabel : S.label), U = (e) => {
|
|
97
165
|
if (e < 1024) return `${e} B`;
|
|
98
166
|
let t = [
|
|
99
167
|
"KB",
|
|
@@ -102,183 +170,364 @@ var x = [
|
|
|
102
170
|
], n = e / 1024, r = 0;
|
|
103
171
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
104
172
|
return `${n >= 10 || Number.isInteger(n) ? Math.round(n) : Number(n.toFixed(1))} ${t[r]}`;
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
173
|
+
}, Be = (e) => {
|
|
174
|
+
let t = e.name.lastIndexOf("."), n = t > 0 && t < e.name.length - 1 ? e.name.slice(t + 1).toUpperCase() : "";
|
|
175
|
+
if (n && n.length <= 5) return n;
|
|
176
|
+
let r = e.type.includes("/") ? e.type.split("/")[1] : "";
|
|
177
|
+
return r ? r.toUpperCase() : "FILE";
|
|
178
|
+
}, Ve = 0, He = /* @__PURE__ */ new WeakMap(), Ue = (e) => {
|
|
179
|
+
let t = He.get(e);
|
|
180
|
+
return t || (Ve += 1, t = `${I}-f${Ve}`, He.set(e, t)), t;
|
|
181
|
+
}, W = r(() => S.accept.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean)), We = (e) => {
|
|
182
|
+
if (W.value.length === 0) return !0;
|
|
183
|
+
let t = e.name.toLowerCase(), n = e.type.toLowerCase();
|
|
184
|
+
return W.value.some((e) => e.startsWith(".") ? t.endsWith(e) : e.endsWith("/*") ? n.startsWith(e.slice(0, -1)) : n === e);
|
|
185
|
+
}, Ge = r(() => W.value.length > 0 && W.value.every((e) => e.includes("/"))), Ke = (e) => {
|
|
186
|
+
let t = e.toLowerCase();
|
|
187
|
+
return !t || W.value.some((e) => e.endsWith("/*") ? t.startsWith(e.slice(0, -1)) : t === e);
|
|
188
|
+
}, qe = (e) => {
|
|
189
|
+
if (!Ge.value || !e) return !1;
|
|
190
|
+
let t = e.items;
|
|
191
|
+
if (!t || t.length === 0) return !1;
|
|
192
|
+
let n = Array.from(t).filter((e) => e.kind === "file");
|
|
193
|
+
return n.length !== 0 && n.every((e) => !Ke(e.type));
|
|
194
|
+
}, Je = (e, t) => {
|
|
195
|
+
let n = S.uploadState;
|
|
196
|
+
if (n) return typeof n == "function" ? n(e, t) : n.get(e);
|
|
197
|
+
}, G = r(() => S.modelValue.map(Je)), Ye = () => typeof window < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function" && typeof URL.revokeObjectURL == "function", Xe = (e) => e.type.startsWith("image/") && (S.maxThumbnailSize === null || e.size <= S.maxThumbnailSize), Ze = () => {
|
|
198
|
+
if (Ye()) for (let e of F.value.values()) URL.revokeObjectURL(e.url);
|
|
199
|
+
F.value.clear();
|
|
200
|
+
}, K = () => {
|
|
201
|
+
if (!S.thumbnails || !Ye()) {
|
|
202
|
+
Ze();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
let e = new Set(S.modelValue);
|
|
206
|
+
for (let [t, n] of [...F.value]) e.has(t) || (URL.revokeObjectURL(n.url), F.value.delete(t));
|
|
207
|
+
for (let e of S.modelValue) {
|
|
208
|
+
if (F.value.has(e) || !Xe(e)) continue;
|
|
209
|
+
let t = URL.createObjectURL(e);
|
|
210
|
+
F.value.set(e, {
|
|
211
|
+
url: t,
|
|
212
|
+
width: null,
|
|
213
|
+
height: null
|
|
214
|
+
});
|
|
215
|
+
let n = new Image();
|
|
216
|
+
n.onload = () => {
|
|
217
|
+
let r = F.value.get(e);
|
|
218
|
+
!r || r.url !== t || F.value.set(e, {
|
|
219
|
+
url: t,
|
|
220
|
+
width: n.naturalWidth,
|
|
221
|
+
height: n.naturalHeight
|
|
222
|
+
});
|
|
223
|
+
}, n.src = t;
|
|
224
|
+
}
|
|
225
|
+
}, q = (e, t) => {
|
|
110
226
|
switch (t) {
|
|
111
227
|
case "file-invalid-type": return `${e.name} is not an accepted file type.`;
|
|
112
|
-
case "file-too-large": return `${e.name} exceeds the ${
|
|
113
|
-
case "too-many-files": return `You can only add up to ${
|
|
228
|
+
case "file-too-large": return `${e.name} exceeds the ${U(S.maxFileSize ?? 0)} limit.`;
|
|
229
|
+
case "too-many-files": return `You can only add up to ${H.value} file${H.value === 1 ? "" : "s"}.`;
|
|
114
230
|
default: return `${e.name} could not be added.`;
|
|
115
231
|
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
if (
|
|
124
|
-
let t =
|
|
232
|
+
}, Qe = () => {
|
|
233
|
+
E.value && (E.value.value = "");
|
|
234
|
+
}, J = () => {
|
|
235
|
+
B.value || E.value?.click();
|
|
236
|
+
}, $e = (e, t, n) => {
|
|
237
|
+
j.value = n.map((e) => e.message), n.length > 0 && C("files-rejected", n), t.length > 0 && (C("update:modelValue", e), C("files-accepted", t));
|
|
238
|
+
}, Y = (e) => {
|
|
239
|
+
if (B.value || e.length === 0) return;
|
|
240
|
+
let t = S.multiple ? [...S.modelValue] : [], n = [], r = [], i = Number.isFinite(H.value) ? Math.max(H.value - t.length, 0) : Infinity;
|
|
125
241
|
for (let a of e) {
|
|
126
242
|
if (i <= 0) {
|
|
127
243
|
r.push({
|
|
128
244
|
file: a,
|
|
129
245
|
reason: "too-many-files",
|
|
130
|
-
message:
|
|
246
|
+
message: q(a, "too-many-files")
|
|
131
247
|
});
|
|
132
248
|
continue;
|
|
133
249
|
}
|
|
134
|
-
if (!
|
|
250
|
+
if (!We(a)) {
|
|
135
251
|
r.push({
|
|
136
252
|
file: a,
|
|
137
253
|
reason: "file-invalid-type",
|
|
138
|
-
message:
|
|
254
|
+
message: q(a, "file-invalid-type")
|
|
139
255
|
});
|
|
140
256
|
continue;
|
|
141
257
|
}
|
|
142
|
-
if (typeof
|
|
258
|
+
if (typeof S.maxFileSize == "number" && S.maxFileSize > 0 && a.size > S.maxFileSize) {
|
|
143
259
|
r.push({
|
|
144
260
|
file: a,
|
|
145
261
|
reason: "file-too-large",
|
|
146
|
-
message:
|
|
262
|
+
message: q(a, "file-too-large")
|
|
147
263
|
});
|
|
148
264
|
continue;
|
|
149
265
|
}
|
|
150
266
|
n.push(a), t.push(a), Number.isFinite(i) && --i;
|
|
151
267
|
}
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
|
|
268
|
+
$e(t, n, r);
|
|
269
|
+
}, et = (e, t, n) => {
|
|
270
|
+
let r = G.value[t];
|
|
271
|
+
!r || r.status !== "uploading" && r.status !== "paused" || C("cancel", {
|
|
272
|
+
file: e,
|
|
273
|
+
index: t,
|
|
274
|
+
fileKey: Ue(e),
|
|
275
|
+
state: r,
|
|
276
|
+
reason: n
|
|
277
|
+
});
|
|
278
|
+
}, tt = (e) => {
|
|
279
|
+
if (B.value) return;
|
|
280
|
+
let t = S.modelValue[e];
|
|
281
|
+
t && et(t, e, "remove"), j.value = [], C("update:modelValue", S.modelValue.filter((t, n) => n !== e));
|
|
155
282
|
}, X = () => {
|
|
156
|
-
|
|
157
|
-
|
|
283
|
+
B.value || !V.value || (S.modelValue.forEach((e, t) => {
|
|
284
|
+
et(e, t, "clear");
|
|
285
|
+
}), j.value = [], C("update:modelValue", []));
|
|
286
|
+
}, nt = r(() => S.modelValue.map((e, t) => {
|
|
287
|
+
let n = G.value[t], r = n?.status, i = F.value.get(e), a = Ue(e), o = n?.progress, s = typeof o == "number" ? Math.round(o) : void 0, c = n?.resumable === !0, l = !!(n && (r === "error" || r === "paused") && n.retryable !== !1), u = c ? "resume" : "restart", d = U(e.size), f = Be(e), p = i && i.width !== null && i.height !== null ? `${i.width} × ${i.height}` : void 0, m = r === "uploading" && s !== void 0 ? `${s}%` : void 0, h;
|
|
288
|
+
r === "uploading" && (n?.remainingLabel ? h = n.remainingLabel : typeof n?.remainingMs == "number" && Number.isFinite(n.remainingMs) && n.remainingMs >= 0 && (h = S.remainingTimeFormat(n.remainingMs)));
|
|
289
|
+
let g = (r === "error" || r === "paused") && typeof n?.uploadedBytes == "number" ? `${U(n.uploadedBytes)} of ${d} uploaded` : void 0, _ = r ? Ne.value[r] : void 0, v;
|
|
290
|
+
l && (v = c && s !== void 0 ? S.resumeLabel(s) : S.retryLabel);
|
|
291
|
+
let y = r === "error" ? n?.error : void 0;
|
|
292
|
+
return {
|
|
293
|
+
slotProps: {
|
|
294
|
+
file: e,
|
|
295
|
+
index: t,
|
|
296
|
+
fileKey: a,
|
|
297
|
+
state: n,
|
|
298
|
+
thumbnailUrl: n?.thumbnailUrl ?? i?.url,
|
|
299
|
+
sizeLabel: d,
|
|
300
|
+
typeLabel: f,
|
|
301
|
+
dimensionsLabel: p,
|
|
302
|
+
progressLabel: m,
|
|
303
|
+
remainingLabel: h,
|
|
304
|
+
uploadedLabel: g,
|
|
305
|
+
statusLabel: _,
|
|
306
|
+
actionLabel: v,
|
|
307
|
+
canRetry: l,
|
|
308
|
+
retryMode: u,
|
|
309
|
+
isDragActive: D.value,
|
|
310
|
+
isDragReject: O.value,
|
|
311
|
+
removeFile: () => tt(t),
|
|
312
|
+
retryFile: () => {
|
|
313
|
+
!l || B.value || !n || C("retry", {
|
|
314
|
+
file: e,
|
|
315
|
+
index: t,
|
|
316
|
+
fileKey: a,
|
|
317
|
+
mode: u,
|
|
318
|
+
state: n
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
rowClass: r ? `is-${r}` : void 0,
|
|
323
|
+
metaText: [
|
|
324
|
+
f,
|
|
325
|
+
d,
|
|
326
|
+
p,
|
|
327
|
+
n?.meta
|
|
328
|
+
].filter(Boolean).join(" · "),
|
|
329
|
+
statusText: [
|
|
330
|
+
_,
|
|
331
|
+
m,
|
|
332
|
+
h,
|
|
333
|
+
g
|
|
334
|
+
].filter(Boolean).join(" · "),
|
|
335
|
+
errorText: y,
|
|
336
|
+
errorId: y ? `${a}-error` : void 0,
|
|
337
|
+
showProgress: !!(n && (r === "uploading" || r === "paused" || r === "error" || r === "success" && s !== void 0)),
|
|
338
|
+
progressValue: r === "uploading" ? o : o ?? 0,
|
|
339
|
+
progressAriaLabel: `${_ ?? ""} ${e.name}`.trim(),
|
|
340
|
+
isBusy: r === "uploading",
|
|
341
|
+
isSuccess: r === "success"
|
|
342
|
+
};
|
|
343
|
+
})), Z = (e) => e ? e.files.length > 0 || Array.from(e.types).includes("Files") : !1, rt = (e) => e?.items ? Array.from(e.items).map((e) => e.getAsFile?.() ?? null).filter((e) => e instanceof File) : [], it = (e) => {
|
|
158
344
|
let t = e.target;
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
!
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
},
|
|
345
|
+
Y(Array.from(t.files ?? [])), Qe();
|
|
346
|
+
}, at = (e) => {
|
|
347
|
+
!ie(e) || B.value || (e.preventDefault(), J());
|
|
348
|
+
}, ot = () => {
|
|
349
|
+
k.value = !0;
|
|
350
|
+
}, st = (e) => {
|
|
165
351
|
let t = e.relatedTarget;
|
|
166
|
-
t &&
|
|
352
|
+
t && T.value?.contains(t) || (k.value = !1);
|
|
353
|
+
}, ct = (e) => {
|
|
354
|
+
P.value = e;
|
|
355
|
+
}, lt = (e) => {
|
|
356
|
+
P.value === e && (P.value = null);
|
|
357
|
+
}, ut = (e) => {
|
|
358
|
+
if (!S.paste || B.value) return;
|
|
359
|
+
let t = rt(e.clipboardData);
|
|
360
|
+
t.length !== 0 && (e.preventDefault(), Y(t));
|
|
167
361
|
}, Q = (e) => {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
!
|
|
173
|
-
},
|
|
174
|
-
!
|
|
175
|
-
},
|
|
176
|
-
!
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
362
|
+
!k.value || e.defaultPrevented || ut(e);
|
|
363
|
+
}, dt = (e) => {
|
|
364
|
+
!S.drop || B.value || !Z(e.dataTransfer) || (e.preventDefault(), A.value += 1, D.value = !0, O.value = qe(e.dataTransfer));
|
|
365
|
+
}, ft = (e) => {
|
|
366
|
+
!S.drop || B.value || !Z(e.dataTransfer) || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"), D.value = !0, O.value = qe(e.dataTransfer));
|
|
367
|
+
}, pt = (e) => {
|
|
368
|
+
!S.drop || B.value || !Z(e.dataTransfer) || (e.preventDefault(), A.value = Math.max(A.value - 1, 0), A.value === 0 && (D.value = !1, O.value = !1));
|
|
369
|
+
}, mt = (e) => {
|
|
370
|
+
!S.drop || B.value || !Z(e.dataTransfer) || (e.preventDefault(), A.value = 0, D.value = !1, O.value = !1, Y(Array.from(e.dataTransfer?.files ?? [])));
|
|
371
|
+
}, $ = /* @__PURE__ */ new Map();
|
|
372
|
+
return b(G, (e) => {
|
|
373
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
374
|
+
S.modelValue.forEach((r, i) => {
|
|
375
|
+
n.add(r);
|
|
376
|
+
let a = e[i]?.status;
|
|
377
|
+
if (!a) return;
|
|
378
|
+
let o = $.get(r);
|
|
379
|
+
o !== a && ($.set(r, a), o !== void 0 && (a === "success" ? t.push(`${r.name} uploaded.`) : a === "error" && t.push(`${r.name} failed. ${e[i]?.error ?? ""}`.trim())));
|
|
380
|
+
});
|
|
381
|
+
for (let e of [...$.keys()]) n.has(e) || $.delete(e);
|
|
382
|
+
t.length > 0 && (N += 1, M.value = [...M.value, {
|
|
383
|
+
id: N,
|
|
384
|
+
text: t.join(" ")
|
|
385
|
+
}].slice(-5));
|
|
386
|
+
}, {
|
|
387
|
+
flush: "post",
|
|
388
|
+
immediate: !0
|
|
389
|
+
}), b(G, () => {
|
|
390
|
+
let e = P.value, t = T.value;
|
|
391
|
+
!e || !t || document.activeElement && document.activeElement !== document.body || t.querySelector(`[data-t-retry="${e}"]`) || (P.value = null, (t.querySelector(`[data-t-remove="${e}"]`) ?? t.querySelector(".t-file-upload__dropzone"))?.focus());
|
|
392
|
+
}, { flush: "post" }), b(() => S.modelValue, K), b(() => S.thumbnails, K), m(() => {
|
|
393
|
+
document.addEventListener("paste", Q), K();
|
|
394
|
+
}), p(() => {
|
|
395
|
+
document.removeEventListener("paste", Q), Ze();
|
|
396
|
+
}), (r, p) => (h(), o("div", d({
|
|
187
397
|
ref_key: "rootRef",
|
|
188
|
-
ref:
|
|
189
|
-
},
|
|
190
|
-
class:
|
|
191
|
-
style:
|
|
192
|
-
onFocusin:
|
|
193
|
-
onFocusout:
|
|
194
|
-
onPaste:
|
|
398
|
+
ref: T
|
|
399
|
+
}, Ie.value, {
|
|
400
|
+
class: Pe.value,
|
|
401
|
+
style: Fe.value,
|
|
402
|
+
onFocusin: ot,
|
|
403
|
+
onFocusout: st,
|
|
404
|
+
onPaste: ut
|
|
195
405
|
}), [
|
|
196
|
-
|
|
197
|
-
id:
|
|
406
|
+
s("input", {
|
|
407
|
+
id: ee(I),
|
|
198
408
|
ref_key: "inputRef",
|
|
199
|
-
ref:
|
|
409
|
+
ref: E,
|
|
200
410
|
class: "t-visually-hidden",
|
|
201
411
|
type: "file",
|
|
202
|
-
accept:
|
|
203
|
-
multiple:
|
|
204
|
-
disabled:
|
|
205
|
-
onChange:
|
|
206
|
-
}, null, 40,
|
|
207
|
-
|
|
412
|
+
accept: u.accept || void 0,
|
|
413
|
+
multiple: u.multiple,
|
|
414
|
+
disabled: B.value,
|
|
415
|
+
onChange: it
|
|
416
|
+
}, null, 40, ae),
|
|
417
|
+
s("div", {
|
|
208
418
|
class: "t-file-upload__dropzone",
|
|
209
|
-
"aria-busy":
|
|
210
|
-
"aria-controls":
|
|
211
|
-
"aria-describedby":
|
|
212
|
-
"aria-disabled":
|
|
213
|
-
"aria-invalid":
|
|
419
|
+
"aria-busy": u.loading || void 0,
|
|
420
|
+
"aria-controls": u.showFileList && V.value ? z : void 0,
|
|
421
|
+
"aria-describedby": Le.value,
|
|
422
|
+
"aria-disabled": B.value || void 0,
|
|
423
|
+
"aria-invalid": u.invalid || void 0,
|
|
214
424
|
role: "button",
|
|
215
|
-
tabindex:
|
|
216
|
-
onClick:
|
|
217
|
-
onKeydown:
|
|
218
|
-
onDragenter:
|
|
219
|
-
onDragover:
|
|
220
|
-
onDragleave:
|
|
221
|
-
onDrop:
|
|
425
|
+
tabindex: B.value ? -1 : 0,
|
|
426
|
+
onClick: J,
|
|
427
|
+
onKeydown: at,
|
|
428
|
+
onDragenter: dt,
|
|
429
|
+
onDragover: ft,
|
|
430
|
+
onDragleave: pt,
|
|
431
|
+
onDrop: mt
|
|
222
432
|
}, [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
files:
|
|
226
|
-
isDragActive:
|
|
227
|
-
|
|
433
|
+
r.$slots.icon || !r.$slots.default ? (h(), o("div", se, [v(r.$slots, "icon", {}, () => [p[0] ||= s("span", { class: "t-file-upload__icon-mark" }, "+", -1)])])) : a("", !0),
|
|
434
|
+
s("div", ce, [v(r.$slots, "default", {
|
|
435
|
+
files: u.modelValue,
|
|
436
|
+
isDragActive: D.value,
|
|
437
|
+
isDragReject: O.value,
|
|
438
|
+
openFileDialog: J,
|
|
228
439
|
clearFiles: X
|
|
229
440
|
}, () => [
|
|
230
|
-
|
|
231
|
-
|
|
441
|
+
s("p", le, y(ze.value), 1),
|
|
442
|
+
u.description ? (h(), o("p", {
|
|
232
443
|
key: 0,
|
|
233
|
-
id:
|
|
444
|
+
id: L,
|
|
234
445
|
class: "t-file-upload__description"
|
|
235
|
-
},
|
|
236
|
-
|
|
446
|
+
}, y(u.description), 1)) : a("", !0),
|
|
447
|
+
s("span", ue, y(u.buttonLabel), 1)
|
|
237
448
|
])]),
|
|
238
|
-
|
|
449
|
+
u.loading ? (h(), i(e, {
|
|
239
450
|
key: 1,
|
|
240
451
|
class: "t-file-upload__spinner",
|
|
241
452
|
size: "sm",
|
|
242
453
|
label: "Uploading files"
|
|
243
|
-
})) :
|
|
244
|
-
], 40,
|
|
245
|
-
|
|
454
|
+
})) : a("", !0)
|
|
455
|
+
], 40, oe),
|
|
456
|
+
j.value.length > 0 ? (h(), o("ul", {
|
|
246
457
|
key: 0,
|
|
247
|
-
id:
|
|
458
|
+
id: R,
|
|
248
459
|
class: "t-file-upload__feedback",
|
|
249
460
|
"aria-live": "polite"
|
|
250
|
-
}, [(
|
|
251
|
-
s
|
|
252
|
-
|
|
461
|
+
}, [(h(!0), o(n, null, _(j.value, (e) => (h(), o("li", { key: e }, y(e), 1))), 128))])) : a("", !0),
|
|
462
|
+
s("div", de, [(h(!0), o(n, null, _(M.value, (e) => (h(), o("p", {
|
|
463
|
+
key: e.id,
|
|
464
|
+
class: "t-file-upload__status-log-entry"
|
|
465
|
+
}, y(e.text), 1))), 128))]),
|
|
466
|
+
u.showFileList && V.value ? (h(), o("div", fe, [s("div", pe, [s("p", {
|
|
467
|
+
id: z,
|
|
253
468
|
class: "t-file-upload__files-label"
|
|
254
|
-
},
|
|
469
|
+
}, y(Re.value), 1), s("button", {
|
|
255
470
|
class: "t-file-upload__clear",
|
|
256
471
|
type: "button",
|
|
257
|
-
disabled:
|
|
472
|
+
disabled: B.value,
|
|
258
473
|
onClick: X
|
|
259
|
-
}, " Clear all ", 8,
|
|
260
|
-
key:
|
|
261
|
-
class: "t-file-upload__file"
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
"
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
474
|
+
}, " Clear all ", 8, me)]), s("ul", he, [(h(!0), o(n, null, _(nt.value, (e) => (h(), o("li", {
|
|
475
|
+
key: e.slotProps.fileKey,
|
|
476
|
+
class: f(["t-file-upload__file", e.rowClass]),
|
|
477
|
+
"aria-busy": e.isBusy || void 0
|
|
478
|
+
}, [v(r.$slots, "file", d({ ref_for: !0 }, e.slotProps), () => [
|
|
479
|
+
s("span", _e, [e.slotProps.thumbnailUrl ? (h(), o("img", {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: "t-file-upload__thumb-image",
|
|
482
|
+
src: e.slotProps.thumbnailUrl,
|
|
483
|
+
alt: ""
|
|
484
|
+
}, null, 8, ve)) : (h(), o("span", ye, y(e.slotProps.typeLabel), 1))]),
|
|
485
|
+
s("div", be, [
|
|
486
|
+
s("p", xe, y(e.slotProps.file.name), 1),
|
|
487
|
+
s("p", Se, y(e.metaText), 1),
|
|
488
|
+
v(r.$slots, "file-status", d({ ref_for: !0 }, e.slotProps), () => [
|
|
489
|
+
e.showProgress ? (h(), o("div", Ce, [l(t, {
|
|
490
|
+
size: "sm",
|
|
491
|
+
value: e.progressValue,
|
|
492
|
+
label: e.progressAriaLabel
|
|
493
|
+
}, null, 8, ["value", "label"])])) : a("", !0),
|
|
494
|
+
e.statusText ? (h(), o("p", we, [e.isSuccess ? (h(), o("span", Te, "✓")) : a("", !0), c(y(e.statusText), 1)])) : a("", !0),
|
|
495
|
+
e.errorText ? (h(), o("p", {
|
|
496
|
+
key: 2,
|
|
497
|
+
id: e.errorId,
|
|
498
|
+
class: "t-file-upload__file-error"
|
|
499
|
+
}, y(e.errorText), 9, Ee)) : a("", !0)
|
|
500
|
+
])
|
|
501
|
+
]),
|
|
502
|
+
e.slotProps.canRetry ? (h(), o("button", {
|
|
503
|
+
key: 0,
|
|
504
|
+
class: "t-file-upload__retry",
|
|
505
|
+
type: "button",
|
|
506
|
+
"data-t-retry": e.slotProps.fileKey,
|
|
507
|
+
disabled: B.value,
|
|
508
|
+
"aria-describedby": e.errorId,
|
|
509
|
+
onFocus: (t) => ct(e.slotProps.fileKey),
|
|
510
|
+
onBlur: (t) => lt(e.slotProps.fileKey),
|
|
511
|
+
onClick: (t) => e.slotProps.retryFile()
|
|
512
|
+
}, y(e.slotProps.actionLabel), 41, De)) : a("", !0),
|
|
513
|
+
s("button", {
|
|
514
|
+
class: "t-file-upload__remove",
|
|
515
|
+
type: "button",
|
|
516
|
+
"data-t-remove": e.slotProps.fileKey,
|
|
517
|
+
disabled: B.value,
|
|
518
|
+
"aria-label": `Remove ${e.slotProps.file.name}`,
|
|
519
|
+
onClick: (t) => e.slotProps.removeFile()
|
|
520
|
+
}, " Remove ", 8, Oe)
|
|
521
|
+
])], 10, ge))), 128))])])) : a("", !0),
|
|
522
|
+
r.$slots.actions ? (h(), o("div", ke, [v(r.$slots, "actions", {
|
|
523
|
+
files: u.modelValue,
|
|
524
|
+
openFileDialog: J,
|
|
276
525
|
clearFiles: X
|
|
277
|
-
})])) :
|
|
526
|
+
})])) : a("", !0)
|
|
278
527
|
], 16));
|
|
279
528
|
}
|
|
280
529
|
});
|
|
281
530
|
//#endregion
|
|
282
|
-
export {
|
|
531
|
+
export { x as default };
|
|
283
532
|
|
|
284
533
|
//# sourceMappingURL=TFileUpload.vue_vue_type_script_setup_true_lang.js.map
|