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