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