@pantograph/vue 0.23.35 → 0.25.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/ActionButton/index.js +1 -1
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-jhaE9j9X.js → ActionButton.vue_vue_type_script_setup_true_lang-CZTRz3hl.js} +2 -2
- package/dist/Alert/index.js +1 -1
- package/dist/{Alert.vue_vue_type_style_index_0_lang-89bXo9jG.js → Alert.vue_vue_type_style_index_0_lang-BNoDGnDR.js} +3 -3
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-kaq1iN2X.js → Avatar.vue_vue_type_style_index_0_lang--OU5sgDR.js} +3 -3
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/Badge/index.js +1 -1
- package/dist/{Badge.vue_vue_type_script_setup_true_lang-C6x4r-P7.js → Badge.vue_vue_type_script_setup_true_lang-ov_fhvSB.js} +2 -2
- package/dist/{BaseBadge.vue_vue_type_style_index_0_lang-CAdrPXmH.js → BaseBadge.vue_vue_type_style_index_0_lang-Cwko3Hlm.js} +1 -1
- package/dist/{BaseButton.vue_vue_type_style_index_0_lang-favf_C7t.js → BaseButton.vue_vue_type_style_index_0_lang-DV59KCrZ.js} +4 -4
- package/dist/Button/index.js +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-DTZUw0pf.js → Button.vue_vue_type_script_setup_true_lang-CYE9whgK.js} +2 -2
- package/dist/Checkbox/index.js +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_lang-Dzren1pf.js → Checkbox.vue_vue_type_style_index_0_lang-B37LXBOT.js} +2 -2
- package/dist/CheckboxGroup/index.js +1 -1
- package/dist/Chip/index.js +2 -2
- package/dist/{Chip.vue_vue_type_style_index_0_lang-BPdU3Pgk.js → Chip.vue_vue_type_style_index_0_lang-B8XnEjIk.js} +2 -2
- package/dist/ChipGroup/index.js +1 -1
- package/dist/{ChipGroup.vue_vue_type_style_index_0_lang-D4A14AxB.js → ChipGroup.vue_vue_type_style_index_0_lang-CYarh7Jx.js} +2 -2
- package/dist/ColorPicker/index.js +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CAzVW3da.js → ColorPicker.vue_vue_type_style_index_0_lang-BhznZQOS.js} +3 -3
- package/dist/ColorSwatch/index.js +1 -1
- package/dist/{ColorSwatch-LVdDBugO.js → ColorSwatch-GhXGfFR9.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-htOyCGxU.js → ColorSwatch.vue_vue_type_style_index_0_lang-CXh-dgyg.js} +3 -3
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-Cv2D2XJ5.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-DMWiKVRG.js} +4 -4
- package/dist/ColorTrigger/index.js +1 -1
- package/dist/{ColorTrigger.vue_vue_type_style_index_0_lang-CNeFfFIE.js → ColorTrigger.vue_vue_type_style_index_0_lang-Cu8MO8RU.js} +3 -3
- package/dist/Combobox/index.js +1 -1
- package/dist/{Combobox.vue_vue_type_style_index_0_lang-Cj3maBpd.js → Combobox.vue_vue_type_style_index_0_lang-BsO5vzLB.js} +15 -15
- package/dist/Comment/CommentEditor.d.ts +9 -9
- package/dist/Comment/index.js +340 -1751
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/DataTable/index.js +1 -1
- package/dist/{DataTable.vue_vue_type_style_index_0_lang-CW2i09wf.js → DataTable.vue_vue_type_style_index_0_lang-DE97OF7f.js} +13 -13
- package/dist/DropZone/index.js +1 -1
- package/dist/{DropZone.vue_vue_type_style_index_0_lang-CF9qXlg0.js → DropZone.vue_vue_type_style_index_0_lang-gguAkRve.js} +2 -2
- package/dist/Empty/index.js +1 -1
- package/dist/{Empty.vue_vue_type_style_index_0_lang-BAbEBeZo.js → Empty.vue_vue_type_style_index_0_lang-YvYjr_zz.js} +1 -1
- package/dist/FloatButton/index.js +1 -1
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-PYw1Yz9o.js → FloatButton.vue_vue_type_script_setup_true_lang-Ck9ilRKa.js} +2 -2
- package/dist/Form/index.js +1 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-DVZ2wSgV.js → GOPicker.vue_vue_type_style_index_0_lang-D9A9w-Pa.js} +11 -11
- package/dist/GraphicalObject/index.js +1 -1
- package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-C949W-Ro.js → GraphicalObject.vue_vue_type_script_setup_true_lang-CEul2ZDZ.js} +3 -3
- package/dist/GraphicalObjectGroup/index.js +1 -1
- package/dist/{GraphicalObjectGroup.vue_vue_type_style_index_0_lang-CYUJM_Vv.js → GraphicalObjectGroup.vue_vue_type_style_index_0_lang-lN6Gzj19.js} +2 -2
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon.vue_vue_type_style_index_0_lang-BUvEzzua.js → Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js} +13 -13
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-BBnCpnF1.js → IconButton.vue_vue_type_script_setup_true_lang-BG-vYXAP.js} +2 -2
- package/dist/Image/index.js +1 -1
- package/dist/{Image.vue_vue_type_style_index_0_lang-UVOAmZXt.js → Image.vue_vue_type_style_index_0_lang-Bzg_B3NK.js} +2 -2
- package/dist/IndentLevel/index.js +1 -1
- package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-59akXJBr.js → IndentLevel.vue_vue_type_style_index_0_lang-C7d2_3hI.js} +3 -3
- package/dist/Indicator/index.js +1 -1
- package/dist/{Indicator.vue_vue_type_script_setup_true_lang-AJV4EFOO.js → Indicator.vue_vue_type_script_setup_true_lang-DMYJ5Fn6.js} +2 -2
- package/dist/Input/index.js +1 -1
- package/dist/{Input.vue_vue_type_style_index_0_lang-D4aCRGW6.js → Input.vue_vue_type_style_index_0_lang-DkuxhdXR.js} +2 -2
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd.vue_vue_type_style_index_0_lang-DpjuML9o.js → Kbd.vue_vue_type_style_index_0_lang-iUfSP9TC.js} +1 -1
- package/dist/Label/index.js +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link.vue_vue_type_style_index_0_lang-CsBkek74.js → Link.vue_vue_type_style_index_0_lang-TePg8XgW.js} +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/MenuItem/index.js +1 -1
- package/dist/{MenuItem.vue_vue_type_style_index_0_lang-DNlGDoyp.js → MenuItem.vue_vue_type_style_index_0_lang-D_lWThP0.js} +3 -3
- package/dist/Pagination/Pagination.d.ts +60 -0
- package/dist/Pagination/index.d.ts +2 -1
- package/dist/Pagination/index.js +6 -1
- package/dist/Pagination/index.umd.cjs +1 -1
- package/dist/Pagination.vue_vue_type_style_index_0_lang-CDaeQOJb.js +1 -0
- package/dist/Pagination.vue_vue_type_style_index_0_lang-D8oCaF6X.js +224 -0
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover.vue_vue_type_style_index_0_lang-Bdu86hho.js → Popover.vue_vue_type_style_index_0_lang-DLboppFN.js} +1 -1
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +15 -0
- package/dist/Progress/index.umd.cjs +1 -0
- package/dist/Progress.vue_vue_type_style_index_0_lang-BEHOwYFc.js +447 -0
- package/dist/Progress.vue_vue_type_style_index_0_lang-WHi3Gv1W.js +1 -0
- package/dist/RadioGroup/index.js +1 -1
- package/dist/{RadioGroup.vue_vue_type_script_setup_true_lang-BVfQx8wD.js → RadioGroup.vue_vue_type_script_setup_true_lang-BEPTbeyN.js} +2 -2
- package/dist/ScrollContainer/index.js +1 -1
- package/dist/{ScrollContainer.vue_vue_type_style_index_0_lang-DGUSuq_n.js → ScrollContainer.vue_vue_type_style_index_0_lang-DqLbpFbD.js} +1 -1
- package/dist/Segmented/Segmented.d.ts +57 -0
- package/dist/Segmented/index.d.ts +2 -1
- package/dist/Segmented/index.js +6 -1
- package/dist/Segmented/index.umd.cjs +1 -1
- package/dist/Segmented.vue_vue_type_style_index_0_lang-B52Fuc2U.js +161 -0
- package/dist/Segmented.vue_vue_type_style_index_0_lang-BvBq13y7.js +1 -0
- package/dist/Select/index.js +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-D-dLDaBy.js → Select.vue_vue_type_style_index_0_lang-NsFWEuv3.js} +7 -7
- package/dist/Shortcut/index.js +1 -1
- package/dist/{Shortcut.vue_vue_type_style_index_0_lang-BXy0S1__.js → Shortcut.vue_vue_type_style_index_0_lang-D0pRaguA.js} +2 -2
- package/dist/Spinner/index.js +1 -1
- package/dist/{Spinner.vue_vue_type_style_index_0_lang-BacaASPe.js → Spinner.vue_vue_type_style_index_0_lang-Bx_MQ7lE.js} +1 -1
- package/dist/SubMenu/index.js +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch.vue_vue_type_style_index_0_lang--RYeL-jW.js → Switch.vue_vue_type_style_index_0_lang-CnwcbtZs.js} +2 -2
- package/dist/{THead.vue_vue_type_style_index_0_lang-DfOi9-Nh.js → THead.vue_vue_type_style_index_0_lang-BEFUWFjk.js} +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/Textarea/index.js +1 -1
- package/dist/{Textarea.vue_vue_type_style_index_0_lang-CPto-5VY.js → Textarea.vue_vue_type_style_index_0_lang-DPWaIFuD.js} +3 -3
- package/dist/Tree/index.js +1 -1
- package/dist/{Tree.vue_vue_type_style_index_0_lang-D-mTy1Es.js → Tree.vue_vue_type_style_index_0_lang-Dh0qoB5W.js} +5 -5
- package/dist/Upload/index.d.ts +4 -1
- package/dist/Upload/index.js +14 -1
- package/dist/Upload/index.umd.cjs +1 -1
- package/dist/Upload.vue_vue_type_style_index_0_lang-6dbdVoDr.js +1 -0
- package/dist/Upload.vue_vue_type_style_index_0_lang-DXBaIH16.js +1008 -0
- package/dist/index.js +192 -162
- package/dist/index.umd.cjs +1 -1
- package/dist/{sortBy-BoHPhPoZ.js → sortBy-CUiSA46K.js} +16 -16
- package/dist/style/index.css +1 -1
- package/dist/{uniq-iuU6YkEW.js → uniq-Bk9D4jYg.js} +1 -1
- package/dist/{useInputDataStates-CJoP9BXy.js → useInputDataStates-RRZVY4Vg.js} +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineComponent as W, useSlots as X, computed as M, watch as Y, createBlock as Z, openBlock as ee, unref as r, mergeProps as te, isRef as oe, withCtx as se, createElementVNode as ne, normalizeStyle as ae, normalizeClass as ie, createVNode as le, h as C } from "vue";
|
|
2
|
+
import { useForwardPropsEmits as ce, RovingFocusGroup as re, RovingFocusItem as ue } from "reka-ui";
|
|
3
|
+
import { getBemBlock as de, generateVariantClassList as g, getBemElement as S, normCls as x } from "@pantograph/utils";
|
|
4
|
+
import { l as me, u as pe, o as fe, j as V, k as ve } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
5
|
+
import { cva as P } from "class-variance-authority";
|
|
6
|
+
import { u as ge, a as p } from "./index-BTuMaS--.js";
|
|
7
|
+
import { g as xe } from "./options-Bh1s18jm.js";
|
|
8
|
+
import "@iconify/vue";
|
|
9
|
+
const Ce = ["sm", "md", "lg"], ke = /* @__PURE__ */ W({
|
|
10
|
+
...xe("Segmented"),
|
|
11
|
+
__name: "Segmented",
|
|
12
|
+
props: {
|
|
13
|
+
options: {},
|
|
14
|
+
size: { default: "md" },
|
|
15
|
+
class: {},
|
|
16
|
+
selectionIndicatorCls: {},
|
|
17
|
+
optionCls: {},
|
|
18
|
+
optionIconCls: {},
|
|
19
|
+
optionTextCls: {},
|
|
20
|
+
block: { type: Boolean },
|
|
21
|
+
modelValue: {},
|
|
22
|
+
defaultModelValue: {},
|
|
23
|
+
orientation: {},
|
|
24
|
+
dir: {},
|
|
25
|
+
loop: { type: Boolean },
|
|
26
|
+
preventScrollOnEntryFocus: { type: Boolean }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue", "entryFocus"],
|
|
29
|
+
setup(R, { emit: j }) {
|
|
30
|
+
const t = R, b = j, a = X(), D = M(
|
|
31
|
+
() => me(t, "orientation", "dir", "loop", "preventScrollOnEntryFocus")
|
|
32
|
+
), N = ce(D, b), f = de("segmented"), $ = P(f, {
|
|
33
|
+
variants: {
|
|
34
|
+
size: g(Ce, f),
|
|
35
|
+
block: g("block", f)
|
|
36
|
+
// style: generateVariantClassList('absolute-selected-indicator', prefix),
|
|
37
|
+
}
|
|
38
|
+
}), u = S(f, "option"), G = P(u, {
|
|
39
|
+
variants: {
|
|
40
|
+
icon: g("icon", u),
|
|
41
|
+
text: g("text", u)
|
|
42
|
+
}
|
|
43
|
+
}), { getDir: L } = ge(), U = L(), q = M(() => {
|
|
44
|
+
switch (t.size) {
|
|
45
|
+
case "lg":
|
|
46
|
+
return "xsm";
|
|
47
|
+
default:
|
|
48
|
+
return "2xsm";
|
|
49
|
+
}
|
|
50
|
+
}), i = pe(
|
|
51
|
+
t,
|
|
52
|
+
"modelValue",
|
|
53
|
+
b,
|
|
54
|
+
{
|
|
55
|
+
defaultValue: t.defaultModelValue,
|
|
56
|
+
passive: t.modelValue === void 0
|
|
57
|
+
}
|
|
58
|
+
), v = (e) => [null, void 0].includes(e), l = (e) => p(e) ? e.value : e, A = (e) => !!(p(e) && e.disabled), H = (e) => p(e) ? e.icon : void 0, J = (e) => p(e) ? e.text : l(e);
|
|
59
|
+
Y(
|
|
60
|
+
() => t.options,
|
|
61
|
+
() => {
|
|
62
|
+
var o, s;
|
|
63
|
+
const e = (o = t.options) == null ? void 0 : o.find((n) => {
|
|
64
|
+
const c = l(n);
|
|
65
|
+
return !v(c) && c === i.value;
|
|
66
|
+
});
|
|
67
|
+
if (!e || v(l(e))) {
|
|
68
|
+
const n = (s = t.options) == null ? void 0 : s.find((c) => {
|
|
69
|
+
const d = l(c);
|
|
70
|
+
return !v(d);
|
|
71
|
+
});
|
|
72
|
+
n && (i.value = l(n));
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{ immediate: !0, deep: !0 }
|
|
76
|
+
);
|
|
77
|
+
const K = () => {
|
|
78
|
+
var e;
|
|
79
|
+
return (e = t.options) == null ? void 0 : e.map((o) => {
|
|
80
|
+
var T, F, w;
|
|
81
|
+
const s = l(o);
|
|
82
|
+
if (v(s)) return;
|
|
83
|
+
const n = A(o), c = p(o) ? fe(o, "icon", "value", "text") : {}, d = i.value === s;
|
|
84
|
+
let m;
|
|
85
|
+
const h = (T = a.option) == null ? void 0 : T.call(a, { disabled: n, selected: d, option: o });
|
|
86
|
+
V(h) || (m = h);
|
|
87
|
+
const B = H(o), I = (F = a.icon) == null ? void 0 : F.call(a, { disabled: n, selected: d, option: o }), _ = J(o), y = (w = a.text) == null ? void 0 : w.call(a, { disabled: n, selected: d, option: o });
|
|
88
|
+
m = [];
|
|
89
|
+
const k = !V(I), z = !!(B || k), O = !V(y), E = !!(_ || O);
|
|
90
|
+
z && m.push(
|
|
91
|
+
C(
|
|
92
|
+
ve,
|
|
93
|
+
{
|
|
94
|
+
icon: B,
|
|
95
|
+
size: q.value,
|
|
96
|
+
class: x(S(u, "icon"), t.optionIconCls)
|
|
97
|
+
},
|
|
98
|
+
k ? I : void 0
|
|
99
|
+
)
|
|
100
|
+
), E && m.push(
|
|
101
|
+
C(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
class: x(S(u, "text"), t.optionTextCls)
|
|
105
|
+
},
|
|
106
|
+
O ? y : _
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
const Q = i.value === s;
|
|
110
|
+
return C(
|
|
111
|
+
ue,
|
|
112
|
+
{
|
|
113
|
+
as: "button",
|
|
114
|
+
active: Q,
|
|
115
|
+
focusable: !n,
|
|
116
|
+
disabled: n,
|
|
117
|
+
tabStopId: s,
|
|
118
|
+
value: s,
|
|
119
|
+
...c,
|
|
120
|
+
class: x(
|
|
121
|
+
G({
|
|
122
|
+
icon: z,
|
|
123
|
+
text: E
|
|
124
|
+
}),
|
|
125
|
+
t.optionCls
|
|
126
|
+
)
|
|
127
|
+
},
|
|
128
|
+
() => m
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
return (e, o) => (ee(), Z(r(re), te(r(N), {
|
|
133
|
+
dir: r(U),
|
|
134
|
+
"current-tab-stop-id": r(i),
|
|
135
|
+
"onUpdate:currentTabStopId": o[0] || (o[0] = (s) => oe(i) ? i.value = s : null),
|
|
136
|
+
asChild: ""
|
|
137
|
+
}), {
|
|
138
|
+
default: se(() => {
|
|
139
|
+
var s;
|
|
140
|
+
return [
|
|
141
|
+
ne("div", {
|
|
142
|
+
class: ie(r(x)(r($)({
|
|
143
|
+
...t
|
|
144
|
+
/*, style: !style*/
|
|
145
|
+
}), t.class)),
|
|
146
|
+
style: ae({
|
|
147
|
+
gridTemplateColumns: `repeat(${((s = t.options) == null ? void 0 : s.length) ?? 1}, minmax(0, 1fr))`
|
|
148
|
+
})
|
|
149
|
+
}, [
|
|
150
|
+
le(K)
|
|
151
|
+
], 6)
|
|
152
|
+
];
|
|
153
|
+
}),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 16, ["dir", "current-tab-stop-id"]));
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
export {
|
|
159
|
+
Ce as S,
|
|
160
|
+
ke as _
|
|
161
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),x=require("reka-ui"),i=require("@pantograph/utils"),r=require("./Icon.vue_vue_type_style_index_0_lang-CPuN4R-k.js"),T=require("class-variance-authority"),m=require("./index-BmcHqJPl.js"),K=require("./options-CY2uxp5A.js");require("@iconify/vue");const F=["sm","md","lg"],Q=e.defineComponent({...K.getComponentOptions("Segmented"),__name:"Segmented",props:{options:{},size:{default:"md"},class:{},selectionIndicatorCls:{},optionCls:{},optionIconCls:{},optionTextCls:{},block:{type:Boolean},modelValue:{},defaultModelValue:{},orientation:{},dir:{},loop:{type:Boolean},preventScrollOnEntryFocus:{type:Boolean}},emits:["update:modelValue","entryFocus"],setup(j,{emit:w}){const n=j,S=w,a=e.useSlots(),L=e.computed(()=>r.pick(n,"orientation","dir","loop","preventScrollOnEntryFocus")),M=x.useForwardPropsEmits(L,S),g=i.getBemBlock("segmented"),P=T.cva(g,{variants:{size:i.generateVariantClassList(F,g),block:i.generateVariantClassList("block",g)}}),p=i.getBemElement(g,"option"),R=T.cva(p,{variants:{icon:i.generateVariantClassList("icon",p),text:i.generateVariantClassList("text",p)}}),{getDir:D}=m.useConfig(),N=D(),U=e.computed(()=>{switch(n.size){case"lg":return"xsm";default:return"2xsm"}}),c=r.useVModel(n,"modelValue",S,{defaultValue:n.defaultModelValue,passive:n.modelValue===void 0}),C=t=>[null,void 0].includes(t),u=t=>m.isObject(t)?t.value:t,$=t=>!!(m.isObject(t)&&t.disabled),A=t=>m.isObject(t)?t.icon:void 0,G=t=>m.isObject(t)?t.text:u(t);e.watch(()=>n.options,()=>{var s,o;const t=(s=n.options)==null?void 0:s.find(l=>{const d=u(l);return!C(d)&&d===c.value});if(!t||C(u(t))){const l=(o=n.options)==null?void 0:o.find(d=>{const f=u(d);return!C(f)});l&&(c.value=u(l))}},{immediate:!0,deep:!0});const H=()=>{var t;return(t=n.options)==null?void 0:t.map(s=>{var z,k,q;const o=u(s);if(C(o))return;const l=$(s),d=m.isObject(s)?r.omit(s,"icon","value","text"):{},f=c.value===o;let v;const V=(z=a.option)==null?void 0:z.call(a,{disabled:l,selected:f,option:s});r.isEmptyElement(V)||(v=V);const b=A(s),_=(k=a.icon)==null?void 0:k.call(a,{disabled:l,selected:f,option:s}),h=G(s),y=(q=a.text)==null?void 0:q.call(a,{disabled:l,selected:f,option:s});v=[];const B=!r.isEmptyElement(_),E=!!(b||B),I=!r.isEmptyElement(y),O=!!(h||I);E&&v.push(e.h(r._sfc_main$3,{icon:b,size:U.value,class:i.normCls(i.getBemElement(p,"icon"),n.optionIconCls)},B?_:void 0)),O&&v.push(e.h("div",{class:i.normCls(i.getBemElement(p,"text"),n.optionTextCls)},I?y:h));const J=c.value===o;return e.h(x.RovingFocusItem,{as:"button",active:J,focusable:!l,disabled:l,tabStopId:o,value:o,...d,class:i.normCls(R({icon:E,text:O}),n.optionCls)},()=>v)})};return(t,s)=>(e.openBlock(),e.createBlock(e.unref(x.RovingFocusGroup),e.mergeProps(e.unref(M),{dir:e.unref(N),"current-tab-stop-id":e.unref(c),"onUpdate:currentTabStopId":s[0]||(s[0]=o=>e.isRef(c)?c.value=o:null),asChild:""}),{default:e.withCtx(()=>{var o;return[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i.normCls)(e.unref(P)({...n}),n.class)),style:e.normalizeStyle({gridTemplateColumns:`repeat(${((o=n.options)==null?void 0:o.length)??1}, minmax(0, 1fr))`})},[e.createVNode(H)],6)]}),_:1},16,["dir","current-tab-stop-id"]))}});exports.SegmentedSizes=F;exports._sfc_main=Q;
|
package/dist/Select/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as a, a as s, S, b as c, c as l, i as o, p as i } from "../Select.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as a, a as s, S, b as c, c as l, i as o, p as i } from "../Select.vue_vue_type_style_index_0_lang-NsFWEuv3.js";
|
|
2
2
|
export {
|
|
3
3
|
a as Select,
|
|
4
4
|
s as SelectLabel,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { defineComponent as te, createElementBlock as ze, openBlock as _e, normalizeClass as ke, unref as le, renderSlot as Be, computed as C, h as i, ref as ve, watch as we, useSlots as De, useAttrs as Ae, createBlock as Fe, normalizeProps as Ce, guardReactiveProps as ye, withCtx as Se, createVNode as We, createSlots as $e, renderList as Ee } from "vue";
|
|
2
2
|
import { createContext as Pe, SelectItem as Ge, SelectItemIndicator as Ne, SelectTrigger as Re, Primitive as je, injectSelectRootContext as Ke, SelectPortal as Me, SelectContent as qe, useEmitAsProps as Ue, SelectRoot as He } from "reka-ui";
|
|
3
|
-
import { j as p, k as ce, s as q, t as he, g as Je, h as Qe, f as Xe, o as be, y as Ve, q as Ye, r as Ze, l as Oe, v as et } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import { j as p, k as ce, s as q, t as he, g as Je, h as Qe, f as Xe, o as be, y as Ve, q as Ye, r as Ze, l as Oe, v as et } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
4
4
|
import { g as Te, a as ge } from "./options-Bh1s18jm.js";
|
|
5
5
|
import { i as ee, f as Y, a as Z, u as tt, c as Le } from "./index-BTuMaS--.js";
|
|
6
6
|
import { getBemBlock as nt, getBemElement as y, generateVariantClassList as E, normCls as _ } from "@pantograph/utils";
|
|
7
7
|
import { cva as de } from "class-variance-authority";
|
|
8
|
-
import { _ as ot } from "./Empty.vue_vue_type_style_index_0_lang-
|
|
8
|
+
import { _ as ot } from "./Empty.vue_vue_type_style_index_0_lang-YvYjr_zz.js";
|
|
9
9
|
import { _ as rt } from "./Skeleton.vue_vue_type_style_index_0_lang-2rpO7HY2.js";
|
|
10
10
|
import { _ as xe } from "./Divider.vue_vue_type_style_index_0_lang-CfBklijs.js";
|
|
11
|
-
import { u as at } from "./useInputDataStates-
|
|
11
|
+
import { u as at } from "./useInputDataStates-RRZVY4Vg.js";
|
|
12
12
|
import { u as it } from "./useLazyLoading-Zo-PEp2E.js";
|
|
13
|
-
import { g as lt, b as pt } from "./Popover.vue_vue_type_style_index_0_lang-
|
|
14
|
-
import { _ as st } from "./ScrollContainer.vue_vue_type_style_index_0_lang-
|
|
15
|
-
import { _ as ut } from "./Chip.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as ct } from "./ChipGroup.vue_vue_type_style_index_0_lang-
|
|
13
|
+
import { g as lt, b as pt } from "./Popover.vue_vue_type_style_index_0_lang-DLboppFN.js";
|
|
14
|
+
import { _ as st } from "./ScrollContainer.vue_vue_type_style_index_0_lang-DqLbpFbD.js";
|
|
15
|
+
import { _ as ut } from "./Chip.vue_vue_type_style_index_0_lang-B8XnEjIk.js";
|
|
16
|
+
import { _ as ct } from "./ChipGroup.vue_vue_type_style_index_0_lang-CYarh7Jx.js";
|
|
17
17
|
const fe = ["sm", "md", "lg"], gt = ["error", "warning", "success"], [Ie, dt] = Pe("Select"), [ft, mt] = Pe("_Select"), k = nt("select"), vt = /* @__PURE__ */ te({
|
|
18
18
|
...Te("SelectLabel"),
|
|
19
19
|
__name: "SelectLabel",
|
package/dist/Shortcut/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as c, createElementBlock as t, openBlock as r, normalizeClass as i, unref as o, Fragment as s, renderList as u, createVNode as f, createBlock as _, createCommentVNode as g, mergeProps as d } from "vue";
|
|
2
2
|
import { getBemBlock as h, normCls as k } from "@pantograph/utils";
|
|
3
3
|
import { g as B } from "./options-Bh1s18jm.js";
|
|
4
|
-
import { _ as C } from "./Kbd.vue_vue_type_style_index_0_lang-
|
|
5
|
-
import { k as y } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import { _ as C } from "./Kbd.vue_vue_type_style_index_0_lang-iUfSP9TC.js";
|
|
5
|
+
import { k as y } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
6
6
|
const v = /* @__PURE__ */ c({
|
|
7
7
|
...B("Shortcut"),
|
|
8
8
|
__name: "Shortcut",
|
package/dist/Spinner/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as z, useSlots as S, computed as m, createElementBlock as n, openBlock as i, normalizeClass as a, unref as t, createVNode as x, createCommentVNode as c, withCtx as h, renderSlot as C, createElementVNode as p, createTextVNode as k, toDisplayString as y } from "vue";
|
|
2
2
|
import { getBemBlock as N, generateVariantClassList as u, normCls as V, getBemElement as d } from "@pantograph/utils";
|
|
3
3
|
import { cva as T } from "class-variance-authority";
|
|
4
|
-
import { k as w } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import { k as w } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
5
5
|
import { g as E } from "./options-Bh1s18jm.js";
|
|
6
6
|
const _ = ["3xsm", "2xsm", "xsm", "sm"], $ = {
|
|
7
7
|
key: 0,
|
package/dist/SubMenu/index.js
CHANGED
package/dist/Switch/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { defineComponent as A, useSlots as L, computed as t, ref as _, watch as
|
|
|
2
2
|
import { getBemBlock as R, generateVariantClassList as f, usePCId as j, normCls as k, getBemElement as n } from "@pantograph/utils";
|
|
3
3
|
import { cva as G } from "class-variance-authority";
|
|
4
4
|
import { useEmitAsProps as H, SwitchRoot as J, SwitchThumb as K } from "reka-ui";
|
|
5
|
-
import { o as x } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
5
|
+
import { o as x } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
6
6
|
import { g as M } from "./options-Bh1s18jm.js";
|
|
7
7
|
import "@iconify/vue";
|
|
8
|
-
import { u as Q, U as W } from "./useInputDataStates-
|
|
8
|
+
import { u as Q, U as W } from "./useInputDataStates-RRZVY4Vg.js";
|
|
9
9
|
const X = ["2xsm", "xsm", "sm"], Y = ["for"], ie = /* @__PURE__ */ A({
|
|
10
10
|
...M("Switch"),
|
|
11
11
|
__name: "Switch",
|
|
@@ -2,7 +2,7 @@ import { defineComponent as y, createElementBlock as c, openBlock as i, normaliz
|
|
|
2
2
|
import { getBemBlock as T, generateVariantClassList as l, normCls as b, getBemElement as m } from "@pantograph/utils";
|
|
3
3
|
import { cva as v } from "class-variance-authority";
|
|
4
4
|
import { g as z } from "./options-Bh1s18jm.js";
|
|
5
|
-
import "./Icon.vue_vue_type_style_index_0_lang-
|
|
5
|
+
import "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
6
6
|
const f = ["lg", "xlg"], d = T("table"), F = /* @__PURE__ */ y({
|
|
7
7
|
...z("Table"),
|
|
8
8
|
__name: "Table",
|
package/dist/Table/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as T, e, _ as d, T as b, b as o, a as r, c as l } from "../THead.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { d as T, e, _ as d, T as b, b as o, a as r, c as l } from "../THead.vue_vue_type_style_index_0_lang-BEFUWFjk.js";
|
|
2
2
|
export {
|
|
3
3
|
T as TBody,
|
|
4
4
|
e as THead,
|
package/dist/Textarea/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as N, useAttrs as j, computed as g, ref as v, onMounted as A, watch as F, nextTick as L, createBlock as b, openBlock as y, unref as o, withCtx as x, withDirectives as G, createElementVNode as J, mergeProps as K, isRef as Q, vModelText as W, createCommentVNode as X, normalizeClass as Y, renderSlot as Z } from "vue";
|
|
2
2
|
import { useResizeObserver as ee } from "@vueuse/core";
|
|
3
3
|
import { getBemBlock as te, generateVariantClassList as c, normCls as h, getBemElement as B } from "@pantograph/utils";
|
|
4
|
-
import { u as ae, o as C, l as oe, r as se, k as re, t as le, v as ie } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
4
|
+
import { u as ae, o as C, l as oe, r as se, k as re, t as le, v as ie } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
5
5
|
import { cva as ne } from "class-variance-authority";
|
|
6
6
|
import { g as ue } from "./options-Bh1s18jm.js";
|
|
7
7
|
import { g as ce } from "./style-BEhqkSEE.js";
|
|
8
|
-
import { u as de, U as pe, c as H } from "./useInputDataStates-
|
|
9
|
-
import { _ as me } from "./ScrollContainer.vue_vue_type_style_index_0_lang-
|
|
8
|
+
import { u as de, U as pe, c as H } from "./useInputDataStates-RRZVY4Vg.js";
|
|
9
|
+
import { _ as me } from "./ScrollContainer.vue_vue_type_style_index_0_lang-DqLbpFbD.js";
|
|
10
10
|
const V = ["sm", "md", "lg"], fe = ["error", "warning", "success"], _e = /* @__PURE__ */ N({
|
|
11
11
|
...ue("Textarea", !1),
|
|
12
12
|
__name: "Textarea",
|
package/dist/Tree/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as r, a as s, T as t, _ as T, i as o, p as i } from "../Tree.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as r, a as s, T as t, _ as T, i as o, p as i } from "../Tree.vue_vue_type_style_index_0_lang-Dh0qoB5W.js";
|
|
2
2
|
export {
|
|
3
3
|
r as Tree,
|
|
4
4
|
s as TreeGaps,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as sn, useSlots as un, computed as B, ref as ge, resolveComponent as xn, createElementBlock as Ce, openBlock as le, mergeProps as ut, unref as h, createCommentVNode as Ge, createElementVNode as Ut, withDirectives as In, normalizeClass as Oe, createVNode as Nn, createBlock as dt, withCtx as ct, renderSlot as je, normalizeProps as Ct, guardReactiveProps as Tt, withModifiers as On, Fragment as Rt, toDisplayString as kn, renderList as vt, createSlots as dn, vShow as An, watch as He, normalizeStyle as Pn, onMounted as Fn, onBeforeUnmount as Mn } from "vue";
|
|
2
2
|
import { generateVariantClassList as Te, normCls as zt, getBemElement as ve, getBemModifier as Kt, getBemBlock as Bn, usePCId as Rn } from "@pantograph/utils";
|
|
3
3
|
import { cva as cn } from "class-variance-authority";
|
|
4
|
-
import { k as zn, t as pe, w as qt } from "./Icon.vue_vue_type_style_index_0_lang-
|
|
5
|
-
import { u as xt } from "./uniq-
|
|
4
|
+
import { k as zn, t as pe, w as qt } from "./Icon.vue_vue_type_style_index_0_lang-BxthrfMq.js";
|
|
5
|
+
import { u as xt } from "./uniq-Bk9D4jYg.js";
|
|
6
6
|
import { g as fn } from "./options-Bh1s18jm.js";
|
|
7
7
|
import { createContext as Kn } from "reka-ui";
|
|
8
|
-
import { _ as Xn } from "./IndentLevel.vue_vue_type_style_index_0_lang-
|
|
9
|
-
import { _ as Yn } from "./Checkbox.vue_vue_type_style_index_0_lang-
|
|
10
|
-
import { U as Ln, u as $n } from "./useInputDataStates-
|
|
8
|
+
import { _ as Xn } from "./IndentLevel.vue_vue_type_style_index_0_lang-C7d2_3hI.js";
|
|
9
|
+
import { _ as Yn } from "./Checkbox.vue_vue_type_style_index_0_lang-B37LXBOT.js";
|
|
10
|
+
import { U as Ln, u as $n } from "./useInputDataStates-RRZVY4Vg.js";
|
|
11
11
|
import { useElementSize as Gn } from "@vueuse/core";
|
|
12
12
|
import { u as Hn, c as jn } from "./index-BTuMaS--.js";
|
|
13
13
|
/**!
|
package/dist/Upload/index.d.ts
CHANGED
package/dist/Upload/index.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
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-DXBaIH16.js";
|
|
2
|
+
export {
|
|
3
|
+
o as Upload,
|
|
4
|
+
p as UploadListTypes,
|
|
5
|
+
e as UploadSizes,
|
|
6
|
+
d as UploadStatuses,
|
|
7
|
+
t as UploadTrigger,
|
|
8
|
+
i as UploadTypes,
|
|
9
|
+
l as injectUploadContext,
|
|
10
|
+
U as provideUploadContext,
|
|
11
|
+
r as uploadListItemPrefix,
|
|
12
|
+
x as uploadListPrefix,
|
|
13
|
+
f as uploadPrefix
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Upload.vue_vue_type_style_index_0_lang-6dbdVoDr.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),te=require("reka-ui"),k=require("@pantograph/utils"),I=require("./index-BmcHqJPl.js"),v=require("./Icon.vue_vue_type_style_index_0_lang-CPuN4R-k.js"),ne=require("class-variance-authority"),se=require("./Progress.vue_vue_type_style_index_0_lang-WHi3Gv1W.js"),_e=require("./FloatButton.vue_vue_type_script_setup_true_lang-BVJZNZm4.js"),R=require("./IconButton.vue_vue_type_script_setup_true_lang-DynLmo_n.js"),xe=require("./Image.vue_vue_type_style_index_0_lang-B43Rg3w7.js"),P=require("./options-CY2uxp5A.js"),we=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-EviuZ52W.js"),H=k.getBemBlock("upload"),j=k.getBemElement(H,"list"),b=k.getBemElement(j,"item"),[D,oe]=te.createContext("Upload"),re=(s,n)=>{if(s&&n){const t=Array.isArray(n)?n:n.split(","),r=s.name||"",o=s.type||"",c=o.replace(/\/.*$/,"");return t.some(p=>{const m=p.trim();if(/^\*(?<temp1>\/\*)?$/.test(p))return!0;if(m.charAt(0)==="."){const d=r.toLowerCase(),l=m.toLowerCase();let g=[l];return(l===".jpg"||l===".jpeg")&&(g=[".jpg",".jpeg"]),g.some(u=>d.endsWith(u))}return/\/\*$/.test(m)?c===m.replace(/\/.*$/,""):!!(o===m||/^\w+$/.test(m))})}return!0},be=(s,n,t=1*1024*1024)=>{const r=[];let o=0,c=0;for(;o<s.size;){const p=Math.min(o+t,s.size),m=s.slice(o,p);r.push({chunk:m,chunkSize:p-o,index:c,uid:n(),status:"waiting"}),o=p,c++}return r},ie=(s,{getUid:n,chunkFile:t,chunkSize:r})=>{if(I.isObject(s)){let o;if(s instanceof File)o=s;else try{o=new File([s],s.name??"",{type:s.type??""})}catch{o=new Blob([s],{type:s.type??""}),o.lastModified=new Date().getTime(),o.name=s.name??"",o.webkitRelativePath=""}if(I.isObject(o)&&o instanceof Blob){let c=[];return t&&(c=be(o,()=>(n==null?void 0:n(!0))??k.usePCId(void 0,!0),r)),{uid:s.uid??(n==null?void 0:n())??k.usePCId(void 0,!0),originFileObj:o,status:"waiting",chunks:c!=null&&c.length&&(c==null?void 0:c.length)>1?c:void 0,chunksCount:c!=null&&c.length&&(c==null?void 0:c.length)>1?c.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}}}},Ce=(s,n)=>{if(I.isObject(s))return s instanceof Blob||s instanceof File?ie(s,n):(!s.uid&&!Object.isFrozen(s)&&(s.uid=n.getUid()),s)},le=["error","paused","done","uploading","waiting"],J=["md","lg","xlg"],K=["image","card"],ae=["outline","transparent"],G={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"}},Be={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=s=>{if(s){for(const[n,t]of Object.entries(Be))if(t.includes(s.toLowerCase()))return n}return"other"},ue=(s="")=>{const n=s.split("/"),r=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},X=s=>{var n,t,r;return(r=(t=(n=s==null?void 0:s.split)==null?void 0:n.call(s,"/"))==null?void 0:t.pop)==null?void 0:r.call(t)},ze=s=>{var t;let n=X((s==null?void 0:s.type)||((t=s==null?void 0:s.originFileObj)==null?void 0:t.type));if(s!=null&&s.url&&!n)try{n=ue(s==null?void 0:s.url)}catch{}return n},W=s=>ce(s)==="image",pe=s=>{if(s.type&&!s.thumbUrl)return W(X(s.type));const n=s.thumbUrl||s.url||"",t=ue(n);return/^data:image\//.test(n)||W(t)?!0:!(/^data:/.test(n)||t)},Fe=e.defineComponent({...P.getComponentOptions("UploadListItemImage"),__name:"UploadListItemImage",setup(s){const n=D(),t=Y(),r=()=>{var o,c,p;I.isFunction((o=t.props.uploadFile)==null?void 0:o.cancel)&&((p=(c=t.props.uploadFile).cancel)==null||p.call(c)),n.remove(t.props.uploadFile)};return(o,c)=>{var p;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(t).props.uploadFile.status!=="waiting"?(e.openBlock(),e.createBlock(xe._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(R._sfc_main,{key:0,color:"neutral",type:"ghost",icon:"tabler:eye",size:"sm",onClick:c[0]||(c[0]=m=>e.unref(n).emit("preview",e.unref(t).props.uploadFile))})):e.unref(t).props.uploadFile.status==="error"?(e.openBlock(),e.createBlock(R._sfc_main,{key:1,color:"neutral",type:"ghost",icon:"tabler:reload",size:"sm",onClick:c[1]||(c[1]=m=>e.unref(n).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(n).progressSize.value,class:e.normalizeClass(e.unref(k.getBemElement)(e.unref(b),"progress")),indeterminate:e.unref(t).props.uploadFile.status==="waiting",percent:((p=e.unref(t).props.uploadFile)==null?void 0:p.percent)??0},null,8,["size","class","indeterminate","percent"])):e.createCommentVNode("",!0),e.createVNode(_e._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:r},null,8,["class"])],64)}}}),Ie=e.defineComponent({...P.getComponentOptions("UploadFileGO"),__name:"UploadFileGO",setup(s){const n=Y(),t=D(),r=e.computed(()=>ce(ze(n.props.uploadFile))),o=e.computed(()=>I.isFunction(t.props.getFileIcon)?t.props.getFileIcon(n.props.uploadFile):G[r.value].icon),c=e.computed(()=>G[r.value].fg),p=e.computed(()=>G[r.value].bg),m=()=>{var u,_,z,E;const g=(_=(u=t.slots).go)==null?void 0:_.call(u,{uploadFile:n.props.uploadFile});return v.isEmptyElement(g)?pe(n.props.uploadFile)?e.h("img",{class:k.getBemElement(b,"thumb"),alt:n.props.uploadFile.name??"",src:((z=n.props.uploadFile)==null?void 0:z.thumbUrl)??((E=n.props.uploadFile)==null?void 0:E.url)}):null:g},d=()=>{var u,_;const g=(_=(u=t.slots).goIcon)==null?void 0:_.call(u,{uploadFile:n.props.uploadFile});return v.isEmptyElement(g)?null:g},l=()=>e.h(we._sfc_main,{size:t.goSize.value,icon:o.value,fg:c.value,bg:p.value},{default:m,icon:d});return(g,u)=>(e.openBlock(),e.createBlock(l))}}),Ee=e.defineComponent({...P.getComponentOptions("UploadListItemCard"),__name:"UploadListItemCard",setup(s){const n=D(),t=Y(),r=()=>{var g,u;const d=(u=(g=n.slots).description)==null?void 0:u.call(g,{uploadFile:t.props.uploadFile});let l;if(v.isEmptyElement(d)||(l=d),t.props.uploadFile.description&&(l=t.props.uploadFile.description),l)return e.h("div",{class:k.getBemElement(b,"description")},l)},o=()=>{var l,g;const d=(g=(l=n.slots).title)==null?void 0:g.call(l,{uploadFile:t.props.uploadFile});return v.isEmptyElement(d)?t.label.value:d},c=()=>{var d;if(I.isFunction(n.props.onDownload))return n.props.onDownload(t.props.uploadFile);if((d=t.props.uploadFile)!=null&&d.url&&typeof window<"u")return window.open(t.props.uploadFile.url)},p=e.computed(()=>{var d,l;return(d=t.props.uploadFile)!=null&&d.percent&&((l=t.props.uploadFile)==null?void 0:l.status)!=="waiting"?`${(t.props.uploadFile.percent??0).toFixed(0)}%`:"waiting..."}),m=(d,l)=>{var u,_,z,E;const g=(_=(u=n.slots)==null?void 0:u.actions)==null?void 0:_.call(u,{...n,uploadFile:t.props.uploadFile,downloadFile:c});return v.isEmptyElement(g)?(E=(z=l.slots)==null?void 0:z.default)==null?void 0:E.call(z,{}):g};return(d,l)=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(n).props.go?(e.openBlock(),e.createBlock(Ie,{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(v._sfc_main$4,{key:0,message:"Failed",status:"error"})):e.unref(n).props.size!=="md"?(e.openBlock(),e.createBlock(r,{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:((g=e.unref(t).props.uploadFile)==null?void 0:g.percent)??0,label:e.unref(t).label.value,helperText:p.value},{label:e.withCtx(()=>[e.createVNode(o)]),_:1},8,["class","percent","label","helperText"])),e.createVNode(m,null,{default:e.withCtx(()=>{var u;return[e.unref(t).props.uploadFile.status==="done"?(e.openBlock(),e.createBlock(R._sfc_main,{key:0,icon:"tabler:download",size:"sm",type:"ghost",color:"neutral",onClick:c})):e.createCommentVNode("",!0),e.unref(n).props.pausableChunked&&e.unref(t).props.uploadFile.status==="uploading"&&((u=e.unref(t).props.uploadFile.chunks)!=null&&u.length)&&e.unref(I.isFunction)(e.unref(t).props.uploadFile.cancel)?(e.openBlock(),e.createBlock(R._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(n).canRunUpload(e.unref(t).props.uploadFile)?(e.openBlock(),e.createBlock(R._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:l[0]||(l[0]=_=>e.unref(n).resetRequest(e.unref(t).props.uploadFile))},null,8,["icon"])):e.createCommentVNode("",!0),e.createVNode(R._sfc_main,{icon:["done","error"].includes(e.unref(t).props.uploadFile.status)?"tabler:trash":"tabler:x",size:"sm",type:"ghost",color:"neutral",onClick:l[1]||(l[1]=_=>e.unref(n).remove(e.unref(t).props.uploadFile))},null,8,["icon"])]}),_:1})],64)}}}),[Y,Ue]=te.createContext("UploadItem"),Le=e.defineComponent({...P.getComponentOptions("UploadListItem"),__name:"UploadListItem",props:{uploadFile:{}},setup(s){const n=s,t=ne.cva(b,{variants:{size:k.generateVariantClassList(J,b),listType:k.generateVariantClassList(K,b),type:k.generateVariantClassList(ae,b),status:k.generateVariantClassList(le,b)}}),r=e.computed(()=>{var p,m,d;return((p=n.uploadFile)==null?void 0:p.name)??((d=(m=n.uploadFile)==null?void 0:m.originFileObj)==null?void 0:d.name)}),o=D();Ue({props:n,label:r});const c=()=>{var m,d;const p=(d=(m=o.slots).listItem)==null?void 0:d.call(m,{...o,uploadFile:n.uploadFile});return v.isEmptyElement(p)?o.props.listType==="card"?e.h(Ee):e.h(Fe):p};return(p,m)=>{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=p.uploadFile)==null?void 0:d.status}))},[e.createVNode(c)],2)}}}),Te=e.defineComponent({...P.getComponentOptions("UploadList"),__name:"UploadList",setup(s){const n=D(),t=ne.cva(j,{variants:{size:k.generateVariantClassList(J,j),listType:k.generateVariantClassList(K,j)}}),r=()=>{var c,p;const o=(p=(c=n.slots).list)==null?void 0:p.call(c,n);return v.isEmptyElement(o)?n.fileList.value.map(m=>e.h(Le,{uploadFile:m,key:m.uid})):o};return(o,c)=>{var p;return(p=e.unref(n).fileList.value)!=null&&p.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t)({size:e.unref(n).props.size,listType:e.unref(n).props.listType}))},[e.createVNode(r)],2)):e.createCommentVNode("",!0)}}}),Pe=s=>new Promise(n=>{s.file(t=>{s.fullPath&&!t.webkitRelativePath&&Object.defineProperty(t,"webkitRelativePath",{value:s.fullPath.replace(/^\//,""),writable:!1}),n(t)})}),Se=s=>{const n=s.createReader(),t=[];return new Promise(r=>{const o=()=>{n.readEntries(c=>{c.length===0?r(t):(t.push(...c),o())})};o()})},Re=async s=>{const n=[],t=async r=>{if(r.isFile){const o=await Pe(r);n.push(o)}else if(r.isDirectory){const o=await Se(r);await Promise.all(o.map(t))}};return await Promise.all(s.map(r=>{var c;const o=(c=r.webkitGetAsEntry)==null?void 0:c.call(r);if(o)return t(o)})),n},De=["accept","webkitdirectory","multiple","value"],de=e.defineComponent({...P.getComponentOptions("UploadTrigger"),__name:"UploadTrigger",props:{directory:{type:Boolean},multiple:{type:Boolean},disabled:{type:Boolean},accept:{}},emits:["addFiles"],setup(s,{emit:n}){const t=n,r=s,o=e.ref(),c=u=>{const{files:_}=u.target;t("addFiles",Array.prototype.slice.call(_)),p.value&&(p.value.value="")},p=e.ref(),m=()=>{var u;(u=p.value)==null||u.click()},d=u=>{u.key==="Enter"&&m()},l=async u=>{if(u.preventDefault(),u.type==="dragover")return;let _=[];u.dataTransfer&&(r.directory?_=await Re(Array.prototype.slice.call(u.dataTransfer.items)):_=Array.prototype.slice.call(u.dataTransfer.files)),r.multiple||(_=_.slice(0,1)),t("addFiles",_.filter(z=>re(z,r.accept)))},g=e.computed(()=>r.disabled?{}:{onClick:m,onKeydown:d,onDrop:l,onDragover:l,tabindex:"0"});return(u,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:"uploadTrigger w-fit inline"},g.value),[e.renderSlot(u.$slots,"default",e.normalizeProps(e.guardReactiveProps({...g.value,disabled:u.disabled}))),e.createElementVNode("input",{type:"file",accept:u.accept,webkitdirectory:u.directory,multiple:u.multiple,value:o.value,onChange:c,ref_key:"inputRef",ref:p,style:{display:"none"}},null,40,De)],16))}}),T=200;function Ve(s){return new Promise(n=>{if(!s.type||!W(X(s.type))){n("");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 r=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:c,height:p}=o;let m=T,d=T,l=0,g=0;c>p?(d=p*(T/c),g=-(d-m)/2):(m=c*(T/p),l=-(m-d)/2),r.drawImage(o,l,g,m,d);const u=t.toDataURL();document.body.removeChild(t),n(u)},o.crossOrigin="anonymous",s.type.startsWith("image/svg+xml")){const c=new FileReader;c.addEventListener("load",()=>{c.result&&(o.src=c.result)}),c.readAsDataURL(s)}else o.src=window.URL.createObjectURL(s)})}const Oe=e.defineComponent({...P.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:{},directory:{type:Boolean},multiple:{type:Boolean,default:!0},disabled:{type:Boolean},accept:{}},emits:["update:fileList","change","preview","createRequest","resetRequest","remove"],setup(s,{expose:n,emit:t}){const r=s,o=t,c=e.useSlots(),p=e.useAttrs(),m=k.getBemElement(H,"file"),d=i=>k.usePCId(i?k.getBemElement(m,"chunk"):m,!0),l=e.ref([]),g=e.computed(()=>r.listType!=="image"&&r.pausableChunked);let u=!1;e.watch(()=>r.fileList,i=>{var h,x;u=!0,l.value=(x=(h=i??[])==null?void 0:h.map)==null?void 0:x.call(h,C=>{if(C&&I.isObject(C))return Ce(C,{getUid:d,chunkFile:g.value,chunkSize:r.chunkSize})}).filter(Boolean),e.nextTick(()=>u=!1)},{immediate:!0,deep:!0}),e.watch(l,i=>{u||o("update:fileList",i??[])},{immediate:!0,deep:!0});const _=e.computed(()=>r.maxCount?Number(r.maxCount):0),z=i=>{if(i){const h=l.value.findIndex(x=>x.uid&&i.uid&&x.uid===i.uid);h===-1&&(!_.value||_.value>l.value.length)?l.value.push(i):h>-1&&l.value.splice(h,0,i),o("change",{file:v.cloneDeep(i),fileList:v.cloneDeep(l.value),event:"add"})}},E=e.computed(()=>r.accept??r.listType==="image"?"image/*":void 0),Z=i=>{I.isArray(i)&&i.filter(h=>!r.directory||re(h,E.value)).forEach(h=>{z(ie(h,{getUid:d,chunkFile:g.value,chunkSize:r.chunkSize}))})},q=e.computed(()=>{var i;return r.uploadOnSelect||r.listType==="image"?((i=l.value)==null?void 0:i.filter(h=>h.status==="waiting"&&h.originFileObj))??[]:[]}),N=e.computed(()=>{var i;return((i=l.value)==null?void 0:i.filter(h=>h.status==="uploading"&&(h==null?void 0:h.cancel)))??[]}),U=(i,h)=>{if(i&&h){const x=l.value.findIndex(C=>C.uid===i);x>-1&&(l.value[x]={...l.value[x],...h})}},$=async i=>{var h,x,C,Q;if(i.uid&&l.value){const F=l.value.find(S=>S.uid===i.uid);if(F&&I.isFunction(r.action)&&(!N.value.length||r.parallelUpload||g.value&&((h=F.chunks)!=null&&h.length)&&F.chunks.length>1&&F.status==="uploading"&&F.chunks.some(S=>S.status==="waiting"))){const S=new AbortController,ye=()=>{const y=()=>S.abort(),a=v.cloneDeep(F);if(g.value&&a.chunks&&a.chunks.length>1){const f=a.chunks.findIndex(B=>B.status==="waiting");f>-1&&(a.chunks[f]={...a.chunks[f],status:"uploading",cancel:y})}U(a.uid,{...a,status:"uploading",cancel:y})};let w={signal:S.signal,onUploadProgress(y){},uid:i.uid};if(g.value&&F.chunks&&F.chunks.length>1&&F.chunks.some(y=>y.status==="waiting")){const y=F.chunks.find(a=>a.status==="waiting");y!=null&&y.uid&&(w={...w,...v.pick(y,"chunk","chunkSiz","index"),chunk_uid:y.uid,onUploadProgress(a){var B,V,L,ee;const f=v.cloneDeep(l.value.find(O=>O.uid===i.uid));if(f){const O=(B=f.chunks)==null?void 0:B.findIndex(M=>M.uid===y.uid);O!==void 0&&((V=f.chunks)!=null&&V[O])&&(f.chunks[O].percent=Math.round(a.loaded*100/a.total)),(L=f.chunks)!=null&&L.length&&((ee=f.chunks)==null?void 0:ee.length)>1?f.percent=Math.min(Math.max(f.chunks.reduce((M,ke)=>M+(ke.percent??0),0)/(100*f.chunks.length),0),100):f.percent=Math.round(a.loaded*100/a.total),U(f.uid,f)}}})}else w={...w,file:F.originFileObj,onUploadProgress(y){const a=v.cloneDeep(l.value.find(f=>f.uid===i.uid));a&&U(a.uid,{percent:Math.round(y.loaded*100/y.total)})}};if(ye(),w.file||w.chunk){o("createRequest",i),o("change",{file:v.cloneDeep(i),fileList:v.cloneDeep(l.value),event:"upload"});try{let y=await r.action(w);try{typeof y=="string"&&(y=JSON.parse(y))}catch{}let a=v.cloneDeep(l.value.find(f=>f.uid===w.uid));if(a){let f=!1;if(w.chunk_uid&&((x=a.chunks)!=null&&x.length)&&a.chunks.length>1){const B=a.chunks.findIndex(L=>L.uid===w.chunk_uid);a.chunks[B]&&(a.chunks[B]={...a.chunks[B],cancel:void 0,status:"done",response:y??void 0});const V=a.chunks.every(L=>L.status==="done")?"done":"uploading";V==="done"?a={...a,cancel:void 0,status:V}:a.chunks.some(L=>L.status==="waiting")&&(f=!0)}else a={...a,cancel:void 0,status:"done",response:y??void 0};U(w.uid,a),f&&await $(a)}}catch(y){if(y.name==="CanceledError"){let a=v.cloneDeep(l.value.find(f=>f.uid===w.uid));if(a){if(w.chunk_uid&&((C=a.chunks)!=null&&C.length)&&a.chunks.length>1){const f=a.chunks.findIndex(B=>B.uid===w.chunk_uid);a.chunks[f]&&(a.chunks[f]={...a.chunks[f],cancel:void 0,status:"waiting"}),a={...a,cancel:void 0,status:"paused"},o("change",{file:v.cloneDeep(a),fileList:v.cloneDeep(l.value),event:"paused"})}else a={...a,cancel:void 0,status:"error"},o("change",{file:v.cloneDeep(a),fileList:v.cloneDeep(l.value),event:"cancel"});U(w.uid,a)}}else{let a=v.cloneDeep(l.value.find(f=>f.uid===w.uid));if(a){if(w.chunk_uid&&((Q=a.chunks)!=null&&Q.length)&&a.chunks.length>1){const f=a.chunks.findIndex(B=>B.uid===w.chunk_uid);a.chunks[f]&&(a.chunks[f]={...a.chunks[f],cancel:void 0,status:"waiting"})}a={...a,cancel:void 0,status:"error",error:y,percent:0},o("change",{file:v.cloneDeep(a),fileList:v.cloneDeep(l.value),event:"failed"}),U(w.uid,a)}}}}}}},fe=async i=>{if(i.uid&&l.value)return U(i.uid,{status:"waiting"}),o("resetRequest",i),$(i)},me=async i=>{if(i.uid&&l.value){const h=v.cloneDeep(l.value??[]),x=h.findIndex(C=>C.uid===i.uid);x>-1&&h[x]&&(h.splice(x,1),l.value=h,o("remove",i),o("change",{file:v.cloneDeep(i),fileList:v.cloneDeep(l.value),event:"remove"}))}},ge=i=>!!((r.parallelUpload||!N.value.length)&&(i.status==="paused"||i.status==="error"||(!r.uploadOnSelect||r.listType==="image")&&i.status==="waiting")),he=e.computed(()=>{switch(r.size){case"xlg":return"md";default:return"sm"}});e.watchEffect(()=>{(r.parallelUpload&&q.value.length||!N.value.length)&&q.value.forEach($),(l.value||[]).forEach((i,h)=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(i.originFileObj instanceof File||i.originFileObj instanceof Blob)||i.thumbUrl!==void 0||(i.thumbUrl="",Ve(i.originFileObj).then(x=>{const C=x||"";C!==i.thumbUrl&&U(i==null?void 0:i.uid,{thumbUrl:C})}))})});const ve=e.computed(()=>{switch(r.size){case"xlg":return"sm";case"lg":return"xsm";default:return"x2sm"}}),A={props:r,attrs:p,slots:c,emit:o,fileList:e.readonly(l),progressSize:ve,uploadableFiles:q,uploadingFiles:N,createRequest:$,resetRequest:fe,canRunUpload:ge,remove:me,goSize:he,addFiles:Z};return oe(A),n(A),(i,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.noTrigger?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de,{key:0,multiple:i.multiple,directory:i.directory,disabled:i.disabled,accept:E.value,onAddFiles:Z},{default:e.withCtx(x=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(x)))]),_:3},8,["multiple","directory","disabled","accept"])),e.renderSlot(i.$slots,"list",e.normalizeProps(e.guardReactiveProps(A)),()=>[e.createVNode(Te)])],64))}});exports.UploadListTypes=K;exports.UploadSizes=J;exports.UploadStatuses=le;exports.UploadTypes=ae;exports._sfc_main=Oe;exports._sfc_main$1=de;exports.injectUploadContext=D;exports.provideUploadContext=oe;exports.uploadListItemPrefix=b;exports.uploadListPrefix=j;exports.uploadPrefix=H;
|