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