@ghentcdh/ui 2.0.0 → 3.0.1

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