@treeui/vue 0.1.1 → 0.2.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/README.md +91 -0
- package/dist/components/TreeAccordion.vue.d.ts +36 -0
- package/dist/components/TreeAccordion.vue.d.ts.map +1 -0
- package/dist/components/TreeAccordionItem.vue.d.ts +31 -0
- package/dist/components/TreeAccordionItem.vue.d.ts.map +1 -0
- package/dist/components/TreeAlert.vue.d.ts +35 -0
- package/dist/components/TreeAlert.vue.d.ts.map +1 -0
- package/dist/components/TreeAvatar.vue.d.ts +33 -0
- package/dist/components/TreeAvatar.vue.d.ts.map +1 -0
- package/dist/components/TreeBadge.vue.d.ts +27 -0
- package/dist/components/TreeBadge.vue.d.ts.map +1 -0
- package/dist/components/TreeBreadcrumb.vue.d.ts +26 -0
- package/dist/components/TreeBreadcrumb.vue.d.ts.map +1 -0
- package/dist/components/TreeBreadcrumbItem.vue.d.ts +32 -0
- package/dist/components/TreeBreadcrumbItem.vue.d.ts.map +1 -0
- package/dist/components/TreeButton.vue.d.ts +39 -0
- package/dist/components/TreeButton.vue.d.ts.map +1 -0
- package/dist/components/TreeCard.vue.d.ts +30 -0
- package/dist/components/TreeCard.vue.d.ts.map +1 -0
- package/dist/components/TreeCheckbox.vue.d.ts +40 -0
- package/dist/components/TreeCheckbox.vue.d.ts.map +1 -0
- package/dist/components/TreeContextMenu.vue.d.ts +59 -0
- package/dist/components/TreeContextMenu.vue.d.ts.map +1 -0
- package/dist/components/TreeDatePicker.vue.d.ts +63 -0
- package/dist/components/TreeDatePicker.vue.d.ts.map +1 -0
- package/dist/components/TreeDivider.vue.d.ts +12 -0
- package/dist/components/TreeDivider.vue.d.ts.map +1 -0
- package/dist/components/TreeDrawer.vue.d.ts +68 -0
- package/dist/components/TreeDrawer.vue.d.ts.map +1 -0
- package/dist/components/TreeDropdown.vue.d.ts +67 -0
- package/dist/components/TreeDropdown.vue.d.ts.map +1 -0
- package/dist/components/TreeFormField.vue.d.ts +44 -0
- package/dist/components/TreeFormField.vue.d.ts.map +1 -0
- package/dist/components/TreeInput.vue.d.ts +41 -0
- package/dist/components/TreeInput.vue.d.ts.map +1 -0
- package/dist/components/TreeMarkdownEditor.vue.d.ts +46 -0
- package/dist/components/TreeMarkdownEditor.vue.d.ts.map +1 -0
- package/dist/components/TreeModal.vue.d.ts +66 -0
- package/dist/components/TreeModal.vue.d.ts.map +1 -0
- package/dist/components/TreePagination.vue.d.ts +47 -0
- package/dist/components/TreePagination.vue.d.ts.map +1 -0
- package/dist/components/TreePopover.vue.d.ts +56 -0
- package/dist/components/TreePopover.vue.d.ts.map +1 -0
- package/dist/components/TreePricing.vue.d.ts +47 -0
- package/dist/components/TreePricing.vue.d.ts.map +1 -0
- package/dist/components/TreePricingCard.vue.d.ts +60 -0
- package/dist/components/TreePricingCard.vue.d.ts.map +1 -0
- package/dist/components/TreeProgress.vue.d.ts +19 -0
- package/dist/components/TreeProgress.vue.d.ts.map +1 -0
- package/dist/components/TreeRadio.vue.d.ts +29 -0
- package/dist/components/TreeRadio.vue.d.ts.map +1 -0
- package/dist/components/TreeRadioGroup.vue.d.ts +36 -0
- package/dist/components/TreeRadioGroup.vue.d.ts.map +1 -0
- package/dist/components/TreeSelect.vue.d.ts +59 -0
- package/dist/components/TreeSelect.vue.d.ts.map +1 -0
- package/dist/components/TreeSkeleton.vue.d.ts +27 -0
- package/dist/components/TreeSkeleton.vue.d.ts.map +1 -0
- package/dist/components/TreeSpinner.vue.d.ts +11 -0
- package/dist/components/TreeSpinner.vue.d.ts.map +1 -0
- package/dist/components/TreeSwitch.vue.d.ts +34 -0
- package/dist/components/TreeSwitch.vue.d.ts.map +1 -0
- package/dist/components/TreeTab.vue.d.ts +24 -0
- package/dist/components/TreeTab.vue.d.ts.map +1 -0
- package/dist/components/TreeTabList.vue.d.ts +22 -0
- package/dist/components/TreeTabList.vue.d.ts.map +1 -0
- package/dist/components/TreeTabPanel.vue.d.ts +21 -0
- package/dist/components/TreeTabPanel.vue.d.ts.map +1 -0
- package/dist/components/TreeTable.vue.d.ts +60 -0
- package/dist/components/TreeTable.vue.d.ts.map +1 -0
- package/dist/components/TreeTabs.vue.d.ts +37 -0
- package/dist/components/TreeTabs.vue.d.ts.map +1 -0
- package/dist/components/TreeTag.vue.d.ts +36 -0
- package/dist/components/TreeTag.vue.d.ts.map +1 -0
- package/dist/components/TreeTextarea.vue.d.ts +29 -0
- package/dist/components/TreeTextarea.vue.d.ts.map +1 -0
- package/dist/components/TreeToast.vue.d.ts +11 -0
- package/dist/components/TreeToast.vue.d.ts.map +1 -0
- package/dist/components/TreeToastProvider.vue.d.ts +11 -0
- package/dist/components/TreeToastProvider.vue.d.ts.map +1 -0
- package/dist/components/TreeTooltip.vue.d.ts +43 -0
- package/dist/components/TreeTooltip.vue.d.ts.map +1 -0
- package/dist/components/accordion.d.ts +17 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/index.d.ts +82 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/tabs-context.d.ts +18 -0
- package/dist/components/tabs-context.d.ts.map +1 -0
- package/dist/composables/useControllableOpen.d.ts +6 -0
- package/dist/composables/useControllableOpen.d.ts.map +1 -0
- package/dist/composables/useToast.d.ts +38 -0
- package/dist/composables/useToast.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3330 -549
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/contracts.d.ts +11 -0
- package/dist/types/contracts.d.ts.map +1 -0
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -1,59 +1,341 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { getTreeIcon as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as L, computed as i, reactive as Ue, provide as Xe, openBlock as s, createElementBlock as n, renderSlot as T, inject as Pe, useId as Je, ref as j, onMounted as Ot, onBeforeUnmount as he, normalizeClass as P, createElementVNode as c, unref as D, createTextVNode as ne, toDisplayString as N, createCommentVNode as S, normalizeStyle as Q, createBlock as _e, resolveDynamicComponent as zt, withCtx as de, createVNode as Y, useAttrs as se, watch as ce, mergeProps as J, toRef as ve, Teleport as Ee, Transition as $e, Fragment as re, renderList as ie, nextTick as Z, normalizeProps as Ae, guardReactiveProps as Se, useSlots as Ye, readonly as Kt, TransitionGroup as Ft } from "vue";
|
|
2
|
+
import { createId as be, isEscapeKey as pe, isActivationKey as ke, startOfDay as Le, parseDateValue as Ke, startOfMonth as we, startOfWeek as Me, addDays as Ce, toDateValue as Fe, isSameDay as He, addMonths as je, focusFirst as Oe, getFocusableElements as Pt, focusLast as Mt } from "@treeui/utils";
|
|
3
|
+
import { getTreeIcon as me, treeIconDefaults as De } from "@treeui/icons";
|
|
4
|
+
const Et = Symbol("tree-accordion"), Ht = { class: "tree-accordion" }, Qe = /* @__PURE__ */ L({
|
|
5
|
+
__name: "TreeAccordion",
|
|
6
|
+
props: {
|
|
7
|
+
type: { default: "single" },
|
|
8
|
+
modelValue: { default: void 0 },
|
|
9
|
+
defaultValue: { default: void 0 },
|
|
10
|
+
disabled: { type: Boolean, default: !1 },
|
|
11
|
+
collapsible: { type: Boolean, default: !1 }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(t, { emit: a }) {
|
|
15
|
+
const e = t, o = a, u = i(() => {
|
|
16
|
+
const $ = e.defaultValue;
|
|
17
|
+
return $ === void 0 ? [] : Array.isArray($) ? $ : [$];
|
|
18
|
+
}), d = Ue(new Set(u.value)), v = i(() => e.modelValue !== void 0), m = i(() => {
|
|
19
|
+
if (v.value) {
|
|
20
|
+
const $ = e.modelValue;
|
|
21
|
+
return new Set(Array.isArray($) ? $ : [$]);
|
|
22
|
+
}
|
|
23
|
+
return d;
|
|
24
|
+
});
|
|
25
|
+
function _($) {
|
|
26
|
+
return m.value.has($);
|
|
27
|
+
}
|
|
28
|
+
function p($) {
|
|
29
|
+
if (e.type === "single") {
|
|
30
|
+
const w = [...$];
|
|
31
|
+
o("update:modelValue", w.length > 0 ? w[0] : void 0);
|
|
32
|
+
} else
|
|
33
|
+
o("update:modelValue", [...$]);
|
|
34
|
+
}
|
|
35
|
+
function l($) {
|
|
36
|
+
const w = _($);
|
|
37
|
+
if (e.type === "single")
|
|
38
|
+
w ? e.collapsible && (v.value || d.delete($), p(/* @__PURE__ */ new Set())) : (v.value || (d.clear(), d.add($)), p(/* @__PURE__ */ new Set([$])));
|
|
39
|
+
else {
|
|
40
|
+
const E = new Set(m.value);
|
|
41
|
+
w ? E.delete($) : E.add($), v.value || (w ? d.delete($) : d.add($)), p(E);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const r = /* @__PURE__ */ new Map(), f = Ue([]);
|
|
45
|
+
function g($, w) {
|
|
46
|
+
r.has($) || f.push($), r.set($, w);
|
|
47
|
+
}
|
|
48
|
+
function A($) {
|
|
49
|
+
r.delete($);
|
|
50
|
+
const w = f.indexOf($);
|
|
51
|
+
w !== -1 && f.splice(w, 1);
|
|
52
|
+
}
|
|
53
|
+
function O() {
|
|
54
|
+
return f.filter(($) => {
|
|
55
|
+
const w = r.get($);
|
|
56
|
+
return w && !w.hasAttribute("disabled");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function V($) {
|
|
60
|
+
var z;
|
|
61
|
+
const w = O(), E = w.indexOf($), y = E > 0 ? E - 1 : w.length - 1;
|
|
62
|
+
(z = r.get(w[y])) == null || z.focus();
|
|
63
|
+
}
|
|
64
|
+
function F($) {
|
|
65
|
+
var z;
|
|
66
|
+
const w = O(), E = w.indexOf($), y = E < w.length - 1 ? E + 1 : 0;
|
|
67
|
+
(z = r.get(w[y])) == null || z.focus();
|
|
68
|
+
}
|
|
69
|
+
function M() {
|
|
70
|
+
var w;
|
|
71
|
+
const $ = O();
|
|
72
|
+
$.length && ((w = r.get($[0])) == null || w.focus());
|
|
73
|
+
}
|
|
74
|
+
function X() {
|
|
75
|
+
var w;
|
|
76
|
+
const $ = O();
|
|
77
|
+
$.length && ((w = r.get($[$.length - 1])) == null || w.focus());
|
|
78
|
+
}
|
|
79
|
+
return Xe(Et, {
|
|
80
|
+
type: e.type,
|
|
81
|
+
disabled: e.disabled,
|
|
82
|
+
collapsible: e.collapsible,
|
|
83
|
+
isItemOpen: _,
|
|
84
|
+
toggleItem: l,
|
|
85
|
+
registerTrigger: g,
|
|
86
|
+
unregisterTrigger: A,
|
|
87
|
+
focusPrev: V,
|
|
88
|
+
focusNext: F,
|
|
89
|
+
focusFirst: M,
|
|
90
|
+
focusLast: X
|
|
91
|
+
}), ($, w) => (s(), n("div", Ht, [
|
|
92
|
+
T($.$slots, "default")
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
}), jt = { class: "tree-accordion__heading" }, Ut = ["id", "aria-expanded", "aria-controls", "disabled"], Nt = ["id", "aria-labelledby"], qt = { class: "tree-accordion__panel" }, Ze = /* @__PURE__ */ L({
|
|
96
|
+
__name: "TreeAccordionItem",
|
|
97
|
+
props: {
|
|
98
|
+
value: {},
|
|
99
|
+
disabled: { type: Boolean, default: !1 }
|
|
100
|
+
},
|
|
101
|
+
setup(t) {
|
|
102
|
+
const a = t, e = Pe(Et);
|
|
103
|
+
if (!e)
|
|
104
|
+
throw new Error("[TreeUI] TAccordionItem must be used inside a TAccordion.");
|
|
105
|
+
const o = e, u = Je(), d = Je(), v = j(null), m = i(() => o.isItemOpen(a.value)), _ = i(() => a.disabled || o.disabled), p = i(() => [
|
|
106
|
+
"tree-accordion__item",
|
|
107
|
+
{
|
|
108
|
+
"is-open": m.value,
|
|
109
|
+
"is-disabled": _.value
|
|
110
|
+
}
|
|
111
|
+
]);
|
|
112
|
+
function l() {
|
|
113
|
+
_.value || o.toggleItem(a.value);
|
|
114
|
+
}
|
|
115
|
+
function r(f) {
|
|
116
|
+
if (!_.value)
|
|
117
|
+
switch (f.key) {
|
|
118
|
+
case "ArrowDown":
|
|
119
|
+
f.preventDefault(), o.focusNext(a.value);
|
|
120
|
+
break;
|
|
121
|
+
case "ArrowUp":
|
|
122
|
+
f.preventDefault(), o.focusPrev(a.value);
|
|
123
|
+
break;
|
|
124
|
+
case "Home":
|
|
125
|
+
f.preventDefault(), o.focusFirst();
|
|
126
|
+
break;
|
|
127
|
+
case "End":
|
|
128
|
+
f.preventDefault(), o.focusLast();
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return Ot(() => {
|
|
133
|
+
v.value && o.registerTrigger(a.value, v.value);
|
|
134
|
+
}), he(() => {
|
|
135
|
+
o.unregisterTrigger(a.value);
|
|
136
|
+
}), (f, g) => (s(), n("div", {
|
|
137
|
+
class: P(p.value)
|
|
138
|
+
}, [
|
|
139
|
+
c("h3", jt, [
|
|
140
|
+
c("button", {
|
|
141
|
+
id: D(u),
|
|
142
|
+
ref_key: "triggerRef",
|
|
143
|
+
ref: v,
|
|
144
|
+
type: "button",
|
|
145
|
+
class: "tree-accordion__trigger",
|
|
146
|
+
"aria-expanded": m.value,
|
|
147
|
+
"aria-controls": D(d),
|
|
148
|
+
disabled: _.value || void 0,
|
|
149
|
+
onClick: l,
|
|
150
|
+
onKeydown: r
|
|
151
|
+
}, [
|
|
152
|
+
T(f.$slots, "trigger", { open: m.value }, () => [
|
|
153
|
+
ne(N(t.value), 1)
|
|
154
|
+
]),
|
|
155
|
+
(s(), n("svg", {
|
|
156
|
+
class: P(["tree-accordion__icon", { "is-open": m.value }]),
|
|
157
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
158
|
+
width: "16",
|
|
159
|
+
height: "16",
|
|
160
|
+
viewBox: "0 0 24 24",
|
|
161
|
+
fill: "none",
|
|
162
|
+
stroke: "currentColor",
|
|
163
|
+
"stroke-width": "2",
|
|
164
|
+
"stroke-linecap": "round",
|
|
165
|
+
"stroke-linejoin": "round",
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
}, [...g[0] || (g[0] = [
|
|
168
|
+
c("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
169
|
+
])], 2))
|
|
170
|
+
], 40, Ut)
|
|
171
|
+
]),
|
|
172
|
+
m.value ? (s(), n("div", {
|
|
173
|
+
key: 0,
|
|
174
|
+
id: D(d),
|
|
175
|
+
role: "region",
|
|
176
|
+
"aria-labelledby": D(u),
|
|
177
|
+
class: "tree-accordion__content"
|
|
178
|
+
}, [
|
|
179
|
+
c("div", qt, [
|
|
180
|
+
T(f.$slots, "default")
|
|
181
|
+
])
|
|
182
|
+
], 8, Nt)) : S("", !0)
|
|
183
|
+
], 2));
|
|
184
|
+
}
|
|
185
|
+
}), Gt = {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "tree-alert__icon",
|
|
188
|
+
"aria-hidden": "true"
|
|
189
|
+
}, Wt = { class: "tree-alert__content" }, et = /* @__PURE__ */ L({
|
|
190
|
+
__name: "TreeAlert",
|
|
191
|
+
props: {
|
|
192
|
+
variant: { default: "info" },
|
|
193
|
+
size: { default: "md" },
|
|
194
|
+
dismissible: { type: Boolean, default: !1 }
|
|
195
|
+
},
|
|
196
|
+
emits: ["dismiss"],
|
|
197
|
+
setup(t, { emit: a }) {
|
|
198
|
+
const e = t, o = a, u = i(() => [
|
|
199
|
+
"tree-alert",
|
|
200
|
+
`tree-alert--${e.variant}`,
|
|
201
|
+
`tree-alert--${e.size}`
|
|
202
|
+
]);
|
|
203
|
+
function d() {
|
|
204
|
+
o("dismiss");
|
|
205
|
+
}
|
|
206
|
+
return (v, m) => (s(), n("div", {
|
|
207
|
+
class: P(u.value),
|
|
208
|
+
role: "alert"
|
|
209
|
+
}, [
|
|
210
|
+
v.$slots.icon ? (s(), n("span", Gt, [
|
|
211
|
+
T(v.$slots, "icon")
|
|
212
|
+
])) : S("", !0),
|
|
213
|
+
c("div", Wt, [
|
|
214
|
+
T(v.$slots, "default")
|
|
215
|
+
]),
|
|
216
|
+
t.dismissible ? (s(), n("button", {
|
|
217
|
+
key: 1,
|
|
218
|
+
type: "button",
|
|
219
|
+
class: "tree-alert__dismiss",
|
|
220
|
+
"aria-label": "Dismiss",
|
|
221
|
+
onClick: d
|
|
222
|
+
}, [
|
|
223
|
+
T(v.$slots, "dismiss-icon", {}, () => [
|
|
224
|
+
m[0] || (m[0] = c("svg", {
|
|
225
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
226
|
+
width: "16",
|
|
227
|
+
height: "16",
|
|
228
|
+
viewBox: "0 0 24 24",
|
|
229
|
+
fill: "none",
|
|
230
|
+
stroke: "currentColor",
|
|
231
|
+
"stroke-width": "2",
|
|
232
|
+
"stroke-linecap": "round",
|
|
233
|
+
"stroke-linejoin": "round",
|
|
234
|
+
"aria-hidden": "true"
|
|
235
|
+
}, [
|
|
236
|
+
c("path", { d: "M18 6 6 18" }),
|
|
237
|
+
c("path", { d: "m6 6 12 12" })
|
|
238
|
+
], -1))
|
|
239
|
+
])
|
|
240
|
+
])) : S("", !0)
|
|
241
|
+
], 2));
|
|
242
|
+
}
|
|
243
|
+
}), Xt = {
|
|
5
244
|
key: 0,
|
|
6
245
|
class: "tree-badge__icon",
|
|
7
246
|
"aria-hidden": "true"
|
|
8
|
-
},
|
|
247
|
+
}, Ne = /* @__PURE__ */ L({
|
|
9
248
|
__name: "TreeBadge",
|
|
10
249
|
props: {
|
|
11
250
|
variant: { default: "soft" },
|
|
12
251
|
size: { default: "md" }
|
|
13
252
|
},
|
|
14
253
|
setup(t) {
|
|
15
|
-
const
|
|
254
|
+
const a = t, e = i(() => [
|
|
16
255
|
"tree-badge",
|
|
17
|
-
`tree-badge--${
|
|
18
|
-
`tree-badge--${
|
|
256
|
+
`tree-badge--${a.variant}`,
|
|
257
|
+
`tree-badge--${a.size}`
|
|
19
258
|
]);
|
|
20
|
-
return (
|
|
21
|
-
class:
|
|
259
|
+
return (o, u) => (s(), n("span", {
|
|
260
|
+
class: P(e.value)
|
|
22
261
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
])) :
|
|
26
|
-
|
|
262
|
+
o.$slots.icon ? (s(), n("span", Xt, [
|
|
263
|
+
T(o.$slots, "icon")
|
|
264
|
+
])) : S("", !0),
|
|
265
|
+
T(o.$slots, "default")
|
|
27
266
|
], 2));
|
|
28
267
|
}
|
|
29
|
-
}),
|
|
268
|
+
}), Yt = {
|
|
269
|
+
"aria-label": "Breadcrumb",
|
|
270
|
+
class: "tree-breadcrumb"
|
|
271
|
+
}, tt = /* @__PURE__ */ L({
|
|
272
|
+
__name: "TreeBreadcrumb",
|
|
273
|
+
props: {
|
|
274
|
+
separator: { default: "/" }
|
|
275
|
+
},
|
|
276
|
+
setup(t) {
|
|
277
|
+
const a = t;
|
|
278
|
+
return (e, o) => (s(), n("nav", Yt, [
|
|
279
|
+
c("ol", {
|
|
280
|
+
class: "tree-breadcrumb__list",
|
|
281
|
+
style: Q({ "--tree-breadcrumb-separator": `'${a.separator}'` })
|
|
282
|
+
}, [
|
|
283
|
+
T(e.$slots, "default")
|
|
284
|
+
], 4)
|
|
285
|
+
]));
|
|
286
|
+
}
|
|
287
|
+
}), Jt = { class: "tree-breadcrumb__item" }, Qt = ["href"], Zt = {
|
|
288
|
+
key: 1,
|
|
289
|
+
class: "tree-breadcrumb__current",
|
|
290
|
+
"aria-current": "page"
|
|
291
|
+
}, at = /* @__PURE__ */ L({
|
|
292
|
+
__name: "TreeBreadcrumbItem",
|
|
293
|
+
props: {
|
|
294
|
+
href: { default: void 0 },
|
|
295
|
+
current: { type: Boolean, default: !1 }
|
|
296
|
+
},
|
|
297
|
+
setup(t) {
|
|
298
|
+
const a = t, e = i(() => a.current || !a.href);
|
|
299
|
+
return (o, u) => (s(), n("li", Jt, [
|
|
300
|
+
t.href && !e.value ? (s(), n("a", {
|
|
301
|
+
key: 0,
|
|
302
|
+
href: t.href,
|
|
303
|
+
class: "tree-breadcrumb__link"
|
|
304
|
+
}, [
|
|
305
|
+
T(o.$slots, "default")
|
|
306
|
+
], 8, Qt)) : (s(), n("span", Zt, [
|
|
307
|
+
T(o.$slots, "default")
|
|
308
|
+
]))
|
|
309
|
+
]));
|
|
310
|
+
}
|
|
311
|
+
}), ea = ["aria-label"], ta = { class: "tree-visually-hidden" }, Ve = /* @__PURE__ */ L({
|
|
30
312
|
__name: "TreeSpinner",
|
|
31
313
|
props: {
|
|
32
314
|
size: { default: "md" },
|
|
33
315
|
label: { default: "Loading" }
|
|
34
316
|
},
|
|
35
317
|
setup(t) {
|
|
36
|
-
const
|
|
37
|
-
return (
|
|
38
|
-
class:
|
|
318
|
+
const a = t, e = i(() => ["tree-spinner", `tree-spinner--${a.size}`]);
|
|
319
|
+
return (o, u) => (s(), n("span", {
|
|
320
|
+
class: P(e.value),
|
|
39
321
|
role: "status",
|
|
40
322
|
"aria-label": t.label
|
|
41
323
|
}, [
|
|
42
|
-
|
|
324
|
+
u[0] || (u[0] = c("span", {
|
|
43
325
|
class: "tree-spinner__ring",
|
|
44
326
|
"aria-hidden": "true"
|
|
45
327
|
}, null, -1)),
|
|
46
|
-
|
|
47
|
-
], 10,
|
|
328
|
+
c("span", ta, N(t.label), 1)
|
|
329
|
+
], 10, ea));
|
|
48
330
|
}
|
|
49
|
-
}),
|
|
331
|
+
}), aa = {
|
|
50
332
|
key: 0,
|
|
51
333
|
class: "tree-button__spinner"
|
|
52
|
-
},
|
|
334
|
+
}, sa = {
|
|
53
335
|
key: 1,
|
|
54
336
|
class: "tree-button__icon",
|
|
55
337
|
"aria-hidden": "true"
|
|
56
|
-
},
|
|
338
|
+
}, oa = { class: "tree-button__label" }, qe = /* @__PURE__ */ L({
|
|
57
339
|
__name: "TreeButton",
|
|
58
340
|
props: {
|
|
59
341
|
as: { default: "button" },
|
|
@@ -64,55 +346,55 @@ const Ye = {
|
|
|
64
346
|
type: { default: "button" }
|
|
65
347
|
},
|
|
66
348
|
emits: ["click"],
|
|
67
|
-
setup(t, { emit:
|
|
68
|
-
const
|
|
349
|
+
setup(t, { emit: a }) {
|
|
350
|
+
const e = t, o = a, u = i(() => e.as === "button"), d = i(() => e.disabled || e.loading), v = i(() => [
|
|
69
351
|
"tree-button",
|
|
70
|
-
`tree-button--${
|
|
71
|
-
`tree-button--${
|
|
352
|
+
`tree-button--${e.variant}`,
|
|
353
|
+
`tree-button--${e.size}`,
|
|
72
354
|
{
|
|
73
|
-
"is-loading":
|
|
74
|
-
"is-disabled":
|
|
355
|
+
"is-loading": e.loading,
|
|
356
|
+
"is-disabled": d.value
|
|
75
357
|
}
|
|
76
|
-
]),
|
|
77
|
-
if (
|
|
78
|
-
|
|
358
|
+
]), m = (_) => {
|
|
359
|
+
if (d.value) {
|
|
360
|
+
_.preventDefault(), _.stopPropagation();
|
|
79
361
|
return;
|
|
80
362
|
}
|
|
81
|
-
|
|
363
|
+
o("click", _);
|
|
82
364
|
};
|
|
83
|
-
return (
|
|
84
|
-
type:
|
|
85
|
-
class:
|
|
86
|
-
disabled:
|
|
87
|
-
"aria-disabled": !
|
|
365
|
+
return (_, p) => (s(), _e(zt(t.as), {
|
|
366
|
+
type: u.value ? t.type : void 0,
|
|
367
|
+
class: P(v.value),
|
|
368
|
+
disabled: u.value ? d.value : void 0,
|
|
369
|
+
"aria-disabled": !u.value && d.value ? "true" : void 0,
|
|
88
370
|
"aria-busy": t.loading || void 0,
|
|
89
|
-
tabindex: !
|
|
90
|
-
onClick:
|
|
371
|
+
tabindex: !u.value && d.value ? -1 : void 0,
|
|
372
|
+
onClick: m
|
|
91
373
|
}, {
|
|
92
|
-
default:
|
|
93
|
-
t.loading ? (
|
|
94
|
-
|
|
374
|
+
default: de(() => [
|
|
375
|
+
t.loading ? (s(), n("span", aa, [
|
|
376
|
+
Y(Ve, {
|
|
95
377
|
size: "sm",
|
|
96
378
|
label: "Loading"
|
|
97
379
|
})
|
|
98
|
-
])) :
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
])) :
|
|
102
|
-
|
|
103
|
-
|
|
380
|
+
])) : S("", !0),
|
|
381
|
+
_.$slots.icon ? (s(), n("span", sa, [
|
|
382
|
+
T(_.$slots, "icon")
|
|
383
|
+
])) : S("", !0),
|
|
384
|
+
c("span", oa, [
|
|
385
|
+
T(_.$slots, "default")
|
|
104
386
|
])
|
|
105
387
|
]),
|
|
106
388
|
_: 3
|
|
107
389
|
}, 8, ["type", "class", "disabled", "aria-disabled", "aria-busy", "tabindex"]));
|
|
108
390
|
}
|
|
109
|
-
}),
|
|
391
|
+
}), la = {
|
|
110
392
|
key: 0,
|
|
111
393
|
class: "tree-card__header"
|
|
112
|
-
},
|
|
394
|
+
}, na = { class: "tree-card__body" }, ra = {
|
|
113
395
|
key: 1,
|
|
114
396
|
class: "tree-card__footer"
|
|
115
|
-
},
|
|
397
|
+
}, st = /* @__PURE__ */ L({
|
|
116
398
|
__name: "TreeCard",
|
|
117
399
|
props: {
|
|
118
400
|
as: { default: "section" },
|
|
@@ -120,43 +402,273 @@ const Ye = {
|
|
|
120
402
|
size: { default: "md" }
|
|
121
403
|
},
|
|
122
404
|
setup(t) {
|
|
123
|
-
const
|
|
405
|
+
const a = t, e = i(() => [
|
|
124
406
|
"tree-card",
|
|
125
|
-
`tree-card--${
|
|
126
|
-
`tree-card--${
|
|
407
|
+
`tree-card--${a.variant}`,
|
|
408
|
+
`tree-card--${a.size}`
|
|
127
409
|
]);
|
|
128
|
-
return (
|
|
129
|
-
class:
|
|
410
|
+
return (o, u) => (s(), _e(zt(t.as), {
|
|
411
|
+
class: P(e.value)
|
|
130
412
|
}, {
|
|
131
|
-
default:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
])) :
|
|
135
|
-
|
|
136
|
-
|
|
413
|
+
default: de(() => [
|
|
414
|
+
o.$slots.header ? (s(), n("header", la, [
|
|
415
|
+
T(o.$slots, "header")
|
|
416
|
+
])) : S("", !0),
|
|
417
|
+
c("div", na, [
|
|
418
|
+
T(o.$slots, "default")
|
|
137
419
|
]),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
])) :
|
|
420
|
+
o.$slots.footer ? (s(), n("footer", ra, [
|
|
421
|
+
T(o.$slots, "footer")
|
|
422
|
+
])) : S("", !0)
|
|
141
423
|
]),
|
|
142
424
|
_: 3
|
|
143
425
|
}, 8, ["class"]));
|
|
144
426
|
}
|
|
145
|
-
}),
|
|
146
|
-
|
|
427
|
+
}), ia = ["checked", "disabled", "aria-checked", "aria-invalid"], da = {
|
|
428
|
+
class: "tree-checkbox__control",
|
|
429
|
+
"aria-hidden": "true"
|
|
430
|
+
}, ca = {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: "tree-checkbox__icon",
|
|
433
|
+
viewBox: "0 0 16 16",
|
|
434
|
+
fill: "none",
|
|
435
|
+
stroke: "currentColor",
|
|
436
|
+
"stroke-width": "2",
|
|
437
|
+
"stroke-linecap": "round",
|
|
438
|
+
"stroke-linejoin": "round"
|
|
439
|
+
}, ua = {
|
|
440
|
+
key: 1,
|
|
441
|
+
class: "tree-checkbox__icon",
|
|
442
|
+
viewBox: "0 0 16 16",
|
|
443
|
+
fill: "none",
|
|
444
|
+
stroke: "currentColor",
|
|
445
|
+
"stroke-width": "2",
|
|
446
|
+
"stroke-linecap": "round"
|
|
447
|
+
}, fa = {
|
|
448
|
+
key: 0,
|
|
449
|
+
class: "tree-checkbox__label"
|
|
450
|
+
}, ot = /* @__PURE__ */ L({
|
|
451
|
+
inheritAttrs: !1,
|
|
452
|
+
__name: "TreeCheckbox",
|
|
453
|
+
props: {
|
|
454
|
+
modelValue: { type: Boolean, default: !1 },
|
|
455
|
+
size: { default: "md" },
|
|
456
|
+
disabled: { type: Boolean, default: !1 },
|
|
457
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
458
|
+
invalid: { type: Boolean, default: !1 }
|
|
459
|
+
},
|
|
460
|
+
emits: ["update:modelValue"],
|
|
461
|
+
setup(t, { emit: a }) {
|
|
462
|
+
const e = t, o = a, u = se(), d = j(null);
|
|
463
|
+
ce(
|
|
464
|
+
() => e.indeterminate,
|
|
465
|
+
(l) => {
|
|
466
|
+
d.value && (d.value.indeterminate = l);
|
|
467
|
+
}
|
|
468
|
+
), ce(d, (l) => {
|
|
469
|
+
l && (l.indeterminate = e.indeterminate);
|
|
470
|
+
});
|
|
471
|
+
const v = i(() => [
|
|
472
|
+
"tree-checkbox",
|
|
473
|
+
`tree-checkbox--${e.size}`,
|
|
474
|
+
{
|
|
475
|
+
"is-checked": e.modelValue,
|
|
476
|
+
"is-indeterminate": e.indeterminate,
|
|
477
|
+
"is-disabled": e.disabled,
|
|
478
|
+
"is-invalid": e.invalid
|
|
479
|
+
},
|
|
480
|
+
u.class
|
|
481
|
+
]), m = i(() => u.style), _ = i(() => {
|
|
482
|
+
const { class: l, style: r, ...f } = u;
|
|
483
|
+
return f;
|
|
484
|
+
}), p = () => {
|
|
485
|
+
o("update:modelValue", !e.modelValue);
|
|
486
|
+
};
|
|
487
|
+
return (l, r) => (s(), n("label", {
|
|
488
|
+
class: P(v.value),
|
|
489
|
+
style: Q(m.value)
|
|
490
|
+
}, [
|
|
491
|
+
c("input", J({
|
|
492
|
+
ref_key: "inputRef",
|
|
493
|
+
ref: d
|
|
494
|
+
}, _.value, {
|
|
495
|
+
type: "checkbox",
|
|
496
|
+
class: "tree-checkbox__input",
|
|
497
|
+
checked: t.modelValue,
|
|
498
|
+
disabled: t.disabled,
|
|
499
|
+
"aria-checked": t.indeterminate ? "mixed" : t.modelValue,
|
|
500
|
+
"aria-invalid": t.invalid || void 0,
|
|
501
|
+
onChange: p
|
|
502
|
+
}), null, 16, ia),
|
|
503
|
+
c("span", da, [
|
|
504
|
+
t.modelValue && !t.indeterminate ? (s(), n("svg", ca, [...r[0] || (r[0] = [
|
|
505
|
+
c("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" }, null, -1)
|
|
506
|
+
])])) : t.indeterminate ? (s(), n("svg", ua, [...r[1] || (r[1] = [
|
|
507
|
+
c("line", {
|
|
508
|
+
x1: "4",
|
|
509
|
+
y1: "8",
|
|
510
|
+
x2: "12",
|
|
511
|
+
y2: "8"
|
|
512
|
+
}, null, -1)
|
|
513
|
+
])])) : S("", !0)
|
|
514
|
+
]),
|
|
515
|
+
l.$slots.default ? (s(), n("span", fa, [
|
|
516
|
+
T(l.$slots, "default")
|
|
517
|
+
])) : S("", !0)
|
|
518
|
+
], 6));
|
|
519
|
+
}
|
|
520
|
+
}), Te = (t, a, e) => {
|
|
521
|
+
const o = j(a), u = i(() => t.value ?? o.value);
|
|
147
522
|
return {
|
|
148
|
-
value:
|
|
149
|
-
setValue: (
|
|
150
|
-
|
|
523
|
+
value: u,
|
|
524
|
+
setValue: (v) => {
|
|
525
|
+
v !== u.value && (t.value === void 0 && (o.value = v), e(v));
|
|
151
526
|
}
|
|
152
527
|
};
|
|
153
|
-
},
|
|
528
|
+
}, va = ["data-state"], pa = ["id"], ba = ["aria-disabled", "tabindex", "onClick", "onKeydown"], lt = /* @__PURE__ */ L({
|
|
529
|
+
__name: "TreeContextMenu",
|
|
530
|
+
props: {
|
|
531
|
+
items: { default: () => [] },
|
|
532
|
+
open: { type: Boolean, default: void 0 },
|
|
533
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
534
|
+
disabled: { type: Boolean, default: !1 },
|
|
535
|
+
size: { default: "md" }
|
|
536
|
+
},
|
|
537
|
+
emits: ["select", "update:open", "open-change"],
|
|
538
|
+
setup(t, { emit: a }) {
|
|
539
|
+
const e = t, o = a, u = be("tree-context-menu"), d = j(null), v = j(/* @__PURE__ */ new Map()), m = j(-1), _ = j({ x: 0, y: 0 }), { value: p, setValue: l } = Te(
|
|
540
|
+
ve(e, "open"),
|
|
541
|
+
e.defaultOpen,
|
|
542
|
+
(y) => {
|
|
543
|
+
o("update:open", y), o("open-change", y);
|
|
544
|
+
}
|
|
545
|
+
), r = i(() => [
|
|
546
|
+
"tree-context-menu",
|
|
547
|
+
`tree-context-menu--${e.size}`,
|
|
548
|
+
{
|
|
549
|
+
"is-disabled": e.disabled,
|
|
550
|
+
"is-open": p.value
|
|
551
|
+
}
|
|
552
|
+
]), f = i(() => e.items.filter((y) => !y.disabled)), g = (y, z) => {
|
|
553
|
+
e.disabled || (_.value = { x: y, y: z }, m.value = f.value.length > 0 ? e.items.indexOf(f.value[0]) : 0, l(!0), Z(() => V(m.value)));
|
|
554
|
+
}, A = (y = !1) => {
|
|
555
|
+
l(!1), m.value = -1, y && Z(() => {
|
|
556
|
+
var z;
|
|
557
|
+
return (z = d.value) == null ? void 0 : z.focus();
|
|
558
|
+
});
|
|
559
|
+
}, O = (y) => {
|
|
560
|
+
y.disabled || (o("select", y.value), A(!0));
|
|
561
|
+
}, V = (y) => {
|
|
562
|
+
const z = e.items[y];
|
|
563
|
+
if (!z) return;
|
|
564
|
+
const H = v.value.get(z.value);
|
|
565
|
+
H == null || H.focus();
|
|
566
|
+
}, F = (y, z) => {
|
|
567
|
+
y instanceof HTMLElement ? v.value.set(z, y) : v.value.delete(z);
|
|
568
|
+
}, M = (y) => {
|
|
569
|
+
let z = m.value + y;
|
|
570
|
+
for (; z >= 0 && z < e.items.length; ) {
|
|
571
|
+
if (!e.items[z].disabled) {
|
|
572
|
+
m.value = z, V(z);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
z += y;
|
|
576
|
+
}
|
|
577
|
+
}, X = (y) => {
|
|
578
|
+
e.disabled || (y.preventDefault(), g(y.clientX, y.clientY));
|
|
579
|
+
}, $ = (y, z) => {
|
|
580
|
+
if (pe(y)) {
|
|
581
|
+
y.preventDefault(), A(!0);
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (ke(y)) {
|
|
585
|
+
y.preventDefault(), O(z);
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
switch (y.key) {
|
|
589
|
+
case "ArrowDown":
|
|
590
|
+
y.preventDefault(), M(1);
|
|
591
|
+
break;
|
|
592
|
+
case "ArrowUp":
|
|
593
|
+
y.preventDefault(), M(-1);
|
|
594
|
+
break;
|
|
595
|
+
case "Home":
|
|
596
|
+
y.preventDefault(), m.value = f.value.length > 0 ? e.items.indexOf(f.value[0]) : 0, V(m.value);
|
|
597
|
+
break;
|
|
598
|
+
case "End":
|
|
599
|
+
y.preventDefault(), m.value = f.value.length > 0 ? e.items.indexOf(f.value[f.value.length - 1]) : e.items.length - 1, V(m.value);
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
}, w = (y) => {
|
|
603
|
+
if (!p.value) return;
|
|
604
|
+
const z = y.target;
|
|
605
|
+
if (!(z instanceof Node)) return;
|
|
606
|
+
const H = document.getElementById(u);
|
|
607
|
+
H != null && H.contains(z) || A();
|
|
608
|
+
}, E = (y) => {
|
|
609
|
+
var H;
|
|
610
|
+
if (!p.value) return;
|
|
611
|
+
const z = y.target;
|
|
612
|
+
z instanceof Node && ((H = d.value) != null && H.contains(z) || A());
|
|
613
|
+
};
|
|
614
|
+
return ce(p, (y) => {
|
|
615
|
+
y ? (document.addEventListener("pointerdown", w), document.addEventListener("contextmenu", E)) : (document.removeEventListener("pointerdown", w), document.removeEventListener("contextmenu", E));
|
|
616
|
+
}), he(() => {
|
|
617
|
+
document.removeEventListener("pointerdown", w), document.removeEventListener("contextmenu", E);
|
|
618
|
+
}), (y, z) => (s(), n("div", {
|
|
619
|
+
ref_key: "rootRef",
|
|
620
|
+
ref: d,
|
|
621
|
+
class: P(r.value),
|
|
622
|
+
"data-state": D(p) ? "open" : "closed",
|
|
623
|
+
onContextmenu: X
|
|
624
|
+
}, [
|
|
625
|
+
T(y.$slots, "default"),
|
|
626
|
+
(s(), _e(Ee, { to: "body" }, [
|
|
627
|
+
Y($e, { name: "tree-fade" }, {
|
|
628
|
+
default: de(() => [
|
|
629
|
+
D(p) && !t.disabled ? (s(), n("ul", {
|
|
630
|
+
key: 0,
|
|
631
|
+
id: D(u),
|
|
632
|
+
role: "menu",
|
|
633
|
+
class: P(["tree-context-menu__menu", `tree-context-menu--${t.size}`]),
|
|
634
|
+
style: Q({ top: `${_.value.y}px`, left: `${_.value.x}px` }),
|
|
635
|
+
"aria-label": "Context menu"
|
|
636
|
+
}, [
|
|
637
|
+
(s(!0), n(re, null, ie(t.items, (H, x) => (s(), n("li", {
|
|
638
|
+
key: H.value,
|
|
639
|
+
ref_for: !0,
|
|
640
|
+
ref: (h) => F(h, H.value),
|
|
641
|
+
role: "menuitem",
|
|
642
|
+
class: P(["tree-context-menu__item", {
|
|
643
|
+
"is-disabled": H.disabled,
|
|
644
|
+
"is-focused": x === m.value
|
|
645
|
+
}]),
|
|
646
|
+
"aria-disabled": H.disabled || void 0,
|
|
647
|
+
tabindex: H.disabled ? -1 : 0,
|
|
648
|
+
onClick: (h) => O(H),
|
|
649
|
+
onKeydown: (h) => $(h, H)
|
|
650
|
+
}, [
|
|
651
|
+
T(y.$slots, "item", {
|
|
652
|
+
item: H,
|
|
653
|
+
index: x
|
|
654
|
+
}, () => [
|
|
655
|
+
ne(N(H.label), 1)
|
|
656
|
+
])
|
|
657
|
+
], 42, ba))), 128))
|
|
658
|
+
], 14, pa)) : S("", !0)
|
|
659
|
+
]),
|
|
660
|
+
_: 3
|
|
661
|
+
})
|
|
662
|
+
]))
|
|
663
|
+
], 42, va));
|
|
664
|
+
}
|
|
665
|
+
}), ma = ["data-state"], _a = ["name", "value"], ha = ["disabled", "aria-controls", "aria-expanded", "aria-invalid"], ya = {
|
|
154
666
|
key: 0,
|
|
155
667
|
class: "tree-date-picker__slot tree-date-picker__slot--prefix"
|
|
156
|
-
},
|
|
668
|
+
}, ga = ["data-placeholder"], ka = { class: "tree-date-picker__slot tree-date-picker__slot--suffix" }, $a = ["id"], Ta = { class: "tree-date-picker__header" }, wa = ["disabled"], Ca = ["disabled"], Da = {
|
|
157
669
|
class: "tree-date-picker__weekdays",
|
|
158
670
|
"aria-hidden": "true"
|
|
159
|
-
},
|
|
671
|
+
}, Ba = ["aria-selected"], xa = ["data-date", "disabled", "tabindex", "aria-current", "aria-label", "onClick", "onKeydown"], nt = /* @__PURE__ */ L({
|
|
160
672
|
inheritAttrs: !1,
|
|
161
673
|
__name: "TreeDatePicker",
|
|
162
674
|
props: {
|
|
@@ -174,651 +686,2920 @@ const Ye = {
|
|
|
174
686
|
id: { default: void 0 }
|
|
175
687
|
},
|
|
176
688
|
emits: ["update:modelValue", "update:open", "open-change", "select"],
|
|
177
|
-
setup(t, { emit:
|
|
178
|
-
const
|
|
179
|
-
const { class:
|
|
180
|
-
return
|
|
181
|
-
}),
|
|
182
|
-
() => typeof
|
|
183
|
-
),
|
|
689
|
+
setup(t, { emit: a }) {
|
|
690
|
+
const e = me("calendar"), o = me("chevron-left"), u = me("chevron-right"), d = t, v = a, m = se(), _ = Le(/* @__PURE__ */ new Date()), p = i(() => Ke(d.modelValue)), l = i(() => Ke(d.min)), r = i(() => Ke(d.max)), f = d.id ?? be("tree-date-picker"), g = `${f}-caption`, A = j(null), O = j(null), V = /* @__PURE__ */ new Map(), F = j(we(p.value ?? _)), M = j(p.value ?? _), X = i(() => {
|
|
691
|
+
const { class: B, style: U, name: ee, ...xe } = m;
|
|
692
|
+
return xe;
|
|
693
|
+
}), $ = i(
|
|
694
|
+
() => typeof m.name == "string" ? m.name : void 0
|
|
695
|
+
), w = i(() => [
|
|
184
696
|
"tree-date-picker",
|
|
185
|
-
`tree-date-picker--${
|
|
697
|
+
`tree-date-picker--${d.size}`,
|
|
186
698
|
{
|
|
187
|
-
"is-disabled":
|
|
188
|
-
"is-invalid":
|
|
189
|
-
"is-open":
|
|
699
|
+
"is-disabled": d.disabled,
|
|
700
|
+
"is-invalid": d.invalid,
|
|
701
|
+
"is-open": y.value
|
|
190
702
|
},
|
|
191
|
-
|
|
192
|
-
]),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
),
|
|
703
|
+
m.class
|
|
704
|
+
]), E = i(() => m.style), { value: y, setValue: z } = Te(
|
|
705
|
+
ve(d, "open"),
|
|
706
|
+
d.defaultOpen,
|
|
707
|
+
(B) => {
|
|
708
|
+
v("update:open", B), v("open-change", B);
|
|
709
|
+
}
|
|
710
|
+
), H = i(() => p.value ? new Intl.DateTimeFormat(d.locale, {
|
|
199
711
|
day: "numeric",
|
|
200
712
|
month: "long",
|
|
201
713
|
year: "numeric"
|
|
202
|
-
}).format(
|
|
203
|
-
() => new Intl.DateTimeFormat(
|
|
714
|
+
}).format(p.value) : d.placeholder), x = i(
|
|
715
|
+
() => new Intl.DateTimeFormat(d.locale, {
|
|
204
716
|
month: "long",
|
|
205
717
|
year: "numeric"
|
|
206
|
-
}).format(
|
|
207
|
-
),
|
|
208
|
-
const
|
|
718
|
+
}).format(F.value)
|
|
719
|
+
), h = i(() => {
|
|
720
|
+
const B = new Intl.DateTimeFormat(d.locale, { weekday: "short" }), U = Me(new Date(2024, 0, 7), d.weekStartsOn);
|
|
209
721
|
return Array.from(
|
|
210
722
|
{ length: 7 },
|
|
211
|
-
(
|
|
723
|
+
(ee, xe) => B.format(Ce(U, xe))
|
|
212
724
|
);
|
|
213
|
-
}),
|
|
214
|
-
|
|
725
|
+
}), C = (B) => !!(d.disabled || l.value && B < l.value || r.value && B > r.value), K = (B) => {
|
|
726
|
+
M.value = Le(B), F.value = we(B);
|
|
215
727
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
(
|
|
219
|
-
if (
|
|
220
|
-
|
|
728
|
+
ce(
|
|
729
|
+
p,
|
|
730
|
+
(B) => {
|
|
731
|
+
if (B) {
|
|
732
|
+
K(B);
|
|
221
733
|
return;
|
|
222
734
|
}
|
|
223
|
-
|
|
735
|
+
y.value || K(_);
|
|
224
736
|
},
|
|
225
737
|
{ immediate: !0 }
|
|
226
738
|
);
|
|
227
|
-
const
|
|
228
|
-
const
|
|
739
|
+
const ae = i(() => {
|
|
740
|
+
const B = Me(we(F.value), d.weekStartsOn);
|
|
229
741
|
return Array.from(
|
|
230
742
|
{ length: 6 },
|
|
231
|
-
(
|
|
232
|
-
const
|
|
743
|
+
(U, ee) => Array.from({ length: 7 }, (xe, te) => {
|
|
744
|
+
const le = Ce(B, ee * 7 + te), Lt = Fe(le);
|
|
233
745
|
return {
|
|
234
|
-
date:
|
|
235
|
-
dayLabel:
|
|
236
|
-
disabled:
|
|
237
|
-
inMonth:
|
|
238
|
-
isFocused:
|
|
239
|
-
isSelected:
|
|
240
|
-
isToday:
|
|
241
|
-
key:
|
|
746
|
+
date: le,
|
|
747
|
+
dayLabel: le.getDate(),
|
|
748
|
+
disabled: C(le),
|
|
749
|
+
inMonth: le.getMonth() === F.value.getMonth(),
|
|
750
|
+
isFocused: He(le, M.value),
|
|
751
|
+
isSelected: He(le, p.value),
|
|
752
|
+
isToday: He(le, _),
|
|
753
|
+
key: Lt
|
|
242
754
|
};
|
|
243
755
|
})
|
|
244
756
|
);
|
|
245
|
-
}),
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
var
|
|
249
|
-
(
|
|
757
|
+
}), ue = i(() => l.value ? we(F.value) > we(l.value) : !0), I = i(() => r.value ? we(F.value) < we(r.value) : !0), b = () => {
|
|
758
|
+
const B = Fe(M.value);
|
|
759
|
+
Z(() => {
|
|
760
|
+
var U;
|
|
761
|
+
(U = V.get(B)) == null || U.focus();
|
|
250
762
|
});
|
|
251
|
-
},
|
|
252
|
-
if (
|
|
253
|
-
|
|
763
|
+
}, k = (B, U) => {
|
|
764
|
+
if (B instanceof HTMLButtonElement) {
|
|
765
|
+
V.set(U, B);
|
|
254
766
|
return;
|
|
255
767
|
}
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
var
|
|
262
|
-
(
|
|
768
|
+
V.delete(U);
|
|
769
|
+
}, R = () => {
|
|
770
|
+
d.disabled || (K(p.value ?? M.value ?? _), z(!0), b());
|
|
771
|
+
}, q = (B = !1) => {
|
|
772
|
+
z(!1), B && Z(() => {
|
|
773
|
+
var U;
|
|
774
|
+
(U = O.value) == null || U.focus();
|
|
263
775
|
});
|
|
264
|
-
},
|
|
265
|
-
if (
|
|
266
|
-
|
|
776
|
+
}, W = () => {
|
|
777
|
+
if (y.value) {
|
|
778
|
+
q();
|
|
267
779
|
return;
|
|
268
780
|
}
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
if (
|
|
781
|
+
R();
|
|
782
|
+
}, oe = (B) => {
|
|
783
|
+
const U = je(F.value, B);
|
|
784
|
+
K(U), b();
|
|
785
|
+
}, G = (B) => {
|
|
786
|
+
C(B) || (K(B), b());
|
|
787
|
+
}, ye = (B) => {
|
|
788
|
+
if (C(B))
|
|
277
789
|
return;
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
if (!
|
|
282
|
-
if (
|
|
283
|
-
|
|
790
|
+
const U = Le(B), ee = Fe(U);
|
|
791
|
+
K(U), v("update:modelValue", ee), v("select", ee), q(!0);
|
|
792
|
+
}, Be = (B) => {
|
|
793
|
+
if (!d.disabled) {
|
|
794
|
+
if (pe(B) && y.value) {
|
|
795
|
+
B.preventDefault(), q();
|
|
284
796
|
return;
|
|
285
797
|
}
|
|
286
|
-
(
|
|
798
|
+
(ke(B) || B.key === "ArrowDown" || B.key === "ArrowUp") && (B.preventDefault(), R());
|
|
287
799
|
}
|
|
288
|
-
},
|
|
289
|
-
if (
|
|
290
|
-
|
|
800
|
+
}, ge = (B, U) => {
|
|
801
|
+
if (pe(B)) {
|
|
802
|
+
B.preventDefault(), q(!0);
|
|
291
803
|
return;
|
|
292
804
|
}
|
|
293
|
-
if (
|
|
294
|
-
|
|
805
|
+
if (ke(B)) {
|
|
806
|
+
B.preventDefault(), ye(U);
|
|
295
807
|
return;
|
|
296
808
|
}
|
|
297
|
-
switch (
|
|
809
|
+
switch (B.key) {
|
|
298
810
|
case "ArrowLeft":
|
|
299
|
-
|
|
811
|
+
B.preventDefault(), G(Ce(U, -1));
|
|
300
812
|
break;
|
|
301
813
|
case "ArrowRight":
|
|
302
|
-
|
|
814
|
+
B.preventDefault(), G(Ce(U, 1));
|
|
303
815
|
break;
|
|
304
816
|
case "ArrowUp":
|
|
305
|
-
|
|
817
|
+
B.preventDefault(), G(Ce(U, -7));
|
|
306
818
|
break;
|
|
307
819
|
case "ArrowDown":
|
|
308
|
-
|
|
820
|
+
B.preventDefault(), G(Ce(U, 7));
|
|
309
821
|
break;
|
|
310
822
|
case "Home":
|
|
311
|
-
|
|
823
|
+
B.preventDefault(), G(Me(U, d.weekStartsOn));
|
|
312
824
|
break;
|
|
313
825
|
case "End":
|
|
314
|
-
|
|
826
|
+
B.preventDefault(), G(Ce(Me(U, d.weekStartsOn), 6));
|
|
315
827
|
break;
|
|
316
828
|
case "PageUp":
|
|
317
|
-
|
|
829
|
+
B.preventDefault(), G(je(U, B.shiftKey ? -12 : -1));
|
|
318
830
|
break;
|
|
319
831
|
case "PageDown":
|
|
320
|
-
|
|
832
|
+
B.preventDefault(), G(je(U, B.shiftKey ? 12 : 1));
|
|
321
833
|
break;
|
|
322
834
|
}
|
|
323
|
-
},
|
|
324
|
-
var
|
|
325
|
-
if (!
|
|
835
|
+
}, fe = (B) => {
|
|
836
|
+
var ee;
|
|
837
|
+
if (!y.value)
|
|
326
838
|
return;
|
|
327
|
-
const
|
|
328
|
-
|
|
839
|
+
const U = B.target;
|
|
840
|
+
U instanceof Node && ((ee = A.value) != null && ee.contains(U) || q());
|
|
329
841
|
};
|
|
330
|
-
return
|
|
331
|
-
if (
|
|
332
|
-
document.addEventListener("pointerdown",
|
|
842
|
+
return ce(y, (B) => {
|
|
843
|
+
if (B) {
|
|
844
|
+
document.addEventListener("pointerdown", fe);
|
|
333
845
|
return;
|
|
334
846
|
}
|
|
335
|
-
document.removeEventListener("pointerdown",
|
|
336
|
-
}),
|
|
337
|
-
document.removeEventListener("pointerdown",
|
|
338
|
-
}), (
|
|
847
|
+
document.removeEventListener("pointerdown", fe);
|
|
848
|
+
}), he(() => {
|
|
849
|
+
document.removeEventListener("pointerdown", fe);
|
|
850
|
+
}), (B, U) => (s(), n("div", {
|
|
339
851
|
ref_key: "rootRef",
|
|
340
|
-
ref:
|
|
341
|
-
class:
|
|
342
|
-
style:
|
|
343
|
-
"data-state":
|
|
852
|
+
ref: A,
|
|
853
|
+
class: P(w.value),
|
|
854
|
+
style: Q(E.value),
|
|
855
|
+
"data-state": D(y) ? "open" : "closed"
|
|
344
856
|
}, [
|
|
345
|
-
|
|
857
|
+
$.value ? (s(), n("input", {
|
|
346
858
|
key: 0,
|
|
347
859
|
type: "hidden",
|
|
348
|
-
name:
|
|
860
|
+
name: $.value,
|
|
349
861
|
value: t.modelValue
|
|
350
|
-
}, null, 8,
|
|
351
|
-
|
|
862
|
+
}, null, 8, _a)) : S("", !0),
|
|
863
|
+
c("button", J({
|
|
352
864
|
ref_key: "triggerRef",
|
|
353
|
-
ref:
|
|
354
|
-
},
|
|
865
|
+
ref: O
|
|
866
|
+
}, X.value, {
|
|
355
867
|
type: "button",
|
|
356
868
|
class: "tree-date-picker__trigger",
|
|
357
869
|
disabled: t.disabled,
|
|
358
|
-
"aria-controls":
|
|
870
|
+
"aria-controls": D(y) ? D(f) : void 0,
|
|
359
871
|
"aria-haspopup": "dialog",
|
|
360
|
-
"aria-expanded":
|
|
872
|
+
"aria-expanded": D(y),
|
|
361
873
|
"aria-invalid": t.invalid || void 0,
|
|
362
|
-
onClick:
|
|
363
|
-
onKeydown:
|
|
874
|
+
onClick: W,
|
|
875
|
+
onKeydown: Be
|
|
364
876
|
}), [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
])) :
|
|
368
|
-
|
|
877
|
+
B.$slots.prefix ? (s(), n("span", ya, [
|
|
878
|
+
T(B.$slots, "prefix")
|
|
879
|
+
])) : S("", !0),
|
|
880
|
+
c("span", {
|
|
369
881
|
class: "tree-date-picker__value",
|
|
370
|
-
"data-placeholder":
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
882
|
+
"data-placeholder": p.value ? void 0 : !0
|
|
883
|
+
}, N(H.value), 9, ga),
|
|
884
|
+
c("span", ka, [
|
|
885
|
+
T(B.$slots, "suffix", {}, () => [
|
|
886
|
+
Y(D(e), Ae(Se(D(De))), null, 16)
|
|
375
887
|
])
|
|
376
888
|
])
|
|
377
|
-
], 16,
|
|
378
|
-
|
|
379
|
-
default:
|
|
380
|
-
|
|
889
|
+
], 16, ha),
|
|
890
|
+
Y($e, { name: "tree-fade" }, {
|
|
891
|
+
default: de(() => [
|
|
892
|
+
D(y) && !t.disabled ? (s(), n("div", {
|
|
381
893
|
key: 0,
|
|
382
|
-
id: f
|
|
894
|
+
id: D(f),
|
|
383
895
|
class: "tree-date-picker__content",
|
|
384
896
|
role: "dialog",
|
|
385
897
|
"aria-modal": "false",
|
|
386
|
-
"aria-labelledby":
|
|
898
|
+
"aria-labelledby": g
|
|
387
899
|
}, [
|
|
388
|
-
|
|
389
|
-
|
|
900
|
+
c("div", Ta, [
|
|
901
|
+
c("button", {
|
|
390
902
|
type: "button",
|
|
391
903
|
class: "tree-date-picker__nav",
|
|
392
|
-
disabled: !
|
|
904
|
+
disabled: !ue.value,
|
|
393
905
|
"aria-label": "Previous month",
|
|
394
|
-
onClick:
|
|
906
|
+
onClick: U[0] || (U[0] = (ee) => oe(-1))
|
|
395
907
|
}, [
|
|
396
|
-
|
|
397
|
-
], 8,
|
|
398
|
-
|
|
399
|
-
id:
|
|
908
|
+
Y(D(o), Ae(Se(D(De))), null, 16)
|
|
909
|
+
], 8, wa),
|
|
910
|
+
c("p", {
|
|
911
|
+
id: g,
|
|
400
912
|
class: "tree-date-picker__month"
|
|
401
|
-
},
|
|
402
|
-
|
|
913
|
+
}, N(x.value), 1),
|
|
914
|
+
c("button", {
|
|
403
915
|
type: "button",
|
|
404
916
|
class: "tree-date-picker__nav",
|
|
405
|
-
disabled: !
|
|
917
|
+
disabled: !I.value,
|
|
406
918
|
"aria-label": "Next month",
|
|
407
|
-
onClick:
|
|
919
|
+
onClick: U[1] || (U[1] = (ee) => oe(1))
|
|
408
920
|
}, [
|
|
409
|
-
|
|
410
|
-
], 8,
|
|
921
|
+
Y(D(u), Ae(Se(D(De))), null, 16)
|
|
922
|
+
], 8, Ca)
|
|
411
923
|
]),
|
|
412
|
-
|
|
413
|
-
(
|
|
414
|
-
key:
|
|
924
|
+
c("div", Da, [
|
|
925
|
+
(s(!0), n(re, null, ie(h.value, (ee) => (s(), n("span", {
|
|
926
|
+
key: ee,
|
|
415
927
|
class: "tree-date-picker__weekday"
|
|
416
|
-
},
|
|
928
|
+
}, N(ee), 1))), 128))
|
|
417
929
|
]),
|
|
418
|
-
|
|
930
|
+
c("div", {
|
|
419
931
|
class: "tree-date-picker__grid",
|
|
420
932
|
role: "grid",
|
|
421
|
-
"aria-labelledby":
|
|
933
|
+
"aria-labelledby": g
|
|
422
934
|
}, [
|
|
423
|
-
(
|
|
424
|
-
key:
|
|
935
|
+
(s(!0), n(re, null, ie(ae.value, (ee, xe) => (s(), n("div", {
|
|
936
|
+
key: xe,
|
|
425
937
|
class: "tree-date-picker__row",
|
|
426
938
|
role: "row"
|
|
427
939
|
}, [
|
|
428
|
-
(
|
|
429
|
-
key:
|
|
940
|
+
(s(!0), n(re, null, ie(ee, (te) => (s(), n("div", {
|
|
941
|
+
key: te.key,
|
|
430
942
|
class: "tree-date-picker__cell",
|
|
431
943
|
role: "gridcell",
|
|
432
|
-
"aria-selected":
|
|
944
|
+
"aria-selected": te.isSelected
|
|
433
945
|
}, [
|
|
434
|
-
|
|
946
|
+
c("button", {
|
|
435
947
|
ref_for: !0,
|
|
436
|
-
ref: (
|
|
948
|
+
ref: (le) => k(le, te.key),
|
|
437
949
|
type: "button",
|
|
438
|
-
class:
|
|
439
|
-
"is-muted":
|
|
440
|
-
"is-selected":
|
|
441
|
-
"is-today":
|
|
950
|
+
class: P(["tree-date-picker__day", {
|
|
951
|
+
"is-muted": !te.inMonth,
|
|
952
|
+
"is-selected": te.isSelected,
|
|
953
|
+
"is-today": te.isToday
|
|
442
954
|
}]),
|
|
443
|
-
"data-date":
|
|
444
|
-
disabled:
|
|
445
|
-
tabindex:
|
|
446
|
-
"aria-current":
|
|
447
|
-
"aria-label":
|
|
448
|
-
onClick: (
|
|
449
|
-
onKeydown: (
|
|
450
|
-
},
|
|
451
|
-
], 8,
|
|
955
|
+
"data-date": te.key,
|
|
956
|
+
disabled: te.disabled,
|
|
957
|
+
tabindex: te.isFocused ? 0 : -1,
|
|
958
|
+
"aria-current": te.isToday ? "date" : void 0,
|
|
959
|
+
"aria-label": te.key,
|
|
960
|
+
onClick: (le) => ye(te.date),
|
|
961
|
+
onKeydown: (le) => ge(le, te.date)
|
|
962
|
+
}, N(te.dayLabel), 43, xa)
|
|
963
|
+
], 8, Ba))), 128))
|
|
452
964
|
]))), 128))
|
|
453
965
|
])
|
|
454
|
-
], 8,
|
|
966
|
+
], 8, $a)) : S("", !0)
|
|
455
967
|
]),
|
|
456
968
|
_: 1
|
|
457
969
|
})
|
|
458
|
-
], 14,
|
|
459
|
-
}
|
|
460
|
-
}), kt = {
|
|
461
|
-
key: 0,
|
|
462
|
-
class: "tree-input__slot tree-input__slot--prefix"
|
|
463
|
-
}, gt = ["type", "value", "placeholder", "disabled", "aria-invalid"], $t = {
|
|
464
|
-
key: 2,
|
|
465
|
-
class: "tree-input__slot tree-input__slot--suffix"
|
|
466
|
-
}, Ke = /* @__PURE__ */ F({
|
|
467
|
-
inheritAttrs: !1,
|
|
468
|
-
__name: "TreeInput",
|
|
469
|
-
props: {
|
|
470
|
-
modelValue: { default: "" },
|
|
471
|
-
size: { default: "md" },
|
|
472
|
-
disabled: { type: Boolean, default: !1 },
|
|
473
|
-
loading: { type: Boolean, default: !1 },
|
|
474
|
-
invalid: { type: Boolean, default: !1 },
|
|
475
|
-
type: { default: "text" },
|
|
476
|
-
placeholder: { default: "" }
|
|
477
|
-
},
|
|
478
|
-
emits: ["update:modelValue"],
|
|
479
|
-
setup(t, { emit: p }) {
|
|
480
|
-
const n = t, r = p, c = ie(), a = o(() => [
|
|
481
|
-
"tree-input",
|
|
482
|
-
`tree-input--${n.size}`,
|
|
483
|
-
{
|
|
484
|
-
"is-disabled": n.disabled,
|
|
485
|
-
"is-invalid": n.invalid,
|
|
486
|
-
"is-loading": n.loading
|
|
487
|
-
},
|
|
488
|
-
c.class
|
|
489
|
-
]), h = o(() => c.style), T = o(() => {
|
|
490
|
-
const { class: u, style: D, ...w } = c;
|
|
491
|
-
return w;
|
|
492
|
-
}), m = o(() => `${n.modelValue ?? ""}`), k = (u) => {
|
|
493
|
-
r("update:modelValue", u.target.value);
|
|
494
|
-
};
|
|
495
|
-
return (u, D) => (l(), d("label", {
|
|
496
|
-
class: S(a.value),
|
|
497
|
-
style: de(h.value)
|
|
498
|
-
}, [
|
|
499
|
-
u.$slots.prefix ? (l(), d("span", kt, [
|
|
500
|
-
b(u.$slots, "prefix")
|
|
501
|
-
])) : _("", !0),
|
|
502
|
-
v("input", ue(T.value, {
|
|
503
|
-
class: "tree-input__field",
|
|
504
|
-
type: t.type,
|
|
505
|
-
value: m.value,
|
|
506
|
-
placeholder: t.placeholder,
|
|
507
|
-
disabled: t.disabled,
|
|
508
|
-
"aria-invalid": t.invalid || void 0,
|
|
509
|
-
onInput: k
|
|
510
|
-
}), null, 16, gt),
|
|
511
|
-
t.loading ? (l(), re(ne, {
|
|
512
|
-
key: 1,
|
|
513
|
-
size: "sm",
|
|
514
|
-
label: "Loading"
|
|
515
|
-
})) : _("", !0),
|
|
516
|
-
u.$slots.suffix ? (l(), d("span", $t, [
|
|
517
|
-
b(u.$slots, "suffix")
|
|
518
|
-
])) : _("", !0)
|
|
519
|
-
], 6));
|
|
970
|
+
], 14, ma));
|
|
520
971
|
}
|
|
521
|
-
}),
|
|
972
|
+
}), Va = ["data-state"], Ia = ["aria-disabled"], Aa = ["data-state"], Sa = ["id", "aria-labelledby", "aria-describedby"], Oa = {
|
|
522
973
|
key: 0,
|
|
523
|
-
class: "tree-
|
|
524
|
-
},
|
|
974
|
+
class: "tree-drawer__topbar"
|
|
975
|
+
}, za = { class: "tree-drawer__title" }, Pa = ["aria-label"], Ma = { class: "tree-drawer__body" }, Ea = {
|
|
525
976
|
key: 2,
|
|
526
|
-
class: "tree-
|
|
527
|
-
},
|
|
977
|
+
class: "tree-drawer__footer"
|
|
978
|
+
}, rt = /* @__PURE__ */ L({
|
|
528
979
|
inheritAttrs: !1,
|
|
529
|
-
__name: "
|
|
980
|
+
__name: "TreeDrawer",
|
|
530
981
|
props: {
|
|
531
982
|
open: { type: Boolean, default: void 0 },
|
|
532
983
|
defaultOpen: { type: Boolean, default: !1 },
|
|
533
984
|
disabled: { type: Boolean, default: !1 },
|
|
534
985
|
size: { default: "md" },
|
|
986
|
+
side: { default: "right" },
|
|
535
987
|
title: { default: "" },
|
|
536
988
|
description: { default: "" },
|
|
537
989
|
closeOnEscape: { type: Boolean, default: !0 },
|
|
538
990
|
closeOnOverlay: { type: Boolean, default: !0 },
|
|
539
991
|
showCloseButton: { type: Boolean, default: !0 },
|
|
540
|
-
closeLabel: { default: "Close
|
|
992
|
+
closeLabel: { default: "Close drawer" },
|
|
541
993
|
id: { default: void 0 }
|
|
542
994
|
},
|
|
543
995
|
emits: ["update:open", "open-change"],
|
|
544
|
-
setup(t, { emit:
|
|
545
|
-
const
|
|
546
|
-
const { class:
|
|
547
|
-
return
|
|
548
|
-
}),
|
|
549
|
-
"tree-
|
|
550
|
-
`tree-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
996
|
+
setup(t, { emit: a }) {
|
|
997
|
+
const e = me("x"), o = t, u = a, d = se(), v = o.id ?? be("tree-drawer"), m = `${v}-title`, _ = `${v}-description`, p = j(null), l = j(null), r = j(null), f = i(() => !!(o.title || g.header)), g = Ye(), A = i(() => ["tree-drawer", d.class]), O = i(() => d.style), V = i(() => {
|
|
998
|
+
const { class: b, style: k, ...R } = d;
|
|
999
|
+
return R;
|
|
1000
|
+
}), F = i(() => [
|
|
1001
|
+
"tree-drawer__surface",
|
|
1002
|
+
`tree-drawer__surface--${o.size}`,
|
|
1003
|
+
`tree-drawer__surface--${o.side}`
|
|
1004
|
+
]), { value: M, setValue: X } = Te(
|
|
1005
|
+
ve(o, "open"),
|
|
1006
|
+
o.defaultOpen,
|
|
1007
|
+
(b) => {
|
|
1008
|
+
u("update:open", b), u("open-change", b);
|
|
1009
|
+
}
|
|
1010
|
+
), $ = i(() => f.value ? m : void 0), w = i(() => o.description ? _ : void 0);
|
|
1011
|
+
let E = 0, y = "";
|
|
1012
|
+
const z = () => {
|
|
1013
|
+
typeof document > "u" || (E === 0 && (y = document.body.style.overflow, document.body.style.overflow = "hidden"), E += 1);
|
|
1014
|
+
}, H = () => {
|
|
1015
|
+
typeof document > "u" || E === 0 || (E -= 1, E === 0 && (document.body.style.overflow = y));
|
|
1016
|
+
}, x = () => {
|
|
1017
|
+
Z(() => {
|
|
1018
|
+
if (!l.value)
|
|
566
1019
|
return;
|
|
567
|
-
|
|
1020
|
+
Oe(l.value) || l.value.focus();
|
|
568
1021
|
});
|
|
569
|
-
},
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
if (
|
|
575
|
-
|
|
1022
|
+
}, h = () => {
|
|
1023
|
+
o.disabled || (r.value = document.activeElement, X(!0));
|
|
1024
|
+
}, C = () => {
|
|
1025
|
+
X(!1);
|
|
1026
|
+
}, K = (b) => {
|
|
1027
|
+
if (o.disabled) {
|
|
1028
|
+
b.preventDefault(), b.stopPropagation();
|
|
576
1029
|
return;
|
|
577
1030
|
}
|
|
578
|
-
|
|
579
|
-
},
|
|
580
|
-
|
|
581
|
-
},
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
if (
|
|
585
|
-
|
|
1031
|
+
b.defaultPrevented || h();
|
|
1032
|
+
}, ae = () => {
|
|
1033
|
+
o.closeOnOverlay && C();
|
|
1034
|
+
}, ue = (b) => {
|
|
1035
|
+
b.stopPropagation();
|
|
1036
|
+
}, I = (b) => {
|
|
1037
|
+
if (pe(b) && o.closeOnEscape) {
|
|
1038
|
+
b.preventDefault(), C();
|
|
586
1039
|
return;
|
|
587
1040
|
}
|
|
588
|
-
if (
|
|
1041
|
+
if (b.key !== "Tab" || !l.value)
|
|
589
1042
|
return;
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
592
|
-
|
|
1043
|
+
const k = Pt(l.value);
|
|
1044
|
+
if (!k.length) {
|
|
1045
|
+
b.preventDefault(), l.value.focus();
|
|
593
1046
|
return;
|
|
594
1047
|
}
|
|
595
|
-
const
|
|
596
|
-
|
|
1048
|
+
const R = k[0], q = k[k.length - 1], W = document.activeElement;
|
|
1049
|
+
b.shiftKey && W === R && (b.preventDefault(), Mt(l.value)), !b.shiftKey && W === q && (b.preventDefault(), Oe(l.value));
|
|
597
1050
|
};
|
|
598
|
-
return
|
|
599
|
-
if (
|
|
600
|
-
|
|
1051
|
+
return ce(M, (b, k) => {
|
|
1052
|
+
if (b) {
|
|
1053
|
+
z(), x();
|
|
601
1054
|
return;
|
|
602
1055
|
}
|
|
603
|
-
|
|
604
|
-
var
|
|
605
|
-
(
|
|
1056
|
+
k && (H(), Z(() => {
|
|
1057
|
+
var R;
|
|
1058
|
+
(R = r.value) == null || R.focus();
|
|
606
1059
|
}));
|
|
607
|
-
}),
|
|
608
|
-
|
|
609
|
-
}), (
|
|
1060
|
+
}), he(() => {
|
|
1061
|
+
M.value && H();
|
|
1062
|
+
}), (b, k) => (s(), n("div", {
|
|
610
1063
|
ref_key: "rootRef",
|
|
611
|
-
ref:
|
|
612
|
-
class:
|
|
613
|
-
style:
|
|
614
|
-
"data-state":
|
|
1064
|
+
ref: p,
|
|
1065
|
+
class: P(A.value),
|
|
1066
|
+
style: Q(O.value),
|
|
1067
|
+
"data-state": D(M) ? "open" : "closed"
|
|
615
1068
|
}, [
|
|
616
|
-
|
|
1069
|
+
b.$slots.trigger ? (s(), n("span", J({
|
|
617
1070
|
key: 0,
|
|
618
|
-
class: "tree-
|
|
619
|
-
},
|
|
1071
|
+
class: "tree-drawer__trigger"
|
|
1072
|
+
}, V.value, {
|
|
620
1073
|
"aria-disabled": t.disabled || void 0,
|
|
621
|
-
onClick:
|
|
1074
|
+
onClick: K
|
|
622
1075
|
}), [
|
|
623
|
-
b
|
|
624
|
-
], 16,
|
|
625
|
-
(
|
|
626
|
-
|
|
627
|
-
default:
|
|
628
|
-
|
|
1076
|
+
T(b.$slots, "trigger")
|
|
1077
|
+
], 16, Ia)) : S("", !0),
|
|
1078
|
+
(s(), _e(Ee, { to: "body" }, [
|
|
1079
|
+
Y($e, { name: "tree-drawer-fade" }, {
|
|
1080
|
+
default: de(() => [
|
|
1081
|
+
D(M) ? (s(), n("div", {
|
|
629
1082
|
key: 0,
|
|
630
|
-
class: "tree-
|
|
631
|
-
"data-state":
|
|
1083
|
+
class: "tree-drawer__portal",
|
|
1084
|
+
"data-state": D(M) ? "open" : "closed"
|
|
632
1085
|
}, [
|
|
633
|
-
|
|
634
|
-
class: "tree-
|
|
1086
|
+
c("div", {
|
|
1087
|
+
class: "tree-drawer__backdrop",
|
|
635
1088
|
"aria-hidden": "true",
|
|
636
|
-
onClick:
|
|
1089
|
+
onClick: ae
|
|
637
1090
|
}),
|
|
638
|
-
|
|
639
|
-
v
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
key: 0,
|
|
655
|
-
id: T,
|
|
656
|
-
class: "tree-modal__header"
|
|
657
|
-
}, [
|
|
658
|
-
b(i.$slots, "header", {}, () => [
|
|
659
|
-
v("h2", St, L(t.title), 1)
|
|
660
|
-
])
|
|
661
|
-
])) : _("", !0),
|
|
662
|
-
t.showCloseButton ? (l(), d("button", {
|
|
663
|
-
key: 1,
|
|
664
|
-
type: "button",
|
|
665
|
-
class: "tree-modal__close",
|
|
666
|
-
"aria-label": t.closeLabel,
|
|
667
|
-
onClick: N
|
|
668
|
-
}, [
|
|
669
|
-
E(f(n), te(ae(f(oe))), null, 16)
|
|
670
|
-
], 8, It)) : _("", !0)
|
|
671
|
-
])) : _("", !0),
|
|
672
|
-
t.description ? (l(), d("p", {
|
|
673
|
-
key: 1,
|
|
1091
|
+
c("div", {
|
|
1092
|
+
id: D(v),
|
|
1093
|
+
ref_key: "surfaceRef",
|
|
1094
|
+
ref: l,
|
|
1095
|
+
class: P(F.value),
|
|
1096
|
+
role: "dialog",
|
|
1097
|
+
"aria-modal": "true",
|
|
1098
|
+
"aria-labelledby": $.value,
|
|
1099
|
+
"aria-describedby": w.value,
|
|
1100
|
+
tabindex: "-1",
|
|
1101
|
+
onClick: ue,
|
|
1102
|
+
onKeydown: I
|
|
1103
|
+
}, [
|
|
1104
|
+
f.value || t.showCloseButton ? (s(), n("div", Oa, [
|
|
1105
|
+
f.value ? (s(), n("div", {
|
|
1106
|
+
key: 0,
|
|
674
1107
|
id: m,
|
|
675
|
-
class: "tree-
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
b(i.$slots, "default")
|
|
1108
|
+
class: "tree-drawer__header"
|
|
1109
|
+
}, [
|
|
1110
|
+
T(b.$slots, "header", {}, () => [
|
|
1111
|
+
c("h2", za, N(t.title), 1)
|
|
680
1112
|
])
|
|
681
|
-
]),
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
1113
|
+
])) : S("", !0),
|
|
1114
|
+
t.showCloseButton ? (s(), n("button", {
|
|
1115
|
+
key: 1,
|
|
1116
|
+
type: "button",
|
|
1117
|
+
class: "tree-drawer__close",
|
|
1118
|
+
"aria-label": t.closeLabel,
|
|
1119
|
+
onClick: C
|
|
1120
|
+
}, [
|
|
1121
|
+
Y(D(e), Ae(Se(D(De))), null, 16)
|
|
1122
|
+
], 8, Pa)) : S("", !0)
|
|
1123
|
+
])) : S("", !0),
|
|
1124
|
+
t.description ? (s(), n("p", {
|
|
1125
|
+
key: 1,
|
|
1126
|
+
id: _,
|
|
1127
|
+
class: "tree-drawer__description"
|
|
1128
|
+
}, N(t.description), 1)) : S("", !0),
|
|
1129
|
+
c("div", Ma, [
|
|
1130
|
+
T(b.$slots, "content", {}, () => [
|
|
1131
|
+
T(b.$slots, "default")
|
|
1132
|
+
])
|
|
1133
|
+
]),
|
|
1134
|
+
b.$slots.footer ? (s(), n("div", Ea, [
|
|
1135
|
+
T(b.$slots, "footer")
|
|
1136
|
+
])) : S("", !0)
|
|
1137
|
+
], 42, Sa)
|
|
1138
|
+
], 8, Aa)) : S("", !0)
|
|
688
1139
|
]),
|
|
689
1140
|
_: 3
|
|
690
1141
|
})
|
|
691
1142
|
]))
|
|
692
|
-
], 14,
|
|
1143
|
+
], 14, Va));
|
|
693
1144
|
}
|
|
694
|
-
}),
|
|
1145
|
+
}), Ra = ["data-state"], La = { class: "tree-dropdown__trigger-wrapper" }, Ka = ["disabled", "aria-controls", "aria-expanded"], Fa = { class: "tree-dropdown__label" }, Ha = ["id", "aria-label"], ja = ["aria-disabled", "tabindex", "onClick", "onKeydown"], it = /* @__PURE__ */ L({
|
|
695
1146
|
inheritAttrs: !1,
|
|
696
|
-
__name: "
|
|
1147
|
+
__name: "TreeDropdown",
|
|
697
1148
|
props: {
|
|
698
|
-
|
|
1149
|
+
items: { default: () => [] },
|
|
1150
|
+
open: { type: Boolean, default: void 0 },
|
|
699
1151
|
defaultOpen: { type: Boolean, default: !1 },
|
|
700
1152
|
disabled: { type: Boolean, default: !1 },
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
delay: { default: 80 },
|
|
704
|
-
id: { default: void 0 }
|
|
1153
|
+
size: { default: "md" },
|
|
1154
|
+
label: { default: "" }
|
|
705
1155
|
},
|
|
706
|
-
emits: ["update:open", "open-change"],
|
|
707
|
-
setup(t, { emit:
|
|
708
|
-
const
|
|
709
|
-
const { class:
|
|
710
|
-
return
|
|
711
|
-
}),
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
(
|
|
715
|
-
|
|
1156
|
+
emits: ["select", "update:open", "open-change"],
|
|
1157
|
+
setup(t, { emit: a }) {
|
|
1158
|
+
const e = t, o = a, u = se(), d = be("tree-dropdown"), v = j(null), m = j(null), _ = j(/* @__PURE__ */ new Map()), p = j(-1), l = i(() => {
|
|
1159
|
+
const { class: x, style: h, ...C } = u;
|
|
1160
|
+
return C;
|
|
1161
|
+
}), { value: r, setValue: f } = Te(
|
|
1162
|
+
ve(e, "open"),
|
|
1163
|
+
e.defaultOpen,
|
|
1164
|
+
(x) => {
|
|
1165
|
+
o("update:open", x), o("open-change", x);
|
|
716
1166
|
}
|
|
717
|
-
)
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1167
|
+
), g = i(() => [
|
|
1168
|
+
"tree-dropdown",
|
|
1169
|
+
`tree-dropdown--${e.size}`,
|
|
1170
|
+
{
|
|
1171
|
+
"is-disabled": e.disabled,
|
|
1172
|
+
"is-open": r.value
|
|
1173
|
+
},
|
|
1174
|
+
u.class
|
|
1175
|
+
]), A = i(() => u.style), O = i(() => e.items.filter((x) => !x.disabled)), V = () => {
|
|
1176
|
+
e.disabled || (p.value = O.value.length > 0 ? e.items.indexOf(O.value[0]) : 0, f(!0), Z(() => $(p.value)));
|
|
1177
|
+
}, F = (x = !1) => {
|
|
1178
|
+
f(!1), p.value = -1, x && Z(() => {
|
|
1179
|
+
var h;
|
|
1180
|
+
return (h = m.value) == null ? void 0 : h.focus();
|
|
1181
|
+
});
|
|
1182
|
+
}, M = () => {
|
|
1183
|
+
r.value ? F() : V();
|
|
1184
|
+
}, X = (x) => {
|
|
1185
|
+
x.disabled || (o("select", x.value), F(!0));
|
|
1186
|
+
}, $ = (x) => {
|
|
1187
|
+
const h = e.items[x];
|
|
1188
|
+
if (!h) return;
|
|
1189
|
+
const C = _.value.get(h.value);
|
|
1190
|
+
C == null || C.focus();
|
|
1191
|
+
}, w = (x, h) => {
|
|
1192
|
+
x instanceof HTMLElement ? _.value.set(h, x) : _.value.delete(h);
|
|
1193
|
+
}, E = (x) => {
|
|
1194
|
+
let h = p.value + x;
|
|
1195
|
+
for (; h >= 0 && h < e.items.length; ) {
|
|
1196
|
+
if (!e.items[h].disabled) {
|
|
1197
|
+
p.value = h, $(h);
|
|
725
1198
|
return;
|
|
726
1199
|
}
|
|
727
|
-
|
|
728
|
-
u(!0);
|
|
729
|
-
}, n.delay);
|
|
1200
|
+
h += x;
|
|
730
1201
|
}
|
|
731
|
-
},
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
1202
|
+
}, y = (x) => {
|
|
1203
|
+
if (!e.disabled) {
|
|
1204
|
+
if (pe(x) && r.value) {
|
|
1205
|
+
x.preventDefault(), F();
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
(ke(x) || x.key === "ArrowDown" || x.key === "ArrowUp") && (x.preventDefault(), V());
|
|
1209
|
+
}
|
|
1210
|
+
}, z = (x, h) => {
|
|
1211
|
+
if (pe(x)) {
|
|
1212
|
+
x.preventDefault(), F(!0);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
if (ke(x)) {
|
|
1216
|
+
x.preventDefault(), X(h);
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
switch (x.key) {
|
|
1220
|
+
case "ArrowDown":
|
|
1221
|
+
x.preventDefault(), E(1);
|
|
1222
|
+
break;
|
|
1223
|
+
case "ArrowUp":
|
|
1224
|
+
x.preventDefault(), E(-1);
|
|
1225
|
+
break;
|
|
1226
|
+
case "Home":
|
|
1227
|
+
x.preventDefault(), p.value = O.value.length > 0 ? e.items.indexOf(O.value[0]) : 0, $(p.value);
|
|
1228
|
+
break;
|
|
1229
|
+
case "End":
|
|
1230
|
+
x.preventDefault(), p.value = O.value.length > 0 ? e.items.indexOf(O.value[O.value.length - 1]) : e.items.length - 1, $(p.value);
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
}, H = (x) => {
|
|
1234
|
+
var C;
|
|
1235
|
+
if (!r.value) return;
|
|
1236
|
+
const h = x.target;
|
|
1237
|
+
h instanceof Node && ((C = v.value) != null && C.contains(h) || F());
|
|
1238
|
+
};
|
|
1239
|
+
return ce(r, (x) => {
|
|
1240
|
+
x ? document.addEventListener("pointerdown", H) : document.removeEventListener("pointerdown", H);
|
|
1241
|
+
}), he(() => {
|
|
1242
|
+
document.removeEventListener("pointerdown", H);
|
|
1243
|
+
}), (x, h) => (s(), n("div", {
|
|
1244
|
+
ref_key: "rootRef",
|
|
1245
|
+
ref: v,
|
|
1246
|
+
class: P(g.value),
|
|
1247
|
+
style: Q(A.value),
|
|
1248
|
+
"data-state": D(r) ? "open" : "closed"
|
|
749
1249
|
}, [
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
1250
|
+
c("span", La, [
|
|
1251
|
+
T(x.$slots, "trigger", { isOpen: D(r) }, () => [
|
|
1252
|
+
c("button", J({
|
|
1253
|
+
ref_key: "triggerRef",
|
|
1254
|
+
ref: m
|
|
1255
|
+
}, l.value, {
|
|
1256
|
+
type: "button",
|
|
1257
|
+
class: "tree-dropdown__trigger",
|
|
1258
|
+
disabled: t.disabled,
|
|
1259
|
+
"aria-controls": D(r) ? D(d) : void 0,
|
|
1260
|
+
"aria-haspopup": "menu",
|
|
1261
|
+
"aria-expanded": D(r),
|
|
1262
|
+
onClick: M,
|
|
1263
|
+
onKeydown: y
|
|
1264
|
+
}), [
|
|
1265
|
+
c("span", Fa, N(t.label), 1),
|
|
1266
|
+
h[0] || (h[0] = c("svg", {
|
|
1267
|
+
class: "tree-dropdown__chevron",
|
|
1268
|
+
viewBox: "0 0 16 16",
|
|
1269
|
+
fill: "none",
|
|
1270
|
+
stroke: "currentColor",
|
|
1271
|
+
"stroke-width": "2",
|
|
1272
|
+
"stroke-linecap": "round",
|
|
1273
|
+
"stroke-linejoin": "round",
|
|
1274
|
+
"aria-hidden": "true"
|
|
1275
|
+
}, [
|
|
1276
|
+
c("polyline", { points: "4 6 8 10 12 6" })
|
|
1277
|
+
], -1))
|
|
1278
|
+
], 16, Ka)
|
|
756
1279
|
])
|
|
757
|
-
]
|
|
758
|
-
|
|
759
|
-
default:
|
|
760
|
-
|
|
1280
|
+
]),
|
|
1281
|
+
Y($e, { name: "tree-fade" }, {
|
|
1282
|
+
default: de(() => [
|
|
1283
|
+
D(r) && !t.disabled ? (s(), n("ul", {
|
|
761
1284
|
key: 0,
|
|
762
|
-
id:
|
|
763
|
-
role: "
|
|
764
|
-
class:
|
|
765
|
-
"
|
|
1285
|
+
id: D(d),
|
|
1286
|
+
role: "menu",
|
|
1287
|
+
class: "tree-dropdown__menu",
|
|
1288
|
+
"aria-label": t.label || void 0
|
|
766
1289
|
}, [
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1290
|
+
(s(!0), n(re, null, ie(t.items, (C, K) => (s(), n("li", {
|
|
1291
|
+
key: C.value,
|
|
1292
|
+
ref_for: !0,
|
|
1293
|
+
ref: (ae) => w(ae, C.value),
|
|
1294
|
+
role: "menuitem",
|
|
1295
|
+
class: P(["tree-dropdown__item", {
|
|
1296
|
+
"is-disabled": C.disabled,
|
|
1297
|
+
"is-focused": K === p.value
|
|
1298
|
+
}]),
|
|
1299
|
+
"aria-disabled": C.disabled || void 0,
|
|
1300
|
+
tabindex: C.disabled ? -1 : 0,
|
|
1301
|
+
onClick: (ae) => X(C),
|
|
1302
|
+
onKeydown: (ae) => z(ae, C)
|
|
1303
|
+
}, [
|
|
1304
|
+
T(x.$slots, "item", {
|
|
1305
|
+
item: C,
|
|
1306
|
+
index: K
|
|
1307
|
+
}, () => [
|
|
1308
|
+
ne(N(C.label), 1)
|
|
1309
|
+
])
|
|
1310
|
+
], 42, ja))), 128))
|
|
1311
|
+
], 8, Ha)) : S("", !0)
|
|
771
1312
|
]),
|
|
772
1313
|
_: 3
|
|
773
1314
|
})
|
|
774
|
-
],
|
|
775
|
-
}
|
|
776
|
-
}),
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
},
|
|
1315
|
+
], 14, Ra));
|
|
1316
|
+
}
|
|
1317
|
+
}), Ua = ["value", "checked", "disabled", "name", "aria-checked", "aria-invalid"], Na = {
|
|
1318
|
+
class: "tree-radio__control",
|
|
1319
|
+
"aria-hidden": "true"
|
|
1320
|
+
}, qa = {
|
|
1321
|
+
key: 0,
|
|
1322
|
+
class: "tree-radio__dot"
|
|
1323
|
+
}, Ga = {
|
|
1324
|
+
key: 0,
|
|
1325
|
+
class: "tree-radio__label"
|
|
1326
|
+
}, dt = /* @__PURE__ */ L({
|
|
1327
|
+
inheritAttrs: !1,
|
|
1328
|
+
__name: "TreeRadio",
|
|
1329
|
+
props: {
|
|
1330
|
+
value: {},
|
|
1331
|
+
disabled: { type: Boolean, default: !1 },
|
|
1332
|
+
invalid: { type: Boolean, default: !1 },
|
|
1333
|
+
size: { default: void 0 }
|
|
1334
|
+
},
|
|
1335
|
+
setup(t) {
|
|
1336
|
+
const a = t, e = Pe("tree-radio-group", null), o = se(), u = i(() => e ? e.modelValue() === a.value : !1), d = i(() => a.disabled || ((e == null ? void 0 : e.disabled()) ?? !1)), v = i(() => a.invalid || ((e == null ? void 0 : e.invalid()) ?? !1)), m = i(() => a.size ?? (e == null ? void 0 : e.size()) ?? "md"), _ = i(() => [
|
|
1337
|
+
"tree-radio",
|
|
1338
|
+
`tree-radio--${m.value}`,
|
|
1339
|
+
{
|
|
1340
|
+
"is-checked": u.value,
|
|
1341
|
+
"is-disabled": d.value,
|
|
1342
|
+
"is-invalid": v.value
|
|
1343
|
+
},
|
|
1344
|
+
o.class
|
|
1345
|
+
]), p = i(() => o.style), l = i(() => {
|
|
1346
|
+
const { class: f, style: g, ...A } = o;
|
|
1347
|
+
return A;
|
|
1348
|
+
}), r = () => {
|
|
1349
|
+
e && e.onChange(a.value);
|
|
1350
|
+
};
|
|
1351
|
+
return (f, g) => {
|
|
1352
|
+
var A;
|
|
1353
|
+
return s(), n("label", {
|
|
1354
|
+
class: P(_.value),
|
|
1355
|
+
style: Q(p.value)
|
|
1356
|
+
}, [
|
|
1357
|
+
c("input", J(l.value, {
|
|
1358
|
+
type: "radio",
|
|
1359
|
+
class: "tree-radio__input",
|
|
1360
|
+
value: t.value,
|
|
1361
|
+
checked: u.value,
|
|
1362
|
+
disabled: d.value,
|
|
1363
|
+
name: (A = D(e)) == null ? void 0 : A.name(),
|
|
1364
|
+
"aria-checked": u.value,
|
|
1365
|
+
"aria-invalid": v.value || void 0,
|
|
1366
|
+
onChange: r
|
|
1367
|
+
}), null, 16, Ua),
|
|
1368
|
+
c("span", Na, [
|
|
1369
|
+
u.value ? (s(), n("span", qa)) : S("", !0)
|
|
1370
|
+
]),
|
|
1371
|
+
f.$slots.default ? (s(), n("span", Ga, [
|
|
1372
|
+
T(f.$slots, "default")
|
|
1373
|
+
])) : S("", !0)
|
|
1374
|
+
], 6);
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
}), ct = /* @__PURE__ */ L({
|
|
1378
|
+
inheritAttrs: !1,
|
|
1379
|
+
__name: "TreeRadioGroup",
|
|
1380
|
+
props: {
|
|
1381
|
+
modelValue: { default: void 0 },
|
|
1382
|
+
name: { default: void 0 },
|
|
1383
|
+
disabled: { type: Boolean, default: !1 },
|
|
1384
|
+
invalid: { type: Boolean, default: !1 },
|
|
1385
|
+
size: { default: "md" }
|
|
1386
|
+
},
|
|
1387
|
+
emits: ["update:modelValue"],
|
|
1388
|
+
setup(t, { emit: a }) {
|
|
1389
|
+
const e = t, o = a, u = se();
|
|
1390
|
+
Xe("tree-radio-group", {
|
|
1391
|
+
modelValue: () => e.modelValue,
|
|
1392
|
+
name: () => e.name,
|
|
1393
|
+
disabled: () => e.disabled,
|
|
1394
|
+
invalid: () => e.invalid,
|
|
1395
|
+
size: () => e.size,
|
|
1396
|
+
onChange: (_) => {
|
|
1397
|
+
o("update:modelValue", _);
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
const d = i(() => [
|
|
1401
|
+
"tree-radio-group",
|
|
1402
|
+
u.class
|
|
1403
|
+
]), v = i(() => u.style), m = i(() => {
|
|
1404
|
+
const { class: _, style: p, ...l } = u;
|
|
1405
|
+
return l;
|
|
1406
|
+
});
|
|
1407
|
+
return (_, p) => (s(), n("div", J(m.value, {
|
|
1408
|
+
class: d.value,
|
|
1409
|
+
style: v.value,
|
|
1410
|
+
role: "radiogroup"
|
|
1411
|
+
}), [
|
|
1412
|
+
T(_.$slots, "default")
|
|
1413
|
+
], 16));
|
|
1414
|
+
}
|
|
1415
|
+
}), Wa = ["data-state"], Xa = ["disabled", "aria-controls", "aria-expanded", "aria-invalid", "aria-busy"], Ya = {
|
|
1416
|
+
key: 0,
|
|
1417
|
+
class: "tree-select__slot tree-select__slot--prefix"
|
|
1418
|
+
}, Ja = ["data-placeholder"], Qa = {
|
|
1419
|
+
key: 2,
|
|
1420
|
+
class: "tree-select__chevron",
|
|
1421
|
+
viewBox: "0 0 16 16",
|
|
1422
|
+
fill: "none",
|
|
1423
|
+
stroke: "currentColor",
|
|
1424
|
+
"stroke-width": "2",
|
|
1425
|
+
"stroke-linecap": "round",
|
|
1426
|
+
"stroke-linejoin": "round",
|
|
1427
|
+
"aria-hidden": "true"
|
|
1428
|
+
}, Za = ["id", "aria-label"], es = ["aria-selected", "aria-disabled", "tabindex", "onClick", "onKeydown"], ts = {
|
|
1429
|
+
key: 0,
|
|
1430
|
+
class: "tree-select__check",
|
|
1431
|
+
viewBox: "0 0 16 16",
|
|
1432
|
+
fill: "none",
|
|
1433
|
+
stroke: "currentColor",
|
|
1434
|
+
"stroke-width": "2",
|
|
1435
|
+
"stroke-linecap": "round",
|
|
1436
|
+
"stroke-linejoin": "round",
|
|
1437
|
+
"aria-hidden": "true"
|
|
1438
|
+
}, ut = /* @__PURE__ */ L({
|
|
1439
|
+
inheritAttrs: !1,
|
|
1440
|
+
__name: "TreeSelect",
|
|
1441
|
+
props: {
|
|
1442
|
+
modelValue: { default: "" },
|
|
1443
|
+
options: { default: () => [] },
|
|
1444
|
+
open: { type: Boolean, default: void 0 },
|
|
1445
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
1446
|
+
size: { default: "md" },
|
|
1447
|
+
disabled: { type: Boolean, default: !1 },
|
|
1448
|
+
loading: { type: Boolean, default: !1 },
|
|
1449
|
+
invalid: { type: Boolean, default: !1 },
|
|
1450
|
+
placeholder: { default: "" }
|
|
1451
|
+
},
|
|
1452
|
+
emits: ["update:modelValue", "update:open", "open-change"],
|
|
1453
|
+
setup(t, { emit: a }) {
|
|
1454
|
+
const e = t, o = a, u = se(), d = be("tree-select"), v = j(null), m = j(null), _ = j(/* @__PURE__ */ new Map()), p = j(-1), l = i(() => {
|
|
1455
|
+
const { class: h, style: C, ...K } = u;
|
|
1456
|
+
return K;
|
|
1457
|
+
}), { value: r, setValue: f } = Te(
|
|
1458
|
+
ve(e, "open"),
|
|
1459
|
+
e.defaultOpen,
|
|
1460
|
+
(h) => {
|
|
1461
|
+
o("update:open", h), o("open-change", h);
|
|
1462
|
+
}
|
|
1463
|
+
), g = i(() => [
|
|
1464
|
+
"tree-select",
|
|
1465
|
+
`tree-select--${e.size}`,
|
|
1466
|
+
{
|
|
1467
|
+
"is-disabled": e.disabled,
|
|
1468
|
+
"is-invalid": e.invalid,
|
|
1469
|
+
"is-loading": e.loading,
|
|
1470
|
+
"is-open": r.value
|
|
1471
|
+
},
|
|
1472
|
+
u.class
|
|
1473
|
+
]), A = i(() => u.style), O = i(() => {
|
|
1474
|
+
const h = e.options.find((C) => C.value === e.modelValue);
|
|
1475
|
+
return (h == null ? void 0 : h.label) ?? "";
|
|
1476
|
+
}), V = i(
|
|
1477
|
+
() => e.options.filter((h) => !h.disabled)
|
|
1478
|
+
), F = () => {
|
|
1479
|
+
if (e.disabled) return;
|
|
1480
|
+
const h = e.options.findIndex((C) => C.value === e.modelValue);
|
|
1481
|
+
p.value = h >= 0 ? h : 0, f(!0), Z(() => w(p.value));
|
|
1482
|
+
}, M = (h = !1) => {
|
|
1483
|
+
f(!1), p.value = -1, h && Z(() => {
|
|
1484
|
+
var C;
|
|
1485
|
+
return (C = m.value) == null ? void 0 : C.focus();
|
|
1486
|
+
});
|
|
1487
|
+
}, X = () => {
|
|
1488
|
+
r.value ? M() : F();
|
|
1489
|
+
}, $ = (h) => {
|
|
1490
|
+
h.disabled || (o("update:modelValue", h.value), M(!0));
|
|
1491
|
+
}, w = (h) => {
|
|
1492
|
+
const C = e.options[h];
|
|
1493
|
+
if (!C) return;
|
|
1494
|
+
const K = _.value.get(C.value);
|
|
1495
|
+
K == null || K.focus();
|
|
1496
|
+
}, E = (h, C) => {
|
|
1497
|
+
h instanceof HTMLElement ? _.value.set(C, h) : _.value.delete(C);
|
|
1498
|
+
}, y = (h) => {
|
|
1499
|
+
let C = p.value + h;
|
|
1500
|
+
for (; C >= 0 && C < e.options.length; ) {
|
|
1501
|
+
if (!e.options[C].disabled) {
|
|
1502
|
+
p.value = C, w(C);
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
C += h;
|
|
1506
|
+
}
|
|
1507
|
+
}, z = (h) => {
|
|
1508
|
+
if (!e.disabled) {
|
|
1509
|
+
if (pe(h) && r.value) {
|
|
1510
|
+
h.preventDefault(), M();
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
(ke(h) || h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), F());
|
|
1514
|
+
}
|
|
1515
|
+
}, H = (h, C, K) => {
|
|
1516
|
+
if (pe(h)) {
|
|
1517
|
+
h.preventDefault(), M(!0);
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
if (ke(h)) {
|
|
1521
|
+
h.preventDefault(), $(C);
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
switch (h.key) {
|
|
1525
|
+
case "ArrowDown":
|
|
1526
|
+
h.preventDefault(), y(1);
|
|
1527
|
+
break;
|
|
1528
|
+
case "ArrowUp":
|
|
1529
|
+
h.preventDefault(), y(-1);
|
|
1530
|
+
break;
|
|
1531
|
+
case "Home":
|
|
1532
|
+
h.preventDefault(), p.value = V.value.length > 0 ? e.options.indexOf(V.value[0]) : 0, w(p.value);
|
|
1533
|
+
break;
|
|
1534
|
+
case "End":
|
|
1535
|
+
h.preventDefault(), p.value = V.value.length > 0 ? e.options.indexOf(V.value[V.value.length - 1]) : e.options.length - 1, w(p.value);
|
|
1536
|
+
break;
|
|
1537
|
+
}
|
|
1538
|
+
}, x = (h) => {
|
|
1539
|
+
var K;
|
|
1540
|
+
if (!r.value) return;
|
|
1541
|
+
const C = h.target;
|
|
1542
|
+
C instanceof Node && ((K = v.value) != null && K.contains(C) || M());
|
|
1543
|
+
};
|
|
1544
|
+
return ce(r, (h) => {
|
|
1545
|
+
h ? document.addEventListener("pointerdown", x) : document.removeEventListener("pointerdown", x);
|
|
1546
|
+
}), he(() => {
|
|
1547
|
+
document.removeEventListener("pointerdown", x);
|
|
1548
|
+
}), (h, C) => (s(), n("div", {
|
|
1549
|
+
ref_key: "rootRef",
|
|
1550
|
+
ref: v,
|
|
1551
|
+
class: P(g.value),
|
|
1552
|
+
style: Q(A.value),
|
|
1553
|
+
"data-state": D(r) ? "open" : "closed"
|
|
1554
|
+
}, [
|
|
1555
|
+
c("button", J({
|
|
1556
|
+
ref_key: "triggerRef",
|
|
1557
|
+
ref: m
|
|
1558
|
+
}, l.value, {
|
|
1559
|
+
type: "button",
|
|
1560
|
+
class: "tree-select__trigger",
|
|
1561
|
+
disabled: t.disabled,
|
|
1562
|
+
"aria-controls": D(r) ? D(d) : void 0,
|
|
1563
|
+
"aria-haspopup": "listbox",
|
|
1564
|
+
"aria-expanded": D(r),
|
|
1565
|
+
"aria-invalid": t.invalid || void 0,
|
|
1566
|
+
"aria-busy": t.loading || void 0,
|
|
1567
|
+
onClick: X,
|
|
1568
|
+
onKeydown: z
|
|
1569
|
+
}), [
|
|
1570
|
+
h.$slots.prefix ? (s(), n("span", Ya, [
|
|
1571
|
+
T(h.$slots, "prefix")
|
|
1572
|
+
])) : S("", !0),
|
|
1573
|
+
c("span", {
|
|
1574
|
+
class: "tree-select__value",
|
|
1575
|
+
"data-placeholder": t.modelValue ? void 0 : !0
|
|
1576
|
+
}, N(O.value || t.placeholder), 9, Ja),
|
|
1577
|
+
t.loading ? (s(), _e(Ve, {
|
|
1578
|
+
key: 1,
|
|
1579
|
+
size: "sm",
|
|
1580
|
+
label: "Loading"
|
|
1581
|
+
})) : (s(), n("svg", Qa, [...C[0] || (C[0] = [
|
|
1582
|
+
c("polyline", { points: "4 6 8 10 12 6" }, null, -1)
|
|
1583
|
+
])]))
|
|
1584
|
+
], 16, Xa),
|
|
1585
|
+
Y($e, { name: "tree-fade" }, {
|
|
1586
|
+
default: de(() => [
|
|
1587
|
+
D(r) && !t.disabled ? (s(), n("ul", {
|
|
1588
|
+
key: 0,
|
|
1589
|
+
id: D(d),
|
|
1590
|
+
role: "listbox",
|
|
1591
|
+
class: "tree-select__listbox",
|
|
1592
|
+
"aria-label": typeof l.value["aria-label"] == "string" ? l.value["aria-label"] : void 0
|
|
1593
|
+
}, [
|
|
1594
|
+
(s(!0), n(re, null, ie(t.options, (K, ae) => (s(), n("li", {
|
|
1595
|
+
key: K.value,
|
|
1596
|
+
ref_for: !0,
|
|
1597
|
+
ref: (ue) => E(ue, K.value),
|
|
1598
|
+
role: "option",
|
|
1599
|
+
class: P(["tree-select__option", {
|
|
1600
|
+
"is-selected": K.value === t.modelValue,
|
|
1601
|
+
"is-disabled": K.disabled,
|
|
1602
|
+
"is-focused": ae === p.value
|
|
1603
|
+
}]),
|
|
1604
|
+
"aria-selected": K.value === t.modelValue,
|
|
1605
|
+
"aria-disabled": K.disabled || void 0,
|
|
1606
|
+
tabindex: K.disabled ? -1 : 0,
|
|
1607
|
+
onClick: (ue) => $(K),
|
|
1608
|
+
onKeydown: (ue) => H(ue, K)
|
|
1609
|
+
}, [
|
|
1610
|
+
ne(N(K.label) + " ", 1),
|
|
1611
|
+
K.value === t.modelValue ? (s(), n("svg", ts, [...C[1] || (C[1] = [
|
|
1612
|
+
c("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" }, null, -1)
|
|
1613
|
+
])])) : S("", !0)
|
|
1614
|
+
], 42, es))), 128))
|
|
1615
|
+
], 8, Za)) : S("", !0)
|
|
1616
|
+
]),
|
|
1617
|
+
_: 1
|
|
1618
|
+
})
|
|
1619
|
+
], 14, Wa));
|
|
1620
|
+
}
|
|
1621
|
+
}), as = {
|
|
1622
|
+
key: 0,
|
|
1623
|
+
class: "tree-input__slot tree-input__slot--prefix"
|
|
1624
|
+
}, ss = ["type", "value", "placeholder", "disabled", "aria-invalid"], os = {
|
|
1625
|
+
key: 2,
|
|
1626
|
+
class: "tree-input__slot tree-input__slot--suffix"
|
|
1627
|
+
}, ft = /* @__PURE__ */ L({
|
|
1628
|
+
inheritAttrs: !1,
|
|
1629
|
+
__name: "TreeInput",
|
|
1630
|
+
props: {
|
|
1631
|
+
modelValue: { default: "" },
|
|
1632
|
+
size: { default: "md" },
|
|
1633
|
+
disabled: { type: Boolean, default: !1 },
|
|
1634
|
+
loading: { type: Boolean, default: !1 },
|
|
1635
|
+
invalid: { type: Boolean, default: !1 },
|
|
1636
|
+
type: { default: "text" },
|
|
1637
|
+
placeholder: { default: "" }
|
|
1638
|
+
},
|
|
1639
|
+
emits: ["update:modelValue"],
|
|
1640
|
+
setup(t, { emit: a }) {
|
|
1641
|
+
const e = t, o = a, u = se(), d = i(() => [
|
|
1642
|
+
"tree-input",
|
|
1643
|
+
`tree-input--${e.size}`,
|
|
1644
|
+
{
|
|
1645
|
+
"is-disabled": e.disabled,
|
|
1646
|
+
"is-invalid": e.invalid,
|
|
1647
|
+
"is-loading": e.loading
|
|
1648
|
+
},
|
|
1649
|
+
u.class
|
|
1650
|
+
]), v = i(() => u.style), m = i(() => {
|
|
1651
|
+
const { class: l, style: r, ...f } = u;
|
|
1652
|
+
return f;
|
|
1653
|
+
}), _ = i(() => `${e.modelValue ?? ""}`), p = (l) => {
|
|
1654
|
+
o("update:modelValue", l.target.value);
|
|
1655
|
+
};
|
|
1656
|
+
return (l, r) => (s(), n("label", {
|
|
1657
|
+
class: P(d.value),
|
|
1658
|
+
style: Q(v.value)
|
|
1659
|
+
}, [
|
|
1660
|
+
l.$slots.prefix ? (s(), n("span", as, [
|
|
1661
|
+
T(l.$slots, "prefix")
|
|
1662
|
+
])) : S("", !0),
|
|
1663
|
+
c("input", J(m.value, {
|
|
1664
|
+
class: "tree-input__field",
|
|
1665
|
+
type: t.type,
|
|
1666
|
+
value: _.value,
|
|
1667
|
+
placeholder: t.placeholder,
|
|
1668
|
+
disabled: t.disabled,
|
|
1669
|
+
"aria-invalid": t.invalid || void 0,
|
|
1670
|
+
onInput: p
|
|
1671
|
+
}), null, 16, ss),
|
|
1672
|
+
t.loading ? (s(), _e(Ve, {
|
|
1673
|
+
key: 1,
|
|
1674
|
+
size: "sm",
|
|
1675
|
+
label: "Loading"
|
|
1676
|
+
})) : S("", !0),
|
|
1677
|
+
l.$slots.suffix ? (s(), n("span", os, [
|
|
1678
|
+
T(l.$slots, "suffix")
|
|
1679
|
+
])) : S("", !0)
|
|
1680
|
+
], 6));
|
|
1681
|
+
}
|
|
1682
|
+
}), ls = ["value", "placeholder", "disabled", "rows", "aria-invalid"], vt = /* @__PURE__ */ L({
|
|
1683
|
+
inheritAttrs: !1,
|
|
1684
|
+
__name: "TreeTextarea",
|
|
1685
|
+
props: {
|
|
1686
|
+
modelValue: { default: "" },
|
|
1687
|
+
size: { default: "md" },
|
|
1688
|
+
disabled: { type: Boolean, default: !1 },
|
|
1689
|
+
loading: { type: Boolean, default: !1 },
|
|
1690
|
+
invalid: { type: Boolean, default: !1 },
|
|
1691
|
+
placeholder: { default: "" },
|
|
1692
|
+
rows: { default: 3 },
|
|
1693
|
+
autoGrow: { type: Boolean, default: !1 }
|
|
1694
|
+
},
|
|
1695
|
+
emits: ["update:modelValue"],
|
|
1696
|
+
setup(t, { emit: a }) {
|
|
1697
|
+
const e = t, o = a, u = se(), d = j(null), v = i(() => [
|
|
1698
|
+
"tree-textarea",
|
|
1699
|
+
`tree-textarea--${e.size}`,
|
|
1700
|
+
{
|
|
1701
|
+
"is-disabled": e.disabled,
|
|
1702
|
+
"is-invalid": e.invalid,
|
|
1703
|
+
"is-loading": e.loading
|
|
1704
|
+
},
|
|
1705
|
+
u.class
|
|
1706
|
+
]), m = i(() => u.style), _ = i(() => {
|
|
1707
|
+
const { class: f, style: g, ...A } = u;
|
|
1708
|
+
return A;
|
|
1709
|
+
}), p = i(() => `${e.modelValue ?? ""}`), l = (f) => {
|
|
1710
|
+
o("update:modelValue", f.target.value);
|
|
1711
|
+
}, r = () => {
|
|
1712
|
+
const f = d.value;
|
|
1713
|
+
!f || !e.autoGrow || (f.style.height = "auto", f.style.height = `${f.scrollHeight}px`);
|
|
1714
|
+
};
|
|
1715
|
+
return ce(
|
|
1716
|
+
() => e.modelValue,
|
|
1717
|
+
async () => {
|
|
1718
|
+
e.autoGrow && (await Z(), r());
|
|
1719
|
+
}
|
|
1720
|
+
), (f, g) => (s(), n("label", {
|
|
1721
|
+
class: P(v.value),
|
|
1722
|
+
style: Q(m.value)
|
|
1723
|
+
}, [
|
|
1724
|
+
c("textarea", J({
|
|
1725
|
+
ref_key: "textareaRef",
|
|
1726
|
+
ref: d
|
|
1727
|
+
}, _.value, {
|
|
1728
|
+
class: "tree-textarea__field",
|
|
1729
|
+
value: p.value,
|
|
1730
|
+
placeholder: t.placeholder,
|
|
1731
|
+
disabled: t.disabled,
|
|
1732
|
+
rows: t.rows,
|
|
1733
|
+
"aria-invalid": t.invalid || void 0,
|
|
1734
|
+
onInput: l
|
|
1735
|
+
}), null, 16, ls),
|
|
1736
|
+
t.loading ? (s(), _e(Ve, {
|
|
1737
|
+
key: 0,
|
|
1738
|
+
size: "sm",
|
|
1739
|
+
label: "Loading"
|
|
1740
|
+
})) : S("", !0)
|
|
1741
|
+
], 6));
|
|
1742
|
+
}
|
|
1743
|
+
}), ns = ["data-state"], rs = ["aria-disabled"], is = ["data-state"], ds = { class: "tree-modal__positioner" }, cs = ["id", "aria-labelledby", "aria-describedby"], us = {
|
|
1744
|
+
key: 0,
|
|
1745
|
+
class: "tree-modal__topbar"
|
|
1746
|
+
}, fs = { class: "tree-modal__title" }, vs = ["aria-label"], ps = { class: "tree-modal__body" }, bs = {
|
|
1747
|
+
key: 2,
|
|
1748
|
+
class: "tree-modal__footer"
|
|
1749
|
+
}, pt = /* @__PURE__ */ L({
|
|
1750
|
+
inheritAttrs: !1,
|
|
1751
|
+
__name: "TreeModal",
|
|
1752
|
+
props: {
|
|
1753
|
+
open: { type: Boolean, default: void 0 },
|
|
1754
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
1755
|
+
disabled: { type: Boolean, default: !1 },
|
|
1756
|
+
size: { default: "md" },
|
|
1757
|
+
title: { default: "" },
|
|
1758
|
+
description: { default: "" },
|
|
1759
|
+
closeOnEscape: { type: Boolean, default: !0 },
|
|
1760
|
+
closeOnOverlay: { type: Boolean, default: !0 },
|
|
1761
|
+
showCloseButton: { type: Boolean, default: !0 },
|
|
1762
|
+
closeLabel: { default: "Close modal" },
|
|
1763
|
+
id: { default: void 0 }
|
|
1764
|
+
},
|
|
1765
|
+
emits: ["update:open", "open-change"],
|
|
1766
|
+
setup(t, { emit: a }) {
|
|
1767
|
+
const e = me("x"), o = t, u = a, d = se(), v = o.id ?? be("tree-modal"), m = `${v}-title`, _ = `${v}-description`, p = j(null), l = j(null), r = j(null), f = i(() => !!(o.title || g.header)), g = Ye(), A = i(() => ["tree-modal", d.class]), O = i(() => d.style), V = i(() => {
|
|
1768
|
+
const { class: b, style: k, ...R } = d;
|
|
1769
|
+
return R;
|
|
1770
|
+
}), F = i(() => [
|
|
1771
|
+
"tree-modal__surface",
|
|
1772
|
+
`tree-modal__surface--${o.size}`
|
|
1773
|
+
]), { value: M, setValue: X } = Te(
|
|
1774
|
+
ve(o, "open"),
|
|
1775
|
+
o.defaultOpen,
|
|
1776
|
+
(b) => {
|
|
1777
|
+
u("update:open", b), u("open-change", b);
|
|
1778
|
+
}
|
|
1779
|
+
), $ = i(() => f.value ? m : void 0), w = i(() => o.description ? _ : void 0);
|
|
1780
|
+
let E = 0, y = "";
|
|
1781
|
+
const z = () => {
|
|
1782
|
+
typeof document > "u" || (E === 0 && (y = document.body.style.overflow, document.body.style.overflow = "hidden"), E += 1);
|
|
1783
|
+
}, H = () => {
|
|
1784
|
+
typeof document > "u" || E === 0 || (E -= 1, E === 0 && (document.body.style.overflow = y));
|
|
1785
|
+
}, x = () => {
|
|
1786
|
+
Z(() => {
|
|
1787
|
+
if (!l.value)
|
|
1788
|
+
return;
|
|
1789
|
+
Oe(l.value) || l.value.focus();
|
|
1790
|
+
});
|
|
1791
|
+
}, h = () => {
|
|
1792
|
+
o.disabled || (r.value = document.activeElement, X(!0));
|
|
1793
|
+
}, C = () => {
|
|
1794
|
+
X(!1);
|
|
1795
|
+
}, K = (b) => {
|
|
1796
|
+
if (o.disabled) {
|
|
1797
|
+
b.preventDefault(), b.stopPropagation();
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1800
|
+
b.defaultPrevented || h();
|
|
1801
|
+
}, ae = () => {
|
|
1802
|
+
o.closeOnOverlay && C();
|
|
1803
|
+
}, ue = (b) => {
|
|
1804
|
+
b.stopPropagation();
|
|
1805
|
+
}, I = (b) => {
|
|
1806
|
+
if (pe(b) && o.closeOnEscape) {
|
|
1807
|
+
b.preventDefault(), C();
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
if (b.key !== "Tab" || !l.value)
|
|
1811
|
+
return;
|
|
1812
|
+
const k = Pt(l.value);
|
|
1813
|
+
if (!k.length) {
|
|
1814
|
+
b.preventDefault(), l.value.focus();
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
const R = k[0], q = k[k.length - 1], W = document.activeElement;
|
|
1818
|
+
b.shiftKey && W === R && (b.preventDefault(), Mt(l.value)), !b.shiftKey && W === q && (b.preventDefault(), Oe(l.value));
|
|
1819
|
+
};
|
|
1820
|
+
return ce(M, (b, k) => {
|
|
1821
|
+
if (b) {
|
|
1822
|
+
z(), x();
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
k && (H(), Z(() => {
|
|
1826
|
+
var R;
|
|
1827
|
+
(R = r.value) == null || R.focus();
|
|
1828
|
+
}));
|
|
1829
|
+
}), he(() => {
|
|
1830
|
+
M.value && H();
|
|
1831
|
+
}), (b, k) => (s(), n("div", {
|
|
1832
|
+
ref_key: "rootRef",
|
|
1833
|
+
ref: p,
|
|
1834
|
+
class: P(A.value),
|
|
1835
|
+
style: Q(O.value),
|
|
1836
|
+
"data-state": D(M) ? "open" : "closed"
|
|
1837
|
+
}, [
|
|
1838
|
+
b.$slots.trigger ? (s(), n("span", J({
|
|
1839
|
+
key: 0,
|
|
1840
|
+
class: "tree-modal__trigger"
|
|
1841
|
+
}, V.value, {
|
|
1842
|
+
"aria-disabled": t.disabled || void 0,
|
|
1843
|
+
onClick: K
|
|
1844
|
+
}), [
|
|
1845
|
+
T(b.$slots, "trigger")
|
|
1846
|
+
], 16, rs)) : S("", !0),
|
|
1847
|
+
(s(), _e(Ee, { to: "body" }, [
|
|
1848
|
+
Y($e, { name: "tree-modal-fade" }, {
|
|
1849
|
+
default: de(() => [
|
|
1850
|
+
D(M) ? (s(), n("div", {
|
|
1851
|
+
key: 0,
|
|
1852
|
+
class: "tree-modal__portal",
|
|
1853
|
+
"data-state": D(M) ? "open" : "closed"
|
|
1854
|
+
}, [
|
|
1855
|
+
c("div", {
|
|
1856
|
+
class: "tree-modal__backdrop",
|
|
1857
|
+
"aria-hidden": "true",
|
|
1858
|
+
onClick: ae
|
|
1859
|
+
}),
|
|
1860
|
+
c("div", ds, [
|
|
1861
|
+
c("div", {
|
|
1862
|
+
id: D(v),
|
|
1863
|
+
ref_key: "surfaceRef",
|
|
1864
|
+
ref: l,
|
|
1865
|
+
class: P(F.value),
|
|
1866
|
+
role: "dialog",
|
|
1867
|
+
"aria-modal": "true",
|
|
1868
|
+
"aria-labelledby": $.value,
|
|
1869
|
+
"aria-describedby": w.value,
|
|
1870
|
+
tabindex: "-1",
|
|
1871
|
+
onClick: ue,
|
|
1872
|
+
onKeydown: I
|
|
1873
|
+
}, [
|
|
1874
|
+
f.value || t.showCloseButton ? (s(), n("div", us, [
|
|
1875
|
+
f.value ? (s(), n("div", {
|
|
1876
|
+
key: 0,
|
|
1877
|
+
id: m,
|
|
1878
|
+
class: "tree-modal__header"
|
|
1879
|
+
}, [
|
|
1880
|
+
T(b.$slots, "header", {}, () => [
|
|
1881
|
+
c("h2", fs, N(t.title), 1)
|
|
1882
|
+
])
|
|
1883
|
+
])) : S("", !0),
|
|
1884
|
+
t.showCloseButton ? (s(), n("button", {
|
|
1885
|
+
key: 1,
|
|
1886
|
+
type: "button",
|
|
1887
|
+
class: "tree-modal__close",
|
|
1888
|
+
"aria-label": t.closeLabel,
|
|
1889
|
+
onClick: C
|
|
1890
|
+
}, [
|
|
1891
|
+
Y(D(e), Ae(Se(D(De))), null, 16)
|
|
1892
|
+
], 8, vs)) : S("", !0)
|
|
1893
|
+
])) : S("", !0),
|
|
1894
|
+
t.description ? (s(), n("p", {
|
|
1895
|
+
key: 1,
|
|
1896
|
+
id: _,
|
|
1897
|
+
class: "tree-modal__description"
|
|
1898
|
+
}, N(t.description), 1)) : S("", !0),
|
|
1899
|
+
c("div", ps, [
|
|
1900
|
+
T(b.$slots, "content", {}, () => [
|
|
1901
|
+
T(b.$slots, "default")
|
|
1902
|
+
])
|
|
1903
|
+
]),
|
|
1904
|
+
b.$slots.footer ? (s(), n("div", bs, [
|
|
1905
|
+
T(b.$slots, "footer")
|
|
1906
|
+
])) : S("", !0)
|
|
1907
|
+
], 42, cs)
|
|
1908
|
+
])
|
|
1909
|
+
], 8, is)) : S("", !0)
|
|
1910
|
+
]),
|
|
1911
|
+
_: 3
|
|
1912
|
+
})
|
|
1913
|
+
]))
|
|
1914
|
+
], 14, ns));
|
|
1915
|
+
}
|
|
1916
|
+
}), bt = /* @__PURE__ */ L({
|
|
1917
|
+
__name: "TreeSkeleton",
|
|
1918
|
+
props: {
|
|
1919
|
+
width: { default: "100%" },
|
|
1920
|
+
height: { default: void 0 },
|
|
1921
|
+
animation: { default: "pulse" }
|
|
1922
|
+
},
|
|
1923
|
+
setup(t) {
|
|
1924
|
+
const a = t, e = i(() => [
|
|
1925
|
+
"tree-skeleton",
|
|
1926
|
+
a.animation !== "none" ? `tree-skeleton--${a.animation}` : ""
|
|
1927
|
+
]), o = i(() => ({
|
|
1928
|
+
width: a.width,
|
|
1929
|
+
height: a.height
|
|
1930
|
+
}));
|
|
1931
|
+
return (u, d) => (s(), n("span", {
|
|
1932
|
+
class: P(e.value),
|
|
1933
|
+
style: Q(o.value),
|
|
1934
|
+
"aria-hidden": "true"
|
|
1935
|
+
}, [
|
|
1936
|
+
T(u.$slots, "default")
|
|
1937
|
+
], 6));
|
|
1938
|
+
}
|
|
1939
|
+
}), ms = ["checked", "disabled", "aria-checked", "aria-invalid"], _s = {
|
|
1940
|
+
key: 0,
|
|
1941
|
+
class: "tree-switch__label"
|
|
1942
|
+
}, mt = /* @__PURE__ */ L({
|
|
1943
|
+
inheritAttrs: !1,
|
|
1944
|
+
__name: "TreeSwitch",
|
|
1945
|
+
props: {
|
|
1946
|
+
modelValue: { type: Boolean, default: !1 },
|
|
1947
|
+
size: { default: "md" },
|
|
1948
|
+
disabled: { type: Boolean, default: !1 },
|
|
1949
|
+
invalid: { type: Boolean, default: !1 }
|
|
1950
|
+
},
|
|
1951
|
+
emits: ["update:modelValue"],
|
|
1952
|
+
setup(t, { emit: a }) {
|
|
1953
|
+
const e = t, o = a, u = se(), d = i(() => [
|
|
1954
|
+
"tree-switch",
|
|
1955
|
+
`tree-switch--${e.size}`,
|
|
1956
|
+
{
|
|
1957
|
+
"is-checked": e.modelValue,
|
|
1958
|
+
"is-disabled": e.disabled,
|
|
1959
|
+
"is-invalid": e.invalid
|
|
1960
|
+
},
|
|
1961
|
+
u.class
|
|
1962
|
+
]), v = i(() => u.style), m = i(() => {
|
|
1963
|
+
const { class: p, style: l, ...r } = u;
|
|
1964
|
+
return r;
|
|
1965
|
+
}), _ = () => {
|
|
1966
|
+
o("update:modelValue", !e.modelValue);
|
|
1967
|
+
};
|
|
1968
|
+
return (p, l) => (s(), n("label", {
|
|
1969
|
+
class: P(d.value),
|
|
1970
|
+
style: Q(v.value)
|
|
1971
|
+
}, [
|
|
1972
|
+
c("input", J(m.value, {
|
|
1973
|
+
type: "checkbox",
|
|
1974
|
+
role: "switch",
|
|
1975
|
+
class: "tree-switch__input",
|
|
1976
|
+
checked: t.modelValue,
|
|
1977
|
+
disabled: t.disabled,
|
|
1978
|
+
"aria-checked": t.modelValue,
|
|
1979
|
+
"aria-invalid": t.invalid || void 0,
|
|
1980
|
+
onChange: _
|
|
1981
|
+
}), null, 16, ms),
|
|
1982
|
+
l[0] || (l[0] = c("span", {
|
|
1983
|
+
class: "tree-switch__track",
|
|
1984
|
+
"aria-hidden": "true"
|
|
1985
|
+
}, [
|
|
1986
|
+
c("span", { class: "tree-switch__thumb" })
|
|
1987
|
+
], -1)),
|
|
1988
|
+
p.$slots.default ? (s(), n("span", _s, [
|
|
1989
|
+
T(p.$slots, "default")
|
|
1990
|
+
])) : S("", !0)
|
|
1991
|
+
], 6));
|
|
1992
|
+
}
|
|
1993
|
+
}), hs = ["data-state"], ys = ["aria-describedby"], gs = ["id", "data-state"], _t = /* @__PURE__ */ L({
|
|
1994
|
+
inheritAttrs: !1,
|
|
1995
|
+
__name: "TreeTooltip",
|
|
1996
|
+
props: {
|
|
1997
|
+
open: { type: Boolean },
|
|
1998
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
1999
|
+
disabled: { type: Boolean, default: !1 },
|
|
2000
|
+
content: { default: "" },
|
|
2001
|
+
side: { default: "top" },
|
|
2002
|
+
delay: { default: 80 },
|
|
2003
|
+
id: { default: void 0 }
|
|
2004
|
+
},
|
|
2005
|
+
emits: ["update:open", "open-change"],
|
|
2006
|
+
setup(t, { emit: a }) {
|
|
2007
|
+
const e = t, o = a, u = se(), d = e.id ?? be("tree-tooltip"), v = i(() => {
|
|
2008
|
+
const { class: M, style: X, ...$ } = u;
|
|
2009
|
+
return $;
|
|
2010
|
+
}), m = i(() => ["tree-tooltip", u.class]), _ = i(() => u.style), { value: p, setValue: l } = Te(
|
|
2011
|
+
ve(e, "open"),
|
|
2012
|
+
e.defaultOpen,
|
|
2013
|
+
(M) => {
|
|
2014
|
+
o("update:open", M), o("open-change", M);
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
let r;
|
|
2018
|
+
const f = () => {
|
|
2019
|
+
r && (clearTimeout(r), r = void 0);
|
|
2020
|
+
}, g = (M = !1) => {
|
|
2021
|
+
if (!e.disabled) {
|
|
2022
|
+
if (f(), M) {
|
|
2023
|
+
l(!0);
|
|
2024
|
+
return;
|
|
2025
|
+
}
|
|
2026
|
+
r = setTimeout(() => {
|
|
2027
|
+
l(!0);
|
|
2028
|
+
}, e.delay);
|
|
2029
|
+
}
|
|
2030
|
+
}, A = () => {
|
|
2031
|
+
g(!0);
|
|
2032
|
+
}, O = () => {
|
|
2033
|
+
g();
|
|
2034
|
+
}, V = () => {
|
|
2035
|
+
f(), l(!1);
|
|
2036
|
+
}, F = i(() => [
|
|
2037
|
+
"tree-tooltip__content",
|
|
2038
|
+
`tree-tooltip__content--${e.side}`
|
|
2039
|
+
]);
|
|
2040
|
+
return he(f), (M, X) => (s(), n("span", {
|
|
2041
|
+
class: P(m.value),
|
|
2042
|
+
style: Q(_.value),
|
|
2043
|
+
"data-state": D(p) ? "open" : "closed",
|
|
2044
|
+
onMouseenter: O,
|
|
2045
|
+
onMouseleave: V,
|
|
2046
|
+
onFocusCapture: A,
|
|
2047
|
+
onBlurCapture: V
|
|
2048
|
+
}, [
|
|
2049
|
+
c("span", J({
|
|
2050
|
+
class: "tree-tooltip__trigger",
|
|
2051
|
+
"aria-describedby": D(p) ? D(d) : void 0
|
|
2052
|
+
}, v.value), [
|
|
2053
|
+
T(M.$slots, "trigger", {}, () => [
|
|
2054
|
+
T(M.$slots, "default")
|
|
2055
|
+
])
|
|
2056
|
+
], 16, ys),
|
|
2057
|
+
Y($e, { name: "tree-fade" }, {
|
|
2058
|
+
default: de(() => [
|
|
2059
|
+
D(p) && !t.disabled ? (s(), n("span", {
|
|
2060
|
+
key: 0,
|
|
2061
|
+
id: D(d),
|
|
2062
|
+
role: "tooltip",
|
|
2063
|
+
class: P(F.value),
|
|
2064
|
+
"data-state": D(p) ? "open" : "closed"
|
|
2065
|
+
}, [
|
|
2066
|
+
T(M.$slots, "content", {}, () => [
|
|
2067
|
+
ne(N(t.content), 1)
|
|
2068
|
+
])
|
|
2069
|
+
], 10, gs)) : S("", !0)
|
|
2070
|
+
]),
|
|
2071
|
+
_: 3
|
|
2072
|
+
})
|
|
2073
|
+
], 46, hs));
|
|
2074
|
+
}
|
|
2075
|
+
}), ks = ["for"], $s = {
|
|
2076
|
+
key: 0,
|
|
2077
|
+
class: "tree-form-field__required",
|
|
2078
|
+
"aria-hidden": "true"
|
|
2079
|
+
}, Ts = { class: "tree-form-field__control" }, ws = {
|
|
2080
|
+
key: 1,
|
|
2081
|
+
class: "tree-form-field__error",
|
|
2082
|
+
role: "alert"
|
|
2083
|
+
}, Cs = {
|
|
2084
|
+
key: 2,
|
|
2085
|
+
class: "tree-form-field__hint"
|
|
2086
|
+
}, ht = /* @__PURE__ */ L({
|
|
2087
|
+
inheritAttrs: !1,
|
|
2088
|
+
__name: "TreeFormField",
|
|
2089
|
+
props: {
|
|
2090
|
+
label: { default: void 0 },
|
|
2091
|
+
htmlFor: { default: void 0 },
|
|
2092
|
+
error: { default: void 0 },
|
|
2093
|
+
hint: { default: void 0 },
|
|
2094
|
+
required: { type: Boolean, default: !1 },
|
|
2095
|
+
disabled: { type: Boolean, default: !1 },
|
|
2096
|
+
size: { default: "md" }
|
|
2097
|
+
},
|
|
2098
|
+
setup(t) {
|
|
2099
|
+
const a = t, e = se(), o = i(() => !!a.error || !!u.error), u = Ye(), d = i(() => [
|
|
2100
|
+
"tree-form-field",
|
|
2101
|
+
`tree-form-field--${a.size}`,
|
|
2102
|
+
{
|
|
2103
|
+
"is-disabled": a.disabled,
|
|
2104
|
+
"is-invalid": o.value,
|
|
2105
|
+
"is-required": a.required
|
|
2106
|
+
},
|
|
2107
|
+
e.class
|
|
2108
|
+
]), v = i(() => e.style), m = i(() => {
|
|
2109
|
+
const { class: _, style: p, ...l } = e;
|
|
2110
|
+
return l;
|
|
2111
|
+
});
|
|
2112
|
+
return (_, p) => (s(), n("div", J(m.value, {
|
|
2113
|
+
class: d.value,
|
|
2114
|
+
style: v.value
|
|
2115
|
+
}), [
|
|
2116
|
+
t.label || _.$slots.label ? (s(), n("label", {
|
|
2117
|
+
key: 0,
|
|
2118
|
+
class: "tree-form-field__label",
|
|
2119
|
+
for: t.htmlFor
|
|
2120
|
+
}, [
|
|
2121
|
+
T(_.$slots, "label", {}, () => [
|
|
2122
|
+
ne(N(t.label), 1)
|
|
2123
|
+
]),
|
|
2124
|
+
t.required ? (s(), n("span", $s, "*")) : S("", !0)
|
|
2125
|
+
], 8, ks)) : S("", !0),
|
|
2126
|
+
c("div", Ts, [
|
|
2127
|
+
T(_.$slots, "default")
|
|
2128
|
+
]),
|
|
2129
|
+
o.value ? (s(), n("p", ws, [
|
|
2130
|
+
T(_.$slots, "error", {}, () => [
|
|
2131
|
+
ne(N(t.error), 1)
|
|
2132
|
+
])
|
|
2133
|
+
])) : t.hint || _.$slots.hint ? (s(), n("p", Cs, [
|
|
2134
|
+
T(_.$slots, "hint", {}, () => [
|
|
2135
|
+
ne(N(t.hint), 1)
|
|
2136
|
+
])
|
|
2137
|
+
])) : S("", !0)
|
|
2138
|
+
], 16));
|
|
2139
|
+
}
|
|
2140
|
+
}), Ds = ["aria-label"], Bs = { class: "tree-pagination__list" }, xs = { class: "tree-pagination__item" }, Vs = ["disabled"], Is = {
|
|
2141
|
+
key: 0,
|
|
2142
|
+
class: "tree-pagination__ellipsis",
|
|
2143
|
+
"aria-hidden": "true"
|
|
2144
|
+
}, As = ["disabled", "aria-label", "aria-current", "onClick", "onKeydown"], Ss = { class: "tree-pagination__item" }, Os = ["disabled"], yt = /* @__PURE__ */ L({
|
|
2145
|
+
__name: "TreePagination",
|
|
2146
|
+
props: {
|
|
2147
|
+
modelValue: { default: 1 },
|
|
2148
|
+
totalPages: {},
|
|
2149
|
+
siblings: { default: 1 },
|
|
2150
|
+
size: { default: "md" },
|
|
2151
|
+
disabled: { type: Boolean, default: !1 },
|
|
2152
|
+
label: { default: "Pagination" }
|
|
2153
|
+
},
|
|
2154
|
+
emits: ["update:modelValue"],
|
|
2155
|
+
setup(t, { emit: a }) {
|
|
2156
|
+
const e = t, o = a, u = i(
|
|
2157
|
+
() => Math.min(Math.max(1, e.modelValue), e.totalPages)
|
|
2158
|
+
), d = i(() => {
|
|
2159
|
+
const p = e.totalPages, l = u.value, r = e.siblings, f = [], g = Math.max(2, l - r), A = Math.min(p - 1, l + r);
|
|
2160
|
+
f.push(1), g > 2 && f.push("ellipsis");
|
|
2161
|
+
for (let O = g; O <= A; O++)
|
|
2162
|
+
f.push(O);
|
|
2163
|
+
return A < p - 1 && f.push("ellipsis"), p > 1 && f.push(p), f;
|
|
2164
|
+
}), v = i(() => [
|
|
2165
|
+
"tree-pagination",
|
|
2166
|
+
`tree-pagination--${e.size}`,
|
|
2167
|
+
{ "is-disabled": e.disabled }
|
|
2168
|
+
]);
|
|
2169
|
+
function m(p) {
|
|
2170
|
+
if (e.disabled) return;
|
|
2171
|
+
const l = Math.min(Math.max(1, p), e.totalPages);
|
|
2172
|
+
l !== u.value && o("update:modelValue", l);
|
|
2173
|
+
}
|
|
2174
|
+
function _(p, l) {
|
|
2175
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), m(l));
|
|
2176
|
+
}
|
|
2177
|
+
return (p, l) => (s(), n("nav", {
|
|
2178
|
+
class: P(v.value),
|
|
2179
|
+
"aria-label": t.label
|
|
2180
|
+
}, [
|
|
2181
|
+
c("ul", Bs, [
|
|
2182
|
+
c("li", xs, [
|
|
2183
|
+
c("button", {
|
|
2184
|
+
class: "tree-pagination__button tree-pagination__button--prev",
|
|
2185
|
+
type: "button",
|
|
2186
|
+
disabled: t.disabled || u.value <= 1,
|
|
2187
|
+
"aria-label": "Go to previous page",
|
|
2188
|
+
onClick: l[0] || (l[0] = (r) => m(u.value - 1))
|
|
2189
|
+
}, [
|
|
2190
|
+
T(p.$slots, "previous", {}, () => [
|
|
2191
|
+
l[2] || (l[2] = c("svg", {
|
|
2192
|
+
class: "tree-pagination__icon",
|
|
2193
|
+
viewBox: "0 0 16 16",
|
|
2194
|
+
fill: "none",
|
|
2195
|
+
"aria-hidden": "true"
|
|
2196
|
+
}, [
|
|
2197
|
+
c("path", {
|
|
2198
|
+
d: "M10 12L6 8l4-4",
|
|
2199
|
+
stroke: "currentColor",
|
|
2200
|
+
"stroke-width": "2",
|
|
2201
|
+
"stroke-linecap": "round",
|
|
2202
|
+
"stroke-linejoin": "round"
|
|
2203
|
+
})
|
|
2204
|
+
], -1))
|
|
2205
|
+
])
|
|
2206
|
+
], 8, Vs)
|
|
2207
|
+
]),
|
|
2208
|
+
(s(!0), n(re, null, ie(d.value, (r, f) => (s(), n("li", {
|
|
2209
|
+
key: r === "ellipsis" ? `ellipsis-${f}` : r,
|
|
2210
|
+
class: "tree-pagination__item"
|
|
2211
|
+
}, [
|
|
2212
|
+
r === "ellipsis" ? (s(), n("span", Is, " … ")) : (s(), n("button", {
|
|
2213
|
+
key: 1,
|
|
2214
|
+
class: P(["tree-pagination__button", { "is-active": r === u.value }]),
|
|
2215
|
+
type: "button",
|
|
2216
|
+
disabled: t.disabled,
|
|
2217
|
+
"aria-label": `Go to page ${r}`,
|
|
2218
|
+
"aria-current": r === u.value ? "page" : void 0,
|
|
2219
|
+
onClick: (g) => m(r),
|
|
2220
|
+
onKeydown: (g) => _(g, r)
|
|
2221
|
+
}, N(r), 43, As))
|
|
2222
|
+
]))), 128)),
|
|
2223
|
+
c("li", Ss, [
|
|
2224
|
+
c("button", {
|
|
2225
|
+
class: "tree-pagination__button tree-pagination__button--next",
|
|
2226
|
+
type: "button",
|
|
2227
|
+
disabled: t.disabled || u.value >= t.totalPages,
|
|
2228
|
+
"aria-label": "Go to next page",
|
|
2229
|
+
onClick: l[1] || (l[1] = (r) => m(u.value + 1))
|
|
2230
|
+
}, [
|
|
2231
|
+
T(p.$slots, "next", {}, () => [
|
|
2232
|
+
l[3] || (l[3] = c("svg", {
|
|
2233
|
+
class: "tree-pagination__icon",
|
|
2234
|
+
viewBox: "0 0 16 16",
|
|
2235
|
+
fill: "none",
|
|
2236
|
+
"aria-hidden": "true"
|
|
2237
|
+
}, [
|
|
2238
|
+
c("path", {
|
|
2239
|
+
d: "M6 4l4 4-4 4",
|
|
2240
|
+
stroke: "currentColor",
|
|
2241
|
+
"stroke-width": "2",
|
|
2242
|
+
"stroke-linecap": "round",
|
|
2243
|
+
"stroke-linejoin": "round"
|
|
2244
|
+
})
|
|
2245
|
+
], -1))
|
|
2246
|
+
])
|
|
2247
|
+
], 8, Os)
|
|
2248
|
+
])
|
|
2249
|
+
])
|
|
2250
|
+
], 10, Ds));
|
|
2251
|
+
}
|
|
2252
|
+
}), zs = ["data-state"], Ps = ["disabled", "aria-expanded", "aria-controls"], Ms = ["id", "data-state"], gt = /* @__PURE__ */ L({
|
|
2253
|
+
inheritAttrs: !1,
|
|
2254
|
+
__name: "TreePopover",
|
|
2255
|
+
props: {
|
|
2256
|
+
open: { type: Boolean, default: void 0 },
|
|
2257
|
+
defaultOpen: { type: Boolean, default: !1 },
|
|
2258
|
+
disabled: { type: Boolean, default: !1 },
|
|
2259
|
+
side: { default: "bottom" },
|
|
2260
|
+
align: { default: "center" },
|
|
2261
|
+
id: { default: void 0 }
|
|
2262
|
+
},
|
|
2263
|
+
emits: ["update:open", "open-change"],
|
|
2264
|
+
setup(t, { emit: a }) {
|
|
2265
|
+
const e = t, o = a, u = se(), d = e.id ?? be("tree-popover"), v = j(null), m = j(null), _ = j(null), p = i(() => {
|
|
2266
|
+
const { class: w, style: E, ...y } = u;
|
|
2267
|
+
return y;
|
|
2268
|
+
}), { value: l, setValue: r } = Te(
|
|
2269
|
+
ve(e, "open"),
|
|
2270
|
+
e.defaultOpen,
|
|
2271
|
+
(w) => {
|
|
2272
|
+
o("update:open", w), o("open-change", w);
|
|
2273
|
+
}
|
|
2274
|
+
), f = i(() => [
|
|
2275
|
+
"tree-popover",
|
|
2276
|
+
{
|
|
2277
|
+
"is-open": l.value,
|
|
2278
|
+
"is-disabled": e.disabled
|
|
2279
|
+
},
|
|
2280
|
+
u.class
|
|
2281
|
+
]), g = i(() => u.style), A = i(() => [
|
|
2282
|
+
"tree-popover__content",
|
|
2283
|
+
`tree-popover__content--${e.side}`,
|
|
2284
|
+
`tree-popover__content--align-${e.align}`
|
|
2285
|
+
]), O = () => {
|
|
2286
|
+
e.disabled || (r(!0), Z(() => {
|
|
2287
|
+
_.value && (Oe(_.value) || _.value.focus());
|
|
2288
|
+
}));
|
|
2289
|
+
}, V = (w = !1) => {
|
|
2290
|
+
r(!1), w && Z(() => {
|
|
2291
|
+
var E;
|
|
2292
|
+
return (E = m.value) == null ? void 0 : E.focus();
|
|
2293
|
+
});
|
|
2294
|
+
}, F = () => {
|
|
2295
|
+
l.value ? V() : O();
|
|
2296
|
+
}, M = (w) => {
|
|
2297
|
+
e.disabled || pe(w) && l.value && (w.preventDefault(), V());
|
|
2298
|
+
}, X = (w) => {
|
|
2299
|
+
pe(w) && (w.preventDefault(), V(!0));
|
|
2300
|
+
}, $ = (w) => {
|
|
2301
|
+
var y;
|
|
2302
|
+
if (!l.value) return;
|
|
2303
|
+
const E = w.target;
|
|
2304
|
+
E instanceof Node && ((y = v.value) != null && y.contains(E) || V());
|
|
2305
|
+
};
|
|
2306
|
+
return ce(l, (w) => {
|
|
2307
|
+
w ? document.addEventListener("pointerdown", $) : document.removeEventListener("pointerdown", $);
|
|
2308
|
+
}), he(() => {
|
|
2309
|
+
document.removeEventListener("pointerdown", $);
|
|
2310
|
+
}), (w, E) => (s(), n("div", {
|
|
2311
|
+
ref_key: "rootRef",
|
|
2312
|
+
ref: v,
|
|
2313
|
+
class: P(f.value),
|
|
2314
|
+
style: Q(g.value),
|
|
2315
|
+
"data-state": D(l) ? "open" : "closed"
|
|
2316
|
+
}, [
|
|
2317
|
+
c("div", {
|
|
2318
|
+
class: "tree-popover__anchor",
|
|
2319
|
+
onClick: F,
|
|
2320
|
+
onKeydown: M
|
|
2321
|
+
}, [
|
|
2322
|
+
T(w.$slots, "trigger", { isOpen: D(l) }, () => [
|
|
2323
|
+
c("button", J({
|
|
2324
|
+
ref_key: "triggerRef",
|
|
2325
|
+
ref: m,
|
|
2326
|
+
type: "button",
|
|
2327
|
+
class: "tree-popover__trigger",
|
|
2328
|
+
disabled: t.disabled,
|
|
2329
|
+
"aria-expanded": D(l),
|
|
2330
|
+
"aria-controls": D(l) ? D(d) : void 0,
|
|
2331
|
+
"aria-haspopup": "dialog"
|
|
2332
|
+
}, p.value), null, 16, Ps)
|
|
2333
|
+
])
|
|
2334
|
+
], 32),
|
|
2335
|
+
Y($e, { name: "tree-popover-fade" }, {
|
|
2336
|
+
default: de(() => [
|
|
2337
|
+
D(l) && !t.disabled ? (s(), n("div", {
|
|
2338
|
+
key: 0,
|
|
2339
|
+
id: D(d),
|
|
2340
|
+
ref_key: "contentRef",
|
|
2341
|
+
ref: _,
|
|
2342
|
+
role: "dialog",
|
|
2343
|
+
class: P(A.value),
|
|
2344
|
+
"data-state": D(l) ? "open" : "closed",
|
|
2345
|
+
tabindex: "-1",
|
|
2346
|
+
onKeydown: X
|
|
2347
|
+
}, [
|
|
2348
|
+
T(w.$slots, "default")
|
|
2349
|
+
], 42, Ms)) : S("", !0)
|
|
2350
|
+
]),
|
|
2351
|
+
_: 3
|
|
2352
|
+
})
|
|
2353
|
+
], 14, zs));
|
|
2354
|
+
}
|
|
2355
|
+
}), Es = ["aria-valuenow", "aria-label"], Rs = { class: "tree-progress__track" }, Ls = { class: "tree-visually-hidden" }, kt = /* @__PURE__ */ L({
|
|
2356
|
+
__name: "TreeProgress",
|
|
2357
|
+
props: {
|
|
2358
|
+
value: { default: void 0 },
|
|
2359
|
+
max: { default: 100 },
|
|
2360
|
+
size: { default: "md" },
|
|
2361
|
+
label: { default: "Progress" }
|
|
2362
|
+
},
|
|
2363
|
+
setup(t) {
|
|
2364
|
+
const a = t, e = i(() => a.value === void 0 || a.value === null), o = i(() => e.value ? 0 : Math.min(100, Math.max(0, a.value / a.max * 100))), u = i(() => [
|
|
2365
|
+
"tree-progress",
|
|
2366
|
+
`tree-progress--${a.size}`,
|
|
2367
|
+
{ "tree-progress--indeterminate": e.value }
|
|
2368
|
+
]);
|
|
2369
|
+
return (d, v) => (s(), n("div", {
|
|
2370
|
+
class: P(u.value),
|
|
2371
|
+
role: "progressbar",
|
|
2372
|
+
"aria-valuenow": e.value ? void 0 : o.value,
|
|
2373
|
+
"aria-valuemin": 0,
|
|
2374
|
+
"aria-valuemax": 100,
|
|
2375
|
+
"aria-label": t.label
|
|
2376
|
+
}, [
|
|
2377
|
+
c("div", Rs, [
|
|
2378
|
+
c("div", {
|
|
2379
|
+
class: "tree-progress__fill",
|
|
2380
|
+
style: Q(e.value ? void 0 : { width: `${o.value}%` })
|
|
2381
|
+
}, null, 4)
|
|
2382
|
+
]),
|
|
2383
|
+
c("span", Ls, N(t.label), 1)
|
|
2384
|
+
], 10, Es));
|
|
2385
|
+
}
|
|
2386
|
+
}), Re = Symbol("TreeTabs"), $t = /* @__PURE__ */ L({
|
|
2387
|
+
__name: "TreeTabs",
|
|
2388
|
+
props: {
|
|
2389
|
+
modelValue: { default: void 0 },
|
|
2390
|
+
defaultValue: { default: "" },
|
|
2391
|
+
size: { default: "md" },
|
|
2392
|
+
activationMode: { default: "automatic" },
|
|
2393
|
+
disabled: { type: Boolean, default: !1 }
|
|
2394
|
+
},
|
|
2395
|
+
emits: ["update:modelValue"],
|
|
2396
|
+
setup(t, { emit: a }) {
|
|
2397
|
+
const e = t, o = a, u = be("tree-tabs"), d = j(e.defaultValue), v = j([]), m = Ue({}), _ = i(() => e.modelValue ?? d.value), p = (V) => {
|
|
2398
|
+
V !== _.value && (e.modelValue === void 0 && (d.value = V), o("update:modelValue", V));
|
|
2399
|
+
}, l = (V) => {
|
|
2400
|
+
v.value.includes(V) || v.value.push(V);
|
|
2401
|
+
}, r = (V) => {
|
|
2402
|
+
const F = v.value.indexOf(V);
|
|
2403
|
+
F >= 0 && v.value.splice(F, 1), delete m[V];
|
|
2404
|
+
}, f = () => v.value, g = (V) => e.disabled || !!m[V], A = (V, F) => {
|
|
2405
|
+
F ? m[V] = !0 : delete m[V];
|
|
2406
|
+
};
|
|
2407
|
+
ce(
|
|
2408
|
+
() => e.modelValue,
|
|
2409
|
+
(V) => {
|
|
2410
|
+
V !== void 0 && (d.value = V);
|
|
2411
|
+
}
|
|
2412
|
+
), Xe(Re, {
|
|
2413
|
+
activeValue: _,
|
|
2414
|
+
setActiveValue: p,
|
|
2415
|
+
size: ve(e, "size"),
|
|
2416
|
+
activationMode: ve(e, "activationMode"),
|
|
2417
|
+
disabled: ve(e, "disabled"),
|
|
2418
|
+
baseId: u,
|
|
2419
|
+
registerTab: l,
|
|
2420
|
+
unregisterTab: r,
|
|
2421
|
+
getTabValues: f,
|
|
2422
|
+
isTabDisabled: g,
|
|
2423
|
+
setTabDisabled: A
|
|
2424
|
+
});
|
|
2425
|
+
const O = i(() => [
|
|
2426
|
+
"tree-tabs",
|
|
2427
|
+
`tree-tabs--${e.size}`
|
|
2428
|
+
]);
|
|
2429
|
+
return (V, F) => (s(), n("div", {
|
|
2430
|
+
class: P(O.value)
|
|
2431
|
+
}, [
|
|
2432
|
+
T(V.$slots, "default")
|
|
2433
|
+
], 2));
|
|
2434
|
+
}
|
|
2435
|
+
}), Tt = /* @__PURE__ */ L({
|
|
2436
|
+
__name: "TreeTabList",
|
|
2437
|
+
setup(t) {
|
|
2438
|
+
const a = Pe(Re);
|
|
2439
|
+
if (!a)
|
|
2440
|
+
throw new Error("TTabList must be used inside TTabs");
|
|
2441
|
+
const e = j(null), o = () => e.value ? Array.from(
|
|
2442
|
+
e.value.querySelectorAll('[role="tab"]')
|
|
2443
|
+
) : [], u = () => o().filter((l) => {
|
|
2444
|
+
const r = l.dataset.tabValue;
|
|
2445
|
+
return r ? !a.isTabDisabled(r) : !1;
|
|
2446
|
+
}), d = (l) => {
|
|
2447
|
+
const r = u();
|
|
2448
|
+
if (!r.length) return;
|
|
2449
|
+
const f = document.activeElement;
|
|
2450
|
+
let A = r.indexOf(f) + l;
|
|
2451
|
+
A < 0 && (A = r.length - 1), A >= r.length && (A = 0);
|
|
2452
|
+
const O = r[A];
|
|
2453
|
+
if (O.focus(), a.activationMode.value === "automatic") {
|
|
2454
|
+
const V = O.dataset.tabValue;
|
|
2455
|
+
V && a.setActiveValue(V);
|
|
2456
|
+
}
|
|
2457
|
+
}, v = () => {
|
|
2458
|
+
const l = u();
|
|
2459
|
+
if (l.length && (l[0].focus(), a.activationMode.value === "automatic")) {
|
|
2460
|
+
const r = l[0].dataset.tabValue;
|
|
2461
|
+
r && a.setActiveValue(r);
|
|
2462
|
+
}
|
|
2463
|
+
}, m = () => {
|
|
2464
|
+
const l = u();
|
|
2465
|
+
if (!l.length) return;
|
|
2466
|
+
const r = l[l.length - 1];
|
|
2467
|
+
if (r.focus(), a.activationMode.value === "automatic") {
|
|
2468
|
+
const f = r.dataset.tabValue;
|
|
2469
|
+
f && a.setActiveValue(f);
|
|
2470
|
+
}
|
|
2471
|
+
}, _ = (l) => {
|
|
2472
|
+
var r;
|
|
2473
|
+
switch (l.key) {
|
|
2474
|
+
case "ArrowRight":
|
|
2475
|
+
l.preventDefault(), d(1);
|
|
2476
|
+
break;
|
|
2477
|
+
case "ArrowLeft":
|
|
2478
|
+
l.preventDefault(), d(-1);
|
|
2479
|
+
break;
|
|
2480
|
+
case "Home":
|
|
2481
|
+
l.preventDefault(), v();
|
|
2482
|
+
break;
|
|
2483
|
+
case "End":
|
|
2484
|
+
l.preventDefault(), m();
|
|
2485
|
+
break;
|
|
2486
|
+
default:
|
|
2487
|
+
if (a.activationMode.value === "manual" && ke(l)) {
|
|
2488
|
+
l.preventDefault();
|
|
2489
|
+
const g = (r = l.target.dataset) == null ? void 0 : r.tabValue;
|
|
2490
|
+
g && a.setActiveValue(g);
|
|
2491
|
+
}
|
|
2492
|
+
break;
|
|
2493
|
+
}
|
|
2494
|
+
}, p = i(() => [
|
|
2495
|
+
"tree-tabs__list"
|
|
2496
|
+
]);
|
|
2497
|
+
return (l, r) => (s(), n("div", {
|
|
2498
|
+
ref_key: "listRef",
|
|
2499
|
+
ref: e,
|
|
2500
|
+
role: "tablist",
|
|
2501
|
+
"aria-orientation": "horizontal",
|
|
2502
|
+
class: P(p.value),
|
|
2503
|
+
onKeydown: _
|
|
2504
|
+
}, [
|
|
2505
|
+
T(l.$slots, "default")
|
|
2506
|
+
], 34));
|
|
2507
|
+
}
|
|
2508
|
+
}), Ks = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "data-tab-value"], wt = /* @__PURE__ */ L({
|
|
2509
|
+
__name: "TreeTab",
|
|
2510
|
+
props: {
|
|
2511
|
+
value: {},
|
|
2512
|
+
disabled: { type: Boolean, default: !1 }
|
|
2513
|
+
},
|
|
2514
|
+
setup(t) {
|
|
2515
|
+
const a = t, e = Pe(Re);
|
|
2516
|
+
if (!e)
|
|
2517
|
+
throw new Error("TTab must be used inside TTabs");
|
|
2518
|
+
Ot(() => {
|
|
2519
|
+
e.registerTab(a.value), e.setTabDisabled(a.value, a.disabled);
|
|
2520
|
+
}), ce(
|
|
2521
|
+
() => a.disabled,
|
|
2522
|
+
(p) => e.setTabDisabled(a.value, p)
|
|
2523
|
+
), he(() => {
|
|
2524
|
+
e.unregisterTab(a.value);
|
|
2525
|
+
});
|
|
2526
|
+
const o = i(() => e.activeValue.value === a.value), u = i(() => e.isTabDisabled(a.value)), d = i(() => `${e.baseId}-tab-${a.value}`), v = i(() => `${e.baseId}-panel-${a.value}`), m = () => {
|
|
2527
|
+
u.value || e.setActiveValue(a.value);
|
|
2528
|
+
}, _ = i(() => [
|
|
2529
|
+
"tree-tabs__tab",
|
|
2530
|
+
`tree-tabs__tab--${e.size.value}`,
|
|
2531
|
+
{
|
|
2532
|
+
"is-active": o.value,
|
|
2533
|
+
"is-disabled": u.value
|
|
2534
|
+
}
|
|
2535
|
+
]);
|
|
2536
|
+
return (p, l) => (s(), n("button", {
|
|
2537
|
+
id: d.value,
|
|
2538
|
+
role: "tab",
|
|
2539
|
+
type: "button",
|
|
2540
|
+
class: P(_.value),
|
|
2541
|
+
"aria-selected": o.value,
|
|
2542
|
+
"aria-controls": v.value,
|
|
2543
|
+
tabindex: o.value ? 0 : -1,
|
|
2544
|
+
disabled: u.value || void 0,
|
|
2545
|
+
"data-tab-value": t.value,
|
|
2546
|
+
onClick: m
|
|
2547
|
+
}, [
|
|
2548
|
+
T(p.$slots, "default")
|
|
2549
|
+
], 10, Ks));
|
|
2550
|
+
}
|
|
2551
|
+
}), Fs = ["id", "aria-labelledby"], Ct = /* @__PURE__ */ L({
|
|
2552
|
+
__name: "TreeTabPanel",
|
|
2553
|
+
props: {
|
|
2554
|
+
value: {}
|
|
2555
|
+
},
|
|
2556
|
+
setup(t) {
|
|
2557
|
+
const a = t, e = Pe(Re);
|
|
2558
|
+
if (!e)
|
|
2559
|
+
throw new Error("TTabPanel must be used inside TTabs");
|
|
2560
|
+
const o = i(() => e.activeValue.value === a.value), u = i(() => `${e.baseId}-panel-${a.value}`), d = i(() => `${e.baseId}-tab-${a.value}`);
|
|
2561
|
+
return (v, m) => o.value ? (s(), n("div", {
|
|
2562
|
+
key: 0,
|
|
2563
|
+
id: u.value,
|
|
2564
|
+
role: "tabpanel",
|
|
2565
|
+
"aria-labelledby": d.value,
|
|
2566
|
+
tabindex: "0",
|
|
2567
|
+
class: "tree-tabs__panel"
|
|
2568
|
+
}, [
|
|
2569
|
+
T(v.$slots, "default")
|
|
2570
|
+
], 8, Fs)) : S("", !0);
|
|
2571
|
+
}
|
|
2572
|
+
}), Hs = ["aria-describedby"], js = {
|
|
2573
|
+
class: "tree-toast__icon",
|
|
2574
|
+
"aria-hidden": "true"
|
|
2575
|
+
}, Us = { class: "tree-toast__content" }, Ge = /* @__PURE__ */ L({
|
|
2576
|
+
__name: "TreeToast",
|
|
2577
|
+
props: {
|
|
2578
|
+
toast: {}
|
|
2579
|
+
},
|
|
2580
|
+
emits: ["close"],
|
|
2581
|
+
setup(t, { emit: a }) {
|
|
2582
|
+
const e = me("x"), o = {
|
|
2583
|
+
info: me("info"),
|
|
2584
|
+
success: me("check"),
|
|
2585
|
+
warning: me("alert-circle"),
|
|
2586
|
+
danger: me("alert-circle")
|
|
2587
|
+
}, u = t, d = a, v = be("tree-toast-item"), m = `${v}-title`, _ = `${v}-description`, p = i(() => [
|
|
2588
|
+
"tree-toast",
|
|
2589
|
+
`tree-toast--${u.toast.variant}`
|
|
2590
|
+
]), l = i(() => o[u.toast.variant]);
|
|
2591
|
+
function r() {
|
|
2592
|
+
d("close", u.toast.id);
|
|
2593
|
+
}
|
|
2594
|
+
return (f, g) => (s(), n("div", {
|
|
2595
|
+
class: P(p.value),
|
|
2596
|
+
role: "status",
|
|
2597
|
+
"aria-labelledby": m,
|
|
2598
|
+
"aria-describedby": t.toast.description ? _ : void 0
|
|
2599
|
+
}, [
|
|
2600
|
+
c("span", js, [
|
|
2601
|
+
Y(D(l), J(D(De), { size: 18 }), null, 16)
|
|
2602
|
+
]),
|
|
2603
|
+
c("div", Us, [
|
|
2604
|
+
c("p", {
|
|
2605
|
+
id: m,
|
|
2606
|
+
class: "tree-toast__title"
|
|
2607
|
+
}, N(t.toast.title), 1),
|
|
2608
|
+
t.toast.description ? (s(), n("p", {
|
|
2609
|
+
key: 0,
|
|
2610
|
+
id: _,
|
|
2611
|
+
class: "tree-toast__description"
|
|
2612
|
+
}, N(t.toast.description), 1)) : S("", !0)
|
|
2613
|
+
]),
|
|
2614
|
+
t.toast.closable ? (s(), n("button", {
|
|
2615
|
+
key: 0,
|
|
2616
|
+
type: "button",
|
|
2617
|
+
class: "tree-toast__close",
|
|
2618
|
+
"aria-label": "Dismiss notification",
|
|
2619
|
+
onClick: r
|
|
2620
|
+
}, [
|
|
2621
|
+
Y(D(e), J(D(De), { size: 16 }), null, 16)
|
|
2622
|
+
])) : S("", !0)
|
|
2623
|
+
], 10, Hs));
|
|
2624
|
+
}
|
|
2625
|
+
}), Ie = j([]), ze = /* @__PURE__ */ new Map();
|
|
2626
|
+
function Ns(t) {
|
|
2627
|
+
const a = be("tree-toast"), e = {
|
|
2628
|
+
id: a,
|
|
2629
|
+
title: t.title,
|
|
2630
|
+
description: t.description,
|
|
2631
|
+
variant: t.variant ?? "info",
|
|
2632
|
+
duration: t.duration ?? 5e3,
|
|
2633
|
+
closable: t.closable ?? !0
|
|
2634
|
+
};
|
|
2635
|
+
if (Ie.value = [...Ie.value, e], e.duration > 0) {
|
|
2636
|
+
const o = setTimeout(() => {
|
|
2637
|
+
Rt(a);
|
|
2638
|
+
}, e.duration);
|
|
2639
|
+
ze.set(a, o);
|
|
2640
|
+
}
|
|
2641
|
+
return a;
|
|
2642
|
+
}
|
|
2643
|
+
function Rt(t) {
|
|
2644
|
+
const a = ze.get(t);
|
|
2645
|
+
a && (clearTimeout(a), ze.delete(t)), Ie.value = Ie.value.filter((e) => e.id !== t);
|
|
2646
|
+
}
|
|
2647
|
+
function qs() {
|
|
2648
|
+
for (const t of ze.values())
|
|
2649
|
+
clearTimeout(t);
|
|
2650
|
+
ze.clear(), Ie.value = [];
|
|
2651
|
+
}
|
|
2652
|
+
function Gs() {
|
|
2653
|
+
return {
|
|
2654
|
+
toasts: Kt(Ie),
|
|
2655
|
+
add: Ns,
|
|
2656
|
+
remove: Rt,
|
|
2657
|
+
clear: qs
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
const Dt = /* @__PURE__ */ L({
|
|
2661
|
+
__name: "TreeToastProvider",
|
|
2662
|
+
props: {
|
|
2663
|
+
position: { default: "bottom-right" },
|
|
2664
|
+
max: { default: 5 }
|
|
2665
|
+
},
|
|
2666
|
+
setup(t) {
|
|
2667
|
+
const a = t, { toasts: e, remove: o } = Gs(), u = i(
|
|
2668
|
+
() => e.value.slice(-a.max)
|
|
2669
|
+
), d = i(() => [
|
|
2670
|
+
"tree-toast-provider",
|
|
2671
|
+
`tree-toast-provider--${a.position}`
|
|
2672
|
+
]);
|
|
2673
|
+
function v(m) {
|
|
2674
|
+
o(m);
|
|
2675
|
+
}
|
|
2676
|
+
return (m, _) => (s(), _e(Ee, { to: "body" }, [
|
|
2677
|
+
c("div", {
|
|
2678
|
+
class: P(d.value),
|
|
2679
|
+
"aria-live": "polite",
|
|
2680
|
+
"aria-relevant": "additions removals"
|
|
2681
|
+
}, [
|
|
2682
|
+
Y(Ft, { name: "tree-toast" }, {
|
|
2683
|
+
default: de(() => [
|
|
2684
|
+
(s(!0), n(re, null, ie(u.value, (p) => (s(), _e(Ge, {
|
|
2685
|
+
key: p.id,
|
|
2686
|
+
toast: p,
|
|
2687
|
+
onClose: v
|
|
2688
|
+
}, null, 8, ["toast"]))), 128))
|
|
2689
|
+
]),
|
|
2690
|
+
_: 1
|
|
2691
|
+
})
|
|
2692
|
+
], 2)
|
|
2693
|
+
]));
|
|
2694
|
+
}
|
|
2695
|
+
}), Ws = ["aria-label"], Xs = ["src", "alt"], Ys = {
|
|
2696
|
+
key: 1,
|
|
2697
|
+
class: "tree-avatar__initials",
|
|
2698
|
+
"aria-hidden": "true"
|
|
2699
|
+
}, Js = ["aria-label"], Bt = /* @__PURE__ */ L({
|
|
2700
|
+
__name: "TreeAvatar",
|
|
2701
|
+
props: {
|
|
2702
|
+
src: { default: void 0 },
|
|
2703
|
+
alt: { default: "" },
|
|
2704
|
+
initials: { default: void 0 },
|
|
2705
|
+
size: { default: "md" },
|
|
2706
|
+
status: { default: void 0 }
|
|
2707
|
+
},
|
|
2708
|
+
setup(t) {
|
|
2709
|
+
const a = t, e = i(() => [
|
|
2710
|
+
"tree-avatar",
|
|
2711
|
+
`tree-avatar--${a.size}`
|
|
2712
|
+
]), o = i(() => a.initials ? a.initials : a.alt ? a.alt.split(" ").filter(Boolean).map((d) => d[0]).slice(0, 2).join("").toUpperCase() : "");
|
|
2713
|
+
function u(d) {
|
|
2714
|
+
const v = d.target;
|
|
2715
|
+
v.style.display = "none";
|
|
2716
|
+
}
|
|
2717
|
+
return (d, v) => (s(), n("span", {
|
|
2718
|
+
class: P(e.value),
|
|
2719
|
+
role: "img",
|
|
2720
|
+
"aria-label": t.alt || void 0
|
|
2721
|
+
}, [
|
|
2722
|
+
t.src ? (s(), n("img", {
|
|
2723
|
+
key: 0,
|
|
2724
|
+
src: t.src,
|
|
2725
|
+
alt: t.alt,
|
|
2726
|
+
class: "tree-avatar__image",
|
|
2727
|
+
onError: u
|
|
2728
|
+
}, null, 40, Xs)) : (s(), n("span", Ys, N(o.value), 1)),
|
|
2729
|
+
T(d.$slots, "default"),
|
|
2730
|
+
t.status ? (s(), n("span", {
|
|
2731
|
+
key: 2,
|
|
2732
|
+
class: P(["tree-avatar__status", `tree-avatar__status--${t.status}`]),
|
|
2733
|
+
"aria-label": t.status
|
|
2734
|
+
}, null, 10, Js)) : S("", !0)
|
|
2735
|
+
], 10, Ws));
|
|
2736
|
+
}
|
|
2737
|
+
}), Qs = ["role", "aria-orientation", "aria-label"], xt = /* @__PURE__ */ L({
|
|
2738
|
+
__name: "TreeDivider",
|
|
2739
|
+
props: {
|
|
2740
|
+
orientation: { default: "horizontal" },
|
|
2741
|
+
decorative: { type: Boolean, default: !0 },
|
|
2742
|
+
label: { default: void 0 }
|
|
2743
|
+
},
|
|
2744
|
+
setup(t) {
|
|
2745
|
+
const a = t, e = i(() => [
|
|
2746
|
+
"tree-divider",
|
|
2747
|
+
`tree-divider--${a.orientation}`
|
|
2748
|
+
]);
|
|
2749
|
+
return (o, u) => (s(), n("hr", {
|
|
2750
|
+
class: P(e.value),
|
|
2751
|
+
role: t.decorative ? "none" : "separator",
|
|
2752
|
+
"aria-orientation": t.decorative ? void 0 : t.orientation,
|
|
2753
|
+
"aria-label": t.decorative ? void 0 : t.label
|
|
2754
|
+
}, null, 10, Qs));
|
|
2755
|
+
}
|
|
2756
|
+
}), Zs = { class: "tree-table-wrapper" }, eo = { class: "tree-table__head" }, to = { class: "tree-table__row" }, ao = ["aria-sort", "tabindex", "onClick", "onKeydown"], so = { class: "tree-table__header-content" }, oo = {
|
|
2757
|
+
key: 0,
|
|
2758
|
+
class: "tree-table__sort-icon",
|
|
2759
|
+
"aria-hidden": "true"
|
|
2760
|
+
}, lo = {
|
|
2761
|
+
key: 0,
|
|
2762
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2763
|
+
width: "14",
|
|
2764
|
+
height: "14",
|
|
2765
|
+
viewBox: "0 0 24 24",
|
|
2766
|
+
fill: "none",
|
|
2767
|
+
stroke: "currentColor",
|
|
2768
|
+
"stroke-width": "2",
|
|
2769
|
+
"stroke-linecap": "round",
|
|
2770
|
+
"stroke-linejoin": "round"
|
|
2771
|
+
}, no = {
|
|
2772
|
+
key: 1,
|
|
2773
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2774
|
+
width: "14",
|
|
2775
|
+
height: "14",
|
|
2776
|
+
viewBox: "0 0 24 24",
|
|
2777
|
+
fill: "none",
|
|
2778
|
+
stroke: "currentColor",
|
|
2779
|
+
"stroke-width": "2",
|
|
2780
|
+
"stroke-linecap": "round",
|
|
2781
|
+
"stroke-linejoin": "round"
|
|
2782
|
+
}, ro = {
|
|
2783
|
+
key: 2,
|
|
2784
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2785
|
+
width: "14",
|
|
2786
|
+
height: "14",
|
|
2787
|
+
viewBox: "0 0 24 24",
|
|
2788
|
+
fill: "none",
|
|
2789
|
+
stroke: "currentColor",
|
|
2790
|
+
"stroke-width": "2",
|
|
2791
|
+
"stroke-linecap": "round",
|
|
2792
|
+
"stroke-linejoin": "round",
|
|
2793
|
+
style: { opacity: "0.4" }
|
|
2794
|
+
}, io = { class: "tree-table__body" }, co = {
|
|
2795
|
+
key: 0,
|
|
2796
|
+
class: "tree-table__row tree-table__row--empty"
|
|
2797
|
+
}, uo = ["colspan"], Vt = /* @__PURE__ */ L({
|
|
2798
|
+
__name: "TreeTable",
|
|
2799
|
+
props: {
|
|
2800
|
+
columns: {},
|
|
2801
|
+
rows: {},
|
|
2802
|
+
size: { default: "md" },
|
|
2803
|
+
sortBy: { default: void 0 }
|
|
2804
|
+
},
|
|
2805
|
+
emits: ["sort"],
|
|
2806
|
+
setup(t, { emit: a }) {
|
|
2807
|
+
const e = t, o = a, u = j(void 0), d = i(() => e.sortBy ?? u.value), v = i(() => [
|
|
2808
|
+
"tree-table",
|
|
2809
|
+
`tree-table--${e.size}`
|
|
2810
|
+
]), m = i(() => {
|
|
2811
|
+
const r = d.value;
|
|
2812
|
+
return !r || r.direction === "none" ? e.rows : [...e.rows].sort((f, g) => {
|
|
2813
|
+
const A = f[r.key], O = g[r.key];
|
|
2814
|
+
if (A == null && O == null) return 0;
|
|
2815
|
+
if (A == null) return 1;
|
|
2816
|
+
if (O == null) return -1;
|
|
2817
|
+
const V = typeof A == "number" && typeof O == "number" ? A - O : String(A).localeCompare(String(O));
|
|
2818
|
+
return r.direction === "desc" ? -V : V;
|
|
2819
|
+
});
|
|
2820
|
+
});
|
|
2821
|
+
function _(r) {
|
|
2822
|
+
if (!r.sortable) return;
|
|
2823
|
+
const f = d.value;
|
|
2824
|
+
let g = "asc";
|
|
2825
|
+
(f == null ? void 0 : f.key) === r.key && (f.direction === "asc" ? g = "desc" : f.direction === "desc" ? g = "none" : g = "asc");
|
|
2826
|
+
const A = { key: r.key, direction: g };
|
|
2827
|
+
u.value = A, o("sort", A);
|
|
2828
|
+
}
|
|
2829
|
+
function p(r) {
|
|
2830
|
+
if (!r.sortable) return;
|
|
2831
|
+
const f = d.value;
|
|
2832
|
+
return (f == null ? void 0 : f.key) !== r.key || f.direction === "none" ? "none" : f.direction === "asc" ? "ascending" : "descending";
|
|
2833
|
+
}
|
|
2834
|
+
function l(r, f) {
|
|
2835
|
+
f.sortable && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), _(f));
|
|
2836
|
+
}
|
|
2837
|
+
return (r, f) => (s(), n("div", Zs, [
|
|
2838
|
+
c("table", {
|
|
2839
|
+
class: P(v.value),
|
|
2840
|
+
role: "grid"
|
|
2841
|
+
}, [
|
|
2842
|
+
c("thead", eo, [
|
|
2843
|
+
c("tr", to, [
|
|
2844
|
+
(s(!0), n(re, null, ie(t.columns, (g) => (s(), n("th", {
|
|
2845
|
+
key: g.key,
|
|
2846
|
+
class: P(["tree-table__header", [
|
|
2847
|
+
g.sortable ? "tree-table__header--sortable" : "",
|
|
2848
|
+
g.align ? `tree-table__header--${g.align}` : ""
|
|
2849
|
+
]]),
|
|
2850
|
+
style: Q(g.width ? { width: g.width } : void 0),
|
|
2851
|
+
"aria-sort": p(g),
|
|
2852
|
+
tabindex: g.sortable ? 0 : void 0,
|
|
2853
|
+
scope: "col",
|
|
2854
|
+
onClick: (A) => _(g),
|
|
2855
|
+
onKeydown: (A) => l(A, g)
|
|
2856
|
+
}, [
|
|
2857
|
+
T(r.$slots, `header-${g.key}`, { column: g }, () => {
|
|
2858
|
+
var A, O;
|
|
2859
|
+
return [
|
|
2860
|
+
c("span", so, [
|
|
2861
|
+
ne(N(g.label) + " ", 1),
|
|
2862
|
+
g.sortable ? (s(), n("span", oo, [
|
|
2863
|
+
((A = d.value) == null ? void 0 : A.key) === g.key && d.value.direction === "asc" ? (s(), n("svg", lo, [...f[0] || (f[0] = [
|
|
2864
|
+
c("path", { d: "m18 15-6-6-6 6" }, null, -1)
|
|
2865
|
+
])])) : ((O = d.value) == null ? void 0 : O.key) === g.key && d.value.direction === "desc" ? (s(), n("svg", no, [...f[1] || (f[1] = [
|
|
2866
|
+
c("path", { d: "m6 9 6 6 6-6" }, null, -1)
|
|
2867
|
+
])])) : (s(), n("svg", ro, [...f[2] || (f[2] = [
|
|
2868
|
+
c("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
2869
|
+
c("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
2870
|
+
])]))
|
|
2871
|
+
])) : S("", !0)
|
|
2872
|
+
])
|
|
2873
|
+
];
|
|
2874
|
+
})
|
|
2875
|
+
], 46, ao))), 128))
|
|
2876
|
+
])
|
|
2877
|
+
]),
|
|
2878
|
+
c("tbody", io, [
|
|
2879
|
+
m.value.length === 0 ? (s(), n("tr", co, [
|
|
2880
|
+
c("td", {
|
|
2881
|
+
colspan: t.columns.length,
|
|
2882
|
+
class: "tree-table__cell tree-table__cell--empty"
|
|
2883
|
+
}, [
|
|
2884
|
+
T(r.$slots, "empty", {}, () => [
|
|
2885
|
+
f[3] || (f[3] = ne(" No data available. ", -1))
|
|
2886
|
+
])
|
|
2887
|
+
], 8, uo)
|
|
2888
|
+
])) : S("", !0),
|
|
2889
|
+
(s(!0), n(re, null, ie(m.value, (g, A) => (s(), n("tr", {
|
|
2890
|
+
key: A,
|
|
2891
|
+
class: "tree-table__row"
|
|
2892
|
+
}, [
|
|
2893
|
+
(s(!0), n(re, null, ie(t.columns, (O) => (s(), n("td", {
|
|
2894
|
+
key: O.key,
|
|
2895
|
+
class: P(["tree-table__cell", O.align ? `tree-table__cell--${O.align}` : ""])
|
|
2896
|
+
}, [
|
|
2897
|
+
T(r.$slots, `cell-${O.key}`, {
|
|
2898
|
+
row: g,
|
|
2899
|
+
value: g[O.key]
|
|
2900
|
+
}, () => [
|
|
2901
|
+
ne(N(g[O.key] ?? ""), 1)
|
|
2902
|
+
])
|
|
2903
|
+
], 2))), 128))
|
|
2904
|
+
]))), 128))
|
|
2905
|
+
])
|
|
2906
|
+
], 2)
|
|
2907
|
+
]));
|
|
2908
|
+
}
|
|
2909
|
+
}), fo = {
|
|
2910
|
+
key: 0,
|
|
2911
|
+
class: "tree-tag__icon",
|
|
2912
|
+
"aria-hidden": "true"
|
|
2913
|
+
}, vo = { class: "tree-tag__label" }, po = ["disabled"], It = /* @__PURE__ */ L({
|
|
2914
|
+
__name: "TreeTag",
|
|
2915
|
+
props: {
|
|
2916
|
+
variant: { default: "soft" },
|
|
2917
|
+
size: { default: "md" },
|
|
2918
|
+
removable: { type: Boolean, default: !1 },
|
|
2919
|
+
disabled: { type: Boolean, default: !1 }
|
|
2920
|
+
},
|
|
2921
|
+
emits: ["remove"],
|
|
2922
|
+
setup(t, { emit: a }) {
|
|
2923
|
+
const e = t, o = a, u = i(() => [
|
|
2924
|
+
"tree-tag",
|
|
2925
|
+
`tree-tag--${e.variant}`,
|
|
2926
|
+
`tree-tag--${e.size}`,
|
|
2927
|
+
e.disabled ? "is-disabled" : ""
|
|
2928
|
+
]);
|
|
2929
|
+
function d() {
|
|
2930
|
+
e.disabled || o("remove");
|
|
2931
|
+
}
|
|
2932
|
+
return (v, m) => (s(), n("span", {
|
|
2933
|
+
class: P(u.value)
|
|
2934
|
+
}, [
|
|
2935
|
+
v.$slots.icon ? (s(), n("span", fo, [
|
|
2936
|
+
T(v.$slots, "icon")
|
|
2937
|
+
])) : S("", !0),
|
|
2938
|
+
c("span", vo, [
|
|
2939
|
+
T(v.$slots, "default")
|
|
2940
|
+
]),
|
|
2941
|
+
t.removable ? (s(), n("button", {
|
|
2942
|
+
key: 1,
|
|
2943
|
+
type: "button",
|
|
2944
|
+
class: "tree-tag__remove",
|
|
2945
|
+
disabled: t.disabled,
|
|
2946
|
+
"aria-label": "Remove",
|
|
2947
|
+
onClick: d
|
|
2948
|
+
}, [...m[0] || (m[0] = [
|
|
2949
|
+
c("svg", {
|
|
2950
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2951
|
+
width: "14",
|
|
2952
|
+
height: "14",
|
|
2953
|
+
viewBox: "0 0 24 24",
|
|
2954
|
+
fill: "none",
|
|
2955
|
+
stroke: "currentColor",
|
|
2956
|
+
"stroke-width": "2",
|
|
2957
|
+
"stroke-linecap": "round",
|
|
2958
|
+
"stroke-linejoin": "round",
|
|
2959
|
+
"aria-hidden": "true"
|
|
2960
|
+
}, [
|
|
2961
|
+
c("path", { d: "M18 6 6 18" }),
|
|
2962
|
+
c("path", { d: "m6 6 12 12" })
|
|
2963
|
+
], -1)
|
|
2964
|
+
])], 8, po)) : S("", !0)
|
|
2965
|
+
], 2));
|
|
2966
|
+
}
|
|
2967
|
+
}), bo = {
|
|
2968
|
+
key: 0,
|
|
2969
|
+
class: "tree-pricing-card__badge"
|
|
2970
|
+
}, mo = { class: "tree-pricing-card__header" }, _o = { class: "tree-pricing-card__title" }, ho = {
|
|
2971
|
+
key: 0,
|
|
2972
|
+
class: "tree-pricing-card__description"
|
|
2973
|
+
}, yo = { class: "tree-pricing-card__price" }, go = { class: "tree-pricing-card__currency" }, ko = { class: "tree-pricing-card__amount" }, $o = {
|
|
2974
|
+
key: 0,
|
|
2975
|
+
class: "tree-pricing-card__period"
|
|
2976
|
+
}, To = {
|
|
2977
|
+
key: 1,
|
|
2978
|
+
class: "tree-pricing-card__features"
|
|
2979
|
+
}, wo = {
|
|
2980
|
+
class: "tree-pricing-card__feature-list",
|
|
2981
|
+
role: "list"
|
|
2982
|
+
}, Co = {
|
|
2983
|
+
class: "tree-pricing-card__feature-icon",
|
|
2984
|
+
"aria-hidden": "true"
|
|
2985
|
+
}, Do = {
|
|
2986
|
+
key: 2,
|
|
2987
|
+
class: "tree-pricing-card__action"
|
|
2988
|
+
}, We = /* @__PURE__ */ L({
|
|
2989
|
+
__name: "TreePricingCard",
|
|
2990
|
+
props: {
|
|
2991
|
+
title: {},
|
|
2992
|
+
description: { default: void 0 },
|
|
2993
|
+
price: {},
|
|
2994
|
+
currency: { default: "$" },
|
|
2995
|
+
period: { default: void 0 },
|
|
2996
|
+
features: { default: () => [] },
|
|
2997
|
+
highlighted: { type: Boolean, default: !1 },
|
|
2998
|
+
badge: { default: void 0 },
|
|
2999
|
+
buttonText: { default: void 0 },
|
|
3000
|
+
size: { default: "md" },
|
|
3001
|
+
disabled: { type: Boolean, default: !1 }
|
|
3002
|
+
},
|
|
3003
|
+
emits: ["select"],
|
|
3004
|
+
setup(t, { emit: a }) {
|
|
3005
|
+
const e = t, o = a, u = i(() => [
|
|
3006
|
+
"tree-pricing-card",
|
|
3007
|
+
`tree-pricing-card--${e.size}`,
|
|
3008
|
+
{
|
|
3009
|
+
"tree-pricing-card--highlighted": e.highlighted
|
|
3010
|
+
}
|
|
3011
|
+
]), d = () => {
|
|
3012
|
+
e.disabled || o("select");
|
|
3013
|
+
};
|
|
3014
|
+
return (v, m) => (s(), n("article", {
|
|
3015
|
+
class: P(u.value)
|
|
3016
|
+
}, [
|
|
3017
|
+
t.badge || v.$slots.badge ? (s(), n("div", bo, [
|
|
3018
|
+
T(v.$slots, "badge", {}, () => [
|
|
3019
|
+
Y(Ne, {
|
|
3020
|
+
variant: "solid",
|
|
3021
|
+
size: "sm"
|
|
3022
|
+
}, {
|
|
3023
|
+
default: de(() => [
|
|
3024
|
+
ne(N(t.badge), 1)
|
|
3025
|
+
]),
|
|
3026
|
+
_: 1
|
|
3027
|
+
})
|
|
3028
|
+
])
|
|
3029
|
+
])) : S("", !0),
|
|
3030
|
+
c("header", mo, [
|
|
3031
|
+
T(v.$slots, "header", {}, () => [
|
|
3032
|
+
c("h3", _o, N(t.title), 1),
|
|
3033
|
+
t.description ? (s(), n("p", ho, N(t.description), 1)) : S("", !0)
|
|
3034
|
+
])
|
|
3035
|
+
]),
|
|
3036
|
+
c("div", yo, [
|
|
3037
|
+
T(v.$slots, "price", {}, () => [
|
|
3038
|
+
c("span", go, N(t.currency), 1),
|
|
3039
|
+
c("span", ko, N(t.price), 1),
|
|
3040
|
+
t.period ? (s(), n("span", $o, N(t.period), 1)) : S("", !0)
|
|
3041
|
+
])
|
|
3042
|
+
]),
|
|
3043
|
+
t.features.length > 0 || v.$slots.features ? (s(), n("div", To, [
|
|
3044
|
+
T(v.$slots, "features", {}, () => [
|
|
3045
|
+
c("ul", wo, [
|
|
3046
|
+
(s(!0), n(re, null, ie(t.features, (_, p) => (s(), n("li", {
|
|
3047
|
+
key: p,
|
|
3048
|
+
class: P(["tree-pricing-card__feature-item", { "tree-pricing-card__feature-item--excluded": _.included === !1 }])
|
|
3049
|
+
}, [
|
|
3050
|
+
c("span", Co, N(_.included === !1 ? "✕" : "✓"), 1),
|
|
3051
|
+
c("span", null, N(_.text), 1)
|
|
3052
|
+
], 2))), 128))
|
|
3053
|
+
])
|
|
3054
|
+
])
|
|
3055
|
+
])) : S("", !0),
|
|
3056
|
+
t.buttonText || v.$slots.action ? (s(), n("footer", Do, [
|
|
3057
|
+
T(v.$slots, "action", {}, () => [
|
|
3058
|
+
Y(qe, {
|
|
3059
|
+
variant: t.highlighted ? "solid" : "outline",
|
|
3060
|
+
size: t.size,
|
|
3061
|
+
disabled: t.disabled,
|
|
3062
|
+
onClick: d
|
|
3063
|
+
}, {
|
|
3064
|
+
default: de(() => [
|
|
3065
|
+
ne(N(t.buttonText), 1)
|
|
3066
|
+
]),
|
|
3067
|
+
_: 1
|
|
3068
|
+
}, 8, ["variant", "size", "disabled"])
|
|
3069
|
+
])
|
|
3070
|
+
])) : S("", !0)
|
|
3071
|
+
], 2));
|
|
3072
|
+
}
|
|
3073
|
+
}), At = /* @__PURE__ */ L({
|
|
3074
|
+
__name: "TreePricing",
|
|
3075
|
+
props: {
|
|
3076
|
+
plans: {},
|
|
3077
|
+
size: { default: "md" },
|
|
3078
|
+
columns: { default: void 0 }
|
|
3079
|
+
},
|
|
3080
|
+
emits: ["select"],
|
|
3081
|
+
setup(t, { emit: a }) {
|
|
3082
|
+
const e = t, o = a, u = i(() => e.columns ? { gridTemplateColumns: `repeat(${e.columns}, 1fr)` } : { gridTemplateColumns: `repeat(${e.plans.length}, 1fr)` });
|
|
3083
|
+
return (d, v) => (s(), n("div", {
|
|
3084
|
+
class: "tree-pricing",
|
|
3085
|
+
style: Q(u.value),
|
|
3086
|
+
role: "list"
|
|
3087
|
+
}, [
|
|
3088
|
+
(s(!0), n(re, null, ie(t.plans, (m, _) => (s(), n("div", {
|
|
3089
|
+
key: _,
|
|
3090
|
+
role: "listitem"
|
|
3091
|
+
}, [
|
|
3092
|
+
T(d.$slots, "plan", {
|
|
3093
|
+
plan: m,
|
|
3094
|
+
index: _
|
|
3095
|
+
}, () => [
|
|
3096
|
+
Y(We, J({ ref_for: !0 }, m, {
|
|
3097
|
+
size: t.size,
|
|
3098
|
+
onSelect: (p) => o("select", m, _)
|
|
3099
|
+
}), null, 16, ["size", "onSelect"])
|
|
3100
|
+
])
|
|
3101
|
+
]))), 128))
|
|
3102
|
+
], 4));
|
|
3103
|
+
}
|
|
3104
|
+
}), Bo = {
|
|
3105
|
+
class: "tree-md-editor__toolbar",
|
|
3106
|
+
role: "toolbar",
|
|
3107
|
+
"aria-label": "Markdown formatting"
|
|
3108
|
+
}, xo = { class: "tree-md-editor__toolbar-group" }, Vo = ["disabled"], Io = ["disabled"], Ao = ["disabled"], So = { class: "tree-md-editor__toolbar-group" }, Oo = ["disabled"], zo = ["disabled"], Po = ["disabled"], Mo = { class: "tree-md-editor__toolbar-group" }, Eo = ["disabled"], Ro = ["disabled"], Lo = ["disabled"], Ko = { class: "tree-md-editor__toolbar-group" }, Fo = ["disabled"], Ho = ["disabled"], jo = ["disabled"], Uo = ["disabled"], No = { class: "tree-md-editor__body" }, qo = { class: "tree-md-editor__pane tree-md-editor__pane--write" }, Go = ["value", "placeholder", "disabled", "aria-label"], Wo = {
|
|
3109
|
+
class: "tree-md-editor__pane tree-md-editor__pane--preview",
|
|
3110
|
+
"aria-label": "Markdown preview"
|
|
3111
|
+
}, Xo = ["innerHTML"], Yo = {
|
|
3112
|
+
key: 0,
|
|
3113
|
+
class: "tree-md-editor__upload-bar",
|
|
3114
|
+
role: "status",
|
|
3115
|
+
"aria-live": "polite"
|
|
3116
|
+
}, St = /* @__PURE__ */ L({
|
|
3117
|
+
inheritAttrs: !1,
|
|
3118
|
+
__name: "TreeMarkdownEditor",
|
|
3119
|
+
props: {
|
|
3120
|
+
modelValue: { default: "" },
|
|
3121
|
+
size: { default: "md" },
|
|
3122
|
+
disabled: { type: Boolean, default: !1 },
|
|
3123
|
+
placeholder: { default: "Write your markdown here..." },
|
|
3124
|
+
uploadImage: { type: Function, default: void 0 }
|
|
3125
|
+
},
|
|
3126
|
+
emits: ["update:modelValue", "image-upload", "image-upload-error"],
|
|
3127
|
+
setup(t, { emit: a }) {
|
|
3128
|
+
const e = t, o = a, u = se(), d = j(null), v = j(!1), m = i(() => [
|
|
3129
|
+
"tree-md-editor",
|
|
3130
|
+
`tree-md-editor--${e.size}`,
|
|
3131
|
+
{
|
|
3132
|
+
"is-disabled": e.disabled,
|
|
3133
|
+
"is-uploading": v.value
|
|
3134
|
+
},
|
|
3135
|
+
u.class
|
|
3136
|
+
]), _ = i(() => u.style), p = i(() => {
|
|
3137
|
+
const { class: I, style: b, ...k } = u;
|
|
3138
|
+
return k;
|
|
3139
|
+
}), l = i(() => `${e.modelValue ?? ""}`), r = (I) => {
|
|
3140
|
+
o("update:modelValue", I.target.value);
|
|
3141
|
+
}, f = (I, b = "") => {
|
|
3142
|
+
const k = d.value;
|
|
3143
|
+
if (!k) return;
|
|
3144
|
+
const R = k.selectionStart, q = k.selectionEnd, W = l.value, oe = W.slice(R, q), G = W.slice(0, R) + I + oe + b + W.slice(q);
|
|
3145
|
+
o("update:modelValue", G), Z(() => {
|
|
3146
|
+
k.focus();
|
|
3147
|
+
const ye = oe ? R + I.length + oe.length + b.length : R + I.length;
|
|
3148
|
+
k.setSelectionRange(ye, ye);
|
|
3149
|
+
});
|
|
3150
|
+
}, g = (I) => {
|
|
3151
|
+
const b = "#".repeat(I) + " ", k = d.value;
|
|
3152
|
+
if (!k) return;
|
|
3153
|
+
const R = k.selectionStart, q = l.value, W = q.lastIndexOf(`
|
|
3154
|
+
`, R - 1) + 1, oe = q.indexOf(`
|
|
3155
|
+
`, R), G = oe === -1 ? q.length : oe, Be = q.slice(W, G).replace(/^#{1,6}\s*/, ""), ge = b + Be, fe = q.slice(0, W) + ge + q.slice(G);
|
|
3156
|
+
o("update:modelValue", fe), Z(() => {
|
|
3157
|
+
k.focus(), k.setSelectionRange(W + ge.length, W + ge.length);
|
|
3158
|
+
});
|
|
3159
|
+
}, A = () => f("**", "**"), O = () => f("_", "_"), V = () => f("`", "`"), F = () => f("\n```\n", "\n```\n"), M = () => f("[", "](url)"), X = () => f(`
|
|
3160
|
+
- `), $ = () => f(`
|
|
3161
|
+
1. `), w = () => f(`
|
|
3162
|
+
> `), E = () => f(`
|
|
3163
|
+
---
|
|
3164
|
+
`), y = i(() => H(l.value));
|
|
3165
|
+
function z(I) {
|
|
3166
|
+
return I.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3167
|
+
}
|
|
3168
|
+
function H(I) {
|
|
3169
|
+
if (!I) return "";
|
|
3170
|
+
const b = I.split(`
|
|
3171
|
+
`), k = [];
|
|
3172
|
+
let R = !1, q = !1, W = !1;
|
|
3173
|
+
for (let oe = 0; oe < b.length; oe++) {
|
|
3174
|
+
const G = b[oe];
|
|
3175
|
+
if (G.trim().startsWith("```")) {
|
|
3176
|
+
R ? (k.push("</code></pre>"), R = !1) : (R = !0, k.push('<pre class="tree-md-editor__code-block"><code>'));
|
|
3177
|
+
continue;
|
|
3178
|
+
}
|
|
3179
|
+
if (R) {
|
|
3180
|
+
k.push(z(G)), k.push(`
|
|
3181
|
+
`);
|
|
3182
|
+
continue;
|
|
3183
|
+
}
|
|
3184
|
+
const ye = /^[-*+]\s/.test(G.trim()), Be = /^\d+\.\s/.test(G.trim());
|
|
3185
|
+
if (q && !ye && (k.push("</ul>"), q = !1), W && !Be && (k.push("</ol>"), W = !1), /^(-{3,}|_{3,}|\*{3,})$/.test(G.trim())) {
|
|
3186
|
+
k.push('<hr class="tree-md-editor__hr" />');
|
|
3187
|
+
continue;
|
|
3188
|
+
}
|
|
3189
|
+
const ge = G.match(/^(#{1,6})\s+(.+)$/);
|
|
3190
|
+
if (ge) {
|
|
3191
|
+
const fe = ge[1].length;
|
|
3192
|
+
k.push(`<h${fe} class="tree-md-editor__heading tree-md-editor__heading--${fe}">${x(z(ge[2]))}</h${fe}>`);
|
|
3193
|
+
continue;
|
|
3194
|
+
}
|
|
3195
|
+
if (G.trim().startsWith("> ")) {
|
|
3196
|
+
k.push(`<blockquote class="tree-md-editor__blockquote">${x(z(G.trim().slice(2)))}</blockquote>`);
|
|
3197
|
+
continue;
|
|
3198
|
+
}
|
|
3199
|
+
if (ye) {
|
|
3200
|
+
q || (k.push('<ul class="tree-md-editor__list">'), q = !0), k.push(`<li>${x(z(G.trim().slice(2)))}</li>`);
|
|
3201
|
+
continue;
|
|
3202
|
+
}
|
|
3203
|
+
if (Be) {
|
|
3204
|
+
W || (k.push('<ol class="tree-md-editor__list tree-md-editor__list--ordered">'), W = !0);
|
|
3205
|
+
const fe = G.trim().replace(/^\d+\.\s/, "");
|
|
3206
|
+
k.push(`<li>${x(z(fe))}</li>`);
|
|
3207
|
+
continue;
|
|
3208
|
+
}
|
|
3209
|
+
if (G.trim() === "") {
|
|
3210
|
+
k.push("<br />");
|
|
3211
|
+
continue;
|
|
3212
|
+
}
|
|
3213
|
+
k.push(`<p class="tree-md-editor__paragraph">${x(z(G))}</p>`);
|
|
3214
|
+
}
|
|
3215
|
+
return R && k.push("</code></pre>"), q && k.push("</ul>"), W && k.push("</ol>"), k.join(`
|
|
3216
|
+
`);
|
|
3217
|
+
}
|
|
3218
|
+
function x(I) {
|
|
3219
|
+
return I = I.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img src="$2" alt="$1" class="tree-md-editor__image" loading="lazy" />'), I = I.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'), I = I.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), I = I.replace(/_(.+?)_/g, "<em>$1</em>"), I = I.replace(new RegExp("(?<!\\*)\\*(?!\\*)(.+?)(?<!\\*)\\*(?!\\*)", "g"), "<em>$1</em>"), I = I.replace(/`(.+?)`/g, '<code class="tree-md-editor__inline-code">$1</code>'), I = I.replace(/~~(.+?)~~/g, "<del>$1</del>"), I;
|
|
3220
|
+
}
|
|
3221
|
+
const h = async (I) => {
|
|
3222
|
+
var k;
|
|
3223
|
+
if (e.disabled) return;
|
|
3224
|
+
const b = (k = I.clipboardData) == null ? void 0 : k.items;
|
|
3225
|
+
if (b) {
|
|
3226
|
+
for (const R of b)
|
|
3227
|
+
if (R.type.startsWith("image/")) {
|
|
3228
|
+
I.preventDefault();
|
|
3229
|
+
const q = R.getAsFile();
|
|
3230
|
+
q && await ae(q);
|
|
3231
|
+
return;
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
}, C = async (I) => {
|
|
3235
|
+
var k;
|
|
3236
|
+
if (e.disabled) return;
|
|
3237
|
+
const b = (k = I.dataTransfer) == null ? void 0 : k.files;
|
|
3238
|
+
if (b)
|
|
3239
|
+
for (const R of b)
|
|
3240
|
+
R.type.startsWith("image/") && (I.preventDefault(), await ae(R));
|
|
3241
|
+
}, K = (I) => {
|
|
3242
|
+
e.disabled || I.preventDefault();
|
|
3243
|
+
}, ae = async (I) => {
|
|
3244
|
+
if (!e.uploadImage) {
|
|
3245
|
+
f(`![${I.name}]()`);
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3248
|
+
const b = `![Uploading ${I.name}...]()`;
|
|
3249
|
+
f(b), v.value = !0;
|
|
3250
|
+
try {
|
|
3251
|
+
const k = e.uploadImage(I), R = k instanceof Promise ? await k : k, W = l.value.replace(b, ``);
|
|
3252
|
+
o("update:modelValue", W), o("image-upload", I, R);
|
|
3253
|
+
} catch (k) {
|
|
3254
|
+
const q = l.value.replace(b, "");
|
|
3255
|
+
o("update:modelValue", q), o("image-upload-error", I, k instanceof Error ? k : new Error(String(k)));
|
|
3256
|
+
} finally {
|
|
3257
|
+
v.value = !1;
|
|
3258
|
+
}
|
|
3259
|
+
}, ue = (I) => {
|
|
3260
|
+
if (!(e.disabled || !(I.metaKey || I.ctrlKey)))
|
|
3261
|
+
switch (I.key) {
|
|
3262
|
+
case "b":
|
|
3263
|
+
I.preventDefault(), A();
|
|
3264
|
+
break;
|
|
3265
|
+
case "i":
|
|
3266
|
+
I.preventDefault(), O();
|
|
3267
|
+
break;
|
|
3268
|
+
case "k":
|
|
3269
|
+
I.preventDefault(), M();
|
|
3270
|
+
break;
|
|
3271
|
+
case "e":
|
|
3272
|
+
I.preventDefault(), V();
|
|
3273
|
+
break;
|
|
3274
|
+
}
|
|
3275
|
+
};
|
|
3276
|
+
return (I, b) => (s(), n("div", J(p.value, {
|
|
3277
|
+
class: m.value,
|
|
3278
|
+
style: _.value
|
|
3279
|
+
}), [
|
|
3280
|
+
c("div", Bo, [
|
|
3281
|
+
c("div", xo, [
|
|
3282
|
+
c("button", {
|
|
3283
|
+
type: "button",
|
|
3284
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3285
|
+
title: "Heading 1 (H1)",
|
|
3286
|
+
disabled: t.disabled,
|
|
3287
|
+
onClick: b[0] || (b[0] = (k) => g(1))
|
|
3288
|
+
}, " H1 ", 8, Vo),
|
|
3289
|
+
c("button", {
|
|
3290
|
+
type: "button",
|
|
3291
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3292
|
+
title: "Heading 2 (H2)",
|
|
3293
|
+
disabled: t.disabled,
|
|
3294
|
+
onClick: b[1] || (b[1] = (k) => g(2))
|
|
3295
|
+
}, " H2 ", 8, Io),
|
|
3296
|
+
c("button", {
|
|
3297
|
+
type: "button",
|
|
3298
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3299
|
+
title: "Heading 3 (H3)",
|
|
3300
|
+
disabled: t.disabled,
|
|
3301
|
+
onClick: b[2] || (b[2] = (k) => g(3))
|
|
3302
|
+
}, " H3 ", 8, Ao)
|
|
3303
|
+
]),
|
|
3304
|
+
b[7] || (b[7] = c("div", {
|
|
3305
|
+
class: "tree-md-editor__toolbar-divider",
|
|
3306
|
+
role: "separator"
|
|
3307
|
+
}, null, -1)),
|
|
3308
|
+
c("div", So, [
|
|
3309
|
+
c("button", {
|
|
3310
|
+
type: "button",
|
|
3311
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3312
|
+
title: "Bold (Ctrl+B)",
|
|
3313
|
+
disabled: t.disabled,
|
|
3314
|
+
onClick: A
|
|
3315
|
+
}, [...b[4] || (b[4] = [
|
|
3316
|
+
c("strong", null, "B", -1)
|
|
3317
|
+
])], 8, Oo),
|
|
3318
|
+
c("button", {
|
|
3319
|
+
type: "button",
|
|
3320
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3321
|
+
title: "Italic (Ctrl+I)",
|
|
3322
|
+
disabled: t.disabled,
|
|
3323
|
+
onClick: O
|
|
3324
|
+
}, [...b[5] || (b[5] = [
|
|
3325
|
+
c("em", null, "I", -1)
|
|
3326
|
+
])], 8, zo),
|
|
3327
|
+
c("button", {
|
|
3328
|
+
type: "button",
|
|
3329
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3330
|
+
title: "Strikethrough",
|
|
3331
|
+
disabled: t.disabled,
|
|
3332
|
+
onClick: b[3] || (b[3] = (k) => f("~~", "~~"))
|
|
3333
|
+
}, [...b[6] || (b[6] = [
|
|
3334
|
+
c("del", null, "S", -1)
|
|
3335
|
+
])], 8, Po)
|
|
3336
|
+
]),
|
|
3337
|
+
b[8] || (b[8] = c("div", {
|
|
3338
|
+
class: "tree-md-editor__toolbar-divider",
|
|
3339
|
+
role: "separator"
|
|
3340
|
+
}, null, -1)),
|
|
3341
|
+
c("div", Mo, [
|
|
3342
|
+
c("button", {
|
|
3343
|
+
type: "button",
|
|
3344
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3345
|
+
title: "Inline code (Ctrl+E)",
|
|
3346
|
+
disabled: t.disabled,
|
|
3347
|
+
onClick: V
|
|
3348
|
+
}, " </> ", 8, Eo),
|
|
3349
|
+
c("button", {
|
|
3350
|
+
type: "button",
|
|
3351
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3352
|
+
title: "Code block",
|
|
3353
|
+
disabled: t.disabled,
|
|
3354
|
+
onClick: F
|
|
3355
|
+
}, " { } ", 8, Ro),
|
|
3356
|
+
c("button", {
|
|
3357
|
+
type: "button",
|
|
3358
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3359
|
+
title: "Link (Ctrl+K)",
|
|
3360
|
+
disabled: t.disabled,
|
|
3361
|
+
onClick: M
|
|
3362
|
+
}, " 🔗 ", 8, Lo)
|
|
3363
|
+
]),
|
|
3364
|
+
b[9] || (b[9] = c("div", {
|
|
3365
|
+
class: "tree-md-editor__toolbar-divider",
|
|
3366
|
+
role: "separator"
|
|
3367
|
+
}, null, -1)),
|
|
3368
|
+
c("div", Ko, [
|
|
3369
|
+
c("button", {
|
|
3370
|
+
type: "button",
|
|
3371
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3372
|
+
title: "Unordered list",
|
|
3373
|
+
disabled: t.disabled,
|
|
3374
|
+
onClick: X
|
|
3375
|
+
}, " • List ", 8, Fo),
|
|
3376
|
+
c("button", {
|
|
3377
|
+
type: "button",
|
|
3378
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3379
|
+
title: "Ordered list",
|
|
3380
|
+
disabled: t.disabled,
|
|
3381
|
+
onClick: $
|
|
3382
|
+
}, " 1. List ", 8, Ho),
|
|
3383
|
+
c("button", {
|
|
3384
|
+
type: "button",
|
|
3385
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3386
|
+
title: "Blockquote",
|
|
3387
|
+
disabled: t.disabled,
|
|
3388
|
+
onClick: w
|
|
3389
|
+
}, " > ", 8, jo),
|
|
3390
|
+
c("button", {
|
|
3391
|
+
type: "button",
|
|
3392
|
+
class: "tree-md-editor__toolbar-btn",
|
|
3393
|
+
title: "Horizontal rule",
|
|
3394
|
+
disabled: t.disabled,
|
|
3395
|
+
onClick: E
|
|
3396
|
+
}, " ― ", 8, Uo)
|
|
3397
|
+
]),
|
|
3398
|
+
T(I.$slots, "toolbar")
|
|
3399
|
+
]),
|
|
3400
|
+
c("div", No, [
|
|
3401
|
+
c("div", qo, [
|
|
3402
|
+
c("textarea", {
|
|
3403
|
+
ref_key: "textareaRef",
|
|
3404
|
+
ref: d,
|
|
3405
|
+
class: "tree-md-editor__textarea",
|
|
3406
|
+
value: l.value,
|
|
3407
|
+
placeholder: t.placeholder,
|
|
3408
|
+
disabled: t.disabled,
|
|
3409
|
+
"aria-label": t.placeholder,
|
|
3410
|
+
onInput: r,
|
|
3411
|
+
onPaste: h,
|
|
3412
|
+
onDrop: C,
|
|
3413
|
+
onDragover: K,
|
|
3414
|
+
onKeydown: ue
|
|
3415
|
+
}, null, 40, Go)
|
|
3416
|
+
]),
|
|
3417
|
+
c("div", Wo, [
|
|
3418
|
+
c("div", {
|
|
3419
|
+
class: "tree-md-editor__preview",
|
|
3420
|
+
innerHTML: y.value
|
|
3421
|
+
}, null, 8, Xo)
|
|
3422
|
+
])
|
|
3423
|
+
]),
|
|
3424
|
+
v.value ? (s(), n("div", Yo, " Uploading image… ")) : S("", !0)
|
|
3425
|
+
], 16));
|
|
3426
|
+
}
|
|
3427
|
+
}), Jo = {
|
|
3428
|
+
TAccordion: Qe,
|
|
3429
|
+
TAccordionItem: Ze,
|
|
3430
|
+
TAlert: et,
|
|
3431
|
+
TBadge: Ne,
|
|
3432
|
+
TBreadcrumb: tt,
|
|
3433
|
+
TBreadcrumbItem: at,
|
|
3434
|
+
TButton: qe,
|
|
3435
|
+
TCard: st,
|
|
3436
|
+
TCheckbox: ot,
|
|
3437
|
+
TContextMenu: lt,
|
|
3438
|
+
TDatePicker: nt,
|
|
3439
|
+
TDrawer: rt,
|
|
3440
|
+
TDropdown: it,
|
|
3441
|
+
TFormField: ht,
|
|
3442
|
+
TInput: ft,
|
|
3443
|
+
TModal: pt,
|
|
3444
|
+
TRadio: dt,
|
|
3445
|
+
TRadioGroup: ct,
|
|
3446
|
+
TSelect: ut,
|
|
3447
|
+
TSkeleton: bt,
|
|
3448
|
+
TSpinner: Ve,
|
|
3449
|
+
TSwitch: mt,
|
|
3450
|
+
TTextarea: vt,
|
|
3451
|
+
TTabs: $t,
|
|
3452
|
+
TTabList: Tt,
|
|
3453
|
+
TTab: wt,
|
|
3454
|
+
TTabPanel: Ct,
|
|
3455
|
+
TToast: Ge,
|
|
3456
|
+
TToastProvider: Dt,
|
|
3457
|
+
TPagination: yt,
|
|
3458
|
+
TPopover: gt,
|
|
3459
|
+
TProgress: kt,
|
|
3460
|
+
TTooltip: _t,
|
|
3461
|
+
TAvatar: Bt,
|
|
3462
|
+
TDivider: xt,
|
|
3463
|
+
TTable: Vt,
|
|
3464
|
+
TTag: It,
|
|
3465
|
+
TPricing: At,
|
|
3466
|
+
TPricingCard: We,
|
|
3467
|
+
TMarkdownEditor: St,
|
|
3468
|
+
TreeAccordion: Qe,
|
|
3469
|
+
TreeAccordionItem: Ze,
|
|
3470
|
+
TreeAlert: et,
|
|
3471
|
+
TreeBadge: Ne,
|
|
3472
|
+
TreeBreadcrumb: tt,
|
|
3473
|
+
TreeBreadcrumbItem: at,
|
|
3474
|
+
TreeButton: qe,
|
|
3475
|
+
TreeCard: st,
|
|
3476
|
+
TreeCheckbox: ot,
|
|
3477
|
+
TreeContextMenu: lt,
|
|
3478
|
+
TreeDatePicker: nt,
|
|
3479
|
+
TreeDrawer: rt,
|
|
3480
|
+
TreeDropdown: it,
|
|
3481
|
+
TreeRadio: dt,
|
|
3482
|
+
TreeRadioGroup: ct,
|
|
3483
|
+
TreeSelect: ut,
|
|
3484
|
+
TreeSkeleton: bt,
|
|
3485
|
+
TreeInput: ft,
|
|
3486
|
+
TreeTextarea: vt,
|
|
3487
|
+
TreeModal: pt,
|
|
3488
|
+
TreePagination: yt,
|
|
3489
|
+
TreePopover: gt,
|
|
3490
|
+
TreeSpinner: Ve,
|
|
3491
|
+
TreeFormField: ht,
|
|
3492
|
+
TreeProgress: kt,
|
|
3493
|
+
TreeSwitch: mt,
|
|
3494
|
+
TreeTabs: $t,
|
|
3495
|
+
TreeTabList: Tt,
|
|
3496
|
+
TreeTab: wt,
|
|
3497
|
+
TreeTabPanel: Ct,
|
|
3498
|
+
TreeToast: Ge,
|
|
3499
|
+
TreeToastProvider: Dt,
|
|
3500
|
+
TreeTooltip: _t,
|
|
3501
|
+
TreeAvatar: Bt,
|
|
3502
|
+
TreeDivider: xt,
|
|
3503
|
+
TreeTable: Vt,
|
|
3504
|
+
TreeTag: It,
|
|
3505
|
+
TreePricing: At,
|
|
3506
|
+
TreePricingCard: We,
|
|
3507
|
+
TreeMarkdownEditor: St
|
|
3508
|
+
}, Qo = {
|
|
794
3509
|
install(t) {
|
|
795
|
-
Object.entries(
|
|
796
|
-
t.component(
|
|
3510
|
+
Object.entries(Jo).forEach(([a, e]) => {
|
|
3511
|
+
t.component(a, e);
|
|
797
3512
|
});
|
|
798
3513
|
}
|
|
799
|
-
},
|
|
3514
|
+
}, al = Qo.install, sl = ["sm", "md", "lg"], ol = ["solid", "outline", "ghost", "soft", "danger"], ll = ["outline", "soft", "solid"], nl = ["top", "right", "bottom", "left"], rl = ["top", "right", "bottom", "left"];
|
|
800
3515
|
export {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
3516
|
+
Qe as TAccordion,
|
|
3517
|
+
Ze as TAccordionItem,
|
|
3518
|
+
et as TAlert,
|
|
3519
|
+
Bt as TAvatar,
|
|
3520
|
+
Ne as TBadge,
|
|
3521
|
+
tt as TBreadcrumb,
|
|
3522
|
+
at as TBreadcrumbItem,
|
|
3523
|
+
qe as TButton,
|
|
3524
|
+
st as TCard,
|
|
3525
|
+
ot as TCheckbox,
|
|
3526
|
+
lt as TContextMenu,
|
|
3527
|
+
nt as TDatePicker,
|
|
3528
|
+
xt as TDivider,
|
|
3529
|
+
rt as TDrawer,
|
|
3530
|
+
it as TDropdown,
|
|
3531
|
+
ht as TFormField,
|
|
3532
|
+
ft as TInput,
|
|
3533
|
+
St as TMarkdownEditor,
|
|
3534
|
+
pt as TModal,
|
|
3535
|
+
yt as TPagination,
|
|
3536
|
+
gt as TPopover,
|
|
3537
|
+
At as TPricing,
|
|
3538
|
+
We as TPricingCard,
|
|
3539
|
+
kt as TProgress,
|
|
3540
|
+
dt as TRadio,
|
|
3541
|
+
ct as TRadioGroup,
|
|
3542
|
+
ut as TSelect,
|
|
3543
|
+
bt as TSkeleton,
|
|
3544
|
+
Ve as TSpinner,
|
|
3545
|
+
mt as TSwitch,
|
|
3546
|
+
wt as TTab,
|
|
3547
|
+
Tt as TTabList,
|
|
3548
|
+
Ct as TTabPanel,
|
|
3549
|
+
Vt as TTable,
|
|
3550
|
+
$t as TTabs,
|
|
3551
|
+
It as TTag,
|
|
3552
|
+
vt as TTextarea,
|
|
3553
|
+
Ge as TToast,
|
|
3554
|
+
Dt as TToastProvider,
|
|
3555
|
+
_t as TTooltip,
|
|
3556
|
+
Qe as TreeAccordion,
|
|
3557
|
+
Ze as TreeAccordionItem,
|
|
3558
|
+
et as TreeAlert,
|
|
3559
|
+
Bt as TreeAvatar,
|
|
3560
|
+
Ne as TreeBadge,
|
|
3561
|
+
tt as TreeBreadcrumb,
|
|
3562
|
+
at as TreeBreadcrumbItem,
|
|
3563
|
+
qe as TreeButton,
|
|
3564
|
+
st as TreeCard,
|
|
3565
|
+
ot as TreeCheckbox,
|
|
3566
|
+
lt as TreeContextMenu,
|
|
3567
|
+
nt as TreeDatePicker,
|
|
3568
|
+
xt as TreeDivider,
|
|
3569
|
+
rt as TreeDrawer,
|
|
3570
|
+
it as TreeDropdown,
|
|
3571
|
+
ht as TreeFormField,
|
|
3572
|
+
ft as TreeInput,
|
|
3573
|
+
St as TreeMarkdownEditor,
|
|
3574
|
+
pt as TreeModal,
|
|
3575
|
+
yt as TreePagination,
|
|
3576
|
+
gt as TreePopover,
|
|
3577
|
+
At as TreePricing,
|
|
3578
|
+
We as TreePricingCard,
|
|
3579
|
+
kt as TreeProgress,
|
|
3580
|
+
dt as TreeRadio,
|
|
3581
|
+
ct as TreeRadioGroup,
|
|
3582
|
+
ut as TreeSelect,
|
|
3583
|
+
bt as TreeSkeleton,
|
|
3584
|
+
Ve as TreeSpinner,
|
|
3585
|
+
mt as TreeSwitch,
|
|
3586
|
+
wt as TreeTab,
|
|
3587
|
+
Tt as TreeTabList,
|
|
3588
|
+
Ct as TreeTabPanel,
|
|
3589
|
+
Vt as TreeTable,
|
|
3590
|
+
$t as TreeTabs,
|
|
3591
|
+
It as TreeTag,
|
|
3592
|
+
vt as TreeTextarea,
|
|
3593
|
+
Ge as TreeToast,
|
|
3594
|
+
Dt as TreeToastProvider,
|
|
3595
|
+
_t as TreeTooltip,
|
|
3596
|
+
Qo as TreeUIPlugin,
|
|
3597
|
+
Qo as default,
|
|
3598
|
+
al as install,
|
|
3599
|
+
ll as treeCardVariants,
|
|
3600
|
+
rl as treeDrawerSides,
|
|
3601
|
+
sl as treeSizes,
|
|
3602
|
+
nl as treeTooltipSides,
|
|
3603
|
+
ol as treeVariants,
|
|
3604
|
+
Gs as useToast
|
|
824
3605
|
};
|