@ghentcdh/ui 0.6.7 → 0.6.9

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