@ghentcdh/ui 0.2.2 → 0.4.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.
Files changed (64) hide show
  1. package/index.css +1 -1
  2. package/index.d.ts +1 -0
  3. package/index.esm.js +1653 -0
  4. package/index.js +7 -7
  5. package/package.json +21 -8
  6. package/button/btn-badge.vue.d.ts +0 -38
  7. package/button/btn.vue.d.ts +0 -44
  8. package/button/const.d.ts +0 -9
  9. package/button/index.d.ts +0 -2
  10. package/card/card.vue.d.ts +0 -20
  11. package/const/colors.d.ts +0 -8
  12. package/const/index.d.ts +0 -2
  13. package/const/size.d.ts +0 -3
  14. package/directives/click-outside.directive.d.ts +0 -6
  15. package/drawer/drawer.properties.d.ts +0 -0
  16. package/drawer/drawer.vue.d.ts +0 -26
  17. package/drawer/index.d.ts +0 -1
  18. package/form/AutoComplete.vue.d.ts +0 -33
  19. package/form/MultiSelect.vue.d.ts +0 -31
  20. package/form/SelectComponent.vue.d.ts +0 -32
  21. package/form/core/ControlWrapper.vue.d.ts +0 -30
  22. package/form/core/emits.d.ts +0 -5
  23. package/form/core/properties.d.ts +0 -32
  24. package/form/core/styles.d.ts +0 -7
  25. package/form/core/utils/style.d.ts +0 -2
  26. package/form/index.d.ts +0 -7
  27. package/icons/icon-list.d.ts +0 -22
  28. package/icons/icon.vue.d.ts +0 -8
  29. package/icons/index.d.ts +0 -2
  30. package/index.mjs +0 -1608
  31. package/loading/index.d.ts +0 -1
  32. package/loading/loading.vue.d.ts +0 -5
  33. package/menu/dropdown.vue.d.ts +0 -6
  34. package/menu/index.d.ts +0 -4
  35. package/menu/menu-item.vue.d.ts +0 -5
  36. package/menu/menu.type.d.ts +0 -15
  37. package/menu/menu.vue.d.ts +0 -7
  38. package/menu/sub-menu.vue.d.ts +0 -7
  39. package/modal/confirmModal.vue.d.ts +0 -10
  40. package/modal/index.d.ts +0 -5
  41. package/modal/modal.model.d.ts +0 -17
  42. package/modal/modal.service.d.ts +0 -15
  43. package/modal/modal.vue.d.ts +0 -39
  44. package/modal/modalWrapper.vue.d.ts +0 -2
  45. package/shell/menu.type.d.ts +0 -11
  46. package/shell/shell.component.vue.d.ts +0 -31
  47. package/table/cells/text.cell.vue.d.ts +0 -30
  48. package/table/header/sort.header.vue.d.ts +0 -12
  49. package/table/index.d.ts +0 -8
  50. package/table/pagination-button.component.vue.d.ts +0 -17
  51. package/table/pagination.component.vue.d.ts +0 -38
  52. package/table/table.component.vue.d.ts +0 -28
  53. package/table/table.model.d.ts +0 -10
  54. package/toast/index.d.ts +0 -3
  55. package/toast/notification-message.d.ts +0 -7
  56. package/toast/notification-message.vue.d.ts +0 -7
  57. package/toast/notification.service.d.ts +0 -24
  58. package/toast/notifications.vue.d.ts +0 -2
  59. package/tree/TreeItem.vue.d.ts +0 -15
  60. package/tree/TreeView.vue.d.ts +0 -7
  61. package/tree/index.d.ts +0 -1
  62. package/tree/props.d.ts +0 -13
  63. package/utils/hasCustomEventListener.d.ts +0 -1
  64. package/utils/index.d.ts +0 -1
