vue2-sxo 0.0.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 +9 -0
- package/dist/components/Accordion.d.ts +76 -0
- package/dist/components/Alert.d.ts +58 -0
- package/dist/components/Avatar.d.ts +29 -0
- package/dist/components/BackTop.d.ts +31 -0
- package/dist/components/Badge.d.ts +14 -0
- package/dist/components/Box.d.ts +13 -0
- package/dist/components/Breadcrumb.d.ts +35 -0
- package/dist/components/Button.d.ts +32 -0
- package/dist/components/Card.d.ts +32 -0
- package/dist/components/Checkbox.d.ts +108 -0
- package/dist/components/Dialog.d.ts +45 -0
- package/dist/components/Divider.d.ts +32 -0
- package/dist/components/Dropdown.d.ts +63 -0
- package/dist/components/Empty.d.ts +32 -0
- package/dist/components/Feedback.d.ts +177 -0
- package/dist/components/Form.d.ts +29 -0
- package/dist/components/I18n.d.ts +27 -0
- package/dist/components/Icon.d.ts +40 -0
- package/dist/components/Input.d.ts +41 -0
- package/dist/components/Layout.d.ts +102 -0
- package/dist/components/Menu.d.ts +35 -0
- package/dist/components/Pagination.d.ts +78 -0
- package/dist/components/Radio.d.ts +107 -0
- package/dist/components/Result.d.ts +32 -0
- package/dist/components/Search.d.ts +59 -0
- package/dist/components/Select.d.ts +52 -0
- package/dist/components/Slider.d.ts +49 -0
- package/dist/components/Switch.d.ts +41 -0
- package/dist/components/Tabs.d.ts +51 -0
- package/dist/components/Tag.d.ts +50 -0
- package/dist/components/Timeline.d.ts +54 -0
- package/dist/components/Toast.d.ts +2 -0
- package/dist/components/Tooltip.d.ts +31 -0
- package/dist/hooks.d.ts +13 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +2674 -0
- package/dist/plugin.d.ts +44 -0
- package/package.json +59 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2674 @@
|
|
|
1
|
+
import { defaultTokens as I, tokensToCssVars as H, resolveToken as J, useAccordion as U, useDialog as W, useDraggable as _, useForm as Y, createI18n as Q, useMenu as Z, useSelect as ee, useTabs as te, useToastManager as ae, useTooltip as ne } from "@sxo/design";
|
|
2
|
+
import { getAccordionClasses as le, getAlertClasses as se, getAvatarClasses as ie, getBadgeClasses as re, getBreadcrumbClasses as M, getButtonClasses as oe, getCardClasses as ue, getCheckboxClasses as ce, getDialogClasses as de, getDividerClasses as ve, getDropdownClasses as V, getEmptyClasses as fe, getSpinnerClasses as me, getProgressClasses as ge, getSkeletonClasses as ye, getInputClasses as pe, getMenuClasses as xe, getPaginationClasses as be, getRadioClasses as he, getResultClasses as Se, getSearchClasses as we, getSelectClasses as A, getSliderClasses as $e, getSwitchClasses as ke, getTabsClasses as Ce, getTagClasses as Be, getTimelineClasses as L, getToastClasses as E, getTooltipClasses as Te } from "@sxo/ui";
|
|
3
|
+
import { defineComponent as f, inject as w, reactive as B, provide as k, watch as h, h as n, computed as m, ref as b, onMounted as R, onUnmounted as j, getCurrentInstance as y } from "vue";
|
|
4
|
+
import { StyleEngine as D } from "@sxo/engine";
|
|
5
|
+
const z = "sxo";
|
|
6
|
+
function O() {
|
|
7
|
+
const e = w(z);
|
|
8
|
+
if (!e)
|
|
9
|
+
throw new Error("SXO plugin not installed");
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
const Ae = {
|
|
13
|
+
install(e, t = {}) {
|
|
14
|
+
const a = t.tokens || I, l = t.mode || "light", i = new D(a), s = B({
|
|
15
|
+
tokens: a,
|
|
16
|
+
engine: i,
|
|
17
|
+
mode: l
|
|
18
|
+
}), r = () => {
|
|
19
|
+
if (typeof document < "u") {
|
|
20
|
+
const o = s.engine.generateTokenCssVars(), u = "sxo-theme-vars";
|
|
21
|
+
let v = document.getElementById(u);
|
|
22
|
+
v || (v = document.createElement("style"), v.id = u, document.head.appendChild(v)), v.textContent = o, document.documentElement.setAttribute("data-sxo-mode", s.mode);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
r(), e.mixin({
|
|
26
|
+
provide() {
|
|
27
|
+
return {
|
|
28
|
+
[z]: s
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}), h(() => s.tokens, r, { deep: !0 });
|
|
32
|
+
}
|
|
33
|
+
}, Le = f({
|
|
34
|
+
name: "SxoThemeProvider",
|
|
35
|
+
props: {
|
|
36
|
+
tokens: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({})
|
|
39
|
+
},
|
|
40
|
+
injectVars: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setup(e, { slots: t }) {
|
|
46
|
+
const a = w(z), l = B({
|
|
47
|
+
tokens: {
|
|
48
|
+
...(a == null ? void 0 : a.tokens) || I,
|
|
49
|
+
...e.tokens
|
|
50
|
+
},
|
|
51
|
+
engine: new D({
|
|
52
|
+
...(a == null ? void 0 : a.tokens) || I,
|
|
53
|
+
...e.tokens
|
|
54
|
+
}),
|
|
55
|
+
mode: (a == null ? void 0 : a.mode) || "light"
|
|
56
|
+
});
|
|
57
|
+
return k(z, l), h(() => l.tokens, () => {
|
|
58
|
+
if (e.injectVars && typeof document < "u") {
|
|
59
|
+
const s = H(l.tokens), r = "sxo-theme-vars-nested";
|
|
60
|
+
let o = document.getElementById(r);
|
|
61
|
+
o || (o = document.createElement("style"), o.id = r, document.head.appendChild(o));
|
|
62
|
+
const u = `:root {
|
|
63
|
+
${Object.entries(s).map(([v, c]) => ` ${v}: ${c};`).join(`
|
|
64
|
+
`)}
|
|
65
|
+
}`;
|
|
66
|
+
o.textContent = u;
|
|
67
|
+
}
|
|
68
|
+
}, { deep: !0, immediate: !0 }), () => n("div", { class: "sxo-theme-provider" }, t.default ? t.default() : []);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
function g(e) {
|
|
72
|
+
const { engine: t } = O(), a = m(() => (typeof e == "function" ? e() : e).split(/\s+/).filter(Boolean)), l = m(() => t.generateBatch(a.value));
|
|
73
|
+
return h(
|
|
74
|
+
l,
|
|
75
|
+
(i) => {
|
|
76
|
+
if (i && typeof document < "u") {
|
|
77
|
+
const s = document.getElementById("sxo-engine");
|
|
78
|
+
if (s)
|
|
79
|
+
s.innerHTML.includes(i) || (s.innerHTML += i);
|
|
80
|
+
else {
|
|
81
|
+
const r = document.createElement("style");
|
|
82
|
+
r.id = "sxo-engine", r.innerHTML = i, document.head.appendChild(r);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{ immediate: !0 }
|
|
87
|
+
), typeof e == "function" ? m(e) : e;
|
|
88
|
+
}
|
|
89
|
+
function Re(e) {
|
|
90
|
+
const { tokens: t } = O();
|
|
91
|
+
return m(() => J(t, e));
|
|
92
|
+
}
|
|
93
|
+
function De() {
|
|
94
|
+
const { tokens: e } = O(), t = b("xs"), a = () => {
|
|
95
|
+
const l = window.innerWidth, i = Object.entries(e.breakpoints).sort(
|
|
96
|
+
(s, r) => Number.parseInt(r[1]) - Number.parseInt(s[1])
|
|
97
|
+
);
|
|
98
|
+
for (const [s, r] of i)
|
|
99
|
+
if (l >= Number.parseInt(r)) {
|
|
100
|
+
t.value = s;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
t.value = "xs";
|
|
104
|
+
};
|
|
105
|
+
return R(() => {
|
|
106
|
+
a(), window.addEventListener("resize", a);
|
|
107
|
+
}), j(() => {
|
|
108
|
+
window.removeEventListener("resize", a);
|
|
109
|
+
}), t;
|
|
110
|
+
}
|
|
111
|
+
const Ne = f({
|
|
112
|
+
name: "SxoAccordion",
|
|
113
|
+
props: {
|
|
114
|
+
value: {
|
|
115
|
+
type: Array,
|
|
116
|
+
default: () => []
|
|
117
|
+
},
|
|
118
|
+
allowMultiple: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !1
|
|
121
|
+
},
|
|
122
|
+
variant: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: "bordered"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
model: {
|
|
128
|
+
prop: "value",
|
|
129
|
+
event: "input"
|
|
130
|
+
},
|
|
131
|
+
setup(e, { emit: t, slots: a, attrs: l }) {
|
|
132
|
+
const i = b(e.value);
|
|
133
|
+
h(
|
|
134
|
+
() => e.value,
|
|
135
|
+
(u) => {
|
|
136
|
+
i.value = u;
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
const s = (u) => {
|
|
140
|
+
i.value.includes(u) ? i.value = i.value.filter((v) => v !== u) : i.value = e.allowMultiple ? [...i.value, u] : [u], t("input", i.value);
|
|
141
|
+
}, { getItemProps: r } = U({
|
|
142
|
+
allowMultiple: e.allowMultiple,
|
|
143
|
+
defaultExpanded: i.value
|
|
144
|
+
}), o = m(() => le({ variant: e.variant }));
|
|
145
|
+
return g(() => {
|
|
146
|
+
const u = o.value;
|
|
147
|
+
return [
|
|
148
|
+
u.root,
|
|
149
|
+
u.trigger,
|
|
150
|
+
u.triggerText,
|
|
151
|
+
u.panel,
|
|
152
|
+
u.item(!0),
|
|
153
|
+
u.item(!1),
|
|
154
|
+
u.icon(!0),
|
|
155
|
+
u.icon(!1),
|
|
156
|
+
l.class
|
|
157
|
+
].filter(Boolean).join(" ");
|
|
158
|
+
}), {
|
|
159
|
+
expandedItems: i,
|
|
160
|
+
toggleItem: s,
|
|
161
|
+
getItemProps: r,
|
|
162
|
+
styles: o,
|
|
163
|
+
renderRoot() {
|
|
164
|
+
var u;
|
|
165
|
+
return n(
|
|
166
|
+
"div",
|
|
167
|
+
{
|
|
168
|
+
class: [o.value.root, l.class],
|
|
169
|
+
on: l.on
|
|
170
|
+
},
|
|
171
|
+
(u = a.default) == null ? void 0 : u.call(a)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
provide() {
|
|
177
|
+
return {
|
|
178
|
+
sxoAccordion: this
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
render() {
|
|
182
|
+
return this.renderRoot();
|
|
183
|
+
}
|
|
184
|
+
}), qe = f({
|
|
185
|
+
name: "SxoAccordionItem",
|
|
186
|
+
inject: ["sxoAccordion"],
|
|
187
|
+
props: {
|
|
188
|
+
value: {
|
|
189
|
+
type: String,
|
|
190
|
+
required: !0
|
|
191
|
+
},
|
|
192
|
+
title: {
|
|
193
|
+
type: String,
|
|
194
|
+
required: !0
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
render() {
|
|
198
|
+
const e = this.sxoAccordion, t = e.expandedItems.includes(this.value), { triggerProps: a, panelProps: l } = e.getItemProps(this.value, e.toggleItem);
|
|
199
|
+
return n(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
class: [e.styles.item(t), this.$attrs.class]
|
|
203
|
+
},
|
|
204
|
+
[
|
|
205
|
+
n(
|
|
206
|
+
"button",
|
|
207
|
+
{
|
|
208
|
+
attrs: a,
|
|
209
|
+
class: e.styles.trigger,
|
|
210
|
+
on: {
|
|
211
|
+
click: a.onClick
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
[
|
|
215
|
+
n("span", { class: e.styles.triggerText }, this.title),
|
|
216
|
+
n(
|
|
217
|
+
"svg",
|
|
218
|
+
{
|
|
219
|
+
class: e.styles.icon(t),
|
|
220
|
+
attrs: {
|
|
221
|
+
width: "16",
|
|
222
|
+
height: "16",
|
|
223
|
+
viewBox: "0 0 24 24",
|
|
224
|
+
fill: "none",
|
|
225
|
+
stroke: "currentColor",
|
|
226
|
+
"stroke-width": "2",
|
|
227
|
+
"stroke-linecap": "round",
|
|
228
|
+
"stroke-linejoin": "round"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
[n("path", { attrs: { d: "m6 9 6 6 6-6" } })]
|
|
232
|
+
)
|
|
233
|
+
]
|
|
234
|
+
),
|
|
235
|
+
n(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
attrs: l,
|
|
239
|
+
class: e.styles.panel
|
|
240
|
+
},
|
|
241
|
+
this.$slots.default
|
|
242
|
+
)
|
|
243
|
+
]
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
}), Fe = f({
|
|
247
|
+
name: "SxoAlert",
|
|
248
|
+
props: {
|
|
249
|
+
type: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: "info"
|
|
252
|
+
},
|
|
253
|
+
variant: {
|
|
254
|
+
type: String,
|
|
255
|
+
default: "subtle"
|
|
256
|
+
},
|
|
257
|
+
title: {
|
|
258
|
+
type: String,
|
|
259
|
+
default: ""
|
|
260
|
+
},
|
|
261
|
+
description: {
|
|
262
|
+
type: String,
|
|
263
|
+
default: ""
|
|
264
|
+
},
|
|
265
|
+
closable: {
|
|
266
|
+
type: Boolean,
|
|
267
|
+
default: !1
|
|
268
|
+
},
|
|
269
|
+
showIcon: {
|
|
270
|
+
type: Boolean,
|
|
271
|
+
default: !0
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
setup(e, { emit: t, slots: a, attrs: l }) {
|
|
275
|
+
const i = m(
|
|
276
|
+
() => se({
|
|
277
|
+
type: e.type,
|
|
278
|
+
variant: e.variant
|
|
279
|
+
})
|
|
280
|
+
);
|
|
281
|
+
g(() => {
|
|
282
|
+
const o = i.value;
|
|
283
|
+
return [
|
|
284
|
+
o.container,
|
|
285
|
+
o.icon,
|
|
286
|
+
o.content,
|
|
287
|
+
o.title,
|
|
288
|
+
o.description,
|
|
289
|
+
o.closeButton,
|
|
290
|
+
l.class
|
|
291
|
+
].filter(Boolean).join(" ");
|
|
292
|
+
});
|
|
293
|
+
const s = () => {
|
|
294
|
+
if (!e.showIcon) return null;
|
|
295
|
+
if (a.icon) return n("div", { class: i.value.icon }, a.icon());
|
|
296
|
+
const o = {
|
|
297
|
+
info: n(
|
|
298
|
+
"svg",
|
|
299
|
+
{
|
|
300
|
+
attrs: {
|
|
301
|
+
viewBox: "0 0 24 24",
|
|
302
|
+
fill: "none",
|
|
303
|
+
stroke: "currentColor",
|
|
304
|
+
"stroke-width": "2"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
[
|
|
308
|
+
n("circle", { attrs: { cx: "12", cy: "12", r: "10" } }),
|
|
309
|
+
n("line", { attrs: { x1: "12", y1: "16", x2: "12", y2: "12" } }),
|
|
310
|
+
n("line", { attrs: { x1: "12", y1: "8", x2: "12.01", y2: "8" } })
|
|
311
|
+
]
|
|
312
|
+
),
|
|
313
|
+
success: n(
|
|
314
|
+
"svg",
|
|
315
|
+
{
|
|
316
|
+
attrs: {
|
|
317
|
+
viewBox: "0 0 24 24",
|
|
318
|
+
fill: "none",
|
|
319
|
+
stroke: "currentColor",
|
|
320
|
+
"stroke-width": "2"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
[
|
|
324
|
+
n("path", { attrs: { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" } }),
|
|
325
|
+
n("polyline", { attrs: { points: "22 4 12 14.01 9 11.01" } })
|
|
326
|
+
]
|
|
327
|
+
),
|
|
328
|
+
warning: n(
|
|
329
|
+
"svg",
|
|
330
|
+
{
|
|
331
|
+
attrs: {
|
|
332
|
+
viewBox: "0 0 24 24",
|
|
333
|
+
fill: "none",
|
|
334
|
+
stroke: "currentColor",
|
|
335
|
+
"stroke-width": "2"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
[
|
|
339
|
+
n("path", {
|
|
340
|
+
attrs: {
|
|
341
|
+
d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
|
|
342
|
+
}
|
|
343
|
+
}),
|
|
344
|
+
n("line", { attrs: { x1: "12", y1: "9", x2: "12", y2: "13" } }),
|
|
345
|
+
n("line", { attrs: { x1: "12", y1: "17", x2: "12.01", y2: "17" } })
|
|
346
|
+
]
|
|
347
|
+
),
|
|
348
|
+
error: n(
|
|
349
|
+
"svg",
|
|
350
|
+
{
|
|
351
|
+
attrs: {
|
|
352
|
+
viewBox: "0 0 24 24",
|
|
353
|
+
fill: "none",
|
|
354
|
+
stroke: "currentColor",
|
|
355
|
+
"stroke-width": "2"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
[
|
|
359
|
+
n("circle", { attrs: { cx: "12", cy: "12", r: "10" } }),
|
|
360
|
+
n("line", { attrs: { x1: "15", y1: "9", x2: "9", y2: "15" } }),
|
|
361
|
+
n("line", { attrs: { x1: "9", y1: "9", x2: "15", y2: "15" } })
|
|
362
|
+
]
|
|
363
|
+
)
|
|
364
|
+
};
|
|
365
|
+
return n("div", { class: i.value.icon }, [
|
|
366
|
+
o[e.type || "info"]
|
|
367
|
+
]);
|
|
368
|
+
}, r = (o) => {
|
|
369
|
+
t("close", o);
|
|
370
|
+
};
|
|
371
|
+
return () => n("div", { class: [i.value.container, l.class] }, [
|
|
372
|
+
s(),
|
|
373
|
+
n("div", { class: i.value.content }, [
|
|
374
|
+
(e.title || a.title) && n(
|
|
375
|
+
"div",
|
|
376
|
+
{ class: i.value.title },
|
|
377
|
+
a.title ? a.title() : e.title
|
|
378
|
+
),
|
|
379
|
+
(e.description || a.default) && n(
|
|
380
|
+
"div",
|
|
381
|
+
{ class: i.value.description },
|
|
382
|
+
a.default ? a.default() : e.description
|
|
383
|
+
)
|
|
384
|
+
]),
|
|
385
|
+
e.closable && n("div", { class: i.value.closeButton, on: { click: r } }, [
|
|
386
|
+
n(
|
|
387
|
+
"svg",
|
|
388
|
+
{
|
|
389
|
+
attrs: {
|
|
390
|
+
viewBox: "0 0 24 24",
|
|
391
|
+
fill: "none",
|
|
392
|
+
stroke: "currentColor",
|
|
393
|
+
"stroke-width": "2"
|
|
394
|
+
},
|
|
395
|
+
class: "w-4 h-4"
|
|
396
|
+
},
|
|
397
|
+
[
|
|
398
|
+
n("line", { attrs: { x1: "18", y1: "6", x2: "6", y2: "18" } }),
|
|
399
|
+
n("line", { attrs: { x1: "6", y1: "6", x2: "18", y2: "18" } })
|
|
400
|
+
]
|
|
401
|
+
)
|
|
402
|
+
])
|
|
403
|
+
]);
|
|
404
|
+
}
|
|
405
|
+
}), Ge = f({
|
|
406
|
+
name: "SxoAvatar",
|
|
407
|
+
props: {
|
|
408
|
+
src: String,
|
|
409
|
+
alt: String,
|
|
410
|
+
fallback: String,
|
|
411
|
+
size: {
|
|
412
|
+
type: String,
|
|
413
|
+
default: "md"
|
|
414
|
+
},
|
|
415
|
+
shape: {
|
|
416
|
+
type: String,
|
|
417
|
+
default: "circle"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
setup(e, { attrs: t }) {
|
|
421
|
+
const a = y(), l = (a == null ? void 0 : a.proxy.$listeners) || {}, i = m(
|
|
422
|
+
() => ie({
|
|
423
|
+
size: e.size,
|
|
424
|
+
shape: e.shape
|
|
425
|
+
})
|
|
426
|
+
);
|
|
427
|
+
return g(() => {
|
|
428
|
+
const s = i.value;
|
|
429
|
+
return [s.root, s.image, s.fallback, t.class].filter(Boolean).join(" ");
|
|
430
|
+
}), () => {
|
|
431
|
+
var s;
|
|
432
|
+
return n(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
class: [i.value.root, t.class],
|
|
436
|
+
on: l
|
|
437
|
+
},
|
|
438
|
+
[
|
|
439
|
+
e.src ? n("img", {
|
|
440
|
+
attrs: {
|
|
441
|
+
src: e.src,
|
|
442
|
+
alt: e.alt
|
|
443
|
+
},
|
|
444
|
+
class: i.value.image
|
|
445
|
+
}) : n(
|
|
446
|
+
"span",
|
|
447
|
+
{
|
|
448
|
+
class: i.value.fallback
|
|
449
|
+
},
|
|
450
|
+
e.fallback || ((s = e.alt) == null ? void 0 : s.charAt(0)) || "?"
|
|
451
|
+
)
|
|
452
|
+
]
|
|
453
|
+
);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}), Xe = f({
|
|
457
|
+
name: "SxoBadge",
|
|
458
|
+
props: {
|
|
459
|
+
variant: {
|
|
460
|
+
type: String,
|
|
461
|
+
default: "primary"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
setup(e, { slots: t, attrs: a }) {
|
|
465
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => re({ variant: e.variant }));
|
|
466
|
+
return g(() => `${s.value} ${a.class || ""}`.trim()), () => n(
|
|
467
|
+
"span",
|
|
468
|
+
{
|
|
469
|
+
attrs: a,
|
|
470
|
+
class: [s.value, a.class],
|
|
471
|
+
on: i
|
|
472
|
+
},
|
|
473
|
+
t.default ? t.default() : []
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
}), Ke = f({
|
|
477
|
+
name: "SxoBox",
|
|
478
|
+
props: {
|
|
479
|
+
as: {
|
|
480
|
+
type: String,
|
|
481
|
+
default: "div"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
setup(e, { slots: t, attrs: a }) {
|
|
485
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = g(() => {
|
|
486
|
+
const r = [a.class || ""], o = {
|
|
487
|
+
p: "p",
|
|
488
|
+
padding: "p",
|
|
489
|
+
m: "m",
|
|
490
|
+
margin: "m",
|
|
491
|
+
bg: "bg",
|
|
492
|
+
text: "text",
|
|
493
|
+
rounded: "rounded",
|
|
494
|
+
shadow: "shadow",
|
|
495
|
+
w: "w",
|
|
496
|
+
h: "h",
|
|
497
|
+
display: "",
|
|
498
|
+
flex: "flex",
|
|
499
|
+
grid: "grid"
|
|
500
|
+
};
|
|
501
|
+
for (const [u, v] of Object.entries(o))
|
|
502
|
+
if (a[u] !== void 0) {
|
|
503
|
+
const c = a[u];
|
|
504
|
+
v ? r.push(`${v}-${c}`) : r.push(String(c));
|
|
505
|
+
}
|
|
506
|
+
return r.filter(Boolean).join(" ");
|
|
507
|
+
});
|
|
508
|
+
return () => n(
|
|
509
|
+
e.as,
|
|
510
|
+
{
|
|
511
|
+
attrs: a,
|
|
512
|
+
class: typeof s == "string" ? s : s.value,
|
|
513
|
+
on: i
|
|
514
|
+
},
|
|
515
|
+
t.default ? t.default() : []
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
}), He = f({
|
|
519
|
+
name: "SxoBreadcrumbItem",
|
|
520
|
+
props: {
|
|
521
|
+
href: { type: String, default: "" },
|
|
522
|
+
current: { type: Boolean, default: !1 }
|
|
523
|
+
},
|
|
524
|
+
setup(e, { slots: t, attrs: a }) {
|
|
525
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => M());
|
|
526
|
+
return g(() => {
|
|
527
|
+
const r = s.value;
|
|
528
|
+
return [r.item, r.link, r.current, a.class].filter(Boolean).join(" ");
|
|
529
|
+
}), () => {
|
|
530
|
+
var r, o;
|
|
531
|
+
return n("div", { class: s.value.item }, [
|
|
532
|
+
e.href && !e.current ? n(
|
|
533
|
+
"a",
|
|
534
|
+
{
|
|
535
|
+
attrs: { href: e.href, ...a },
|
|
536
|
+
class: [s.value.link],
|
|
537
|
+
on: i
|
|
538
|
+
},
|
|
539
|
+
(r = t.default) == null ? void 0 : r.call(t)
|
|
540
|
+
) : n(
|
|
541
|
+
"span",
|
|
542
|
+
{
|
|
543
|
+
class: [
|
|
544
|
+
e.current ? s.value.current : s.value.link,
|
|
545
|
+
a.class
|
|
546
|
+
],
|
|
547
|
+
attrs: a,
|
|
548
|
+
on: i
|
|
549
|
+
},
|
|
550
|
+
(o = t.default) == null ? void 0 : o.call(t)
|
|
551
|
+
)
|
|
552
|
+
]);
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
}), Je = f({
|
|
556
|
+
name: "SxoBreadcrumb",
|
|
557
|
+
props: {
|
|
558
|
+
separator: { type: String, default: "/" }
|
|
559
|
+
},
|
|
560
|
+
setup(e, { slots: t, attrs: a }) {
|
|
561
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => M({ separator: e.separator }));
|
|
562
|
+
return g(() => {
|
|
563
|
+
const r = s.value;
|
|
564
|
+
return [r.container, r.separator, a.class].filter(Boolean).join(" ");
|
|
565
|
+
}), () => {
|
|
566
|
+
var u;
|
|
567
|
+
const r = ((u = t.default) == null ? void 0 : u.call(t)) || [], o = r.reduce((v, c, d) => (v.push(c), d < r.length - 1 && v.push(n("span", { class: s.value.separator }, e.separator)), v), []);
|
|
568
|
+
return n(
|
|
569
|
+
"nav",
|
|
570
|
+
{
|
|
571
|
+
class: [s.value.container, a.class],
|
|
572
|
+
attrs: { "aria-label": "Breadcrumb", ...a },
|
|
573
|
+
on: i
|
|
574
|
+
},
|
|
575
|
+
o
|
|
576
|
+
);
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
}), Ue = f({
|
|
580
|
+
name: "SxoButton",
|
|
581
|
+
props: {
|
|
582
|
+
variant: {
|
|
583
|
+
type: String,
|
|
584
|
+
default: "primary"
|
|
585
|
+
},
|
|
586
|
+
size: {
|
|
587
|
+
type: String,
|
|
588
|
+
default: "md"
|
|
589
|
+
},
|
|
590
|
+
disabled: {
|
|
591
|
+
type: Boolean,
|
|
592
|
+
default: !1
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
setup(e, { slots: t, attrs: a }) {
|
|
596
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => oe({
|
|
597
|
+
variant: e.variant,
|
|
598
|
+
size: e.size,
|
|
599
|
+
disabled: e.disabled
|
|
600
|
+
}));
|
|
601
|
+
return g(() => `${s.value} ${a.class || ""}`.trim()), () => n(
|
|
602
|
+
"button",
|
|
603
|
+
{
|
|
604
|
+
attrs: {
|
|
605
|
+
...a,
|
|
606
|
+
disabled: e.disabled
|
|
607
|
+
},
|
|
608
|
+
class: [s.value, a.class],
|
|
609
|
+
on: i
|
|
610
|
+
},
|
|
611
|
+
t.default ? t.default() : []
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
}), We = f({
|
|
615
|
+
name: "SxoCard",
|
|
616
|
+
props: {
|
|
617
|
+
variant: {
|
|
618
|
+
type: String,
|
|
619
|
+
default: "default"
|
|
620
|
+
},
|
|
621
|
+
padding: {
|
|
622
|
+
type: String,
|
|
623
|
+
default: "md"
|
|
624
|
+
},
|
|
625
|
+
interactive: {
|
|
626
|
+
type: Boolean,
|
|
627
|
+
default: !1
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
setup(e, { slots: t, attrs: a }) {
|
|
631
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => ue({
|
|
632
|
+
variant: e.variant,
|
|
633
|
+
padding: e.padding,
|
|
634
|
+
interactive: e.interactive
|
|
635
|
+
}));
|
|
636
|
+
return g(() => s.value), () => n(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
attrs: a,
|
|
640
|
+
class: s.value,
|
|
641
|
+
on: i
|
|
642
|
+
},
|
|
643
|
+
t.default ? t.default() : []
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
}), N = Symbol("CheckboxGroup"), _e = f({
|
|
647
|
+
name: "SxoCheckboxGroup",
|
|
648
|
+
props: {
|
|
649
|
+
value: {
|
|
650
|
+
type: Array,
|
|
651
|
+
default: () => []
|
|
652
|
+
},
|
|
653
|
+
direction: {
|
|
654
|
+
type: String,
|
|
655
|
+
default: "col"
|
|
656
|
+
},
|
|
657
|
+
gap: {
|
|
658
|
+
type: [String, Number],
|
|
659
|
+
default: 2
|
|
660
|
+
},
|
|
661
|
+
size: {
|
|
662
|
+
type: String,
|
|
663
|
+
default: "md"
|
|
664
|
+
},
|
|
665
|
+
color: {
|
|
666
|
+
type: String,
|
|
667
|
+
default: "primary"
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
setup(e, { emit: t, slots: a, attrs: l }) {
|
|
671
|
+
const i = b([...e.value]);
|
|
672
|
+
h(
|
|
673
|
+
() => e.value,
|
|
674
|
+
(r) => {
|
|
675
|
+
i.value = [...r];
|
|
676
|
+
}
|
|
677
|
+
);
|
|
678
|
+
const s = (r) => {
|
|
679
|
+
const o = i.value.indexOf(r);
|
|
680
|
+
o > -1 ? i.value.splice(o, 1) : i.value.push(r);
|
|
681
|
+
const u = [...i.value];
|
|
682
|
+
t("input", u), t("change", u);
|
|
683
|
+
};
|
|
684
|
+
return k(N, {
|
|
685
|
+
value: i,
|
|
686
|
+
size: e.size,
|
|
687
|
+
color: e.color,
|
|
688
|
+
toggleValue: s
|
|
689
|
+
}), g(() => `flex flex-${e.direction} gap-${e.gap} ${l.class || ""}`.trim()), () => {
|
|
690
|
+
var r;
|
|
691
|
+
return n(
|
|
692
|
+
"div",
|
|
693
|
+
{
|
|
694
|
+
class: `flex flex-${e.direction} gap-${e.gap} ${l.class || ""}`.trim(),
|
|
695
|
+
attrs: { ...l }
|
|
696
|
+
},
|
|
697
|
+
(r = a.default) == null ? void 0 : r.call(a)
|
|
698
|
+
);
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
}), Ye = f({
|
|
702
|
+
name: "SxoCheckbox",
|
|
703
|
+
model: {
|
|
704
|
+
prop: "checked",
|
|
705
|
+
event: "input"
|
|
706
|
+
},
|
|
707
|
+
props: {
|
|
708
|
+
checked: {
|
|
709
|
+
type: [Boolean, String, Number, Object],
|
|
710
|
+
default: void 0
|
|
711
|
+
},
|
|
712
|
+
label: {
|
|
713
|
+
type: String,
|
|
714
|
+
default: ""
|
|
715
|
+
},
|
|
716
|
+
disabled: {
|
|
717
|
+
type: Boolean,
|
|
718
|
+
default: !1
|
|
719
|
+
},
|
|
720
|
+
value: {
|
|
721
|
+
type: [String, Number, Boolean, Object],
|
|
722
|
+
default: void 0
|
|
723
|
+
},
|
|
724
|
+
size: {
|
|
725
|
+
type: String,
|
|
726
|
+
default: void 0
|
|
727
|
+
},
|
|
728
|
+
color: {
|
|
729
|
+
type: String,
|
|
730
|
+
default: void 0
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
setup(e, { emit: t, attrs: a, slots: l }) {
|
|
734
|
+
const i = w(N, null), s = m(() => i && e.value !== void 0 ? i.value.value.includes(e.value) : e.checked === !0), r = m(() => e.size || (i == null ? void 0 : i.size) || "md"), o = m(() => e.color || (i == null ? void 0 : i.color) || "primary"), u = m(() => ce(s.value, {
|
|
735
|
+
size: r.value,
|
|
736
|
+
color: o.value,
|
|
737
|
+
disabled: e.disabled
|
|
738
|
+
}));
|
|
739
|
+
g(() => {
|
|
740
|
+
const c = u.value;
|
|
741
|
+
return `${c.root} ${c.icon} ${a.class || ""}`.trim();
|
|
742
|
+
});
|
|
743
|
+
const v = (c) => {
|
|
744
|
+
if (e.disabled) return;
|
|
745
|
+
const d = c.target.checked;
|
|
746
|
+
i && e.value !== void 0 ? i.toggleValue(e.value) : (t("input", d), t("change", d));
|
|
747
|
+
};
|
|
748
|
+
return () => n(
|
|
749
|
+
"label",
|
|
750
|
+
{
|
|
751
|
+
class: [
|
|
752
|
+
"inline-flex items-center cursor-pointer select-none",
|
|
753
|
+
e.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
754
|
+
a.class
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
[
|
|
758
|
+
n("input", {
|
|
759
|
+
attrs: {
|
|
760
|
+
type: "checkbox",
|
|
761
|
+
checked: s.value,
|
|
762
|
+
disabled: e.disabled,
|
|
763
|
+
...a
|
|
764
|
+
},
|
|
765
|
+
class: "hidden",
|
|
766
|
+
on: {
|
|
767
|
+
change: v
|
|
768
|
+
}
|
|
769
|
+
}),
|
|
770
|
+
n(
|
|
771
|
+
"div",
|
|
772
|
+
{
|
|
773
|
+
class: u.value.root
|
|
774
|
+
},
|
|
775
|
+
[
|
|
776
|
+
n(
|
|
777
|
+
"svg",
|
|
778
|
+
{
|
|
779
|
+
class: u.value.icon,
|
|
780
|
+
attrs: {
|
|
781
|
+
width: "12",
|
|
782
|
+
height: "12",
|
|
783
|
+
viewBox: "0 0 12 12",
|
|
784
|
+
fill: "none",
|
|
785
|
+
stroke: "currentColor",
|
|
786
|
+
"stroke-width": "2",
|
|
787
|
+
"stroke-linecap": "round",
|
|
788
|
+
"stroke-linejoin": "round"
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
[n("polyline", { attrs: { points: "2 6 5 9 10 3" } })]
|
|
792
|
+
)
|
|
793
|
+
]
|
|
794
|
+
),
|
|
795
|
+
e.label || l.default ? n(
|
|
796
|
+
"span",
|
|
797
|
+
{ class: "ml-2 text-sm" },
|
|
798
|
+
l.default ? l.default() : e.label
|
|
799
|
+
) : null
|
|
800
|
+
]
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
}), Qe = f({
|
|
804
|
+
name: "SxoDialog",
|
|
805
|
+
props: {
|
|
806
|
+
isOpen: {
|
|
807
|
+
type: Boolean,
|
|
808
|
+
required: !0
|
|
809
|
+
},
|
|
810
|
+
title: String,
|
|
811
|
+
description: String,
|
|
812
|
+
size: {
|
|
813
|
+
type: String,
|
|
814
|
+
default: "md"
|
|
815
|
+
},
|
|
816
|
+
isCentered: {
|
|
817
|
+
type: Boolean,
|
|
818
|
+
default: !1
|
|
819
|
+
},
|
|
820
|
+
isDraggable: {
|
|
821
|
+
type: Boolean,
|
|
822
|
+
default: !1
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
setup(e, { slots: t, emit: a, attrs: l }) {
|
|
826
|
+
const i = y(), s = (i == null ? void 0 : i.proxy.$listeners) || {}, r = B({ x: 0, y: 0 }), { getDialogProps: o, getOverlayProps: u, getCloseButtonProps: v } = W({
|
|
827
|
+
isOpen: e.isOpen,
|
|
828
|
+
onClose: () => a("close")
|
|
829
|
+
}), { getDragProps: c } = _({
|
|
830
|
+
onDrag: (x) => {
|
|
831
|
+
r.x = x.x, r.y = x.y;
|
|
832
|
+
}
|
|
833
|
+
}), d = de({
|
|
834
|
+
size: e.size,
|
|
835
|
+
isCentered: e.isCentered
|
|
836
|
+
});
|
|
837
|
+
return g(() => Object.values(d).join(" ")), () => e.isOpen ? n(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
class: `${d.container} ${l.class || ""}`.trim(),
|
|
841
|
+
on: s
|
|
842
|
+
},
|
|
843
|
+
[
|
|
844
|
+
// 遮罩层
|
|
845
|
+
n("div", {
|
|
846
|
+
attrs: u(),
|
|
847
|
+
class: d.overlay
|
|
848
|
+
}),
|
|
849
|
+
// 内容层
|
|
850
|
+
n(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
attrs: o(),
|
|
854
|
+
class: d.content,
|
|
855
|
+
style: {
|
|
856
|
+
transform: `translate(${r.x}px, ${r.y}px)`
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
[
|
|
860
|
+
// 关闭按钮
|
|
861
|
+
n(
|
|
862
|
+
"button",
|
|
863
|
+
{
|
|
864
|
+
attrs: v(),
|
|
865
|
+
class: d.closeButton
|
|
866
|
+
},
|
|
867
|
+
["✕"]
|
|
868
|
+
),
|
|
869
|
+
// 头部 (支持拖拽)
|
|
870
|
+
n(
|
|
871
|
+
"div",
|
|
872
|
+
{
|
|
873
|
+
class: d.header,
|
|
874
|
+
on: e.isDraggable ? c().on : {}
|
|
875
|
+
},
|
|
876
|
+
[
|
|
877
|
+
e.title ? n("h2", { class: d.title }, [e.title]) : null,
|
|
878
|
+
e.description ? n("p", { class: d.description }, [e.description]) : null
|
|
879
|
+
]
|
|
880
|
+
),
|
|
881
|
+
// 内容
|
|
882
|
+
n("div", { class: "dialog-body" }, [
|
|
883
|
+
t.default ? t.default() : []
|
|
884
|
+
]),
|
|
885
|
+
// 底部
|
|
886
|
+
t.footer ? n("div", { class: d.footer }, [t.footer()]) : null
|
|
887
|
+
]
|
|
888
|
+
)
|
|
889
|
+
]
|
|
890
|
+
) : null;
|
|
891
|
+
}
|
|
892
|
+
}), Ze = f({
|
|
893
|
+
name: "SxoDivider",
|
|
894
|
+
props: {
|
|
895
|
+
direction: {
|
|
896
|
+
type: String,
|
|
897
|
+
default: "horizontal"
|
|
898
|
+
},
|
|
899
|
+
type: {
|
|
900
|
+
type: String,
|
|
901
|
+
default: "solid"
|
|
902
|
+
},
|
|
903
|
+
contentPlacement: {
|
|
904
|
+
type: String,
|
|
905
|
+
default: "center"
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
setup(e, { slots: t, attrs: a }) {
|
|
909
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(
|
|
910
|
+
() => ve({
|
|
911
|
+
direction: e.direction,
|
|
912
|
+
type: e.type,
|
|
913
|
+
contentPlacement: e.contentPlacement
|
|
914
|
+
})
|
|
915
|
+
);
|
|
916
|
+
return g(() => {
|
|
917
|
+
const r = s.value;
|
|
918
|
+
return [r.container, r.line, r.lineLeft, r.lineRight, r.text, a.class].filter(Boolean).join(" ");
|
|
919
|
+
}), () => {
|
|
920
|
+
var o;
|
|
921
|
+
return e.direction === "vertical" ? n("div", {
|
|
922
|
+
class: [s.value.container, a.class],
|
|
923
|
+
attrs: a,
|
|
924
|
+
on: i
|
|
925
|
+
}) : t.default ? n(
|
|
926
|
+
"div",
|
|
927
|
+
{
|
|
928
|
+
class: [s.value.container, a.class],
|
|
929
|
+
attrs: a,
|
|
930
|
+
on: i
|
|
931
|
+
},
|
|
932
|
+
[
|
|
933
|
+
n("div", { class: [s.value.line, s.value.lineLeft] }),
|
|
934
|
+
n("span", { class: s.value.text }, (o = t.default) == null ? void 0 : o.call(t)),
|
|
935
|
+
n("div", { class: [s.value.line, s.value.lineRight] })
|
|
936
|
+
]
|
|
937
|
+
) : n("div", {
|
|
938
|
+
class: [s.value.line, "my-4", a.class],
|
|
939
|
+
attrs: a,
|
|
940
|
+
on: i
|
|
941
|
+
});
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
}), et = f({
|
|
945
|
+
name: "SxoDropdownItem",
|
|
946
|
+
props: {
|
|
947
|
+
disabled: { type: Boolean, default: !1 },
|
|
948
|
+
active: { type: Boolean, default: !1 },
|
|
949
|
+
divider: { type: Boolean, default: !1 },
|
|
950
|
+
header: { type: String, default: "" }
|
|
951
|
+
},
|
|
952
|
+
setup(e, { slots: t, attrs: a }) {
|
|
953
|
+
const l = m(() => V());
|
|
954
|
+
return () => {
|
|
955
|
+
var r;
|
|
956
|
+
if (e.divider) return n("div", { class: l.value.divider });
|
|
957
|
+
if (e.header) return n("div", { class: l.value.header }, e.header);
|
|
958
|
+
const i = y(), s = (i == null ? void 0 : i.proxy.$listeners) || {};
|
|
959
|
+
return n(
|
|
960
|
+
"div",
|
|
961
|
+
{
|
|
962
|
+
class: [
|
|
963
|
+
l.value.item,
|
|
964
|
+
e.active && l.value.itemActive,
|
|
965
|
+
e.disabled && l.value.itemDisabled,
|
|
966
|
+
a.class
|
|
967
|
+
],
|
|
968
|
+
on: {
|
|
969
|
+
...s,
|
|
970
|
+
click: (o) => {
|
|
971
|
+
e.disabled || s.click && (Array.isArray(s.click) ? s.click.forEach((u) => u(o)) : s.click(o));
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
(r = t.default) == null ? void 0 : r.call(t)
|
|
976
|
+
);
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
}), tt = f({
|
|
980
|
+
name: "SxoDropdown",
|
|
981
|
+
props: {
|
|
982
|
+
placement: { type: String, default: "bottom-left" },
|
|
983
|
+
trigger: { type: String, default: "click" }
|
|
984
|
+
},
|
|
985
|
+
setup(e, { slots: t, attrs: a }) {
|
|
986
|
+
const l = b(!1), i = b(null), s = m(() => V({ placement: e.placement }));
|
|
987
|
+
g(() => {
|
|
988
|
+
const d = s.value;
|
|
989
|
+
return [
|
|
990
|
+
d.container,
|
|
991
|
+
d.menu,
|
|
992
|
+
d.item,
|
|
993
|
+
d.itemActive,
|
|
994
|
+
d.itemDisabled,
|
|
995
|
+
d.divider,
|
|
996
|
+
d.header,
|
|
997
|
+
a.class
|
|
998
|
+
].filter(Boolean).join(" ");
|
|
999
|
+
});
|
|
1000
|
+
const r = () => l.value = !l.value, o = () => l.value = !0, u = () => l.value = !1, v = (d) => {
|
|
1001
|
+
const x = i.value;
|
|
1002
|
+
x && !x.contains(d.target) && u();
|
|
1003
|
+
};
|
|
1004
|
+
R(() => {
|
|
1005
|
+
e.trigger === "click" && window.addEventListener("click", v);
|
|
1006
|
+
}), j(() => {
|
|
1007
|
+
e.trigger === "click" && window.removeEventListener("click", v);
|
|
1008
|
+
});
|
|
1009
|
+
const c = m(() => e.trigger === "hover" ? {
|
|
1010
|
+
mouseenter: o,
|
|
1011
|
+
mouseleave: u
|
|
1012
|
+
} : {
|
|
1013
|
+
click: (d) => {
|
|
1014
|
+
d.stopPropagation(), r();
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
return () => {
|
|
1018
|
+
var d, x;
|
|
1019
|
+
return n(
|
|
1020
|
+
"div",
|
|
1021
|
+
{
|
|
1022
|
+
ref: "dropdownRef",
|
|
1023
|
+
class: [s.value.container, a.class],
|
|
1024
|
+
on: c.value
|
|
1025
|
+
},
|
|
1026
|
+
[
|
|
1027
|
+
(d = t.default) == null ? void 0 : d.call(t),
|
|
1028
|
+
l.value && n(
|
|
1029
|
+
"div",
|
|
1030
|
+
{
|
|
1031
|
+
class: s.value.menu,
|
|
1032
|
+
on: {
|
|
1033
|
+
click: (p) => p.stopPropagation()
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
(x = t.overlay) == null ? void 0 : x.call(t)
|
|
1037
|
+
)
|
|
1038
|
+
]
|
|
1039
|
+
);
|
|
1040
|
+
};
|
|
1041
|
+
},
|
|
1042
|
+
// Handle ref correctly in Vue 2 setup
|
|
1043
|
+
mounted() {
|
|
1044
|
+
this.dropdownRef = this.$el;
|
|
1045
|
+
}
|
|
1046
|
+
}), at = f({
|
|
1047
|
+
name: "SxoEmpty",
|
|
1048
|
+
props: {
|
|
1049
|
+
description: {
|
|
1050
|
+
type: String,
|
|
1051
|
+
default: "No Data"
|
|
1052
|
+
},
|
|
1053
|
+
size: {
|
|
1054
|
+
type: String,
|
|
1055
|
+
default: "md"
|
|
1056
|
+
},
|
|
1057
|
+
image: {
|
|
1058
|
+
type: String,
|
|
1059
|
+
default: ""
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1063
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(
|
|
1064
|
+
() => fe({
|
|
1065
|
+
size: e.size
|
|
1066
|
+
})
|
|
1067
|
+
);
|
|
1068
|
+
g(() => {
|
|
1069
|
+
const o = s.value;
|
|
1070
|
+
return [o.container, o.image, o.description, o.extra, a.class].filter(Boolean).join(" ");
|
|
1071
|
+
});
|
|
1072
|
+
const r = () => t.image ? n("div", { class: s.value.image }, t.image()) : e.image ? n("img", {
|
|
1073
|
+
attrs: { src: e.image, alt: "empty" },
|
|
1074
|
+
class: s.value.image
|
|
1075
|
+
}) : n(
|
|
1076
|
+
"svg",
|
|
1077
|
+
{
|
|
1078
|
+
attrs: {
|
|
1079
|
+
viewBox: "0 0 100 100",
|
|
1080
|
+
fill: "none",
|
|
1081
|
+
stroke: "currentColor",
|
|
1082
|
+
"stroke-width": "1.5"
|
|
1083
|
+
},
|
|
1084
|
+
class: s.value.image
|
|
1085
|
+
},
|
|
1086
|
+
[
|
|
1087
|
+
n("rect", { attrs: { x: "20", y: "20", width: "60", height: "60", rx: "8" } }),
|
|
1088
|
+
n("path", { attrs: { d: "M20 40h60M40 20v60" } }),
|
|
1089
|
+
n("circle", { attrs: { cx: "50", cy: "50", r: "10", opacity: "0.5" } })
|
|
1090
|
+
]
|
|
1091
|
+
);
|
|
1092
|
+
return () => n(
|
|
1093
|
+
"div",
|
|
1094
|
+
{
|
|
1095
|
+
class: [s.value.container, a.class],
|
|
1096
|
+
attrs: a,
|
|
1097
|
+
on: i
|
|
1098
|
+
},
|
|
1099
|
+
[
|
|
1100
|
+
r(),
|
|
1101
|
+
n(
|
|
1102
|
+
"div",
|
|
1103
|
+
{ class: s.value.description },
|
|
1104
|
+
t.default ? t.default() : e.description
|
|
1105
|
+
),
|
|
1106
|
+
t.extra && n("div", { class: s.value.extra }, t.extra())
|
|
1107
|
+
]
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
1110
|
+
}), ze = f({
|
|
1111
|
+
name: "SxoSpinner",
|
|
1112
|
+
props: {
|
|
1113
|
+
size: {
|
|
1114
|
+
type: String,
|
|
1115
|
+
default: "md"
|
|
1116
|
+
},
|
|
1117
|
+
color: {
|
|
1118
|
+
type: String,
|
|
1119
|
+
default: "primary"
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
setup(e, { attrs: t }) {
|
|
1123
|
+
const a = me({
|
|
1124
|
+
size: e.size,
|
|
1125
|
+
color: e.color
|
|
1126
|
+
});
|
|
1127
|
+
return g(() => a), () => n("div", {
|
|
1128
|
+
attrs: t,
|
|
1129
|
+
class: a
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
}), je = f({
|
|
1133
|
+
name: "SxoProgress",
|
|
1134
|
+
props: {
|
|
1135
|
+
value: {
|
|
1136
|
+
type: Number,
|
|
1137
|
+
required: !0
|
|
1138
|
+
},
|
|
1139
|
+
max: {
|
|
1140
|
+
type: Number,
|
|
1141
|
+
default: 100
|
|
1142
|
+
},
|
|
1143
|
+
color: {
|
|
1144
|
+
type: String,
|
|
1145
|
+
default: "primary"
|
|
1146
|
+
},
|
|
1147
|
+
size: {
|
|
1148
|
+
type: String,
|
|
1149
|
+
default: "md"
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
setup(e, { attrs: t }) {
|
|
1153
|
+
const a = ge({
|
|
1154
|
+
value: e.value,
|
|
1155
|
+
max: e.max,
|
|
1156
|
+
color: e.color,
|
|
1157
|
+
size: e.size
|
|
1158
|
+
});
|
|
1159
|
+
return g(() => `${a.root} ${a.bar}`), () => n("div", { attrs: t, class: a.root }, [
|
|
1160
|
+
n("div", {
|
|
1161
|
+
class: a.bar,
|
|
1162
|
+
style: { width: `${a.percentage}%` }
|
|
1163
|
+
})
|
|
1164
|
+
]);
|
|
1165
|
+
}
|
|
1166
|
+
}), Pe = f({
|
|
1167
|
+
name: "SxoSkeleton",
|
|
1168
|
+
props: {
|
|
1169
|
+
variant: {
|
|
1170
|
+
type: String,
|
|
1171
|
+
default: "rect"
|
|
1172
|
+
},
|
|
1173
|
+
width: [String, Number],
|
|
1174
|
+
height: [String, Number],
|
|
1175
|
+
animate: {
|
|
1176
|
+
type: Boolean,
|
|
1177
|
+
default: !0
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
setup(e, { attrs: t }) {
|
|
1181
|
+
const a = ye({
|
|
1182
|
+
variant: e.variant,
|
|
1183
|
+
animate: e.animate
|
|
1184
|
+
});
|
|
1185
|
+
g(() => a);
|
|
1186
|
+
const l = {
|
|
1187
|
+
width: typeof e.width == "number" ? `${e.width}px` : e.width,
|
|
1188
|
+
height: typeof e.height == "number" ? `${e.height}px` : e.height
|
|
1189
|
+
};
|
|
1190
|
+
return () => n("div", {
|
|
1191
|
+
attrs: t,
|
|
1192
|
+
class: a,
|
|
1193
|
+
style: l
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
}), nt = {
|
|
1197
|
+
Spinner: ze,
|
|
1198
|
+
Progress: je,
|
|
1199
|
+
Skeleton: Pe
|
|
1200
|
+
}, q = "SxoForm", lt = f({
|
|
1201
|
+
name: "SxoForm",
|
|
1202
|
+
props: {
|
|
1203
|
+
initialValues: {
|
|
1204
|
+
type: Object,
|
|
1205
|
+
required: !0
|
|
1206
|
+
},
|
|
1207
|
+
rules: {
|
|
1208
|
+
type: Object,
|
|
1209
|
+
default: () => ({})
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1212
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1213
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = Y({
|
|
1214
|
+
initialValues: e.initialValues,
|
|
1215
|
+
rules: e.rules,
|
|
1216
|
+
onSubmit: (o) => l == null ? void 0 : l.proxy.$emit("submit", o)
|
|
1217
|
+
}), r = B({
|
|
1218
|
+
values: { ...e.initialValues },
|
|
1219
|
+
errors: {}
|
|
1220
|
+
});
|
|
1221
|
+
return s.subscribe(() => {
|
|
1222
|
+
r.values = { ...s.values }, r.errors = { ...s.errors };
|
|
1223
|
+
}), k(q, {
|
|
1224
|
+
values: r.values,
|
|
1225
|
+
errors: r.errors,
|
|
1226
|
+
setFieldValue: s.setFieldValue
|
|
1227
|
+
}), () => {
|
|
1228
|
+
var o;
|
|
1229
|
+
return n(
|
|
1230
|
+
"form",
|
|
1231
|
+
{
|
|
1232
|
+
attrs: a,
|
|
1233
|
+
on: {
|
|
1234
|
+
...i,
|
|
1235
|
+
submit: s.handleSubmit
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
(o = t.default) == null ? void 0 : o.call(t)
|
|
1239
|
+
);
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
}), st = f({
|
|
1243
|
+
name: "SxoFormItem",
|
|
1244
|
+
props: {
|
|
1245
|
+
name: String,
|
|
1246
|
+
label: String
|
|
1247
|
+
},
|
|
1248
|
+
setup(e, { slots: t }) {
|
|
1249
|
+
const a = w(q);
|
|
1250
|
+
if (!a) throw new Error("FormItem must be used within Form");
|
|
1251
|
+
return () => {
|
|
1252
|
+
var l;
|
|
1253
|
+
return n("div", { class: "flex flex-col gap-1 mb-4" }, [
|
|
1254
|
+
e.label && n("label", { class: "text-sm font-bold opacity-70" }, e.label),
|
|
1255
|
+
(l = t.default) == null ? void 0 : l.call(t),
|
|
1256
|
+
e.name && a.errors[e.name] && n(
|
|
1257
|
+
"span",
|
|
1258
|
+
{ class: "text-xs text-red-500 font-medium" },
|
|
1259
|
+
a.errors[e.name]
|
|
1260
|
+
)
|
|
1261
|
+
]);
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
}), F = "SxoI18n", it = f({
|
|
1265
|
+
name: "SxoI18nProvider",
|
|
1266
|
+
props: {
|
|
1267
|
+
locale: {
|
|
1268
|
+
type: String,
|
|
1269
|
+
default: "en"
|
|
1270
|
+
},
|
|
1271
|
+
messages: {
|
|
1272
|
+
type: Object,
|
|
1273
|
+
required: !0
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
setup(e, { slots: t }) {
|
|
1277
|
+
const a = Q({
|
|
1278
|
+
locale: e.locale,
|
|
1279
|
+
messages: e.messages
|
|
1280
|
+
}), l = B({
|
|
1281
|
+
locale: a.locale
|
|
1282
|
+
});
|
|
1283
|
+
return a.subscribe((s) => {
|
|
1284
|
+
l.locale = s;
|
|
1285
|
+
}), k(F, {
|
|
1286
|
+
state: l,
|
|
1287
|
+
t: (s, ...r) => a.t(s, ...r),
|
|
1288
|
+
setLocale: (s) => {
|
|
1289
|
+
a.locale = s;
|
|
1290
|
+
}
|
|
1291
|
+
}), () => t.default ? t.default() : [];
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
function rt() {
|
|
1295
|
+
const e = w(F);
|
|
1296
|
+
return e ? {
|
|
1297
|
+
locale: e.state.locale,
|
|
1298
|
+
t: e.t,
|
|
1299
|
+
setLocale: e.setLocale
|
|
1300
|
+
} : {
|
|
1301
|
+
locale: "en",
|
|
1302
|
+
t: (t) => t,
|
|
1303
|
+
setLocale: () => {
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
const ot = f({
|
|
1308
|
+
name: "SxoInput",
|
|
1309
|
+
props: {
|
|
1310
|
+
variant: {
|
|
1311
|
+
type: String,
|
|
1312
|
+
default: "outline"
|
|
1313
|
+
},
|
|
1314
|
+
size: {
|
|
1315
|
+
type: String,
|
|
1316
|
+
default: "md"
|
|
1317
|
+
},
|
|
1318
|
+
invalid: {
|
|
1319
|
+
type: Boolean,
|
|
1320
|
+
default: !1
|
|
1321
|
+
},
|
|
1322
|
+
value: {
|
|
1323
|
+
type: [String, Number],
|
|
1324
|
+
default: ""
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
setup(e, { emit: t, attrs: a }) {
|
|
1328
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => pe({
|
|
1329
|
+
variant: e.variant,
|
|
1330
|
+
size: e.size,
|
|
1331
|
+
invalid: e.invalid
|
|
1332
|
+
}));
|
|
1333
|
+
g(() => `${s.value} ${a.class || ""}`.trim());
|
|
1334
|
+
const r = (o) => {
|
|
1335
|
+
t("input", o.target.value);
|
|
1336
|
+
};
|
|
1337
|
+
return () => n("input", {
|
|
1338
|
+
attrs: {
|
|
1339
|
+
...a,
|
|
1340
|
+
value: e.value
|
|
1341
|
+
},
|
|
1342
|
+
class: [s.value, a.class],
|
|
1343
|
+
on: {
|
|
1344
|
+
...i,
|
|
1345
|
+
input: r
|
|
1346
|
+
}
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
});
|
|
1350
|
+
function S(e, t) {
|
|
1351
|
+
if (e === void 0) return [];
|
|
1352
|
+
if (typeof e != "object" || Array.isArray(e))
|
|
1353
|
+
return [`${t}-${e}`];
|
|
1354
|
+
const a = [], l = e;
|
|
1355
|
+
return l.base !== void 0 && a.push(`${t}-${l.base}`), l.sm !== void 0 && a.push(`sm:${t}-${l.sm}`), l.md !== void 0 && a.push(`md:${t}-${l.md}`), l.lg !== void 0 && a.push(`lg:${t}-${l.lg}`), l.xl !== void 0 && a.push(`xl:${t}-${l.xl}`), l["2xl"] !== void 0 && a.push(`2xl:${t}-${l["2xl"]}`), a;
|
|
1356
|
+
}
|
|
1357
|
+
const ut = f({
|
|
1358
|
+
name: "SxoStack",
|
|
1359
|
+
props: {
|
|
1360
|
+
direction: {
|
|
1361
|
+
type: [String, Object],
|
|
1362
|
+
default: "col"
|
|
1363
|
+
},
|
|
1364
|
+
gap: {
|
|
1365
|
+
type: [String, Number, Object],
|
|
1366
|
+
default: 4
|
|
1367
|
+
},
|
|
1368
|
+
align: {
|
|
1369
|
+
type: [String, Object],
|
|
1370
|
+
default: "stretch"
|
|
1371
|
+
},
|
|
1372
|
+
justify: {
|
|
1373
|
+
type: [String, Object],
|
|
1374
|
+
default: "start"
|
|
1375
|
+
},
|
|
1376
|
+
wrap: {
|
|
1377
|
+
type: [Boolean, Object],
|
|
1378
|
+
default: !1
|
|
1379
|
+
}
|
|
1380
|
+
},
|
|
1381
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1382
|
+
const l = m(
|
|
1383
|
+
() => [
|
|
1384
|
+
"flex",
|
|
1385
|
+
...S(e.direction, "flex"),
|
|
1386
|
+
...S(e.gap, "gap"),
|
|
1387
|
+
...S(e.align, "items"),
|
|
1388
|
+
...S(e.justify, "justify"),
|
|
1389
|
+
...typeof e.wrap == "boolean" ? [e.wrap ? "flex-wrap" : "flex-nowrap"] : S(e.wrap, "flex").map(
|
|
1390
|
+
(i) => i.includes("true") ? i.replace("-true", "-wrap") : i.replace("-false", "-nowrap")
|
|
1391
|
+
),
|
|
1392
|
+
a.class
|
|
1393
|
+
].filter(Boolean).join(" ")
|
|
1394
|
+
);
|
|
1395
|
+
return g(() => l.value), () => {
|
|
1396
|
+
var i;
|
|
1397
|
+
return n(
|
|
1398
|
+
"div",
|
|
1399
|
+
{
|
|
1400
|
+
attrs: { ...a },
|
|
1401
|
+
class: l.value
|
|
1402
|
+
},
|
|
1403
|
+
(i = t.default) == null ? void 0 : i.call(t)
|
|
1404
|
+
);
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
}), ct = f({
|
|
1408
|
+
name: "SxoGrid",
|
|
1409
|
+
props: {
|
|
1410
|
+
cols: {
|
|
1411
|
+
type: [Number, Object],
|
|
1412
|
+
default: 1
|
|
1413
|
+
},
|
|
1414
|
+
rows: {
|
|
1415
|
+
type: [Number, Object],
|
|
1416
|
+
default: void 0
|
|
1417
|
+
},
|
|
1418
|
+
gap: {
|
|
1419
|
+
type: [String, Number, Object],
|
|
1420
|
+
default: 4
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1424
|
+
const l = m(
|
|
1425
|
+
() => [
|
|
1426
|
+
"grid",
|
|
1427
|
+
...S(e.cols, "grid-cols"),
|
|
1428
|
+
...S(e.rows, "grid-rows"),
|
|
1429
|
+
...S(e.gap, "gap"),
|
|
1430
|
+
a.class
|
|
1431
|
+
].filter(Boolean).join(" ")
|
|
1432
|
+
);
|
|
1433
|
+
return g(() => l.value), () => {
|
|
1434
|
+
var i;
|
|
1435
|
+
return n(
|
|
1436
|
+
"div",
|
|
1437
|
+
{
|
|
1438
|
+
attrs: { ...a },
|
|
1439
|
+
class: l.value
|
|
1440
|
+
},
|
|
1441
|
+
(i = t.default) == null ? void 0 : i.call(t)
|
|
1442
|
+
);
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1445
|
+
}), dt = f({
|
|
1446
|
+
name: "SxoContainer",
|
|
1447
|
+
props: {
|
|
1448
|
+
center: {
|
|
1449
|
+
type: Boolean,
|
|
1450
|
+
default: !0
|
|
1451
|
+
}
|
|
1452
|
+
},
|
|
1453
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1454
|
+
const l = m(
|
|
1455
|
+
() => ["container", e.center ? "mx-auto" : "", a.class].filter(Boolean).join(" ")
|
|
1456
|
+
);
|
|
1457
|
+
return g(() => l.value), () => {
|
|
1458
|
+
var i;
|
|
1459
|
+
return n(
|
|
1460
|
+
"div",
|
|
1461
|
+
{
|
|
1462
|
+
attrs: { ...a },
|
|
1463
|
+
class: l.value
|
|
1464
|
+
},
|
|
1465
|
+
(i = t.default) == null ? void 0 : i.call(t)
|
|
1466
|
+
);
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
}), vt = f({
|
|
1470
|
+
name: "SxoMenu",
|
|
1471
|
+
props: {
|
|
1472
|
+
label: {
|
|
1473
|
+
type: [String, Object],
|
|
1474
|
+
required: !0
|
|
1475
|
+
},
|
|
1476
|
+
items: {
|
|
1477
|
+
type: Array,
|
|
1478
|
+
required: !0
|
|
1479
|
+
},
|
|
1480
|
+
variant: {
|
|
1481
|
+
type: String,
|
|
1482
|
+
default: "default"
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
setup(e, { emit: t, refs: a, slots: l }) {
|
|
1486
|
+
const i = b(!1), { getMenuProps: s, getItemProps: r, getButtonProps: o } = Z({
|
|
1487
|
+
isOpen: i.value,
|
|
1488
|
+
id: "sxo-menu"
|
|
1489
|
+
}), u = xe({ variant: e.variant });
|
|
1490
|
+
g(() => `${Object.values(u).join(" ")}`);
|
|
1491
|
+
const v = () => {
|
|
1492
|
+
i.value = !i.value;
|
|
1493
|
+
}, c = (d) => {
|
|
1494
|
+
t("select", d), i.value = !1;
|
|
1495
|
+
};
|
|
1496
|
+
return () => n(
|
|
1497
|
+
"div",
|
|
1498
|
+
{
|
|
1499
|
+
class: u.container,
|
|
1500
|
+
attrs: { "data-sxo-component": "Menu" }
|
|
1501
|
+
},
|
|
1502
|
+
[
|
|
1503
|
+
n(
|
|
1504
|
+
"button",
|
|
1505
|
+
{
|
|
1506
|
+
attrs: o(),
|
|
1507
|
+
class: u.button,
|
|
1508
|
+
on: {
|
|
1509
|
+
click: v
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
l.label ? l.label() : e.label
|
|
1513
|
+
),
|
|
1514
|
+
i.value ? n(
|
|
1515
|
+
"div",
|
|
1516
|
+
{
|
|
1517
|
+
attrs: s(),
|
|
1518
|
+
class: u.items
|
|
1519
|
+
},
|
|
1520
|
+
[
|
|
1521
|
+
n(
|
|
1522
|
+
"div",
|
|
1523
|
+
{ class: u.section },
|
|
1524
|
+
e.items.map(
|
|
1525
|
+
(d) => n(
|
|
1526
|
+
"button",
|
|
1527
|
+
{
|
|
1528
|
+
attrs: r(d.id),
|
|
1529
|
+
key: d.id,
|
|
1530
|
+
class: u.item,
|
|
1531
|
+
on: {
|
|
1532
|
+
click: () => c(d)
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
d.label
|
|
1536
|
+
)
|
|
1537
|
+
)
|
|
1538
|
+
)
|
|
1539
|
+
]
|
|
1540
|
+
) : null
|
|
1541
|
+
]
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
}), ft = f({
|
|
1545
|
+
name: "SxoPagination",
|
|
1546
|
+
props: {
|
|
1547
|
+
total: { type: Number, default: 0 },
|
|
1548
|
+
pageSize: { type: Number, default: 10 },
|
|
1549
|
+
current: { type: Number, default: 1 },
|
|
1550
|
+
size: { type: String, default: "md" },
|
|
1551
|
+
variant: { type: String, default: "outline" },
|
|
1552
|
+
rounded: { type: Boolean, default: !0 },
|
|
1553
|
+
showTotal: { type: Boolean, default: !1 },
|
|
1554
|
+
showJumper: { type: Boolean, default: !1 }
|
|
1555
|
+
},
|
|
1556
|
+
setup(e, { emit: t, attrs: a }) {
|
|
1557
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => Math.ceil(e.total / e.pageSize)), r = m(
|
|
1558
|
+
() => be({
|
|
1559
|
+
size: e.size,
|
|
1560
|
+
variant: e.variant,
|
|
1561
|
+
rounded: e.rounded
|
|
1562
|
+
})
|
|
1563
|
+
);
|
|
1564
|
+
g(() => {
|
|
1565
|
+
const c = r.value;
|
|
1566
|
+
return `${c.container} ${c.item} ${c.active} ${c.disabled} ${c.ellipsis} ${a.class || ""}`;
|
|
1567
|
+
});
|
|
1568
|
+
const o = (c) => {
|
|
1569
|
+
c < 1 || c > s.value || c === e.current || t("change", c);
|
|
1570
|
+
}, u = (c) => n(
|
|
1571
|
+
"li",
|
|
1572
|
+
{
|
|
1573
|
+
key: c,
|
|
1574
|
+
class: [r.value.item, e.current === c && r.value.active],
|
|
1575
|
+
on: {
|
|
1576
|
+
click: () => o(c)
|
|
1577
|
+
}
|
|
1578
|
+
},
|
|
1579
|
+
[c]
|
|
1580
|
+
), v = () => {
|
|
1581
|
+
const c = [], d = e.current, x = s.value;
|
|
1582
|
+
if (c.push(
|
|
1583
|
+
n(
|
|
1584
|
+
"li",
|
|
1585
|
+
{
|
|
1586
|
+
class: [r.value.item, d === 1 && r.value.disabled],
|
|
1587
|
+
on: {
|
|
1588
|
+
click: () => o(d - 1)
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
["<"]
|
|
1592
|
+
)
|
|
1593
|
+
), x <= 7)
|
|
1594
|
+
for (let p = 1; p <= x; p++)
|
|
1595
|
+
c.push(u(p));
|
|
1596
|
+
else {
|
|
1597
|
+
c.push(u(1)), d > 4 && c.push(n("li", { class: r.value.ellipsis }, ["..."]));
|
|
1598
|
+
const p = Math.max(2, d - 2), T = Math.min(x - 1, d + 2);
|
|
1599
|
+
for (let $ = p; $ <= T; $++)
|
|
1600
|
+
c.push(u($));
|
|
1601
|
+
d < x - 3 && c.push(n("li", { class: r.value.ellipsis }, ["..."])), c.push(u(x));
|
|
1602
|
+
}
|
|
1603
|
+
return c.push(
|
|
1604
|
+
n(
|
|
1605
|
+
"li",
|
|
1606
|
+
{
|
|
1607
|
+
class: [r.value.item, d === x && r.value.disabled],
|
|
1608
|
+
on: {
|
|
1609
|
+
click: () => o(d + 1)
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
[">"]
|
|
1613
|
+
)
|
|
1614
|
+
), c;
|
|
1615
|
+
};
|
|
1616
|
+
return () => n(
|
|
1617
|
+
"nav",
|
|
1618
|
+
{
|
|
1619
|
+
class: `${r.value.container} ${a.class || ""}`.trim(),
|
|
1620
|
+
on: i
|
|
1621
|
+
},
|
|
1622
|
+
[
|
|
1623
|
+
e.showTotal && n("span", { class: r.value.total }, [`Total ${e.total}`]),
|
|
1624
|
+
n("ul", { class: "flex items-center gap-1 list-none p-0 m-0" }, v()),
|
|
1625
|
+
e.showJumper && n("div", { class: r.value.jumper }, [
|
|
1626
|
+
"Go to",
|
|
1627
|
+
n("input", {
|
|
1628
|
+
class: "w-12 h-8 px-2 border rounded text-center outline-none focus:border-primary-500",
|
|
1629
|
+
attrs: { type: "number" },
|
|
1630
|
+
on: {
|
|
1631
|
+
keyup: (c) => {
|
|
1632
|
+
if (c.key === "Enter") {
|
|
1633
|
+
const d = parseInt(
|
|
1634
|
+
c.target.value
|
|
1635
|
+
);
|
|
1636
|
+
isNaN(d) || o(d);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
})
|
|
1641
|
+
])
|
|
1642
|
+
]
|
|
1643
|
+
);
|
|
1644
|
+
}
|
|
1645
|
+
}), G = Symbol("RadioGroup"), mt = f({
|
|
1646
|
+
name: "SxoRadioGroup",
|
|
1647
|
+
props: {
|
|
1648
|
+
value: {
|
|
1649
|
+
type: String,
|
|
1650
|
+
default: ""
|
|
1651
|
+
},
|
|
1652
|
+
name: {
|
|
1653
|
+
type: String,
|
|
1654
|
+
default: () => `sxo-radio-group-${Math.random().toString(36).substr(2, 9)}`
|
|
1655
|
+
},
|
|
1656
|
+
size: {
|
|
1657
|
+
type: String,
|
|
1658
|
+
default: "md"
|
|
1659
|
+
},
|
|
1660
|
+
color: {
|
|
1661
|
+
type: String,
|
|
1662
|
+
default: "primary"
|
|
1663
|
+
},
|
|
1664
|
+
direction: {
|
|
1665
|
+
type: String,
|
|
1666
|
+
default: "row"
|
|
1667
|
+
},
|
|
1668
|
+
gap: {
|
|
1669
|
+
type: [String, Number],
|
|
1670
|
+
default: 2
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
setup(e, { emit: t, slots: a, attrs: l }) {
|
|
1674
|
+
const i = b(e.value);
|
|
1675
|
+
h(
|
|
1676
|
+
() => e.value,
|
|
1677
|
+
(r) => {
|
|
1678
|
+
i.value = r;
|
|
1679
|
+
}
|
|
1680
|
+
);
|
|
1681
|
+
const s = (r) => {
|
|
1682
|
+
i.value = r, t("input", r), t("change", r);
|
|
1683
|
+
};
|
|
1684
|
+
return k(G, {
|
|
1685
|
+
value: i,
|
|
1686
|
+
name: e.name,
|
|
1687
|
+
size: e.size,
|
|
1688
|
+
color: e.color,
|
|
1689
|
+
updateValue: s
|
|
1690
|
+
}), () => {
|
|
1691
|
+
var r;
|
|
1692
|
+
return n(
|
|
1693
|
+
"div",
|
|
1694
|
+
{
|
|
1695
|
+
class: `flex flex-${e.direction} gap-${e.gap} ${l.class || ""}`.trim()
|
|
1696
|
+
},
|
|
1697
|
+
(r = a.default) == null ? void 0 : r.call(a)
|
|
1698
|
+
);
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
}), gt = f({
|
|
1702
|
+
name: "SxoRadio",
|
|
1703
|
+
props: {
|
|
1704
|
+
value: {
|
|
1705
|
+
type: String,
|
|
1706
|
+
required: !0
|
|
1707
|
+
},
|
|
1708
|
+
label: {
|
|
1709
|
+
type: String,
|
|
1710
|
+
default: ""
|
|
1711
|
+
},
|
|
1712
|
+
size: {
|
|
1713
|
+
type: String,
|
|
1714
|
+
default: void 0
|
|
1715
|
+
},
|
|
1716
|
+
color: {
|
|
1717
|
+
type: String,
|
|
1718
|
+
default: void 0
|
|
1719
|
+
},
|
|
1720
|
+
disabled: {
|
|
1721
|
+
type: Boolean,
|
|
1722
|
+
default: !1
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1726
|
+
const l = w(G);
|
|
1727
|
+
if (!l) throw new Error("Radio must be used within RadioGroup");
|
|
1728
|
+
const i = y(), s = (i == null ? void 0 : i.proxy.$listeners) || {}, r = m(() => l.value.value === e.value), o = m(() => e.size || l.size), u = m(() => e.color || l.color), v = m(
|
|
1729
|
+
() => he(r.value, {
|
|
1730
|
+
size: o.value,
|
|
1731
|
+
color: u.value,
|
|
1732
|
+
disabled: e.disabled
|
|
1733
|
+
})
|
|
1734
|
+
);
|
|
1735
|
+
g(() => {
|
|
1736
|
+
const d = v.value;
|
|
1737
|
+
return [d.root, d.inner, a.class].filter(Boolean).join(" ");
|
|
1738
|
+
});
|
|
1739
|
+
const c = () => {
|
|
1740
|
+
e.disabled || l.updateValue(e.value);
|
|
1741
|
+
};
|
|
1742
|
+
return () => {
|
|
1743
|
+
var d, x;
|
|
1744
|
+
return n(
|
|
1745
|
+
"label",
|
|
1746
|
+
{
|
|
1747
|
+
class: [
|
|
1748
|
+
"inline-flex items-center gap-2 cursor-pointer",
|
|
1749
|
+
e.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1750
|
+
a.class
|
|
1751
|
+
],
|
|
1752
|
+
on: {
|
|
1753
|
+
click: c
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
[
|
|
1757
|
+
n("div", { class: v.value.root }, [
|
|
1758
|
+
n("input", {
|
|
1759
|
+
attrs: {
|
|
1760
|
+
type: "radio",
|
|
1761
|
+
name: l.name,
|
|
1762
|
+
value: e.value,
|
|
1763
|
+
checked: r.value,
|
|
1764
|
+
disabled: e.disabled
|
|
1765
|
+
},
|
|
1766
|
+
class: "sr-only",
|
|
1767
|
+
on: {
|
|
1768
|
+
change: c,
|
|
1769
|
+
...s
|
|
1770
|
+
}
|
|
1771
|
+
}),
|
|
1772
|
+
n("div", { class: v.value.inner })
|
|
1773
|
+
]),
|
|
1774
|
+
(((d = t.default) == null ? void 0 : d.call(t)) || e.label) && n(
|
|
1775
|
+
"span",
|
|
1776
|
+
{ class: "text-sm font-medium" },
|
|
1777
|
+
((x = t.default) == null ? void 0 : x.call(t)) || e.label
|
|
1778
|
+
)
|
|
1779
|
+
]
|
|
1780
|
+
);
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
}), yt = f({
|
|
1784
|
+
name: "SxoResult",
|
|
1785
|
+
props: {
|
|
1786
|
+
status: { type: String, default: "info" },
|
|
1787
|
+
title: { type: String, default: "" },
|
|
1788
|
+
subTitle: { type: String, default: "" }
|
|
1789
|
+
},
|
|
1790
|
+
setup(e, { slots: t, attrs: a }) {
|
|
1791
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => Se({ status: e.status }));
|
|
1792
|
+
g(() => {
|
|
1793
|
+
const o = s.value;
|
|
1794
|
+
return `${o.container} ${o.icon} ${o.title} ${o.subTitle} ${o.extra} ${a.class || ""}`;
|
|
1795
|
+
});
|
|
1796
|
+
const r = () => {
|
|
1797
|
+
if (t.icon) return n("div", { class: s.value.icon }, t.icon());
|
|
1798
|
+
const o = {
|
|
1799
|
+
success: n(
|
|
1800
|
+
"svg",
|
|
1801
|
+
{
|
|
1802
|
+
attrs: {
|
|
1803
|
+
viewBox: "0 0 24 24",
|
|
1804
|
+
fill: "none",
|
|
1805
|
+
stroke: "currentColor",
|
|
1806
|
+
"stroke-width": "2"
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
[
|
|
1810
|
+
n("path", { attrs: { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" } }),
|
|
1811
|
+
n("polyline", { attrs: { points: "22 4 12 14.01 9 11.01" } })
|
|
1812
|
+
]
|
|
1813
|
+
),
|
|
1814
|
+
error: n(
|
|
1815
|
+
"svg",
|
|
1816
|
+
{
|
|
1817
|
+
attrs: {
|
|
1818
|
+
viewBox: "0 0 24 24",
|
|
1819
|
+
fill: "none",
|
|
1820
|
+
stroke: "currentColor",
|
|
1821
|
+
"stroke-width": "2"
|
|
1822
|
+
}
|
|
1823
|
+
},
|
|
1824
|
+
[
|
|
1825
|
+
n("circle", { attrs: { cx: "12", cy: "12", r: "10" } }),
|
|
1826
|
+
n("line", { attrs: { x1: "15", y1: "9", x2: "9", y2: "15" } }),
|
|
1827
|
+
n("line", { attrs: { x1: "9", y1: "9", x2: "15", y2: "15" } })
|
|
1828
|
+
]
|
|
1829
|
+
),
|
|
1830
|
+
info: n(
|
|
1831
|
+
"svg",
|
|
1832
|
+
{
|
|
1833
|
+
attrs: {
|
|
1834
|
+
viewBox: "0 0 24 24",
|
|
1835
|
+
fill: "none",
|
|
1836
|
+
stroke: "currentColor",
|
|
1837
|
+
"stroke-width": "2"
|
|
1838
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
[
|
|
1841
|
+
n("circle", { attrs: { cx: "12", cy: "12", r: "10" } }),
|
|
1842
|
+
n("line", { attrs: { x1: "12", y1: "16", x2: "12", y2: "12" } }),
|
|
1843
|
+
n("line", { attrs: { x1: "12", y1: "8", x2: "12.01", y2: "8" } })
|
|
1844
|
+
]
|
|
1845
|
+
),
|
|
1846
|
+
warning: n(
|
|
1847
|
+
"svg",
|
|
1848
|
+
{
|
|
1849
|
+
attrs: {
|
|
1850
|
+
viewBox: "0 0 24 24",
|
|
1851
|
+
fill: "none",
|
|
1852
|
+
stroke: "currentColor",
|
|
1853
|
+
"stroke-width": "2"
|
|
1854
|
+
}
|
|
1855
|
+
},
|
|
1856
|
+
[
|
|
1857
|
+
n("path", {
|
|
1858
|
+
attrs: {
|
|
1859
|
+
d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
|
|
1860
|
+
}
|
|
1861
|
+
}),
|
|
1862
|
+
n("line", { attrs: { x1: "12", y1: "9", x2: "12", y2: "13" } }),
|
|
1863
|
+
n("line", { attrs: { x1: "12", y1: "17", x2: "12.01", y2: "17" } })
|
|
1864
|
+
]
|
|
1865
|
+
),
|
|
1866
|
+
404: n("div", { class: "text-6xl font-black opacity-20" }, "404"),
|
|
1867
|
+
500: n("div", { class: "text-6xl font-black opacity-20" }, "500"),
|
|
1868
|
+
403: n("div", { class: "text-6xl font-black opacity-20" }, "403")
|
|
1869
|
+
};
|
|
1870
|
+
return n("div", { class: s.value.icon }, [o[e.status || "info"]]);
|
|
1871
|
+
};
|
|
1872
|
+
return () => {
|
|
1873
|
+
var o;
|
|
1874
|
+
return n(
|
|
1875
|
+
"div",
|
|
1876
|
+
{
|
|
1877
|
+
class: [s.value.container, a.class],
|
|
1878
|
+
attrs: a,
|
|
1879
|
+
on: i
|
|
1880
|
+
},
|
|
1881
|
+
[
|
|
1882
|
+
r(),
|
|
1883
|
+
n(
|
|
1884
|
+
"div",
|
|
1885
|
+
{ class: s.value.title },
|
|
1886
|
+
t.title ? t.title() : e.title
|
|
1887
|
+
),
|
|
1888
|
+
n(
|
|
1889
|
+
"div",
|
|
1890
|
+
{ class: s.value.subTitle },
|
|
1891
|
+
t.subTitle ? t.subTitle() : e.subTitle
|
|
1892
|
+
),
|
|
1893
|
+
t.extra && n("div", { class: s.value.extra }, t.extra()),
|
|
1894
|
+
(o = t.default) == null ? void 0 : o.call(t)
|
|
1895
|
+
]
|
|
1896
|
+
);
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
}), pt = f({
|
|
1900
|
+
name: "SxoSearch",
|
|
1901
|
+
props: {
|
|
1902
|
+
value: {
|
|
1903
|
+
type: String,
|
|
1904
|
+
default: ""
|
|
1905
|
+
},
|
|
1906
|
+
placeholder: {
|
|
1907
|
+
type: String,
|
|
1908
|
+
default: "Search..."
|
|
1909
|
+
},
|
|
1910
|
+
variant: {
|
|
1911
|
+
type: String,
|
|
1912
|
+
default: "outline"
|
|
1913
|
+
},
|
|
1914
|
+
size: {
|
|
1915
|
+
type: String,
|
|
1916
|
+
default: "md"
|
|
1917
|
+
},
|
|
1918
|
+
rounded: {
|
|
1919
|
+
type: Boolean,
|
|
1920
|
+
default: !0
|
|
1921
|
+
},
|
|
1922
|
+
loading: {
|
|
1923
|
+
type: Boolean,
|
|
1924
|
+
default: !1
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1927
|
+
setup(e, { emit: t, attrs: a }) {
|
|
1928
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = b(null), r = m(
|
|
1929
|
+
() => we({
|
|
1930
|
+
variant: e.variant,
|
|
1931
|
+
size: e.size,
|
|
1932
|
+
rounded: e.rounded
|
|
1933
|
+
})
|
|
1934
|
+
);
|
|
1935
|
+
g(() => {
|
|
1936
|
+
const c = r.value;
|
|
1937
|
+
return `${c.container} ${c.input} ${c.icon} ${c.clear} ${a.class || ""}`;
|
|
1938
|
+
});
|
|
1939
|
+
const o = (c) => {
|
|
1940
|
+
const d = c.target;
|
|
1941
|
+
t("input", d.value);
|
|
1942
|
+
}, u = (c) => {
|
|
1943
|
+
c.key === "Enter" && t("search", e.value);
|
|
1944
|
+
}, v = () => {
|
|
1945
|
+
var c;
|
|
1946
|
+
t("input", ""), t("clear"), (c = s.value) == null || c.focus();
|
|
1947
|
+
};
|
|
1948
|
+
return () => n("div", { class: [r.value.container, a.class] }, [
|
|
1949
|
+
// Search Icon
|
|
1950
|
+
n(
|
|
1951
|
+
"span",
|
|
1952
|
+
{ class: r.value.icon },
|
|
1953
|
+
n(
|
|
1954
|
+
"svg",
|
|
1955
|
+
{
|
|
1956
|
+
attrs: {
|
|
1957
|
+
viewBox: "0 0 24 24",
|
|
1958
|
+
fill: "none",
|
|
1959
|
+
stroke: "currentColor",
|
|
1960
|
+
"stroke-width": "2",
|
|
1961
|
+
"stroke-linecap": "round",
|
|
1962
|
+
"stroke-linejoin": "round"
|
|
1963
|
+
},
|
|
1964
|
+
class: "w-full h-full"
|
|
1965
|
+
},
|
|
1966
|
+
[
|
|
1967
|
+
n("circle", { attrs: { cx: "11", cy: "11", r: "8" } }),
|
|
1968
|
+
n("line", {
|
|
1969
|
+
attrs: { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }
|
|
1970
|
+
})
|
|
1971
|
+
]
|
|
1972
|
+
)
|
|
1973
|
+
),
|
|
1974
|
+
// Input Field
|
|
1975
|
+
n("input", {
|
|
1976
|
+
ref: "inputRef",
|
|
1977
|
+
attrs: {
|
|
1978
|
+
...a,
|
|
1979
|
+
type: "text",
|
|
1980
|
+
placeholder: e.placeholder
|
|
1981
|
+
},
|
|
1982
|
+
domProps: {
|
|
1983
|
+
value: e.value
|
|
1984
|
+
},
|
|
1985
|
+
class: r.value.input,
|
|
1986
|
+
on: {
|
|
1987
|
+
...i,
|
|
1988
|
+
input: o,
|
|
1989
|
+
keydown: u
|
|
1990
|
+
}
|
|
1991
|
+
}),
|
|
1992
|
+
// Clear Button
|
|
1993
|
+
e.value && n(
|
|
1994
|
+
"span",
|
|
1995
|
+
{
|
|
1996
|
+
class: r.value.clear,
|
|
1997
|
+
on: {
|
|
1998
|
+
click: v
|
|
1999
|
+
}
|
|
2000
|
+
},
|
|
2001
|
+
n(
|
|
2002
|
+
"svg",
|
|
2003
|
+
{
|
|
2004
|
+
attrs: {
|
|
2005
|
+
viewBox: "0 0 24 24",
|
|
2006
|
+
fill: "none",
|
|
2007
|
+
stroke: "currentColor",
|
|
2008
|
+
"stroke-width": "2",
|
|
2009
|
+
"stroke-linecap": "round",
|
|
2010
|
+
"stroke-linejoin": "round"
|
|
2011
|
+
},
|
|
2012
|
+
class: "w-full h-full"
|
|
2013
|
+
},
|
|
2014
|
+
[
|
|
2015
|
+
n("line", { attrs: { x1: "18", y1: "6", x2: "6", y2: "18" } }),
|
|
2016
|
+
n("line", { attrs: { x1: "6", y1: "6", x2: "18", y2: "18" } })
|
|
2017
|
+
]
|
|
2018
|
+
)
|
|
2019
|
+
)
|
|
2020
|
+
]);
|
|
2021
|
+
}
|
|
2022
|
+
}), X = Symbol("Select"), xt = f({
|
|
2023
|
+
name: "SxoSelect",
|
|
2024
|
+
props: {
|
|
2025
|
+
value: {
|
|
2026
|
+
type: String,
|
|
2027
|
+
default: ""
|
|
2028
|
+
},
|
|
2029
|
+
placeholder: {
|
|
2030
|
+
type: String,
|
|
2031
|
+
default: "Select an option"
|
|
2032
|
+
},
|
|
2033
|
+
size: {
|
|
2034
|
+
type: String,
|
|
2035
|
+
default: "md"
|
|
2036
|
+
},
|
|
2037
|
+
disabled: {
|
|
2038
|
+
type: Boolean,
|
|
2039
|
+
default: !1
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
setup(e, { emit: t, slots: a, attrs: l }) {
|
|
2043
|
+
const i = b(e.value);
|
|
2044
|
+
h(
|
|
2045
|
+
() => e.value,
|
|
2046
|
+
(p) => {
|
|
2047
|
+
i.value = p;
|
|
2048
|
+
}
|
|
2049
|
+
);
|
|
2050
|
+
const { isOpen: s, setValue: r, getTriggerProps: o, getListboxProps: u } = ee({
|
|
2051
|
+
defaultValue: i.value
|
|
2052
|
+
}), v = m(() => A(s.value, { size: e.size }));
|
|
2053
|
+
g(() => `${v.value.trigger} ${v.value.listbox} ${l.class || ""}`), k(X, {
|
|
2054
|
+
currentValue: i,
|
|
2055
|
+
handleSelect: (p) => {
|
|
2056
|
+
i.value = p, r(p), t("input", p), t("change", p);
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
const d = y(), x = (d == null ? void 0 : d.proxy.$listeners) || {};
|
|
2060
|
+
return () => {
|
|
2061
|
+
var p;
|
|
2062
|
+
return n(
|
|
2063
|
+
"div",
|
|
2064
|
+
{
|
|
2065
|
+
class: `relative inline-block w-full ${l.class || ""}`.trim()
|
|
2066
|
+
},
|
|
2067
|
+
[
|
|
2068
|
+
n(
|
|
2069
|
+
"div",
|
|
2070
|
+
{
|
|
2071
|
+
attrs: { ...o().attrs },
|
|
2072
|
+
class: v.value.trigger,
|
|
2073
|
+
on: { ...o().on, ...x }
|
|
2074
|
+
},
|
|
2075
|
+
[
|
|
2076
|
+
n(
|
|
2077
|
+
"span",
|
|
2078
|
+
{
|
|
2079
|
+
class: i.value ? "text-foreground" : "text-neutral-400"
|
|
2080
|
+
},
|
|
2081
|
+
i.value || e.placeholder
|
|
2082
|
+
),
|
|
2083
|
+
n(
|
|
2084
|
+
"svg",
|
|
2085
|
+
{
|
|
2086
|
+
class: `transition-transform duration-200 ${s.value ? "rotate-180" : ""}`,
|
|
2087
|
+
attrs: {
|
|
2088
|
+
width: "16",
|
|
2089
|
+
height: "16",
|
|
2090
|
+
viewBox: "0 0 24 24",
|
|
2091
|
+
fill: "none",
|
|
2092
|
+
stroke: "currentColor",
|
|
2093
|
+
"stroke-width": "2"
|
|
2094
|
+
}
|
|
2095
|
+
},
|
|
2096
|
+
[n("polyline", { attrs: { points: "6 9 12 15 18 9" } })]
|
|
2097
|
+
)
|
|
2098
|
+
]
|
|
2099
|
+
),
|
|
2100
|
+
s.value ? n(
|
|
2101
|
+
"div",
|
|
2102
|
+
{
|
|
2103
|
+
attrs: { ...u().attrs },
|
|
2104
|
+
class: v.value.listbox,
|
|
2105
|
+
on: { ...u().on }
|
|
2106
|
+
},
|
|
2107
|
+
(p = a.default) == null ? void 0 : p.call(a)
|
|
2108
|
+
) : null
|
|
2109
|
+
]
|
|
2110
|
+
);
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
}), bt = f({
|
|
2114
|
+
name: "SxoSelectOption",
|
|
2115
|
+
props: {
|
|
2116
|
+
value: {
|
|
2117
|
+
type: String,
|
|
2118
|
+
required: !0
|
|
2119
|
+
}
|
|
2120
|
+
},
|
|
2121
|
+
setup(e, { slots: t, attrs: a }) {
|
|
2122
|
+
const l = w(X);
|
|
2123
|
+
if (!l) throw new Error("SelectOption must be used within Select");
|
|
2124
|
+
const i = m(() => l.currentValue.value === e.value), s = A(!1);
|
|
2125
|
+
return g(() => `${s.option} ${a.class || ""}`), () => {
|
|
2126
|
+
var r;
|
|
2127
|
+
return n(
|
|
2128
|
+
"div",
|
|
2129
|
+
{
|
|
2130
|
+
class: `${s.option} ${i.value ? "bg-primary/10 text-primary font-medium" : ""} ${a.class || ""}`.trim(),
|
|
2131
|
+
on: {
|
|
2132
|
+
click: () => l.handleSelect(e.value)
|
|
2133
|
+
}
|
|
2134
|
+
},
|
|
2135
|
+
(r = t.default) == null ? void 0 : r.call(t)
|
|
2136
|
+
);
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
}), ht = f({
|
|
2140
|
+
name: "SxoSlider",
|
|
2141
|
+
props: {
|
|
2142
|
+
value: { type: Number, default: 0 },
|
|
2143
|
+
min: { type: Number, default: 0 },
|
|
2144
|
+
max: { type: Number, default: 100 },
|
|
2145
|
+
step: { type: Number, default: 1 },
|
|
2146
|
+
disabled: { type: Boolean, default: !1 }
|
|
2147
|
+
},
|
|
2148
|
+
setup(e, { emit: t, attrs: a }) {
|
|
2149
|
+
const l = b(null), i = b(!1), s = m(() => $e({ disabled: e.disabled })), r = m(() => (e.value - e.min) / (e.max - e.min) * 100), o = (p) => {
|
|
2150
|
+
if (e.disabled || !l.value) return;
|
|
2151
|
+
const T = l.value.getBoundingClientRect();
|
|
2152
|
+
let $ = (p - T.left) / T.width;
|
|
2153
|
+
$ = Math.max(0, Math.min(1, $));
|
|
2154
|
+
let C = e.min + $ * (e.max - e.min);
|
|
2155
|
+
C = Math.round(C / e.step) * e.step, C = Math.max(e.min, Math.min(e.max, C)), t("input", C), t("change", C);
|
|
2156
|
+
}, u = (p) => {
|
|
2157
|
+
i.value && o(p.clientX);
|
|
2158
|
+
}, v = () => {
|
|
2159
|
+
i.value = !1, window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", v);
|
|
2160
|
+
}, c = (p) => {
|
|
2161
|
+
e.disabled || (i.value = !0, o(p.clientX), window.addEventListener("mousemove", u), window.addEventListener("mouseup", v));
|
|
2162
|
+
};
|
|
2163
|
+
j(() => {
|
|
2164
|
+
window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", v);
|
|
2165
|
+
});
|
|
2166
|
+
const d = y(), x = (d == null ? void 0 : d.proxy.$listeners) || {};
|
|
2167
|
+
return () => n(
|
|
2168
|
+
"div",
|
|
2169
|
+
{
|
|
2170
|
+
ref: "sliderRef",
|
|
2171
|
+
class: [s.value.container, a.class],
|
|
2172
|
+
on: {
|
|
2173
|
+
mousedown: c,
|
|
2174
|
+
...x
|
|
2175
|
+
}
|
|
2176
|
+
},
|
|
2177
|
+
[
|
|
2178
|
+
n("div", { class: s.value.track }, [
|
|
2179
|
+
n("div", {
|
|
2180
|
+
class: s.value.range,
|
|
2181
|
+
style: { width: `${r.value}%` }
|
|
2182
|
+
})
|
|
2183
|
+
]),
|
|
2184
|
+
n("div", {
|
|
2185
|
+
class: s.value.handle,
|
|
2186
|
+
style: {
|
|
2187
|
+
left: `${r.value}%`,
|
|
2188
|
+
transform: "translateX(-50%)"
|
|
2189
|
+
}
|
|
2190
|
+
})
|
|
2191
|
+
]
|
|
2192
|
+
);
|
|
2193
|
+
},
|
|
2194
|
+
// Handle ref in Vue 2 setup
|
|
2195
|
+
mounted() {
|
|
2196
|
+
this.sliderRef = this.$refs.sliderRef;
|
|
2197
|
+
}
|
|
2198
|
+
}), St = f({
|
|
2199
|
+
name: "SxoSwitch",
|
|
2200
|
+
props: {
|
|
2201
|
+
value: {
|
|
2202
|
+
type: Boolean,
|
|
2203
|
+
default: !1
|
|
2204
|
+
},
|
|
2205
|
+
disabled: {
|
|
2206
|
+
type: Boolean,
|
|
2207
|
+
default: !1
|
|
2208
|
+
},
|
|
2209
|
+
size: {
|
|
2210
|
+
type: String,
|
|
2211
|
+
default: "md"
|
|
2212
|
+
},
|
|
2213
|
+
color: {
|
|
2214
|
+
type: String,
|
|
2215
|
+
default: "primary"
|
|
2216
|
+
}
|
|
2217
|
+
},
|
|
2218
|
+
setup(e, { emit: t, attrs: a }) {
|
|
2219
|
+
const l = b(e.value);
|
|
2220
|
+
h(
|
|
2221
|
+
() => e.value,
|
|
2222
|
+
(u) => {
|
|
2223
|
+
l.value = u;
|
|
2224
|
+
}
|
|
2225
|
+
);
|
|
2226
|
+
const i = m(() => ke(l.value, {
|
|
2227
|
+
size: e.size,
|
|
2228
|
+
color: e.color,
|
|
2229
|
+
disabled: e.disabled
|
|
2230
|
+
}));
|
|
2231
|
+
g(() => `${i.value.track} ${i.value.thumb} ${a.class || ""}`);
|
|
2232
|
+
const s = () => {
|
|
2233
|
+
e.disabled || (l.value = !l.value, t("input", l.value), t("change", l.value));
|
|
2234
|
+
}, r = y(), o = (r == null ? void 0 : r.proxy.$listeners) || {};
|
|
2235
|
+
return () => n(
|
|
2236
|
+
"div",
|
|
2237
|
+
{
|
|
2238
|
+
class: `${i.value.track} ${e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${a.class || ""}`.trim(),
|
|
2239
|
+
on: {
|
|
2240
|
+
click: s,
|
|
2241
|
+
...o
|
|
2242
|
+
}
|
|
2243
|
+
},
|
|
2244
|
+
[n("span", { class: i.value.thumb })]
|
|
2245
|
+
);
|
|
2246
|
+
}
|
|
2247
|
+
}), P = "SxoTabs", wt = f({
|
|
2248
|
+
name: "SxoTabs",
|
|
2249
|
+
props: {
|
|
2250
|
+
value: String,
|
|
2251
|
+
defaultValue: String,
|
|
2252
|
+
variant: {
|
|
2253
|
+
type: String,
|
|
2254
|
+
default: "line"
|
|
2255
|
+
},
|
|
2256
|
+
size: {
|
|
2257
|
+
type: String,
|
|
2258
|
+
default: "md"
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
provide() {
|
|
2262
|
+
return {
|
|
2263
|
+
[P]: this
|
|
2264
|
+
};
|
|
2265
|
+
},
|
|
2266
|
+
setup(e, { emit: t, attrs: a }) {
|
|
2267
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = b(e.value || e.defaultValue || "");
|
|
2268
|
+
h(
|
|
2269
|
+
() => e.value,
|
|
2270
|
+
(v) => {
|
|
2271
|
+
v !== void 0 && (s.value = v);
|
|
2272
|
+
}
|
|
2273
|
+
);
|
|
2274
|
+
const { getTabProps: r, getTabPanelProps: o } = te({
|
|
2275
|
+
value: s.value,
|
|
2276
|
+
onChange: (v) => {
|
|
2277
|
+
s.value = v, t("input", v), t("change", v);
|
|
2278
|
+
}
|
|
2279
|
+
}), u = m(
|
|
2280
|
+
() => Ce({
|
|
2281
|
+
variant: e.variant,
|
|
2282
|
+
size: e.size
|
|
2283
|
+
})
|
|
2284
|
+
);
|
|
2285
|
+
return g(() => `${u.value.list} ${a.class || ""}`), {
|
|
2286
|
+
currentValue: s,
|
|
2287
|
+
selectTab: (v) => {
|
|
2288
|
+
s.value = v, t("input", v), t("change", v);
|
|
2289
|
+
},
|
|
2290
|
+
styles: u,
|
|
2291
|
+
getTabProps: r,
|
|
2292
|
+
getTabPanelProps: o,
|
|
2293
|
+
listeners: i
|
|
2294
|
+
};
|
|
2295
|
+
},
|
|
2296
|
+
render() {
|
|
2297
|
+
return n(
|
|
2298
|
+
"div",
|
|
2299
|
+
{
|
|
2300
|
+
class: this.$attrs.class,
|
|
2301
|
+
on: this.listeners
|
|
2302
|
+
},
|
|
2303
|
+
this.$slots.default
|
|
2304
|
+
);
|
|
2305
|
+
}
|
|
2306
|
+
}), $t = f({
|
|
2307
|
+
name: "SxoTabList",
|
|
2308
|
+
inject: {
|
|
2309
|
+
tabsContext: { from: P, default: null }
|
|
2310
|
+
},
|
|
2311
|
+
render() {
|
|
2312
|
+
const e = this.tabsContext;
|
|
2313
|
+
if (!e) throw new Error("TabList must be used within Tabs");
|
|
2314
|
+
return n(
|
|
2315
|
+
"div",
|
|
2316
|
+
{
|
|
2317
|
+
role: "tablist",
|
|
2318
|
+
class: `${e.styles.list} ${this.$attrs.class || ""}`.trim()
|
|
2319
|
+
},
|
|
2320
|
+
this.$slots.default
|
|
2321
|
+
);
|
|
2322
|
+
}
|
|
2323
|
+
}), kt = f({
|
|
2324
|
+
name: "SxoTab",
|
|
2325
|
+
props: {
|
|
2326
|
+
value: {
|
|
2327
|
+
type: String,
|
|
2328
|
+
required: !0
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
inject: {
|
|
2332
|
+
tabsContext: { from: P, default: null }
|
|
2333
|
+
},
|
|
2334
|
+
render() {
|
|
2335
|
+
const e = this.tabsContext;
|
|
2336
|
+
if (!e) throw new Error("Tab must be used within Tabs");
|
|
2337
|
+
const t = e.currentValue === this.value, a = e.getTabProps(this.value, e.selectTab);
|
|
2338
|
+
return n(
|
|
2339
|
+
"div",
|
|
2340
|
+
{
|
|
2341
|
+
attrs: a.attrs,
|
|
2342
|
+
on: a.on,
|
|
2343
|
+
class: `${e.styles.tab(t)} ${this.$attrs.class || ""}`.trim()
|
|
2344
|
+
},
|
|
2345
|
+
this.$slots.default
|
|
2346
|
+
);
|
|
2347
|
+
}
|
|
2348
|
+
}), Ct = f({
|
|
2349
|
+
name: "SxoTabPanel",
|
|
2350
|
+
props: {
|
|
2351
|
+
value: {
|
|
2352
|
+
type: String,
|
|
2353
|
+
required: !0
|
|
2354
|
+
}
|
|
2355
|
+
},
|
|
2356
|
+
inject: {
|
|
2357
|
+
tabsContext: { from: P, default: null }
|
|
2358
|
+
},
|
|
2359
|
+
render() {
|
|
2360
|
+
const e = this.tabsContext;
|
|
2361
|
+
if (!e) throw new Error("TabPanel must be used within Tabs");
|
|
2362
|
+
const t = e.getTabPanelProps(this.value);
|
|
2363
|
+
return n(
|
|
2364
|
+
"div",
|
|
2365
|
+
{
|
|
2366
|
+
attrs: t.attrs,
|
|
2367
|
+
class: `${e.styles.panel} ${this.$attrs.class || ""}`.trim()
|
|
2368
|
+
},
|
|
2369
|
+
this.$slots.default
|
|
2370
|
+
);
|
|
2371
|
+
}
|
|
2372
|
+
}), Bt = f({
|
|
2373
|
+
name: "SxoTag",
|
|
2374
|
+
props: {
|
|
2375
|
+
variant: {
|
|
2376
|
+
type: String,
|
|
2377
|
+
default: "solid"
|
|
2378
|
+
},
|
|
2379
|
+
color: {
|
|
2380
|
+
type: String,
|
|
2381
|
+
default: "primary"
|
|
2382
|
+
},
|
|
2383
|
+
rounded: {
|
|
2384
|
+
type: String,
|
|
2385
|
+
default: "sm"
|
|
2386
|
+
},
|
|
2387
|
+
size: {
|
|
2388
|
+
type: String,
|
|
2389
|
+
default: "md"
|
|
2390
|
+
},
|
|
2391
|
+
closable: {
|
|
2392
|
+
type: Boolean,
|
|
2393
|
+
default: !1
|
|
2394
|
+
}
|
|
2395
|
+
},
|
|
2396
|
+
setup(e, { slots: t, attrs: a, emit: l }) {
|
|
2397
|
+
const i = m(() => {
|
|
2398
|
+
const u = Be({
|
|
2399
|
+
variant: e.variant,
|
|
2400
|
+
color: e.color,
|
|
2401
|
+
rounded: e.rounded,
|
|
2402
|
+
size: e.size,
|
|
2403
|
+
closable: e.closable
|
|
2404
|
+
});
|
|
2405
|
+
return {
|
|
2406
|
+
base: `${u.base} ${a.class || ""}`.trim(),
|
|
2407
|
+
closeIcon: u.closeIcon
|
|
2408
|
+
};
|
|
2409
|
+
});
|
|
2410
|
+
g(() => `${i.value.base} ${i.value.closeIcon}`);
|
|
2411
|
+
const s = y(), r = (s == null ? void 0 : s.proxy.$listeners) || {}, o = (u) => {
|
|
2412
|
+
u.stopPropagation(), l("close");
|
|
2413
|
+
};
|
|
2414
|
+
return () => {
|
|
2415
|
+
var u;
|
|
2416
|
+
return n(
|
|
2417
|
+
"span",
|
|
2418
|
+
{
|
|
2419
|
+
class: i.value.base,
|
|
2420
|
+
on: r,
|
|
2421
|
+
attrs: { ...a }
|
|
2422
|
+
},
|
|
2423
|
+
[
|
|
2424
|
+
(u = t.default) == null ? void 0 : u.call(t),
|
|
2425
|
+
e.closable && n(
|
|
2426
|
+
"span",
|
|
2427
|
+
{
|
|
2428
|
+
class: i.value.closeIcon,
|
|
2429
|
+
on: {
|
|
2430
|
+
click: o
|
|
2431
|
+
}
|
|
2432
|
+
},
|
|
2433
|
+
"×"
|
|
2434
|
+
)
|
|
2435
|
+
]
|
|
2436
|
+
);
|
|
2437
|
+
};
|
|
2438
|
+
}
|
|
2439
|
+
}), Tt = f({
|
|
2440
|
+
name: "SxoTimelineItem",
|
|
2441
|
+
props: {
|
|
2442
|
+
label: { type: String, default: "" },
|
|
2443
|
+
title: { type: String, default: "" },
|
|
2444
|
+
description: { type: String, default: "" },
|
|
2445
|
+
color: { type: String, default: "" }
|
|
2446
|
+
},
|
|
2447
|
+
setup(e, { slots: t, attrs: a }) {
|
|
2448
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => L());
|
|
2449
|
+
return g(() => `${Object.values(s.value).join(" ")}`), () => n(
|
|
2450
|
+
"div",
|
|
2451
|
+
{
|
|
2452
|
+
class: [s.value.item, a.class],
|
|
2453
|
+
attrs: a,
|
|
2454
|
+
on: i
|
|
2455
|
+
},
|
|
2456
|
+
[
|
|
2457
|
+
n("div", { class: s.value.tail }),
|
|
2458
|
+
n("div", {
|
|
2459
|
+
class: s.value.dot,
|
|
2460
|
+
style: e.color ? { backgroundColor: e.color } : void 0
|
|
2461
|
+
}),
|
|
2462
|
+
n("div", { class: s.value.content }, [
|
|
2463
|
+
(e.label || t.label) && n(
|
|
2464
|
+
"div",
|
|
2465
|
+
{ class: s.value.label },
|
|
2466
|
+
t.label ? t.label() : e.label
|
|
2467
|
+
),
|
|
2468
|
+
(e.title || t.title) && n(
|
|
2469
|
+
"div",
|
|
2470
|
+
{ class: s.value.title },
|
|
2471
|
+
t.title ? t.title() : e.title
|
|
2472
|
+
),
|
|
2473
|
+
(e.description || t.default) && n(
|
|
2474
|
+
"div",
|
|
2475
|
+
{ class: s.value.description },
|
|
2476
|
+
t.default ? t.default() : e.description
|
|
2477
|
+
)
|
|
2478
|
+
])
|
|
2479
|
+
]
|
|
2480
|
+
);
|
|
2481
|
+
}
|
|
2482
|
+
}), zt = f({
|
|
2483
|
+
name: "SxoTimeline",
|
|
2484
|
+
props: {
|
|
2485
|
+
mode: { type: String, default: "left" }
|
|
2486
|
+
},
|
|
2487
|
+
setup(e, { slots: t, attrs: a }) {
|
|
2488
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = m(() => L({ mode: e.mode }));
|
|
2489
|
+
return g(() => `${Object.values(s.value).join(" ")}`), () => {
|
|
2490
|
+
var r;
|
|
2491
|
+
return n(
|
|
2492
|
+
"div",
|
|
2493
|
+
{
|
|
2494
|
+
class: [s.value.container, a.class],
|
|
2495
|
+
attrs: a,
|
|
2496
|
+
on: i
|
|
2497
|
+
},
|
|
2498
|
+
(r = t.default) == null ? void 0 : r.call(t)
|
|
2499
|
+
);
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
}), K = "SxoToast", jt = f({
|
|
2503
|
+
name: "SxoToastProvider",
|
|
2504
|
+
setup(e, { slots: t }) {
|
|
2505
|
+
const a = ae(), l = b([]), i = a.subscribe((s) => {
|
|
2506
|
+
l.value = s;
|
|
2507
|
+
});
|
|
2508
|
+
return j(() => {
|
|
2509
|
+
i();
|
|
2510
|
+
}), k(K, a), () => n("div", { class: "sxo-toast-provider" }, [
|
|
2511
|
+
t.default ? t.default() : [],
|
|
2512
|
+
// In Vue 2, we don't have Teleport built-in.
|
|
2513
|
+
// For a production app, we would use portal-vue or manual DOM manipulation.
|
|
2514
|
+
n("div", { class: "sxo-toasts-container" }, Ie(l.value, a))
|
|
2515
|
+
]);
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
function Ie(e, t) {
|
|
2519
|
+
return [
|
|
2520
|
+
"top",
|
|
2521
|
+
"bottom",
|
|
2522
|
+
"top-left",
|
|
2523
|
+
"top-right",
|
|
2524
|
+
"bottom-left",
|
|
2525
|
+
"bottom-right"
|
|
2526
|
+
].map((l) => {
|
|
2527
|
+
const i = e.filter((r) => (r.position || "top-right") === l);
|
|
2528
|
+
if (i.length === 0) return null;
|
|
2529
|
+
const s = E({ position: l });
|
|
2530
|
+
return n(
|
|
2531
|
+
"div",
|
|
2532
|
+
{ class: s.container, key: l },
|
|
2533
|
+
i.map(
|
|
2534
|
+
(r) => n("div", { key: r.id, class: E({ type: r.type }).item }, [
|
|
2535
|
+
// Content
|
|
2536
|
+
n("div", { class: "flex-grow flex flex-col" }, [
|
|
2537
|
+
r.title && n("div", { class: "text-sm font-bold" }, r.title),
|
|
2538
|
+
r.description && n("div", { class: "text-xs opacity-80" }, r.description)
|
|
2539
|
+
]),
|
|
2540
|
+
// Close Button
|
|
2541
|
+
n(
|
|
2542
|
+
"button",
|
|
2543
|
+
{
|
|
2544
|
+
class: "opacity-50 hover:opacity-100",
|
|
2545
|
+
on: {
|
|
2546
|
+
click: () => t.remove(r.id)
|
|
2547
|
+
}
|
|
2548
|
+
},
|
|
2549
|
+
"✕"
|
|
2550
|
+
)
|
|
2551
|
+
])
|
|
2552
|
+
)
|
|
2553
|
+
);
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
function Pt() {
|
|
2557
|
+
const e = w(K);
|
|
2558
|
+
return e || {
|
|
2559
|
+
show: () => console.warn("ToastProvider not found"),
|
|
2560
|
+
success: () => console.warn("ToastProvider not found"),
|
|
2561
|
+
error: () => console.warn("ToastProvider not found")
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
const It = f({
|
|
2565
|
+
name: "SxoTooltip",
|
|
2566
|
+
props: {
|
|
2567
|
+
content: {
|
|
2568
|
+
type: [String, Object],
|
|
2569
|
+
required: !0
|
|
2570
|
+
},
|
|
2571
|
+
delay: {
|
|
2572
|
+
type: Number,
|
|
2573
|
+
default: 200
|
|
2574
|
+
},
|
|
2575
|
+
variant: {
|
|
2576
|
+
type: String,
|
|
2577
|
+
default: "dark"
|
|
2578
|
+
}
|
|
2579
|
+
},
|
|
2580
|
+
setup(e, { slots: t, attrs: a }) {
|
|
2581
|
+
const l = y(), i = (l == null ? void 0 : l.proxy.$listeners) || {}, s = b(!1), { getTriggerProps: r, getTooltipProps: o } = ne({
|
|
2582
|
+
delay: e.delay,
|
|
2583
|
+
defaultOpen: s.value
|
|
2584
|
+
}), u = m(() => Te({ variant: e.variant }));
|
|
2585
|
+
g(() => `${u.value.content} ${a.class || ""}`);
|
|
2586
|
+
const v = r(
|
|
2587
|
+
() => {
|
|
2588
|
+
s.value = !0;
|
|
2589
|
+
},
|
|
2590
|
+
() => {
|
|
2591
|
+
s.value = !1;
|
|
2592
|
+
}
|
|
2593
|
+
);
|
|
2594
|
+
return () => {
|
|
2595
|
+
var c;
|
|
2596
|
+
return n("div", { class: "relative inline-block" }, [
|
|
2597
|
+
n(
|
|
2598
|
+
"div",
|
|
2599
|
+
{
|
|
2600
|
+
attrs: { ...v.attrs },
|
|
2601
|
+
on: { ...v.on, ...i }
|
|
2602
|
+
},
|
|
2603
|
+
(c = t.default) == null ? void 0 : c.call(t)
|
|
2604
|
+
),
|
|
2605
|
+
s.value ? n(
|
|
2606
|
+
"div",
|
|
2607
|
+
{
|
|
2608
|
+
attrs: { ...o().attrs },
|
|
2609
|
+
class: `${u.value.content} ${a.class || ""} bottom-full left-1/2 -translate-x-1/2 mb-2`.trim()
|
|
2610
|
+
},
|
|
2611
|
+
t.content ? t.content() : e.content
|
|
2612
|
+
) : null
|
|
2613
|
+
]);
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
});
|
|
2617
|
+
export {
|
|
2618
|
+
Ne as Accordion,
|
|
2619
|
+
qe as AccordionItem,
|
|
2620
|
+
Fe as Alert,
|
|
2621
|
+
Ge as Avatar,
|
|
2622
|
+
Xe as Badge,
|
|
2623
|
+
Ke as Box,
|
|
2624
|
+
Je as Breadcrumb,
|
|
2625
|
+
He as BreadcrumbItem,
|
|
2626
|
+
Ue as Button,
|
|
2627
|
+
We as Card,
|
|
2628
|
+
Ye as Checkbox,
|
|
2629
|
+
_e as CheckboxGroup,
|
|
2630
|
+
dt as Container,
|
|
2631
|
+
Qe as Dialog,
|
|
2632
|
+
Ze as Divider,
|
|
2633
|
+
tt as Dropdown,
|
|
2634
|
+
et as DropdownItem,
|
|
2635
|
+
at as Empty,
|
|
2636
|
+
nt as Feedback,
|
|
2637
|
+
lt as Form,
|
|
2638
|
+
st as FormItem,
|
|
2639
|
+
ct as Grid,
|
|
2640
|
+
it as I18nProvider,
|
|
2641
|
+
ot as Input,
|
|
2642
|
+
vt as Menu,
|
|
2643
|
+
ft as Pagination,
|
|
2644
|
+
je as Progress,
|
|
2645
|
+
gt as Radio,
|
|
2646
|
+
mt as RadioGroup,
|
|
2647
|
+
yt as Result,
|
|
2648
|
+
z as SXO_KEY,
|
|
2649
|
+
pt as Search,
|
|
2650
|
+
xt as Select,
|
|
2651
|
+
bt as SelectOption,
|
|
2652
|
+
Pe as Skeleton,
|
|
2653
|
+
ht as Slider,
|
|
2654
|
+
ze as Spinner,
|
|
2655
|
+
ut as Stack,
|
|
2656
|
+
St as Switch,
|
|
2657
|
+
Ae as SxoPlugin,
|
|
2658
|
+
kt as Tab,
|
|
2659
|
+
$t as TabList,
|
|
2660
|
+
Ct as TabPanel,
|
|
2661
|
+
wt as Tabs,
|
|
2662
|
+
Bt as Tag,
|
|
2663
|
+
Le as ThemeProvider,
|
|
2664
|
+
zt as Timeline,
|
|
2665
|
+
Tt as TimelineItem,
|
|
2666
|
+
jt as ToastProvider,
|
|
2667
|
+
It as Tooltip,
|
|
2668
|
+
De as useBreakpoint,
|
|
2669
|
+
rt as useI18n,
|
|
2670
|
+
g as useStyle,
|
|
2671
|
+
O as useSxo,
|
|
2672
|
+
Pt as useToast,
|
|
2673
|
+
Re as useToken
|
|
2674
|
+
};
|