@ghentcdh/ui 1.1.1 → 2.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/Markdown-C7ZNnPQB.js +1 -0
- package/Markdown-OZGmR-pI.js +76 -0
- package/button/Btn.properties.d.ts +6 -2
- package/button/btn.vue.d.ts +15 -5
- package/const/colors.d.ts +2 -1
- package/drawer/drawer.properties.d.ts +4 -0
- package/drawer/drawer.vue.d.ts +9 -0
- package/form/Checkbox.properties.d.ts +14 -1
- package/form/Checkbox.vue.d.ts +37 -4
- package/form/Input.properties.d.ts +18 -1
- package/form/Input.vue.d.ts +46 -4
- package/form/InputNumber.properties.d.ts +14 -1
- package/form/InputNumber.vue.d.ts +37 -4
- package/form/Textarea.properties.d.ts +26 -1
- package/form/Textarea.vue.d.ts +64 -4
- package/form/core/ControlWrapper.properties.d.ts +54 -1
- package/form/core/ControlWrapper.vue.d.ts +38 -4
- package/form/core/properties.d.ts +2 -16
- package/form/core/styles.d.ts +1 -1
- package/form/core/utils/style.d.ts +3 -3
- package/form/index.d.ts +273 -1
- package/form/select/AutoComplete.properties.d.ts +27 -2
- package/form/select/AutoComplete.vue.d.ts +67 -7
- package/form/select/ListResults.properties.d.ts +7 -1
- package/form/select/ListResults.vue.d.ts +12 -3
- package/form/select/MultiSelect.vue.d.ts +67 -7
- package/form/select/SelectComponent.vue.d.ts +55 -4
- package/form/select/SelectWrapper.properties.d.ts +57 -9
- package/form/select/SelectWrapper.vue.d.ts +93 -11
- package/form/text/Markdown.vue.d.ts +37 -4
- package/form/text/MarkdownComponent.properties.d.ts +14 -1
- package/form/text/MarkdownFallback.vue.d.ts +267 -0
- package/icons/icon-list.d.ts +3 -1
- package/index-NGeplssl.js +2 -0
- package/index-WrdKkd9c.js +2633 -0
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -2
- package/index.mjs +66 -2370
- package/modal/modal.vue.d.ts +1 -0
- package/package.json +26 -16
- package/table/cells/text.cell.vue.d.ts +1 -1
- package/table/column.model.d.ts +6 -0
- package/table/header/sort.header.properties.d.ts +1 -1
- package/table/header/sort.header.vue.d.ts +2 -2
- package/table/index.d.ts +2 -0
- package/table/pagination.component.properties.d.ts +5 -0
- package/table/pagination.component.vue.d.ts +9 -0
- package/table/table.component.properties.d.ts +4 -0
- package/table/table.component.vue.d.ts +9 -0
- package/table/table.model.d.ts +4 -1
- package/test-utils/withSetup.d.ts +0 -4
package/index.mjs
CHANGED
|
@@ -1,2372 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RouterLink as Ne } from "vue-router";
|
|
3
|
-
import { v4 as de } from "uuid";
|
|
4
|
-
import { LinkIcon as qe, DocumentTextIcon as je, EyeIcon as Fe, CheckIcon as Ke, LanguageIcon as Ue, ChevronDoubleRightIcon as He, ChevronDoubleLeftIcon as We, ChevronUpIcon as Ge, ChevronDownIcon as Xe, ChevronLeftIcon as Ze, ChevronRightIcon as Je, Bars3Icon as Qe, PaperClipIcon as Ye, PlusCircleIcon as et, XMarkIcon as tt, FunnelIcon as ot, BarsArrowUpIcon as st, BarsArrowDownIcon as nt, TrashIcon as lt, PencilSquareIcon as at } from "@heroicons/vue/24/outline";
|
|
5
|
-
import rt from "@tiptap/starter-kit";
|
|
6
|
-
import { useEditor as it, EditorContent as ut } from "@tiptap/vue-3";
|
|
7
|
-
import { Markdown as ct } from "tiptap-markdown";
|
|
8
|
-
import { ChevronDownIcon as dt, ChevronRightIcon as pt } from "@heroicons/vue/24/solid";
|
|
9
|
-
var R = /* @__PURE__ */ ((e) => (e.Edit = "Edit", e.Delete = "Delete", e.BarsArrowDown = "BarsArrowDown", e.BarsArrowUp = "BarsArrowUp", e.Funnel = "Funnel", e.Close = "Close", e.Plus = "Plus", e.PaperClip = "PaperClip", e.Hamburger = "Hamburger", e.ChevronRight = "ChevronRight", e.ChevronLeft = "ChevronLeft", e.ChevronDown = "ChevronDown", e.ChevronUp = "ChevronUp", e.DblChevronLeft = "DblChevronLeft", e.DblChevronRight = "DblChevronRight", e.Language = "Language", e.Check = "Check", e.View = "View", e.Text = "Text", e.Link = "Link", e))(R || {});
|
|
10
|
-
const ft = {
|
|
11
|
-
Edit: at,
|
|
12
|
-
Delete: lt,
|
|
13
|
-
BarsArrowDown: nt,
|
|
14
|
-
BarsArrowUp: st,
|
|
15
|
-
Funnel: ot,
|
|
16
|
-
Close: tt,
|
|
17
|
-
Plus: et,
|
|
18
|
-
PaperClip: Ye,
|
|
19
|
-
Hamburger: Qe,
|
|
20
|
-
ChevronRight: Je,
|
|
21
|
-
ChevronLeft: Ze,
|
|
22
|
-
ChevronDown: Xe,
|
|
23
|
-
ChevronUp: Ge,
|
|
24
|
-
DblChevronLeft: We,
|
|
25
|
-
DblChevronRight: He,
|
|
26
|
-
Language: Ue,
|
|
27
|
-
Check: Ke,
|
|
28
|
-
View: Fe,
|
|
29
|
-
Text: je,
|
|
30
|
-
Link: qe
|
|
31
|
-
}, mt = {
|
|
32
|
-
icon: { type: [String, Object, Function] },
|
|
33
|
-
size: { type: String }
|
|
34
|
-
}, q = /* @__PURE__ */ k({
|
|
35
|
-
__name: "icon",
|
|
36
|
-
props: mt,
|
|
37
|
-
setup(e) {
|
|
38
|
-
const t = e, o = v(() => t.icon ? typeof t.icon == "string" ? ft[t.icon] : t.icon : null);
|
|
39
|
-
return (n, l) => o.value ? (r(), y(ne(o.value), {
|
|
40
|
-
key: 0,
|
|
41
|
-
"aria-hidden": "true",
|
|
42
|
-
class: $([
|
|
43
|
-
{
|
|
44
|
-
"w-full h-full": !n.size,
|
|
45
|
-
"w-2 h-2": n.size === "xs",
|
|
46
|
-
"w-4 h-4": n.size === "sm",
|
|
47
|
-
"w-6 h-6": n.size === "lg",
|
|
48
|
-
"w-8 h-8": n.size === "xl"
|
|
49
|
-
}
|
|
50
|
-
])
|
|
51
|
-
}, null, 8, ["class"])) : _("", !0);
|
|
52
|
-
}
|
|
53
|
-
}), bt = { class: "dropdown dropdown-end" }, gt = {
|
|
54
|
-
tabindex: "0",
|
|
55
|
-
role: "menu",
|
|
56
|
-
class: "menu dropdown-content bg-white z-1 mt-4 p-2 shadow-sm"
|
|
57
|
-
}, vt = { class: "min-w-max flex-no-wrap text-black" }, pe = /* @__PURE__ */ k({
|
|
58
|
-
__name: "sub-menu",
|
|
59
|
-
props: {
|
|
60
|
-
label: {},
|
|
61
|
-
items: {},
|
|
62
|
-
action: { type: Function },
|
|
63
|
-
disabled: { type: Boolean },
|
|
64
|
-
btnClass: {},
|
|
65
|
-
disableArrow: { type: Boolean }
|
|
66
|
-
},
|
|
67
|
-
setup(e) {
|
|
68
|
-
return (t, o) => (r(), f("div", bt, [
|
|
69
|
-
u("div", {
|
|
70
|
-
tabindex: "0",
|
|
71
|
-
role: "button",
|
|
72
|
-
"aria-haspopup": "menu",
|
|
73
|
-
class: $([e.btnClass, "btn btn-ghost text-right flex-nowrap flex"])
|
|
74
|
-
}, [
|
|
75
|
-
u("span", null, w(e.label), 1),
|
|
76
|
-
e.disableArrow ? _("", !0) : (r(), y(g(q), {
|
|
77
|
-
key: 0,
|
|
78
|
-
icon: g(R).ChevronDown,
|
|
79
|
-
size: "sm"
|
|
80
|
-
}, null, 8, ["icon"]))
|
|
81
|
-
], 2),
|
|
82
|
-
u("ul", gt, [
|
|
83
|
-
u("li", vt, [
|
|
84
|
-
(r(!0), f(L, null, M(e.items, (n) => (r(), y(Pe, B({
|
|
85
|
-
key: n.label
|
|
86
|
-
}, { ref_for: !0 }, n), null, 16))), 128))
|
|
87
|
-
])
|
|
88
|
-
])
|
|
89
|
-
]));
|
|
90
|
-
}
|
|
91
|
-
}), oe = "btn btn-ghost text-left justify-between min-w-max font-normal", Pe = /* @__PURE__ */ k({
|
|
92
|
-
__name: "menu-item",
|
|
93
|
-
props: {
|
|
94
|
-
label: {},
|
|
95
|
-
items: {},
|
|
96
|
-
action: {},
|
|
97
|
-
disabled: { type: Boolean, default: !1 }
|
|
98
|
-
},
|
|
99
|
-
setup(e) {
|
|
100
|
-
const t = e, o = v(() => !t.disabled && t.action && "routerLink" in t.action), n = v(() => !t.disabled && t.action), l = v(() => t.items?.length), a = v(() => {
|
|
101
|
-
const d = t.action;
|
|
102
|
-
return d && "routerLink" in d && "params" in d ? {
|
|
103
|
-
name: d.routerLink,
|
|
104
|
-
params: d.params
|
|
105
|
-
} : "";
|
|
106
|
-
}), c = () => {
|
|
107
|
-
t.action?.();
|
|
108
|
-
};
|
|
109
|
-
return (d, p) => {
|
|
110
|
-
const i = ce("RouterLink");
|
|
111
|
-
return l.value ? (r(), y(pe, B({ key: 0 }, t, { "btn-class": oe }), null, 16)) : o.value ? (r(), y(i, {
|
|
112
|
-
key: 1,
|
|
113
|
-
to: a.value,
|
|
114
|
-
class: $(oe),
|
|
115
|
-
onClick: c
|
|
116
|
-
}, {
|
|
117
|
-
default: S(() => [
|
|
118
|
-
E(w(e.label), 1)
|
|
119
|
-
]),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 8, ["to"])) : n.value ? (r(), f("button", {
|
|
122
|
-
key: 2,
|
|
123
|
-
class: $(oe),
|
|
124
|
-
onClick: c
|
|
125
|
-
}, w(e.label), 1)) : (r(), f("div", {
|
|
126
|
-
key: 3,
|
|
127
|
-
class: $([oe, { "btn-disabled": e.disabled }])
|
|
128
|
-
}, w(e.label), 3));
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}), ht = { class: "navbar bg-base-100 shadow-sm" }, yt = { class: "flex-1" }, wt = {
|
|
132
|
-
key: 0,
|
|
133
|
-
class: "breadcrumbs text-sm"
|
|
134
|
-
}, kt = { class: "flex grow justify-end px-2" }, _t = { class: "flex items-stretch" }, wn = /* @__PURE__ */ k({
|
|
135
|
-
__name: "menu",
|
|
136
|
-
props: {
|
|
137
|
-
menu: {},
|
|
138
|
-
breadcrumbs: {}
|
|
139
|
-
},
|
|
140
|
-
setup(e) {
|
|
141
|
-
return (t, o) => {
|
|
142
|
-
const n = ce("RouterLink");
|
|
143
|
-
return r(), f("nav", ht, [
|
|
144
|
-
u("div", yt, [
|
|
145
|
-
e.breadcrumbs ? (r(), f("div", wt, [
|
|
146
|
-
u("ul", null, [
|
|
147
|
-
(r(!0), f(L, null, M(e.breadcrumbs, (l) => (r(), f("li", {
|
|
148
|
-
key: l.label
|
|
149
|
-
}, [
|
|
150
|
-
l.routerLink ? (r(), y(n, {
|
|
151
|
-
key: 0,
|
|
152
|
-
to: { name: l.routerLink, params: l.params },
|
|
153
|
-
role: "navigation",
|
|
154
|
-
"aria-label": l.label
|
|
155
|
-
}, {
|
|
156
|
-
default: S(() => [
|
|
157
|
-
E(w(l.label), 1)
|
|
158
|
-
]),
|
|
159
|
-
_: 2
|
|
160
|
-
}, 1032, ["to", "aria-label"])) : (r(), f(L, { key: 1 }, [
|
|
161
|
-
E(w(l.label), 1)
|
|
162
|
-
], 64))
|
|
163
|
-
]))), 128))
|
|
164
|
-
])
|
|
165
|
-
])) : _("", !0)
|
|
166
|
-
]),
|
|
167
|
-
u("div", kt, [
|
|
168
|
-
u("div", _t, [
|
|
169
|
-
(r(!0), f(L, null, M(e.menu, (l) => (r(), y(Pe, B({
|
|
170
|
-
key: l.label
|
|
171
|
-
}, { ref_for: !0 }, l), null, 16))), 128))
|
|
172
|
-
])
|
|
173
|
-
])
|
|
174
|
-
]);
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}), kn = /* @__PURE__ */ k({
|
|
178
|
-
__name: "dropdown",
|
|
179
|
-
props: {
|
|
180
|
-
items: {}
|
|
181
|
-
},
|
|
182
|
-
setup(e) {
|
|
183
|
-
const t = x(!0);
|
|
184
|
-
return (o, n) => (r(), y(pe, {
|
|
185
|
-
items: e.items,
|
|
186
|
-
label: "test",
|
|
187
|
-
open: t.value,
|
|
188
|
-
"btn-class": "",
|
|
189
|
-
"disable-arrow": !0
|
|
190
|
-
}, null, 8, ["items", "open"]));
|
|
191
|
-
}
|
|
192
|
-
}), $t = {
|
|
193
|
-
modalTitle: { type: String, required: !0 },
|
|
194
|
-
buttonLabel: { type: String },
|
|
195
|
-
buttonSaveLabel: { type: String },
|
|
196
|
-
data: { default: void 0 },
|
|
197
|
-
open: { type: Boolean, default: !1 },
|
|
198
|
-
disableClose: { type: Boolean, default: !1 },
|
|
199
|
-
width: { type: String, default: "sm" }
|
|
200
|
-
}, Ct = ["closeModal"], xt = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])', ke = (e) => Array.from(e.querySelectorAll(xt)), Lt = ({
|
|
201
|
-
containerRef: e,
|
|
202
|
-
isActive: t,
|
|
203
|
-
onEscape: o,
|
|
204
|
-
restoreFocus: n = !0
|
|
205
|
-
}) => {
|
|
206
|
-
let l = null;
|
|
207
|
-
const a = (p) => {
|
|
208
|
-
const i = e.value;
|
|
209
|
-
if (!i) return;
|
|
210
|
-
if (p.key === "Escape") {
|
|
211
|
-
o?.();
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
if (p.key !== "Tab") return;
|
|
215
|
-
const s = ke(i);
|
|
216
|
-
if (s.length === 0) return;
|
|
217
|
-
const m = s[0], b = s[s.length - 1];
|
|
218
|
-
p.shiftKey ? document.activeElement === m && (p.preventDefault(), b.focus()) : document.activeElement === b && (p.preventDefault(), m.focus());
|
|
219
|
-
}, c = () => {
|
|
220
|
-
const p = e.value;
|
|
221
|
-
if (!p) return;
|
|
222
|
-
l = document.activeElement, document.addEventListener("keydown", a);
|
|
223
|
-
const i = ke(p);
|
|
224
|
-
i.length > 0 && i[0].focus();
|
|
225
|
-
}, d = () => {
|
|
226
|
-
document.removeEventListener("keydown", a), n && l && (l.focus(), l = null);
|
|
227
|
-
};
|
|
228
|
-
j(t, (p) => {
|
|
229
|
-
p ? c() : d();
|
|
230
|
-
}, { immediate: !0 }), _e(() => {
|
|
231
|
-
d();
|
|
232
|
-
});
|
|
233
|
-
}, St = {
|
|
234
|
-
xs: "max-w-xs w-[50VW]",
|
|
235
|
-
sm: "max-w-sm w-[50VW]",
|
|
236
|
-
lg: "max-w-2xl w-[80VW]",
|
|
237
|
-
xl: "max-w-[80VW] w-[80VW]"
|
|
238
|
-
}, Pt = {
|
|
239
|
-
xs: "btn-xs",
|
|
240
|
-
sm: "btn-sm",
|
|
241
|
-
lg: "btn-sm",
|
|
242
|
-
xl: "btn"
|
|
243
|
-
}, Mt = {
|
|
244
|
-
xs: "badge-xs text-xxs",
|
|
245
|
-
sm: "badge-sm text-xs",
|
|
246
|
-
lg: "badge-sm text-xs",
|
|
247
|
-
xl: "badge text-xs"
|
|
248
|
-
}, Bt = { class: "flex justify-end gap-2 pt-2 mt-2 border-t border-gray-300 shrink-0" }, Vt = /* @__PURE__ */ k({
|
|
249
|
-
__name: "modal",
|
|
250
|
-
props: $t,
|
|
251
|
-
emits: Ct,
|
|
252
|
-
setup(e, { expose: t, emit: o }) {
|
|
253
|
-
const n = e, l = `modal_${de()}`, a = `${l}_title`, c = `${l}_content`, d = x(null), p = x(!1), i = o, s = () => {
|
|
254
|
-
d.value?.showModal(), p.value = !0;
|
|
255
|
-
}, m = () => {
|
|
256
|
-
d.value?.close(), p.value = !1, i("closeModal");
|
|
257
|
-
}, b = () => {
|
|
258
|
-
n.disableClose || m();
|
|
259
|
-
};
|
|
260
|
-
return Lt({
|
|
261
|
-
containerRef: d,
|
|
262
|
-
isActive: p,
|
|
263
|
-
onEscape: () => {
|
|
264
|
-
n.disableClose || m();
|
|
265
|
-
}
|
|
266
|
-
}), t({ closeModal: m, openModal: s }), j(
|
|
267
|
-
() => n.open,
|
|
268
|
-
() => {
|
|
269
|
-
n.open ? s() : m();
|
|
270
|
-
}
|
|
271
|
-
), $e(() => {
|
|
272
|
-
n.open && s();
|
|
273
|
-
}), (h, D) => (r(), f("dialog", {
|
|
274
|
-
ref_key: "dialogRef",
|
|
275
|
-
ref: d,
|
|
276
|
-
class: "modal",
|
|
277
|
-
role: "dialog",
|
|
278
|
-
"aria-modal": "true",
|
|
279
|
-
"aria-labelledby": a,
|
|
280
|
-
"aria-describedby": c,
|
|
281
|
-
onCancel: le(b, ["prevent"])
|
|
282
|
-
}, [
|
|
283
|
-
u("div", {
|
|
284
|
-
class: $([
|
|
285
|
-
"modal-box bg-white min-h-0 max-h-[90vh] flex flex-col overflow-hidden",
|
|
286
|
-
g(St)[h.width]
|
|
287
|
-
])
|
|
288
|
-
}, [
|
|
289
|
-
h.disableClose ? _("", !0) : (r(), f("button", {
|
|
290
|
-
key: 0,
|
|
291
|
-
type: "button",
|
|
292
|
-
class: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2",
|
|
293
|
-
"aria-label": "Close",
|
|
294
|
-
onClick: m
|
|
295
|
-
}, " ✕ ")),
|
|
296
|
-
u("h3", {
|
|
297
|
-
id: a,
|
|
298
|
-
class: "font-bold shrink-0"
|
|
299
|
-
}, w(h.modalTitle), 1),
|
|
300
|
-
u("div", {
|
|
301
|
-
id: c,
|
|
302
|
-
class: "pt-4 flex-1 min-h-0 flex flex-col"
|
|
303
|
-
}, [
|
|
304
|
-
P(h.$slots, "content")
|
|
305
|
-
]),
|
|
306
|
-
u("div", Bt, [
|
|
307
|
-
P(h.$slots, "actions")
|
|
308
|
-
])
|
|
309
|
-
], 2)
|
|
310
|
-
], 544));
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
var fe = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(fe || {}), Me = /* @__PURE__ */ ((e) => (e.a = "a", e.button = "button", e))(Me || {}), z = /* @__PURE__ */ ((e) => (e.blank = "blank", e.primary = "primary", e.secondary = "secondary", e.error = "error", e))(z || {});
|
|
314
|
-
const At = {
|
|
315
|
-
blank: "btn-ghost",
|
|
316
|
-
primary: "btn-primary",
|
|
317
|
-
secondary: "btn-soft btn-primary",
|
|
318
|
-
error: "btn-error"
|
|
319
|
-
}, Ot = {
|
|
320
|
-
blank: "badge-ghost",
|
|
321
|
-
primary: "badge-primary",
|
|
322
|
-
secondary: "badge-soft badge-primary",
|
|
323
|
-
error: "badge-error"
|
|
324
|
-
}, It = {
|
|
325
|
-
href: { type: String },
|
|
326
|
-
disabled: { type: Boolean, default: !1 },
|
|
327
|
-
tooltip: { type: String },
|
|
328
|
-
as: { type: String, default: Me.button },
|
|
329
|
-
icon: { type: [String, Object, Function] },
|
|
330
|
-
type: { type: String, default: fe.button },
|
|
331
|
-
outline: { type: Boolean, default: !1 },
|
|
332
|
-
color: { type: String, default: z.primary },
|
|
333
|
-
size: { type: String, default: "sm" },
|
|
334
|
-
square: { type: Boolean, default: !1 }
|
|
335
|
-
}, Dt = ["click"], Rt = {
|
|
336
|
-
icon: { type: [String, Object, Function] },
|
|
337
|
-
type: { type: String, default: fe.button },
|
|
338
|
-
color: { type: String, default: z.primary },
|
|
339
|
-
disabled: { type: Boolean, default: !1 },
|
|
340
|
-
size: { type: String, default: "sm" }
|
|
341
|
-
}, Tt = ["click"], N = /* @__PURE__ */ k({
|
|
342
|
-
__name: "btn",
|
|
343
|
-
props: It,
|
|
344
|
-
emits: Dt,
|
|
345
|
-
setup(e, { emit: t }) {
|
|
346
|
-
const o = e, n = t;
|
|
347
|
-
return (l, a) => (r(), y(ne(o.as), {
|
|
348
|
-
class: $([
|
|
349
|
-
"btn p-1 flex justify-center flex-nowrap",
|
|
350
|
-
g(At)[o.color],
|
|
351
|
-
g(Pt)[o.size],
|
|
352
|
-
{ "btn-outline": o.outline, "btn-square": o.square, tooltip: o.tooltip }
|
|
353
|
-
]),
|
|
354
|
-
href: o.href,
|
|
355
|
-
type: o.type,
|
|
356
|
-
disabled: o.disabled,
|
|
357
|
-
"data-tip": o.tooltip,
|
|
358
|
-
onClick: a[0] || (a[0] = (c) => n("click"))
|
|
359
|
-
}, {
|
|
360
|
-
default: S(() => [
|
|
361
|
-
o.icon ? (r(), y(g(q), {
|
|
362
|
-
key: 0,
|
|
363
|
-
icon: o.icon,
|
|
364
|
-
size: o.size
|
|
365
|
-
}, null, 8, ["icon", "size"])) : _("", !0),
|
|
366
|
-
P(l.$slots, "default")
|
|
367
|
-
]),
|
|
368
|
-
_: 3
|
|
369
|
-
}, 8, ["class", "href", "type", "disabled", "data-tip"]));
|
|
370
|
-
}
|
|
371
|
-
}), Et = ["type", "disabled"], _n = /* @__PURE__ */ k({
|
|
372
|
-
__name: "btn-badge",
|
|
373
|
-
props: Rt,
|
|
374
|
-
emits: Tt,
|
|
375
|
-
setup(e, { emit: t }) {
|
|
376
|
-
const o = e, n = t;
|
|
377
|
-
return (l, a) => (r(), f("button", {
|
|
378
|
-
class: $(["badge gap-1", g(Mt)[o.size], g(Ot)[o.color]]),
|
|
379
|
-
type: o.type,
|
|
380
|
-
disabled: o.disabled,
|
|
381
|
-
onClick: a[0] || (a[0] = (c) => n("click"))
|
|
382
|
-
}, [
|
|
383
|
-
P(l.$slots, "default"),
|
|
384
|
-
o.icon ? (r(), y(g(q), {
|
|
385
|
-
key: 0,
|
|
386
|
-
icon: o.icon,
|
|
387
|
-
size: o.size
|
|
388
|
-
}, null, 8, ["icon", "size"])) : _("", !0)
|
|
389
|
-
], 10, Et));
|
|
390
|
-
}
|
|
391
|
-
}), zt = /* @__PURE__ */ k({
|
|
392
|
-
__name: "confirmModal",
|
|
393
|
-
props: {
|
|
394
|
-
title: {},
|
|
395
|
-
message: {},
|
|
396
|
-
confirmLabel: { default: "Ok" },
|
|
397
|
-
cancelLabel: { default: "Cancel" }
|
|
398
|
-
},
|
|
399
|
-
emits: ["closeModal"],
|
|
400
|
-
setup(e, { emit: t }) {
|
|
401
|
-
const o = t, n = (l) => {
|
|
402
|
-
o("closeModal", { confirmed: l });
|
|
403
|
-
};
|
|
404
|
-
return (l, a) => (r(), y(Vt, {
|
|
405
|
-
"modal-title": e.title,
|
|
406
|
-
open: !0,
|
|
407
|
-
"disable-close": !0
|
|
408
|
-
}, {
|
|
409
|
-
content: S(() => [
|
|
410
|
-
E(w(e.message), 1)
|
|
411
|
-
]),
|
|
412
|
-
actions: S(() => [
|
|
413
|
-
V(g(N), {
|
|
414
|
-
color: g(z).secondary,
|
|
415
|
-
outline: !0,
|
|
416
|
-
"aria-label": e.cancelLabel,
|
|
417
|
-
onClick: a[0] || (a[0] = (c) => n(!1))
|
|
418
|
-
}, {
|
|
419
|
-
default: S(() => [
|
|
420
|
-
E(w(e.cancelLabel), 1)
|
|
421
|
-
]),
|
|
422
|
-
_: 1
|
|
423
|
-
}, 8, ["color", "aria-label"]),
|
|
424
|
-
V(g(N), {
|
|
425
|
-
"aria-label": e.confirmLabel,
|
|
426
|
-
onClick: a[1] || (a[1] = (c) => n(!0))
|
|
427
|
-
}, {
|
|
428
|
-
default: S(() => [
|
|
429
|
-
E(w(e.confirmLabel), 1)
|
|
430
|
-
]),
|
|
431
|
-
_: 1
|
|
432
|
-
}, 8, ["aria-label"])
|
|
433
|
-
]),
|
|
434
|
-
_: 1
|
|
435
|
-
}, 8, ["modal-title"]));
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
class me {
|
|
439
|
-
constructor() {
|
|
440
|
-
this.showModal = x(!1), this.modals = [];
|
|
441
|
-
}
|
|
442
|
-
openModal(t) {
|
|
443
|
-
const o = t.props.onClose, n = de(), l = t;
|
|
444
|
-
t.props.onClose = (a) => {
|
|
445
|
-
o(a), this.closeModal(n);
|
|
446
|
-
}, l.id = n, this.modals = [...this.modals, l], this.showModal.value = Date.now();
|
|
447
|
-
}
|
|
448
|
-
closeModal(t) {
|
|
449
|
-
this.modals = this.modals.filter((o) => o.id !== t), this.showModal.value = Date.now();
|
|
450
|
-
}
|
|
451
|
-
static showConfirm(t) {
|
|
452
|
-
this.getInstance().openModal({
|
|
453
|
-
component: zt,
|
|
454
|
-
props: t
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
static openModal(t) {
|
|
458
|
-
this.getInstance().openModal(t);
|
|
459
|
-
}
|
|
460
|
-
static getInstance() {
|
|
461
|
-
return this.instance || (this.instance = new me()), this.instance;
|
|
462
|
-
}
|
|
463
|
-
static closeAll() {
|
|
464
|
-
this.instance.closeAll();
|
|
465
|
-
}
|
|
466
|
-
closeAll() {
|
|
467
|
-
this.modals = [], this.showModal.value = !1;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
const Nt = /* @__PURE__ */ k({
|
|
471
|
-
__name: "modalWrapper",
|
|
472
|
-
setup(e) {
|
|
473
|
-
const t = me.getInstance(), o = v(() => t.showModal.value ? t.modals : []);
|
|
474
|
-
return (n, l) => (r(!0), f(L, null, M(o.value, (a) => (r(), y(ne(a?.component), B({
|
|
475
|
-
key: a.id,
|
|
476
|
-
ref_for: !0
|
|
477
|
-
}, a?.props, {
|
|
478
|
-
open: !0,
|
|
479
|
-
onCloseModal: a?.props?.onClose
|
|
480
|
-
}), null, 16, ["onCloseModal"]))), 128));
|
|
481
|
-
}
|
|
482
|
-
}), qt = /* @__PURE__ */ k({
|
|
483
|
-
__name: "notification-message",
|
|
484
|
-
props: {
|
|
485
|
-
message: {},
|
|
486
|
-
type: {}
|
|
487
|
-
},
|
|
488
|
-
setup(e) {
|
|
489
|
-
const t = {
|
|
490
|
-
success: "alert-success",
|
|
491
|
-
error: "alert-error",
|
|
492
|
-
warning: "alert-warning",
|
|
493
|
-
info: "alert-info"
|
|
494
|
-
};
|
|
495
|
-
return (o, n) => (r(), f("div", {
|
|
496
|
-
role: "alert",
|
|
497
|
-
class: $(`alert ${t[e.type]} `)
|
|
498
|
-
}, [
|
|
499
|
-
u("span", null, w(e.message), 1)
|
|
500
|
-
], 2));
|
|
501
|
-
}
|
|
502
|
-
}), jt = 5e3;
|
|
503
|
-
class be {
|
|
504
|
-
constructor() {
|
|
505
|
-
this.notifications = x([]), this.addNotification = (t, o = "info") => {
|
|
506
|
-
const n = {
|
|
507
|
-
id: de(),
|
|
508
|
-
duration: jt,
|
|
509
|
-
message: t,
|
|
510
|
-
type: o
|
|
511
|
-
};
|
|
512
|
-
this.notifications.value.push(n), this.removeNotificationAfterDuration(n);
|
|
513
|
-
}, this.removeNotificationAfterDuration = (t) => {
|
|
514
|
-
setTimeout(() => {
|
|
515
|
-
this.removeNotification(t.id);
|
|
516
|
-
}, t.duration);
|
|
517
|
-
}, this.removeNotification = (t) => {
|
|
518
|
-
this.notifications.value = this.notifications.value.filter((o) => o.id !== t);
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
static getInstance() {
|
|
522
|
-
return this.instance || (this.instance = new be()), this.instance;
|
|
523
|
-
}
|
|
524
|
-
static info(t) {
|
|
525
|
-
this.getInstance().addNotification(t, "info");
|
|
526
|
-
}
|
|
527
|
-
static success(t) {
|
|
528
|
-
this.getInstance().addNotification(t, "success");
|
|
529
|
-
}
|
|
530
|
-
static warning(t) {
|
|
531
|
-
this.getInstance().addNotification(t, "warning");
|
|
532
|
-
}
|
|
533
|
-
static error(t) {
|
|
534
|
-
this.getInstance().addNotification(t, "error");
|
|
535
|
-
}
|
|
536
|
-
static removeNotification(t) {
|
|
537
|
-
this.getInstance().removeNotification(t);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
const Ft = { class: "toast toast-top toast-center z-[999]" }, Kt = /* @__PURE__ */ k({
|
|
541
|
-
__name: "notifications",
|
|
542
|
-
setup(e) {
|
|
543
|
-
const t = be.getInstance();
|
|
544
|
-
return (o, n) => (r(), f("div", Ft, [
|
|
545
|
-
(r(!0), f(L, null, M(g(t).notifications.value, (l) => (r(), y(qt, B({
|
|
546
|
-
key: l.id
|
|
547
|
-
}, { ref_for: !0 }, l), null, 16))), 128))
|
|
548
|
-
]));
|
|
549
|
-
}
|
|
550
|
-
}), Ut = { class: "flex h-screen flex-col" }, Ht = { class: "shrink-0" }, Wt = { class: "navbar bg-primary text-primary-content w-full z-100" }, Gt = { class: "navbar-start" }, Xt = { class: "navbar-center" }, Zt = ["href"], Jt = { class: "navbar-end" }, Qt = { class: "drawer-content overflow-y-auto mb-2 mr-2 shadow-md" }, Yt = { class: "drawer-side h-full shadow-md" }, eo = { class: "flex-grow overflow-y-auto" }, to = { class: "bg-base-200 p-4" }, $n = /* @__PURE__ */ k({
|
|
551
|
-
__name: "shell.component",
|
|
552
|
-
props: {
|
|
553
|
-
title: {},
|
|
554
|
-
menu: {},
|
|
555
|
-
user: {},
|
|
556
|
-
version: {},
|
|
557
|
-
widthSidebar: { default: 300 }
|
|
558
|
-
},
|
|
559
|
-
emits: ["logout"],
|
|
560
|
-
setup(e, { emit: t }) {
|
|
561
|
-
const n = e, l = x(!1), a = () => {
|
|
562
|
-
l.value = !l.value;
|
|
563
|
-
}, c = t, d = v(() => n.user ? {
|
|
564
|
-
label: n.user.name,
|
|
565
|
-
items: [
|
|
566
|
-
{
|
|
567
|
-
label: "Logout",
|
|
568
|
-
action: () => {
|
|
569
|
-
c("logout");
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
]
|
|
573
|
-
} : null);
|
|
574
|
-
return (p, i) => (r(), f(L, null, [
|
|
575
|
-
V(Kt),
|
|
576
|
-
V(g(Nt)),
|
|
577
|
-
u("div", Ut, [
|
|
578
|
-
u("header", Ht, [
|
|
579
|
-
u("nav", Wt, [
|
|
580
|
-
u("div", Gt, [
|
|
581
|
-
u("button", {
|
|
582
|
-
"aria-label": "open sidebar",
|
|
583
|
-
class: "btn btn-square btn-ghost p-1",
|
|
584
|
-
onClick: a
|
|
585
|
-
}, [
|
|
586
|
-
V(g(q), {
|
|
587
|
-
icon: g(R).Hamburger
|
|
588
|
-
}, null, 8, ["icon"])
|
|
589
|
-
])
|
|
590
|
-
]),
|
|
591
|
-
u("div", Xt, [
|
|
592
|
-
u("a", {
|
|
593
|
-
class: "btn btn-ghost text-primary-content text-lg color-white",
|
|
594
|
-
href: g("/")
|
|
595
|
-
}, w(e.title), 9, Zt)
|
|
596
|
-
]),
|
|
597
|
-
u("div", Jt, [
|
|
598
|
-
d.value ? (r(), y(g(pe), B({ key: 0 }, d.value, { "btn-class": "" }), null, 16)) : _("", !0)
|
|
599
|
-
])
|
|
600
|
-
])
|
|
601
|
-
]),
|
|
602
|
-
u("div", {
|
|
603
|
-
class: $(["drawer flex-1 overflow-hidden", { "drawer-open": l.value }])
|
|
604
|
-
}, [
|
|
605
|
-
Y(u("input", {
|
|
606
|
-
id: "app-drawer",
|
|
607
|
-
"onUpdate:modelValue": i[0] || (i[0] = (s) => l.value = s),
|
|
608
|
-
type: "checkbox",
|
|
609
|
-
class: "drawer-toggle"
|
|
610
|
-
}, null, 512), [
|
|
611
|
-
[Ce, l.value]
|
|
612
|
-
]),
|
|
613
|
-
u("main", Qt, [
|
|
614
|
-
P(p.$slots, "default")
|
|
615
|
-
]),
|
|
616
|
-
u("div", Yt, [
|
|
617
|
-
i[1] || (i[1] = u("label", {
|
|
618
|
-
for: "app-drawer",
|
|
619
|
-
"aria-label": "close sidebar",
|
|
620
|
-
class: "drawer-overlay"
|
|
621
|
-
}, null, -1)),
|
|
622
|
-
u("div", {
|
|
623
|
-
class: "menu bg-base-100 h-full flex flex-col justify-between",
|
|
624
|
-
style: X({ width: e.widthSidebar + "px" })
|
|
625
|
-
}, [
|
|
626
|
-
u("ul", eo, [
|
|
627
|
-
(r(!0), f(L, null, M(e.menu, (s) => (r(), f("li", {
|
|
628
|
-
key: s.label
|
|
629
|
-
}, [
|
|
630
|
-
V(g(Ne), {
|
|
631
|
-
to: { name: s.routerLink, params: s.params }
|
|
632
|
-
}, {
|
|
633
|
-
default: S(() => [
|
|
634
|
-
E(w(s.label), 1)
|
|
635
|
-
]),
|
|
636
|
-
_: 2
|
|
637
|
-
}, 1032, ["to"])
|
|
638
|
-
]))), 128))
|
|
639
|
-
]),
|
|
640
|
-
u("div", to, " version: " + w(e.version), 1)
|
|
641
|
-
], 4)
|
|
642
|
-
])
|
|
643
|
-
], 2)
|
|
644
|
-
])
|
|
645
|
-
], 64));
|
|
646
|
-
}
|
|
647
|
-
}), oo = {
|
|
648
|
-
currentPage: { type: Number, required: !0 },
|
|
649
|
-
page: { type: Number, required: !0 },
|
|
650
|
-
label: { type: String, required: !0 },
|
|
651
|
-
neverActive: { type: Boolean, default: !1 },
|
|
652
|
-
disabled: { type: Boolean, default: !1 }
|
|
653
|
-
}, so = ["updatePage", "updatePageSize"], J = /* @__PURE__ */ k({
|
|
654
|
-
__name: "pagination-button.component",
|
|
655
|
-
props: oo,
|
|
656
|
-
emits: so,
|
|
657
|
-
setup(e, { emit: t }) {
|
|
658
|
-
const o = e, n = t, l = v(
|
|
659
|
-
() => o.neverActive ? !1 : o.page === o.currentPage
|
|
660
|
-
), a = v(() => o.neverActive ? z.blank : l.value ? z.primary : z.secondary), c = () => {
|
|
661
|
-
n("updatePage", o.page);
|
|
662
|
-
};
|
|
663
|
-
return (d, p) => (r(), y(g(N), {
|
|
664
|
-
disabled: d.disabled,
|
|
665
|
-
square: !0,
|
|
666
|
-
size: "xs",
|
|
667
|
-
color: a.value,
|
|
668
|
-
onClick: p[0] || (p[0] = (i) => c())
|
|
669
|
-
}, {
|
|
670
|
-
default: S(() => [
|
|
671
|
-
E(w(d.label), 1)
|
|
672
|
-
]),
|
|
673
|
-
_: 1
|
|
674
|
-
}, 8, ["disabled", "color"]));
|
|
675
|
-
}
|
|
676
|
-
}), no = {
|
|
677
|
-
totalItems: { type: Number, default: 0 },
|
|
678
|
-
itemsPerPage: { type: Number, default: 1 },
|
|
679
|
-
currentPage: { type: Number, default: 1 }
|
|
680
|
-
}, lo = ["updatePage", "updatePageSize"], ao = { class: "flex gap-2" }, ro = { class: "flex flex-1 justify-center items-center" }, io = { class: "flex gap-1" }, uo = { class: "text-sm" }, Q = 6, co = /* @__PURE__ */ k({
|
|
681
|
-
__name: "pagination.component",
|
|
682
|
-
props: no,
|
|
683
|
-
emits: lo,
|
|
684
|
-
setup(e, { emit: t }) {
|
|
685
|
-
const o = e, n = t, l = v(() => {
|
|
686
|
-
let s = Math.ceil(o.totalItems / o.itemsPerPage);
|
|
687
|
-
return s < 1 ? 1 : s;
|
|
688
|
-
}), a = Q / 2, c = v(() => {
|
|
689
|
-
if (l.value <= Q)
|
|
690
|
-
return {
|
|
691
|
-
min: 1,
|
|
692
|
-
max: l.value
|
|
693
|
-
};
|
|
694
|
-
let s = o.currentPage - a;
|
|
695
|
-
s <= 1 ? s = 1 : s + Q > l.value && (s = l.value - Q);
|
|
696
|
-
let m = s + Q;
|
|
697
|
-
return {
|
|
698
|
-
min: s,
|
|
699
|
-
max: m
|
|
700
|
-
};
|
|
701
|
-
}), d = (s) => ({
|
|
702
|
-
label: "...",
|
|
703
|
-
currentPage: s,
|
|
704
|
-
page: -10,
|
|
705
|
-
disabled: !0,
|
|
706
|
-
neverActive: !0
|
|
707
|
-
}), p = v(() => {
|
|
708
|
-
let s = l.value;
|
|
709
|
-
s < 1 && (s = 1);
|
|
710
|
-
const m = o.currentPage, b = [], { min: h, max: D } = c.value;
|
|
711
|
-
return Array.from({ length: s }, (H, A) => {
|
|
712
|
-
const C = A + 1;
|
|
713
|
-
C !== 1 && C !== s && (C > D || C < h) || (C === s && s > 1 && D < s && b.push(d(m)), b.push({
|
|
714
|
-
label: `${C}`,
|
|
715
|
-
totalPages: s,
|
|
716
|
-
currentPage: m,
|
|
717
|
-
page: C
|
|
718
|
-
}), C === 1 && s > 1 && h > 1 && b.push(d(m)));
|
|
719
|
-
}), b;
|
|
720
|
-
}), i = (s) => {
|
|
721
|
-
n("updatePage", s);
|
|
722
|
-
};
|
|
723
|
-
return (s, m) => (r(), f("div", ao, [
|
|
724
|
-
u("div", ro, [
|
|
725
|
-
u("div", io, [
|
|
726
|
-
V(J, B(o, {
|
|
727
|
-
page: 1,
|
|
728
|
-
label: "<<",
|
|
729
|
-
"current-page": s.currentPage,
|
|
730
|
-
"never-active": !0,
|
|
731
|
-
disabled: s.currentPage === 1,
|
|
732
|
-
onUpdatePage: i
|
|
733
|
-
}), null, 16, ["current-page", "disabled"]),
|
|
734
|
-
V(J, B(o, {
|
|
735
|
-
page: s.currentPage - 1,
|
|
736
|
-
label: "<",
|
|
737
|
-
"current-page": s.currentPage,
|
|
738
|
-
"never-active": !0,
|
|
739
|
-
disabled: s.currentPage === 1,
|
|
740
|
-
onUpdatePage: i
|
|
741
|
-
}), null, 16, ["page", "current-page", "disabled"]),
|
|
742
|
-
(r(!0), f(L, null, M(p.value, (b) => (r(), y(J, B({
|
|
743
|
-
key: b.page,
|
|
744
|
-
ref_for: !0
|
|
745
|
-
}, b, { onUpdatePage: i }), null, 16))), 128)),
|
|
746
|
-
V(J, B(o, {
|
|
747
|
-
page: s.currentPage + 1,
|
|
748
|
-
label: ">",
|
|
749
|
-
"current-page": s.currentPage,
|
|
750
|
-
"never-active": !0,
|
|
751
|
-
disabled: o.currentPage === l.value,
|
|
752
|
-
onUpdatePage: i
|
|
753
|
-
}), null, 16, ["page", "current-page", "disabled"]),
|
|
754
|
-
V(J, B(o, {
|
|
755
|
-
page: l.value,
|
|
756
|
-
label: ">>",
|
|
757
|
-
"current-page": s.currentPage,
|
|
758
|
-
"never-active": !0,
|
|
759
|
-
disabled: o.currentPage === l.value,
|
|
760
|
-
onUpdatePage: i
|
|
761
|
-
}), null, 16, ["page", "current-page", "disabled"])
|
|
762
|
-
])
|
|
763
|
-
]),
|
|
764
|
-
u("div", uo, " page " + w(s.currentPage) + " of " + w(l.value), 1)
|
|
765
|
-
]));
|
|
766
|
-
}
|
|
767
|
-
}), Be = {
|
|
768
|
-
data: { type: Object, required: !0 },
|
|
769
|
-
column: { type: Object, required: !0 },
|
|
770
|
-
options: { type: Object }
|
|
771
|
-
}, Cn = /* @__PURE__ */ k({
|
|
772
|
-
__name: "text.cell",
|
|
773
|
-
props: Be,
|
|
774
|
-
setup(e) {
|
|
775
|
-
const t = e, o = v(() => {
|
|
776
|
-
const n = t.data[t.column.id];
|
|
777
|
-
return n ? t.column.options?.format === "keyValue" ? n[t.column.options.key] : n : null;
|
|
778
|
-
});
|
|
779
|
-
return (n, l) => w(o.value);
|
|
780
|
-
}
|
|
781
|
-
}), po = {
|
|
782
|
-
column: { type: Object, required: !0 },
|
|
783
|
-
sortColumn: { type: String },
|
|
784
|
-
sortDirection: { type: String }
|
|
785
|
-
}, fo = ["sort"], mo = { class: "flex-grow pr-2" }, bo = { class: "h-4 w-4" }, go = /* @__PURE__ */ k({
|
|
786
|
-
__name: "sort.header",
|
|
787
|
-
props: po,
|
|
788
|
-
emits: fo,
|
|
789
|
-
setup(e, { emit: t }) {
|
|
790
|
-
const o = e, n = t, l = v(
|
|
791
|
-
() => o.sortDirection === "asc" ? R.BarsArrowUp : R.BarsArrowDown
|
|
792
|
-
), a = v(() => o.column.options?.sortId ?? o.column.id), c = () => {
|
|
793
|
-
n("sort", a.value);
|
|
794
|
-
};
|
|
795
|
-
return (d, p) => (r(), f("button", {
|
|
796
|
-
class: "flex items-center",
|
|
797
|
-
onClick: c
|
|
798
|
-
}, [
|
|
799
|
-
u("span", mo, w(d.column.label), 1),
|
|
800
|
-
u("div", bo, [
|
|
801
|
-
d.sortColumn === a.value ? (r(), y(g(q), {
|
|
802
|
-
key: 0,
|
|
803
|
-
icon: l.value
|
|
804
|
-
}, null, 8, ["icon"])) : _("", !0)
|
|
805
|
-
])
|
|
806
|
-
]));
|
|
807
|
-
}
|
|
808
|
-
}), vo = {
|
|
809
|
-
loading: { type: Boolean, default: !1 },
|
|
810
|
-
actions: { type: Array },
|
|
811
|
-
data: { type: Array },
|
|
812
|
-
displayColumns: {
|
|
813
|
-
type: Array,
|
|
814
|
-
required: !0
|
|
815
|
-
},
|
|
816
|
-
page: { type: Object },
|
|
817
|
-
sort: { type: Object }
|
|
818
|
-
}, ho = ["updatePage", "sort"], yo = { class: "table w-full" }, wo = { key: 0 }, ko = ["colspan"], _o = ["ui-id"], $o = { class: "flex gap-2" }, xn = /* @__PURE__ */ k({
|
|
819
|
-
__name: "table.component",
|
|
820
|
-
props: vo,
|
|
821
|
-
emits: ho,
|
|
822
|
-
setup(e, { emit: t }) {
|
|
823
|
-
const o = t, n = Ie(), l = v(() => "onEdit" in n), a = v(() => "onDelete" in n), c = (s) => {
|
|
824
|
-
n.onEdit?.(s);
|
|
825
|
-
}, d = (s) => {
|
|
826
|
-
n.onDelete?.(s);
|
|
827
|
-
}, p = (s) => {
|
|
828
|
-
o("updatePage", s);
|
|
829
|
-
}, i = (s) => {
|
|
830
|
-
o("sort", s);
|
|
831
|
-
};
|
|
832
|
-
return (s, m) => (r(), f(L, null, [
|
|
833
|
-
u("table", yo, [
|
|
834
|
-
u("thead", null, [
|
|
835
|
-
u("tr", null, [
|
|
836
|
-
(r(!0), f(L, null, M(s.displayColumns, (b) => (r(), f("th", {
|
|
837
|
-
key: b.scope
|
|
838
|
-
}, [
|
|
839
|
-
V(go, B({ column: b }, { ref_for: !0 }, s.sort, { onSort: i }), null, 16, ["column"])
|
|
840
|
-
]))), 128)),
|
|
841
|
-
m[0] || (m[0] = u("th", null, null, -1))
|
|
842
|
-
])
|
|
843
|
-
]),
|
|
844
|
-
u("tbody", null, [
|
|
845
|
-
s.loading ? (r(), f("tr", wo, [
|
|
846
|
-
u("td", {
|
|
847
|
-
colspan: s.displayColumns.length + 1,
|
|
848
|
-
class: "text-center"
|
|
849
|
-
}, [...m[1] || (m[1] = [
|
|
850
|
-
u("span", { class: "loading loading-bars loading-xs" }, null, -1)
|
|
851
|
-
])], 8, ko)
|
|
852
|
-
])) : _("", !0),
|
|
853
|
-
(r(!0), f(L, null, M(s.data, (b) => (r(), f("tr", {
|
|
854
|
-
key: b.id,
|
|
855
|
-
"ui-id": `table_${b.id}`
|
|
856
|
-
}, [
|
|
857
|
-
(r(!0), f(L, null, M(s.displayColumns, (h) => (r(), f("td", {
|
|
858
|
-
key: h.scope
|
|
859
|
-
}, [
|
|
860
|
-
(r(), y(ne(h.component), B({ ref_for: !0 }, h, {
|
|
861
|
-
data: b,
|
|
862
|
-
column: h
|
|
863
|
-
}), null, 16, ["data", "column"]))
|
|
864
|
-
]))), 128)),
|
|
865
|
-
u("td", null, [
|
|
866
|
-
u("span", $o, [
|
|
867
|
-
(r(!0), f(L, null, M(s.actions, (h) => (r(), y(N, {
|
|
868
|
-
key: h.label,
|
|
869
|
-
"aria-label": h.label,
|
|
870
|
-
icon: h.icon,
|
|
871
|
-
outline: !0,
|
|
872
|
-
onClick: (D) => h.action(b)
|
|
873
|
-
}, {
|
|
874
|
-
default: S(() => [
|
|
875
|
-
E(w(h.label), 1)
|
|
876
|
-
]),
|
|
877
|
-
_: 2
|
|
878
|
-
}, 1032, ["aria-label", "icon", "onClick"]))), 128)),
|
|
879
|
-
l.value ? (r(), y(N, {
|
|
880
|
-
key: 0,
|
|
881
|
-
"aria-label": "Edit",
|
|
882
|
-
icon: g(R).Edit,
|
|
883
|
-
outline: !0,
|
|
884
|
-
onClick: (h) => c(b)
|
|
885
|
-
}, null, 8, ["icon", "onClick"])) : _("", !0),
|
|
886
|
-
a.value ? (r(), y(N, {
|
|
887
|
-
key: 1,
|
|
888
|
-
"aria-label": "Delete",
|
|
889
|
-
icon: g(R).Delete,
|
|
890
|
-
outline: !0,
|
|
891
|
-
onClick: (h) => d(b)
|
|
892
|
-
}, null, 8, ["icon", "onClick"])) : _("", !0)
|
|
893
|
-
])
|
|
894
|
-
])
|
|
895
|
-
], 8, _o))), 128))
|
|
896
|
-
])
|
|
897
|
-
]),
|
|
898
|
-
s.page ? (r(), y(co, {
|
|
899
|
-
key: 0,
|
|
900
|
-
class: "border-gray-300 border-t pt-4 border-x-0 border-b-0",
|
|
901
|
-
"total-items": s.page.count,
|
|
902
|
-
"items-per-page": s.page.pageSize,
|
|
903
|
-
"current-page": s.page.page,
|
|
904
|
-
onUpdatePage: p
|
|
905
|
-
}, null, 8, ["total-items", "items-per-page", "current-page"])) : _("", !0)
|
|
906
|
-
], 64));
|
|
907
|
-
}
|
|
908
|
-
}), Co = { class: "flex justify-center" }, Ln = /* @__PURE__ */ k({
|
|
909
|
-
__name: "boolean.cell",
|
|
910
|
-
props: Be,
|
|
911
|
-
setup(e) {
|
|
912
|
-
const t = e, o = v(() => {
|
|
913
|
-
const n = t.data[t.column.id];
|
|
914
|
-
return n ? t.column.options?.format === "keyValue" ? n[t.column.options.key] : n : null;
|
|
915
|
-
});
|
|
916
|
-
return (n, l) => (r(), f("div", Co, [
|
|
917
|
-
o.value === !0 ? (r(), y(q, {
|
|
918
|
-
key: 0,
|
|
919
|
-
icon: g(R).Check,
|
|
920
|
-
size: "sm"
|
|
921
|
-
}, null, 8, ["icon"])) : _("", !0)
|
|
922
|
-
]));
|
|
923
|
-
}
|
|
924
|
-
}), xo = (e, t) => {
|
|
925
|
-
const o = e.__vccOpts || e;
|
|
926
|
-
for (const [n, l] of t)
|
|
927
|
-
o[n] = l;
|
|
928
|
-
return o;
|
|
929
|
-
}, Lo = {}, So = { class: "card bg-base-100 shadow-sm" }, Po = { class: "card-body" }, Mo = {
|
|
930
|
-
key: 0,
|
|
931
|
-
class: "card-title"
|
|
932
|
-
}, Bo = {
|
|
933
|
-
key: 1,
|
|
934
|
-
class: "card-actions justify-end"
|
|
935
|
-
};
|
|
936
|
-
function Vo(e, t) {
|
|
937
|
-
return r(), f("div", So, [
|
|
938
|
-
u("div", Po, [
|
|
939
|
-
e.$slots.title ? (r(), f("h2", Mo, [
|
|
940
|
-
P(e.$slots, "title")
|
|
941
|
-
])) : _("", !0),
|
|
942
|
-
u("p", null, [
|
|
943
|
-
P(e.$slots, "default"),
|
|
944
|
-
P(e.$slots, "content")
|
|
945
|
-
]),
|
|
946
|
-
e.$slots.actions ? (r(), f("div", Bo, [
|
|
947
|
-
P(e.$slots, "actions")
|
|
948
|
-
])) : _("", !0)
|
|
949
|
-
])
|
|
950
|
-
]);
|
|
951
|
-
}
|
|
952
|
-
const Sn = /* @__PURE__ */ xo(Lo, [["render", Vo]]), Pn = (e, t) => {
|
|
953
|
-
if (!e) return null;
|
|
954
|
-
const o = (n) => {
|
|
955
|
-
e.contains(n.target) || t();
|
|
956
|
-
};
|
|
957
|
-
return document.addEventListener("click", o), o;
|
|
958
|
-
}, Mn = (e) => {
|
|
959
|
-
document.removeEventListener("click", e);
|
|
960
|
-
}, Bn = {
|
|
961
|
-
beforeMount(e, t) {
|
|
962
|
-
e.clickOutsideEvent = function(o) {
|
|
963
|
-
e === o.target || e.contains(o.target) || t.value(o);
|
|
964
|
-
}, document.addEventListener("click", e.clickOutsideEvent);
|
|
965
|
-
},
|
|
966
|
-
unmounted(e) {
|
|
967
|
-
document.removeEventListener("click", e.clickOutsideEvent);
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
function Ao(e) {
|
|
971
|
-
return e.replace(/[:\s_-]+(.)/g, (t, o) => o.toUpperCase()).replace(/^[A-Z]/, (t) => t.toLowerCase());
|
|
972
|
-
}
|
|
973
|
-
function Vn(e) {
|
|
974
|
-
const t = De();
|
|
975
|
-
if (!t)
|
|
976
|
-
return !1;
|
|
977
|
-
const o = t.vnode.props;
|
|
978
|
-
if (!o)
|
|
979
|
-
return !1;
|
|
980
|
-
const n = Ao(e), l = Re(e);
|
|
981
|
-
return [
|
|
982
|
-
re(e),
|
|
983
|
-
re(l),
|
|
984
|
-
re(n),
|
|
985
|
-
`on:${e}`,
|
|
986
|
-
`on:${l}`,
|
|
987
|
-
`on:${n}`
|
|
988
|
-
].some(
|
|
989
|
-
(c) => !!o[c]
|
|
990
|
-
);
|
|
991
|
-
}
|
|
992
|
-
const Oo = ["select"], ge = {
|
|
993
|
-
options: { type: Array, required: !1 },
|
|
994
|
-
isLoading: {
|
|
995
|
-
type: Boolean,
|
|
996
|
-
default: !1
|
|
997
|
-
},
|
|
998
|
-
query: { type: String, default: null },
|
|
999
|
-
isActive: { type: Function, default: (e) => !1 }
|
|
1000
|
-
}, se = {
|
|
1001
|
-
group: {
|
|
1002
|
-
root: "group",
|
|
1003
|
-
label: "text-primary text-lg font-bold",
|
|
1004
|
-
item: "group-item"
|
|
1005
|
-
},
|
|
1006
|
-
verticalLayout: {
|
|
1007
|
-
root: "flex flex-col gap-x-2",
|
|
1008
|
-
item: "w-full"
|
|
1009
|
-
},
|
|
1010
|
-
horizontalLayout: {
|
|
1011
|
-
root: "flex flex-row gap-x-2",
|
|
1012
|
-
item: "w-full"
|
|
1013
|
-
},
|
|
1014
|
-
arrayList: {
|
|
1015
|
-
root: "fieldset",
|
|
1016
|
-
legend: "fieldset-legend text-xl capitalize"
|
|
1017
|
-
},
|
|
1018
|
-
control: {
|
|
1019
|
-
root: "fieldset",
|
|
1020
|
-
wrapper: "fieldset",
|
|
1021
|
-
label: "fieldset-legend",
|
|
1022
|
-
error: "",
|
|
1023
|
-
input: "input",
|
|
1024
|
-
textarea: "input h-32",
|
|
1025
|
-
checkbox: "checkbox",
|
|
1026
|
-
select: "input pr-14",
|
|
1027
|
-
description: "form-control--description label text-xs text-gray-500"
|
|
1028
|
-
},
|
|
1029
|
-
fixedArrayList: {
|
|
1030
|
-
root: "flex flex-row gap-x-2",
|
|
1031
|
-
item: "w-full"
|
|
1032
|
-
}
|
|
1033
|
-
}, ae = (e) => {
|
|
1034
|
-
if (!e) return { ...se };
|
|
1035
|
-
const t = { ...se };
|
|
1036
|
-
for (const o of Object.keys(e)) {
|
|
1037
|
-
const n = e[o];
|
|
1038
|
-
n && typeof n == "object" && (t[o] = { ...se[o], ...n });
|
|
1039
|
-
}
|
|
1040
|
-
return t;
|
|
1041
|
-
}, K = {
|
|
1042
|
-
id: { type: String },
|
|
1043
|
-
placeholder: { type: String },
|
|
1044
|
-
description: { type: String },
|
|
1045
|
-
errors: { type: String },
|
|
1046
|
-
label: { type: String },
|
|
1047
|
-
visible: { type: Boolean, default: !1 },
|
|
1048
|
-
required: { type: Boolean, default: !1 },
|
|
1049
|
-
enabled: { type: Boolean, default: !0 },
|
|
1050
|
-
isFocused: { type: Boolean, default: !1 },
|
|
1051
|
-
isTouched: { type: Boolean, default: !1 },
|
|
1052
|
-
hideLabel: { type: Boolean, default: !1 },
|
|
1053
|
-
styles: {
|
|
1054
|
-
type: Object,
|
|
1055
|
-
default: () => se
|
|
1056
|
-
},
|
|
1057
|
-
width: { type: String, default: "w-48" }
|
|
1058
|
-
}, ve = {
|
|
1059
|
-
...K,
|
|
1060
|
-
options: { type: Array, required: !0 },
|
|
1061
|
-
/** Key to use as the display label when options are objects */
|
|
1062
|
-
labelKey: { type: String, default: "label" },
|
|
1063
|
-
/** Key to use as the stored
|
|
1064
|
-
value when options are objects */
|
|
1065
|
-
valueKey: { type: String, default: "value" },
|
|
1066
|
-
/** add a new button next to the list*/
|
|
1067
|
-
enableCreate: { type: Boolean, default: !1 }
|
|
1068
|
-
}, Io = ["select", "clear", "close", "create"], Ve = {
|
|
1069
|
-
...ge,
|
|
1070
|
-
...ve,
|
|
1071
|
-
isOpen: { type: Boolean, default: !1 },
|
|
1072
|
-
isActive: { type: Function, default: (e) => !1 }
|
|
1073
|
-
}, Do = {
|
|
1074
|
-
key: 1,
|
|
1075
|
-
tabindex: "-1",
|
|
1076
|
-
class: "pointer-events-none"
|
|
1077
|
-
}, Ro = ["data-index", "aria-selected", "onMousedown", "onMousemove"], To = ["innerHTML"], Eo = {
|
|
1078
|
-
key: 0,
|
|
1079
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
|
-
class: "h-4 w-4 shrink-0 opacity-80",
|
|
1081
|
-
fill: "none",
|
|
1082
|
-
viewBox: "0 0 24 24",
|
|
1083
|
-
stroke: "currentColor",
|
|
1084
|
-
"stroke-width": "2.5"
|
|
1085
|
-
};
|
|
1086
|
-
function zo(e, t) {
|
|
1087
|
-
if (!t) return e;
|
|
1088
|
-
const o = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1089
|
-
return e.replace(
|
|
1090
|
-
new RegExp(`(${o})`, "gi"),
|
|
1091
|
-
'<mark class="bg-warning/40 text-inherit rounded-sm px-0.5">$1</mark>'
|
|
1092
|
-
);
|
|
1093
|
-
}
|
|
1094
|
-
const No = /* @__PURE__ */ k({
|
|
1095
|
-
__name: "ListResults",
|
|
1096
|
-
props: ge,
|
|
1097
|
-
emits: Oo,
|
|
1098
|
-
setup(e, { expose: t, emit: o }) {
|
|
1099
|
-
const n = e, l = x(-1), a = x(), c = o;
|
|
1100
|
-
j(
|
|
1101
|
-
() => n.options,
|
|
1102
|
-
() => {
|
|
1103
|
-
l.value = -1;
|
|
1104
|
-
}
|
|
1105
|
-
);
|
|
1106
|
-
function d() {
|
|
1107
|
-
xe(() => {
|
|
1108
|
-
a.value?.querySelector(
|
|
1109
|
-
`[data-index="${l.value}"]`
|
|
1110
|
-
)?.scrollIntoView({ block: "nearest" });
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
function p(s) {
|
|
1114
|
-
const m = n.options?.length ?? 0;
|
|
1115
|
-
if (m)
|
|
1116
|
-
switch (s.key) {
|
|
1117
|
-
case "ArrowDown":
|
|
1118
|
-
s.preventDefault(), l.value = (l.value + 1) % m, d();
|
|
1119
|
-
break;
|
|
1120
|
-
case "ArrowUp":
|
|
1121
|
-
s.preventDefault(), l.value = l.value <= 0 ? m - 1 : l.value - 1, d();
|
|
1122
|
-
break;
|
|
1123
|
-
case "Enter":
|
|
1124
|
-
s.preventDefault(), l.value >= 0 && l.value < m && i(n.options[l.value]);
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
function i(s) {
|
|
1129
|
-
l.value = -1, c("select", s);
|
|
1130
|
-
}
|
|
1131
|
-
return t({ handleKeydown: p }), (s, m) => (r(), f("ul", {
|
|
1132
|
-
ref_key: "listRef",
|
|
1133
|
-
ref: a,
|
|
1134
|
-
role: "listbox",
|
|
1135
|
-
class: "absolute z-50 w-full mt-1 bg-base-100 border border-base-300 rounded-box shadow-xl overflow-auto max-h-64 origin-top p-1"
|
|
1136
|
-
}, [
|
|
1137
|
-
s.isLoading ? (r(), f(L, { key: 0 }, M(2, (b) => u("li", {
|
|
1138
|
-
key: `skel-${b}`,
|
|
1139
|
-
class: "pointer-events-none px-3 py-2"
|
|
1140
|
-
}, [...m[0] || (m[0] = [
|
|
1141
|
-
u("div", { class: "flex items-center gap-3" }, [
|
|
1142
|
-
u("div", { class: "skeleton h-3 w-3/4 rounded" })
|
|
1143
|
-
], -1)
|
|
1144
|
-
])])), 64)) : s.options?.length === 0 ? (r(), f("li", Do, [...m[1] || (m[1] = [
|
|
1145
|
-
u("span", { class: "px-3 py-2 text-sm opacity-50 italic" }, " No results found ", -1)
|
|
1146
|
-
])])) : (r(!0), f(L, { key: 2 }, M(s.options, (b, h) => (r(), f("li", {
|
|
1147
|
-
key: b.value,
|
|
1148
|
-
"data-index": h,
|
|
1149
|
-
role: "option",
|
|
1150
|
-
"aria-selected": h === l.value,
|
|
1151
|
-
onMousedown: le((D) => i(b), ["prevent"]),
|
|
1152
|
-
onMousemove: (D) => l.value = h
|
|
1153
|
-
}, [
|
|
1154
|
-
u("a", {
|
|
1155
|
-
class: $(["flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition-colors duration-100", {
|
|
1156
|
-
"active bg-secondary text-primary-content": h === l.value,
|
|
1157
|
-
"hover:bg-base-200": h !== l.value
|
|
1158
|
-
}])
|
|
1159
|
-
}, [
|
|
1160
|
-
u("span", {
|
|
1161
|
-
class: "whitespace-nowrap",
|
|
1162
|
-
innerHTML: zo(b.label, s.query)
|
|
1163
|
-
}, null, 8, To),
|
|
1164
|
-
s.isActive(b) ? (r(), f("svg", Eo, [...m[2] || (m[2] = [
|
|
1165
|
-
u("path", {
|
|
1166
|
-
"stroke-linecap": "round",
|
|
1167
|
-
"stroke-linejoin": "round",
|
|
1168
|
-
d: "M5 13l4 4L19 7"
|
|
1169
|
-
}, null, -1)
|
|
1170
|
-
])])) : _("", !0)
|
|
1171
|
-
], 2)
|
|
1172
|
-
], 40, Ro))), 128))
|
|
1173
|
-
], 512));
|
|
1174
|
-
}
|
|
1175
|
-
}), Ae = ({ isTouched: e, errors: t }) => !!(e && t), qo = (e, t, o, n) => t === void 0 || t !== void 0 && !e || !n && !o, U = (e, t) => [e, { "input-error": Ae(t) }], jo = { key: 0 }, Z = /* @__PURE__ */ k({
|
|
1176
|
-
__name: "ControlWrapper",
|
|
1177
|
-
props: K,
|
|
1178
|
-
setup(e) {
|
|
1179
|
-
const t = e, o = v(() => !qo(
|
|
1180
|
-
t.visible,
|
|
1181
|
-
t.description,
|
|
1182
|
-
t.isFocused,
|
|
1183
|
-
!0
|
|
1184
|
-
)), n = v(() => t.required), l = v(() => Ae(t)), a = v(() => ae(t.styles));
|
|
1185
|
-
return (c, d) => (r(), f("fieldset", {
|
|
1186
|
-
class: $(["fieldset", [c.width, a.value.control.wrapper]])
|
|
1187
|
-
}, [
|
|
1188
|
-
u("legend", {
|
|
1189
|
-
class: $(a.value.control.label)
|
|
1190
|
-
}, [
|
|
1191
|
-
c.hideLabel ? _("", !0) : (r(), f(L, { key: 0 }, [
|
|
1192
|
-
u("span", null, w(c.label), 1),
|
|
1193
|
-
n.value ? (r(), f("span", jo, "*")) : _("", !0)
|
|
1194
|
-
], 64)),
|
|
1195
|
-
d[0] || (d[0] = E(" ", -1))
|
|
1196
|
-
], 2),
|
|
1197
|
-
P(c.$slots, "default"),
|
|
1198
|
-
u("p", {
|
|
1199
|
-
class: $(["fieldset-label h-4", { "text-error": l.value }])
|
|
1200
|
-
}, w(l.value ? c.errors : o.value ? c.description : null), 3)
|
|
1201
|
-
], 2));
|
|
1202
|
-
}
|
|
1203
|
-
}), Fo = ["aria-label"], Ko = { class: "flex items-center w-full" }, Uo = { class: "overflow-hidden w-full" }, Ho = { class: "absolute inset-y-0 right-0 flex items-center pr-3 gap-1 pointer-events-none" }, Wo = {
|
|
1204
|
-
key: 0,
|
|
1205
|
-
class: "loading loading-spinner loading-xs text-primary pointer-events-none"
|
|
1206
|
-
}, he = /* @__PURE__ */ k({
|
|
1207
|
-
__name: "SelectWrapper",
|
|
1208
|
-
props: Ve,
|
|
1209
|
-
emits: Io,
|
|
1210
|
-
setup(e, { emit: t }) {
|
|
1211
|
-
const o = e, n = x(), l = x(), a = t, c = () => {
|
|
1212
|
-
d(), a("clear");
|
|
1213
|
-
}, d = () => {
|
|
1214
|
-
a("close");
|
|
1215
|
-
}, p = (s) => {
|
|
1216
|
-
if (s.key === "Escape") {
|
|
1217
|
-
d();
|
|
1218
|
-
return;
|
|
1219
|
-
}
|
|
1220
|
-
l.value?.handleKeydown(s);
|
|
1221
|
-
}, i = (s) => {
|
|
1222
|
-
n.value && !n.value.contains(s.target) && d();
|
|
1223
|
-
};
|
|
1224
|
-
return $e(() => {
|
|
1225
|
-
document.addEventListener("click", i);
|
|
1226
|
-
}), _e(() => {
|
|
1227
|
-
document.removeEventListener("click", i);
|
|
1228
|
-
}), (s, m) => (r(), f("div", {
|
|
1229
|
-
ref_key: "selectWrapperRef",
|
|
1230
|
-
ref: n,
|
|
1231
|
-
"aria-label": s.id,
|
|
1232
|
-
role: "select"
|
|
1233
|
-
}, [
|
|
1234
|
-
V(Z, ee(te(o)), {
|
|
1235
|
-
default: S(() => [
|
|
1236
|
-
u("div", Ko, [
|
|
1237
|
-
u("div", {
|
|
1238
|
-
class: "relative w-full",
|
|
1239
|
-
onKeydown: p
|
|
1240
|
-
}, [
|
|
1241
|
-
u("div", Uo, [
|
|
1242
|
-
P(s.$slots, "default")
|
|
1243
|
-
]),
|
|
1244
|
-
u("div", Ho, [
|
|
1245
|
-
s.isLoading && !s.label ? (r(), f("span", Wo)) : _("", !0),
|
|
1246
|
-
s.query && !s.isLoading ? (r(), f("button", {
|
|
1247
|
-
key: 1,
|
|
1248
|
-
type: "button",
|
|
1249
|
-
class: "pointer-events-auto btn btn-ghost btn-xs btn-circle opacity-60 hover:opacity-100",
|
|
1250
|
-
tabindex: "-1",
|
|
1251
|
-
"aria-label": "Clear",
|
|
1252
|
-
onMousedown: le(c, ["prevent"])
|
|
1253
|
-
}, [...m[2] || (m[2] = [
|
|
1254
|
-
u("svg", {
|
|
1255
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1256
|
-
class: "h-3.5 w-3.5",
|
|
1257
|
-
fill: "none",
|
|
1258
|
-
viewBox: "0 0 24 24",
|
|
1259
|
-
stroke: "currentColor",
|
|
1260
|
-
"stroke-width": "2.5"
|
|
1261
|
-
}, [
|
|
1262
|
-
u("path", {
|
|
1263
|
-
"stroke-linecap": "round",
|
|
1264
|
-
"stroke-linejoin": "round",
|
|
1265
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
1266
|
-
})
|
|
1267
|
-
], -1)
|
|
1268
|
-
])], 32)) : _("", !0),
|
|
1269
|
-
(r(), f("svg", {
|
|
1270
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1271
|
-
class: $(["h-4 w-4 opacity-40 transition-transform duration-200", { "rotate-180": s.isOpen }]),
|
|
1272
|
-
fill: "none",
|
|
1273
|
-
viewBox: "0 0 24 24",
|
|
1274
|
-
stroke: "currentColor",
|
|
1275
|
-
"stroke-width": "2"
|
|
1276
|
-
}, [...m[3] || (m[3] = [
|
|
1277
|
-
u("path", {
|
|
1278
|
-
"stroke-linecap": "round",
|
|
1279
|
-
"stroke-linejoin": "round",
|
|
1280
|
-
d: "M19 9l-7 7-7-7"
|
|
1281
|
-
}, null, -1)
|
|
1282
|
-
])], 2))
|
|
1283
|
-
]),
|
|
1284
|
-
V(Te, {
|
|
1285
|
-
"enter-active-class": "transition-all duration-150 ease-out",
|
|
1286
|
-
"enter-from-class": "opacity-0 -translate-y-1 scale-y-95",
|
|
1287
|
-
"enter-to-class": "opacity-100 translate-y-0 scale-y-100",
|
|
1288
|
-
"leave-active-class": "transition-all duration-100 ease-in",
|
|
1289
|
-
"leave-from-class": "opacity-100 translate-y-0 scale-y-100",
|
|
1290
|
-
"leave-to-class": "opacity-0 -translate-y-1 scale-y-95"
|
|
1291
|
-
}, {
|
|
1292
|
-
default: S(() => [
|
|
1293
|
-
s.isOpen ? (r(), y(No, {
|
|
1294
|
-
key: 0,
|
|
1295
|
-
ref_key: "listResultsRef",
|
|
1296
|
-
ref: l,
|
|
1297
|
-
query: s.query,
|
|
1298
|
-
options: s.options,
|
|
1299
|
-
"is-loading": s.isLoading,
|
|
1300
|
-
"is-active": s.isActive,
|
|
1301
|
-
onSelect: m[0] || (m[0] = (b) => a("select", b))
|
|
1302
|
-
}, null, 8, ["query", "options", "is-loading", "is-active"])) : _("", !0)
|
|
1303
|
-
]),
|
|
1304
|
-
_: 1
|
|
1305
|
-
})
|
|
1306
|
-
], 32),
|
|
1307
|
-
s.enableCreate ? (r(), y(N, {
|
|
1308
|
-
key: 0,
|
|
1309
|
-
icon: g(R).Plus,
|
|
1310
|
-
color: g(z).blank,
|
|
1311
|
-
size: "lg",
|
|
1312
|
-
tooltip: "Create new",
|
|
1313
|
-
"aria-label": "create",
|
|
1314
|
-
onClick: m[1] || (m[1] = (b) => a("create"))
|
|
1315
|
-
}, null, 8, ["icon", "color"])) : _("", !0)
|
|
1316
|
-
])
|
|
1317
|
-
]),
|
|
1318
|
-
_: 3
|
|
1319
|
-
}, 16)
|
|
1320
|
-
], 8, Fo));
|
|
1321
|
-
}
|
|
1322
|
-
}), ue = (e, t) => {
|
|
1323
|
-
if (e)
|
|
1324
|
-
return typeof e == "object" ? e[t.labelKey] : e;
|
|
1325
|
-
}, ie = (e, t) => {
|
|
1326
|
-
if (e)
|
|
1327
|
-
return typeof e == "object" ? e[t.valueKey] : e;
|
|
1328
|
-
}, Go = (e) => {
|
|
1329
|
-
const t = x([]), o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), l = (s) => {
|
|
1330
|
-
const m = [];
|
|
1331
|
-
o.clear(), n.clear(), s?.forEach((b) => {
|
|
1332
|
-
const h = {
|
|
1333
|
-
value: ie(b, e),
|
|
1334
|
-
label: ue(b, e)
|
|
1335
|
-
};
|
|
1336
|
-
o.set(h.value, b), n.set(h.value, h), m.push(h);
|
|
1337
|
-
}), t.value = m;
|
|
1338
|
-
}, a = (s) => o.get(s.value);
|
|
1339
|
-
return {
|
|
1340
|
-
options: t,
|
|
1341
|
-
setOptions: l,
|
|
1342
|
-
getOriginal: a,
|
|
1343
|
-
getLabels: (...s) => s.map((m) => ue(m, e)),
|
|
1344
|
-
getValues: (...s) => s.map((m) => ie(m, e)),
|
|
1345
|
-
getOption: (s) => n.get(ie(s, e)),
|
|
1346
|
-
getOriginals: (...s) => s.map(a).filter(Boolean)
|
|
1347
|
-
};
|
|
1348
|
-
}, ye = (e) => Go(e), Xo = ["aria-label"], An = /* @__PURE__ */ k({
|
|
1349
|
-
__name: "SelectComponent",
|
|
1350
|
-
props: /* @__PURE__ */ I(ve, {
|
|
1351
|
-
modelValue: {},
|
|
1352
|
-
modelModifiers: {}
|
|
1353
|
-
}),
|
|
1354
|
-
emits: /* @__PURE__ */ I(["update:modelValue", "change", "clear", "focus", "blur"], ["update:modelValue"]),
|
|
1355
|
-
setup(e, { emit: t }) {
|
|
1356
|
-
const o = x(!1), n = e, l = t, a = F(e, "modelValue"), c = ye(n), { options: d } = c;
|
|
1357
|
-
j(
|
|
1358
|
-
() => n.options,
|
|
1359
|
-
() => {
|
|
1360
|
-
c.setOptions(n.options);
|
|
1361
|
-
},
|
|
1362
|
-
{ immediate: !0 }
|
|
1363
|
-
);
|
|
1364
|
-
const p = (A) => {
|
|
1365
|
-
l("change", A);
|
|
1366
|
-
}, i = v(
|
|
1367
|
-
() => a.value ? c.getLabels(a.value)[0] : ""
|
|
1368
|
-
), s = v(() => ae(n.styles)), m = v(
|
|
1369
|
-
() => U(s.value.control.select, n)
|
|
1370
|
-
), b = (A) => {
|
|
1371
|
-
const C = c.getOriginal(A);
|
|
1372
|
-
a.value = C, p(C);
|
|
1373
|
-
}, h = () => {
|
|
1374
|
-
o.value = !1, a.value = null, p(void 0);
|
|
1375
|
-
}, D = (A) => c.getValues(a.value)?.[0] === A.value, H = () => {
|
|
1376
|
-
o.value = !1;
|
|
1377
|
-
};
|
|
1378
|
-
return (A, C) => (r(), y(he, B(n, {
|
|
1379
|
-
options: g(d),
|
|
1380
|
-
disabled: !A.enabled,
|
|
1381
|
-
"is-open": o.value,
|
|
1382
|
-
query: i.value,
|
|
1383
|
-
"is-active": D,
|
|
1384
|
-
onClose: H,
|
|
1385
|
-
onSelect: b,
|
|
1386
|
-
onClear: h
|
|
1387
|
-
}), {
|
|
1388
|
-
default: S(() => [
|
|
1389
|
-
u("button", {
|
|
1390
|
-
type: "button",
|
|
1391
|
-
class: $(["truncate block text-left", [m.value, A.width]]),
|
|
1392
|
-
"aria-label": A.id,
|
|
1393
|
-
role: "combobox",
|
|
1394
|
-
onClick: C[0] || (C[0] = (T) => o.value = !0)
|
|
1395
|
-
}, w(i.value ?? "Select value"), 11, Xo)
|
|
1396
|
-
]),
|
|
1397
|
-
_: 1
|
|
1398
|
-
}, 16, ["options", "disabled", "is-open", "query"]));
|
|
1399
|
-
}
|
|
1400
|
-
}), Zo = {
|
|
1401
|
-
...ve,
|
|
1402
|
-
...ge,
|
|
1403
|
-
/** v-model binding */
|
|
1404
|
-
modelValue: {
|
|
1405
|
-
type: [String, Object],
|
|
1406
|
-
default: ""
|
|
1407
|
-
},
|
|
1408
|
-
/**
|
|
1409
|
-
* HTTP mode: async function that receives the search string and returns
|
|
1410
|
-
* an array of strings or { label, value } objects.
|
|
1411
|
-
* e.g. :fetchOptions="(q) => fetch(`/api/search?q=${q}`).then(r => r.json())"
|
|
1412
|
-
*/
|
|
1413
|
-
fetchOptions: {
|
|
1414
|
-
type: Function,
|
|
1415
|
-
default: null
|
|
1416
|
-
},
|
|
1417
|
-
/** Debounce delay in ms for HTTP mode */
|
|
1418
|
-
debounceMs: {
|
|
1419
|
-
type: Number,
|
|
1420
|
-
default: 200
|
|
1421
|
-
},
|
|
1422
|
-
/** How many results to show at once */
|
|
1423
|
-
maxResults: {
|
|
1424
|
-
type: Number,
|
|
1425
|
-
default: 8
|
|
1426
|
-
},
|
|
1427
|
-
/** Allow free-text (don't clear input if nothing selected) */
|
|
1428
|
-
freeText: {
|
|
1429
|
-
type: Boolean,
|
|
1430
|
-
default: !1
|
|
1431
|
-
}
|
|
1432
|
-
};
|
|
1433
|
-
function Jo(e) {
|
|
1434
|
-
const t = x([]), o = x(!1);
|
|
1435
|
-
function n(a) {
|
|
1436
|
-
if (!e.options) {
|
|
1437
|
-
t.value = [];
|
|
1438
|
-
return;
|
|
1439
|
-
}
|
|
1440
|
-
const c = a.toLowerCase(), d = c ? e.options.filter(
|
|
1441
|
-
(p) => ue(p, e).toLowerCase().includes(c)
|
|
1442
|
-
) : e.options;
|
|
1443
|
-
t.value = d.slice(0, e.maxResults);
|
|
1444
|
-
}
|
|
1445
|
-
function l() {
|
|
1446
|
-
t.value = [];
|
|
1447
|
-
}
|
|
1448
|
-
return { results: t, isLoading: o, search: n, clear: l };
|
|
1449
|
-
}
|
|
1450
|
-
function Qo(e) {
|
|
1451
|
-
const t = x([]), o = x(!1);
|
|
1452
|
-
let n = null, l = null;
|
|
1453
|
-
async function a(p) {
|
|
1454
|
-
l && l.abort(), l = new AbortController(), o.value = !0;
|
|
1455
|
-
try {
|
|
1456
|
-
const i = await e.fetchOptions(p, l.signal);
|
|
1457
|
-
t.value = (i || []).slice(0, e.maxResults);
|
|
1458
|
-
} catch (i) {
|
|
1459
|
-
i.name !== "AbortError" && (t.value = []);
|
|
1460
|
-
} finally {
|
|
1461
|
-
o.value = !1;
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
function c(p) {
|
|
1465
|
-
n && clearTimeout(n), o.value = !0, n = setTimeout(() => {
|
|
1466
|
-
a(p);
|
|
1467
|
-
}, e.debounceMs);
|
|
1468
|
-
}
|
|
1469
|
-
function d() {
|
|
1470
|
-
n && clearTimeout(n), l && l.abort(), t.value = [], o.value = !1;
|
|
1471
|
-
}
|
|
1472
|
-
return { results: t, isLoading: o, search: c, clear: d };
|
|
1473
|
-
}
|
|
1474
|
-
function Yo(e) {
|
|
1475
|
-
const t = e.fetchOptions ? Qo(e) : Jo(e);
|
|
1476
|
-
function o(n) {
|
|
1477
|
-
t.search(n);
|
|
1478
|
-
}
|
|
1479
|
-
return {
|
|
1480
|
-
results: t.results,
|
|
1481
|
-
isLoading: t.isLoading,
|
|
1482
|
-
triggerSearch: o,
|
|
1483
|
-
clear: t.clear
|
|
1484
|
-
};
|
|
1485
|
-
}
|
|
1486
|
-
const es = ["aria-label", "aria-expanded", "value", "placeholder", "disabled"], On = /* @__PURE__ */ k({
|
|
1487
|
-
__name: "AutoComplete",
|
|
1488
|
-
props: Zo,
|
|
1489
|
-
emits: ["update:modelValue", "change", "clear", "focus", "blur"],
|
|
1490
|
-
setup(e, { emit: t }) {
|
|
1491
|
-
const o = e, n = t, l = x(null), a = x(""), c = x(!1), d = Yo(o), { isLoading: p, triggerSearch: i, clear: s } = d, m = ye(o), { options: b } = m;
|
|
1492
|
-
j(
|
|
1493
|
-
() => d.results.value,
|
|
1494
|
-
() => {
|
|
1495
|
-
m.setOptions(d.results.value);
|
|
1496
|
-
},
|
|
1497
|
-
{ immediate: !0 }
|
|
1498
|
-
), j(
|
|
1499
|
-
() => o.modelValue,
|
|
1500
|
-
(O) => {
|
|
1501
|
-
if (O == null || O === "") {
|
|
1502
|
-
a.value = "";
|
|
1503
|
-
return;
|
|
1504
|
-
}
|
|
1505
|
-
const G = typeof O == "object" ? O[o.labelKey] : O;
|
|
1506
|
-
G !== a.value && (a.value = G);
|
|
1507
|
-
},
|
|
1508
|
-
{ immediate: !0 }
|
|
1509
|
-
);
|
|
1510
|
-
const h = (O) => {
|
|
1511
|
-
a.value = O.target.value, o.freeText ? n("update:modelValue", a.value) : n("update:modelValue", ""), i(a.value), c.value = !0;
|
|
1512
|
-
}, D = () => {
|
|
1513
|
-
i(a.value), c.value = !0;
|
|
1514
|
-
};
|
|
1515
|
-
function H() {
|
|
1516
|
-
setTimeout(() => {
|
|
1517
|
-
c.value = !1, o.freeText ? n("change", a.value) : o.modelValue || (a.value = "");
|
|
1518
|
-
}, 150);
|
|
1519
|
-
}
|
|
1520
|
-
const A = (O) => {
|
|
1521
|
-
const G = m.getOriginal(O);
|
|
1522
|
-
a.value = O.label, c.value = !1, n("update:modelValue", G), n("change", G);
|
|
1523
|
-
}, C = () => {
|
|
1524
|
-
a.value = "", s(), c.value = !1, n("update:modelValue", ""), n("clear"), xe(() => l.value?.focus());
|
|
1525
|
-
}, T = () => {
|
|
1526
|
-
c.value = !1;
|
|
1527
|
-
}, W = v(() => ae(o.styles)), Oe = v(
|
|
1528
|
-
() => U(W.value.control.select, o)
|
|
1529
|
-
);
|
|
1530
|
-
return (O, G) => (r(), y(he, B(o, {
|
|
1531
|
-
options: g(b),
|
|
1532
|
-
"is-loading": g(p),
|
|
1533
|
-
"is-open": c.value,
|
|
1534
|
-
query: a.value,
|
|
1535
|
-
onClose: T,
|
|
1536
|
-
onSelect: A,
|
|
1537
|
-
onClear: C
|
|
1538
|
-
}), {
|
|
1539
|
-
default: S(() => [
|
|
1540
|
-
u("input", {
|
|
1541
|
-
ref_key: "inputRef",
|
|
1542
|
-
ref: l,
|
|
1543
|
-
type: "text",
|
|
1544
|
-
role: "combobox",
|
|
1545
|
-
"aria-label": O.id,
|
|
1546
|
-
"aria-expanded": c.value,
|
|
1547
|
-
"aria-autocomplete": "list",
|
|
1548
|
-
"aria-haspopup": "listbox",
|
|
1549
|
-
autocomplete: "off",
|
|
1550
|
-
autocorrect: "off",
|
|
1551
|
-
spellcheck: "false",
|
|
1552
|
-
class: $([Oe.value, "w-full"]),
|
|
1553
|
-
value: a.value,
|
|
1554
|
-
placeholder: O.placeholder,
|
|
1555
|
-
disabled: !O.enabled,
|
|
1556
|
-
onInput: h,
|
|
1557
|
-
onFocus: D,
|
|
1558
|
-
onBlur: H
|
|
1559
|
-
}, null, 42, es)
|
|
1560
|
-
]),
|
|
1561
|
-
_: 1
|
|
1562
|
-
}, 16, ["options", "is-loading", "is-open", "query"]));
|
|
1563
|
-
}
|
|
1564
|
-
}), ts = ["aria-label"], In = /* @__PURE__ */ k({
|
|
1565
|
-
__name: "MultiSelect",
|
|
1566
|
-
props: /* @__PURE__ */ I(Ve, {
|
|
1567
|
-
modelValue: {},
|
|
1568
|
-
modelModifiers: {}
|
|
1569
|
-
}),
|
|
1570
|
-
emits: /* @__PURE__ */ I(["update:modelValue", "change", "clear", "focus", "blur"], ["update:modelValue"]),
|
|
1571
|
-
setup(e, { emit: t }) {
|
|
1572
|
-
const o = x(!1), n = e, l = t, a = F(e, "modelValue"), c = (C) => {
|
|
1573
|
-
l("change", C);
|
|
1574
|
-
}, d = ye(n), { options: p } = d;
|
|
1575
|
-
j(
|
|
1576
|
-
() => n.options,
|
|
1577
|
-
() => {
|
|
1578
|
-
d.setOptions(n.options);
|
|
1579
|
-
},
|
|
1580
|
-
{ immediate: !0 }
|
|
1581
|
-
);
|
|
1582
|
-
const i = v(
|
|
1583
|
-
() => a.value ? d.getLabels(...a.value).join(", ") : void 0
|
|
1584
|
-
), s = v(
|
|
1585
|
-
() => d.getValues(...a.value ?? [])
|
|
1586
|
-
), m = (C) => {
|
|
1587
|
-
let T = a.value ?? [];
|
|
1588
|
-
if (D(C))
|
|
1589
|
-
T = T.filter(
|
|
1590
|
-
(W) => d.getOption(W)?.value !== C.value
|
|
1591
|
-
);
|
|
1592
|
-
else {
|
|
1593
|
-
const W = d.getOriginal(C);
|
|
1594
|
-
T.push(W);
|
|
1595
|
-
}
|
|
1596
|
-
a.value = T, c(T);
|
|
1597
|
-
}, b = () => {
|
|
1598
|
-
o.value = !1, a.value = [], c([]);
|
|
1599
|
-
}, h = () => {
|
|
1600
|
-
o.value = !1;
|
|
1601
|
-
}, D = (C) => s.value?.includes(C.value) ?? !1, H = v(() => ae(n.styles)), A = v(
|
|
1602
|
-
() => U(H.value.control.select, n)
|
|
1603
|
-
);
|
|
1604
|
-
return (C, T) => (r(), y(he, B(n, {
|
|
1605
|
-
options: g(p),
|
|
1606
|
-
"is-open": o.value,
|
|
1607
|
-
disabled: !C.enabled,
|
|
1608
|
-
query: i.value,
|
|
1609
|
-
"is-active": D,
|
|
1610
|
-
onClose: h,
|
|
1611
|
-
onSelect: m,
|
|
1612
|
-
onClear: b
|
|
1613
|
-
}), {
|
|
1614
|
-
default: S(() => [
|
|
1615
|
-
u("button", {
|
|
1616
|
-
type: "button",
|
|
1617
|
-
class: $(["truncate block text-left", [A.value, C.width]]),
|
|
1618
|
-
"aria-label": C.id,
|
|
1619
|
-
role: "combobox",
|
|
1620
|
-
onClick: T[0] || (T[0] = (W) => o.value = !0)
|
|
1621
|
-
}, w(i.value ?? "Select value"), 11, ts)
|
|
1622
|
-
]),
|
|
1623
|
-
_: 1
|
|
1624
|
-
}, 16, ["options", "is-open", "disabled", "query"]));
|
|
1625
|
-
}
|
|
1626
|
-
}), os = ["change"], ss = {
|
|
1627
|
-
...K,
|
|
1628
|
-
width: { type: String, default: "w-48" },
|
|
1629
|
-
minHeight: { type: String, default: "min-h-[50vh]" },
|
|
1630
|
-
actions: {
|
|
1631
|
-
type: Object,
|
|
1632
|
-
default: () => [
|
|
1633
|
-
{
|
|
1634
|
-
label: "<strong>B</strong>",
|
|
1635
|
-
name: "bold",
|
|
1636
|
-
action: (e) => e?.chain().focus().toggleBold().run()
|
|
1637
|
-
},
|
|
1638
|
-
{
|
|
1639
|
-
label: "<em>I</em>",
|
|
1640
|
-
name: "italic",
|
|
1641
|
-
action: (e) => e?.chain().focus().toggleItalic().run()
|
|
1642
|
-
}
|
|
1643
|
-
]
|
|
1644
|
-
}
|
|
1645
|
-
}, ns = ["aria-label"], ls = { class: "flex items-center gap-1 px-3 py-2 border-b border-base-300 bg-base-200" }, as = ["title", "onClick"], rs = ["innerHTML"], is = { class: "card-body p-3" }, Dn = /* @__PURE__ */ k({
|
|
1646
|
-
__name: "Markdown",
|
|
1647
|
-
props: /* @__PURE__ */ I(ss, {
|
|
1648
|
-
modelValue: {},
|
|
1649
|
-
modelModifiers: {}
|
|
1650
|
-
}),
|
|
1651
|
-
emits: /* @__PURE__ */ I(os, ["update:modelValue"]),
|
|
1652
|
-
setup(e, { emit: t }) {
|
|
1653
|
-
const o = e, n = t, l = F(e, "modelValue"), a = it({
|
|
1654
|
-
content: l.value ?? "",
|
|
1655
|
-
extensions: [
|
|
1656
|
-
rt.configure({
|
|
1657
|
-
heading: !1,
|
|
1658
|
-
blockquote: !1,
|
|
1659
|
-
bulletList: !1,
|
|
1660
|
-
orderedList: !1,
|
|
1661
|
-
listItem: !1,
|
|
1662
|
-
code: !1,
|
|
1663
|
-
codeBlock: !1,
|
|
1664
|
-
horizontalRule: !1,
|
|
1665
|
-
hardBreak: !1
|
|
1666
|
-
}),
|
|
1667
|
-
ct.configure({
|
|
1668
|
-
html: !1,
|
|
1669
|
-
transformPastedText: !0
|
|
1670
|
-
// parse markdown on paste
|
|
1671
|
-
})
|
|
1672
|
-
],
|
|
1673
|
-
onUpdate({ editor: c }) {
|
|
1674
|
-
const d = c.storage.markdown.getMarkdown();
|
|
1675
|
-
l.value = d, n("change", d);
|
|
1676
|
-
}
|
|
1677
|
-
});
|
|
1678
|
-
return Ee(() => {
|
|
1679
|
-
a.value?.destroy();
|
|
1680
|
-
}), (c, d) => (r(), y(Z, ee(te(o)), {
|
|
1681
|
-
default: S(() => [
|
|
1682
|
-
u("div", {
|
|
1683
|
-
class: $([[c.minHeight], "card bg-base-100 border border-base-300 w-full"]),
|
|
1684
|
-
"aria-label": c.id,
|
|
1685
|
-
role: "textbox"
|
|
1686
|
-
}, [
|
|
1687
|
-
u("div", ls, [
|
|
1688
|
-
(r(!0), f(L, null, M(c.actions, (p) => (r(), f("button", {
|
|
1689
|
-
key: p.name,
|
|
1690
|
-
tabindex: "-1",
|
|
1691
|
-
type: "button",
|
|
1692
|
-
class: $(["btn btn-sm btn-ghost", { "btn-active": g(a)?.isActive(p.name) }]),
|
|
1693
|
-
title: p.label,
|
|
1694
|
-
onClick: (i) => p.action(g(a))
|
|
1695
|
-
}, [
|
|
1696
|
-
u("span", {
|
|
1697
|
-
innerHTML: p.label
|
|
1698
|
-
}, null, 8, rs)
|
|
1699
|
-
], 10, as))), 128))
|
|
1700
|
-
]),
|
|
1701
|
-
u("div", is, [
|
|
1702
|
-
V(g(ut), {
|
|
1703
|
-
editor: g(a),
|
|
1704
|
-
class: "prose prose-sm max-w-none h-full"
|
|
1705
|
-
}, null, 8, ["editor"])
|
|
1706
|
-
])
|
|
1707
|
-
], 10, ns)
|
|
1708
|
-
]),
|
|
1709
|
-
_: 1
|
|
1710
|
-
}, 16));
|
|
1711
|
-
}
|
|
1712
|
-
}), us = {
|
|
1713
|
-
...K
|
|
1714
|
-
}, cs = ["change", "focus", "blur"], ds = { class: "flex items-center justify-center h-full" }, ps = { class: "fieldset-label" }, fs = ["aria-label", "disabled"], ms = { class: "font-bold text-gray-500 text-sm" }, Rn = /* @__PURE__ */ k({
|
|
1715
|
-
__name: "Checkbox",
|
|
1716
|
-
props: /* @__PURE__ */ I(us, {
|
|
1717
|
-
modelValue: {},
|
|
1718
|
-
modelModifiers: {}
|
|
1719
|
-
}),
|
|
1720
|
-
emits: /* @__PURE__ */ I(cs, ["update:modelValue"]),
|
|
1721
|
-
setup(e, { emit: t }) {
|
|
1722
|
-
const o = e, n = t, l = F(e, "modelValue"), a = (i) => {
|
|
1723
|
-
n("change", l.value);
|
|
1724
|
-
}, c = (i) => {
|
|
1725
|
-
n("focus", i);
|
|
1726
|
-
}, d = (i) => {
|
|
1727
|
-
n("blur", i);
|
|
1728
|
-
}, p = v(
|
|
1729
|
-
() => U(o.styles.control.checkbox, o)
|
|
1730
|
-
);
|
|
1731
|
-
return (i, s) => (r(), f("div", ds, [
|
|
1732
|
-
V(Z, B(o, { "hide-label": !0 }), {
|
|
1733
|
-
default: S(() => [
|
|
1734
|
-
u("label", ps, [
|
|
1735
|
-
Y(u("input", {
|
|
1736
|
-
"onUpdate:modelValue": s[0] || (s[0] = (m) => l.value = m),
|
|
1737
|
-
"aria-label": i.id,
|
|
1738
|
-
role: "checkbox",
|
|
1739
|
-
type: "checkbox",
|
|
1740
|
-
class: $(p.value),
|
|
1741
|
-
disabled: !i.enabled,
|
|
1742
|
-
onChange: a,
|
|
1743
|
-
onFocus: c,
|
|
1744
|
-
onBlur: d
|
|
1745
|
-
}, null, 42, fs), [
|
|
1746
|
-
[Ce, l.value]
|
|
1747
|
-
]),
|
|
1748
|
-
u("span", ms, w(i.label), 1)
|
|
1749
|
-
])
|
|
1750
|
-
]),
|
|
1751
|
-
_: 1
|
|
1752
|
-
}, 16)
|
|
1753
|
-
]));
|
|
1754
|
-
}
|
|
1755
|
-
}), bs = {
|
|
1756
|
-
...K,
|
|
1757
|
-
type: { type: String, default: "text" }
|
|
1758
|
-
}, gs = ["change", "focus", "blur"], vs = ["aria-label", "type", "disabled", "autofocus", "placeholder"], Tn = /* @__PURE__ */ k({
|
|
1759
|
-
__name: "Input",
|
|
1760
|
-
props: /* @__PURE__ */ I(bs, {
|
|
1761
|
-
modelValue: {},
|
|
1762
|
-
modelModifiers: {}
|
|
1763
|
-
}),
|
|
1764
|
-
emits: /* @__PURE__ */ I(gs, ["update:modelValue"]),
|
|
1765
|
-
setup(e, { emit: t }) {
|
|
1766
|
-
const o = e, n = t, l = F(e, "modelValue"), a = (i) => {
|
|
1767
|
-
n("change", i);
|
|
1768
|
-
}, c = (i) => {
|
|
1769
|
-
n("focus", i);
|
|
1770
|
-
}, d = (i) => {
|
|
1771
|
-
n("blur", i);
|
|
1772
|
-
}, p = v(
|
|
1773
|
-
() => U(o.styles.control.input, o)
|
|
1774
|
-
);
|
|
1775
|
-
return (i, s) => (r(), y(Z, ee(te(o)), {
|
|
1776
|
-
default: S(() => [
|
|
1777
|
-
Y(u("input", {
|
|
1778
|
-
"onUpdate:modelValue": s[0] || (s[0] = (m) => l.value = m),
|
|
1779
|
-
"aria-label": i.id,
|
|
1780
|
-
autocomplete: "off",
|
|
1781
|
-
type: i.type,
|
|
1782
|
-
class: $(["w-full", p.value]),
|
|
1783
|
-
disabled: !i.enabled,
|
|
1784
|
-
autofocus: i.isFocused,
|
|
1785
|
-
placeholder: i.placeholder,
|
|
1786
|
-
onChange: a,
|
|
1787
|
-
onFocus: c,
|
|
1788
|
-
onBlur: d
|
|
1789
|
-
}, null, 42, vs), [
|
|
1790
|
-
[ze, l.value]
|
|
1791
|
-
])
|
|
1792
|
-
]),
|
|
1793
|
-
_: 1
|
|
1794
|
-
}, 16));
|
|
1795
|
-
}
|
|
1796
|
-
}), hs = {
|
|
1797
|
-
...K,
|
|
1798
|
-
steps: { type: Number, default: 1 }
|
|
1799
|
-
}, ys = ["change", "focus", "blur"], ws = ["aria-label", "disabled", "step", "autofocus", "placeholder"], En = /* @__PURE__ */ k({
|
|
1800
|
-
__name: "InputNumber",
|
|
1801
|
-
props: /* @__PURE__ */ I(hs, {
|
|
1802
|
-
modelValue: {},
|
|
1803
|
-
modelModifiers: {}
|
|
1804
|
-
}),
|
|
1805
|
-
emits: /* @__PURE__ */ I(ys, ["update:modelValue"]),
|
|
1806
|
-
setup(e, { emit: t }) {
|
|
1807
|
-
const o = e, n = t, l = F(e, "modelValue"), a = (i) => {
|
|
1808
|
-
n("change", i);
|
|
1809
|
-
}, c = (i) => {
|
|
1810
|
-
n("focus", i);
|
|
1811
|
-
}, d = (i) => {
|
|
1812
|
-
n("blur", i);
|
|
1813
|
-
}, p = v(
|
|
1814
|
-
() => U(o.styles?.control?.input, o)
|
|
1815
|
-
);
|
|
1816
|
-
return (i, s) => (r(), y(Z, ee(te(o)), {
|
|
1817
|
-
default: S(() => [
|
|
1818
|
-
Y(u("input", {
|
|
1819
|
-
"onUpdate:modelValue": s[0] || (s[0] = (m) => l.value = m),
|
|
1820
|
-
autocomplete: "off",
|
|
1821
|
-
"aria-label": i.id,
|
|
1822
|
-
type: "number",
|
|
1823
|
-
class: $(["w-full", [p.value]]),
|
|
1824
|
-
disabled: !i.enabled,
|
|
1825
|
-
step: i.steps,
|
|
1826
|
-
autofocus: i.isFocused,
|
|
1827
|
-
placeholder: i.placeholder,
|
|
1828
|
-
onChange: a,
|
|
1829
|
-
onFocus: c,
|
|
1830
|
-
onBlur: d
|
|
1831
|
-
}, null, 42, ws), [
|
|
1832
|
-
[Le, l.value]
|
|
1833
|
-
])
|
|
1834
|
-
]),
|
|
1835
|
-
_: 1
|
|
1836
|
-
}, 16));
|
|
1837
|
-
}
|
|
1838
|
-
}), ks = {
|
|
1839
|
-
...K,
|
|
1840
|
-
rows: { type: Number, default: 4 }
|
|
1841
|
-
}, _s = ["change", "focus", "blur"], $s = ["aria-label", "disabled", "rows", "autofocus", "placeholder"], zn = /* @__PURE__ */ k({
|
|
1842
|
-
__name: "Textarea",
|
|
1843
|
-
props: /* @__PURE__ */ I(ks, {
|
|
1844
|
-
modelValue: {},
|
|
1845
|
-
modelModifiers: {}
|
|
1846
|
-
}),
|
|
1847
|
-
emits: /* @__PURE__ */ I(_s, ["update:modelValue"]),
|
|
1848
|
-
setup(e, { emit: t }) {
|
|
1849
|
-
const o = e, n = t, l = F(e, "modelValue"), a = (i) => {
|
|
1850
|
-
n("change", i);
|
|
1851
|
-
}, c = (i) => {
|
|
1852
|
-
n("focus", i);
|
|
1853
|
-
}, d = (i) => {
|
|
1854
|
-
n("blur", i);
|
|
1855
|
-
}, p = v(
|
|
1856
|
-
() => U(o.styles.control.textarea, o)
|
|
1857
|
-
);
|
|
1858
|
-
return (i, s) => (r(), y(Z, ee(te(o)), {
|
|
1859
|
-
default: S(() => [
|
|
1860
|
-
Y(u("textarea", {
|
|
1861
|
-
"onUpdate:modelValue": s[0] || (s[0] = (m) => l.value = m),
|
|
1862
|
-
autocomplete: "off",
|
|
1863
|
-
type: "text",
|
|
1864
|
-
"aria-label": i.id,
|
|
1865
|
-
class: $(["w-full", p.value]),
|
|
1866
|
-
disabled: !i.enabled,
|
|
1867
|
-
rows: i.rows,
|
|
1868
|
-
autofocus: i.isFocused,
|
|
1869
|
-
placeholder: i.placeholder,
|
|
1870
|
-
onChange: a,
|
|
1871
|
-
onFocus: c,
|
|
1872
|
-
onBlur: d
|
|
1873
|
-
}, null, 42, $s), [
|
|
1874
|
-
[Le, l.value]
|
|
1875
|
-
])
|
|
1876
|
-
]),
|
|
1877
|
-
_: 1
|
|
1878
|
-
}, 16));
|
|
1879
|
-
}
|
|
1880
|
-
}), Cs = {
|
|
1881
|
-
widthLeft: { type: Number, default: 200 },
|
|
1882
|
-
widthRight: { type: Number, default: 200 },
|
|
1883
|
-
initialLeftOpen: { type: Boolean, default: !0 },
|
|
1884
|
-
initialRightOpen: { type: Boolean, default: !0 }
|
|
1885
|
-
}, xs = { class: "flex h-full overflow-hidden gap-2" }, Ls = {
|
|
1886
|
-
key: 0,
|
|
1887
|
-
id: "drawer-left",
|
|
1888
|
-
class: "min-h-0 relative flex-shrink-0 bg-white overflow-visible flex"
|
|
1889
|
-
}, Ss = ["aria-expanded", "aria-label"], Ps = { class: "flex-1 overflow-y-auto bg-white" }, Ms = {
|
|
1890
|
-
key: 1,
|
|
1891
|
-
class: "min-h-0 relative flex-shrink-0 bg-white overflow-visible flex"
|
|
1892
|
-
}, Bs = ["aria-expanded", "aria-label"], Nn = /* @__PURE__ */ k({
|
|
1893
|
-
__name: "drawer",
|
|
1894
|
-
props: Cs,
|
|
1895
|
-
setup(e) {
|
|
1896
|
-
const t = e, o = Se(), n = v(() => !!o["left-drawer"]), l = v(() => !!o["right-drawer"]), a = x({
|
|
1897
|
-
left: t.initialLeftOpen,
|
|
1898
|
-
right: t.initialRightOpen
|
|
1899
|
-
}), c = (d) => {
|
|
1900
|
-
a.value[d] = !a.value[d];
|
|
1901
|
-
};
|
|
1902
|
-
return (d, p) => (r(), f("main", xs, [
|
|
1903
|
-
n.value ? (r(), f("aside", Ls, [
|
|
1904
|
-
u("div", {
|
|
1905
|
-
id: "drawer-left-panel",
|
|
1906
|
-
style: X({ width: a.value.left ? d.widthLeft + "px" : "0px" }),
|
|
1907
|
-
class: "h-full overflow-hidden bg-white shadow-sm transition-[width] duration-300 ease-in-out"
|
|
1908
|
-
}, [
|
|
1909
|
-
u("div", {
|
|
1910
|
-
style: X({ width: d.widthLeft + "px" }),
|
|
1911
|
-
class: "h-full overflow-y-auto p-4"
|
|
1912
|
-
}, [
|
|
1913
|
-
P(d.$slots, "left-drawer")
|
|
1914
|
-
], 4)
|
|
1915
|
-
], 4),
|
|
1916
|
-
u("button", {
|
|
1917
|
-
"aria-expanded": a.value.left,
|
|
1918
|
-
"aria-controls": "drawer-left-panel",
|
|
1919
|
-
"aria-label": a.value.left ? "Collapse left panel" : "Expand left panel",
|
|
1920
|
-
class: "hover:bg-base-300 hover:text-base-content transition-colors cursor-pointer",
|
|
1921
|
-
onClick: p[0] || (p[0] = (i) => c("left"))
|
|
1922
|
-
}, [
|
|
1923
|
-
V(g(q), {
|
|
1924
|
-
size: "lg",
|
|
1925
|
-
icon: a.value.left ? g(R).ChevronLeft : g(R).ChevronRight
|
|
1926
|
-
}, null, 8, ["icon"])
|
|
1927
|
-
], 8, Ss)
|
|
1928
|
-
])) : _("", !0),
|
|
1929
|
-
u("div", Ps, [
|
|
1930
|
-
P(d.$slots, "default")
|
|
1931
|
-
]),
|
|
1932
|
-
l.value ? (r(), f("aside", Ms, [
|
|
1933
|
-
u("button", {
|
|
1934
|
-
"aria-expanded": a.value.right,
|
|
1935
|
-
"aria-controls": "drawer-right-panel",
|
|
1936
|
-
"aria-label": a.value.right ? "Collapse right panel" : "Expand right panel",
|
|
1937
|
-
class: "hover:bg-base-300 hover:text-base-content transition-colors cursor-pointer",
|
|
1938
|
-
onClick: p[1] || (p[1] = (i) => c("right"))
|
|
1939
|
-
}, [
|
|
1940
|
-
V(g(q), {
|
|
1941
|
-
size: "lg",
|
|
1942
|
-
icon: a.value.right ? g(R).ChevronRight : g(R).ChevronLeft
|
|
1943
|
-
}, null, 8, ["icon"])
|
|
1944
|
-
], 8, Bs),
|
|
1945
|
-
u("div", {
|
|
1946
|
-
id: "drawer-right-panel",
|
|
1947
|
-
style: X({ width: a.value.right ? d.widthRight + "px" : "0px" }),
|
|
1948
|
-
class: "h-full overflow-hidden bg-white shadow-sm transition-[width] duration-300 ease-in-out"
|
|
1949
|
-
}, [
|
|
1950
|
-
u("div", {
|
|
1951
|
-
style: X({ width: d.widthRight + "px" }),
|
|
1952
|
-
class: "h-full overflow-y-auto p-4"
|
|
1953
|
-
}, [
|
|
1954
|
-
P(d.$slots, "right-drawer")
|
|
1955
|
-
], 4)
|
|
1956
|
-
], 4)
|
|
1957
|
-
])) : _("", !0)
|
|
1958
|
-
]));
|
|
1959
|
-
}
|
|
1960
|
-
}), Vs = { class: "ml-1" }, As = { class: "truncate flex-1 min-w-0 text-left" }, Os = {
|
|
1961
|
-
key: 0,
|
|
1962
|
-
class: "badge badge-ghost badge-sm flex-shrink-0"
|
|
1963
|
-
}, Is = /* @__PURE__ */ k({
|
|
1964
|
-
__name: "TreeItem",
|
|
1965
|
-
props: {
|
|
1966
|
-
active: {},
|
|
1967
|
-
node: {},
|
|
1968
|
-
expanded: {},
|
|
1969
|
-
isExpanded: { type: Function }
|
|
1970
|
-
},
|
|
1971
|
-
emits: ["toggle", "select"],
|
|
1972
|
-
setup(e, { emit: t }) {
|
|
1973
|
-
const o = e, n = t, l = v(() => o.active === o.node.id);
|
|
1974
|
-
return (a, c) => {
|
|
1975
|
-
const d = ce("TreeItem", !0);
|
|
1976
|
-
return r(), f("li", Vs, [
|
|
1977
|
-
u("div", {
|
|
1978
|
-
class: $([
|
|
1979
|
-
`flex items-center gap-1 cursor-pointer rounded-md px-1 py-0.5
|
|
1980
|
-
hover:bg-gray-100`,
|
|
1981
|
-
l.value ? "text-primary" : ""
|
|
1982
|
-
])
|
|
1983
|
-
}, [
|
|
1984
|
-
(e.node?.children?.length ?? 0) > 0 ? (r(), f("span", {
|
|
1985
|
-
key: 0,
|
|
1986
|
-
class: "flex items-center justify-center",
|
|
1987
|
-
onClick: c[0] || (c[0] = (p) => n("toggle", e.node))
|
|
1988
|
-
}, [
|
|
1989
|
-
e.node.children && e.isExpanded(e.node.id) ? (r(), y(g(dt), {
|
|
1990
|
-
key: 0,
|
|
1991
|
-
class: "w-3 h-3"
|
|
1992
|
-
})) : (r(), y(g(pt), {
|
|
1993
|
-
key: 1,
|
|
1994
|
-
class: "w-3 h-3"
|
|
1995
|
-
}))
|
|
1996
|
-
])) : _("", !0),
|
|
1997
|
-
u("div", {
|
|
1998
|
-
class: "flex items-center gap-2 w-full min-w-0",
|
|
1999
|
-
onClick: c[1] || (c[1] = (p) => n("select", e.node))
|
|
2000
|
-
}, [
|
|
2001
|
-
u("div", As, w(e.node.label), 1),
|
|
2002
|
-
e.node.tag ? (r(), f("div", Os, w(e.node.tag), 1)) : _("", !0)
|
|
2003
|
-
])
|
|
2004
|
-
], 2),
|
|
2005
|
-
e.node.children && e.isExpanded(e.node.id) ? (r(), f("ul", {
|
|
2006
|
-
key: 0,
|
|
2007
|
-
class: $([
|
|
2008
|
-
"ml-4 border-l pl-2",
|
|
2009
|
-
{ "border-gray-200": !l.value, "border-primary": l.value }
|
|
2010
|
-
])
|
|
2011
|
-
}, [
|
|
2012
|
-
(r(!0), f(L, null, M(e.node.children, (p) => (r(), y(d, {
|
|
2013
|
-
key: p.id,
|
|
2014
|
-
node: p,
|
|
2015
|
-
expanded: e.expanded,
|
|
2016
|
-
active: e.active,
|
|
2017
|
-
"is-expanded": e.isExpanded,
|
|
2018
|
-
onToggle: c[2] || (c[2] = (i) => n("toggle", i)),
|
|
2019
|
-
onSelect: c[3] || (c[3] = (i) => n("select", i))
|
|
2020
|
-
}, null, 8, ["node", "expanded", "active", "is-expanded"]))), 128))
|
|
2021
|
-
], 2)) : _("", !0)
|
|
2022
|
-
]);
|
|
2023
|
-
};
|
|
2024
|
-
}
|
|
2025
|
-
}), Ds = { class: "select-none text-sm" }, qn = /* @__PURE__ */ k({
|
|
2026
|
-
__name: "TreeView",
|
|
2027
|
-
props: {
|
|
2028
|
-
data: {},
|
|
2029
|
-
active: {}
|
|
2030
|
-
},
|
|
2031
|
-
emits: ["select"],
|
|
2032
|
-
setup(e, { emit: t }) {
|
|
2033
|
-
const o = e, n = t, l = x(/* @__PURE__ */ new Set()), a = (p) => {
|
|
2034
|
-
const i = p.id;
|
|
2035
|
-
if (!p.children || p.children.length === 0) {
|
|
2036
|
-
n("select", p);
|
|
2037
|
-
return;
|
|
2038
|
-
}
|
|
2039
|
-
l.value.has(i) ? l.value.delete(i) : l.value.add(i);
|
|
2040
|
-
}, c = (p) => {
|
|
2041
|
-
n("select", p), l.value.add(p.id);
|
|
2042
|
-
}, d = (p) => l.value.has(p);
|
|
2043
|
-
return (p, i) => (r(), f("ul", Ds, [
|
|
2044
|
-
(r(!0), f(L, null, M(o.data, (s) => (r(), y(Is, {
|
|
2045
|
-
key: s.id,
|
|
2046
|
-
node: s,
|
|
2047
|
-
expanded: l.value,
|
|
2048
|
-
active: e.active,
|
|
2049
|
-
"is-expanded": d,
|
|
2050
|
-
onToggle: a,
|
|
2051
|
-
onSelect: c
|
|
2052
|
-
}, null, 8, ["node", "expanded", "active"]))), 128))
|
|
2053
|
-
]));
|
|
2054
|
-
}
|
|
2055
|
-
}), Rs = {
|
|
2056
|
-
key: 0,
|
|
2057
|
-
role: "status",
|
|
2058
|
-
"aria-live": "polite",
|
|
2059
|
-
class: "flex items-center justify-center h-20"
|
|
2060
|
-
}, jn = /* @__PURE__ */ k({
|
|
2061
|
-
__name: "loading",
|
|
2062
|
-
props: {
|
|
2063
|
-
loading: { type: Boolean }
|
|
2064
|
-
},
|
|
2065
|
-
setup(e) {
|
|
2066
|
-
return (t, o) => e.loading ? (r(), f("div", Rs, [...o[0] || (o[0] = [
|
|
2067
|
-
u("span", {
|
|
2068
|
-
"aria-hidden": "true",
|
|
2069
|
-
class: "loading loading-bars loading-md text-primary"
|
|
2070
|
-
}, null, -1),
|
|
2071
|
-
u("span", { class: "sr-only" }, "Loading...", -1)
|
|
2072
|
-
])])) : _("", !0);
|
|
2073
|
-
}
|
|
2074
|
-
}), Ts = {
|
|
2075
|
-
title: { type: String, required: !0 },
|
|
2076
|
-
opened: { type: Boolean, default: !0 },
|
|
2077
|
-
heightFull: { type: Boolean, default: !1 },
|
|
2078
|
-
scrollable: { type: Boolean, default: !1 },
|
|
2079
|
-
disabled: { type: Boolean, default: !1 },
|
|
2080
|
-
actions: {
|
|
2081
|
-
type: Array,
|
|
2082
|
-
default: () => []
|
|
2083
|
-
}
|
|
2084
|
-
}, Es = ["checked", "aria-label"], zs = { class: "collapse-title text-gray-500 text-xs font-medium" }, Ns = { class: "flex items-center justify-between" }, qs = {
|
|
2085
|
-
key: 0,
|
|
2086
|
-
class: "list bg-base-100"
|
|
2087
|
-
}, js = {
|
|
2088
|
-
key: 1,
|
|
2089
|
-
class: "shrink-0 pt-2"
|
|
2090
|
-
}, Fs = /* @__PURE__ */ k({
|
|
2091
|
-
__name: "Collapse",
|
|
2092
|
-
props: Ts,
|
|
2093
|
-
setup(e) {
|
|
2094
|
-
const t = Se(), o = e, n = x(o.opened), l = x(o.opened || o.disabled);
|
|
2095
|
-
return (a, c) => (r(), f("div", {
|
|
2096
|
-
class: $(["collapse collapse-arrow bg-white border border-gray-300", [
|
|
2097
|
-
a.scrollable ? "flex-1 min-h-0 !grid-rows-[auto_1fr] overflow-hidden" : "",
|
|
2098
|
-
a.heightFull ? "h-full" : "",
|
|
2099
|
-
a.disabled ? "collapse-open" : "",
|
|
2100
|
-
l.value && !a.scrollable ? "overflow-visible" : ""
|
|
2101
|
-
]])
|
|
2102
|
-
}, [
|
|
2103
|
-
a.disabled ? _("", !0) : (r(), f("input", {
|
|
2104
|
-
key: 0,
|
|
2105
|
-
type: "checkbox",
|
|
2106
|
-
checked: n.value,
|
|
2107
|
-
tabindex: "-1",
|
|
2108
|
-
"aria-label": "Toggle " + a.title,
|
|
2109
|
-
onChange: c[0] || (c[0] = (d) => l.value = d.target.checked)
|
|
2110
|
-
}, null, 40, Es)),
|
|
2111
|
-
u("div", zs, [
|
|
2112
|
-
u("div", Ns, [
|
|
2113
|
-
u("span", null, w(a.title), 1),
|
|
2114
|
-
o.actions.length > 0 ? (r(), f("div", {
|
|
2115
|
-
key: 0,
|
|
2116
|
-
class: "relative z-10 flex gap-1 overflow-y-auto",
|
|
2117
|
-
onClick: c[1] || (c[1] = le(() => {
|
|
2118
|
-
}, ["stop"]))
|
|
2119
|
-
}, [
|
|
2120
|
-
(r(!0), f(L, null, M(o.actions, (d, p) => (r(), y(g(N), {
|
|
2121
|
-
key: p,
|
|
2122
|
-
color: g(z).blank,
|
|
2123
|
-
size: "xs",
|
|
2124
|
-
icon: d.icon,
|
|
2125
|
-
tooltip: d.tooltip,
|
|
2126
|
-
disabled: d.disabled,
|
|
2127
|
-
onClick: d.onClick
|
|
2128
|
-
}, {
|
|
2129
|
-
default: S(() => [
|
|
2130
|
-
E(w(d.label), 1)
|
|
2131
|
-
]),
|
|
2132
|
-
_: 2
|
|
2133
|
-
}, 1032, ["color", "icon", "tooltip", "disabled", "onClick"]))), 128))
|
|
2134
|
-
])) : _("", !0)
|
|
2135
|
-
])
|
|
2136
|
-
]),
|
|
2137
|
-
u("div", {
|
|
2138
|
-
class: $(["collapse-content", [
|
|
2139
|
-
a.scrollable ? "!flex !flex-col min-h-0" : "",
|
|
2140
|
-
g(t).list ? "p-0" : ""
|
|
2141
|
-
]])
|
|
2142
|
-
}, [
|
|
2143
|
-
u("div", {
|
|
2144
|
-
class: $(a.scrollable ? "flex-1 min-h-0 overflow-y-auto" : "")
|
|
2145
|
-
}, [
|
|
2146
|
-
P(a.$slots, "default")
|
|
2147
|
-
], 2),
|
|
2148
|
-
g(t).list ? (r(), f("ul", qs, [
|
|
2149
|
-
P(a.$slots, "list")
|
|
2150
|
-
])) : _("", !0),
|
|
2151
|
-
g(t).footer ? (r(), f("div", js, [
|
|
2152
|
-
P(a.$slots, "footer")
|
|
2153
|
-
])) : _("", !0)
|
|
2154
|
-
], 2)
|
|
2155
|
-
], 2));
|
|
2156
|
-
}
|
|
2157
|
-
}), Ks = {
|
|
2158
|
-
title: { type: String },
|
|
2159
|
-
label: { type: String },
|
|
2160
|
-
labelLink: { type: String },
|
|
2161
|
-
description: { type: String },
|
|
2162
|
-
descriptionLink: { type: String }
|
|
2163
|
-
}, Us = { class: "list-row" }, Hs = { class: "list-col-grow" }, Ws = { key: 0 }, Gs = {
|
|
2164
|
-
key: 1,
|
|
2165
|
-
class: "text-xs text-gray-600"
|
|
2166
|
-
}, Xs = ["href"], Zs = { key: 1 }, Js = {
|
|
2167
|
-
key: 0,
|
|
2168
|
-
class: "text-xs text-gray-500"
|
|
2169
|
-
}, Qs = ["href"], Ys = { key: 1 }, Fn = /* @__PURE__ */ k({
|
|
2170
|
-
__name: "CollapseRow",
|
|
2171
|
-
props: Ks,
|
|
2172
|
-
setup(e) {
|
|
2173
|
-
return (t, o) => (r(), f("li", Us, [
|
|
2174
|
-
u("div", Hs, [
|
|
2175
|
-
t.title ? (r(), f("div", Ws, w(t.title), 1)) : _("", !0),
|
|
2176
|
-
t.description || t.descriptionLink ? (r(), f("div", Gs, [
|
|
2177
|
-
t.descriptionLink ? (r(), f("a", {
|
|
2178
|
-
key: 0,
|
|
2179
|
-
href: t.descriptionLink,
|
|
2180
|
-
target: "_blank"
|
|
2181
|
-
}, w(t.description ?? t.descriptionLink), 9, Xs)) : (r(), f("span", Zs, w(t.description), 1))
|
|
2182
|
-
])) : _("", !0)
|
|
2183
|
-
]),
|
|
2184
|
-
t.label ? (r(), f("div", Js, [
|
|
2185
|
-
t.labelLink ? (r(), f("a", {
|
|
2186
|
-
key: 0,
|
|
2187
|
-
href: t.labelLink,
|
|
2188
|
-
target: "_blank"
|
|
2189
|
-
}, w(t.label), 9, Qs)) : (r(), f("span", Ys, w(t.label), 1))
|
|
2190
|
-
])) : _("", !0),
|
|
2191
|
-
P(t.$slots, "default")
|
|
2192
|
-
]));
|
|
2193
|
-
}
|
|
2194
|
-
}), en = { class: "text-gray-800" }, Kn = /* @__PURE__ */ k({
|
|
2195
|
-
__name: "alert",
|
|
2196
|
-
props: {
|
|
2197
|
-
message: {},
|
|
2198
|
-
type: {}
|
|
2199
|
-
},
|
|
2200
|
-
setup(e) {
|
|
2201
|
-
const t = {
|
|
2202
|
-
success: "alert-success",
|
|
2203
|
-
error: "alert-error",
|
|
2204
|
-
warning: "alert-warning",
|
|
2205
|
-
info: "alert-info"
|
|
2206
|
-
};
|
|
2207
|
-
return (o, n) => (r(), f("div", {
|
|
2208
|
-
role: "alert",
|
|
2209
|
-
class: $(`alert alert-soft ${t[e.type]} `)
|
|
2210
|
-
}, [
|
|
2211
|
-
u("span", en, w(e.message), 1),
|
|
2212
|
-
P(o.$slots, "default")
|
|
2213
|
-
], 2));
|
|
2214
|
-
}
|
|
2215
|
-
}), tn = {
|
|
2216
|
-
title: { type: String, required: !0 },
|
|
2217
|
-
items: {
|
|
2218
|
-
type: Array,
|
|
2219
|
-
required: !0
|
|
2220
|
-
},
|
|
2221
|
-
modelValue: {
|
|
2222
|
-
type: Array,
|
|
2223
|
-
default: () => []
|
|
2224
|
-
},
|
|
2225
|
-
labelKey: { type: String, default: "label" },
|
|
2226
|
-
valueKey: { type: String, default: "id" },
|
|
2227
|
-
colorKey: { type: String, default: void 0 },
|
|
2228
|
-
countKey: { type: String, default: "count" },
|
|
2229
|
-
counts: {
|
|
2230
|
-
type: Object,
|
|
2231
|
-
default: void 0
|
|
2232
|
-
},
|
|
2233
|
-
opened: { type: Boolean, default: !0 }
|
|
2234
|
-
}, on = ["update:modelValue"], sn = (e, t, o, n) => {
|
|
2235
|
-
const l = v(
|
|
2236
|
-
() => e.value.map((s) => s[o.value])
|
|
2237
|
-
), a = (s) => t.value.includes(s), c = v(() => {
|
|
2238
|
-
const s = t.value.length;
|
|
2239
|
-
return s === 0 ? "None" : s === l.value.length ? "All" : `${s}`;
|
|
2240
|
-
});
|
|
2241
|
-
return { isSelected: a, selectedLabel: c, selectAll: () => n("update:modelValue", [...l.value]), selectNone: () => n("update:modelValue", []), toggleItem: (s, m) => {
|
|
2242
|
-
m ? n("update:modelValue", [...t.value, s]) : n(
|
|
2243
|
-
"update:modelValue",
|
|
2244
|
-
t.value.filter((b) => b !== s)
|
|
2245
|
-
);
|
|
2246
|
-
} };
|
|
2247
|
-
}, nn = { class: "flex items-center justify-between mb-2" }, ln = { class: "text-xs text-base-content/50" }, an = { class: "flex gap-1" }, rn = { class: "flex flex-col gap-1" }, un = ["checked", "onChange"], cn = { class: "text-sm flex-1 select-none" }, dn = {
|
|
2248
|
-
key: 1,
|
|
2249
|
-
class: "badge badge-sm badge-ghost"
|
|
2250
|
-
}, Un = /* @__PURE__ */ k({
|
|
2251
|
-
__name: "filter",
|
|
2252
|
-
props: tn,
|
|
2253
|
-
emits: on,
|
|
2254
|
-
setup(e, { emit: t }) {
|
|
2255
|
-
const o = e, n = t, l = v(() => o.items ?? []), { isSelected: a, selectedLabel: c, selectAll: d, selectNone: p, toggleItem: i } = sn(l, we(o, "modelValue"), we(o, "valueKey"), n);
|
|
2256
|
-
return (s, m) => (r(), y(g(Fs), {
|
|
2257
|
-
title: s.title,
|
|
2258
|
-
opened: s.opened
|
|
2259
|
-
}, {
|
|
2260
|
-
default: S(() => [
|
|
2261
|
-
u("div", nn, [
|
|
2262
|
-
u("span", ln, w(g(c)) + " of " + w(l.value.length) + " items ", 1),
|
|
2263
|
-
u("div", an, [
|
|
2264
|
-
u("button", {
|
|
2265
|
-
class: "btn btn-ghost btn-xs",
|
|
2266
|
-
type: "button",
|
|
2267
|
-
tabindex: "-1",
|
|
2268
|
-
onClick: m[0] || (m[0] = //@ts-ignore
|
|
2269
|
-
(...b) => g(d) && g(d)(...b))
|
|
2270
|
-
}, " All "),
|
|
2271
|
-
u("button", {
|
|
2272
|
-
class: "btn btn-ghost btn-xs",
|
|
2273
|
-
type: "button",
|
|
2274
|
-
tabindex: "-1",
|
|
2275
|
-
onClick: m[1] || (m[1] = //@ts-ignore
|
|
2276
|
-
(...b) => g(p) && g(p)(...b))
|
|
2277
|
-
}, " None ")
|
|
2278
|
-
])
|
|
2279
|
-
]),
|
|
2280
|
-
u("div", rn, [
|
|
2281
|
-
(r(!0), f(L, null, M(l.value, (b) => (r(), f("label", {
|
|
2282
|
-
key: b[s.valueKey],
|
|
2283
|
-
class: $(["flex items-center gap-3 px-2 py-1.5 rounded-lg cursor-pointer transition-colors hover:bg-base-200", { "bg-base-200/60": g(a)(b[s.valueKey]) }])
|
|
2284
|
-
}, [
|
|
2285
|
-
u("input", {
|
|
2286
|
-
type: "checkbox",
|
|
2287
|
-
class: "checkbox checkbox-sm",
|
|
2288
|
-
checked: g(a)(b[s.valueKey]),
|
|
2289
|
-
onChange: (h) => g(i)(
|
|
2290
|
-
b[s.valueKey],
|
|
2291
|
-
h.target.checked
|
|
2292
|
-
)
|
|
2293
|
-
}, null, 40, un),
|
|
2294
|
-
s.colorKey && b[s.colorKey] ? (r(), f("span", {
|
|
2295
|
-
key: 0,
|
|
2296
|
-
class: "w-3 h-3 rounded-full shrink-0 ring-1 ring-black/10",
|
|
2297
|
-
style: X({ backgroundColor: b[s.colorKey] })
|
|
2298
|
-
}, null, 4)) : _("", !0),
|
|
2299
|
-
u("span", cn, w(b[s.labelKey]), 1),
|
|
2300
|
-
b[s.countKey] > 0 ? (r(), f("span", dn, w(b[s.countKey]), 1)) : _("", !0)
|
|
2301
|
-
], 2))), 128))
|
|
2302
|
-
])
|
|
2303
|
-
]),
|
|
2304
|
-
_: 1
|
|
2305
|
-
}, 8, ["title", "opened"]));
|
|
2306
|
-
}
|
|
2307
|
-
});
|
|
1
|
+
import { s as e, t, B as o, u as r, v as i, w as n, a as l, b as p, c as d, d as u, e as c, f as C, g as m, a3 as B, x as M, C as S, y as g, z as E, h as T, A as b, _ as I, i as P, D as v, E as w, G as f, F as k, j as y, H as F, I as h, k as x, l as L, J as N, K as z, L as D, M as O, O as W, P as A, o as H, p as R, q as V, r as Y, Q as j, R as q, S as G, N as J, T as K, U as Q, V as U, W as X, X as Z, Y as _, Y as $, Z as aa, $ as sa, a0 as ea, a1 as ta, a2 as oa, a4 as ra, a5 as ia, a6 as na, a7 as la, a8 as pa, a9 as da, aa as ua, ab as ca } from "./index-WrdKkd9c.js";
|
|
2308
2
|
export {
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
3
|
+
e as Alert,
|
|
4
|
+
t as Autocomplete,
|
|
5
|
+
o as BadgeSize,
|
|
6
|
+
r as BooleanCell,
|
|
7
|
+
i as Btn,
|
|
8
|
+
n as BtnBadge,
|
|
9
|
+
l as BtnBadgeEmits,
|
|
10
|
+
p as BtnBadgeProperties,
|
|
11
|
+
d as BtnEmits,
|
|
12
|
+
u as BtnProperties,
|
|
13
|
+
c as ButtonSize,
|
|
14
|
+
C as ButtonTag,
|
|
15
|
+
m as ButtonType,
|
|
16
|
+
B as Card,
|
|
17
|
+
M as Checkbox,
|
|
18
|
+
S as ClickOutside,
|
|
19
|
+
g as Collapse,
|
|
20
|
+
E as CollapseRow,
|
|
21
|
+
T as Color,
|
|
22
|
+
b as ConfirmModal,
|
|
23
|
+
I as ControlWrapper,
|
|
24
|
+
P as ControlWrapperProperties,
|
|
25
|
+
v as Drawer,
|
|
26
|
+
w as Dropdown,
|
|
27
|
+
f as Filter,
|
|
28
|
+
k as FilterEmits,
|
|
29
|
+
y as FilterProperties,
|
|
30
|
+
F as Icon,
|
|
31
|
+
h as IconEnum,
|
|
32
|
+
x as IconMap,
|
|
33
|
+
L as IconProperties,
|
|
34
|
+
N as Input,
|
|
35
|
+
z as InputNumber,
|
|
36
|
+
D as Loading,
|
|
37
|
+
O as Markdown,
|
|
38
|
+
W as Menu,
|
|
39
|
+
A as Modal,
|
|
40
|
+
H as ModalEmits,
|
|
41
|
+
R as ModalProperties,
|
|
42
|
+
V as ModalService,
|
|
43
|
+
Y as ModalSize,
|
|
44
|
+
j as ModalWrapper,
|
|
45
|
+
q as MultiSelect,
|
|
46
|
+
G as NotificationMessage,
|
|
47
|
+
J as NotificationService,
|
|
48
|
+
K as Notifications,
|
|
49
|
+
Q as PaginationComponent,
|
|
50
|
+
U as SelectComponent,
|
|
51
|
+
X as ShellComponent,
|
|
52
|
+
Z as SubMenu,
|
|
53
|
+
_ as Table,
|
|
54
|
+
$ as TableComponent,
|
|
55
|
+
aa as TextCell,
|
|
56
|
+
sa as Textarea,
|
|
57
|
+
ea as TreeView,
|
|
58
|
+
ta as addClickOutsideEventListener,
|
|
59
|
+
oa as buildInputStyle,
|
|
60
|
+
ra as hasCustomEventListener,
|
|
61
|
+
ia as isDescriptionHidden,
|
|
62
|
+
na as mergeStyles,
|
|
63
|
+
la as myStyles,
|
|
64
|
+
pa as removeClickOutsideEventListener,
|
|
65
|
+
da as showErrors,
|
|
66
|
+
ua as useFilter,
|
|
67
|
+
ca as useFocusTrap
|
|
2372
68
|
};
|