package/index.mjs DELETED
@@ -1,1608 +0,0 @@
1
- import { defineComponent as g, createElementBlock as u, openBlock as l, unref as h, normalizeClass as w, createElementVNode as c, createBlock as f, createCommentVNode as y, toDisplayString as v, Fragment as k, renderList as x, mergeProps as P, computed as $, resolveComponent as oe, withCtx as T, createTextVNode as U, ref as R, watch as ne, onMounted as ke, renderSlot as z, resolveDynamicComponent as se, createVNode as B, normalizeStyle as J, getCurrentInstance as $e, toHandlerKey as me, camelize as Ce, mergeDefaults as X, mergeModels as E, useModel as le, normalizeProps as ae, guardReactiveProps as re, withDirectives as Q, vModelSelect as Le, inject as Me, resolveDirective as fe, vModelText as xe } from "vue";
2
- import { RouterLink as Be } from "vue-router";
3
- const M = (...e) => `<svg
4
- xmlns="http://www.w3.org/2000/svg"
5
- fill="none"
6
- viewBox="0 0 24 24"
7
- stroke-width="1.5"
8
- stroke="currentColor" >
9
- ${e.map(
10
- (o) => ` <path
11
- stroke-linejoin="round"
12
- stroke-linecap="round"
13
- d="${o}"
14
- />`
15
- ).join(`
16
- `)}
17
- </svg>`;
18
- var V = /* @__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.Check = "Check", e.View = "View", e.Text = "Text", e))(V || {});
19
- const Pe = {
20
- Edit: M(
21
- "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"
22
- ),
23
- Delete: M(
24
- "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"
25
- ),
26
- BarsArrowDown: M(
27
- "M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0-3.75-3.75M17.25 21 21 17.25"
28
- ),
29
- BarsArrowUp: M(
30
- "M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"
31
- ),
32
- Funnel: M(
33
- "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"
34
- ),
35
- Close: M("M6 18 18 6M6 6l12 12"),
36
- Plus: M("M12 9v6m3-3H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"),
37
- PaperClip: M(
38
- "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"
39
- ),
40
- Hamburger: M("M4 6h16M4 12h16M4 18h16"),
41
- ChevronDown: M(
42
- "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"
43
- ),
44
- ChevronUp: M(
45
- "M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z"
46
- ),
47
- Check: M("m4.5 12.75 6 6 9-13.5"),
48
- View: M(
49
- "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",
50
- "M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
51
- ),
52
- Text: M(
53
- "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"
54
- ),
55
- DblChevronLeft: M(
56
- "m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"
57
- ),
58
- DblChevronRight: M("m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5")
59
- }, De = ["innerHTML"], K = /* @__PURE__ */ g({
60
- __name: "icon",
61
- props: {
62
- icon: {},
63
- size: {}
64
- },
65
- setup(e) {
66
- return (t, o) => (l(), u("div", {
67
- class: w([
68
- {
69
- "w-full h-full": !t.size,
70
- "w-2 h-2": t.size === "xs",
71
- "w-4 h-4": t.size === "sm"
72
- }
73
- ]),
74
- innerHTML: h(Pe)[t.icon]
75
- }, null, 10, De));
76
- }
77
- }), Ae = { class: "dropdown dropdown-end" }, Te = {
78
- tabindex: "0",
79
- class: "menu dropdown-content bg-white z-1 mt-4 p-2 shadow-sm"
80
- }, ze = { class: "min-w-max flex-no-wrap text-black" }, ie = /* @__PURE__ */ g({
81
- __name: "sub-menu",
82
- props: {
83
- label: {},
84
- items: {},
85
- action: { type: Function },
86
- disabled: { type: Boolean },
87
- btnClass: {},
88
- disableArrow: { type: Boolean }
89
- },
90
- setup(e) {
91
- return (t, o) => (l(), u("div", Ae, [
92
- c("div", {
93
- tabindex: "0",
94
- role: "button",
95
- class: w([t.btnClass, "btn btn-ghost text-right flex-nowrap flex"])
96
- }, [
97
- c("span", null, v(t.label), 1),
98
- t.disableArrow ? y("", !0) : (l(), f(h(K), {
99
- key: 0,
100
- icon: h(V).ChevronDown,
101
- size: "sm"
102
- }, null, 8, ["icon"]))
103
- ], 2),
104
- c("ul", Te, [
105
- c("li", ze, [
106
- (l(!0), u(k, null, x(t.items, (s) => (l(), f(ve, P({
107
- key: s.label
108
- }, { ref_for: !0 }, s), null, 16))), 128))
109
- ])
110
- ])
111
- ]));
112
- }
113
- }), G = "btn btn-ghost text-left justify-between min-w-max font-normal", ve = /* @__PURE__ */ g({
114
- __name: "menu-item",
115
- props: {
116
- label: {},
117
- items: {},
118
- action: {},
119
- disabled: { type: Boolean, default: !1 }
120
- },
121
- setup(e) {
122
- const t = e, o = $(() => !t.disabled && t.action && "routerLink" in t.action), s = $(() => !t.disabled && t.action), n = $(() => {
123
- var r;
124
- return (r = t.items) == null ? void 0 : r.length;
125
- }), a = $(() => {
126
- const r = t.action;
127
- return r && "routerLink" in r && "params" in r ? {
128
- name: r.routerLink,
129
- params: r.params
130
- } : "";
131
- }), b = () => {
132
- var r;
133
- (r = t.action) == null || r.call(t);
134
- };
135
- return (r, d) => {
136
- const p = oe("RouterLink");
137
- return n.value ? (l(), f(ie, P({ key: 0 }, t, { "btn-class": G }), null, 16)) : o.value ? (l(), f(p, {
138
- key: 1,
139
- to: a.value,
140
- class: w(G),
141
- onClick: b
142
- }, {
143
- default: T(() => [
144
- U(v(r.label), 1)
145
- ]),
146
- _: 1
147
- }, 8, ["to"])) : s.value ? (l(), u("button", {
148
- key: 2,
149
- class: w(G),
150
- onClick: b
151
- }, v(r.label), 1)) : (l(), u("div", {
152
- key: 3,
153
- class: w([G, { "btn-disabled": r.disabled }])
154
- }, v(r.label), 3));
155
- };
156
- }
157
- }), Se = { class: "navbar bg-base-100 shadow-sm" }, Ve = { class: "flex-1" }, Ne = {
158
- key: 0,
159
- class: "breadcrumbs text-sm"
160
- }, Ue = { class: "flex grow justify-end px-2" }, Re = { class: "flex items-stretch" }, pn = /* @__PURE__ */ g({
161
- __name: "menu",
162
- props: {
163
- menu: {},
164
- breadcrumbs: {}
165
- },
166
- setup(e) {
167
- return (t, o) => {
168
- const s = oe("RouterLink");
169
- return l(), u("nav", Se, [
170
- c("div", Ve, [
171
- t.breadcrumbs ? (l(), u("div", Ne, [
172
- c("ul", null, [
173
- (l(!0), u(k, null, x(t.breadcrumbs, (n) => (l(), u("li", {
174
- key: n.label
175
- }, [
176
- n.routerLink ? (l(), f(s, {
177
- key: 0,
178
- to: { name: n.routerLink, params: n.params }
179
- }, {
180
- default: T(() => [
181
- U(v(n.label), 1)
182
- ]),
183
- _: 2
184
- }, 1032, ["to"])) : (l(), u(k, { key: 1 }, [
185
- U(v(n.label), 1)
186
- ], 64))
187
- ]))), 128))
188
- ])
189
- ])) : y("", !0)
190
- ]),
191
- c("div", Ue, [
192
- c("div", Re, [
193
- (l(!0), u(k, null, x(t.menu, (n) => (l(), f(ve, P({
194
- key: n.label
195
- }, { ref_for: !0 }, n), null, 16))), 128))
196
- ])
197
- ])
198
- ]);
199
- };
200
- }
201
- }), mn = /* @__PURE__ */ g({
202
- __name: "dropdown",
203
- props: {
204
- items: {}
205
- },
206
- setup(e) {
207
- const t = R(!0);
208
- return (o, s) => (l(), f(ie, {
209
- items: o.items,
210
- label: "test",
211
- open: t.value,
212
- "btn-class": "",
213
- "disable-arrow": !0
214
- }, null, 8, ["items", "open"]));
215
- }
216
- }), L = [];
217
- for (let e = 0; e < 256; ++e)
218
- L.push((e + 256).toString(16).slice(1));
219
- function Fe(e, t = 0) {
220
- return (L[e[t + 0]] + L[e[t + 1]] + L[e[t + 2]] + L[e[t + 3]] + "-" + L[e[t + 4]] + L[e[t + 5]] + "-" + L[e[t + 6]] + L[e[t + 7]] + "-" + L[e[t + 8]] + L[e[t + 9]] + "-" + L[e[t + 10]] + L[e[t + 11]] + L[e[t + 12]] + L[e[t + 13]] + L[e[t + 14]] + L[e[t + 15]]).toLowerCase();
221
- }
222
- let te;
223
- const He = new Uint8Array(16);
224
- function Ke() {
225
- if (!te) {
226
- if (typeof crypto > "u" || !crypto.getRandomValues)
227
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
228
- te = crypto.getRandomValues.bind(crypto);
229
- }
230
- return te(He);
231
- }
232
- const je = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), be = { randomUUID: je };
233
- function Y(e, t, o) {
234
- var n;
235
- if (be.randomUUID && !e)
236
- return be.randomUUID();
237
- e = e || {};
238
- const s = e.random ?? ((n = e.rng) == null ? void 0 : n.call(e)) ?? Ke();
239
- if (s.length < 16)
240
- throw new Error("Random bytes length must be >= 16");
241
- return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, Fe(s);
242
- }
243
- const Oe = { class: "font-bold" }, Ie = { class: "pt-4" }, qe = { class: "modal-action" }, Ee = /* @__PURE__ */ g({
244
- __name: "modal",
245
- props: {
246
- modalTitle: {},
247
- buttonLabel: {},
248
- buttonSaveLabel: {},
249
- data: {},
250
- open: { type: Boolean, default: !1 },
251
- disableClose: { type: Boolean, default: !1 },
252
- width: { default: "sm" }
253
- },
254
- emits: ["closeModal"],
255
- setup(e, { expose: t, emit: o }) {
256
- const s = {
257
- xs: "max-w-xs w-[50VW]",
258
- sm: "max-w-sm w-[50VW]",
259
- lg: "max-w-2xl w-[80VW]",
260
- xl: "max-w-[80VW] w-[80VW]"
261
- }, n = e, a = `modal_${Y()}`, b = o, r = () => {
262
- const p = document.getElementById(a);
263
- p == null || p.showModal();
264
- }, d = () => {
265
- const p = document.getElementById(a);
266
- p == null || p.close(), b("closeModal");
267
- };
268
- return t({ closeModal: d, openModal: r }), ne(
269
- () => n.open,
270
- (p, i, D) => {
271
- n.open ? r() : d();
272
- }
273
- ), ke(() => {
274
- n.open && r();
275
- }), (p, i) => (l(), u("dialog", {
276
- id: a,
277
- class: "modal"
278
- }, [
279
- c("div", {
280
- class: w(["modal-box bg-white", s[p.width]])
281
- }, [
282
- p.disableClose ? y("", !0) : (l(), u("button", {
283
- key: 0,
284
- type: "button",
285
- class: "btn btn-sm btn-circle btn-ghost absolute right-2 top-2",
286
- onClick: d
287
- }, " ✕ ")),
288
- c("h3", Oe, v(p.modalTitle), 1),
289
- c("div", Ie, [
290
- z(p.$slots, "content")
291
- ]),
292
- c("div", qe, [
293
- z(p.$slots, "actions")
294
- ])
295
- ], 2)
296
- ]));
297
- }
298
- });
299
- var ue = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(ue || {}), ge = /* @__PURE__ */ ((e) => (e.a = "a", e.button = "button", e))(ge || {}), I = /* @__PURE__ */ ((e) => (e.blank = "blank", e.primary = "primary", e.secondary = "secondary", e.error = "error", e))(I || {});
300
- const Ze = {
301
- blank: "btn-ghost",
302
- primary: "btn-primary",
303
- secondary: "btn-soft btn-primary",
304
- error: "btn-error text-white"
305
- }, We = {
306
- blank: "badge-ghost",
307
- primary: "badge-primary",
308
- secondary: "badge-soft badge-primary",
309
- error: "badge-error"
310
- }, Ge = {
311
- xs: "btn-xs",
312
- sm: "btn-sm",
313
- lg: "btn-sm",
314
- xl: "btn"
315
- }, Je = {
316
- xs: "badge-xs text-xxs",
317
- sm: "badge-sm text-xs",
318
- lg: "badge-sm text-xs",
319
- xl: "badge text-xs"
320
- }, q = /* @__PURE__ */ g({
321
- __name: "btn",
322
- props: {
323
- href: {},
324
- disabled: { type: Boolean, default: !1 },
325
- as: { default: ge.button },
326
- icon: {},
327
- type: { default: ue.button },
328
- outline: { type: Boolean, default: !1 },
329
- color: { default: I.primary },
330
- size: { default: "sm" },
331
- square: { type: Boolean, default: !1 }
332
- },
333
- emits: ["click"],
334
- setup(e, { emit: t }) {
335
- const o = e, s = t;
336
- return (n, a) => (l(), f(se(n.as), P({
337
- class: [
338
- "btn p-1 flex justify-center flex-nowrap",
339
- h(Ze)[n.color],
340
- h(Ge)[n.size],
341
- { "btn-outline": n.outline, "btn-square": n.square }
342
- ]
343
- }, o, {
344
- onClick: a[0] || (a[0] = (b) => s("click"))
345
- }), {
346
- default: T(() => [
347
- n.icon ? (l(), f(h(K), {
348
- key: 0,
349
- icon: n.icon,
350
- size: n.size
351
- }, null, 8, ["icon", "size"])) : y("", !0),
352
- z(n.$slots, "default")
353
- ]),
354
- _: 3
355
- }, 16, ["class"]));
356
- }
357
- }), Qe = ["type", "disabled"], bn = /* @__PURE__ */ g({
358
- __name: "btn-badge",
359
- props: {
360
- icon: { default: void 0 },
361
- type: { default: ue.button },
362
- color: { default: void 0 },
363
- disabled: { type: Boolean, default: !1 },
364
- size: { default: "sm" }
365
- },
366
- emits: ["click"],
367
- setup(e, { emit: t }) {
368
- const o = t;
369
- return (s, n) => (l(), u("button", {
370
- class: w(["badge gap-1", h(Je)[s.size], h(We)[s.color]]),
371
- type: s.type,
372
- disabled: s.disabled,
373
- onClick: n[0] || (n[0] = (a) => o("click"))
374
- }, [
375
- z(s.$slots, "default"),
376
- s.icon ? (l(), f(h(K), {
377
- key: 0,
378
- icon: s.icon,
379
- size: s.size
380
- }, null, 8, ["icon", "size"])) : y("", !0)
381
- ], 10, Qe));
382
- }
383
- }), Xe = /* @__PURE__ */ g({
384
- __name: "confirmModal",
385
- props: {
386
- title: {},
387
- message: {},
388
- confirmLabel: { default: "Ok" },
389
- cancelLabel: { default: "Cancel" }
390
- },
391
- emits: ["closeModal"],
392
- setup(e, { emit: t }) {
393
- const o = t, s = (n) => {
394
- o("closeModal", { confirmed: n });
395
- };
396
- return (n, a) => (l(), f(Ee, {
397
- "modal-title": n.title,
398
- open: !0,
399
- "disable-close": !0
400
- }, {
401
- content: T(() => [
402
- U(v(n.message), 1)
403
- ]),
404
- actions: T(() => [
405
- B(h(q), {
406
- color: h(I).secondary,
407
- outline: !0,
408
- onClick: a[0] || (a[0] = (b) => s(!1))
409
- }, {
410
- default: T(() => [
411
- U(v(n.cancelLabel), 1)
412
- ]),
413
- _: 1
414
- }, 8, ["color"]),
415
- B(h(q), {
416
- onClick: a[1] || (a[1] = (b) => s(!0))
417
- }, {
418
- default: T(() => [
419
- U(v(n.confirmLabel), 1)
420
- ]),
421
- _: 1
422
- })
423
- ]),
424
- _: 1
425
- }, 8, ["modal-title"]));
426
- }
427
- });
428
- class ce {
429
- constructor() {
430
- this.showModal = R(!1), this.modals = [];
431
- }
432
- openModal(t) {
433
- const o = t.props.onClose, s = Y(), n = t;
434
- t.props.onClose = (a) => {
435
- o(a), this.closeModal(s);
436
- }, n.id = s, this.modals = [...this.modals, n], this.showModal.value = Date.now();
437
- }
438
- closeModal(t) {
439
- this.modals = this.modals.filter((o) => o.id !== t), this.showModal.value = Date.now();
440
- }
441
- static showConfirm(t) {
442
- this.getInstance().openModal({
443
- component: Xe,
444
- props: t
445
- });
446
- }
447
- static openModal(t) {
448
- this.getInstance().openModal(t);
449
- }
450
- static getInstance() {
451
- return this.instance || (this.instance = new ce()), this.instance;
452
- }
453
- static closeAll() {
454
- this.instance.closeAll();
455
- }
456
- closeAll() {
457
- this.modals = [], this.showModal.value = !1;
458
- }
459
- }
460
- const Ye = /* @__PURE__ */ g({
461
- __name: "modalWrapper",
462
- setup(e) {
463
- const t = ce.getInstance(), o = $(() => t.showModal.value ? t.modals : []);
464
- return (s, n) => (l(!0), u(k, null, x(o.value, (a) => {
465
- var b;
466
- return l(), f(se(a == null ? void 0 : a.component), P({
467
- key: a.id,
468
- ref_for: !0
469
- }, a == null ? void 0 : a.props, {
470
- open: !0,
471
- onCloseModal: (b = a == null ? void 0 : a.props) == null ? void 0 : b.onClose
472
- }), null, 16, ["onCloseModal"]);
473
- }), 128));
474
- }
475
- }), et = /* @__PURE__ */ g({
476
- __name: "notification-message",
477
- props: {
478
- message: {},
479
- type: {}
480
- },
481
- setup(e) {
482
- const t = {
483
- success: "alert-success",
484
- error: "alert-error",
485
- warning: "alert-warning",
486
- info: "alert-info"
487
- };
488
- return (o, s) => (l(), u("div", {
489
- role: "alert",
490
- class: w(`alert ${t[o.type]} `)
491
- }, [
492
- c("span", null, v(o.message), 1)
493
- ], 2));
494
- }
495
- }), tt = 5e3;
496
- class de {
497
- constructor() {
498
- this.notifications = R([]), this.addNotification = (t, o = "info") => {
499
- const s = {
500
- id: Y(),
501
- duration: tt,
502
- message: t,
503
- type: o
504
- };
505
- this.notifications.value.push(s), this.removeNotificationAfterDuration(s);
506
- }, this.removeNotificationAfterDuration = (t) => {
507
- setTimeout(() => {
508
- this.removeNotification(t.id);
509
- }, t.duration);
510
- }, this.removeNotification = (t) => {
511
- this.notifications.value = this.notifications.value.filter((o) => o.id !== t);
512
- };
513
- }
514
- static getInstance() {
515
- return this.instance || (this.instance = new de()), this.instance;
516
- }
517
- static info(t) {
518
- this.getInstance().addNotification(t, "info");
519
- }
520
- static success(t) {
521
- this.getInstance().addNotification(t, "success");
522
- }
523
- static warning(t) {
524
- this.getInstance().addNotification(t, "warning");
525
- }
526
- static error(t) {
527
- this.getInstance().addNotification(t, "error");
528
- }
529
- static removeNotification(t) {
530
- this.getInstance().removeNotification(t);
531
- }
532
- }
533
- const nt = { class: "toast toast-top toast-center z-[999]" }, ot = /* @__PURE__ */ g({
534
- __name: "notifications",
535
- setup(e) {
536
- const t = de.getInstance();
537
- return (o, s) => (l(), u("div", nt, [
538
- (l(!0), u(k, null, x(h(t).notifications.value, (n) => (l(), f(et, P({
539
- key: n.id
540
- }, { ref_for: !0 }, n), null, 16))), 128))
541
- ]));
542
- }
543
- }), st = { class: "h-screen" }, lt = { class: "navbar bg-primary text-primary-content w-full z-100 sticky" }, at = { class: "navbar-start" }, rt = { class: "navbar-center" }, it = ["href"], ut = { class: "navbar-end" }, ct = { class: "menu h-full flex-col space-between m-0 overflow-y-auto" }, dt = { class: "flex-grow-1" }, pt = { class: "bg-base-200 p-4" }, mt = { class: "h-full" }, he = 64, hn = /* @__PURE__ */ g({
544
- __name: "shell.component",
545
- props: {
546
- title: {},
547
- menu: {},
548
- user: {},
549
- version: {},
550
- widthSidebar: { default: 300 }
551
- },
552
- emits: ["logout"],
553
- setup(e, { emit: t }) {
554
- const s = e, n = R(!1), a = () => {
555
- n.value = !n.value;
556
- }, b = t, r = $(() => s.user ? {
557
- label: s.user.name,
558
- items: [
559
- {
560
- label: "Logout",
561
- action: () => {
562
- b("logout");
563
- }
564
- }
565
- ]
566
- } : null);
567
- return (d, p) => (l(), u(k, null, [
568
- B(ot),
569
- B(h(Ye)),
570
- c("div", st, [
571
- c("header", null, [
572
- c("nav", lt, [
573
- c("div", at, [
574
- c("button", {
575
- "aria-label": "open sidebar",
576
- class: "btn btn-square btn-ghost p-1",
577
- onClick: a
578
- }, [
579
- B(h(K), {
580
- icon: h(V).Hamburger
581
- }, null, 8, ["icon"])
582
- ])
583
- ]),
584
- c("div", rt, [
585
- c("a", {
586
- class: "btn btn-ghost text-xl",
587
- href: h("/")
588
- }, v(d.title), 9, it)
589
- ]),
590
- c("div", ut, [
591
- r.value ? (l(), f(h(ie), P({ key: 0 }, r.value, { "btn-class": "" }), null, 16)) : y("", !0)
592
- ])
593
- ])
594
- ]),
595
- n.value ? (l(), u("aside", {
596
- key: 0,
597
- id: "drawer-left",
598
- class: "fixed overflow-y-auto z-[1000] min-h-0 min-w-0 relative flex-shrink-0 bg-white shadow-lg transition-all duration-300 ease-in-out border-l border-gray-200 overflow-visible inset-0",
599
- style: J({
600
- width: d.widthSidebar + "px",
601
- top: `${he}px`
602
- })
603
- }, [
604
- c("div", ct, [
605
- c("ul", dt, [
606
- (l(!0), u(k, null, x(d.menu, (i) => (l(), u("li", {
607
- key: i.label
608
- }, [
609
- B(h(Be), {
610
- to: { name: i.routerLink, params: i.params }
611
- }, {
612
- default: T(() => [
613
- U(v(i.label), 1)
614
- ]),
615
- _: 2
616
- }, 1032, ["to"])
617
- ]))), 128))
618
- ]),
619
- c("div", pt, " version: " + v(d.version), 1)
620
- ])
621
- ], 4)) : y("", !0),
622
- c("main", {
623
- class: w("overflow-hidden fixed border-red bg-white p-4 mx-auto max-h-full shadow-sm "),
624
- style: J({
625
- top: `${he}px`,
626
- bottom: "2px",
627
- right: "2px",
628
- left: n.value ? d.widthSidebar + "px" : 0
629
- })
630
- }, [
631
- c("div", mt, [
632
- z(d.$slots, "default")
633
- ])
634
- ], 4)
635
- ])
636
- ], 64));
637
- }
638
- }), Z = /* @__PURE__ */ g({
639
- __name: "pagination-button.component",
640
- props: {
641
- currentPage: {},
642
- page: {},
643
- label: {},
644
- neverActive: { type: Boolean, default: !1 },
645
- disabled: { type: Boolean }
646
- },
647
- emits: ["updatePage", "updatePageSize"],
648
- setup(e, { emit: t }) {
649
- const o = e, s = t, n = $(
650
- () => o.neverActive ? !1 : o.page === o.currentPage
651
- ), a = $(() => o.neverActive ? I.blank : n.value ? I.primary : I.secondary), b = () => {
652
- s("updatePage", o.page);
653
- };
654
- return (r, d) => (l(), f(h(q), {
655
- disabled: r.disabled,
656
- square: !0,
657
- size: "xs",
658
- color: a.value,
659
- onClick: d[0] || (d[0] = (p) => b())
660
- }, {
661
- default: T(() => [
662
- U(v(r.label), 1)
663
- ]),
664
- _: 1
665
- }, 8, ["disabled", "color"]));
666
- }
667
- }), bt = { class: "flex gap-2" }, ht = { class: "flex flex-1 justify-center items-center" }, ft = { class: "flex gap-1" }, vt = { class: "text-sm" }, W = 6, gt = /* @__PURE__ */ g({
668
- __name: "pagination.component",
669
- props: {
670
- totalItems: { type: Number, default: 0 },
671
- itemsPerPage: { type: Number, default: 1 },
672
- currentPage: { type: Number, default: 1 }
673
- },
674
- emits: ["updatePage", "updatePageSize"],
675
- setup(e, { emit: t }) {
676
- const o = e, s = t, n = $(() => {
677
- let i = Math.ceil(o.totalItems / o.itemsPerPage);
678
- return i < 1 ? 1 : i;
679
- }), a = W / 2, b = $(() => {
680
- if (n.value <= W)
681
- return {
682
- min: 1,
683
- max: n.value
684
- };
685
- let i = o.currentPage - a;
686
- i <= 1 ? i = 1 : i + W > n.value && (i = n.value - W);
687
- let D = i + W;
688
- return {
689
- min: i,
690
- max: D
691
- };
692
- }), r = (i) => ({
693
- label: "...",
694
- currentPage: i,
695
- page: -10,
696
- disabled: !0,
697
- neverActive: !0
698
- }), d = $(() => {
699
- let i = n.value;
700
- i < 1 && (i = 1);
701
- const D = o.currentPage, S = [], { min: F, max: j } = b.value;
702
- return Array.from({ length: i }, (_, N) => {
703
- const m = N + 1;
704
- m !== 1 && m !== i && (m > j || m < F) || (m === i && i > 1 && j < i && S.push(r(D)), S.push({
705
- label: `${m}`,
706
- totalPages: i,
707
- currentPage: D,
708
- page: m
709
- }), m === 1 && i > 1 && F > 1 && S.push(r(D)));
710
- }), S;
711
- }), p = (i) => {
712
- s("updatePage", i);
713
- };
714
- return (i, D) => (l(), u("div", bt, [
715
- c("div", ht, [
716
- c("div", ft, [
717
- B(Z, P(o, {
718
- page: 1,
719
- label: "<<",
720
- "current-page": e.currentPage,
721
- "never-active": !0,
722
- disabled: e.currentPage === 1,
723
- onUpdatePage: p
724
- }), null, 16, ["current-page", "disabled"]),
725
- B(Z, P(o, {
726
- page: e.currentPage - 1,
727
- label: "<",
728
- "current-page": e.currentPage,
729
- "never-active": !0,
730
- disabled: e.currentPage === 1,
731
- onUpdatePage: p
732
- }), null, 16, ["page", "current-page", "disabled"]),
733
- (l(!0), u(k, null, x(d.value, (S) => (l(), f(Z, P({
734
- key: S.page,
735
- ref_for: !0
736
- }, S, { onUpdatePage: p }), null, 16))), 128)),
737
- B(Z, P(o, {
738
- page: e.currentPage + 1,
739
- label: ">",
740
- "current-page": e.currentPage,
741
- "never-active": !0,
742
- disabled: o.currentPage === n.value,
743
- onUpdatePage: p
744
- }), null, 16, ["page", "current-page", "disabled"]),
745
- B(Z, P(o, {
746
- page: n.value,
747
- label: ">>",
748
- "current-page": e.currentPage,
749
- "never-active": !0,
750
- disabled: o.currentPage === n.value,
751
- onUpdatePage: p
752
- }), null, 16, ["page", "current-page", "disabled"])
753
- ])
754
- ]),
755
- c("div", vt, " page " + v(e.currentPage) + " of " + v(n.value), 1)
756
- ]));
757
- }
758
- }), ye = (e, t) => {
759
- const o = e.__vccOpts || e;
760
- for (const [s, n] of t)
761
- o[s] = n;
762
- return o;
763
- }, yt = () => ({
764
- data: {
765
- type: Object,
766
- required: !0
767
- },
768
- column: {
769
- type: Object,
770
- required: !0
771
- },
772
- options: {
773
- type: Object,
774
- required: !1
775
- }
776
- }), _t = g({
777
- name: "TextCell",
778
- props: {
779
- ...yt()
780
- },
781
- computed: {
782
- value() {
783
- var t;
784
- const e = this.data[this.column.id];
785
- return e ? ((t = this.column.options) == null ? void 0 : t.format) === "keyValue" ? e[this.column.options.key] : e : null;
786
- }
787
- }
788
- }), wt = _t;
789
- function kt(e, t, o, s, n, a) {
790
- return v(e.value);
791
- }
792
- const fn = /* @__PURE__ */ ye(wt, [["render", kt]]), $t = { class: "flex-grow pr-2" }, Ct = { class: "h-4 w-4" }, Lt = /* @__PURE__ */ g({
793
- __name: "sort.header",
794
- props: {
795
- column: {},
796
- sortColumn: {},
797
- sortDirection: {}
798
- },
799
- emits: ["sort"],
800
- setup(e, { emit: t }) {
801
- const o = e, s = $(
802
- () => o.sortDirection === "asc" ? V.BarsArrowUp : V.BarsArrowDown
803
- ), n = $(() => {
804
- var r;
805
- return ((r = o.column.options) == null ? void 0 : r.sortId) ?? o.column.id;
806
- }), a = () => {
807
- b("sort", n.value);
808
- }, b = t;
809
- return (r, d) => (l(), u("button", {
810
- class: "flex items-center",
811
- onClick: a
812
- }, [
813
- c("span", $t, v(r.column.label), 1),
814
- c("div", Ct, [
815
- r.sortColumn === n.value ? (l(), f(h(K), {
816
- key: 0,
817
- icon: s.value
818
- }, null, 8, ["icon"])) : y("", !0)
819
- ])
820
- ]));
821
- }
822
- }), Mt = { class: "table w-full" }, xt = { key: 0 }, Bt = ["colspan"], Pt = { class: "flex gap-2" }, vn = /* @__PURE__ */ g({
823
- __name: "table.component",
824
- props: {
825
- loading: { type: Boolean },
826
- actions: {},
827
- data: {},
828
- displayColumns: {},
829
- page: {},
830
- sort: {}
831
- },
832
- emits: ["delete", "edit", "updatePage", "sort"],
833
- setup(e, { emit: t }) {
834
- const o = t, s = (r) => {
835
- o("edit", r);
836
- }, n = (r) => {
837
- o("delete", r);
838
- }, a = (r) => {
839
- o("updatePage", r);
840
- }, b = (r) => {
841
- o("sort", r);
842
- };
843
- return (r, d) => (l(), u(k, null, [
844
- c("table", Mt, [
845
- c("thead", null, [
846
- c("tr", null, [
847
- (l(!0), u(k, null, x(r.displayColumns, (p) => (l(), u("th", {
848
- key: p.scope
849
- }, [
850
- B(Lt, P({ column: p }, { ref_for: !0 }, r.sort, { onSort: b }), null, 16, ["column"])
851
- ]))), 128)),
852
- d[0] || (d[0] = c("th", null, null, -1))
853
- ])
854
- ]),
855
- c("tbody", null, [
856
- r.loading ? (l(), u("tr", xt, [
857
- c("td", {
858
- colspan: r.displayColumns.length + 1,
859
- class: "text-center"
860
- }, d[1] || (d[1] = [
861
- c("span", { class: "loading loading-bars loading-xs" }, null, -1)
862
- ]), 8, Bt)
863
- ])) : y("", !0),
864
- (l(!0), u(k, null, x(r.data, (p) => (l(), u("tr", {
865
- key: p.id
866
- }, [
867
- (l(!0), u(k, null, x(r.displayColumns, (i) => (l(), u("td", {
868
- key: i.scope
869
- }, [
870
- (l(), f(se(i.component), P({ ref_for: !0 }, i, {
871
- data: p,
872
- column: i
873
- }), null, 16, ["data", "column"]))
874
- ]))), 128)),
875
- c("td", null, [
876
- c("span", Pt, [
877
- (l(!0), u(k, null, x(r.actions, (i) => (l(), f(q, {
878
- key: i.label,
879
- icon: i.icon,
880
- outline: !0,
881
- onClick: (D) => i.action(p)
882
- }, {
883
- default: T(() => [
884
- U(v(i.label), 1)
885
- ]),
886
- _: 2
887
- }, 1032, ["icon", "onClick"]))), 128)),
888
- B(q, {
889
- icon: h(V).Edit,
890
- outline: !0,
891
- onClick: (i) => s(p)
892
- }, null, 8, ["icon", "onClick"]),
893
- B(q, {
894
- icon: h(V).Delete,
895
- outline: !0,
896
- onClick: (i) => n(p)
897
- }, null, 8, ["icon", "onClick"])
898
- ])
899
- ])
900
- ]))), 128))
901
- ])
902
- ]),
903
- r.page ? (l(), f(gt, {
904
- key: 0,
905
- class: "border-gray-300 border-t pt-4 border-x-0 border-b-0",
906
- "total-items": r.page.count,
907
- "items-per-page": r.page.pageSize,
908
- "current-page": r.page.page,
909
- onUpdatePage: a
910
- }, null, 8, ["total-items", "items-per-page", "current-page"])) : y("", !0)
911
- ], 64));
912
- }
913
- }), Dt = {}, At = { class: "card bg-base-100 shadow-sm" }, Tt = { class: "card-body" }, zt = {
914
- key: 0,
915
- class: "card-title"
916
- }, St = {
917
- key: 1,
918
- class: "card-actions justify-end"
919
- };
920
- function Vt(e, t) {
921
- return l(), u("div", At, [
922
- c("div", Tt, [
923
- e.$slots.title ? (l(), u("h2", zt, [
924
- z(e.$slots, "title")
925
- ])) : y("", !0),
926
- c("p", null, [
927
- z(e.$slots, "default"),
928
- z(e.$slots, "content")
929
- ]),
930
- e.$slots.actions ? (l(), u("div", St, [
931
- z(e.$slots, "actions")
932
- ])) : y("", !0)
933
- ])
934
- ]);
935
- }
936
- const gn = /* @__PURE__ */ ye(Dt, [["render", Vt]]), yn = (e, t) => {
937
- if (!e) return null;
938
- const o = (s) => {
939
- e.contains(s.target) || t();
940
- };
941
- return document.addEventListener("click", o), o;
942
- }, _n = (e) => {
943
- document.removeEventListener("click", e);
944
- }, wn = {
945
- beforeMount(e, t) {
946
- e.clickOutsideEvent = function(o) {
947
- e === o.target || e.contains(o.target) || t.value(o);
948
- }, document.addEventListener("click", e.clickOutsideEvent);
949
- },
950
- unmounted(e) {
951
- document.removeEventListener("click", e.clickOutsideEvent);
952
- }
953
- };
954
- function kn(e) {
955
- const t = $e();
956
- if (!t)
957
- return !1;
958
- const o = t.vnode.props;
959
- return o ? !!(o[me(e)] || // also try camelCase event handler (#2249)
960
- o[me(Ce(e))]) : !1;
961
- }
962
- const Nt = {
963
- group: {
964
- root: "group",
965
- label: "text-primary text-lg font-bold",
966
- item: "group-item"
967
- },
968
- verticalLayout: {
969
- root: "flex flex-col gap-x-2",
970
- item: "w-full"
971
- },
972
- horizontalLayout: {
973
- root: "flex flex-row gap-x-2",
974
- item: "w-full"
975
- },
976
- arrayList: {
977
- root: "fieldset",
978
- legend: "fieldset-legend text-xl capitalize"
979
- },
980
- control: {
981
- root: "fieldset",
982
- wrapper: "fieldset",
983
- label: "fieldset-legend",
984
- error: "",
985
- input: "input",
986
- select: "select",
987
- description: "form-control--description label text-xs text-gray-500"
988
- },
989
- fixedArrayList: {
990
- root: "flex flex-row gap-x-2",
991
- item: "w-full"
992
- }
993
- }, ee = () => ({
994
- id: Y(),
995
- visible: !0,
996
- required: !1,
997
- enabled: !0,
998
- isFocused: !1,
999
- isTouched: !1,
1000
- hideLabel: !1,
1001
- styles: Nt
1002
- }), Ut = () => ({
1003
- ...ee(),
1004
- options: [],
1005
- valueKey: "value",
1006
- labelKey: "label"
1007
- }), Rt = (e, t, o) => !!(e && o), Ft = (e, t, o, s) => t === void 0 || t !== void 0 && !e || !s && !o, Ht = { key: 0 }, pe = /* @__PURE__ */ g({
1008
- __name: "ControlWrapper",
1009
- props: /* @__PURE__ */ X({
1010
- id: {},
1011
- description: {},
1012
- errors: {},
1013
- label: {},
1014
- visible: { type: Boolean },
1015
- required: { type: Boolean },
1016
- enabled: { type: Boolean },
1017
- isFocused: { type: Boolean },
1018
- isTouched: { type: Boolean },
1019
- hideLabel: { type: Boolean },
1020
- styles: {}
1021
- }, ee()),
1022
- setup(e) {
1023
- const t = e, o = $(() => !Ft(
1024
- t.visible,
1025
- t.description,
1026
- t.isFocused,
1027
- !0
1028
- )), s = $(() => t.required), n = $(() => Rt(
1029
- t.isTouched,
1030
- t.isFocused,
1031
- t.errors
1032
- ));
1033
- return (a, b) => (l(), u("fieldset", {
1034
- class: w(a.styles.control.wrapper)
1035
- }, [
1036
- a.hideLabel ? y("", !0) : (l(), u("legend", {
1037
- key: 0,
1038
- class: w(a.styles.control.label)
1039
- }, [
1040
- U(v(a.label) + " ", 1),
1041
- s.value ? (l(), u("span", Ht, "*")) : y("", !0)
1042
- ], 2)),
1043
- z(a.$slots, "default"),
1044
- c("p", {
1045
- class: w(["fieldset-label h-4", { "text-error": n.value }])
1046
- }, v(n.value ? a.errors : o.value ? a.description : null), 3)
1047
- ], 2));
1048
- }
1049
- }), Kt = ["disabled"], jt = ["value"], $n = /* @__PURE__ */ g({
1050
- __name: "SelectComponent",
1051
- props: /* @__PURE__ */ E(/* @__PURE__ */ X({
1052
- id: {},
1053
- description: {},
1054
- errors: {},
1055
- label: {},
1056
- visible: { type: Boolean },
1057
- required: { type: Boolean },
1058
- enabled: { type: Boolean },
1059
- isFocused: { type: Boolean },
1060
- isTouched: { type: Boolean },
1061
- hideLabel: { type: Boolean },
1062
- styles: {},
1063
- options: {},
1064
- valueKey: {},
1065
- labelKey: {}
1066
- }, {
1067
- ...ee(),
1068
- options: [],
1069
- valueKey: "value",
1070
- labelKey: "label"
1071
- }), {
1072
- modelValue: {},
1073
- modelModifiers: {}
1074
- }),
1075
- emits: /* @__PURE__ */ E(["change", "focus", "blur"], ["update:modelValue"]),
1076
- setup(e, { emit: t }) {
1077
- const o = e, s = t, n = le(e, "modelValue"), a = (d) => {
1078
- s("change", d);
1079
- }, b = (d) => {
1080
- s("focus", d);
1081
- }, r = (d) => {
1082
- s("blur", d);
1083
- };
1084
- return (d, p) => (l(), f(pe, ae(re(o)), {
1085
- default: T(() => [
1086
- Q(c("select", {
1087
- "onUpdate:modelValue": p[0] || (p[0] = (i) => n.value = i),
1088
- disabled: !d.enabled,
1089
- class: w(["select select-bordered", d.styles.control.select]),
1090
- onChange: a,
1091
- onFocus: b,
1092
- onBlur: r
1093
- }, [
1094
- (l(!0), u(k, null, x(d.options, (i) => (l(), u("option", {
1095
- key: i[d.valueKey],
1096
- value: i
1097
- }, v(i[d.labelKey]), 9, jt))), 128))
1098
- ], 42, Kt), [
1099
- [Le, n.value]
1100
- ])
1101
- ]),
1102
- _: 1
1103
- }, 16));
1104
- }
1105
- }), Ot = "GHENTCDH_AUTHENTICATION", It = () => {
1106
- const e = Me(Ot);
1107
- e || console.warn("No auth provided, authorized calls may not work");
1108
- const t = async (o, s, n = { contentType: "application/json" }) => {
1109
- const a = (n == null ? void 0 : n.skipAuth) ?? (e == null ? void 0 : e.options.skipAuthentication), b = {
1110
- accept: "application/json",
1111
- ...s.headers ?? {}
1112
- };
1113
- n.contentType && (b["Content-Type"] = n.contentType), a || (await (e == null ? void 0 : e.updateToken()), b.Authorization = `Bearer ${e == null ? void 0 : e.token()}`);
1114
- const r = new URL(o, window.location.href);
1115
- if (n != null && n.queryParams)
1116
- for (const [p, i] of Object.entries(n.queryParams))
1117
- r.searchParams.set(p, i);
1118
- const d = await fetch(r.toString(), {
1119
- ...s,
1120
- headers: b
1121
- });
1122
- return d.ok ? d.json() : (n != null && n.skipAuth, Promise.reject({
1123
- content: d.body,
1124
- status: d.status
1125
- }));
1126
- };
1127
- return {
1128
- get: (o, s) => t(o, { method: "GET" }, s),
1129
- postFile: (o, s, n = {}, a) => {
1130
- const b = new FormData();
1131
- for (const r in n)
1132
- b.append(r, n[r]);
1133
- return b.append("file", s), t(
1134
- o,
1135
- {
1136
- method: "POST",
1137
- body: b
1138
- },
1139
- { ...a, contentType: void 0 }
1140
- );
1141
- },
1142
- post: (o, s, n) => t(
1143
- o,
1144
- {
1145
- method: "POST",
1146
- body: JSON.stringify(s)
1147
- },
1148
- n
1149
- ),
1150
- patch: (o, s, n) => t(
1151
- o,
1152
- {
1153
- method: "PATCH",
1154
- body: JSON.stringify(s)
1155
- },
1156
- n
1157
- ),
1158
- delete: (o, s, n) => t(
1159
- o,
1160
- {
1161
- method: "DELETE",
1162
- body: JSON.stringify(s)
1163
- },
1164
- n
1165
- )
1166
- };
1167
- }, qt = ["disabled"], Et = {
1168
- key: 0,
1169
- class: /* @__PURE__ */ w([
1170
- `bg-base-100 w-52 shadow -mt-5
1171
- absolute z-50`
1172
- ])
1173
- }, Zt = ["onClick", "onBlur"], Cn = /* @__PURE__ */ g({
1174
- __name: "AutoComplete",
1175
- props: /* @__PURE__ */ E(/* @__PURE__ */ X({
1176
- id: {},
1177
- description: {},
1178
- errors: {},
1179
- label: {},
1180
- visible: { type: Boolean },
1181
- required: { type: Boolean },
1182
- enabled: { type: Boolean },
1183
- isFocused: { type: Boolean },
1184
- isTouched: { type: Boolean },
1185
- hideLabel: { type: Boolean },
1186
- styles: {},
1187
- config: {},
1188
- options: {},
1189
- valueKey: {},
1190
- labelKey: {}
1191
- }, Ut()), {
1192
- modelValue: {},
1193
- modelModifiers: {}
1194
- }),
1195
- emits: /* @__PURE__ */ E(["change", "focus", "blur"], ["update:modelValue"]),
1196
- setup(e, { emit: t }) {
1197
- const o = e, s = t, n = le(e, "modelValue"), a = R(""), b = (m) => {
1198
- s("change", m);
1199
- }, r = (m) => {
1200
- s("focus", m);
1201
- }, d = (m) => {
1202
- s("blur", m);
1203
- }, p = R(!1), i = R([]), D = (m) => {
1204
- p.value = !0, S(m);
1205
- }, S = (m) => {
1206
- n.value = m, b(m);
1207
- }, F = (m) => {
1208
- var C;
1209
- ((C = i.value) == null ? void 0 : C.length) === m + 1 && (i.value = []);
1210
- }, j = It(), _ = (m) => m[o.valueKey], N = (m) => (m == null ? void 0 : m[o.labelKey]) ?? "";
1211
- return ne(
1212
- () => n.value,
1213
- (m) => {
1214
- m && !_(m) || (p.value = !0, i.value = [], a.value = N(m));
1215
- },
1216
- { immediate: !0 }
1217
- ), ne(
1218
- () => a.value,
1219
- (m) => {
1220
- if (p.value) {
1221
- p.value = !1;
1222
- return;
1223
- }
1224
- if (S({ [o.labelKey]: m }), o.config) {
1225
- const { uri: C, skipAuth: O, dataField: A } = o.config;
1226
- j.get(`${C}${m}`, { skipAuth: O }).then((H) => {
1227
- i.value = H[A];
1228
- });
1229
- } else o.options && (i.value = o.options.filter((C) => N(C).toLowerCase().includes(m)).slice(0, 10));
1230
- }
1231
- ), (m, C) => {
1232
- const O = fe("click-outside");
1233
- return l(), f(pe, ae(re(o)), {
1234
- default: T(() => {
1235
- var A;
1236
- return [
1237
- Q(c("input", {
1238
- "onUpdate:modelValue": C[0] || (C[0] = (H) => a.value = H),
1239
- autocomplete: "off",
1240
- type: "text",
1241
- class: w([m.styles.control.select]),
1242
- disabled: !m.enabled,
1243
- onFocus: r,
1244
- onBlur: d
1245
- }, null, 42, qt), [
1246
- [xe, a.value]
1247
- ]),
1248
- Q((l(), u("div", null, [
1249
- (A = i.value) != null && A.length ? (l(), u("ul", Et, [
1250
- (l(!0), u(k, null, x(i.value, (H, _e) => (l(), u("li", {
1251
- key: H[m.valueKey]
1252
- }, [
1253
- c("button", {
1254
- class: "w-full h-8 border-b-1 border-gray-200 border-x-0 border-t-0 px-4 py-2 text-left hover:bg-primary-content cursor-pointer",
1255
- type: "button",
1256
- onClick: (we) => D(H),
1257
- onBlur: (we) => F(_e)
1258
- }, v(N(H)), 41, Zt)
1259
- ]))), 128))
1260
- ])) : y("", !0)
1261
- ])), [
1262
- [O, () => i.value = []]
1263
- ])
1264
- ];
1265
- }),
1266
- _: 1
1267
- }, 16);
1268
- };
1269
- }
1270
- }), Wt = {
1271
- key: 0,
1272
- class: /* @__PURE__ */ w([
1273
- `bg-base-100 w-52 shadow -mt-5
1274
- absolute z-50 p-0`
1275
- ])
1276
- }, Gt = ["onClick"], Jt = { class: "w-4 mr-2" }, Ln = /* @__PURE__ */ g({
1277
- __name: "MultiSelect",
1278
- props: /* @__PURE__ */ E(/* @__PURE__ */ X({
1279
- id: {},
1280
- description: {},
1281
- errors: {},
1282
- label: {},
1283
- visible: { type: Boolean },
1284
- required: { type: Boolean },
1285
- enabled: { type: Boolean },
1286
- isFocused: { type: Boolean },
1287
- isTouched: { type: Boolean },
1288
- hideLabel: { type: Boolean },
1289
- styles: {},
1290
- options: {},
1291
- valueKey: {},
1292
- labelKey: {}
1293
- }, {
1294
- ...ee(),
1295
- valueKey: "value",
1296
- labelKey: "label"
1297
- }), {
1298
- modelValue: {},
1299
- modelModifiers: {}
1300
- }),
1301
- emits: /* @__PURE__ */ E(["change", "focus", "blur"], ["update:modelValue"]),
1302
- setup(e, { emit: t }) {
1303
- const o = e, s = t, n = le(e, "modelValue");
1304
- let a = !1;
1305
- const b = (_) => {
1306
- s("change", _);
1307
- }, r = R(!1), d = () => {
1308
- r.value = !r.value, a = !0;
1309
- }, p = () => {
1310
- a || (r.value = !1), a = !1;
1311
- }, i = $(
1312
- () => {
1313
- var _;
1314
- return ((_ = n.value) == null ? void 0 : _.map((N) => F(N))) ?? [];
1315
- }
1316
- ), D = (_) => i.value.includes(_), S = (_, N) => {
1317
- _.preventDefault();
1318
- let m = n.value ?? [];
1319
- const C = F(N);
1320
- D(C) ? m = m.filter((A) => F(A) !== C) : m.push(N), n.value = m, b(m);
1321
- }, F = (_) => _[o.valueKey], j = (_) => (_ == null ? void 0 : _[o.labelKey]) ?? "";
1322
- return (_, N) => {
1323
- const m = fe("click-outside");
1324
- return l(), f(pe, ae(re(o)), {
1325
- default: T(() => {
1326
- var C, O;
1327
- return [
1328
- c("button", {
1329
- type: "button",
1330
- class: w([_.styles.control.select, "w-full truncate block"]),
1331
- onClick: d
1332
- }, v(((O = (C = n.value) == null ? void 0 : C.map) == null ? void 0 : O.call(C, (A) => j(A)).join(", ")) ?? "Select value"), 3),
1333
- Q((l(), u("div", null, [
1334
- r.value ? (l(), u("ul", Wt, [
1335
- (l(!0), u(k, null, x(_.options, (A) => (l(), u("li", {
1336
- key: A[_.valueKey]
1337
- }, [
1338
- c("button", {
1339
- class: "w-full flex h-8 border-b-1 border-gray-200 border-x-0 border-t-0 p-2 text-left hover:bg-primary-content cursor-pointer",
1340
- type: "button",
1341
- onClick: (H) => S(H, A)
1342
- }, [
1343
- c("div", Jt, [
1344
- D(F(A)) ? (l(), f(h(K), {
1345
- key: 0,
1346
- icon: h(V).Check,
1347
- size: "sm"
1348
- }, null, 8, ["icon"])) : y("", !0)
1349
- ]),
1350
- U(" " + v(j(A)), 1)
1351
- ], 8, Gt)
1352
- ]))), 128))
1353
- ])) : y("", !0)
1354
- ])), [
1355
- [m, () => p()]
1356
- ])
1357
- ];
1358
- }),
1359
- _: 1
1360
- }, 16);
1361
- };
1362
- }
1363
- }), Qt = { class: "grid grid-cols-[auto_1fr_auto] h-full overflow-hidden" }, Xt = {
1364
- id: "drawer-left",
1365
- class: "min-h-0 min-w-6 relative flex-shrink-0 bg-white shadow-lg transition-all duration-300 ease-in-out border-l border-gray-200 overflow-visible"
1366
- }, Yt = { class: "flex-1 overflow-y-auto bg-white" }, en = { class: "min-h-0 min-w-6 relative flex-shrink-0 bg-white shadow-lg transition-all duration-300 ease-in-out border-l border-gray-200 overflow-visible" }, Mn = /* @__PURE__ */ g({
1367
- __name: "drawer",
1368
- props: {
1369
- widthLeft: { default: 200 },
1370
- widthRight: { default: 200 }
1371
- },
1372
- setup(e) {
1373
- const t = R({ left: !0, right: !0 }), o = (s) => {
1374
- t.value[s] = !t.value[s];
1375
- };
1376
- return (s, n) => (l(), u("main", Qt, [
1377
- c("aside", Xt, [
1378
- c("div", {
1379
- class: w(["absolute top-0 z-20", t.value.left ? "-right-0" : "-right-2"])
1380
- }, [
1381
- c("button", {
1382
- class: "btn btn-ghost btn-circle",
1383
- onClick: n[0] || (n[0] = (a) => o("left"))
1384
- }, [
1385
- B(h(K), {
1386
- size: "sm",
1387
- icon: t.value.left ? h(V).DblChevronLeft : h(V).DblChevronRight
1388
- }, null, 8, ["icon"])
1389
- ])
1390
- ], 2),
1391
- t.value.left ? (l(), u("div", {
1392
- key: 0,
1393
- style: J({ width: s.widthLeft + "px" }),
1394
- class: "h-full overflow-y-auto p-4"
1395
- }, [
1396
- z(s.$slots, "left-drawer")
1397
- ], 4)) : y("", !0)
1398
- ]),
1399
- c("div", Yt, [
1400
- z(s.$slots, "default")
1401
- ]),
1402
- c("aside", en, [
1403
- t.value.right ? (l(), u("div", {
1404
- key: 0,
1405
- style: J({ width: s.widthRight + "px" }),
1406
- class: "h-full overflow-y-auto p-4"
1407
- }, [
1408
- z(s.$slots, "right-drawer")
1409
- ], 4)) : y("", !0),
1410
- c("div", {
1411
- class: w(["absolute top-0 z-20", t.value.right ? "-left-0" : "-left-2"])
1412
- }, [
1413
- c("button", {
1414
- class: "btn btn-ghost btn-circle",
1415
- onClick: n[1] || (n[1] = (a) => o("right"))
1416
- }, [
1417
- B(h(K), {
1418
- size: "sm",
1419
- icon: t.value.right ? h(V).DblChevronRight : h(V).DblChevronLeft
1420
- }, null, 8, ["icon"])
1421
- ])
1422
- ], 2)
1423
- ])
1424
- ]));
1425
- }
1426
- });
1427
- function tn(e, t) {
1428
- return l(), u("svg", {
1429
- xmlns: "http://www.w3.org/2000/svg",
1430
- viewBox: "0 0 24 24",
1431
- fill: "currentColor",
1432
- "aria-hidden": "true",
1433
- "data-slot": "icon"
1434
- }, [
1435
- c("path", {
1436
- "fill-rule": "evenodd",
1437
- 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",
1438
- "clip-rule": "evenodd"
1439
- })
1440
- ]);
1441
- }
1442
- function nn(e, t) {
1443
- return l(), u("svg", {
1444
- xmlns: "http://www.w3.org/2000/svg",
1445
- viewBox: "0 0 24 24",
1446
- fill: "currentColor",
1447
- "aria-hidden": "true",
1448
- "data-slot": "icon"
1449
- }, [
1450
- c("path", {
1451
- "fill-rule": "evenodd",
1452
- 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",
1453
- "clip-rule": "evenodd"
1454
- })
1455
- ]);
1456
- }
1457
- const on = { class: "ml-1" }, sn = { class: "truncate flex-1 min-w-0 text-left" }, ln = {
1458
- key: 0,
1459
- class: "badge badge-ghost badge-sm flex-shrink-0"
1460
- }, an = /* @__PURE__ */ g({
1461
- __name: "TreeItem",
1462
- props: {
1463
- active: {},
1464
- node: {},
1465
- expanded: {},
1466
- isExpanded: { type: Function }
1467
- },
1468
- emits: ["toggle", "select"],
1469
- setup(e, { emit: t }) {
1470
- const o = e, s = t, n = $(() => o.active === o.node.id);
1471
- return (a, b) => {
1472
- var d;
1473
- const r = oe("TreeItem", !0);
1474
- return l(), u("li", on, [
1475
- c("div", {
1476
- class: w([
1477
- `flex items-center gap-1 cursor-pointer rounded-md px-1 py-0.5
1478
- hover:bg-gray-100`,
1479
- n.value ? "text-primary" : ""
1480
- ])
1481
- }, [
1482
- ((d = a.node.children) == null ? void 0 : d.length) > 0 ? (l(), u("span", {
1483
- key: 0,
1484
- class: "flex items-center justify-center",
1485
- onClick: b[0] || (b[0] = (p) => s("toggle", a.node))
1486
- }, [
1487
- a.node.children && a.isExpanded(a.node.id) ? (l(), f(h(tn), {
1488
- key: 0,
1489
- class: "w-3 h-3"
1490
- })) : (l(), f(h(nn), {
1491
- key: 1,
1492
- class: "w-3 h-3"
1493
- }))
1494
- ])) : y("", !0),
1495
- c("div", {
1496
- class: "flex items-center gap-2 w-full min-w-0",
1497
- onClick: b[1] || (b[1] = (p) => s("select", a.node))
1498
- }, [
1499
- c("div", sn, v(a.node.label), 1),
1500
- a.node.tag ? (l(), u("div", ln, v(a.node.tag), 1)) : y("", !0)
1501
- ])
1502
- ], 2),
1503
- a.node.children && a.isExpanded(a.node.id) ? (l(), u("ul", {
1504
- key: 0,
1505
- class: w([
1506
- "ml-4 border-l pl-2",
1507
- { "border-gray-200": !n.value, "border-primary": n.value }
1508
- ])
1509
- }, [
1510
- (l(!0), u(k, null, x(a.node.children, (p) => (l(), f(r, {
1511
- key: p.id,
1512
- node: p,
1513
- expanded: a.expanded,
1514
- active: a.active,
1515
- "is-expanded": a.isExpanded,
1516
- onToggle: b[2] || (b[2] = (i) => s("toggle", i)),
1517
- onSelect: b[3] || (b[3] = (i) => s("select", i))
1518
- }, null, 8, ["node", "expanded", "active", "is-expanded"]))), 128))
1519
- ], 2)) : y("", !0)
1520
- ]);
1521
- };
1522
- }
1523
- }), rn = { class: "select-none text-sm" }, xn = /* @__PURE__ */ g({
1524
- __name: "TreeView",
1525
- props: {
1526
- data: {},
1527
- active: {}
1528
- },
1529
- emits: ["select"],
1530
- setup(e, { emit: t }) {
1531
- const o = e, s = t, n = R(/* @__PURE__ */ new Set()), a = (d) => {
1532
- const p = d.id;
1533
- if (!d.children || d.children.length === 0) {
1534
- s("select", d);
1535
- return;
1536
- }
1537
- n.value.has(p) ? n.value.delete(p) : n.value.add(p);
1538
- }, b = (d) => {
1539
- s("select", d), n.value.add(d.id);
1540
- }, r = (d) => n.value.has(d);
1541
- return (d, p) => (l(), u("ul", rn, [
1542
- (l(!0), u(k, null, x(o.data, (i) => (l(), f(an, {
1543
- key: i.id,
1544
- node: i,
1545
- expanded: n.value,
1546
- active: d.active,
1547
- "is-expanded": r,
1548
- onToggle: a,
1549
- onSelect: b
1550
- }, null, 8, ["node", "expanded", "active"]))), 128))
1551
- ]));
1552
- }
1553
- }), un = {
1554
- key: 0,
1555
- class: "flex items-center justify-center h-20"
1556
- }, Bn = /* @__PURE__ */ g({
1557
- __name: "loading",
1558
- props: {
1559
- loading: { type: Boolean }
1560
- },
1561
- setup(e) {
1562
- return (t, o) => t.loading ? (l(), u("div", un, o[0] || (o[0] = [
1563
- c("span", { class: "loading loading-bars loading-md text-primary" }, null, -1)
1564
- ]))) : y("", !0);
1565
- }
1566
- });
1567
- export {
1568
- Cn as Autocomplete,
1569
- Je as BadgeSize,
1570
- q as Btn,
1571
- bn as BtnBadge,
1572
- Ge as ButtonSize,
1573
- gn as Card,
1574
- wn as ClickOutside,
1575
- I as Color,
1576
- Xe as ConfirmModal,
1577
- pe as ControlWrapper,
1578
- Ut as DefaultAutoCompleteProperties,
1579
- ee as DefaultControlProperties,
1580
- Mn as Drawer,
1581
- mn as Dropdown,
1582
- K as Icon,
1583
- V as IconEnum,
1584
- Pe as IconMap,
1585
- Bn as Loading,
1586
- pn as Menu,
1587
- Ee as Modal,
1588
- ce as ModalService,
1589
- Ye as ModalWrapper,
1590
- Ln as MultiSelect,
1591
- et as NotificationMessage,
1592
- de as NotificationService,
1593
- ot as Notifications,
1594
- gt as PaginationComponent,
1595
- $n as SelectComponent,
1596
- hn as ShellComponent,
1597
- ie as SubMenu,
1598
- vn as Table,
1599
- vn as TableComponent,
1600
- fn as TextCell,
1601
- xn as TreeView,
1602
- yn as addClickOutsideEventListener,
1603
- kn as hasCustomEventListener,
1604
- Ft as isDescriptionHidden,
1605
- Nt as myStyles,
1606
- _n as removeClickOutsideEventListener,
1607
- Rt as showErrors
1608
- };