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