@enos5/enos-vue 1.0.1 → 1.0.3
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/dist/index.js +287 -281
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as j, computed as g, watch as Q, openBlock as a, createElementBlock as i, createElementVNode as o, Fragment as q, renderList as P, normalizeClass as
|
|
1
|
+
import { ref as j, computed as g, watch as Q, openBlock as a, createElementBlock as i, createElementVNode as o, Fragment as q, renderList as P, normalizeClass as k, normalizeStyle as Te, toDisplayString as T, createBlock as B, createCommentVNode as D, renderSlot as w, createVNode as R, Transition as oe, withCtx as O, mergeProps as z, useSlots as fe, unref as I, withDirectives as Z, vShow as ie, watchEffect as Qe, onMounted as ee, useAttrs as ne, vModelCheckbox as Ye, nextTick as be, onBeforeUnmount as Je, Teleport as Ze, withModifiers as ve, onUnmounted as Ae, isRef as me, createTextVNode as ue, resolveDynamicComponent as Be, vModelText as et } from "vue";
|
|
2
2
|
import { usePage as tt, Link as ge } from "@inertiajs/vue3";
|
|
3
3
|
import { useI18n as lt } from "vue-i18n";
|
|
4
4
|
import { CheckCircleIcon as at, ExclamationTriangleIcon as Le, XMarkIcon as st, LockClosedIcon as nt, ChevronDownIcon as xe, PhotoIcon as rt, ExclamationCircleIcon as ot, ChevronUpIcon as Ie, MagnifyingGlassIcon as it, CheckIcon as dt, PencilSquareIcon as ut } from "@heroicons/vue/24/outline";
|
|
@@ -151,61 +151,61 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
151
151
|
"tab-click"
|
|
152
152
|
],
|
|
153
153
|
setup(e, { emit: s }) {
|
|
154
|
-
const t = e, l = s, r = j([]), u = g(() => t.tabs.map((
|
|
155
|
-
Q(d, (
|
|
156
|
-
|
|
154
|
+
const t = e, l = s, r = j([]), u = g(() => t.tabs.map((h) => h.value)), d = g(() => u.value.includes(t.activeTab) ? t.activeTab : u.value[0] ?? "");
|
|
155
|
+
Q(d, (h) => {
|
|
156
|
+
h !== t.activeTab && l("update:activeTab", h);
|
|
157
157
|
}, { immediate: !0 });
|
|
158
|
-
const f = (
|
|
159
|
-
r.value[
|
|
160
|
-
}, $ = (
|
|
161
|
-
!
|
|
162
|
-
}, b = (
|
|
163
|
-
r.value[
|
|
164
|
-
},
|
|
158
|
+
const f = (h, v) => {
|
|
159
|
+
r.value[v] = h;
|
|
160
|
+
}, $ = (h) => {
|
|
161
|
+
!h || h === t.activeTab || (l("update:activeTab", h), l("tab-click", h));
|
|
162
|
+
}, b = (h) => {
|
|
163
|
+
r.value[h]?.focus();
|
|
164
|
+
}, C = (h, v) => {
|
|
165
165
|
if (t.tabs.length === 0)
|
|
166
166
|
return;
|
|
167
|
-
let
|
|
168
|
-
switch (
|
|
167
|
+
let S = v;
|
|
168
|
+
switch (h.key) {
|
|
169
169
|
case "ArrowRight":
|
|
170
170
|
case "ArrowDown":
|
|
171
|
-
|
|
171
|
+
S = (v + 1) % t.tabs.length;
|
|
172
172
|
break;
|
|
173
173
|
case "ArrowLeft":
|
|
174
174
|
case "ArrowUp":
|
|
175
|
-
|
|
175
|
+
S = (v - 1 + t.tabs.length) % t.tabs.length;
|
|
176
176
|
break;
|
|
177
177
|
case "Home":
|
|
178
|
-
|
|
178
|
+
S = 0;
|
|
179
179
|
break;
|
|
180
180
|
case "End":
|
|
181
|
-
|
|
181
|
+
S = t.tabs.length - 1;
|
|
182
182
|
break;
|
|
183
183
|
default:
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
h.preventDefault(), $(t.tabs[S].value), b(S);
|
|
187
187
|
};
|
|
188
|
-
return (
|
|
188
|
+
return (h, v) => (a(), i("div", ft, [
|
|
189
189
|
o("div", gt, [
|
|
190
|
-
(a(!0), i(q, null, P(e.tabs, (
|
|
191
|
-
key:
|
|
190
|
+
(a(!0), i(q, null, P(e.tabs, (S, p) => (a(), i("button", {
|
|
191
|
+
key: S.value,
|
|
192
192
|
ref_for: !0,
|
|
193
193
|
ref: (M) => f(M, p),
|
|
194
194
|
type: "button",
|
|
195
195
|
style: Te({ width: `${100 / e.tabs.length}%` }),
|
|
196
196
|
role: "tab",
|
|
197
|
-
"aria-selected": d.value ===
|
|
198
|
-
tabindex: d.value ===
|
|
199
|
-
class:
|
|
197
|
+
"aria-selected": d.value === S.value,
|
|
198
|
+
tabindex: d.value === S.value ? 0 : -1,
|
|
199
|
+
class: k([
|
|
200
200
|
"px-4 py-3 text-center text-sm font-semibold tracking-wide transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 focus-visible:ring-inset",
|
|
201
|
-
d.value ===
|
|
201
|
+
d.value === S.value ? "bg-blue-50 text-blue-700 shadow-[inset_0_-2px_0_0_rgb(37_99_235)]" : "text-gray-700 hover:bg-gray-50",
|
|
202
202
|
{
|
|
203
203
|
"border-r border-gray-200/80": p !== e.tabs.length - 1
|
|
204
204
|
}
|
|
205
205
|
]),
|
|
206
|
-
onClick: (M) => $(
|
|
207
|
-
onKeydown: (M) =>
|
|
208
|
-
}, T(
|
|
206
|
+
onClick: (M) => $(S.value),
|
|
207
|
+
onKeydown: (M) => C(M, p)
|
|
208
|
+
}, T(S.label), 47, yt))), 128))
|
|
209
209
|
])
|
|
210
210
|
]));
|
|
211
211
|
}
|
|
@@ -261,7 +261,7 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
261
261
|
return g(() => s.tabs.findIndex((u) => u.value === t.value)), Q(r, (u, d) => {
|
|
262
262
|
d !== void 0 && d !== -1 && u !== -1 && u !== d && (l.value = u > d ? "right" : "left", t.value = s.activeTab);
|
|
263
263
|
}), (u, d) => (a(), i("div", {
|
|
264
|
-
class:
|
|
264
|
+
class: k(["bg-white/80 backdrop-blur-sm border border-gray-200/60 rounded-xl shadow-[0_1px_3px_rgba(0,0,0,0.1)]", e.overflowClass, { "sticky top-6 self-start": e.sticky }, e.cardClass])
|
|
265
265
|
}, [
|
|
266
266
|
e.tabs.length > 0 ? (a(), B(De, {
|
|
267
267
|
key: 0,
|
|
@@ -271,13 +271,13 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
271
271
|
onTabClick: d[1] || (d[1] = (f) => u.$emit("tab-click", f))
|
|
272
272
|
}, null, 8, ["tabs", "active-tab"])) : D("", !0),
|
|
273
273
|
o("div", {
|
|
274
|
-
class:
|
|
274
|
+
class: k(e.paddingClass)
|
|
275
275
|
}, [
|
|
276
276
|
u.$slots.customTitle ? (a(), i("div", pt, [
|
|
277
|
-
|
|
277
|
+
w(u.$slots, "customTitle")
|
|
278
278
|
])) : e.title ? (a(), i("h3", mt, T(e.title), 1)) : D("", !0),
|
|
279
279
|
o("div", {
|
|
280
|
-
class:
|
|
280
|
+
class: k(["relative", e.tabs.length > 0 ? "overflow-hidden" : "overflow-visible"])
|
|
281
281
|
}, [
|
|
282
282
|
R(oe, {
|
|
283
283
|
"enter-active-class": "transition-all duration-200 ease-in-out",
|
|
@@ -291,9 +291,9 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
291
291
|
default: O(() => [
|
|
292
292
|
(a(), i("div", {
|
|
293
293
|
key: e.activeTab,
|
|
294
|
-
class:
|
|
294
|
+
class: k([e.tabs.length > 0 ? "p-2" : "", e.contentClass])
|
|
295
295
|
}, [
|
|
296
|
-
|
|
296
|
+
w(u.$slots, "default")
|
|
297
297
|
], 2))
|
|
298
298
|
]),
|
|
299
299
|
_: 3
|
|
@@ -308,7 +308,7 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
308
308
|
__name: "Divider",
|
|
309
309
|
setup(e) {
|
|
310
310
|
return (s, t) => (a(), i("div", z({ class: "border-t border-gray-200" }, s.$attrs), [
|
|
311
|
-
|
|
311
|
+
w(s.$slots, "default")
|
|
312
312
|
], 16));
|
|
313
313
|
}
|
|
314
314
|
}), bt = {
|
|
@@ -330,13 +330,13 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
330
330
|
"content-class": e.actionsClass
|
|
331
331
|
}, {
|
|
332
332
|
default: O(() => [
|
|
333
|
-
|
|
333
|
+
w(t.$slots, "default"),
|
|
334
334
|
I(s).danger ? (a(), B(we, {
|
|
335
335
|
key: 0,
|
|
336
336
|
class: "mt-6 pt-4"
|
|
337
337
|
}, {
|
|
338
338
|
default: O(() => [
|
|
339
|
-
|
|
339
|
+
w(t.$slots, "danger")
|
|
340
340
|
]),
|
|
341
341
|
_: 3
|
|
342
342
|
})) : D("", !0)
|
|
@@ -358,7 +358,7 @@ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
358
358
|
}, {
|
|
359
359
|
default: O(() => [
|
|
360
360
|
Z(o("div", vt, [
|
|
361
|
-
|
|
361
|
+
w(s.$slots, "default")
|
|
362
362
|
], 512), [
|
|
363
363
|
[ie, e.on]
|
|
364
364
|
])
|
|
@@ -377,14 +377,14 @@ function Vt(e, s) {
|
|
|
377
377
|
return a(), i("div", wt, [
|
|
378
378
|
o("div", kt, [
|
|
379
379
|
o("h3", St, [
|
|
380
|
-
|
|
380
|
+
w(e.$slots, "title")
|
|
381
381
|
]),
|
|
382
382
|
o("p", $t, [
|
|
383
|
-
|
|
383
|
+
w(e.$slots, "description")
|
|
384
384
|
])
|
|
385
385
|
]),
|
|
386
386
|
o("div", Ct, [
|
|
387
|
-
|
|
387
|
+
w(e.$slots, "aside")
|
|
388
388
|
])
|
|
389
389
|
]);
|
|
390
390
|
}
|
|
@@ -394,16 +394,16 @@ const Se = /* @__PURE__ */ ke(xt, [["render", Vt]]), _t = { class: "md:grid md:g
|
|
|
394
394
|
return (s, t) => (a(), i("div", _t, [
|
|
395
395
|
R(Se, null, {
|
|
396
396
|
title: O(() => [
|
|
397
|
-
|
|
397
|
+
w(s.$slots, "title")
|
|
398
398
|
]),
|
|
399
399
|
description: O(() => [
|
|
400
|
-
|
|
400
|
+
w(s.$slots, "description")
|
|
401
401
|
]),
|
|
402
402
|
_: 3
|
|
403
403
|
}),
|
|
404
404
|
o("div", Tt, [
|
|
405
405
|
o("div", At, [
|
|
406
|
-
|
|
406
|
+
w(s.$slots, "content")
|
|
407
407
|
])
|
|
408
408
|
])
|
|
409
409
|
]));
|
|
@@ -433,10 +433,10 @@ const Mt = /* @__PURE__ */ ke(Lt, [["render", Dt]]), jt = {}, Ot = { class: "min
|
|
|
433
433
|
function Et(e, s) {
|
|
434
434
|
return a(), i("div", Ot, [
|
|
435
435
|
o("div", null, [
|
|
436
|
-
|
|
436
|
+
w(e.$slots, "logo")
|
|
437
437
|
]),
|
|
438
438
|
o("div", zt, [
|
|
439
|
-
|
|
439
|
+
w(e.$slots, "default")
|
|
440
440
|
])
|
|
441
441
|
]);
|
|
442
442
|
}
|
|
@@ -497,24 +497,24 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
497
497
|
};
|
|
498
498
|
return (r, u) => e.type === "dot" ? (a(), i("span", {
|
|
499
499
|
key: 0,
|
|
500
|
-
class:
|
|
500
|
+
class: k(["inline-flex items-center justify-center w-6 h-6 rounded-full", s[e.color].bg])
|
|
501
501
|
}, [
|
|
502
502
|
o("span", {
|
|
503
|
-
class:
|
|
503
|
+
class: k(["w-2 h-2 rounded-full", s[e.color].dot])
|
|
504
504
|
}, null, 2),
|
|
505
505
|
o("span", Nt, [
|
|
506
|
-
|
|
506
|
+
w(r.$slots, "default")
|
|
507
507
|
])
|
|
508
508
|
], 2)) : (a(), i("span", {
|
|
509
509
|
key: 1,
|
|
510
|
-
class:
|
|
510
|
+
class: k(["inline-flex items-center font-medium", [
|
|
511
511
|
s[e.color].bg,
|
|
512
512
|
s[e.color].text,
|
|
513
513
|
t[e.size],
|
|
514
514
|
l[e.rounded]
|
|
515
515
|
]])
|
|
516
516
|
}, [
|
|
517
|
-
|
|
517
|
+
w(r.$slots, "default")
|
|
518
518
|
], 2));
|
|
519
519
|
}
|
|
520
520
|
}, Ut = {
|
|
@@ -537,13 +537,13 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
537
537
|
}, 5e3);
|
|
538
538
|
};
|
|
539
539
|
return Qe(async () => {
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
}),
|
|
540
|
+
const C = s.props.jetstream.flash?.bannerStyle || "success", h = s.props.jetstream.flash?.banner || "";
|
|
541
|
+
h && (r.value = C, u.value = h, b());
|
|
542
|
+
}), ee(() => {
|
|
543
543
|
u.value && b();
|
|
544
|
-
}), (
|
|
544
|
+
}), (C, h) => l.value ? (a(), i("div", Ut, [
|
|
545
545
|
o("div", {
|
|
546
|
-
class:
|
|
546
|
+
class: k([
|
|
547
547
|
"transform transition-all duration-300 ease-out shadow-lg rounded-lg p-4 min-w-[300px] max-w-md",
|
|
548
548
|
d.value ? "translate-y-0 opacity-100" : "translate-y-full opacity-0",
|
|
549
549
|
r.value === "success" ? "bg-green-600" : "bg-red-600"
|
|
@@ -552,7 +552,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
552
552
|
o("div", Rt, [
|
|
553
553
|
o("div", Ht, [
|
|
554
554
|
o("div", {
|
|
555
|
-
class:
|
|
555
|
+
class: k([
|
|
556
556
|
"flex p-2 rounded-full",
|
|
557
557
|
r.value === "success" ? "bg-green-700" : "bg-red-700"
|
|
558
558
|
])
|
|
@@ -573,7 +573,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
573
573
|
o("div", Wt, [
|
|
574
574
|
o("button", {
|
|
575
575
|
type: "button",
|
|
576
|
-
class:
|
|
576
|
+
class: k(["inline-flex text-white hover:bg-white/20 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-green-600 focus:ring-white rounded-md p-1.5 transition-colors", [
|
|
577
577
|
r.value === "success" ? "hover:bg-green-700 focus:ring-offset-green-600" : "hover:bg-red-700 focus:ring-offset-red-600"
|
|
578
578
|
]]),
|
|
579
579
|
onClick: $
|
|
@@ -621,7 +621,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
621
621
|
disabled: e.disabled,
|
|
622
622
|
class: u.value
|
|
623
623
|
}), [
|
|
624
|
-
|
|
624
|
+
w(d.$slots, "default")
|
|
625
625
|
], 16, Qt));
|
|
626
626
|
}
|
|
627
627
|
}), Yt = ["value"], Jt = {
|
|
@@ -688,8 +688,8 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
688
688
|
}, $ = (b) => {
|
|
689
689
|
t("update:modelValue", b.target.checked ? l.value : l.uncheckedValue);
|
|
690
690
|
};
|
|
691
|
-
return (b,
|
|
692
|
-
class:
|
|
691
|
+
return (b, C) => (a(), i("label", {
|
|
692
|
+
class: k(["inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm font-medium select-none transition-colors", [
|
|
693
693
|
r.value ? "bg-indigo-600 text-white border-indigo-600" : "text-gray-600 border-gray-200",
|
|
694
694
|
e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer",
|
|
695
695
|
u.value && !e.disabled ? "ring-2 ring-indigo-500/80 ring-offset-2 ring-offset-white" : ""
|
|
@@ -705,7 +705,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
705
705
|
onBlur: f
|
|
706
706
|
}, null, 40, Zt),
|
|
707
707
|
o("span", {
|
|
708
|
-
class:
|
|
708
|
+
class: k(["inline-flex h-4 w-4 items-center justify-center border text-[10px] font-bold leading-none", [
|
|
709
709
|
r.value ? "border-current bg-white/15 text-current" : "border-current/70 text-transparent",
|
|
710
710
|
"rounded"
|
|
711
711
|
]])
|
|
@@ -746,23 +746,23 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
746
746
|
},
|
|
747
747
|
emits: ["update:modelValue", "blur"],
|
|
748
748
|
setup(e, { expose: s, emit: t }) {
|
|
749
|
-
const l = e, r = t, u = ne(), d = j(null), f = j(!1), $ = g(() => String(u.type ?? "text")), b = g(() => $.value === "password"),
|
|
749
|
+
const l = e, r = t, u = ne(), d = j(null), f = j(!1), $ = g(() => String(u.type ?? "text")), b = g(() => $.value === "password"), C = g(() => b.value && f.value ? "text" : $.value), h = g(() => l.modelValue ?? ""), v = g(() => {
|
|
750
750
|
const { class: L, type: E, ...F } = u;
|
|
751
751
|
return F.maxlength === void 0 && (F.maxlength = rl), F;
|
|
752
|
-
}),
|
|
752
|
+
}), S = g(() => [
|
|
753
753
|
"w-full min-w-0 max-w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm",
|
|
754
754
|
u.class,
|
|
755
755
|
b.value ? "pr-10 pl-10" : ""
|
|
756
756
|
]), p = () => {
|
|
757
757
|
f.value = !f.value;
|
|
758
758
|
}, M = (L) => {
|
|
759
|
-
if (
|
|
759
|
+
if (C.value !== "number")
|
|
760
760
|
return;
|
|
761
761
|
L.preventDefault();
|
|
762
762
|
const E = document.scrollingElement ?? document.documentElement ?? document.body;
|
|
763
763
|
E && (E.scrollTop += L.deltaY);
|
|
764
764
|
};
|
|
765
|
-
return
|
|
765
|
+
return ee(() => {
|
|
766
766
|
d.value?.hasAttribute("autofocus") && d.value.focus();
|
|
767
767
|
}), s({ focus: () => d.value?.focus() }), (L, E) => (a(), i("div", el, [
|
|
768
768
|
b.value ? (a(), i("div", tl, [
|
|
@@ -771,10 +771,10 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
771
771
|
o("input", z({
|
|
772
772
|
ref_key: "input",
|
|
773
773
|
ref: d
|
|
774
|
-
},
|
|
775
|
-
type:
|
|
776
|
-
class: [
|
|
777
|
-
value:
|
|
774
|
+
}, v.value, {
|
|
775
|
+
type: C.value,
|
|
776
|
+
class: [S.value, l.disabled ? l.disabledClass : null],
|
|
777
|
+
value: h.value,
|
|
778
778
|
disabled: l.disabled,
|
|
779
779
|
onInput: E[0] || (E[0] = (F) => r("update:modelValue", F.target.value)),
|
|
780
780
|
onBlur: E[1] || (E[1] = (F) => r("blur", F)),
|
|
@@ -831,18 +831,18 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
831
831
|
emits: ["update:modelValue"],
|
|
832
832
|
setup(e, { expose: s, emit: t }) {
|
|
833
833
|
const l = e, r = t, u = ne(), d = j(null), f = g(() => {
|
|
834
|
-
const { class:
|
|
835
|
-
return
|
|
834
|
+
const { class: h, ...v } = u;
|
|
835
|
+
return v.maxlength === void 0 && (v.maxlength = il), v;
|
|
836
836
|
}), $ = g(() => [
|
|
837
837
|
"w-full min-w-0 max-w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm",
|
|
838
838
|
l.autoResize ? "resize-none overflow-y-auto" : "resize-y",
|
|
839
839
|
u.class
|
|
840
840
|
]), b = () => {
|
|
841
841
|
!l.autoResize || !d.value || (d.value.style.height = "auto", d.value.style.height = `${d.value.scrollHeight}px`);
|
|
842
|
-
},
|
|
843
|
-
r("update:modelValue",
|
|
842
|
+
}, C = (h) => {
|
|
843
|
+
r("update:modelValue", h.target.value), b();
|
|
844
844
|
};
|
|
845
|
-
return
|
|
845
|
+
return ee(() => {
|
|
846
846
|
d.value?.hasAttribute("autofocus") && d.value.focus(), be(() => {
|
|
847
847
|
b();
|
|
848
848
|
});
|
|
@@ -850,7 +850,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
850
850
|
be(() => {
|
|
851
851
|
b();
|
|
852
852
|
});
|
|
853
|
-
}), s({ focus: () => d.value?.focus() }), (
|
|
853
|
+
}), s({ focus: () => d.value?.focus() }), (h, v) => (a(), i("div", null, [
|
|
854
854
|
o("textarea", z({
|
|
855
855
|
ref_key: "textarea",
|
|
856
856
|
ref: d
|
|
@@ -858,7 +858,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
858
858
|
class: [$.value, l.disabled ? l.disabledClass : ""],
|
|
859
859
|
value: l.modelValue,
|
|
860
860
|
disabled: l.disabled,
|
|
861
|
-
onInput:
|
|
861
|
+
onInput: C
|
|
862
862
|
}), null, 16, ol)
|
|
863
863
|
]));
|
|
864
864
|
}
|
|
@@ -948,44 +948,44 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
948
948
|
},
|
|
949
949
|
emits: ["update:modelValue"],
|
|
950
950
|
setup(e, { emit: s }) {
|
|
951
|
-
const t = e, l = s, r = ne(), u = j(!1), d = j(null), f = j(null), $ = j(null), b = j({}),
|
|
952
|
-
if (t.modelValue === null || t.modelValue === void 0 || t.modelValue === "" && !t.options.some((N) =>
|
|
951
|
+
const t = e, l = s, r = ne(), u = j(!1), d = j(null), f = j(null), $ = j(null), b = j({}), C = (x) => typeof x == "object" && x !== null, h = (x) => C(x) ? x[t.valueKey] : x, v = (x) => t.optionLabel ? t.optionLabel(x) : C(x) ? x[t.labelKey] ?? x[t.valueKey] ?? "" : x, S = (x) => !t.softDeleteAware || !C(x) ? !1 : !!x[t.deletedKey], p = g(() => String(t.modelValue ?? "")), M = g(() => !t.softDeleteAware || p.value === "" ? null : t.options.find((x) => S(x) && String(h(x) ?? "") === p.value) ?? null), L = g(() => t.softDeleteAware ? t.options.filter((x) => !S(x)) : t.options), E = g(() => {
|
|
952
|
+
if (t.modelValue === null || t.modelValue === void 0 || t.modelValue === "" && !t.options.some((N) => h(N) === ""))
|
|
953
953
|
return t.placeholder;
|
|
954
|
-
const
|
|
955
|
-
const K =
|
|
954
|
+
const x = t.options.find((N) => {
|
|
955
|
+
const K = h(N);
|
|
956
956
|
return K === t.modelValue || String(K) === String(t.modelValue);
|
|
957
957
|
});
|
|
958
|
-
return
|
|
959
|
-
}), F = (
|
|
958
|
+
return x ? v(x) : t.modelValue;
|
|
959
|
+
}), F = (x) => t.modelModifiers.number ? x === "" ? "" : Number(x) : x, re = () => {
|
|
960
960
|
t.disabled || (u.value = !u.value);
|
|
961
|
-
}, Y = (
|
|
962
|
-
const N =
|
|
961
|
+
}, Y = (x) => {
|
|
962
|
+
const N = h(x);
|
|
963
963
|
l("update:modelValue", F(N)), u.value = !1;
|
|
964
964
|
}, W = () => {
|
|
965
965
|
t.placeholderDisabled || (l("update:modelValue", F("")), u.value = !1);
|
|
966
966
|
}, G = () => {
|
|
967
967
|
if (!f.value)
|
|
968
968
|
return;
|
|
969
|
-
const
|
|
969
|
+
const x = f.value.getBoundingClientRect(), N = window.innerWidth, K = window.innerHeight, X = K - x.bottom - 8, te = x.top - 8, le = X < 240 && te > X, ae = Math.min(x.width, Math.max(N - x.left - 16, 160)), se = Math.max(Math.min(240, le ? te : X), 120);
|
|
970
970
|
b.value = {
|
|
971
971
|
position: "fixed",
|
|
972
|
-
left: `${Math.max(
|
|
973
|
-
width: `${
|
|
974
|
-
maxHeight: `${
|
|
972
|
+
left: `${Math.max(x.left, 8)}px`,
|
|
973
|
+
width: `${ae}px`,
|
|
974
|
+
maxHeight: `${se}px`,
|
|
975
975
|
zIndex: "9999",
|
|
976
|
-
...
|
|
976
|
+
...le ? { bottom: `${K - x.top + 1}px` } : { top: `${x.bottom - 1}px` }
|
|
977
977
|
};
|
|
978
|
-
}, J = (
|
|
979
|
-
const N = d.value?.contains(
|
|
978
|
+
}, J = (x) => {
|
|
979
|
+
const N = d.value?.contains(x.target), K = $.value?.contains(x.target);
|
|
980
980
|
!N && !K && (u.value = !1);
|
|
981
981
|
};
|
|
982
|
-
return
|
|
982
|
+
return ee(() => {
|
|
983
983
|
document.addEventListener("click", J), window.addEventListener("resize", G), window.addEventListener("scroll", G, !0);
|
|
984
984
|
}), Je(() => {
|
|
985
985
|
document.removeEventListener("click", J), window.removeEventListener("resize", G), window.removeEventListener("scroll", G, !0);
|
|
986
|
-
}), Q(u, async (
|
|
987
|
-
|
|
988
|
-
}), (
|
|
986
|
+
}), Q(u, async (x) => {
|
|
987
|
+
x && (await be(), G());
|
|
988
|
+
}), (x, N) => (a(), i("div", {
|
|
989
989
|
ref_key: "rootRef",
|
|
990
990
|
ref: d,
|
|
991
991
|
class: "relative",
|
|
@@ -1002,10 +1002,10 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1002
1002
|
]
|
|
1003
1003
|
}, I(r), { tabindex: "0" }), [
|
|
1004
1004
|
o("span", {
|
|
1005
|
-
class:
|
|
1005
|
+
class: k({ "text-gray-400": !e.modelValue && e.placeholder })
|
|
1006
1006
|
}, T(E.value), 3),
|
|
1007
1007
|
R(I(xe), {
|
|
1008
|
-
class:
|
|
1008
|
+
class: k(["size-5 text-gray-400 transition-transform", { "rotate-180": u.value }])
|
|
1009
1009
|
}, null, 8, ["class"])
|
|
1010
1010
|
], 16),
|
|
1011
1011
|
R(oe, {
|
|
@@ -1022,12 +1022,12 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1022
1022
|
key: 0,
|
|
1023
1023
|
ref_key: "dropdownMenuRef",
|
|
1024
1024
|
ref: $,
|
|
1025
|
-
class:
|
|
1025
|
+
class: k(e.dropdownClass),
|
|
1026
1026
|
style: Te(b.value)
|
|
1027
1027
|
}, [
|
|
1028
1028
|
e.placeholder ? (a(), i("div", {
|
|
1029
1029
|
key: 0,
|
|
1030
|
-
class:
|
|
1030
|
+
class: k([
|
|
1031
1031
|
e.dropdownOptionClass,
|
|
1032
1032
|
e.placeholderClass,
|
|
1033
1033
|
{ "text-gray-400": !e.modelValue }
|
|
@@ -1036,25 +1036,25 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1036
1036
|
}, T(e.placeholder), 3)) : D("", !0),
|
|
1037
1037
|
M.value ? (a(), i("div", {
|
|
1038
1038
|
key: 1,
|
|
1039
|
-
class:
|
|
1039
|
+
class: k([
|
|
1040
1040
|
e.dropdownOptionClass,
|
|
1041
1041
|
e.deletedOptionClass,
|
|
1042
1042
|
e.dropdownSelectedClass
|
|
1043
1043
|
])
|
|
1044
|
-
}, T(
|
|
1044
|
+
}, T(v(M.value)), 3)) : D("", !0),
|
|
1045
1045
|
(a(!0), i(q, null, P(L.value, (K) => (a(), i("div", {
|
|
1046
|
-
key: String(
|
|
1047
|
-
class:
|
|
1046
|
+
key: String(h(K)),
|
|
1047
|
+
class: k([
|
|
1048
1048
|
e.dropdownOptionClass,
|
|
1049
1049
|
e.optionClass,
|
|
1050
1050
|
{
|
|
1051
|
-
[e.dropdownSelectedClass]:
|
|
1051
|
+
[e.dropdownSelectedClass]: h(K) === e.modelValue || String(h(K)) === String(e.modelValue),
|
|
1052
1052
|
"rounded-b-lg": K === L.value[L.value.length - 1] && !e.placeholder,
|
|
1053
1053
|
"rounded-lg": !e.placeholder && L.value.length === 1
|
|
1054
1054
|
}
|
|
1055
1055
|
]),
|
|
1056
1056
|
onClick: ve((X) => Y(K), ["stop"])
|
|
1057
|
-
}, T(
|
|
1057
|
+
}, T(v(K)), 11, dl))), 128))
|
|
1058
1058
|
], 6)) : D("", !0)
|
|
1059
1059
|
]))
|
|
1060
1060
|
]),
|
|
@@ -1198,32 +1198,32 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1198
1198
|
const l = e, r = t, u = ne(), d = j(null), f = g(() => l.withTimestamp ? "datetime-local" : "date"), $ = g(() => l.modelValue ?? ""), b = g(() => {
|
|
1199
1199
|
const p = l.withTimestamp ? "9999-12-31T23:59" : "9999-12-31", M = u.max;
|
|
1200
1200
|
return typeof M != "string" || M === "" || M > p ? p : M;
|
|
1201
|
-
}),
|
|
1201
|
+
}), C = g(() => {
|
|
1202
1202
|
const { class: p, type: M, ...L } = u;
|
|
1203
1203
|
return L;
|
|
1204
|
-
}),
|
|
1204
|
+
}), h = g(() => [
|
|
1205
1205
|
"w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm",
|
|
1206
1206
|
u.class
|
|
1207
|
-
]),
|
|
1207
|
+
]), v = (p) => typeof p != "string" ? "" : p.replace(/^(\d{4})\d+/, "$1"), S = (p) => {
|
|
1208
1208
|
const M = p.target;
|
|
1209
1209
|
if (!M)
|
|
1210
1210
|
return;
|
|
1211
|
-
const L = String(M.value ?? ""), E =
|
|
1211
|
+
const L = String(M.value ?? ""), E = v(L);
|
|
1212
1212
|
E !== L && (M.value = E), r("update:modelValue", E);
|
|
1213
1213
|
};
|
|
1214
|
-
return
|
|
1214
|
+
return ee(() => {
|
|
1215
1215
|
d.value?.hasAttribute("autofocus") && d.value.focus();
|
|
1216
1216
|
}), s({ focus: () => d.value?.focus() }), (p, M) => (a(), i("input", z({
|
|
1217
1217
|
ref_key: "input",
|
|
1218
1218
|
ref: d
|
|
1219
|
-
},
|
|
1219
|
+
}, C.value, {
|
|
1220
1220
|
type: f.value,
|
|
1221
1221
|
max: b.value,
|
|
1222
|
-
class: [
|
|
1222
|
+
class: [h.value, l.disabled ? l.disabledClass : null],
|
|
1223
1223
|
value: $.value,
|
|
1224
1224
|
disabled: l.disabled,
|
|
1225
|
-
onInput:
|
|
1226
|
-
onChange:
|
|
1225
|
+
onInput: S,
|
|
1226
|
+
onChange: S
|
|
1227
1227
|
}), null, 16, ul));
|
|
1228
1228
|
}
|
|
1229
1229
|
}), cl = { class: "relative" }, fl = { class: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" }, gl = ["accept"], yl = {
|
|
@@ -1306,17 +1306,17 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1306
1306
|
setup(e, { emit: s }) {
|
|
1307
1307
|
const t = s, l = e, r = g(() => l.options.map((f) => f == null ? "" : String(f).trim()).filter((f) => f !== "")), u = (f) => String(f) === String(l.modelValue ?? ""), d = (f) => t("update:modelValue", f);
|
|
1308
1308
|
return (f, $) => (a(), i("div", hl, [
|
|
1309
|
-
(a(!0), i(q, null, P(r.value, (b,
|
|
1310
|
-
key: `notation-${
|
|
1309
|
+
(a(!0), i(q, null, P(r.value, (b, C) => (a(), i("button", {
|
|
1310
|
+
key: `notation-${C}-${b}`,
|
|
1311
1311
|
type: "button",
|
|
1312
|
-
class:
|
|
1313
|
-
|
|
1314
|
-
|
|
1312
|
+
class: k(["flex-1 border-l border-gray-300 px-2 text-center font-semibold transition-colors duration-150 first:border-l-0", [
|
|
1313
|
+
C === 0 ? "rounded-l-lg" : "",
|
|
1314
|
+
C === r.value.length - 1 ? "rounded-r-lg" : "",
|
|
1315
1315
|
u(b) ? "bg-indigo-600 text-white" : "bg-white text-gray-700 hover:bg-gray-50",
|
|
1316
1316
|
"focus-visible:ring-2 "
|
|
1317
1317
|
]]),
|
|
1318
1318
|
disabled: e.disabled,
|
|
1319
|
-
onClick: (
|
|
1319
|
+
onClick: (h) => d(b)
|
|
1320
1320
|
}, T(b), 11, xl))), 128))
|
|
1321
1321
|
]));
|
|
1322
1322
|
}
|
|
@@ -1351,8 +1351,8 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1351
1351
|
}, f = () => {
|
|
1352
1352
|
u.value = !1;
|
|
1353
1353
|
}, $ = () => t("update:modelValue", l.value);
|
|
1354
|
-
return (b,
|
|
1355
|
-
class:
|
|
1354
|
+
return (b, C) => (a(), i("label", {
|
|
1355
|
+
class: k(["inline-flex items-center rounded-full border px-3 py-1 text-sm font-medium select-none transition-colors", [
|
|
1356
1356
|
r.value ? "bg-indigo-600 text-white border-indigo-600" : "text-gray-600 border-gray-200",
|
|
1357
1357
|
e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer",
|
|
1358
1358
|
u.value && !e.disabled ? "ring-2 ring-indigo-500/80 ring-offset-2 ring-offset-white" : ""
|
|
@@ -1532,7 +1532,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1532
1532
|
},
|
|
1533
1533
|
emits: ["update:modelValue", "blur"],
|
|
1534
1534
|
setup(e, { emit: s }) {
|
|
1535
|
-
const t = e, l = s, r = ne(), u = (U) => l("update:modelValue", U), d = g(() => !!t.errorMessage), f = g(() =>
|
|
1535
|
+
const t = e, l = s, r = ne(), u = (U) => l("update:modelValue", U), d = g(() => !!t.errorMessage), f = g(() => S.value || p.value), $ = g(() => {
|
|
1536
1536
|
const U = r.id;
|
|
1537
1537
|
return typeof U == "string" && U !== "" ? U : void 0;
|
|
1538
1538
|
}), b = [
|
|
@@ -1547,7 +1547,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1547
1547
|
"month",
|
|
1548
1548
|
"week",
|
|
1549
1549
|
"color"
|
|
1550
|
-
],
|
|
1550
|
+
], C = [], h = g(() => t.type === "image"), v = g(() => t.type === "notation"), S = g(() => t.type === "checkbox-input"), p = g(() => t.type === "radio-input"), M = g(() => t.type === "checkbox"), L = g(() => t.type === "radio"), E = g(() => t.type === "date" || t.type === "datetime-local"), F = g(() => t.type === "textarea"), re = g(() => t.type === "select"), Y = g(() => b.includes(t.type)), W = g(() => C.includes(t.type)), G = g(() => ({
|
|
1551
1551
|
...r,
|
|
1552
1552
|
class: [ce, r.class],
|
|
1553
1553
|
type: t.type,
|
|
@@ -1560,7 +1560,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1560
1560
|
modelValue: t.modelValue,
|
|
1561
1561
|
disabled: t.disabled,
|
|
1562
1562
|
disabledClass: t.disabledClass
|
|
1563
|
-
})),
|
|
1563
|
+
})), x = g(() => ({
|
|
1564
1564
|
...r,
|
|
1565
1565
|
class: [ce, r.class],
|
|
1566
1566
|
modelValue: t.modelValue,
|
|
@@ -1594,24 +1594,24 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1594
1594
|
modelValue: t.modelValue,
|
|
1595
1595
|
options: t.options,
|
|
1596
1596
|
disabled: t.disabled
|
|
1597
|
-
})),
|
|
1597
|
+
})), te = g(() => ({
|
|
1598
1598
|
...r,
|
|
1599
1599
|
modelValue: t.modelValue,
|
|
1600
1600
|
options: t.options,
|
|
1601
1601
|
name: t.name ?? r.name,
|
|
1602
1602
|
disabled: t.disabled
|
|
1603
|
-
})),
|
|
1603
|
+
})), le = g(() => ({
|
|
1604
1604
|
...r,
|
|
1605
1605
|
modelValue: t.modelValue,
|
|
1606
1606
|
label: t.label || r.label || "",
|
|
1607
1607
|
disabled: t.disabled
|
|
1608
|
-
})),
|
|
1608
|
+
})), ae = g(() => ({
|
|
1609
1609
|
...r,
|
|
1610
1610
|
modelValue: t.modelValue,
|
|
1611
1611
|
label: t.label || r.label || "",
|
|
1612
1612
|
name: t.name ?? r.name,
|
|
1613
1613
|
disabled: t.disabled
|
|
1614
|
-
})),
|
|
1614
|
+
})), se = g(() => ({
|
|
1615
1615
|
...r,
|
|
1616
1616
|
accept: t.accept ?? r.accept ?? "image/*",
|
|
1617
1617
|
modelValue: t.modelValue,
|
|
@@ -1619,7 +1619,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1619
1619
|
currentLabel: t.currentLabel,
|
|
1620
1620
|
currentSubtext: t.currentSubtext
|
|
1621
1621
|
}));
|
|
1622
|
-
return (U,
|
|
1622
|
+
return (U, V) => (a(), i("div", null, [
|
|
1623
1623
|
e.label && !f.value ? (a(), i("label", {
|
|
1624
1624
|
key: 0,
|
|
1625
1625
|
for: $.value,
|
|
@@ -1627,42 +1627,42 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1627
1627
|
}, T(e.label), 9, Sl)) : D("", !0),
|
|
1628
1628
|
e.helperText && !f.value ? (a(), i("span", $l, T(e.helperText), 1)) : D("", !0),
|
|
1629
1629
|
F.value ? (a(), B(ze, z({ key: 2 }, J.value, {
|
|
1630
|
-
"onUpdate:modelValue":
|
|
1631
|
-
onBlur:
|
|
1630
|
+
"onUpdate:modelValue": V[0] || (V[0] = (_) => l("update:modelValue", _)),
|
|
1631
|
+
onBlur: V[1] || (V[1] = (_) => l("blur", _))
|
|
1632
1632
|
}), null, 16)) : re.value ? (a(), B(Fe, z({ key: 3 }, N.value, {
|
|
1633
|
-
"onUpdate:modelValue":
|
|
1634
|
-
onBlur:
|
|
1635
|
-
}), null, 16)) : E.value ? (a(), B(Ne, z({ key: 4 },
|
|
1636
|
-
"onUpdate:modelValue":
|
|
1637
|
-
onBlur:
|
|
1633
|
+
"onUpdate:modelValue": V[2] || (V[2] = (_) => l("update:modelValue", _)),
|
|
1634
|
+
onBlur: V[3] || (V[3] = (_) => l("blur", _))
|
|
1635
|
+
}), null, 16)) : E.value ? (a(), B(Ne, z({ key: 4 }, x.value, {
|
|
1636
|
+
"onUpdate:modelValue": V[4] || (V[4] = (_) => l("update:modelValue", _)),
|
|
1637
|
+
onBlur: V[5] || (V[5] = (_) => l("blur", _))
|
|
1638
1638
|
}), null, 16)) : Y.value ? (a(), B(Oe, z({ key: 5 }, G.value, {
|
|
1639
|
-
"onUpdate:modelValue":
|
|
1640
|
-
onBlur:
|
|
1641
|
-
}), null, 16)) :
|
|
1642
|
-
"onUpdate:modelValue":
|
|
1643
|
-
onBlur:
|
|
1644
|
-
}), null, 16)) :
|
|
1645
|
-
"onUpdate:modelValue":
|
|
1646
|
-
onBlur:
|
|
1647
|
-
}), null, 16)) : p.value ? (a(), B(Re, z({ key: 8 },
|
|
1648
|
-
"onUpdate:modelValue":
|
|
1649
|
-
onBlur:
|
|
1650
|
-
}), null, 16)) :
|
|
1651
|
-
"onUpdate:modelValue":
|
|
1652
|
-
onBlur:
|
|
1639
|
+
"onUpdate:modelValue": V[6] || (V[6] = (_) => l("update:modelValue", _)),
|
|
1640
|
+
onBlur: V[7] || (V[7] = (_) => l("blur", _))
|
|
1641
|
+
}), null, 16)) : h.value ? (a(), B(Ke, z({ key: 6 }, se.value, {
|
|
1642
|
+
"onUpdate:modelValue": V[8] || (V[8] = (_) => l("update:modelValue", _)),
|
|
1643
|
+
onBlur: V[9] || (V[9] = (_) => l("blur", _))
|
|
1644
|
+
}), null, 16)) : S.value ? (a(), B(je, z({ key: 7 }, le.value, {
|
|
1645
|
+
"onUpdate:modelValue": V[10] || (V[10] = (_) => l("update:modelValue", _)),
|
|
1646
|
+
onBlur: V[11] || (V[11] = (_) => l("blur", _))
|
|
1647
|
+
}), null, 16)) : p.value ? (a(), B(Re, z({ key: 8 }, ae.value, {
|
|
1648
|
+
"onUpdate:modelValue": V[12] || (V[12] = (_) => l("update:modelValue", _)),
|
|
1649
|
+
onBlur: V[13] || (V[13] = (_) => l("blur", _))
|
|
1650
|
+
}), null, 16)) : v.value ? (a(), B(Ue, z({ key: 9 }, K.value, {
|
|
1651
|
+
"onUpdate:modelValue": V[14] || (V[14] = (_) => l("update:modelValue", _)),
|
|
1652
|
+
onBlur: V[15] || (V[15] = (_) => l("blur", _))
|
|
1653
1653
|
}), null, 16)) : M.value ? (a(), B(qe, z({ key: 10 }, X.value, {
|
|
1654
|
-
"onUpdate:modelValue":
|
|
1655
|
-
onBlur:
|
|
1656
|
-
}), null, 16)) : L.value ? (a(), B(He, z({ key: 11 },
|
|
1657
|
-
"onUpdate:modelValue":
|
|
1658
|
-
onBlur:
|
|
1659
|
-
}), null, 16)) : W.value ?
|
|
1654
|
+
"onUpdate:modelValue": V[16] || (V[16] = (_) => l("update:modelValue", _)),
|
|
1655
|
+
onBlur: V[17] || (V[17] = (_) => l("blur", _))
|
|
1656
|
+
}), null, 16)) : L.value ? (a(), B(He, z({ key: 11 }, te.value, {
|
|
1657
|
+
"onUpdate:modelValue": V[18] || (V[18] = (_) => l("update:modelValue", _)),
|
|
1658
|
+
onBlur: V[19] || (V[19] = (_) => l("blur", _))
|
|
1659
|
+
}), null, 16)) : W.value ? w(U.$slots, "unsupported-type", {
|
|
1660
1660
|
key: 12,
|
|
1661
1661
|
type: e.type,
|
|
1662
1662
|
modelValue: e.modelValue,
|
|
1663
1663
|
updateValue: u,
|
|
1664
1664
|
attrs: I(r)
|
|
1665
|
-
}) :
|
|
1665
|
+
}) : w(U.$slots, "unsupported-type", {
|
|
1666
1666
|
key: 13,
|
|
1667
1667
|
type: e.type,
|
|
1668
1668
|
modelValue: e.modelValue,
|
|
@@ -1694,8 +1694,8 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1694
1694
|
emits: ["update:modelValue"],
|
|
1695
1695
|
setup(e, { emit: s }) {
|
|
1696
1696
|
const t = s, l = e, r = g(() => l.options.map((f) => f == null ? "" : String(f).trim()).filter((f) => f !== "")), u = (f) => Array.isArray(l.modelValue) && l.modelValue.includes(f), d = (f, $) => {
|
|
1697
|
-
const b = Array.isArray(l.modelValue) ? [...l.modelValue] : [],
|
|
1698
|
-
$ &&
|
|
1697
|
+
const b = Array.isArray(l.modelValue) ? [...l.modelValue] : [], C = b.indexOf(f);
|
|
1698
|
+
$ && C === -1 ? b.push(f) : !$ && C !== -1 && b.splice(C, 1), t("update:modelValue", b);
|
|
1699
1699
|
};
|
|
1700
1700
|
return (f, $) => (a(), i("div", Vl, [
|
|
1701
1701
|
(a(!0), i(q, null, P(r.value, (b) => (a(), B(ye, {
|
|
@@ -1706,7 +1706,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1706
1706
|
"unchecked-value": !1,
|
|
1707
1707
|
label: b,
|
|
1708
1708
|
disabled: e.disabled,
|
|
1709
|
-
"onUpdate:modelValue": (
|
|
1709
|
+
"onUpdate:modelValue": (C) => d(b, C)
|
|
1710
1710
|
}, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"]))), 128))
|
|
1711
1711
|
]));
|
|
1712
1712
|
}
|
|
@@ -1733,27 +1733,33 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1733
1733
|
},
|
|
1734
1734
|
emits: ["close"],
|
|
1735
1735
|
setup(e, { emit: s }) {
|
|
1736
|
-
const t = e, l = s, r = j(), u = j(t.show)
|
|
1737
|
-
|
|
1738
|
-
|
|
1736
|
+
const t = e, l = s, r = j(), u = j(t.show), d = () => {
|
|
1737
|
+
document.body.style.overflow = "hidden", u.value = !0, r.value?.showModal();
|
|
1738
|
+
}, f = () => {
|
|
1739
|
+
document.body.style.overflow = null, setTimeout(() => {
|
|
1739
1740
|
r.value?.close(), u.value = !1;
|
|
1740
|
-
}, 200)
|
|
1741
|
+
}, 200);
|
|
1742
|
+
};
|
|
1743
|
+
Q(() => t.show, () => {
|
|
1744
|
+
t.show ? d() : f();
|
|
1745
|
+
}), ee(() => {
|
|
1746
|
+
t.show && d();
|
|
1741
1747
|
});
|
|
1742
|
-
const
|
|
1748
|
+
const $ = () => {
|
|
1743
1749
|
t.closeable && l("close");
|
|
1744
|
-
},
|
|
1745
|
-
|
|
1750
|
+
}, b = (v) => {
|
|
1751
|
+
v.key === "Escape" && (v.preventDefault(), t.show && $());
|
|
1746
1752
|
};
|
|
1747
|
-
|
|
1748
|
-
document.removeEventListener("keydown",
|
|
1753
|
+
ee(() => document.addEventListener("keydown", b)), Ae(() => {
|
|
1754
|
+
document.removeEventListener("keydown", b), document.body.style.overflow = null;
|
|
1749
1755
|
});
|
|
1750
|
-
const
|
|
1756
|
+
const C = g(() => ({
|
|
1751
1757
|
sm: "sm:max-w-sm",
|
|
1752
1758
|
md: "sm:max-w-md",
|
|
1753
1759
|
lg: "sm:max-w-lg",
|
|
1754
1760
|
xl: "sm:max-w-xl",
|
|
1755
1761
|
"2xl": "sm:max-w-2xl"
|
|
1756
|
-
})[t.maxWidth]),
|
|
1762
|
+
})[t.maxWidth]), h = g(() => {
|
|
1757
1763
|
switch (t.position) {
|
|
1758
1764
|
case "top":
|
|
1759
1765
|
return "flex-col items-center pt-16";
|
|
@@ -1763,13 +1769,13 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1763
1769
|
return "items-center justify-center";
|
|
1764
1770
|
}
|
|
1765
1771
|
});
|
|
1766
|
-
return (
|
|
1772
|
+
return (v, S) => (a(), i("dialog", {
|
|
1767
1773
|
class: "z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent",
|
|
1768
1774
|
ref_key: "dialog",
|
|
1769
1775
|
ref: r
|
|
1770
1776
|
}, [
|
|
1771
1777
|
o("div", {
|
|
1772
|
-
class:
|
|
1778
|
+
class: k(["fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50 flex", h.value])
|
|
1773
1779
|
}, [
|
|
1774
1780
|
R(oe, {
|
|
1775
1781
|
"enter-active-class": "ease-out duration-300",
|
|
@@ -1781,9 +1787,9 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1781
1787
|
}, {
|
|
1782
1788
|
default: O(() => [
|
|
1783
1789
|
Z(o("div", {
|
|
1784
|
-
class: "fixed inset-0 transform transition-all",
|
|
1785
|
-
onClick:
|
|
1786
|
-
}, [...
|
|
1790
|
+
class: "fixed inset-0 z-40 transform transition-all",
|
|
1791
|
+
onClick: $
|
|
1792
|
+
}, [...S[0] || (S[0] = [
|
|
1787
1793
|
o("div", { class: "absolute inset-0 bg-gray-500 opacity-75" }, null, -1)
|
|
1788
1794
|
])], 512), [
|
|
1789
1795
|
[ie, e.show]
|
|
@@ -1801,9 +1807,9 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1801
1807
|
}, {
|
|
1802
1808
|
default: O(() => [
|
|
1803
1809
|
Z(o("div", {
|
|
1804
|
-
class:
|
|
1810
|
+
class: k(["relative z-50 mb-6 bg-white rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto", C.value])
|
|
1805
1811
|
}, [
|
|
1806
|
-
u.value ?
|
|
1812
|
+
u.value ? w(v.$slots, "default", { key: 0 }) : D("", !0)
|
|
1807
1813
|
], 2), [
|
|
1808
1814
|
[ie, e.show]
|
|
1809
1815
|
])
|
|
@@ -1854,16 +1860,16 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1854
1860
|
]),
|
|
1855
1861
|
o("div", Bl, [
|
|
1856
1862
|
o("h3", Ll, [
|
|
1857
|
-
|
|
1863
|
+
w(r.$slots, "title")
|
|
1858
1864
|
]),
|
|
1859
1865
|
o("div", Il, [
|
|
1860
|
-
|
|
1866
|
+
w(r.$slots, "content")
|
|
1861
1867
|
])
|
|
1862
1868
|
])
|
|
1863
1869
|
])
|
|
1864
1870
|
]),
|
|
1865
1871
|
o("div", Dl, [
|
|
1866
|
-
|
|
1872
|
+
w(r.$slots, "footer")
|
|
1867
1873
|
])
|
|
1868
1874
|
]),
|
|
1869
1875
|
_: 3
|
|
@@ -1899,20 +1905,20 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1899
1905
|
default: O(() => [
|
|
1900
1906
|
o("div", jl, [
|
|
1901
1907
|
o("div", Ol, [
|
|
1902
|
-
|
|
1908
|
+
w(r.$slots, "title")
|
|
1903
1909
|
]),
|
|
1904
1910
|
o("div", zl, [
|
|
1905
|
-
|
|
1911
|
+
w(r.$slots, "content")
|
|
1906
1912
|
])
|
|
1907
1913
|
]),
|
|
1908
1914
|
o("div", El, [
|
|
1909
|
-
|
|
1915
|
+
w(r.$slots, "footer")
|
|
1910
1916
|
])
|
|
1911
1917
|
]),
|
|
1912
1918
|
_: 3
|
|
1913
1919
|
}, 8, ["show", "max-width", "closeable"]));
|
|
1914
1920
|
}
|
|
1915
|
-
}, Nl = { class: "relative" }, Kl = {
|
|
1921
|
+
}, Nl = { class: "relative inline-block w-fit" }, Kl = {
|
|
1916
1922
|
__name: "Dropdown",
|
|
1917
1923
|
props: {
|
|
1918
1924
|
align: {
|
|
@@ -1934,15 +1940,15 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1934
1940
|
const l = (d) => {
|
|
1935
1941
|
t.value && d.key === "Escape" && (t.value = !1);
|
|
1936
1942
|
};
|
|
1937
|
-
|
|
1943
|
+
ee(() => document.addEventListener("keydown", l)), Ae(() => document.removeEventListener("keydown", l));
|
|
1938
1944
|
const r = g(() => ({
|
|
1939
1945
|
48: "w-48"
|
|
1940
|
-
})[s.width.toString()]), u = g(() => s.align === "left" ? "ltr:origin-top-left rtl:origin-top-right start-0" : s.align === "right" ? "ltr:origin-top-right rtl:origin-top-left
|
|
1946
|
+
})[s.width.toString()]), u = g(() => s.align === "left" ? "ltr:origin-top-left rtl:origin-top-right start-0" : s.align === "right" ? "ltr:origin-top-right rtl:origin-top-left" : "origin-top");
|
|
1941
1947
|
return (d, f) => (a(), i("div", Nl, [
|
|
1942
1948
|
o("div", {
|
|
1943
1949
|
onClick: f[0] || (f[0] = ($) => me(t) ? t.value = !I(t) : t = !I(t))
|
|
1944
1950
|
}, [
|
|
1945
|
-
|
|
1951
|
+
w(d.$slots, "trigger", { open: I(t) })
|
|
1946
1952
|
]),
|
|
1947
1953
|
Z(o("div", {
|
|
1948
1954
|
class: "fixed inset-0 z-40",
|
|
@@ -1960,14 +1966,14 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1960
1966
|
}, {
|
|
1961
1967
|
default: O(() => [
|
|
1962
1968
|
Z(o("div", {
|
|
1963
|
-
class:
|
|
1969
|
+
class: k(["absolute z-50 mt-2 rounded-xl shadow-xl shadow-gray-900/10", [r.value, u.value]]),
|
|
1964
1970
|
style: { display: "none" },
|
|
1965
1971
|
onClick: f[2] || (f[2] = ($) => me(t) ? t.value = !1 : t = !1)
|
|
1966
1972
|
}, [
|
|
1967
1973
|
o("div", {
|
|
1968
|
-
class:
|
|
1974
|
+
class: k(["rounded-xl ring-1 ring-gray-200/60 backdrop-blur-sm bg-white/95", e.contentClasses])
|
|
1969
1975
|
}, [
|
|
1970
|
-
|
|
1976
|
+
w(d.$slots, "content")
|
|
1971
1977
|
], 2)
|
|
1972
1978
|
], 2), [
|
|
1973
1979
|
[ie, I(t)]
|
|
@@ -1990,20 +1996,20 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
1990
1996
|
setup(e) {
|
|
1991
1997
|
return (s, t) => (a(), i("div", null, [
|
|
1992
1998
|
e.as == "button" ? (a(), i("button", Ul, [
|
|
1993
|
-
|
|
1999
|
+
w(s.$slots, "default")
|
|
1994
2000
|
])) : e.as == "a" ? (a(), i("a", {
|
|
1995
2001
|
key: 1,
|
|
1996
2002
|
href: e.href,
|
|
1997
2003
|
class: "block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out"
|
|
1998
2004
|
}, [
|
|
1999
|
-
|
|
2005
|
+
w(s.$slots, "default")
|
|
2000
2006
|
], 8, Rl)) : (a(), B(I(ge), {
|
|
2001
2007
|
key: 2,
|
|
2002
2008
|
href: e.href,
|
|
2003
2009
|
class: "block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out"
|
|
2004
2010
|
}, {
|
|
2005
2011
|
default: O(() => [
|
|
2006
|
-
|
|
2012
|
+
w(s.$slots, "default")
|
|
2007
2013
|
]),
|
|
2008
2014
|
_: 3
|
|
2009
2015
|
}, 8, ["href"]))
|
|
@@ -2020,10 +2026,10 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2020
2026
|
return (t, l) => (a(), i("div", ql, [
|
|
2021
2027
|
R(Se, null, {
|
|
2022
2028
|
title: O(() => [
|
|
2023
|
-
|
|
2029
|
+
w(t.$slots, "title")
|
|
2024
2030
|
]),
|
|
2025
2031
|
description: O(() => [
|
|
2026
|
-
|
|
2032
|
+
w(t.$slots, "description")
|
|
2027
2033
|
]),
|
|
2028
2034
|
_: 3
|
|
2029
2035
|
}),
|
|
@@ -2032,14 +2038,14 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2032
2038
|
onSubmit: l[0] || (l[0] = ve((r) => t.$emit("submitted"), ["prevent"]))
|
|
2033
2039
|
}, [
|
|
2034
2040
|
o("div", {
|
|
2035
|
-
class:
|
|
2041
|
+
class: k(["px-4 py-5 bg-white sm:p-6", s.value ? "sm:rounded-tl-md sm:rounded-tr-md" : "sm:rounded-md"])
|
|
2036
2042
|
}, [
|
|
2037
2043
|
o("div", Wl, [
|
|
2038
|
-
|
|
2044
|
+
w(t.$slots, "form")
|
|
2039
2045
|
])
|
|
2040
2046
|
], 2),
|
|
2041
2047
|
s.value ? (a(), i("div", Gl, [
|
|
2042
|
-
|
|
2048
|
+
w(t.$slots, "actions")
|
|
2043
2049
|
])) : D("", !0)
|
|
2044
2050
|
], 32)
|
|
2045
2051
|
])
|
|
@@ -2065,7 +2071,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2065
2071
|
setup(e) {
|
|
2066
2072
|
return (s, t) => (a(), i("label", Jl, [
|
|
2067
2073
|
e.value ? (a(), i("span", Zl, T(e.value), 1)) : (a(), i("span", ea, [
|
|
2068
|
-
|
|
2074
|
+
w(s.$slots, "default")
|
|
2069
2075
|
]))
|
|
2070
2076
|
]));
|
|
2071
2077
|
}
|
|
@@ -2118,14 +2124,14 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2118
2124
|
rel: e.rel,
|
|
2119
2125
|
class: u.value
|
|
2120
2126
|
}), [
|
|
2121
|
-
|
|
2127
|
+
w(d.$slots, "default")
|
|
2122
2128
|
], 16, la)) : (a(), B(I(ge), z({ key: 0 }, I(s), {
|
|
2123
2129
|
href: e.href,
|
|
2124
2130
|
title: e.title,
|
|
2125
2131
|
class: u.value
|
|
2126
2132
|
}), {
|
|
2127
2133
|
default: O(() => [
|
|
2128
|
-
|
|
2134
|
+
w(d.$slots, "default")
|
|
2129
2135
|
]),
|
|
2130
2136
|
_: 3
|
|
2131
2137
|
}, 16, ["href", "title", "class"]));
|
|
@@ -2140,10 +2146,10 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2140
2146
|
const s = e, t = g(() => s.active ? "inline-flex items-center px-1 pt-1 border-b-2 border-indigo-500 text-sm font-semibold leading-5 text-gray-900 focus:outline-none focus:border-indigo-700 transition-all duration-300 ease-out relative group" : "inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-600 hover:text-gray-900 hover:border-gray-400 focus:outline-none focus:text-gray-900 focus:border-gray-400 transition-all duration-300 ease-out relative group");
|
|
2141
2147
|
return (l, r) => (a(), B(I(ge), {
|
|
2142
2148
|
href: e.href,
|
|
2143
|
-
class:
|
|
2149
|
+
class: k(t.value)
|
|
2144
2150
|
}, {
|
|
2145
2151
|
default: O(() => [
|
|
2146
|
-
|
|
2152
|
+
w(l.$slots, "default")
|
|
2147
2153
|
]),
|
|
2148
2154
|
_: 3
|
|
2149
2155
|
}, 8, ["href", "class"]));
|
|
@@ -2160,22 +2166,22 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2160
2166
|
return (l, r) => (a(), i("div", null, [
|
|
2161
2167
|
e.as == "button" ? (a(), i("button", {
|
|
2162
2168
|
key: 0,
|
|
2163
|
-
class:
|
|
2169
|
+
class: k([t.value, "w-full text-start"])
|
|
2164
2170
|
}, [
|
|
2165
|
-
|
|
2171
|
+
w(l.$slots, "default")
|
|
2166
2172
|
], 2)) : e.as == "a" ? (a(), i("a", {
|
|
2167
2173
|
key: 1,
|
|
2168
|
-
class:
|
|
2174
|
+
class: k([t.value, "w-full text-start"]),
|
|
2169
2175
|
href: e.href
|
|
2170
2176
|
}, [
|
|
2171
|
-
|
|
2177
|
+
w(l.$slots, "default")
|
|
2172
2178
|
], 10, sa)) : (a(), B(I(ge), {
|
|
2173
2179
|
key: 2,
|
|
2174
2180
|
href: e.href,
|
|
2175
|
-
class:
|
|
2181
|
+
class: k(t.value)
|
|
2176
2182
|
}, {
|
|
2177
2183
|
default: O(() => [
|
|
2178
|
-
|
|
2184
|
+
w(l.$slots, "default")
|
|
2179
2185
|
]),
|
|
2180
2186
|
_: 3
|
|
2181
2187
|
}, 8, ["href", "class"]))
|
|
@@ -2235,7 +2241,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2235
2241
|
(a(!0), i(q, null, P(e.fields, (d) => (a(), i("button", {
|
|
2236
2242
|
key: d.key,
|
|
2237
2243
|
onClick: (f) => l(d.key),
|
|
2238
|
-
class:
|
|
2244
|
+
class: k([
|
|
2239
2245
|
"px-3 py-1.5 text-sm font-medium rounded-lg transition-all duration-200",
|
|
2240
2246
|
e.currentSortField === d.key ? "bg-blue-500 text-white shadow-sm" : "bg-gray-100 text-gray-700 hover:bg-gray-200"
|
|
2241
2247
|
])
|
|
@@ -2280,16 +2286,16 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2280
2286
|
}, [
|
|
2281
2287
|
o("div", ba, [
|
|
2282
2288
|
o("span", null, [
|
|
2283
|
-
|
|
2289
|
+
w(r.$slots, "default")
|
|
2284
2290
|
]),
|
|
2285
2291
|
o("div", va, [
|
|
2286
2292
|
t.value && e.currentDirection === "asc" ? (a(), B(I(Ie), {
|
|
2287
2293
|
key: 0,
|
|
2288
|
-
class:
|
|
2294
|
+
class: k([l.value, "w-3 h-3"])
|
|
2289
2295
|
}, null, 8, ["class"])) : D("", !0),
|
|
2290
2296
|
t.value && e.currentDirection === "desc" ? (a(), B(I(xe), {
|
|
2291
2297
|
key: 1,
|
|
2292
|
-
class:
|
|
2298
|
+
class: k([l.value, "w-3 h-3"])
|
|
2293
2299
|
}, null, 8, ["class"])) : D("", !0)
|
|
2294
2300
|
])
|
|
2295
2301
|
])
|
|
@@ -2367,29 +2373,29 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2367
2373
|
setup(e, { emit: s }) {
|
|
2368
2374
|
const t = fe(), l = e, r = s;
|
|
2369
2375
|
g(() => !!t.actions);
|
|
2370
|
-
const u = g(() => l.data && l.data.length > 0), d = (
|
|
2371
|
-
r("sort",
|
|
2372
|
-
}, f = (
|
|
2373
|
-
const
|
|
2374
|
-
return !Number.isFinite(p) || p <= 0 ||
|
|
2375
|
-
}, $ = (
|
|
2376
|
-
if (
|
|
2376
|
+
const u = g(() => l.data && l.data.length > 0), d = (v) => {
|
|
2377
|
+
r("sort", v);
|
|
2378
|
+
}, f = (v) => {
|
|
2379
|
+
const S = String(v ?? ""), p = Number(l.maxTextLength);
|
|
2380
|
+
return !Number.isFinite(p) || p <= 0 || S.length <= p ? S : `${S.slice(0, p)}...`;
|
|
2381
|
+
}, $ = (v, S) => {
|
|
2382
|
+
if (S.slot)
|
|
2377
2383
|
return null;
|
|
2378
|
-
if (
|
|
2379
|
-
return
|
|
2380
|
-
const p =
|
|
2384
|
+
if (S.render)
|
|
2385
|
+
return S.render(v);
|
|
2386
|
+
const p = S.key.split(".").reduce((M, L) => M?.[L], v);
|
|
2381
2387
|
return p == null || p === "" ? "-" : f(p);
|
|
2382
|
-
}, b = (
|
|
2383
|
-
if (
|
|
2384
|
-
return
|
|
2385
|
-
let
|
|
2386
|
-
return
|
|
2387
|
-
},
|
|
2388
|
-
return (
|
|
2389
|
-
class:
|
|
2388
|
+
}, b = (v) => v.deleted_at || v.deleted, C = (v) => {
|
|
2389
|
+
if (v.class)
|
|
2390
|
+
return v.class;
|
|
2391
|
+
let S = "px-6 py-4 text-sm truncate";
|
|
2392
|
+
return v.isSecondary || (S += " font-medium"), v.isSecondary && (S += " text-gray-600"), S;
|
|
2393
|
+
}, h = (v) => v.sortable ? "" : "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider";
|
|
2394
|
+
return (v, S) => (a(), i("div", {
|
|
2395
|
+
class: k(["bg-white", e.isCard ? "border border-gray-200/60 rounded-xl shadow-[0_1px_3px_rgba(0,0,0,0.1)] animate-fadeIn mx-4 md:mx-0" : ""])
|
|
2390
2396
|
}, [
|
|
2391
2397
|
o("div", {
|
|
2392
|
-
class:
|
|
2398
|
+
class: k(["overflow-x-auto", e.isCard ? "rounded-xl" : ""])
|
|
2393
2399
|
}, [
|
|
2394
2400
|
o("table", ha, [
|
|
2395
2401
|
o("thead", xa, [
|
|
@@ -2410,20 +2416,20 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2410
2416
|
_: 2
|
|
2411
2417
|
}, 1032, ["field", "current-sort-field", "current-direction"])) : (a(), i("th", {
|
|
2412
2418
|
key: 1,
|
|
2413
|
-
class:
|
|
2419
|
+
class: k([h(p), { "text-right": p.align === "right" }])
|
|
2414
2420
|
}, T(p.label), 3))
|
|
2415
2421
|
], 64))), 128)),
|
|
2416
|
-
|
|
2422
|
+
v.$slots.actions ? (a(), i("th", wa, T(e.actionsLabel), 1)) : D("", !0)
|
|
2417
2423
|
])
|
|
2418
2424
|
]),
|
|
2419
2425
|
o("tbody", ka, [
|
|
2420
2426
|
(a(!0), i(q, null, P(e.data, (p, M) => (a(), i("tr", {
|
|
2421
2427
|
key: p.id,
|
|
2422
|
-
class:
|
|
2428
|
+
class: k(e.rowClasses(p, M))
|
|
2423
2429
|
}, [
|
|
2424
2430
|
(a(!0), i(q, null, P(e.columns, (L) => (a(), i("td", {
|
|
2425
2431
|
key: L.key,
|
|
2426
|
-
class:
|
|
2432
|
+
class: k(C(L))
|
|
2427
2433
|
}, [
|
|
2428
2434
|
L.key === "name" && !L.slot ? (a(), i("div", Sa, [
|
|
2429
2435
|
o("div", {
|
|
@@ -2431,7 +2437,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2431
2437
|
title: $(p, L)
|
|
2432
2438
|
}, T($(p, L)), 9, $a),
|
|
2433
2439
|
b(p) ? (a(), i("span", Ca, T(e.deletedLabel), 1)) : D("", !0)
|
|
2434
|
-
])) : L.slot ?
|
|
2440
|
+
])) : L.slot ? w(v.$slots, L.slot, {
|
|
2435
2441
|
key: 1,
|
|
2436
2442
|
item: p,
|
|
2437
2443
|
column: L,
|
|
@@ -2441,8 +2447,8 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2441
2447
|
innerHTML: L.render(p)
|
|
2442
2448
|
}, null, 8, Va)) : (a(), i("div", _a, T($(p, L)), 1))
|
|
2443
2449
|
], 2))), 128)),
|
|
2444
|
-
|
|
2445
|
-
|
|
2450
|
+
v.$slots.actions ? (a(), i("td", Ta, [
|
|
2451
|
+
w(v.$slots, "actions", {
|
|
2446
2452
|
item: p,
|
|
2447
2453
|
index: M
|
|
2448
2454
|
})
|
|
@@ -2584,14 +2590,14 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2584
2590
|
},
|
|
2585
2591
|
emits: ["sort", "update", "update:editingRowKey", "edit-start", "edit-cancel"],
|
|
2586
2592
|
setup(e, { emit: s }) {
|
|
2587
|
-
const t = fe(), l = e, r = s, u = j(l.sortField), d = j(l.sortDirection), f = j(""), $ = j(null), b = j({}),
|
|
2593
|
+
const t = fe(), l = e, r = s, u = j(l.sortField), d = j(l.sortDirection), f = j(""), $ = j(null), b = j({}), C = g(() => l.editingRowKey !== void 0 ? l.editingRowKey : $.value);
|
|
2588
2594
|
Q(() => l.sortField, (n) => {
|
|
2589
2595
|
u.value = n;
|
|
2590
2596
|
}), Q(() => l.sortDirection, (n) => {
|
|
2591
2597
|
d.value = n;
|
|
2592
2598
|
}), Q(() => l.rowEditing, (n) => {
|
|
2593
2599
|
n || X();
|
|
2594
|
-
}), Q(
|
|
2600
|
+
}), Q(C, (n, y) => {
|
|
2595
2601
|
if (n === y)
|
|
2596
2602
|
return;
|
|
2597
2603
|
if (n == null || n === "") {
|
|
@@ -2603,13 +2609,13 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2603
2609
|
}), Q(
|
|
2604
2610
|
() => l.data,
|
|
2605
2611
|
() => {
|
|
2606
|
-
if (
|
|
2612
|
+
if (C.value === null || C.value === void 0)
|
|
2607
2613
|
return;
|
|
2608
|
-
l.data.find((y, c) => W(y, c) ===
|
|
2614
|
+
l.data.find((y, c) => W(y, c) === C.value) || X();
|
|
2609
2615
|
},
|
|
2610
2616
|
{ deep: !0 }
|
|
2611
2617
|
);
|
|
2612
|
-
const
|
|
2618
|
+
const h = g(() => {
|
|
2613
2619
|
let n = l.data;
|
|
2614
2620
|
if (l.search && f.value.trim()) {
|
|
2615
2621
|
const y = f.value.toLowerCase().trim();
|
|
@@ -2627,7 +2633,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2627
2633
|
let H = 0;
|
|
2628
2634
|
return A < m && (H = -1), A > m && (H = 1), d.value === "desc" ? -H : H;
|
|
2629
2635
|
}) : n;
|
|
2630
|
-
}),
|
|
2636
|
+
}), v = g(() => !!t.actions), S = g(() => v.value || l.rowEditing), p = g(() => h.value && h.value.length > 0), M = (n) => {
|
|
2631
2637
|
u.value === n ? d.value = d.value === "asc" ? "desc" : "asc" : (u.value = n, d.value = "asc"), r("sort", { field: n, direction: d.value });
|
|
2632
2638
|
}, L = (n) => Array.isArray(n) ? n.map((y) => L(y)) : n && typeof n == "object" ? Object.fromEntries(
|
|
2633
2639
|
Object.entries(n).map(([y, c]) => [y, L(c)])
|
|
@@ -2642,36 +2648,36 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2642
2648
|
for (const de of A)
|
|
2643
2649
|
(H[de] === void 0 || H[de] === null || typeof H[de] != "object") && (H[de] = {}), H = H[de];
|
|
2644
2650
|
m !== void 0 && (H[m] = c);
|
|
2645
|
-
}, Y = (n) => n?.id ? l.data.findIndex((y) => y?.id === n.id) : l.data.findIndex((y) => y === n), W = (n, y) => typeof l.rowKey == "function" ? l.rowKey(n, y) ?? `row-${y}` : F(n, l.rowKey) ?? `row-${y}`, G = (n) => `${n.slot}-edit`, J = (n) => l.isDeletedFn(n),
|
|
2651
|
+
}, Y = (n) => n?.id ? l.data.findIndex((y) => y?.id === n.id) : l.data.findIndex((y) => y === n), W = (n, y) => typeof l.rowKey == "function" ? l.rowKey(n, y) ?? `row-${y}` : F(n, l.rowKey) ?? `row-${y}`, G = (n) => `${n.slot}-edit`, J = (n) => l.isDeletedFn(n), x = (n) => {
|
|
2646
2652
|
l.editingRowKey === void 0 && ($.value = n), r("update:editingRowKey", n);
|
|
2647
|
-
}, N = (n, y) => l.rowEditing &&
|
|
2648
|
-
|
|
2649
|
-
},
|
|
2653
|
+
}, N = (n, y) => l.rowEditing && C.value !== null && C.value === W(n, y), K = (n, y) => !l.rowEditing || !l.canEditRow(n, y) || J(n) ? !0 : C.value !== null && !N(n, y), X = () => {
|
|
2654
|
+
x(null);
|
|
2655
|
+
}, te = (n, y) => {
|
|
2650
2656
|
if (K(n, y))
|
|
2651
2657
|
return;
|
|
2652
2658
|
const c = W(n, y);
|
|
2653
|
-
|
|
2659
|
+
x(c), r("edit-start", {
|
|
2654
2660
|
item: n,
|
|
2655
2661
|
index: Y(n),
|
|
2656
2662
|
rowKey: c
|
|
2657
2663
|
});
|
|
2658
|
-
},
|
|
2664
|
+
}, le = (n, y) => {
|
|
2659
2665
|
r("edit-cancel", {
|
|
2660
2666
|
item: n,
|
|
2661
2667
|
index: Y(n),
|
|
2662
2668
|
rowKey: W(n, y)
|
|
2663
2669
|
}), X();
|
|
2664
|
-
},
|
|
2670
|
+
}, ae = (n, y, c, A = void 0) => {
|
|
2665
2671
|
re(b.value, n, y), l.mutateRows && re(c, n, L(y)), r("update", {
|
|
2666
2672
|
item: c,
|
|
2667
2673
|
draft: b.value,
|
|
2668
2674
|
field: n,
|
|
2669
2675
|
value: y,
|
|
2670
2676
|
index: Y(c),
|
|
2671
|
-
rowKey:
|
|
2677
|
+
rowKey: C.value,
|
|
2672
2678
|
event: A
|
|
2673
2679
|
});
|
|
2674
|
-
},
|
|
2680
|
+
}, se = (n, y) => {
|
|
2675
2681
|
if (y.slot)
|
|
2676
2682
|
return null;
|
|
2677
2683
|
if (y.render)
|
|
@@ -2683,7 +2689,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2683
2689
|
return n.class;
|
|
2684
2690
|
let m = N(y, c) && (n.input || t[G(n)]) ? "px-6 py-3 text-sm align-top" : "px-6 py-4 text-sm truncate";
|
|
2685
2691
|
return n.isSecondary || (m += " font-medium"), n.isSecondary && (m += " text-gray-600"), m;
|
|
2686
|
-
},
|
|
2692
|
+
}, V = (n) => n.sortable ? "" : "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider", _ = (n) => n.inputType || "text", Pe = (n) => {
|
|
2687
2693
|
let y = "block w-full min-w-[12rem] sm:min-w-[10rem] max-w-xs rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 shadow-none placeholder-gray-400 transition-colors duration-200 focus:border-blue-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-blue-500/20";
|
|
2688
2694
|
return n.inputClass && (y += ` ${n.inputClass}`), n.isSecondary && (y += " text-gray-600"), y;
|
|
2689
2695
|
}, We = (n) => n.placeholder || n.label || "", _e = (n, y, c) => N(n, c) ? F(b.value, y.key) ?? "" : F(n, y.key) ?? "", Ge = (n, y) => {
|
|
@@ -2696,16 +2702,16 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2696
2702
|
isEditing: N(n, c),
|
|
2697
2703
|
draft: b.value,
|
|
2698
2704
|
rowKey: W(n, c),
|
|
2699
|
-
updateDraft: (A, m) =>
|
|
2700
|
-
startEdit: () =>
|
|
2701
|
-
cancelEdit: () =>
|
|
2705
|
+
updateDraft: (A, m) => ae(A, m, n),
|
|
2706
|
+
startEdit: () => te(n, c),
|
|
2707
|
+
cancelEdit: () => le(n, c)
|
|
2702
2708
|
}), Xe = (n, y, c) => !!((typeof n.disabled == "function" ? n.disabled(y, c) : n.disabled) || J(y));
|
|
2703
2709
|
return (n, y) => (a(), i("div", {
|
|
2704
|
-
class:
|
|
2710
|
+
class: k(["bg-white", e.isCard ? "mx-4 md:mx-0 border border-gray-200/60 rounded-xl shadow-[0_1px_3px_rgba(0,0,0,0.1)] animate-fadeIn" : ""])
|
|
2705
2711
|
}, [
|
|
2706
2712
|
e.search ? (a(), i("div", {
|
|
2707
2713
|
key: 0,
|
|
2708
|
-
class:
|
|
2714
|
+
class: k([
|
|
2709
2715
|
"px-6 py-4",
|
|
2710
2716
|
e.isCard ? "border-b border-gray-200 bg-gray-50/80 rounded-t-xl" : "mb-4 bg-white/80 backdrop-blur-sm"
|
|
2711
2717
|
])
|
|
@@ -2726,7 +2732,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2726
2732
|
], 2)) : D("", !0),
|
|
2727
2733
|
p.value ? (a(), i("div", {
|
|
2728
2734
|
key: 1,
|
|
2729
|
-
class:
|
|
2735
|
+
class: k(["overflow-x-auto", e.isCard ? "rounded-xl" : ""])
|
|
2730
2736
|
}, [
|
|
2731
2737
|
o("table", za, [
|
|
2732
2738
|
o("thead", Ea, [
|
|
@@ -2747,53 +2753,53 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2747
2753
|
_: 2
|
|
2748
2754
|
}, 1032, ["field", "current-sort-field", "current-direction"])) : (a(), i("th", {
|
|
2749
2755
|
key: 1,
|
|
2750
|
-
class:
|
|
2756
|
+
class: k([V(c), { "text-right": c.align === "right" }])
|
|
2751
2757
|
}, T(c.label), 3))
|
|
2752
2758
|
], 64))), 128)),
|
|
2753
|
-
|
|
2759
|
+
S.value ? (a(), i("th", Fa, T(e.actionsLabel), 1)) : D("", !0)
|
|
2754
2760
|
])
|
|
2755
2761
|
]),
|
|
2756
2762
|
o("tbody", Na, [
|
|
2757
|
-
(a(!0), i(q, null, P(
|
|
2763
|
+
(a(!0), i(q, null, P(h.value, (c, A) => (a(), i("tr", {
|
|
2758
2764
|
key: W(c, A),
|
|
2759
|
-
class:
|
|
2765
|
+
class: k(e.rowClasses(c, A))
|
|
2760
2766
|
}, [
|
|
2761
2767
|
(a(!0), i(q, null, P(e.columns, (m) => (a(), i("td", {
|
|
2762
2768
|
key: m.key,
|
|
2763
|
-
class:
|
|
2769
|
+
class: k([U(m, c, A), { "text-right": m.align === "right" }])
|
|
2764
2770
|
}, [
|
|
2765
|
-
N(c, A) && m.slot && I(t)[G(m)] ?
|
|
2771
|
+
N(c, A) && m.slot && I(t)[G(m)] ? w(n.$slots, G(m), z({
|
|
2766
2772
|
key: 0,
|
|
2767
2773
|
ref_for: !0
|
|
2768
2774
|
}, pe(c, m, A))) : N(c, A) && m.input ? (a(), B(ye, {
|
|
2769
2775
|
key: 1,
|
|
2770
2776
|
type: _(m),
|
|
2771
|
-
class:
|
|
2777
|
+
class: k(Pe(m)),
|
|
2772
2778
|
placeholder: We(m),
|
|
2773
2779
|
"model-value": _e(c, m, A),
|
|
2774
2780
|
disabled: Xe(m, c, A),
|
|
2775
2781
|
maxlength: m.maxlength,
|
|
2776
2782
|
"error-message": Ge(c, m),
|
|
2777
2783
|
"helper-text": "",
|
|
2778
|
-
"onUpdate:modelValue": (H) =>
|
|
2779
|
-
onBlur: (H) =>
|
|
2784
|
+
"onUpdate:modelValue": (H) => ae(m.key, H, c),
|
|
2785
|
+
onBlur: (H) => ae(m.key, H?.target?.value ?? _e(c, m, A), c, "blur")
|
|
2780
2786
|
}, null, 8, ["type", "class", "placeholder", "model-value", "disabled", "maxlength", "error-message", "onUpdate:modelValue", "onBlur"])) : m.key === "name" && !m.slot ? (a(), i("div", Ka, [
|
|
2781
2787
|
o("div", {
|
|
2782
2788
|
class: "text-sm font-medium truncate",
|
|
2783
|
-
title:
|
|
2784
|
-
}, T(
|
|
2789
|
+
title: se(c, m)
|
|
2790
|
+
}, T(se(c, m)), 9, Ua),
|
|
2785
2791
|
J(c) ? (a(), i("span", Ra, T(e.deletedLabel), 1)) : D("", !0)
|
|
2786
|
-
])) : m.slot ?
|
|
2792
|
+
])) : m.slot ? w(n.$slots, m.slot, z({
|
|
2787
2793
|
key: 3,
|
|
2788
2794
|
ref_for: !0
|
|
2789
2795
|
}, pe(c, m, A))) : m.render ? (a(), i("div", {
|
|
2790
2796
|
key: 4,
|
|
2791
2797
|
innerHTML: m.render(c)
|
|
2792
|
-
}, null, 8, Ha)) : (a(), i("div", qa, T(
|
|
2798
|
+
}, null, 8, Ha)) : (a(), i("div", qa, T(se(c, m)), 1))
|
|
2793
2799
|
], 2))), 128)),
|
|
2794
|
-
|
|
2800
|
+
S.value ? (a(), i("td", Pa, [
|
|
2795
2801
|
o("div", Wa, [
|
|
2796
|
-
|
|
2802
|
+
v.value ? w(n.$slots, "actions", z({
|
|
2797
2803
|
key: 0,
|
|
2798
2804
|
ref_for: !0
|
|
2799
2805
|
}, pe(c, null, A))) : D("", !0),
|
|
@@ -2803,7 +2809,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2803
2809
|
variant: "tertiary",
|
|
2804
2810
|
title: e.cancelLabel,
|
|
2805
2811
|
"aria-label": e.cancelLabel,
|
|
2806
|
-
onClick: (m) =>
|
|
2812
|
+
onClick: (m) => le(c, A)
|
|
2807
2813
|
}, {
|
|
2808
2814
|
default: O(() => [
|
|
2809
2815
|
R(I(dt), { class: "size-4" })
|
|
@@ -2816,7 +2822,7 @@ const Ft = /* @__PURE__ */ ke(jt, [["render", Et]]), Nt = { class: "sr-only" },
|
|
|
2816
2822
|
disabled: K(c, A),
|
|
2817
2823
|
title: e.editLabel,
|
|
2818
2824
|
"aria-label": e.editLabel,
|
|
2819
|
-
onClick: (m) =>
|
|
2825
|
+
onClick: (m) => te(c, A)
|
|
2820
2826
|
}, {
|
|
2821
2827
|
default: O(() => [
|
|
2822
2828
|
R(I(ut), { class: "size-4" })
|