@pantograph/vue 0.27.8 → 0.27.9
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/ActionButton/ActionButton.d.ts +2 -0
- package/dist/ActionButton/index.js +1 -1
- package/dist/ActionButton/index.umd.cjs +1 -1
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-DEtXFuT4.js +1 -0
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-D6GO-k30.js → ActionButton.vue_vue_type_script_setup_true_lang-v9gNXyn5.js} +7 -6
- package/dist/Alert/index.js +1 -1
- package/dist/Alert/index.umd.cjs +1 -1
- package/dist/{Alert.vue_vue_type_style_index_0_lang-BAOHfQJ2.js → Alert.vue_vue_type_style_index_0_lang-C8MzfVOk.js} +1 -1
- package/dist/{Alert.vue_vue_type_style_index_0_lang-Drpe229t.js → Alert.vue_vue_type_style_index_0_lang-p4dL1Gko.js} +1 -1
- package/dist/Base/BaseButton/BaseButton.d.ts +22 -50
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-DPgYIiQ0.js +1 -0
- package/dist/{BaseButton.vue_vue_type_style_index_0_lang-D8UQiapO.js → BaseButton.vue_vue_type_style_index_0_lang-j05pPl4c.js} +70 -63
- package/dist/Button/Button.d.ts +2 -0
- package/dist/Button/index.js +1 -1
- package/dist/Button/index.umd.cjs +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-Mnltc7z6.js → Button.vue_vue_type_script_setup_true_lang-BQU4_Lua.js} +2 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-Cl6tKGGP.js +1 -0
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CyER8GOv.js → ColorPicker.vue_vue_type_style_index_0_lang-RsIsAz7Q.js} +2 -2
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-M_Tlbw68.js → ColorPicker.vue_vue_type_style_index_0_lang-ZhSubRCW.js} +1 -1
- package/dist/ColorSwatch/index.js +1 -1
- package/dist/ColorSwatch/index.umd.cjs +1 -1
- package/dist/{ColorSwatch-CIE6Omwr.js → ColorSwatch-CUFAWu5f.js} +1 -1
- package/dist/{ColorSwatch-C78FvSId.js → ColorSwatch-cqNMaSvB.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-BuiXPjL9.js → ColorSwatch.vue_vue_type_style_index_0_lang-BGDS4VzJ.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-BlhGwucn.js → ColorSwatch.vue_vue_type_style_index_0_lang-ZdMYWeO7.js} +1 -1
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-BlraIbBp.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-BZzb0nJN.js} +2 -2
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-Ba9LhQWl.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-CVCppls5.js} +1 -1
- package/dist/Comment/CommentActions.d.ts +12 -8
- package/dist/Comment/CommentEditor.d.ts +24 -16
- package/dist/Comment/CommentReactions.d.ts +6 -4
- package/dist/Comment/index.js +4 -4
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/DataTable/index.js +1 -1
- package/dist/DataTable/index.umd.cjs +1 -1
- package/dist/{DataTable.vue_vue_type_style_index_0_lang-DpLNsX2Z.js → DataTable.vue_vue_type_style_index_0_lang-B2ObeeJP.js} +2 -2
- package/dist/{DataTable.vue_vue_type_style_index_0_lang-CkgL-lAr.js → DataTable.vue_vue_type_style_index_0_lang-BUZ8G07U.js} +1 -1
- package/dist/DropZone/index.js +1 -1
- package/dist/DropZone/index.umd.cjs +1 -1
- package/dist/{DropZone.vue_vue_type_style_index_0_lang-D2U8rqTy.js → DropZone.vue_vue_type_style_index_0_lang-CIEiqOyg.js} +1 -1
- package/dist/{DropZone.vue_vue_type_style_index_0_lang-ZfmWjf5_.js → DropZone.vue_vue_type_style_index_0_lang-DAdn3SV-.js} +1 -1
- package/dist/FloatButton/FloatButton.d.ts +2 -0
- package/dist/FloatButton/index.js +1 -1
- package/dist/FloatButton/index.umd.cjs +1 -1
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-C1bIx2Ad.js +1 -0
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-DH1hvvgb.js → FloatButton.vue_vue_type_script_setup_true_lang-Djn-mHpD.js} +2 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-Coc2r8FZ.js → GOPicker.vue_vue_type_style_index_0_lang-BM0Tln3s.js} +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-CsxKAG7z.js → GOPicker.vue_vue_type_style_index_0_lang-CExz9-OC.js} +3 -3
- package/dist/IconButton/IconButton.d.ts +4 -2
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.umd.cjs +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-ahPqU4HJ.js → IconButton.vue_vue_type_script_setup_true_lang-1WWZ64Us.js} +2 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-EXpTHZs6.js +1 -0
- package/dist/Pagination/index.js +1 -1
- package/dist/Pagination/index.umd.cjs +1 -1
- package/dist/{Pagination.vue_vue_type_style_index_0_lang-B0_VsOAZ.js → Pagination.vue_vue_type_style_index_0_lang-CSHShI5C.js} +1 -1
- package/dist/{Pagination.vue_vue_type_style_index_0_lang-CLsI3KAW.js → Pagination.vue_vue_type_style_index_0_lang-D94Qn7sm.js} +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/Select.vue_vue_type_style_index_0_lang-BAKkMSd9.js +1 -0
- package/dist/{Select.vue_vue_type_style_index_0_lang-Dh-a0ASP.js → Select.vue_vue_type_style_index_0_lang-BVGpB085.js} +29 -29
- package/dist/{TabContent.vue_vue_type_script_setup_true_lang-B6GAPEdf.js → TabContent.vue_vue_type_script_setup_true_lang-CRNljMkW.js} +1 -1
- package/dist/{TabContent.vue_vue_type_script_setup_true_lang-B6gNekgT.js → TabContent.vue_vue_type_script_setup_true_lang-s7YRQosV.js} +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.umd.cjs +1 -1
- package/dist/Upload/index.js +1 -1
- package/dist/Upload/index.umd.cjs +1 -1
- package/dist/{Upload.vue_vue_type_style_index_0_lang-DJqvk1PP.js → Upload.vue_vue_type_style_index_0_lang-DAL-1Um6.js} +2 -2
- package/dist/{Upload.vue_vue_type_style_index_0_lang-cN55f5aO.js → Upload.vue_vue_type_style_index_0_lang-DY_iafpY.js} +1 -1
- package/dist/exports.d.ts +5 -5
- package/dist/index.js +263 -257
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +1 -1
- package/dist/ActionButton.vue_vue_type_script_setup_true_lang-D3TR9Ar1.js +0 -1
- package/dist/BaseButton.vue_vue_type_style_index_0_lang-CJ5cQhLc.js +0 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-jL1v7uqc.js +0 -1
- package/dist/FloatButton.vue_vue_type_script_setup_true_lang-Drvb_yGk.js +0 -1
- package/dist/IconButton.vue_vue_type_script_setup_true_lang-Dk1TQJVA.js +0 -1
- package/dist/Select.vue_vue_type_style_index_0_lang-CiU2FQYW.js +0 -1
|
@@ -45,9 +45,9 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
45
45
|
default:
|
|
46
46
|
return "xsm";
|
|
47
47
|
}
|
|
48
|
-
}), A = y(() => o.getOptionValue(m.option)), u = y(() => o.getOptionLabel(m.option)), R = y(() => o.getOptionIcon(m.option)), q = y(() => o.getOptionDisabled(m.option)),
|
|
48
|
+
}), A = y(() => o.getOptionValue(m.option)), u = y(() => o.getOptionLabel(m.option)), R = y(() => o.getOptionIcon(m.option)), q = y(() => o.getOptionDisabled(m.option)), z = S(F, "option"), H = de(z, {
|
|
49
49
|
variants: {
|
|
50
|
-
size: N(me,
|
|
50
|
+
size: N(me, z)
|
|
51
51
|
}
|
|
52
52
|
}), W = (b) => {
|
|
53
53
|
var L, w;
|
|
@@ -67,7 +67,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
67
67
|
{ asChild: !0 },
|
|
68
68
|
() => a(ce, { icon: o.props.indicatorIcon, size: e.value })
|
|
69
69
|
) : b;
|
|
70
|
-
},
|
|
70
|
+
}, T = () => {
|
|
71
71
|
var L, w, E;
|
|
72
72
|
const b = (L = t.default) == null ? void 0 : L.call(t, { option: m.option }), f = [];
|
|
73
73
|
if (!p(b)) f.push(b);
|
|
@@ -78,7 +78,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
78
78
|
l ? D = J : D = a(ce, { icon: R.value, size: e.value }), f.push(
|
|
79
79
|
a(
|
|
80
80
|
"div",
|
|
81
|
-
{ class: x(S(
|
|
81
|
+
{ class: x(S(z, "leading"), o.props.itemLeadingCls) },
|
|
82
82
|
D
|
|
83
83
|
)
|
|
84
84
|
);
|
|
@@ -89,7 +89,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
89
89
|
a(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
92
|
-
class: x(S(
|
|
92
|
+
class: x(S(z, "text"), o.props.optionTextCls)
|
|
93
93
|
},
|
|
94
94
|
O
|
|
95
95
|
)
|
|
@@ -97,7 +97,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
97
97
|
}
|
|
98
98
|
return a(
|
|
99
99
|
"div",
|
|
100
|
-
{ class: x(S(
|
|
100
|
+
{ class: x(S(z, "content"), o.props.optionContentCls) },
|
|
101
101
|
f
|
|
102
102
|
);
|
|
103
103
|
};
|
|
@@ -115,7 +115,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
115
115
|
),
|
|
116
116
|
onSelect: W
|
|
117
117
|
},
|
|
118
|
-
() => [
|
|
118
|
+
() => [T(), $()]
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
}), Ct = te({
|
|
@@ -152,7 +152,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
152
152
|
default:
|
|
153
153
|
return "sm";
|
|
154
154
|
}
|
|
155
|
-
}),
|
|
155
|
+
}), z = y(() => {
|
|
156
156
|
switch (e.getSize.value) {
|
|
157
157
|
case "sm":
|
|
158
158
|
return "2xsm";
|
|
@@ -166,7 +166,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
166
166
|
}), W = (l = H.value) => {
|
|
167
167
|
if (e.props.selectedItemIconAsTrailingIcon && Z(l) && "icon" in l)
|
|
168
168
|
return l.icon;
|
|
169
|
-
}, $ = y(() => W()),
|
|
169
|
+
}, $ = y(() => W()), T = y(() => {
|
|
170
170
|
if (!e.props.noTrailing)
|
|
171
171
|
return e.props.trailingIcon;
|
|
172
172
|
}), b = y(
|
|
@@ -195,11 +195,11 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
195
195
|
e.props.triggerCls
|
|
196
196
|
),
|
|
197
197
|
...o
|
|
198
|
-
})), E = (l, O =
|
|
198
|
+
})), E = (l, O = z.value) => a(ce, { icon: l, size: O }), J = () => {
|
|
199
199
|
var _;
|
|
200
200
|
let l;
|
|
201
201
|
const O = (_ = t.triggerTrailing) == null ? void 0 : _.call(t, f.value);
|
|
202
|
-
if (p(O) ?
|
|
202
|
+
if (p(O) ? T.value && typeof T.value == "string" && (l = E(T.value)) : l = O, l)
|
|
203
203
|
return a(
|
|
204
204
|
"div",
|
|
205
205
|
{ class: x(S(u, "trailing"), e.props.triggerTrailingCls) },
|
|
@@ -210,7 +210,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
210
210
|
var D;
|
|
211
211
|
const l = (D = t.trigger) == null ? void 0 : D.call(t, f.value), _ = (() => {
|
|
212
212
|
if (p(l)) return !1;
|
|
213
|
-
const
|
|
213
|
+
const I = Xe(l) ?? null, j = I.length === 1 ? I[0] : I;
|
|
214
214
|
return j ? Ye(j) && !Ze(j) : !0;
|
|
215
215
|
})();
|
|
216
216
|
return a(
|
|
@@ -221,7 +221,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
221
221
|
var X;
|
|
222
222
|
if (!p(l))
|
|
223
223
|
return l;
|
|
224
|
-
const
|
|
224
|
+
const I = (X = t.triggerLeading) == null ? void 0 : X.call(t, f.value), j = !p(I), oe = () => {
|
|
225
225
|
var G;
|
|
226
226
|
if (!e.props.multiple && !Q(e.modelValue.value)) {
|
|
227
227
|
const M = (G = m.getOptionSlot(
|
|
@@ -230,7 +230,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
230
230
|
)) == null ? void 0 : G();
|
|
231
231
|
if (j || M || $.value || e.props.leadingIcon) {
|
|
232
232
|
let r;
|
|
233
|
-
return p(M) ? $.value ? r = E($.value) : j ? r =
|
|
233
|
+
return p(M) ? $.value ? r = E($.value) : j ? r = I : e.props.leadingIcon && (r = E(e.props.leadingIcon)) : r = M, a(
|
|
234
234
|
"div",
|
|
235
235
|
{
|
|
236
236
|
class: x(
|
|
@@ -288,7 +288,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
288
288
|
var h, d;
|
|
289
289
|
if (!p(k)) return null;
|
|
290
290
|
const i = (h = m.getOptionSlot("leading", c)) == null ? void 0 : h(), C = (d = t.tagLeading) == null ? void 0 : d.call(t, L(c)), s = W(e.getOptionByValue(c)) ?? e.props.leadingIcon;
|
|
291
|
-
return p(C) ? p(i) ? s ? E(s, n) : p(
|
|
291
|
+
return p(C) ? p(i) ? s ? E(s, n) : p(I) ? null : I : i : C;
|
|
292
292
|
}, ae = () => {
|
|
293
293
|
var i;
|
|
294
294
|
const n = (i = t.tagTrailing) == null ? void 0 : i.call(t, L(c));
|
|
@@ -348,14 +348,14 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
348
348
|
setup(m, { slots: t }) {
|
|
349
349
|
const o = mt(), e = Ke(), A = ve();
|
|
350
350
|
et({ target: A });
|
|
351
|
-
const u = ve(), R = it({ triggerRef: u, props: o.props }), { getFlipOnDir: q, getDir:
|
|
351
|
+
const u = ve(), R = it({ triggerRef: u, props: o.props }), { getFlipOnDir: q, getDir: z } = lt(), H = q("reversePlacementOnDir"), W = z(), $ = at({
|
|
352
352
|
props: o.props,
|
|
353
353
|
flip: H,
|
|
354
354
|
emitsAsProps: o.emitsAsProps,
|
|
355
355
|
_dir: W,
|
|
356
356
|
controlAutoFocus: !1,
|
|
357
357
|
extraPropNames: ["bodyLock", "position"]
|
|
358
|
-
}),
|
|
358
|
+
}), T = ({
|
|
359
359
|
key: r,
|
|
360
360
|
getterKey: V,
|
|
361
361
|
defaultValue: P,
|
|
@@ -372,14 +372,14 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
372
372
|
return B;
|
|
373
373
|
}
|
|
374
374
|
return ee(g) && !v ? g ?? c : c;
|
|
375
|
-
}, b =
|
|
375
|
+
}, b = T({
|
|
376
376
|
getterKey: "getValue",
|
|
377
377
|
key: "value"
|
|
378
|
-
}), f =
|
|
378
|
+
}), f = T({
|
|
379
379
|
getterKey: "getLabel",
|
|
380
380
|
key: "label",
|
|
381
381
|
defaultValue: b
|
|
382
|
-
}), L =
|
|
382
|
+
}), L = T({
|
|
383
383
|
getterKey: "getIcon",
|
|
384
384
|
key: "icon",
|
|
385
385
|
noReturnOption: !0
|
|
@@ -398,20 +398,20 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
398
398
|
}, E = (r) => {
|
|
399
399
|
const V = w(r);
|
|
400
400
|
return V ? f(V) ?? r : r;
|
|
401
|
-
}, J =
|
|
401
|
+
}, J = T({
|
|
402
402
|
getterKey: "getDisabled",
|
|
403
403
|
key: "disabled",
|
|
404
404
|
defaultValue: !1,
|
|
405
405
|
noReturnOption: !0
|
|
406
|
-
}), l =
|
|
406
|
+
}), l = T({
|
|
407
407
|
getterKey: "getGroupLabel",
|
|
408
408
|
key: "label",
|
|
409
409
|
noReturnOption: !0
|
|
410
|
-
}), O =
|
|
410
|
+
}), O = T({
|
|
411
411
|
getterKey: "getGroupOptions",
|
|
412
412
|
key: "options",
|
|
413
413
|
noReturnOption: !0
|
|
414
|
-
}), { getDisabled: _, getStatus: D, getSize:
|
|
414
|
+
}), { getDisabled: _, getStatus: D, getSize: I } = tt({
|
|
415
415
|
getDisabled: () => o.props.disabled,
|
|
416
416
|
getSize: () => o.props.size,
|
|
417
417
|
getStatus: () => o.props.status
|
|
@@ -428,7 +428,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
428
428
|
getLabelByValue: E,
|
|
429
429
|
getDisabled: _,
|
|
430
430
|
getStatus: D,
|
|
431
|
-
getSize:
|
|
431
|
+
getSize: I,
|
|
432
432
|
...e,
|
|
433
433
|
modelValue: e.modelValue
|
|
434
434
|
}), we(
|
|
@@ -457,7 +457,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
457
457
|
if (typeof r == "string")
|
|
458
458
|
return r;
|
|
459
459
|
}, ne = y(() => K(o.props.popupWidth)), re = y(() => K(o.props.popupHeight)), X = y(() => K(o.props.minWidth)), G = y(() => ({
|
|
460
|
-
type:
|
|
460
|
+
type: I.value === "sm" ? "simple" : "advance",
|
|
461
461
|
...be(o.props.emptyProps ?? {}, ["class"])
|
|
462
462
|
})), M = y(() => be(o.props.skeletonProps ?? {}, ["class"]));
|
|
463
463
|
return () => {
|
|
@@ -545,7 +545,7 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
545
545
|
s.push(
|
|
546
546
|
...d.map(
|
|
547
547
|
() => a(rt, {
|
|
548
|
-
size:
|
|
548
|
+
size: I.value,
|
|
549
549
|
class: x(
|
|
550
550
|
S(F, "skeleton"),
|
|
551
551
|
o.props.skeletonCls
|
|
@@ -756,13 +756,13 @@ const me = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] =
|
|
|
756
756
|
props: o,
|
|
757
757
|
emit: e,
|
|
758
758
|
emitsAsProps: A
|
|
759
|
-
}), (
|
|
759
|
+
}), (z, H) => (xe(), Ae(le(He), Ce(ye(u.value)), {
|
|
760
760
|
default: Se(() => [
|
|
761
761
|
We(le(yt), null, $e({ _: 2 }, [
|
|
762
762
|
Ee(Object.keys(R), (W) => ({
|
|
763
763
|
name: W,
|
|
764
764
|
fn: Se(($) => [
|
|
765
|
-
_e(
|
|
765
|
+
_e(z.$slots, W, Ce(ye($)))
|
|
766
766
|
])
|
|
767
767
|
}))
|
|
768
768
|
]), 1024)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),E=require("reka-ui"),u=require("@pantograph/utils-vue"),t=require("@pantograph/utils"),N=require("class-variance-authority"),L=require("./ScrollContainer.vue_vue_type_style_index_0_lang-Dti6qFXk.js"),T=require("./FloatButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const e=require("vue"),E=require("reka-ui"),u=require("@pantograph/utils-vue"),t=require("@pantograph/utils"),N=require("class-variance-authority"),L=require("./ScrollContainer.vue_vue_type_style_index_0_lang-Dti6qFXk.js"),T=require("./FloatButton.vue_vue_type_script_setup_true_lang-C1bIx2Ad.js"),w=require("./Divider.vue_vue_type_style_index_0_lang-jjCOfwfM.js"),I=require("@pantograph/sortable"),R=require("./ConfigProvider.vue_vue_type_script_setup_true_lang-Dn5qxQ1y.js"),$=require("./isNumber-DMOjxgl8.js"),A=require("./Skeleton.vue_vue_type_style_index_0_lang-W1OLEfkY.js"),O=require("./Badge.vue_vue_type_script_setup_true_lang-BP3OmkDG.js"),[S,M]=E.createContext("Tabs"),D=e.defineComponent({...u.getComponentOptions("Tabs",!1),__name:"Tabs",props:{block:{type:Boolean},draggable:{type:Boolean},size:{default:"md"},sortableProps:{},defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["change","dragStart","dragEnd","update:modelValue"],setup(_,{emit:l}){const s=_,g=l,i=u.useVModel(s,"modelValue",g,{defaultValue:s.defaultValue,passive:s.defaultValue===void 0,onChange:f=>g("change",f)}),{getDir:c}=R.useConfig(),m=c();return M({props:s,emit:g,dir:m,slotProps:e.computed(()=>({size:s.size==="lg"?"md":"sm",iconSize:s.size==="lg"?"sm":"xsm"}))}),(f,r)=>(e.openBlock(),e.createBlock(e.unref(E.TabsRoot),{asChild:"",orientation:"horizontal",modelValue:e.unref(i),"onUpdate:modelValue":r[0]||(r[0]=b=>e.isRef(i)?i.value=b:null),dir:e.unref(m)},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default")]),_:3},8,["modelValue","dir"]))}}),q=["md","lg"],a=t.getBemBlock("tabs"),v=t.getBemElement(a,"trigger"),U=e.defineComponent({...u.getComponentOptions("TabList"),__name:"TabList",props:{class:{},indicatorCls:{},containerCls:{},fixedActionsCls:{},actionsCls:{},startScrollCls:{},endScrollCls:{}},setup(_){const l=_,s=e.useSlots(),g=N.cva(a,{variants:{block:t.generateVariantClassList("block",a),size:t.generateVariantClassList(q,a)}}),i=e.ref(),c=S();let m;function f(){m&&clearInterval(m),m=null}const r=o=>{o?b():f()},b=()=>{m||(m=setInterval(()=>{var o,n,d,C;$.isNumber((d=(n=(o=i.value)==null?void 0:o.container)==null?void 0:n.viewportElement)==null?void 0:d.scrollLeft)&&((C=i.value)!=null&&C.rightVisible?f():i.value.container.viewportElement.scrollLeft+=10)},10))},y=o=>{o?V():f()},V=()=>{m||(m=setInterval(()=>{var o,n,d,C;$.isNumber((d=(n=(o=i.value)==null?void 0:o.container)==null?void 0:n.viewportElement)==null?void 0:d.scrollLeft)&&((C=i.value)!=null&&C.leftVisible?f():i.value.container.viewportElement.scrollLeft-=10)},10))},x=()=>{var n;const o=(n=s.actions)==null?void 0:n.call(s,c.slotProps.value);if(!u.isEmptyElement(o))return[e.h(w._sfc_main,{type:"vertical",class:t.getBemElement(a,"actions_divider")}),e.h("div",{class:t.normCls(t.getBemElement(a,"actions"),l.actionsCls)},o)]},h=e.ref(),B=e.ref(!1);let p;e.onMounted(async()=>{c.props.draggable&&h.value&&(p=new I(h.value,{...c.props.sortableProps??{},forceFallback:!1,fallbackOnBody:!1,filter:"[data-draggable=false]",draggable:`.${v}`,dataIdAttr:"id",onStart(o){B.value=!0,c.emit("dragStart",o,p)},onEnd(o){B.value=!1,c.emit("dragEnd",o,p)},getPlaceholder(o){const n=document.createElement("div"),d=o.item.getBoundingClientRect();return n.style.width=`${d.width??100}px`,n.style.height="100%",n.classList.add(t.getBemElement(a,u.sortPlaceholderCls)),e.render(e.h("div",{class:u.sortPlaceholderVariantsClass({size:c.slotProps.value.size})}),n),n}}))}),e.onBeforeUnmount(()=>{f(),p&&(p.destroy(),p=void 0)});const{CollectionSlot:z,itemMap:P}=u.useCollection({isProvider:!0,key:a});return(o,n)=>(e.openBlock(),e.createBlock(e.unref(z),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsList),{class:e.normalizeClass(e.unref(t.normCls)(e.unref(g)({block:e.unref(c).props.block,size:e.unref(c).props.size}),l.class)),loop:!1,asChild:!1,style:e.normalizeStyle({"--ptc-tabs-count":e.unref(P).size})},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(a),"wrapper"))},[e.createVNode(L._sfc_main,{wrapCls:e.unref(t.getBemElement)(e.unref(a),"scroll_wrap"),rootCls:e.unref(t.getBemElement)(e.unref(a),"scroll_root"),areaCls:e.unref(t.getBemElement)(e.unref(a),"scroll_area"),dir:e.unref(c).dir.value,ref_key:"scrollContainer",ref:i,overlay:!1,hasMask:!e.unref(c).props.block,hideHorizontalScrollbar:""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsIndicator),{class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"indicator"),l.indicatorCls)),hasMask:""},null,8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"container"),l.containerCls)),ref_key:"container",ref:h},[e.renderSlot(o.$slots,"default")],2)]),_:2},[e.unref(c).props.block?void 0:{name:"root",fn:e.withCtx(()=>{var d,C;return[!((d=i.value)!=null&&d.leftVisible)&&!B.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"left_scroll"),l.startScrollCls))},[e.createVNode(T._sfc_main,{type:"outline",icon:"tabler:chevron-left",size:"sm",color:"neutral",onMousedown:n[0]||(n[0]=k=>y(!0)),onMouseup:n[1]||(n[1]=k=>y(!1)),onMouseleave:n[2]||(n[2]=k=>y(!1))})],2)):e.createCommentVNode("",!0),!((C=i.value)!=null&&C.rightVisible)&&!B.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"right_scroll"),l.endScrollCls))},[e.createVNode(T._sfc_main,{type:"outline",icon:"tabler:chevron-right",size:"sm",color:"neutral",onMousedown:n[3]||(n[3]=k=>r(!0)),onMouseup:n[4]||(n[4]=k=>r(!1)),onMouseleave:n[5]||(n[5]=k=>r(!1))})],2)):e.createCommentVNode("",!0)]}),key:"0"}]),1032,["wrapCls","rootCls","areaCls","dir","hasMask"]),e.createVNode(x)],2),o.$slots.fixedActions?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"fixed_actions"),l.fixedActionsCls))},[e.renderSlot(o.$slots,"fixedActions",e.normalizeProps(e.guardReactiveProps(e.unref(c).slotProps.value)))],2)):e.createCommentVNode("",!0),e.createVNode(w._sfc_main,{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(a),"underline"))},null,8,["class"])]),_:3},8,["class","style"])]),_:3}))}}),j=e.defineComponent({...u.getComponentOptions("TabsTrigger"),__name:"TabTrigger",props:{text:{},loading:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},class:{},contentCls:{},textCls:{},trailingCls:{},actionCls:{},badgeProps:{},value:{},disabled:{type:Boolean}},setup(_){const l=_,s=e.useSlots(),g=N.cva(v,{variants:{loading:t.generateVariantClassList("loading",v)}}),i=S(),c=()=>{var b,y,V,x,h,B,p;const r=[];if(l.loading)r.push(e.h(A._sfc_main,{size:i.slotProps.value.size,class:t.getBemElement(v,"skeleton")}));else{const z=(b=s.leading)==null?void 0:b.call(s,i.slotProps.value),P=(y=s.text)==null?void 0:y.call(s,{});u.isEmptyElement(z)||r.push(z);const o=!u.isEmptyElement(P);(o||l.text)&&r.push(e.h("div",{class:t.normCls(t.getBemElement(v,"text"),l.textCls)},o?P:l.text));const n=(V=s.trailing)==null?void 0:V.call(s,i.slotProps.value);u.isEmptyElement(n)||r.push(e.h("div",{class:t.normCls(t.getBemElement(v,"trailing"),l.trailingCls)},n)),(s.badgeIcon||s.badge||(x=l.badgeProps)!=null&&x.text||(h=l.badgeProps)!=null&&h.icon)&&r.push(e.h(O._sfc_main,{...l.badgeProps??{},size:"xsm",color:((B=l.badgeProps)==null?void 0:B.color)??"primary-subtle"},{default:s.badge,icon:s.badgeIcon}));const d=(p=s.action)==null?void 0:p.call(s,i.slotProps.value);u.isEmptyElement(d)||r.push(e.h("div",{class:t.normCls(t.getBemElement(v,"action"),l.actionCls)},d))}return e.h("div",{class:t.normCls(t.getBemElement(v,"content"),l.contentCls)},r)},{CollectionItem:m}=u.useCollection({key:a}),f=e.computed(()=>l.disabled||l.draggable===!1?!1:void 0);return(r,b)=>(e.openBlock(),e.createBlock(e.unref(m),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsTrigger),{asChild:!1,as:"button",value:r.value,"data-draggable":f.value,disabled:r.loading||r.disabled,class:e.normalizeClass(e.unref(t.normCls)(e.unref(g)({loading:r.loading}),l.class))},{default:e.withCtx(()=>[e.createVNode(c)]),_:1},8,["value","data-draggable","disabled","class"])]),_:1}))}}),F=e.defineComponent({...u.getComponentOptions("TabContent"),__name:"TabContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(_){const l=_;return(s,g)=>(e.openBlock(),e.createBlock(e.unref(E.TabsContent),e.normalizeProps(e.guardReactiveProps(l)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}});exports.TabsSizes=q;exports._sfc_main=D;exports._sfc_main$1=U;exports._sfc_main$2=j;exports._sfc_main$3=F;exports.injectTabsContext=S;exports.provideTabsContext=M;exports.tabsPrefix=a;
|
|
@@ -4,7 +4,7 @@ import { getComponentOptions as A, useVModel as ue, sortPlaceholderCls as pe, so
|
|
|
4
4
|
import { getBemBlock as me, getBemElement as r, generateVariantClassList as H, normCls as p } from "@pantograph/utils";
|
|
5
5
|
import { cva as X } from "class-variance-authority";
|
|
6
6
|
import { _ as ge } from "./ScrollContainer.vue_vue_type_style_index_0_lang-CCEG6AjN.js";
|
|
7
|
-
import { _ as j } from "./FloatButton.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { _ as j } from "./FloatButton.vue_vue_type_script_setup_true_lang-Djn-mHpD.js";
|
|
8
8
|
import { _ as F } from "./Divider.vue_vue_type_style_index_0_lang-Clrzj4R0.js";
|
|
9
9
|
import ve from "@pantograph/sortable";
|
|
10
10
|
import { u as be } from "./ConfigProvider.vue_vue_type_script_setup_true_lang-C-xm8OzO.js";
|
package/dist/Tabs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as t, a as b, b as e, _ as T, T as i, i as o, p as r, t as n } from "../TabContent.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { c as t, a as b, b as e, _ as T, T as i, i as o, p as r, t as n } from "../TabContent.vue_vue_type_script_setup_true_lang-s7YRQosV.js";
|
|
2
2
|
export {
|
|
3
3
|
t as TabContent,
|
|
4
4
|
b as TabList,
|
package/dist/Tabs/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../TabContent.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../TabContent.vue_vue_type_script_setup_true_lang-CRNljMkW.js");exports.TabContent=e._sfc_main$3;exports.TabList=e._sfc_main$1;exports.TabTrigger=e._sfc_main$2;exports.Tabs=e._sfc_main;exports.TabsSizes=e.TabsSizes;exports.injectTabsContext=e.injectTabsContext;exports.provideTabsContext=e.provideTabsContext;exports.tabsPrefix=e.tabsPrefix;
|
package/dist/Upload/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as o, e as p, d as e, U as d, a as t, f as i, i as l, p as U, c as r, b as x, u as f } from "../Upload.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as o, e as p, d as e, U as d, a as t, f as i, i as l, p as U, c as r, b as x, u as f } from "../Upload.vue_vue_type_style_index_0_lang-DAL-1Um6.js";
|
|
2
2
|
export {
|
|
3
3
|
o as Upload,
|
|
4
4
|
p as UploadListTypes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Upload.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Upload.vue_vue_type_style_index_0_lang-DY_iafpY.js");exports.Upload=e._sfc_main;exports.UploadListTypes=e.UploadListTypes;exports.UploadSizes=e.UploadSizes;exports.UploadStatuses=e.UploadStatuses;exports.UploadTrigger=e._sfc_main$1;exports.UploadTypes=e.UploadTypes;exports.injectUploadContext=e.injectUploadContext;exports.provideUploadContext=e.provideUploadContext;exports.uploadListItemPrefix=e.uploadListItemPrefix;exports.uploadListPrefix=e.uploadListPrefix;exports.uploadPrefix=e.uploadPrefix;
|
|
@@ -4,8 +4,8 @@ import { getBemBlock as We, getBemElement as F, usePCId as pe, normCls as be, ge
|
|
|
4
4
|
import { i as se } from "./isObject-vmP43YLW.js";
|
|
5
5
|
import { cva as we } from "class-variance-authority";
|
|
6
6
|
import { _ as xe } from "./Progress.vue_vue_type_style_index_0_lang-DtG1mmcQ.js";
|
|
7
|
-
import { _ as He } from "./FloatButton.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { _ as G } from "./IconButton.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { _ as He } from "./FloatButton.vue_vue_type_script_setup_true_lang-Djn-mHpD.js";
|
|
8
|
+
import { _ as G } from "./IconButton.vue_vue_type_script_setup_true_lang-1WWZ64Us.js";
|
|
9
9
|
import { _ as Je } from "./Image.vue_vue_type_style_index_0_lang-CLuipQtA.js";
|
|
10
10
|
import { isFunction as K, throttle as Ke, pick as Xe, cloneDeep as _ } from "es-toolkit";
|
|
11
11
|
import { getComponentOptions as q, isEmptyElement as A, useFormInput as Ye } from "@pantograph/utils-vue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),te=require("reka-ui"),k=require("@pantograph/utils"),A=require("./isObject-BDHKUJKN.js"),ne=require("class-variance-authority"),se=require("./Progress.vue_vue_type_style_index_0_lang-B4GBo6sb.js"),be=require("./FloatButton.vue_vue_type_script_setup_true_lang-Drvb_yGk.js"),P=require("./IconButton.vue_vue_type_script_setup_true_lang-Dk1TQJVA.js"),Ce=require("./Image.vue_vue_type_style_index_0_lang-6NV8jF6n.js"),y=require("es-toolkit"),z=require("@pantograph/utils-vue"),we=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-CxrU_AN6.js"),Be=require("./FormValidation.vue_vue_type_style_index_0_lang-ByTzoA28.js"),ze=require("./isArray-Bin_5of_.js"),J=k.getBemBlock("upload"),j=k.getBemElement(J,"list"),B=k.getBemElement(j,"item"),[D,oe]=te.createContext("Upload"),re=(n,s)=>{if(n&&s){const t=Array.isArray(s)?s:s.split(","),i=(n==null?void 0:n.name)||"",o=(n==null?void 0:n.type)||"",l=o.replace(/\/.*$/,"");return t.some(u=>{const p=u.trim();if(/^\*(?<temp1>\/\*)?$/.test(u))return!0;if(p.charAt(0)==="."){const d=i.toLowerCase(),a=p.toLowerCase();let f=[a];return(a===".jpg"||a===".jpeg")&&(f=[".jpg",".jpeg"]),f.some(v=>d.endsWith(v))}return/\/\*$/.test(p)?l===p.replace(/\/.*$/,""):!!(o===p||/^\w+$/.test(p))})}return!0},Ue=(n,s,t=1024*1024)=>{const i=[];let o=0,l=0;for(;o<n.size;){const u=Math.min(o+t,n.size),p=n.slice(o,u);i.push({chunk:p,chunkSize:u-o,index:l,uid:s(),status:"waiting"}),o=u,l++}return i},ie=(n,{getUid:s,chunkFile:t,chunkSize:i})=>{if(A.isObject(n)){let o;if(n instanceof File)o=n;else try{o=new File([n],n.name??"",{type:n.type??""})}catch{o=new Blob([n],{type:n.type??""}),o.lastModified=new Date().getTime(),o.name=n.name??"",o.webkitRelativePath=""}if(A.isObject(o)&&o instanceof Blob){let l=[];return t&&(l=Ue(o,()=>(s==null?void 0:s(!0))??k.usePCId(void 0,!0),i)),{uid:n.uid??(s==null?void 0:s())??k.usePCId(void 0,!0),originFileObj:o,status:"waiting",chunks:l!=null&&l.length&&(l==null?void 0:l.length)>1?l:void 0,chunksCount:l!=null&&l.length&&(l==null?void 0:l.length)>1?l.length:void 0,name:o==null?void 0:o.name,type:o==null?void 0:o.type,size:o==null?void 0:o.size,lastModified:o==null?void 0:o.lastModified,thumbUrl:void 0}}}},Fe=(n,s)=>{if(A.isObject(n))return n instanceof Blob||n instanceof File?ie(n,s):(!n.uid&&!Object.isFrozen(n)&&(n.uid=s.getUid()),n)},ae=["error","paused","done","uploading","waiting"],K=["md","lg","xlg"],X=["image","card"],le=["outline","transparent"],W={other:{icon:"tabler:file-text",fg:"primary",bg:"primary-subtle"},text:{icon:"tabler:file-typography",fg:"primary",bg:"primary-subtle"},image:{icon:"tabler:photo",fg:"primary",bg:"primary-subtle"},video:{icon:"tabler:video",fg:"primary",bg:"primary-subtle"},zip:{icon:"tabler:file-zip",fg:"primary",bg:"primary-subtle"},pdf:{icon:"tabler:file-type-pdf",fg:"red",bg:"red-subtle"},document:{icon:"tabler:file-type-docx",fg:"primary",bg:"primary-subtle"},excel:{icon:"tabler:file-type-csv",fg:"green",bg:"green-subtle"}},Ie={image:["3fr","arw","bmp","dib","cr2","crw","dng","gif","heic","heif","ico","jfif","jpe","jpeg","jpg","jp2","nef","png","raf","raw","rw2","sr2","svg","svg","tga","tif","tiff","wdp","webp"],video:["3g2","3gp2","3gp","3gpp","asf","asx","avi","flv","m1v","m2v","mod","mp2v","mpa","mpe","mpv2","mpeg","mpegvideo","m2t","m2ts","tts","ts","mkv","mp4v","mp4","mov","m4v","mjpeg","mts","ogv","webm","wm","wmv","wmx","wvx"],text:["addin","dtsconfig","vssettings","vstemplate","xml","xrm-ms","xsd","xsl","cd","cs","csproj","iss","py","pyw","rc","rc2","rct","sln","srt","txt","user","vb","vbproj","vdp","vdproj","vspscc","vsscc","vssscc","contact","css","group","html","htm","shtml","htc","ics","iqy","odc","sct","wsc","vcf","vtt"],zip:["zip","7z","rar","tar.gz"],document:["doc","docx","odt","rtf"],excel:["xls","xlsx","csv","ods"],pdf:["pdf"]},ce=n=>{if(n){for(const[s,t]of Object.entries(Ie))if(t.includes(n.toLowerCase()))return s}return"other"},ue=(n="")=>{const s=n.split("/"),i=s[s.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},Y=n=>{var s,t,i;return(i=(t=(s=n==null?void 0:n.split)==null?void 0:s.call(n,"/"))==null?void 0:t.pop)==null?void 0:i.call(t)},Ee=n=>{var t;let s=Y((n==null?void 0:n.type)||((t=n==null?void 0:n.originFileObj)==null?void 0:t.type));if(n!=null&&n.url&&!s)try{s=ue(n==null?void 0:n.url)}catch{}return s},H=n=>ce(n)==="image",pe=n=>{if(n.type&&!n.thumbUrl)return H(Y(n.type));const s=n.thumbUrl||n.url||"",t=ue(s);return/^data:image\//.test(s)||H(t)?!0:!(/^data:/.test(s)||t)},Le=e.defineComponent({...z.getComponentOptions("UploadListItemImage"),__name:"UploadListItemImage",setup(n){const s=D(),t=Z(),i=()=>{var o,l,u;y.isFunction((o=t.props.uploadFile)==null?void 0:o.cancel)&&((u=(l=t.props.uploadFile).cancel)==null||u.call(l)),s.remove(t.props.uploadFile)};return(o,l)=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(t).props.uploadFile.status!=="waiting"?(e.openBlock(),e.createBlock(Ce._sfc_main,{key:0,src:e.unref(pe)(e.unref(t).props.uploadFile)?e.unref(t).props.uploadFile.thumbUrl??e.unref(t).props.uploadFile.url:void 0,aspectRatio:"1:1",class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"image")),sizeRange:"xsm",alt:e.unref(t).label.value,hovered:e.unref(t).props.uploadFile.status==="uploading",width:"100%"},e.createSlots({_:2},[["error","done"].includes(e.unref(t).props.uploadFile.status)?{name:"actions",fn:e.withCtx(()=>[e.unref(t).props.uploadFile.status==="done"?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,color:"neutral",type:"ghost",icon:"tabler:eye",size:"sm",onClick:l[0]||(l[0]=p=>e.unref(s).emit("preview",e.unref(t).props.uploadFile))})):e.unref(t).props.uploadFile.status==="error"?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,color:"neutral",type:"ghost",icon:"tabler:reload",size:"sm",onClick:l[1]||(l[1]=p=>e.unref(s).resetRequest(e.unref(t).props.uploadFile))})):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["src","class","alt","hovered"])):e.createCommentVNode("",!0),["uploading","waiting"].includes(e.unref(t).props.uploadFile.status)?(e.openBlock(),e.createBlock(se._sfc_main,{key:1,type:"circle",size:e.unref(s).progressSize.value,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"progress")),indeterminate:e.unref(t).props.uploadFile.status==="waiting",percent:((u=e.unref(t).props.uploadFile)==null?void 0:u.percent)??0},null,8,["size","class","indeterminate","percent"])):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{class:e.normalizeClass(e.unref(k.normCls)(e.unref(k.getBemElement)(e.unref(B),"cancel"),"pantograph-tokens pantograph-dark")),color:"neutral",icon:"tabler:x",size:"sm",onClick:i},null,8,["class"])],64)}}}),Te=e.defineComponent({...z.getComponentOptions("UploadFileGO"),__name:"UploadFileGO",setup(n){const s=Z(),t=D(),i=e.computed(()=>ce(Ee(s.props.uploadFile))),o=e.computed(()=>y.isFunction(t.props.getFileIcon)?t.props.getFileIcon(s.props.uploadFile):W[i.value].icon),l=e.computed(()=>W[i.value].fg),u=e.computed(()=>W[i.value].bg),p=()=>{var v,h,w,I;const f=(h=(v=t.slots).go)==null?void 0:h.call(v,{uploadFile:s.props.uploadFile});return z.isEmptyElement(f)?pe(s.props.uploadFile)?e.h("img",{class:k.getBemElement(B,"thumb"),alt:s.props.uploadFile.name??"",src:((w=s.props.uploadFile)==null?void 0:w.thumbUrl)??((I=s.props.uploadFile)==null?void 0:I.url)}):null:f},d=()=>{var v,h;const f=(h=(v=t.slots).goIcon)==null?void 0:h.call(v,{uploadFile:s.props.uploadFile});return z.isEmptyElement(f)?null:f},a=()=>e.h(we._sfc_main,{size:t.goSize.value,icon:o.value,fg:l.value,bg:u.value},{default:p,icon:d});return(f,v)=>(e.openBlock(),e.createBlock(a))}}),Se=e.defineComponent({...z.getComponentOptions("UploadListItemCard"),__name:"UploadListItemCard",setup(n){const s=D(),t=Z(),i=()=>{var f,v;const d=(v=(f=s.slots).description)==null?void 0:v.call(f,{uploadFile:t.props.uploadFile});let a;if(z.isEmptyElement(d)||(a=d),t.props.uploadFile.description&&(a=t.props.uploadFile.description),a)return e.h("div",{class:k.getBemElement(B,"description")},a)},o=()=>{var a,f;const d=(f=(a=s.slots).title)==null?void 0:f.call(a,{uploadFile:t.props.uploadFile});return z.isEmptyElement(d)?t.label.value:d},l=()=>{var d;if(y.isFunction(s.props.onDownload))return s.props.onDownload(t.props.uploadFile);if((d=t.props.uploadFile)!=null&&d.url&&typeof window<"u")return window.open(t.props.uploadFile.url)},u=e.computed(()=>{var d,a;return(d=t.props.uploadFile)!=null&&d.percent&&((a=t.props.uploadFile)==null?void 0:a.status)!=="waiting"?`${(t.props.uploadFile.percent??0).toFixed(0)}%`:"waiting..."}),p=(d,a)=>{var v,h,w,I;const f=(h=(v=s.slots)==null?void 0:v.actions)==null?void 0:h.call(v,{...s,uploadFile:t.props.uploadFile,downloadFile:l});return z.isEmptyElement(f)?(I=(w=a.slots)==null?void 0:w.default)==null?void 0:I.call(w,{}):f};return(d,a)=>{var f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s).props.go?(e.openBlock(),e.createBlock(Te,{key:0})):e.createCommentVNode("",!0),["error","done"].includes(e.unref(t).props.uploadFile.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"content"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"title"))},[e.createVNode(o)],2),e.unref(t).props.uploadFile.status==="error"?(e.openBlock(),e.createBlock(Be._sfc_main$2,{key:0,message:"Failed",status:"error"})):e.unref(s).props.size!=="md"?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(se._sfc_main,{key:1,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"progress")),percent:((f=e.unref(t).props.uploadFile)==null?void 0:f.percent)??0,label:e.unref(t).label.value,helperText:u.value,helperTextCls:e.unref(k.getBemElement)(e.unref(B),"percent")},{label:e.withCtx(()=>[e.createVNode(o)]),_:1},8,["class","percent","label","helperText","helperTextCls"])),e.createVNode(p,null,{default:e.withCtx(()=>{var v;return[e.unref(t).props.uploadFile.status==="done"?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:download",size:"sm",type:"ghost",color:"neutral",onClick:l})):e.createCommentVNode("",!0),e.unref(s).props.pausableChunked&&e.unref(t).props.uploadFile.status==="uploading"&&((v=e.unref(t).props.uploadFile.chunks)!=null&&v.length)&&e.unref(y.isFunction)(e.unref(t).props.uploadFile.cancel)?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:pause",size:"sm",type:"ghost",color:"neutral",onClick:e.unref(t).props.uploadFile.cancel},null,8,["onClick"])):e.unref(s).canRunUpload(e.unref(t).props.uploadFile)?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:["paused","waiting"].includes(e.unref(t).props.uploadFile.status)?"tabler:player-play":"tabler:reload",size:"sm",type:"ghost",color:"neutral",onClick:a[0]||(a[0]=h=>e.unref(s).resetRequest(e.unref(t).props.uploadFile))},null,8,["icon"])):e.createCommentVNode("",!0),e.createVNode(P._sfc_main,{icon:["done","error"].includes(e.unref(t).props.uploadFile.status)?"tabler:trash":"tabler:x",size:"sm",type:"ghost",color:"neutral",onClick:a[1]||(a[1]=h=>e.unref(s).remove(e.unref(t).props.uploadFile))},null,8,["icon"])]}),_:1})],64)}}}),[Z,Pe]=te.createContext("UploadItem"),De=e.defineComponent({...z.getComponentOptions("UploadListItem"),__name:"UploadListItem",props:{uploadFile:{}},setup(n){const s=n,t=ne.cva(B,{variants:{size:k.generateVariantClassList(K,B),listType:k.generateVariantClassList(X,B),type:k.generateVariantClassList(le,B),status:k.generateVariantClassList(ae,B)}}),i=e.computed(()=>{var u,p,d;return((u=s.uploadFile)==null?void 0:u.name)??((d=(p=s.uploadFile)==null?void 0:p.originFileObj)==null?void 0:d.name)}),o=D();Pe({props:s,label:i});const l=()=>{var p,d;const u=(d=(p=o.slots).listItem)==null?void 0:d.call(p,{...o,uploadFile:s.uploadFile});return z.isEmptyElement(u)?o.props.listType==="card"?e.h(Se):e.h(Le):u};return(u,p)=>{var d;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t)({size:e.unref(o).props.size,listType:e.unref(o).props.listType,type:e.unref(o).props.type,status:(d=u.uploadFile)==null?void 0:d.status}))},[e.createVNode(l)],2)}}}),Re=e.defineComponent({...z.getComponentOptions("UploadList"),__name:"UploadList",setup(n){const s=D(),t=ne.cva(j,{variants:{size:k.generateVariantClassList(K,j),listType:k.generateVariantClassList(X,j)}}),i=()=>{var l,u;const o=(u=(l=s.slots).list)==null?void 0:u.call(l,s);return z.isEmptyElement(o)?s.fileList.value.map(p=>e.h(De,{uploadFile:p,key:p.uid})):o};return(o,l)=>{var u;return(u=e.unref(s).fileList.value)!=null&&u.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t)({size:e.unref(s).props.size,listType:e.unref(s).props.listType}))},[e.createVNode(i)],2)):e.createCommentVNode("",!0)}}}),Ve=n=>new Promise(s=>{n.file(t=>{n.fullPath&&!t.webkitRelativePath&&Object.defineProperty(t,"webkitRelativePath",{value:n.fullPath.replace(/^\//,""),writable:!1}),s(t)})}),Oe=n=>{const s=n.createReader(),t=[];return new Promise(i=>{const o=()=>{s.readEntries(l=>{l.length===0?i(t):(t.push(...l),o())})};o()})},je=async n=>{const s=[],t=async i=>{if(i.isFile){const o=await Ve(i);s.push(o)}else if(i.isDirectory){const o=await Oe(i);await Promise.all(o.map(t))}};return await Promise.all(n.map(i=>{var l;const o=(l=i.webkitGetAsEntry)==null?void 0:l.call(i);if(o)return t(o)})),s},qe=["accept","webkitdirectory","multiple","value","disabled"],de=e.defineComponent({...z.getComponentOptions("UploadTrigger"),__name:"UploadTrigger",props:{directory:{type:Boolean},multiple:{type:Boolean},disabled:{type:Boolean,default:void 0},accept:{},class:{}},emits:["addFiles"],setup(n,{emit:s}){const t=s,i=n,{getDisabled:o}=z.useFormInput(),l=e.ref(),u=h=>{const{files:w}=h.target;t("addFiles",Array.prototype.slice.call(w)),p.value&&(p.value.value="")},p=e.ref(),d=()=>{var h;(h=p.value)==null||h.click()},a=h=>{h.key==="Enter"&&d()},f=async h=>{if(h.preventDefault(),h.type==="dragover")return;let w=[];h.dataTransfer&&(i.directory?w=await je(Array.prototype.slice.call(h.dataTransfer.items)):w=Array.prototype.slice.call(h.dataTransfer.files)),i.multiple||(w=w.slice(0,1)),t("addFiles",w.filter(I=>re(I,i.accept)))},v=e.computed(()=>o.value?{}:{onClick:d,onKeydown:a,onDrop:f,onDragover:f});return(h,w)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(k.normCls)(i.class)},v.value),[e.renderSlot(h.$slots,"default",e.normalizeProps(e.guardReactiveProps({...v.value,disabled:e.unref(o),tabindex:"0"}))),e.createElementVNode("input",{type:"file",accept:h.accept,webkitdirectory:h.directory,multiple:h.multiple,value:l.value,disabled:e.unref(o),onChange:u,ref_key:"inputRef",ref:p,style:{display:"none"}},null,40,qe)],16))}}),T=200;function Ne(n){return new Promise(s=>{if(!n.type||!H(Y(n.type))){s("");return}const t=document.createElement("canvas");t.width=T,t.height=T,t.style.cssText=`position: fixed; left: 0; top: 0; width: ${T}px; height: ${T}px; z-index: 9999; display: none;`,document.body.appendChild(t);const i=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:l,height:u}=o;let p=T,d=T,a=0,f=0;l>u?(d=u*(T/l),f=-(d-p)/2):(p=l*(T/u),a=-(p-d)/2),i.drawImage(o,a,f,p,d);const v=t.toDataURL();document.body.removeChild(t),s(v)},o.crossOrigin="anonymous",n.type.startsWith("image/svg+xml")){const l=new FileReader;l.addEventListener("load",()=>{l.result&&(o.src=l.result)}),l.readAsDataURL(n)}else o.src=window.URL.createObjectURL(n)})}const $e=e.defineComponent({...z.getComponentOptions("Upload",!1),__name:"Upload",props:{onDownload:{},parallelUpload:{type:Boolean},uploadOnSelect:{type:Boolean,default:!0},pausableChunked:{type:Boolean},noTrigger:{type:Boolean},fileList:{},size:{default:"md"},chunkSize:{},listType:{default:"card"},type:{default:"outline"},go:{type:Boolean,default:!0},maxCount:{},action:{},getFileIcon:{},triggerCls:{},directory:{type:Boolean},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},accept:{}},emits:["update:fileList","change","preview","createRequest","resetRequest","remove"],setup(n,{expose:s,emit:t}){const i=n,o=t,l=e.useSlots(),u=e.useAttrs(),p=k.getBemElement(J,"file"),d=r=>k.usePCId(r?k.getBemElement(p,"chunk"):p,!0),a=e.ref([]),f=e.computed(()=>i.listType!=="image"&&i.pausableChunked);let v=!1;e.watch(()=>i.fileList,r=>{var g,x;v=!0,a.value=(x=(g=r??[])==null?void 0:g.map)==null?void 0:x.call(g,U=>{if(U&&A.isObject(U))return Fe(U,{getUid:d,chunkFile:f.value,chunkSize:i.chunkSize})}).filter(Boolean),e.nextTick(()=>v=!1)},{immediate:!0,deep:!0}),e.watch(a,r=>{v||o("update:fileList",r??[])},{immediate:!0,deep:!0});const h=e.computed(()=>i.maxCount?Number(i.maxCount):0),w=r=>{if(r){const g=a.value.findIndex(x=>x.uid&&r.uid&&x.uid===r.uid);g===-1&&(!h.value||h.value>a.value.length)?a.value.push(r):g>-1&&a.value.splice(g,0,r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"add"})}},I=e.computed(()=>i.accept??i.listType==="image"?"image/*":void 0),Q=r=>{ze.isArray(r)&&r.filter(g=>!i.directory||re(g,I.value)).forEach(g=>{w(ie(g,{getUid:d,chunkFile:f.value,chunkSize:i.chunkSize}))})},q=e.computed(()=>{var r;return i.uploadOnSelect||i.listType==="image"?((r=a.value)==null?void 0:r.filter(g=>g.status==="waiting"&&g.originFileObj))??[]:[]}),R=e.computed(()=>{var r;return((r=a.value)==null?void 0:r.filter(g=>g.status==="uploading"&&(g==null?void 0:g.cancel)))??[]}),E=(r,g)=>{if(r&&g){const x=a.value.findIndex(U=>U.uid===r);x>-1&&(a.value[x]={...a.value[x],...g})}},N=async r=>{var g,x,U,$;if(r.uid&&a.value){const b=a.value.find(S=>S.uid===r.uid),ke=f.value&&((g=b==null?void 0:b.chunks)==null?void 0:g.length)&&(b==null?void 0:b.chunks.length)>1&&(b==null?void 0:b.status)==="uploading"&&(b==null?void 0:b.chunks.some(S=>S.status==="waiting"));if(b&&y.isFunction(i.action)&&(!R.value.length||i.parallelUpload||ke)){const S=new AbortController,_e=()=>{const _=()=>S.abort(),c=y.cloneDeep(b);if(f.value&&c.chunks&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.status==="waiting");m>-1&&(c.chunks[m]={...c.chunks[m],status:"uploading",cancel:_})}E(c.uid,{status:"uploading",cancel:_})};let C={signal:S.signal,onUploadProgress(_){},uid:r.uid};if(f.value&&b.chunks&&b.chunks.length>1&&b.chunks.some(_=>_.status==="waiting")){const _=b.chunks.find(c=>c.status==="waiting");_!=null&&_.uid&&(C={...C,...y.pick(_,["chunk","chunkSize","index"]),chunk_uid:_.uid,onUploadProgress(c){var F,V,L,ee;const m=y.cloneDeep(a.value.find(O=>O.uid===r.uid));if(m){const O=(F=m.chunks)==null?void 0:F.findIndex(G=>G.uid===_.uid);O!==void 0&&((V=m.chunks)!=null&&V[O])&&(m.chunks[O].percent=Math.round(c.loaded*100/c.total)),(L=m.chunks)!=null&&L.length&&((ee=m.chunks)==null?void 0:ee.length)>1?m.percent=Math.min(Math.max(m.chunks.reduce((G,xe)=>G+(xe.percent??0),0)/(100*m.chunks.length),0),100):m.percent=Math.round(c.loaded*100/c.total),E(m.uid,{chunks:m.chunks,percent:m.percent})}}})}else C={...C,file:b.originFileObj,onUploadProgress(_){const c=y.cloneDeep(a.value.find(m=>m.uid===r.uid));c&&E(c.uid,{percent:Math.round(_.loaded*100/_.total)})}};if(_e(),C.file||C.chunk){o("createRequest",r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"upload"});try{let _=await i.action(C);try{typeof _=="string"&&(_=JSON.parse(_))}catch{}let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){let m=!1;if(C.chunk_uid&&((x=c.chunks)!=null&&x.length)&&c.chunks.length>1){const F=c.chunks.findIndex(L=>L.uid===C.chunk_uid);c.chunks[F]&&(c.chunks[F]={...c.chunks[F],cancel:void 0,status:"done",response:_??void 0});const V=c.chunks.every(L=>L.status==="done")?"done":"uploading";V==="done"?c={...c,cancel:void 0,status:V}:c.chunks.some(L=>L.status==="waiting")&&(m=!0)}else c={...c,cancel:void 0,status:"done",response:_??void 0};E(C.uid,c),m&&await N(c)}}catch(_){if(_.name==="CanceledError"){let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){if(C.chunk_uid&&((U=c.chunks)!=null&&U.length)&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.uid===C.chunk_uid);c.chunks[m]&&(c.chunks[m]={...c.chunks[m],cancel:void 0,status:"waiting"}),c={...c,cancel:void 0,status:"paused"},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"paused"})}else c={...c,cancel:void 0,status:"error"},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"cancel"});E(C.uid,c)}}else{let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){if(C.chunk_uid&&(($=c.chunks)!=null&&$.length)&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.uid===C.chunk_uid);c.chunks[m]&&(c.chunks[m]={...c.chunks[m],cancel:void 0,status:"waiting"})}c={...c,cancel:void 0,status:"error",error:_,percent:0},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"failed"}),E(C.uid,c)}}}}}}},me=async r=>{if(r.uid&&a.value)return E(r.uid,{status:"waiting"}),o("resetRequest",r),N(r)},fe=async r=>{var g;if(r.uid&&a.value){const x=y.cloneDeep(a.value??[]),U=x.findIndex($=>$.uid===r.uid);U>-1&&x[U]&&((g=r.cancel)==null||g.call(r),x.splice(U,1),a.value=x,o("remove",r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"remove"}))}},ge=r=>!!((i.parallelUpload||!R.value.length)&&(r.status==="paused"||r.status==="error"||(!i.uploadOnSelect||i.listType==="image")&&r.status==="waiting")),he=e.computed(()=>{switch(i.size){case"xlg":return"md";default:return"sm"}}),ve=y.throttle(()=>{(i.parallelUpload&&q.value.length||!R.value.length)&&q.value.forEach(N),(a.value||[]).forEach(r=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(r.originFileObj instanceof File||r.originFileObj instanceof Blob)||r.thumbUrl!==void 0||(r.thumbUrl="",Ne(r.originFileObj).then(g=>{const x=g||"";x!==r.thumbUrl&&E(r==null?void 0:r.uid,{thumbUrl:x})}))})},1e3);e.watch(()=>[i.parallelUpload,q.value,R.value,a.value],ve,{deep:!0,flush:"post"});const ye=e.computed(()=>{switch(i.size){case"xlg":return"sm";case"lg":return"xsm";default:return"x2sm"}}),M={props:i,attrs:u,slots:l,emit:o,fileList:e.readonly(a),progressSize:ye,uploadableFiles:q,uploadingFiles:R,createRequest:N,resetRequest:me,canRunUpload:ge,remove:fe,goSize:he,addFiles:Q};return oe(M),s(M),(r,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.noTrigger?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de,{key:0,multiple:r.multiple,directory:r.directory,disabled:r.disabled,accept:I.value,onAddFiles:Q,class:e.normalizeClass(r.triggerCls)},{default:e.withCtx(x=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(x)))]),_:3},8,["multiple","directory","disabled","accept","class"])),e.renderSlot(r.$slots,"list",e.normalizeProps(e.guardReactiveProps(M)),()=>[e.createVNode(Re)])],64))}});exports.UploadListTypes=X;exports.UploadSizes=K;exports.UploadStatuses=ae;exports.UploadTypes=le;exports._sfc_main=$e;exports._sfc_main$1=de;exports.injectUploadContext=D;exports.provideUploadContext=oe;exports.uploadListItemPrefix=B;exports.uploadListPrefix=j;exports.uploadPrefix=J;
|
|
1
|
+
"use strict";const e=require("vue"),te=require("reka-ui"),k=require("@pantograph/utils"),A=require("./isObject-BDHKUJKN.js"),ne=require("class-variance-authority"),se=require("./Progress.vue_vue_type_style_index_0_lang-B4GBo6sb.js"),be=require("./FloatButton.vue_vue_type_script_setup_true_lang-C1bIx2Ad.js"),P=require("./IconButton.vue_vue_type_script_setup_true_lang-EXpTHZs6.js"),Ce=require("./Image.vue_vue_type_style_index_0_lang-6NV8jF6n.js"),y=require("es-toolkit"),z=require("@pantograph/utils-vue"),we=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-CxrU_AN6.js"),Be=require("./FormValidation.vue_vue_type_style_index_0_lang-ByTzoA28.js"),ze=require("./isArray-Bin_5of_.js"),J=k.getBemBlock("upload"),j=k.getBemElement(J,"list"),B=k.getBemElement(j,"item"),[D,oe]=te.createContext("Upload"),re=(n,s)=>{if(n&&s){const t=Array.isArray(s)?s:s.split(","),i=(n==null?void 0:n.name)||"",o=(n==null?void 0:n.type)||"",l=o.replace(/\/.*$/,"");return t.some(u=>{const p=u.trim();if(/^\*(?<temp1>\/\*)?$/.test(u))return!0;if(p.charAt(0)==="."){const d=i.toLowerCase(),a=p.toLowerCase();let f=[a];return(a===".jpg"||a===".jpeg")&&(f=[".jpg",".jpeg"]),f.some(v=>d.endsWith(v))}return/\/\*$/.test(p)?l===p.replace(/\/.*$/,""):!!(o===p||/^\w+$/.test(p))})}return!0},Ue=(n,s,t=1024*1024)=>{const i=[];let o=0,l=0;for(;o<n.size;){const u=Math.min(o+t,n.size),p=n.slice(o,u);i.push({chunk:p,chunkSize:u-o,index:l,uid:s(),status:"waiting"}),o=u,l++}return i},ie=(n,{getUid:s,chunkFile:t,chunkSize:i})=>{if(A.isObject(n)){let o;if(n instanceof File)o=n;else try{o=new File([n],n.name??"",{type:n.type??""})}catch{o=new Blob([n],{type:n.type??""}),o.lastModified=new Date().getTime(),o.name=n.name??"",o.webkitRelativePath=""}if(A.isObject(o)&&o instanceof Blob){let l=[];return t&&(l=Ue(o,()=>(s==null?void 0:s(!0))??k.usePCId(void 0,!0),i)),{uid:n.uid??(s==null?void 0:s())??k.usePCId(void 0,!0),originFileObj:o,status:"waiting",chunks:l!=null&&l.length&&(l==null?void 0:l.length)>1?l:void 0,chunksCount:l!=null&&l.length&&(l==null?void 0:l.length)>1?l.length:void 0,name:o==null?void 0:o.name,type:o==null?void 0:o.type,size:o==null?void 0:o.size,lastModified:o==null?void 0:o.lastModified,thumbUrl:void 0}}}},Fe=(n,s)=>{if(A.isObject(n))return n instanceof Blob||n instanceof File?ie(n,s):(!n.uid&&!Object.isFrozen(n)&&(n.uid=s.getUid()),n)},ae=["error","paused","done","uploading","waiting"],K=["md","lg","xlg"],X=["image","card"],le=["outline","transparent"],W={other:{icon:"tabler:file-text",fg:"primary",bg:"primary-subtle"},text:{icon:"tabler:file-typography",fg:"primary",bg:"primary-subtle"},image:{icon:"tabler:photo",fg:"primary",bg:"primary-subtle"},video:{icon:"tabler:video",fg:"primary",bg:"primary-subtle"},zip:{icon:"tabler:file-zip",fg:"primary",bg:"primary-subtle"},pdf:{icon:"tabler:file-type-pdf",fg:"red",bg:"red-subtle"},document:{icon:"tabler:file-type-docx",fg:"primary",bg:"primary-subtle"},excel:{icon:"tabler:file-type-csv",fg:"green",bg:"green-subtle"}},Ie={image:["3fr","arw","bmp","dib","cr2","crw","dng","gif","heic","heif","ico","jfif","jpe","jpeg","jpg","jp2","nef","png","raf","raw","rw2","sr2","svg","svg","tga","tif","tiff","wdp","webp"],video:["3g2","3gp2","3gp","3gpp","asf","asx","avi","flv","m1v","m2v","mod","mp2v","mpa","mpe","mpv2","mpeg","mpegvideo","m2t","m2ts","tts","ts","mkv","mp4v","mp4","mov","m4v","mjpeg","mts","ogv","webm","wm","wmv","wmx","wvx"],text:["addin","dtsconfig","vssettings","vstemplate","xml","xrm-ms","xsd","xsl","cd","cs","csproj","iss","py","pyw","rc","rc2","rct","sln","srt","txt","user","vb","vbproj","vdp","vdproj","vspscc","vsscc","vssscc","contact","css","group","html","htm","shtml","htc","ics","iqy","odc","sct","wsc","vcf","vtt"],zip:["zip","7z","rar","tar.gz"],document:["doc","docx","odt","rtf"],excel:["xls","xlsx","csv","ods"],pdf:["pdf"]},ce=n=>{if(n){for(const[s,t]of Object.entries(Ie))if(t.includes(n.toLowerCase()))return s}return"other"},ue=(n="")=>{const s=n.split("/"),i=s[s.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},Y=n=>{var s,t,i;return(i=(t=(s=n==null?void 0:n.split)==null?void 0:s.call(n,"/"))==null?void 0:t.pop)==null?void 0:i.call(t)},Ee=n=>{var t;let s=Y((n==null?void 0:n.type)||((t=n==null?void 0:n.originFileObj)==null?void 0:t.type));if(n!=null&&n.url&&!s)try{s=ue(n==null?void 0:n.url)}catch{}return s},H=n=>ce(n)==="image",pe=n=>{if(n.type&&!n.thumbUrl)return H(Y(n.type));const s=n.thumbUrl||n.url||"",t=ue(s);return/^data:image\//.test(s)||H(t)?!0:!(/^data:/.test(s)||t)},Le=e.defineComponent({...z.getComponentOptions("UploadListItemImage"),__name:"UploadListItemImage",setup(n){const s=D(),t=Z(),i=()=>{var o,l,u;y.isFunction((o=t.props.uploadFile)==null?void 0:o.cancel)&&((u=(l=t.props.uploadFile).cancel)==null||u.call(l)),s.remove(t.props.uploadFile)};return(o,l)=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(t).props.uploadFile.status!=="waiting"?(e.openBlock(),e.createBlock(Ce._sfc_main,{key:0,src:e.unref(pe)(e.unref(t).props.uploadFile)?e.unref(t).props.uploadFile.thumbUrl??e.unref(t).props.uploadFile.url:void 0,aspectRatio:"1:1",class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"image")),sizeRange:"xsm",alt:e.unref(t).label.value,hovered:e.unref(t).props.uploadFile.status==="uploading",width:"100%"},e.createSlots({_:2},[["error","done"].includes(e.unref(t).props.uploadFile.status)?{name:"actions",fn:e.withCtx(()=>[e.unref(t).props.uploadFile.status==="done"?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,color:"neutral",type:"ghost",icon:"tabler:eye",size:"sm",onClick:l[0]||(l[0]=p=>e.unref(s).emit("preview",e.unref(t).props.uploadFile))})):e.unref(t).props.uploadFile.status==="error"?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,color:"neutral",type:"ghost",icon:"tabler:reload",size:"sm",onClick:l[1]||(l[1]=p=>e.unref(s).resetRequest(e.unref(t).props.uploadFile))})):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["src","class","alt","hovered"])):e.createCommentVNode("",!0),["uploading","waiting"].includes(e.unref(t).props.uploadFile.status)?(e.openBlock(),e.createBlock(se._sfc_main,{key:1,type:"circle",size:e.unref(s).progressSize.value,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"progress")),indeterminate:e.unref(t).props.uploadFile.status==="waiting",percent:((u=e.unref(t).props.uploadFile)==null?void 0:u.percent)??0},null,8,["size","class","indeterminate","percent"])):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{class:e.normalizeClass(e.unref(k.normCls)(e.unref(k.getBemElement)(e.unref(B),"cancel"),"pantograph-tokens pantograph-dark")),color:"neutral",icon:"tabler:x",size:"sm",onClick:i},null,8,["class"])],64)}}}),Te=e.defineComponent({...z.getComponentOptions("UploadFileGO"),__name:"UploadFileGO",setup(n){const s=Z(),t=D(),i=e.computed(()=>ce(Ee(s.props.uploadFile))),o=e.computed(()=>y.isFunction(t.props.getFileIcon)?t.props.getFileIcon(s.props.uploadFile):W[i.value].icon),l=e.computed(()=>W[i.value].fg),u=e.computed(()=>W[i.value].bg),p=()=>{var v,h,w,I;const f=(h=(v=t.slots).go)==null?void 0:h.call(v,{uploadFile:s.props.uploadFile});return z.isEmptyElement(f)?pe(s.props.uploadFile)?e.h("img",{class:k.getBemElement(B,"thumb"),alt:s.props.uploadFile.name??"",src:((w=s.props.uploadFile)==null?void 0:w.thumbUrl)??((I=s.props.uploadFile)==null?void 0:I.url)}):null:f},d=()=>{var v,h;const f=(h=(v=t.slots).goIcon)==null?void 0:h.call(v,{uploadFile:s.props.uploadFile});return z.isEmptyElement(f)?null:f},a=()=>e.h(we._sfc_main,{size:t.goSize.value,icon:o.value,fg:l.value,bg:u.value},{default:p,icon:d});return(f,v)=>(e.openBlock(),e.createBlock(a))}}),Se=e.defineComponent({...z.getComponentOptions("UploadListItemCard"),__name:"UploadListItemCard",setup(n){const s=D(),t=Z(),i=()=>{var f,v;const d=(v=(f=s.slots).description)==null?void 0:v.call(f,{uploadFile:t.props.uploadFile});let a;if(z.isEmptyElement(d)||(a=d),t.props.uploadFile.description&&(a=t.props.uploadFile.description),a)return e.h("div",{class:k.getBemElement(B,"description")},a)},o=()=>{var a,f;const d=(f=(a=s.slots).title)==null?void 0:f.call(a,{uploadFile:t.props.uploadFile});return z.isEmptyElement(d)?t.label.value:d},l=()=>{var d;if(y.isFunction(s.props.onDownload))return s.props.onDownload(t.props.uploadFile);if((d=t.props.uploadFile)!=null&&d.url&&typeof window<"u")return window.open(t.props.uploadFile.url)},u=e.computed(()=>{var d,a;return(d=t.props.uploadFile)!=null&&d.percent&&((a=t.props.uploadFile)==null?void 0:a.status)!=="waiting"?`${(t.props.uploadFile.percent??0).toFixed(0)}%`:"waiting..."}),p=(d,a)=>{var v,h,w,I;const f=(h=(v=s.slots)==null?void 0:v.actions)==null?void 0:h.call(v,{...s,uploadFile:t.props.uploadFile,downloadFile:l});return z.isEmptyElement(f)?(I=(w=a.slots)==null?void 0:w.default)==null?void 0:I.call(w,{}):f};return(d,a)=>{var f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s).props.go?(e.openBlock(),e.createBlock(Te,{key:0})):e.createCommentVNode("",!0),["error","done"].includes(e.unref(t).props.uploadFile.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"content"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"title"))},[e.createVNode(o)],2),e.unref(t).props.uploadFile.status==="error"?(e.openBlock(),e.createBlock(Be._sfc_main$2,{key:0,message:"Failed",status:"error"})):e.unref(s).props.size!=="md"?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createBlock(se._sfc_main,{key:1,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(B),"progress")),percent:((f=e.unref(t).props.uploadFile)==null?void 0:f.percent)??0,label:e.unref(t).label.value,helperText:u.value,helperTextCls:e.unref(k.getBemElement)(e.unref(B),"percent")},{label:e.withCtx(()=>[e.createVNode(o)]),_:1},8,["class","percent","label","helperText","helperTextCls"])),e.createVNode(p,null,{default:e.withCtx(()=>{var v;return[e.unref(t).props.uploadFile.status==="done"?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:download",size:"sm",type:"ghost",color:"neutral",onClick:l})):e.createCommentVNode("",!0),e.unref(s).props.pausableChunked&&e.unref(t).props.uploadFile.status==="uploading"&&((v=e.unref(t).props.uploadFile.chunks)!=null&&v.length)&&e.unref(y.isFunction)(e.unref(t).props.uploadFile.cancel)?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:pause",size:"sm",type:"ghost",color:"neutral",onClick:e.unref(t).props.uploadFile.cancel},null,8,["onClick"])):e.unref(s).canRunUpload(e.unref(t).props.uploadFile)?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:["paused","waiting"].includes(e.unref(t).props.uploadFile.status)?"tabler:player-play":"tabler:reload",size:"sm",type:"ghost",color:"neutral",onClick:a[0]||(a[0]=h=>e.unref(s).resetRequest(e.unref(t).props.uploadFile))},null,8,["icon"])):e.createCommentVNode("",!0),e.createVNode(P._sfc_main,{icon:["done","error"].includes(e.unref(t).props.uploadFile.status)?"tabler:trash":"tabler:x",size:"sm",type:"ghost",color:"neutral",onClick:a[1]||(a[1]=h=>e.unref(s).remove(e.unref(t).props.uploadFile))},null,8,["icon"])]}),_:1})],64)}}}),[Z,Pe]=te.createContext("UploadItem"),De=e.defineComponent({...z.getComponentOptions("UploadListItem"),__name:"UploadListItem",props:{uploadFile:{}},setup(n){const s=n,t=ne.cva(B,{variants:{size:k.generateVariantClassList(K,B),listType:k.generateVariantClassList(X,B),type:k.generateVariantClassList(le,B),status:k.generateVariantClassList(ae,B)}}),i=e.computed(()=>{var u,p,d;return((u=s.uploadFile)==null?void 0:u.name)??((d=(p=s.uploadFile)==null?void 0:p.originFileObj)==null?void 0:d.name)}),o=D();Pe({props:s,label:i});const l=()=>{var p,d;const u=(d=(p=o.slots).listItem)==null?void 0:d.call(p,{...o,uploadFile:s.uploadFile});return z.isEmptyElement(u)?o.props.listType==="card"?e.h(Se):e.h(Le):u};return(u,p)=>{var d;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t)({size:e.unref(o).props.size,listType:e.unref(o).props.listType,type:e.unref(o).props.type,status:(d=u.uploadFile)==null?void 0:d.status}))},[e.createVNode(l)],2)}}}),Re=e.defineComponent({...z.getComponentOptions("UploadList"),__name:"UploadList",setup(n){const s=D(),t=ne.cva(j,{variants:{size:k.generateVariantClassList(K,j),listType:k.generateVariantClassList(X,j)}}),i=()=>{var l,u;const o=(u=(l=s.slots).list)==null?void 0:u.call(l,s);return z.isEmptyElement(o)?s.fileList.value.map(p=>e.h(De,{uploadFile:p,key:p.uid})):o};return(o,l)=>{var u;return(u=e.unref(s).fileList.value)!=null&&u.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t)({size:e.unref(s).props.size,listType:e.unref(s).props.listType}))},[e.createVNode(i)],2)):e.createCommentVNode("",!0)}}}),Ve=n=>new Promise(s=>{n.file(t=>{n.fullPath&&!t.webkitRelativePath&&Object.defineProperty(t,"webkitRelativePath",{value:n.fullPath.replace(/^\//,""),writable:!1}),s(t)})}),Oe=n=>{const s=n.createReader(),t=[];return new Promise(i=>{const o=()=>{s.readEntries(l=>{l.length===0?i(t):(t.push(...l),o())})};o()})},je=async n=>{const s=[],t=async i=>{if(i.isFile){const o=await Ve(i);s.push(o)}else if(i.isDirectory){const o=await Oe(i);await Promise.all(o.map(t))}};return await Promise.all(n.map(i=>{var l;const o=(l=i.webkitGetAsEntry)==null?void 0:l.call(i);if(o)return t(o)})),s},qe=["accept","webkitdirectory","multiple","value","disabled"],de=e.defineComponent({...z.getComponentOptions("UploadTrigger"),__name:"UploadTrigger",props:{directory:{type:Boolean},multiple:{type:Boolean},disabled:{type:Boolean,default:void 0},accept:{},class:{}},emits:["addFiles"],setup(n,{emit:s}){const t=s,i=n,{getDisabled:o}=z.useFormInput(),l=e.ref(),u=h=>{const{files:w}=h.target;t("addFiles",Array.prototype.slice.call(w)),p.value&&(p.value.value="")},p=e.ref(),d=()=>{var h;(h=p.value)==null||h.click()},a=h=>{h.key==="Enter"&&d()},f=async h=>{if(h.preventDefault(),h.type==="dragover")return;let w=[];h.dataTransfer&&(i.directory?w=await je(Array.prototype.slice.call(h.dataTransfer.items)):w=Array.prototype.slice.call(h.dataTransfer.files)),i.multiple||(w=w.slice(0,1)),t("addFiles",w.filter(I=>re(I,i.accept)))},v=e.computed(()=>o.value?{}:{onClick:d,onKeydown:a,onDrop:f,onDragover:f});return(h,w)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(k.normCls)(i.class)},v.value),[e.renderSlot(h.$slots,"default",e.normalizeProps(e.guardReactiveProps({...v.value,disabled:e.unref(o),tabindex:"0"}))),e.createElementVNode("input",{type:"file",accept:h.accept,webkitdirectory:h.directory,multiple:h.multiple,value:l.value,disabled:e.unref(o),onChange:u,ref_key:"inputRef",ref:p,style:{display:"none"}},null,40,qe)],16))}}),T=200;function Ne(n){return new Promise(s=>{if(!n.type||!H(Y(n.type))){s("");return}const t=document.createElement("canvas");t.width=T,t.height=T,t.style.cssText=`position: fixed; left: 0; top: 0; width: ${T}px; height: ${T}px; z-index: 9999; display: none;`,document.body.appendChild(t);const i=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:l,height:u}=o;let p=T,d=T,a=0,f=0;l>u?(d=u*(T/l),f=-(d-p)/2):(p=l*(T/u),a=-(p-d)/2),i.drawImage(o,a,f,p,d);const v=t.toDataURL();document.body.removeChild(t),s(v)},o.crossOrigin="anonymous",n.type.startsWith("image/svg+xml")){const l=new FileReader;l.addEventListener("load",()=>{l.result&&(o.src=l.result)}),l.readAsDataURL(n)}else o.src=window.URL.createObjectURL(n)})}const $e=e.defineComponent({...z.getComponentOptions("Upload",!1),__name:"Upload",props:{onDownload:{},parallelUpload:{type:Boolean},uploadOnSelect:{type:Boolean,default:!0},pausableChunked:{type:Boolean},noTrigger:{type:Boolean},fileList:{},size:{default:"md"},chunkSize:{},listType:{default:"card"},type:{default:"outline"},go:{type:Boolean,default:!0},maxCount:{},action:{},getFileIcon:{},triggerCls:{},directory:{type:Boolean},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},accept:{}},emits:["update:fileList","change","preview","createRequest","resetRequest","remove"],setup(n,{expose:s,emit:t}){const i=n,o=t,l=e.useSlots(),u=e.useAttrs(),p=k.getBemElement(J,"file"),d=r=>k.usePCId(r?k.getBemElement(p,"chunk"):p,!0),a=e.ref([]),f=e.computed(()=>i.listType!=="image"&&i.pausableChunked);let v=!1;e.watch(()=>i.fileList,r=>{var g,x;v=!0,a.value=(x=(g=r??[])==null?void 0:g.map)==null?void 0:x.call(g,U=>{if(U&&A.isObject(U))return Fe(U,{getUid:d,chunkFile:f.value,chunkSize:i.chunkSize})}).filter(Boolean),e.nextTick(()=>v=!1)},{immediate:!0,deep:!0}),e.watch(a,r=>{v||o("update:fileList",r??[])},{immediate:!0,deep:!0});const h=e.computed(()=>i.maxCount?Number(i.maxCount):0),w=r=>{if(r){const g=a.value.findIndex(x=>x.uid&&r.uid&&x.uid===r.uid);g===-1&&(!h.value||h.value>a.value.length)?a.value.push(r):g>-1&&a.value.splice(g,0,r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"add"})}},I=e.computed(()=>i.accept??i.listType==="image"?"image/*":void 0),Q=r=>{ze.isArray(r)&&r.filter(g=>!i.directory||re(g,I.value)).forEach(g=>{w(ie(g,{getUid:d,chunkFile:f.value,chunkSize:i.chunkSize}))})},q=e.computed(()=>{var r;return i.uploadOnSelect||i.listType==="image"?((r=a.value)==null?void 0:r.filter(g=>g.status==="waiting"&&g.originFileObj))??[]:[]}),R=e.computed(()=>{var r;return((r=a.value)==null?void 0:r.filter(g=>g.status==="uploading"&&(g==null?void 0:g.cancel)))??[]}),E=(r,g)=>{if(r&&g){const x=a.value.findIndex(U=>U.uid===r);x>-1&&(a.value[x]={...a.value[x],...g})}},N=async r=>{var g,x,U,$;if(r.uid&&a.value){const b=a.value.find(S=>S.uid===r.uid),ke=f.value&&((g=b==null?void 0:b.chunks)==null?void 0:g.length)&&(b==null?void 0:b.chunks.length)>1&&(b==null?void 0:b.status)==="uploading"&&(b==null?void 0:b.chunks.some(S=>S.status==="waiting"));if(b&&y.isFunction(i.action)&&(!R.value.length||i.parallelUpload||ke)){const S=new AbortController,_e=()=>{const _=()=>S.abort(),c=y.cloneDeep(b);if(f.value&&c.chunks&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.status==="waiting");m>-1&&(c.chunks[m]={...c.chunks[m],status:"uploading",cancel:_})}E(c.uid,{status:"uploading",cancel:_})};let C={signal:S.signal,onUploadProgress(_){},uid:r.uid};if(f.value&&b.chunks&&b.chunks.length>1&&b.chunks.some(_=>_.status==="waiting")){const _=b.chunks.find(c=>c.status==="waiting");_!=null&&_.uid&&(C={...C,...y.pick(_,["chunk","chunkSize","index"]),chunk_uid:_.uid,onUploadProgress(c){var F,V,L,ee;const m=y.cloneDeep(a.value.find(O=>O.uid===r.uid));if(m){const O=(F=m.chunks)==null?void 0:F.findIndex(G=>G.uid===_.uid);O!==void 0&&((V=m.chunks)!=null&&V[O])&&(m.chunks[O].percent=Math.round(c.loaded*100/c.total)),(L=m.chunks)!=null&&L.length&&((ee=m.chunks)==null?void 0:ee.length)>1?m.percent=Math.min(Math.max(m.chunks.reduce((G,xe)=>G+(xe.percent??0),0)/(100*m.chunks.length),0),100):m.percent=Math.round(c.loaded*100/c.total),E(m.uid,{chunks:m.chunks,percent:m.percent})}}})}else C={...C,file:b.originFileObj,onUploadProgress(_){const c=y.cloneDeep(a.value.find(m=>m.uid===r.uid));c&&E(c.uid,{percent:Math.round(_.loaded*100/_.total)})}};if(_e(),C.file||C.chunk){o("createRequest",r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"upload"});try{let _=await i.action(C);try{typeof _=="string"&&(_=JSON.parse(_))}catch{}let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){let m=!1;if(C.chunk_uid&&((x=c.chunks)!=null&&x.length)&&c.chunks.length>1){const F=c.chunks.findIndex(L=>L.uid===C.chunk_uid);c.chunks[F]&&(c.chunks[F]={...c.chunks[F],cancel:void 0,status:"done",response:_??void 0});const V=c.chunks.every(L=>L.status==="done")?"done":"uploading";V==="done"?c={...c,cancel:void 0,status:V}:c.chunks.some(L=>L.status==="waiting")&&(m=!0)}else c={...c,cancel:void 0,status:"done",response:_??void 0};E(C.uid,c),m&&await N(c)}}catch(_){if(_.name==="CanceledError"){let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){if(C.chunk_uid&&((U=c.chunks)!=null&&U.length)&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.uid===C.chunk_uid);c.chunks[m]&&(c.chunks[m]={...c.chunks[m],cancel:void 0,status:"waiting"}),c={...c,cancel:void 0,status:"paused"},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"paused"})}else c={...c,cancel:void 0,status:"error"},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"cancel"});E(C.uid,c)}}else{let c=y.cloneDeep(a.value.find(m=>m.uid===C.uid));if(c){if(C.chunk_uid&&(($=c.chunks)!=null&&$.length)&&c.chunks.length>1){const m=c.chunks.findIndex(F=>F.uid===C.chunk_uid);c.chunks[m]&&(c.chunks[m]={...c.chunks[m],cancel:void 0,status:"waiting"})}c={...c,cancel:void 0,status:"error",error:_,percent:0},o("change",{file:y.cloneDeep(c),fileList:y.cloneDeep(a.value),event:"failed"}),E(C.uid,c)}}}}}}},me=async r=>{if(r.uid&&a.value)return E(r.uid,{status:"waiting"}),o("resetRequest",r),N(r)},fe=async r=>{var g;if(r.uid&&a.value){const x=y.cloneDeep(a.value??[]),U=x.findIndex($=>$.uid===r.uid);U>-1&&x[U]&&((g=r.cancel)==null||g.call(r),x.splice(U,1),a.value=x,o("remove",r),o("change",{file:y.cloneDeep(r),fileList:y.cloneDeep(a.value),event:"remove"}))}},ge=r=>!!((i.parallelUpload||!R.value.length)&&(r.status==="paused"||r.status==="error"||(!i.uploadOnSelect||i.listType==="image")&&r.status==="waiting")),he=e.computed(()=>{switch(i.size){case"xlg":return"md";default:return"sm"}}),ve=y.throttle(()=>{(i.parallelUpload&&q.value.length||!R.value.length)&&q.value.forEach(N),(a.value||[]).forEach(r=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(r.originFileObj instanceof File||r.originFileObj instanceof Blob)||r.thumbUrl!==void 0||(r.thumbUrl="",Ne(r.originFileObj).then(g=>{const x=g||"";x!==r.thumbUrl&&E(r==null?void 0:r.uid,{thumbUrl:x})}))})},1e3);e.watch(()=>[i.parallelUpload,q.value,R.value,a.value],ve,{deep:!0,flush:"post"});const ye=e.computed(()=>{switch(i.size){case"xlg":return"sm";case"lg":return"xsm";default:return"x2sm"}}),M={props:i,attrs:u,slots:l,emit:o,fileList:e.readonly(a),progressSize:ye,uploadableFiles:q,uploadingFiles:R,createRequest:N,resetRequest:me,canRunUpload:ge,remove:fe,goSize:he,addFiles:Q};return oe(M),s(M),(r,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r.noTrigger?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de,{key:0,multiple:r.multiple,directory:r.directory,disabled:r.disabled,accept:I.value,onAddFiles:Q,class:e.normalizeClass(r.triggerCls)},{default:e.withCtx(x=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(x)))]),_:3},8,["multiple","directory","disabled","accept","class"])),e.renderSlot(r.$slots,"list",e.normalizeProps(e.guardReactiveProps(M)),()=>[e.createVNode(Re)])],64))}});exports.UploadListTypes=X;exports.UploadSizes=K;exports.UploadStatuses=ae;exports.UploadTypes=le;exports._sfc_main=$e;exports._sfc_main$1=de;exports.injectUploadContext=D;exports.provideUploadContext=oe;exports.uploadListItemPrefix=B;exports.uploadListPrefix=j;exports.uploadPrefix=J;
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export * from './Base/BaseBadge/BaseBadge';
|
|
2
|
+
export * from './Base/BaseBadge/BaseBadge.model';
|
|
3
|
+
export * from './Base/BaseButton/BaseButton';
|
|
4
|
+
export * from './Base/BaseButton/BaseButton.model';
|
|
5
|
+
export * from './Base/BaseInput/BaseInput';
|
|
6
6
|
export * from './Base/BaseInput/BaseInput.model';
|