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