@wishbone-media/spark 0.30.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +641 -641
- package/package.json +1 -1
- package/src/containers/SparkDefaultContainer.vue +18 -4
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as $, resolveComponent as E, createElementBlock as y, openBlock as h, normalizeClass as V, createElementVNode as m, createCommentVNode as T, createVNode as S, unref as
|
|
1
|
+
import { computed as $, resolveComponent as E, createElementBlock as y, openBlock as h, normalizeClass as V, createElementVNode as m, createCommentVNode as T, createVNode as S, unref as C, renderSlot as O, reactive as K, Fragment as D, renderList as B, toDisplayString as M, createBlock as H, resolveDynamicComponent as Z, markRaw as ce, ref as R, watch as j, onMounted as ye, Transition as ht, withCtx as L, normalizeProps as gt, mergeProps as q, createTextVNode as A, Teleport as yt, TransitionGroup as ue, inject as $e, provide as vt, withModifiers as U, toHandlers as Oe, useSlots as Be, onUnmounted as ze, withDirectives as bt, vShow as xt, h as Te } from "vue";
|
|
2
2
|
import { icon as te, library as je } from "@fortawesome/fontawesome-svg-core";
|
|
3
3
|
import { FontAwesomeIcon as he } from "@fortawesome/vue-fontawesome";
|
|
4
|
-
import { faCircleDot as Ne, faEyeDropper as Ze, faAnglesLeft as qe, faAnglesRight as Ue, faStar as Ke, faSpinnerThird as
|
|
4
|
+
import { faCircleDot as Ne, faEyeDropper as Ze, faAnglesLeft as qe, faAnglesRight as Ue, faStar as Ke, faSpinnerThird as We, faCircle as kt, faFile as we, faCalendar as Ge, faArrowUp as Ye, faArrowDown as Xe, faPlus as Je, faCircleCheck as wt, faInbox as _t, faCloudDownload as Ct, faBolt as St, faUndo as $t, faEye as Tt, faSignOut as Lt, faXmark as _e, faTrash as Qe, faTimes as Pt, faStreetView as Mt, faSortUp as Vt, faSortDown as Ht, faSort as Rt, faScaleBalanced as Ft, faSatelliteDish as Dt, faLayerPlus as Et, faLaptopMobile as At, faInfoCircle as It, faGripDotsVertical as et, faGearComplex as Ot, faFlag as Bt, faFaceSmileWink as zt, faFaceSmileRelaxed as jt, faExclamationTriangle as Nt, faEllipsisVertical as Zt, faEllipsis as qt, faEdit as Ut, faComments as Kt, faCircleXmark as Wt, faCircleUser as Gt, faChevronUp as Yt, faChevronRight as tt, faChevronLeft as st, faChevronDown as at, faCheckCircle as Xt, faCheck as Ce, faBullhorn as Jt, faBellRing as Qt, faBarsSort as es, faArrowRightToLine as ts, faArrowLeftToLine as ss } from "@fortawesome/pro-regular-svg-icons";
|
|
5
5
|
import { faSortUp as as, faSortDown as os, faSort as rs } from "@fortawesome/pro-duotone-svg-icons";
|
|
6
6
|
import { defineStore as pe } from "pinia";
|
|
7
|
-
import { useRoute as se, useRouter as
|
|
7
|
+
import { useRoute as se, useRouter as W, onBeforeRouteLeave as ns } from "vue-router";
|
|
8
8
|
import { TransitionRoot as ot, Dialog as rt, TransitionChild as ge, DialogPanel as nt } from "@headlessui/vue";
|
|
9
9
|
import ve from "nprogress";
|
|
10
10
|
import { range as ls, get as ee, find as is, has as cs } from "lodash";
|
|
@@ -28,8 +28,8 @@ const F = {
|
|
|
28
28
|
farChevronLeft: st,
|
|
29
29
|
farChevronRight: tt,
|
|
30
30
|
farChevronUp: Yt,
|
|
31
|
-
farCircleUser:
|
|
32
|
-
farCircleXmark:
|
|
31
|
+
farCircleUser: Gt,
|
|
32
|
+
farCircleXmark: Wt,
|
|
33
33
|
farComments: Kt,
|
|
34
34
|
farEdit: Ut,
|
|
35
35
|
farEllipsis: qt,
|
|
@@ -66,10 +66,10 @@ const F = {
|
|
|
66
66
|
farPlus: Je,
|
|
67
67
|
farArrowDown: Xe,
|
|
68
68
|
farArrowUp: Ye,
|
|
69
|
-
farCalendar:
|
|
69
|
+
farCalendar: Ge,
|
|
70
70
|
farFile: we,
|
|
71
71
|
farCircle: kt,
|
|
72
|
-
farSpinner:
|
|
72
|
+
farSpinner: We,
|
|
73
73
|
farStar: Ke,
|
|
74
74
|
farAnglesRight: Ue,
|
|
75
75
|
farAnglesLeft: qe,
|
|
@@ -87,7 +87,7 @@ const F = {
|
|
|
87
87
|
check: Ce,
|
|
88
88
|
close: _e,
|
|
89
89
|
checkboxDecorator: Ce,
|
|
90
|
-
date:
|
|
90
|
+
date: Ge,
|
|
91
91
|
dragHandle: et,
|
|
92
92
|
fileItem: we,
|
|
93
93
|
fileRemove: _e,
|
|
@@ -95,7 +95,7 @@ const F = {
|
|
|
95
95
|
radioDecorator: Ne,
|
|
96
96
|
// Circle with dot for radio indicator
|
|
97
97
|
select: at,
|
|
98
|
-
spinner:
|
|
98
|
+
spinner: We,
|
|
99
99
|
star: Ke,
|
|
100
100
|
trash: Qe,
|
|
101
101
|
fastForward: Ue,
|
|
@@ -120,7 +120,7 @@ function Un(e) {
|
|
|
120
120
|
function Kn(e) {
|
|
121
121
|
Object.assign(F, e), je.add(...Object.values(e));
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Wn(e) {
|
|
124
124
|
je.add(...Object.values(F)), e.component("FontAwesomeIcon", he);
|
|
125
125
|
}
|
|
126
126
|
const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }, ks = { class: "ml-3" }, ws = {
|
|
@@ -156,21 +156,21 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
156
156
|
warning: "farExclamationTriangle",
|
|
157
157
|
danger: "farCircleXmark",
|
|
158
158
|
info: "farInfoCircle"
|
|
159
|
-
})[s.type]),
|
|
159
|
+
})[s.type]), r = $(() => ({
|
|
160
160
|
success: "text-green-400 hover:bg-green-100",
|
|
161
161
|
warning: "text-yellow-400 hover:bg-yellow-100",
|
|
162
162
|
danger: "text-red-400 hover:bg-red-100",
|
|
163
163
|
info: "text-blue-400 hover:bg-blue-100"
|
|
164
164
|
})[s.type]);
|
|
165
165
|
return (o, i) => {
|
|
166
|
-
const
|
|
166
|
+
const n = E("font-awesome-icon");
|
|
167
167
|
return h(), y("div", {
|
|
168
168
|
class: V(["rounded-md border p-4", t.value])
|
|
169
169
|
}, [
|
|
170
170
|
m("div", bs, [
|
|
171
171
|
m("div", xs, [
|
|
172
|
-
S(
|
|
173
|
-
icon:
|
|
172
|
+
S(n, {
|
|
173
|
+
icon: C(F)[l.value],
|
|
174
174
|
class: V(a.value)
|
|
175
175
|
}, null, 8, ["icon", "class"])
|
|
176
176
|
]),
|
|
@@ -181,11 +181,11 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
181
181
|
m("div", _s, [
|
|
182
182
|
m("button", {
|
|
183
183
|
type: "button",
|
|
184
|
-
class: V(["inline-flex rounded-md px-2 py-1.5",
|
|
184
|
+
class: V(["inline-flex rounded-md px-2 py-1.5", r.value]),
|
|
185
185
|
onClick: i[0] || (i[0] = (c) => o.$emit("close"))
|
|
186
186
|
}, [
|
|
187
|
-
S(
|
|
188
|
-
icon:
|
|
187
|
+
S(n, {
|
|
188
|
+
icon: C(F).farXmark
|
|
189
189
|
}, null, 8, ["icon"])
|
|
190
190
|
], 2)
|
|
191
191
|
])
|
|
@@ -246,11 +246,11 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
246
246
|
], it = pe("sparkAppSelector", () => {
|
|
247
247
|
const e = K({
|
|
248
248
|
apps: [...be]
|
|
249
|
-
}), s = (
|
|
250
|
-
if (
|
|
251
|
-
const o =
|
|
252
|
-
const
|
|
253
|
-
return
|
|
249
|
+
}), s = (r = {}) => {
|
|
250
|
+
if (r.apps && Array.isArray(r.apps)) {
|
|
251
|
+
const o = r.apps.filter((i) => {
|
|
252
|
+
const n = i.name && i.description && i.icon && i.href;
|
|
253
|
+
return n || console.warn("useSparkAppSelectorStore: Invalid app object", i), n;
|
|
254
254
|
});
|
|
255
255
|
e.apps = o.map((i) => ({
|
|
256
256
|
name: i.name,
|
|
@@ -260,23 +260,23 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
260
260
|
}));
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
if (
|
|
263
|
+
if (r.appHrefs && typeof r.appHrefs == "object") {
|
|
264
264
|
const o = /* @__PURE__ */ new Map();
|
|
265
|
-
Object.keys(
|
|
266
|
-
o.set(i.toLowerCase(),
|
|
265
|
+
Object.keys(r.appHrefs).forEach((i) => {
|
|
266
|
+
o.set(i.toLowerCase(), r.appHrefs[i]);
|
|
267
267
|
}), e.apps = be.map((i) => {
|
|
268
|
-
const
|
|
268
|
+
const n = o.get(i.name.toLowerCase());
|
|
269
269
|
return {
|
|
270
270
|
...i,
|
|
271
|
-
href:
|
|
271
|
+
href: n || i.href
|
|
272
272
|
};
|
|
273
273
|
});
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
e.apps = [...be];
|
|
277
|
-
}, t = $(() => e.apps), a = (
|
|
278
|
-
if (!
|
|
279
|
-
const o =
|
|
277
|
+
}, t = $(() => e.apps), a = (r) => {
|
|
278
|
+
if (!r) return null;
|
|
279
|
+
const o = r.toLowerCase();
|
|
280
280
|
return e.apps.find((i) => i.name.toLowerCase() === o) || null;
|
|
281
281
|
};
|
|
282
282
|
return {
|
|
@@ -284,8 +284,8 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
284
284
|
initialize: s,
|
|
285
285
|
allApps: t,
|
|
286
286
|
getAppByName: a,
|
|
287
|
-
getAppIcon: (
|
|
288
|
-
const o = a(
|
|
287
|
+
getAppIcon: (r) => {
|
|
288
|
+
const o = a(r);
|
|
289
289
|
return o ? o.icon : "";
|
|
290
290
|
}
|
|
291
291
|
};
|
|
@@ -325,31 +325,31 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
325
325
|
},
|
|
326
326
|
emits: ["close", "select"],
|
|
327
327
|
setup(e, { emit: s }) {
|
|
328
|
-
const t = s, a = it(), l = ct(),
|
|
328
|
+
const t = s, a = it(), l = ct(), r = $(() => {
|
|
329
329
|
const i = l.state.app;
|
|
330
|
-
return a.state.apps.map((
|
|
331
|
-
...
|
|
332
|
-
current: i &&
|
|
330
|
+
return a.state.apps.map((n) => ({
|
|
331
|
+
...n,
|
|
332
|
+
current: i && n.name.toLowerCase() === i.toLowerCase()
|
|
333
333
|
}));
|
|
334
|
-
}), o = (i,
|
|
334
|
+
}), o = (i, n) => {
|
|
335
335
|
t("select", i);
|
|
336
336
|
};
|
|
337
|
-
return (i,
|
|
337
|
+
return (i, n) => {
|
|
338
338
|
const c = E("font-awesome-icon");
|
|
339
339
|
return h(), y("div", Cs, [
|
|
340
340
|
m("div", Ss, [
|
|
341
341
|
m("div", $s, [
|
|
342
342
|
m("div", Ts, [
|
|
343
|
-
|
|
343
|
+
n[1] || (n[1] = m("div", null, "Mr Group Network", -1)),
|
|
344
344
|
m("div", Ls, [
|
|
345
345
|
S(c, {
|
|
346
|
-
icon:
|
|
346
|
+
icon: C(F).farTimes,
|
|
347
347
|
class: "h-[15px] w-[15px] shrink-0 text-gray-400 cursor-pointer",
|
|
348
|
-
onClick:
|
|
348
|
+
onClick: n[0] || (n[0] = (d) => t("close"))
|
|
349
349
|
}, null, 8, ["icon"])
|
|
350
350
|
])
|
|
351
351
|
]),
|
|
352
|
-
(h(!0), y(D, null, B(
|
|
352
|
+
(h(!0), y(D, null, B(r.value, (d) => (h(), y("a", {
|
|
353
353
|
key: d.name,
|
|
354
354
|
href: d.href,
|
|
355
355
|
target: "_blank",
|
|
@@ -366,11 +366,11 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
366
366
|
m("div", Ds, [
|
|
367
367
|
S(c, {
|
|
368
368
|
class: V([d.current ? "text-gray-700" : "text-gray-400", "h-5 w-5 shrink-0"]),
|
|
369
|
-
icon:
|
|
369
|
+
icon: C(F)[d.icon]
|
|
370
370
|
}, null, 8, ["class", "icon"])
|
|
371
371
|
])
|
|
372
372
|
], 10, Ps))), 128)),
|
|
373
|
-
|
|
373
|
+
n[2] || (n[2] = m("div", null, null, -1))
|
|
374
374
|
]),
|
|
375
375
|
m("div", Es, [
|
|
376
376
|
i.$slots.bottom || e.bottomSlot ? (h(), y("div", As, [
|
|
@@ -408,10 +408,10 @@ function Bs() {
|
|
|
408
408
|
shownOnPath: null
|
|
409
409
|
});
|
|
410
410
|
let s = null, t = 0, a = !1, l = null;
|
|
411
|
-
const
|
|
411
|
+
const r = () => {
|
|
412
412
|
s && (clearTimeout(s), s = null), t = 0, a = !1, l = null;
|
|
413
413
|
}, o = () => {
|
|
414
|
-
|
|
414
|
+
r(), e.isVisible = !1;
|
|
415
415
|
}, i = (f) => {
|
|
416
416
|
f <= 0 || (t = f, l = Date.now(), s = setTimeout(() => {
|
|
417
417
|
o();
|
|
@@ -420,19 +420,19 @@ function Bs() {
|
|
|
420
420
|
return {
|
|
421
421
|
state: e,
|
|
422
422
|
show: (f = {}) => {
|
|
423
|
-
|
|
423
|
+
r();
|
|
424
424
|
const {
|
|
425
|
-
type:
|
|
426
|
-
message:
|
|
425
|
+
type: x = "info",
|
|
426
|
+
message: w = null,
|
|
427
427
|
component: v = null,
|
|
428
428
|
props: u = {},
|
|
429
429
|
closeable: g = !0,
|
|
430
|
-
duration:
|
|
430
|
+
duration: _ = null,
|
|
431
431
|
persistent: b = !1
|
|
432
432
|
} = f;
|
|
433
|
-
e.type =
|
|
434
|
-
const
|
|
435
|
-
e.duration =
|
|
433
|
+
e.type = x, e.message = w, e.component = v ? ce(v) : null, e.props = u, e.closeable = g, e.persistent = b, e.isVisible = !0;
|
|
434
|
+
const k = _ !== null ? _ : ut[x];
|
|
435
|
+
e.duration = k, k > 0 && i(k);
|
|
436
436
|
},
|
|
437
437
|
hide: o,
|
|
438
438
|
reset: () => {
|
|
@@ -568,28 +568,28 @@ class zs {
|
|
|
568
568
|
type: t = "info",
|
|
569
569
|
message: a = null,
|
|
570
570
|
component: l = null,
|
|
571
|
-
props:
|
|
571
|
+
props: r = {},
|
|
572
572
|
closeable: o = !0,
|
|
573
573
|
duration: i = null,
|
|
574
|
-
position:
|
|
575
|
-
} = s, c = ++this._toastIdCounter, d =
|
|
574
|
+
position: n = null
|
|
575
|
+
} = s, c = ++this._toastIdCounter, d = n && Pe.includes(n) ? n : this.toastState.defaultPosition, p = i !== null ? i : ut[t], f = {
|
|
576
576
|
id: c,
|
|
577
577
|
type: t,
|
|
578
578
|
message: a,
|
|
579
579
|
component: l ? ce(l) : null,
|
|
580
|
-
props:
|
|
580
|
+
props: r,
|
|
581
581
|
closeable: o,
|
|
582
582
|
duration: p,
|
|
583
583
|
position: d,
|
|
584
584
|
createdAt: Date.now()
|
|
585
|
-
},
|
|
586
|
-
if (
|
|
587
|
-
const
|
|
588
|
-
this.hideToast(
|
|
585
|
+
}, x = this.toastState.toasts.filter((w) => w.position === d);
|
|
586
|
+
if (x.length >= this.toastState.maxToasts) {
|
|
587
|
+
const w = this.toastState.newestOnTop ? x[x.length - 1] : x[0];
|
|
588
|
+
this.hideToast(w.id);
|
|
589
589
|
}
|
|
590
590
|
if (this.toastState.newestOnTop) {
|
|
591
|
-
const
|
|
592
|
-
|
|
591
|
+
const w = this.toastState.toasts.findIndex((v) => v.position === d);
|
|
592
|
+
w === -1 ? this.toastState.toasts.push(f) : this.toastState.toasts.splice(w, 0, f);
|
|
593
593
|
} else
|
|
594
594
|
this.toastState.toasts.push(f);
|
|
595
595
|
return p > 0 && this._startToastTimer(c, p), c;
|
|
@@ -665,7 +665,7 @@ class zs {
|
|
|
665
665
|
t && (t.timeout && clearTimeout(t.timeout), this._toastTimers.delete(s));
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
const z = new zs(),
|
|
668
|
+
const z = new zs(), Gn = {
|
|
669
669
|
__name: "SparkNotificationOutlet",
|
|
670
670
|
props: {
|
|
671
671
|
name: {
|
|
@@ -686,8 +686,8 @@ const z = new zs(), Wn = {
|
|
|
686
686
|
}
|
|
687
687
|
), j(
|
|
688
688
|
() => a.value.state.isVisible,
|
|
689
|
-
(
|
|
690
|
-
|
|
689
|
+
(n) => {
|
|
690
|
+
n && !a.value.state.shownOnPath && (a.value.state.shownOnPath = t.path);
|
|
691
691
|
},
|
|
692
692
|
{ immediate: !0 }
|
|
693
693
|
), ye(() => {
|
|
@@ -698,14 +698,14 @@ const z = new zs(), Wn = {
|
|
|
698
698
|
s.clearOnRouteChange && (t.meta.preserveNotifications || a.value.state.isVisible && (a.value.state.persistent || a.value.hide()));
|
|
699
699
|
}
|
|
700
700
|
);
|
|
701
|
-
const
|
|
701
|
+
const r = () => {
|
|
702
702
|
z.hide(s.name);
|
|
703
703
|
}, o = () => {
|
|
704
704
|
z.pause(s.name);
|
|
705
705
|
}, i = () => {
|
|
706
706
|
z.resume(s.name);
|
|
707
707
|
};
|
|
708
|
-
return (
|
|
708
|
+
return (n, c) => (h(), H(ht, {
|
|
709
709
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
710
710
|
"enter-from-class": "opacity-0 -translate-y-2",
|
|
711
711
|
"enter-to-class": "opacity-100 translate-y-0",
|
|
@@ -719,7 +719,7 @@ const z = new zs(), Wn = {
|
|
|
719
719
|
key: l.value,
|
|
720
720
|
type: a.value.state.type,
|
|
721
721
|
closeable: a.value.state.closeable,
|
|
722
|
-
onClose:
|
|
722
|
+
onClose: r,
|
|
723
723
|
onMouseenter: o,
|
|
724
724
|
onMouseleave: i
|
|
725
725
|
}, {
|
|
@@ -743,13 +743,13 @@ const z = new zs(), Wn = {
|
|
|
743
743
|
() => s.toasts.filter((d) => d.position === "top-right")
|
|
744
744
|
), l = $(
|
|
745
745
|
() => s.toasts.filter((d) => d.position === "center")
|
|
746
|
-
),
|
|
746
|
+
), r = $(
|
|
747
747
|
() => s.toasts.filter((d) => d.position === "bottom-left")
|
|
748
748
|
), o = $(
|
|
749
749
|
() => s.toasts.filter((d) => d.position === "bottom-right")
|
|
750
750
|
), i = (d) => {
|
|
751
751
|
z.hideToast(d);
|
|
752
|
-
},
|
|
752
|
+
}, n = (d) => {
|
|
753
753
|
z.pauseToast(d);
|
|
754
754
|
}, c = (d) => {
|
|
755
755
|
z.resumeToast(d);
|
|
@@ -772,9 +772,9 @@ const z = new zs(), Wn = {
|
|
|
772
772
|
S(re, {
|
|
773
773
|
type: f.type,
|
|
774
774
|
closeable: f.closeable,
|
|
775
|
-
onClose: (
|
|
776
|
-
onMouseenter: (
|
|
777
|
-
onMouseleave: (
|
|
775
|
+
onClose: (x) => i(f.id),
|
|
776
|
+
onMouseenter: (x) => n(f.id),
|
|
777
|
+
onMouseleave: (x) => c(f.id)
|
|
778
778
|
}, {
|
|
779
779
|
default: L(() => [
|
|
780
780
|
f.component ? (h(), H(Z(f.component), q({
|
|
@@ -808,9 +808,9 @@ const z = new zs(), Wn = {
|
|
|
808
808
|
S(re, {
|
|
809
809
|
type: f.type,
|
|
810
810
|
closeable: f.closeable,
|
|
811
|
-
onClose: (
|
|
812
|
-
onMouseenter: (
|
|
813
|
-
onMouseleave: (
|
|
811
|
+
onClose: (x) => i(f.id),
|
|
812
|
+
onMouseenter: (x) => n(f.id),
|
|
813
|
+
onMouseleave: (x) => c(f.id)
|
|
814
814
|
}, {
|
|
815
815
|
default: L(() => [
|
|
816
816
|
f.component ? (h(), H(Z(f.component), q({
|
|
@@ -844,9 +844,9 @@ const z = new zs(), Wn = {
|
|
|
844
844
|
S(re, {
|
|
845
845
|
type: f.type,
|
|
846
846
|
closeable: f.closeable,
|
|
847
|
-
onClose: (
|
|
848
|
-
onMouseenter: (
|
|
849
|
-
onMouseleave: (
|
|
847
|
+
onClose: (x) => i(f.id),
|
|
848
|
+
onMouseenter: (x) => n(f.id),
|
|
849
|
+
onMouseleave: (x) => c(f.id)
|
|
850
850
|
}, {
|
|
851
851
|
default: L(() => [
|
|
852
852
|
f.component ? (h(), H(Z(f.component), q({
|
|
@@ -873,16 +873,16 @@ const z = new zs(), Wn = {
|
|
|
873
873
|
"leave-to-class": "opacity-0 -translate-x-4"
|
|
874
874
|
}, {
|
|
875
875
|
default: L(() => [
|
|
876
|
-
(h(!0), y(D, null, B(
|
|
876
|
+
(h(!0), y(D, null, B(r.value, (f) => (h(), y("div", {
|
|
877
877
|
key: f.id,
|
|
878
878
|
class: "pointer-events-auto"
|
|
879
879
|
}, [
|
|
880
880
|
S(re, {
|
|
881
881
|
type: f.type,
|
|
882
882
|
closeable: f.closeable,
|
|
883
|
-
onClose: (
|
|
884
|
-
onMouseenter: (
|
|
885
|
-
onMouseleave: (
|
|
883
|
+
onClose: (x) => i(f.id),
|
|
884
|
+
onMouseenter: (x) => n(f.id),
|
|
885
|
+
onMouseleave: (x) => c(f.id)
|
|
886
886
|
}, {
|
|
887
887
|
default: L(() => [
|
|
888
888
|
f.component ? (h(), H(Z(f.component), q({
|
|
@@ -916,9 +916,9 @@ const z = new zs(), Wn = {
|
|
|
916
916
|
S(re, {
|
|
917
917
|
type: f.type,
|
|
918
918
|
closeable: f.closeable,
|
|
919
|
-
onClose: (
|
|
920
|
-
onMouseenter: (
|
|
921
|
-
onMouseleave: (
|
|
919
|
+
onClose: (x) => i(f.id),
|
|
920
|
+
onMouseenter: (x) => n(f.id),
|
|
921
|
+
onMouseleave: (x) => c(f.id)
|
|
922
922
|
}, {
|
|
923
923
|
default: L(() => [
|
|
924
924
|
f.component ? (h(), H(Z(f.component), q({
|
|
@@ -942,36 +942,36 @@ const z = new zs(), Wn = {
|
|
|
942
942
|
() => {
|
|
943
943
|
const e = K({
|
|
944
944
|
brands: []
|
|
945
|
-
}), s = (
|
|
946
|
-
if (!
|
|
945
|
+
}), s = (r = {}) => {
|
|
946
|
+
if (!r.brands || !Array.isArray(r.brands)) {
|
|
947
947
|
console.warn("useSparkBrandFilterStore: No brands provided to initialize()"), e.brands = [];
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
const o =
|
|
951
|
-
const c =
|
|
952
|
-
return c || console.warn("useSparkBrandFilterStore: Invalid brand object",
|
|
953
|
-
}), i = o.filter((
|
|
954
|
-
i.length === 0 && o.length > 0 ? o[0].current = !0 : i.length > 1 && o.forEach((
|
|
955
|
-
|
|
956
|
-
}), e.brands = o.map((
|
|
957
|
-
id:
|
|
958
|
-
name:
|
|
959
|
-
logo:
|
|
960
|
-
current:
|
|
950
|
+
const o = r.brands.filter((n) => {
|
|
951
|
+
const c = n.name && n.logo;
|
|
952
|
+
return c || console.warn("useSparkBrandFilterStore: Invalid brand object", n), c;
|
|
953
|
+
}), i = o.filter((n) => n.current);
|
|
954
|
+
i.length === 0 && o.length > 0 ? o[0].current = !0 : i.length > 1 && o.forEach((n) => {
|
|
955
|
+
n.current = n === i[0];
|
|
956
|
+
}), e.brands = o.map((n) => ({
|
|
957
|
+
id: n.id,
|
|
958
|
+
name: n.name,
|
|
959
|
+
logo: n.logo,
|
|
960
|
+
current: n.current || !1
|
|
961
961
|
}));
|
|
962
|
-
}, t = $(() => e.brands.find((
|
|
962
|
+
}, t = $(() => e.brands.find((r) => r.current) || null), a = $(() => e.brands);
|
|
963
963
|
return {
|
|
964
964
|
state: e,
|
|
965
965
|
initialize: s,
|
|
966
966
|
currentBrand: t,
|
|
967
967
|
allBrands: a,
|
|
968
|
-
toggleBrand: (
|
|
969
|
-
if (!
|
|
968
|
+
toggleBrand: (r) => {
|
|
969
|
+
if (!r || !e.brands.includes(r)) {
|
|
970
970
|
console.warn("useSparkBrandFilterStore: Invalid brand provided to toggleBrand()");
|
|
971
971
|
return;
|
|
972
972
|
}
|
|
973
973
|
e.brands.forEach((o) => {
|
|
974
|
-
o.current = o ===
|
|
974
|
+
o.current = o === r;
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
};
|
|
@@ -981,7 +981,7 @@ const z = new zs(), Wn = {
|
|
|
981
981
|
paths: ["state.brands"]
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
), Ks = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" },
|
|
984
|
+
), Ks = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, Ws = { class: "flex flex-1 flex-col" }, Gs = { class: "divide-y divide-gray-200" }, Ys = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, Xs = { class: "ml-auto flex items-center" }, Js = {
|
|
985
985
|
key: 0,
|
|
986
986
|
class: "flex px-[22px] py-[15px] text-gray-500 text-sm"
|
|
987
987
|
}, Qs = ["onClick"], ea = { class: "w-full gap-y-1 flex justify-between" }, ta = { class: "flex flex-col" }, sa = { class: "flex items-center" }, aa = { class: "font-medium text-base text-gray-900" }, oa = {
|
|
@@ -991,42 +991,42 @@ const z = new zs(), Wn = {
|
|
|
991
991
|
__name: "SparkBrandSelector",
|
|
992
992
|
emits: ["close", "select"],
|
|
993
993
|
setup(e, { emit: s }) {
|
|
994
|
-
const t = s, a = dt(), l = (
|
|
995
|
-
t("select",
|
|
994
|
+
const t = s, a = dt(), l = (r) => {
|
|
995
|
+
t("select", r);
|
|
996
996
|
};
|
|
997
|
-
return (
|
|
997
|
+
return (r, o) => {
|
|
998
998
|
const i = E("font-awesome-icon");
|
|
999
999
|
return h(), y("div", Ks, [
|
|
1000
|
-
m("div",
|
|
1001
|
-
m("div",
|
|
1000
|
+
m("div", Ws, [
|
|
1001
|
+
m("div", Gs, [
|
|
1002
1002
|
m("div", Ys, [
|
|
1003
1003
|
o[1] || (o[1] = m("div", null, "Filter by Brand", -1)),
|
|
1004
1004
|
m("div", Xs, [
|
|
1005
1005
|
S(i, {
|
|
1006
|
-
icon:
|
|
1006
|
+
icon: C(F).farTimes,
|
|
1007
1007
|
class: "size-4 text-gray-400 cursor-pointer",
|
|
1008
|
-
onClick: o[0] || (o[0] = (
|
|
1008
|
+
onClick: o[0] || (o[0] = (n) => t("close"))
|
|
1009
1009
|
}, null, 8, ["icon"])
|
|
1010
1010
|
])
|
|
1011
1011
|
]),
|
|
1012
|
-
|
|
1013
|
-
(h(!0), y(D, null, B(
|
|
1014
|
-
key:
|
|
1015
|
-
class: V([
|
|
1016
|
-
onClick: (c) => l(
|
|
1012
|
+
C(a).allBrands.length === 0 ? (h(), y("div", Js, " No brands configured ")) : T("", !0),
|
|
1013
|
+
(h(!0), y(D, null, B(C(a).allBrands, (n) => (h(), y("div", {
|
|
1014
|
+
key: n.id,
|
|
1015
|
+
class: V([n.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
|
|
1016
|
+
onClick: (c) => l(n)
|
|
1017
1017
|
}, [
|
|
1018
1018
|
m("div", ea, [
|
|
1019
1019
|
m("div", ta, [
|
|
1020
1020
|
m("div", sa, [
|
|
1021
|
-
m("div", aa, M(
|
|
1022
|
-
|
|
1021
|
+
m("div", aa, M(n.name), 1),
|
|
1022
|
+
n.current ? (h(), y("span", oa, " Current ")) : T("", !0)
|
|
1023
1023
|
]),
|
|
1024
|
-
m("div", ra, M(
|
|
1024
|
+
m("div", ra, M(n.current ? "Current Brand" : "Change to"), 1)
|
|
1025
1025
|
]),
|
|
1026
1026
|
m("div", na, [
|
|
1027
1027
|
m("img", {
|
|
1028
|
-
src:
|
|
1029
|
-
alt: `${
|
|
1028
|
+
src: n.logo,
|
|
1029
|
+
alt: `${n.name} logo`,
|
|
1030
1030
|
class: "h-8 w-auto"
|
|
1031
1031
|
}, null, 8, la)
|
|
1032
1032
|
])
|
|
@@ -1039,7 +1039,7 @@ const z = new zs(), Wn = {
|
|
|
1039
1039
|
]);
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
|
-
}, ca = ["disabled"],
|
|
1042
|
+
}, ca = ["disabled"], G = {
|
|
1043
1043
|
__name: "SparkButton",
|
|
1044
1044
|
props: {
|
|
1045
1045
|
size: {
|
|
@@ -1064,14 +1064,14 @@ const z = new zs(), Wn = {
|
|
|
1064
1064
|
setup(e) {
|
|
1065
1065
|
const s = e, t = R(null), a = $e("buttonGroup", null), l = $(() => {
|
|
1066
1066
|
if (!a?.isInGroup || !t.value) return null;
|
|
1067
|
-
const
|
|
1067
|
+
const n = a.getButtonIndex(t.value), c = a.getButtonCount();
|
|
1068
1068
|
return {
|
|
1069
|
-
isFirst:
|
|
1070
|
-
isLast:
|
|
1071
|
-
index:
|
|
1069
|
+
isFirst: n === 0,
|
|
1070
|
+
isLast: n === c - 1,
|
|
1071
|
+
index: n,
|
|
1072
1072
|
total: c
|
|
1073
1073
|
};
|
|
1074
|
-
}),
|
|
1074
|
+
}), r = {
|
|
1075
1075
|
paddingX: /^px-/,
|
|
1076
1076
|
paddingY: /^py-/,
|
|
1077
1077
|
paddingAll: /^p-/,
|
|
@@ -1081,74 +1081,74 @@ const z = new zs(), Wn = {
|
|
|
1081
1081
|
borderRadius: /^rounded-/,
|
|
1082
1082
|
background: /^bg-/,
|
|
1083
1083
|
text: /^text-(?!white|black)/
|
|
1084
|
-
}, o = (
|
|
1085
|
-
if (!c) return
|
|
1086
|
-
const d =
|
|
1087
|
-
return [...d.filter((
|
|
1088
|
-
const v = Object.entries(
|
|
1089
|
-
([g,
|
|
1090
|
-
)?.[0], u = Object.entries(
|
|
1091
|
-
([g,
|
|
1084
|
+
}, o = (n, c) => {
|
|
1085
|
+
if (!c) return n;
|
|
1086
|
+
const d = n.split(" ").filter(Boolean), p = c.split(" ").filter(Boolean);
|
|
1087
|
+
return [...d.filter((x) => !p.some((w) => {
|
|
1088
|
+
const v = Object.entries(r).find(
|
|
1089
|
+
([g, _]) => _.test(x)
|
|
1090
|
+
)?.[0], u = Object.entries(r).find(
|
|
1091
|
+
([g, _]) => _.test(w)
|
|
1092
1092
|
)?.[0];
|
|
1093
1093
|
return v && v === u;
|
|
1094
1094
|
})), ...p].join(" ");
|
|
1095
1095
|
}, i = $(() => {
|
|
1096
|
-
let
|
|
1096
|
+
let n = "", c = "";
|
|
1097
1097
|
switch (s.size) {
|
|
1098
1098
|
case "xs":
|
|
1099
|
-
|
|
1099
|
+
n += " px-4 py-1 text-xs", c = "sm";
|
|
1100
1100
|
break;
|
|
1101
1101
|
case "sm":
|
|
1102
|
-
|
|
1102
|
+
n += " px-4 py-1 text-sm", c = "sm";
|
|
1103
1103
|
break;
|
|
1104
1104
|
case "md":
|
|
1105
|
-
|
|
1105
|
+
n += " px-5 py-1.5 text-sm", c = "md";
|
|
1106
1106
|
break;
|
|
1107
1107
|
case "lg":
|
|
1108
|
-
|
|
1108
|
+
n += " px-6 py-2 text-sm", c = "md";
|
|
1109
1109
|
break;
|
|
1110
1110
|
case "xl":
|
|
1111
|
-
|
|
1111
|
+
n += " px-7 py-2.5 min-h-[42px] text-sm", c = "md";
|
|
1112
1112
|
break;
|
|
1113
1113
|
}
|
|
1114
1114
|
if (a?.isInGroup && l.value) {
|
|
1115
1115
|
const { isFirst: d, isLast: p } = l.value;
|
|
1116
|
-
|
|
1116
|
+
n += " relative inline-flex items-center focus:z-10", d && p ? n += ` rounded-${c}` : d ? n += ` rounded-l-${c} rounded-r-none` : p ? n += ` rounded-r-${c} rounded-l-none -ml-px` : n += " rounded-none -ml-px";
|
|
1117
1117
|
} else
|
|
1118
|
-
|
|
1118
|
+
n += ` shadow-xs rounded-${c}`;
|
|
1119
1119
|
switch (s.variant) {
|
|
1120
1120
|
case "primary":
|
|
1121
|
-
|
|
1121
|
+
n += " bg-primary-600 hover:bg-primary-500 text-white";
|
|
1122
1122
|
break;
|
|
1123
1123
|
case "secondary":
|
|
1124
|
-
|
|
1124
|
+
n += " ring-1 ring-gray-300 ring-inset bg-white hover:bg-gray-50 text-gray-900";
|
|
1125
1125
|
break;
|
|
1126
1126
|
case "success":
|
|
1127
|
-
|
|
1127
|
+
n += " bg-green-600 hover:bg-green-500 text-white";
|
|
1128
1128
|
break;
|
|
1129
1129
|
case "warning":
|
|
1130
|
-
|
|
1130
|
+
n += " bg-amber-600 hover:bg-amber-500 text-white";
|
|
1131
1131
|
break;
|
|
1132
1132
|
case "danger":
|
|
1133
|
-
|
|
1133
|
+
n += " bg-red-600 hover:bg-red-500 text-white";
|
|
1134
1134
|
break;
|
|
1135
1135
|
case "info":
|
|
1136
|
-
|
|
1136
|
+
n += " bg-cyan-600 hover:bg-cyan-500 text-white";
|
|
1137
1137
|
break;
|
|
1138
1138
|
default:
|
|
1139
|
-
|
|
1139
|
+
n += ` bg-${s.variant}-600 hover:bg-${s.variant}-500 text-white`;
|
|
1140
1140
|
}
|
|
1141
|
-
return
|
|
1141
|
+
return n = o(n, s.buttonClass), n;
|
|
1142
1142
|
});
|
|
1143
|
-
return (
|
|
1143
|
+
return (n, c) => (h(), y("button", {
|
|
1144
1144
|
type: "button",
|
|
1145
1145
|
ref_key: "buttonRef",
|
|
1146
1146
|
ref: t,
|
|
1147
1147
|
class: V(i.value),
|
|
1148
1148
|
disabled: e.disabled,
|
|
1149
|
-
onClick: c[0] || (c[0] = (d) =>
|
|
1149
|
+
onClick: c[0] || (c[0] = (d) => n.$emit("click"))
|
|
1150
1150
|
}, [
|
|
1151
|
-
O(
|
|
1151
|
+
O(n.$slots, "default")
|
|
1152
1152
|
], 10, ca));
|
|
1153
1153
|
}
|
|
1154
1154
|
}, pt = {
|
|
@@ -1159,7 +1159,7 @@ const z = new zs(), Wn = {
|
|
|
1159
1159
|
isInGroup: !0,
|
|
1160
1160
|
getButtonIndex: (l) => s.value ? Array.from(s.value.children).indexOf(l) : -1,
|
|
1161
1161
|
getButtonCount: () => s.value?.children.length || 0
|
|
1162
|
-
}), (l,
|
|
1162
|
+
}), (l, r) => (h(), y("div", {
|
|
1163
1163
|
class: "inline-flex rounded-md shadow-xs",
|
|
1164
1164
|
ref_key: "groupRef",
|
|
1165
1165
|
ref: s
|
|
@@ -1259,19 +1259,19 @@ const z = new zs(), Wn = {
|
|
|
1259
1259
|
},
|
|
1260
1260
|
emits: ["update:modelValue", "upload-start", "upload-success", "upload-error"],
|
|
1261
1261
|
setup(e, { emit: s }) {
|
|
1262
|
-
const t = e, a = s, l = $e("axios"),
|
|
1262
|
+
const t = e, a = s, l = $e("axios"), r = R(!1), o = R(!1);
|
|
1263
1263
|
function i() {
|
|
1264
1264
|
a("update:modelValue", "");
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1267
|
-
t.disabled ||
|
|
1266
|
+
function n() {
|
|
1267
|
+
t.disabled || r.value || (o.value = !0);
|
|
1268
1268
|
}
|
|
1269
1269
|
function c() {
|
|
1270
1270
|
o.value = !1;
|
|
1271
1271
|
}
|
|
1272
|
-
function d(
|
|
1273
|
-
if (o.value = !1, t.disabled ||
|
|
1274
|
-
const v =
|
|
1272
|
+
function d(w) {
|
|
1273
|
+
if (o.value = !1, t.disabled || r.value) return;
|
|
1274
|
+
const v = w.dataTransfer?.files?.[0];
|
|
1275
1275
|
if (v) {
|
|
1276
1276
|
if (!p(v)) {
|
|
1277
1277
|
z.show({
|
|
@@ -1280,33 +1280,33 @@ const z = new zs(), Wn = {
|
|
|
1280
1280
|
});
|
|
1281
1281
|
return;
|
|
1282
1282
|
}
|
|
1283
|
-
|
|
1283
|
+
x(v);
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
function p(
|
|
1286
|
+
function p(w) {
|
|
1287
1287
|
const v = t.accept.split(",").map((u) => u.trim());
|
|
1288
1288
|
for (const u of v) {
|
|
1289
1289
|
if (u === "*/*") return !0;
|
|
1290
1290
|
if (u.endsWith("/*")) {
|
|
1291
1291
|
const g = u.slice(0, -2);
|
|
1292
|
-
if (
|
|
1292
|
+
if (w.type.startsWith(g + "/")) return !0;
|
|
1293
1293
|
} else if (u.startsWith(".")) {
|
|
1294
|
-
if (
|
|
1295
|
-
} else if (
|
|
1294
|
+
if (w.name.toLowerCase().endsWith(u.toLowerCase())) return !0;
|
|
1295
|
+
} else if (w.type === u) return !0;
|
|
1296
1296
|
}
|
|
1297
1297
|
return !1;
|
|
1298
1298
|
}
|
|
1299
|
-
function f(
|
|
1300
|
-
if (!
|
|
1301
|
-
const v =
|
|
1302
|
-
v &&
|
|
1299
|
+
function f(w) {
|
|
1300
|
+
if (!w || w.length === 0) return;
|
|
1301
|
+
const v = w[0].file;
|
|
1302
|
+
v && x(v);
|
|
1303
1303
|
}
|
|
1304
|
-
async function w
|
|
1305
|
-
|
|
1304
|
+
async function x(w) {
|
|
1305
|
+
r.value = !0, a("upload-start");
|
|
1306
1306
|
try {
|
|
1307
1307
|
const v = new FormData();
|
|
1308
|
-
v.append(t.fieldName,
|
|
1309
|
-
v.append(
|
|
1308
|
+
v.append(t.fieldName, w), Object.entries(t.extraFields).forEach(([_, b]) => {
|
|
1309
|
+
v.append(_, b);
|
|
1310
1310
|
});
|
|
1311
1311
|
const u = await l.post(t.uploadUrl, v, {
|
|
1312
1312
|
headers: { "Content-Type": "multipart/form-data" }
|
|
@@ -1321,10 +1321,10 @@ const z = new zs(), Wn = {
|
|
|
1321
1321
|
message: v.response?.data?.message || "Failed to upload image."
|
|
1322
1322
|
});
|
|
1323
1323
|
} finally {
|
|
1324
|
-
|
|
1324
|
+
r.value = !1;
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
|
-
return (
|
|
1327
|
+
return (w, v) => {
|
|
1328
1328
|
const u = E("font-awesome-icon"), g = E("FormKit");
|
|
1329
1329
|
return h(), y("div", null, [
|
|
1330
1330
|
e.label ? (h(), y("label", fa, M(e.label), 1)) : T("", !0),
|
|
@@ -1347,7 +1347,7 @@ const z = new zs(), Wn = {
|
|
|
1347
1347
|
onClick: i
|
|
1348
1348
|
}, [
|
|
1349
1349
|
S(u, {
|
|
1350
|
-
icon:
|
|
1350
|
+
icon: C(F).farXmark,
|
|
1351
1351
|
class: "text-xs"
|
|
1352
1352
|
}, null, 8, ["icon"])
|
|
1353
1353
|
], 8, ya)
|
|
@@ -1357,8 +1357,8 @@ const z = new zs(), Wn = {
|
|
|
1357
1357
|
class: V(["relative rounded-md transition-colors", {
|
|
1358
1358
|
"ring-2 ring-blue-500 ring-offset-2 bg-blue-50": o.value
|
|
1359
1359
|
}]),
|
|
1360
|
-
onDragover: U(
|
|
1361
|
-
onDragenter: U(
|
|
1360
|
+
onDragover: U(n, ["prevent"]),
|
|
1361
|
+
onDragenter: U(n, ["prevent"]),
|
|
1362
1362
|
onDragleave: U(c, ["prevent"]),
|
|
1363
1363
|
onDrop: U(d, ["prevent"])
|
|
1364
1364
|
}, [
|
|
@@ -1366,14 +1366,14 @@ const z = new zs(), Wn = {
|
|
|
1366
1366
|
type: "file",
|
|
1367
1367
|
name: e.name,
|
|
1368
1368
|
accept: e.accept,
|
|
1369
|
-
disabled: e.disabled ||
|
|
1369
|
+
disabled: e.disabled || r.value,
|
|
1370
1370
|
onInput: f
|
|
1371
1371
|
}, null, 8, ["name", "accept", "disabled"]),
|
|
1372
1372
|
o.value ? (h(), y("div", va, [...v[0] || (v[0] = [
|
|
1373
1373
|
m("span", { class: "text-sm text-blue-600 font-medium" }, "Drop image here", -1)
|
|
1374
1374
|
])])) : T("", !0)
|
|
1375
1375
|
], 34)),
|
|
1376
|
-
|
|
1376
|
+
r.value ? (h(), y("p", ba, "Uploading...")) : T("", !0)
|
|
1377
1377
|
]);
|
|
1378
1378
|
};
|
|
1379
1379
|
}
|
|
@@ -1446,7 +1446,7 @@ const z = new zs(), Wn = {
|
|
|
1446
1446
|
success: "farCheckCircle",
|
|
1447
1447
|
warning: "farExclamationTriangle",
|
|
1448
1448
|
danger: "farCircleXmark"
|
|
1449
|
-
},
|
|
1449
|
+
}, r = $(() => s.icon || l[s.type]), o = $(() => ({
|
|
1450
1450
|
info: "bg-blue-100",
|
|
1451
1451
|
success: "bg-green-100",
|
|
1452
1452
|
warning: "bg-yellow-100",
|
|
@@ -1457,20 +1457,20 @@ const z = new zs(), Wn = {
|
|
|
1457
1457
|
warning: "text-yellow-400",
|
|
1458
1458
|
danger: "text-red-400"
|
|
1459
1459
|
})[s.type]);
|
|
1460
|
-
return (
|
|
1460
|
+
return (n, c) => {
|
|
1461
1461
|
const d = E("font-awesome-icon");
|
|
1462
1462
|
return h(), y("div", xa, [
|
|
1463
|
-
|
|
1463
|
+
r.value ? (h(), y("div", {
|
|
1464
1464
|
key: 0,
|
|
1465
1465
|
class: V(["mx-auto flex size-12 items-center justify-center rounded-full", o.value])
|
|
1466
1466
|
}, [
|
|
1467
1467
|
S(d, {
|
|
1468
|
-
icon:
|
|
1468
|
+
icon: C(F)[r.value],
|
|
1469
1469
|
class: V(["h-5 w-5", i.value])
|
|
1470
1470
|
}, null, 8, ["icon", "class"])
|
|
1471
1471
|
], 2)) : T("", !0),
|
|
1472
1472
|
m("div", {
|
|
1473
|
-
class: V(["text-center", { "mt-3 sm:mt-5":
|
|
1473
|
+
class: V(["text-center", { "mt-3 sm:mt-5": r.value }])
|
|
1474
1474
|
}, [
|
|
1475
1475
|
e.title ? (h(), y("h3", ka, M(e.title), 1)) : T("", !0),
|
|
1476
1476
|
e.message ? (h(), y("div", {
|
|
@@ -1481,10 +1481,10 @@ const z = new zs(), Wn = {
|
|
|
1481
1481
|
m("div", {
|
|
1482
1482
|
class: V(["mt-5 sm:mt-6", a.value])
|
|
1483
1483
|
}, [
|
|
1484
|
-
(h(!0), y(D, null, B(t.value, (p, f) => (h(), H(
|
|
1484
|
+
(h(!0), y(D, null, B(t.value, (p, f) => (h(), H(C(G), {
|
|
1485
1485
|
key: f,
|
|
1486
1486
|
variant: p.variant,
|
|
1487
|
-
onClick: (
|
|
1487
|
+
onClick: (x) => n.$emit(p.event, p)
|
|
1488
1488
|
}, {
|
|
1489
1489
|
default: L(() => [
|
|
1490
1490
|
A(M(p.text), 1)
|
|
@@ -1527,19 +1527,19 @@ class _a {
|
|
|
1527
1527
|
const {
|
|
1528
1528
|
title: a = "Confirm",
|
|
1529
1529
|
message: l = "Are you sure?",
|
|
1530
|
-
type:
|
|
1530
|
+
type: r = "warning",
|
|
1531
1531
|
confirmText: o = "Confirm",
|
|
1532
1532
|
cancelText: i = "Cancel",
|
|
1533
|
-
confirmVariant:
|
|
1533
|
+
confirmVariant: n = "primary"
|
|
1534
1534
|
} = s;
|
|
1535
1535
|
this.show(
|
|
1536
1536
|
wa,
|
|
1537
1537
|
{
|
|
1538
1538
|
title: a,
|
|
1539
1539
|
message: l,
|
|
1540
|
-
type:
|
|
1540
|
+
type: r,
|
|
1541
1541
|
buttons: [
|
|
1542
|
-
{ text: o, variant:
|
|
1542
|
+
{ text: o, variant: n, event: "confirm" },
|
|
1543
1543
|
{ text: i, variant: "secondary", event: "cancel" }
|
|
1544
1544
|
]
|
|
1545
1545
|
},
|
|
@@ -1557,17 +1557,17 @@ class _a {
|
|
|
1557
1557
|
const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto" }, Sa = { class: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" }, $a = {
|
|
1558
1558
|
__name: "SparkModalContainer",
|
|
1559
1559
|
setup(e) {
|
|
1560
|
-
return (s, t) => (h(), H(
|
|
1560
|
+
return (s, t) => (h(), H(C(ot), {
|
|
1561
1561
|
as: "template",
|
|
1562
|
-
show:
|
|
1562
|
+
show: C(J).state.isVisible
|
|
1563
1563
|
}, {
|
|
1564
1564
|
default: L(() => [
|
|
1565
|
-
S(
|
|
1565
|
+
S(C(rt), {
|
|
1566
1566
|
class: "relative z-1000",
|
|
1567
|
-
onClose:
|
|
1567
|
+
onClose: C(J).hide
|
|
1568
1568
|
}, {
|
|
1569
1569
|
default: L(() => [
|
|
1570
|
-
S(
|
|
1570
|
+
S(C(ge), {
|
|
1571
1571
|
as: "template",
|
|
1572
1572
|
enter: "ease-out duration-300",
|
|
1573
1573
|
"enter-from": "opacity-0",
|
|
@@ -1583,7 +1583,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1583
1583
|
}),
|
|
1584
1584
|
m("div", Ca, [
|
|
1585
1585
|
m("div", Sa, [
|
|
1586
|
-
S(
|
|
1586
|
+
S(C(ge), {
|
|
1587
1587
|
as: "template",
|
|
1588
1588
|
enter: "ease-out duration-300",
|
|
1589
1589
|
"enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
@@ -1593,9 +1593,9 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1593
1593
|
"leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
1594
1594
|
}, {
|
|
1595
1595
|
default: L(() => [
|
|
1596
|
-
S(
|
|
1596
|
+
S(C(nt), { class: "relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:min-w-lg sm:max-w-max" }, {
|
|
1597
1597
|
default: L(() => [
|
|
1598
|
-
(h(), H(Z(
|
|
1598
|
+
(h(), H(Z(C(J).state.content), q(C(J).state.props, Oe(C(J).state.eventHandlers)), null, 16))
|
|
1599
1599
|
]),
|
|
1600
1600
|
_: 1
|
|
1601
1601
|
})
|
|
@@ -1632,21 +1632,21 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1632
1632
|
md: "w-[450px]",
|
|
1633
1633
|
lg: "w-[810px]",
|
|
1634
1634
|
xl: "w-[1000px]"
|
|
1635
|
-
}, l = e,
|
|
1636
|
-
l.overlayInstance.close(),
|
|
1635
|
+
}, l = e, r = s, o = $(() => a[l.overlayInstance.state.size] || a.md), i = () => {
|
|
1636
|
+
l.overlayInstance.close(), r("close");
|
|
1637
1637
|
};
|
|
1638
|
-
return (
|
|
1638
|
+
return (n, c) => (h(), H(C(ot), {
|
|
1639
1639
|
show: e.overlayInstance.state.isVisible,
|
|
1640
1640
|
as: "template"
|
|
1641
1641
|
}, {
|
|
1642
1642
|
default: L(() => [
|
|
1643
|
-
S(
|
|
1643
|
+
S(C(rt), {
|
|
1644
1644
|
initialFocus: t.value,
|
|
1645
1645
|
class: "relative z-1000",
|
|
1646
1646
|
onClose: i
|
|
1647
1647
|
}, {
|
|
1648
1648
|
default: L(() => [
|
|
1649
|
-
S(
|
|
1649
|
+
S(C(ge), {
|
|
1650
1650
|
as: "template",
|
|
1651
1651
|
enter: "transition-opacity ease-linear duration-150",
|
|
1652
1652
|
"enter-from": "opacity-0",
|
|
@@ -1661,7 +1661,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1661
1661
|
_: 1
|
|
1662
1662
|
}),
|
|
1663
1663
|
m("div", Ta, [
|
|
1664
|
-
S(
|
|
1664
|
+
S(C(ge), {
|
|
1665
1665
|
as: "template",
|
|
1666
1666
|
enter: "transition ease-in-out duration-150 transform",
|
|
1667
1667
|
"enter-from": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0",
|
|
@@ -1671,7 +1671,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1671
1671
|
"leave-to": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
|
|
1672
1672
|
}, {
|
|
1673
1673
|
default: L(() => [
|
|
1674
|
-
S(
|
|
1674
|
+
S(C(nt), {
|
|
1675
1675
|
ref_key: "panelRef",
|
|
1676
1676
|
ref: t,
|
|
1677
1677
|
class: V([
|
|
@@ -1743,14 +1743,14 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1743
1743
|
},
|
|
1744
1744
|
emits: ["navigate", "update:activeId"],
|
|
1745
1745
|
setup(e, { emit: s }) {
|
|
1746
|
-
const t = e, a = s, l = $(() => t.navInstance ? t.navInstance.visibleItems.value : t.items.filter((v) => !(typeof v.hidden == "function" ? v.hidden() : v.hidden))),
|
|
1746
|
+
const t = e, a = s, l = $(() => t.navInstance ? t.navInstance.visibleItems.value : t.items.filter((v) => !(typeof v.hidden == "function" ? v.hidden() : v.hidden))), r = $(() => t.navInstance ? t.navInstance.activeId.value : t.activeId);
|
|
1747
1747
|
function o(v) {
|
|
1748
1748
|
return t.navInstance ? t.navInstance.isActive(v) : v.id === t.activeId;
|
|
1749
1749
|
}
|
|
1750
1750
|
function i(v) {
|
|
1751
1751
|
return t.navInstance ? t.navInstance.isDisabled(v) : typeof v.disabled == "function" ? v.disabled() : v.disabled;
|
|
1752
1752
|
}
|
|
1753
|
-
async function
|
|
1753
|
+
async function n(v) {
|
|
1754
1754
|
i(v) || (t.navInstance && await t.navInstance.navigateTo(v), a("navigate", v), a("update:activeId", v.id));
|
|
1755
1755
|
}
|
|
1756
1756
|
const c = $(() => ["spark-sub-nav", {
|
|
@@ -1761,21 +1761,21 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1761
1761
|
custom: ""
|
|
1762
1762
|
}[t.layout]]), d = $(() => t.compact ? "text-sm" : "");
|
|
1763
1763
|
function p(v) {
|
|
1764
|
-
const u = o(v), g = i(v),
|
|
1764
|
+
const u = o(v), g = i(v), _ = [
|
|
1765
1765
|
"inline-flex items-center transition-colors cursor-pointer",
|
|
1766
1766
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1"
|
|
1767
1767
|
];
|
|
1768
|
-
return g &&
|
|
1768
|
+
return g && _.push("opacity-50 cursor-not-allowed"), t.layout === "tabs" ? _.push(...f(u, g)) : t.layout === "vertical" && _.push(...x(u, g)), _;
|
|
1769
1769
|
}
|
|
1770
1770
|
function f(v, u) {
|
|
1771
|
-
const g = ["border-b-2 -mb-px rounded-t font-medium"],
|
|
1772
|
-
return g.push(
|
|
1771
|
+
const g = ["border-b-2 -mb-px rounded-t font-medium"], _ = t.compact ? "text-sm px-3 py-1.5" : "text-sm px-8 py-4";
|
|
1772
|
+
return g.push(_), v ? g.push("border-primary-600 text-primary-600") : u ? g.push("border-transparent text-gray-400") : g.push("border-transparent text-gray-600 hover:text-gray-900 hover:border-gray-300"), g;
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1774
|
+
function x(v, u) {
|
|
1775
1775
|
const g = ["font-medium text-sm py-1"];
|
|
1776
1776
|
return v ? g.push("text-primary-600") : u ? g.push("text-gray-400") : g.push("text-gray-600 hover:text-gray-900"), g;
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function w(v) {
|
|
1779
1779
|
const u = v.badgeVariant || "primary", g = {
|
|
1780
1780
|
primary: "bg-primary-100 text-primary-700",
|
|
1781
1781
|
secondary: "bg-gray-100 text-gray-700",
|
|
@@ -1791,32 +1791,32 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1791
1791
|
t.layout === "custom" ? O(v.$slots, "default", {
|
|
1792
1792
|
key: 0,
|
|
1793
1793
|
items: l.value,
|
|
1794
|
-
activeId:
|
|
1794
|
+
activeId: r.value,
|
|
1795
1795
|
isActive: o,
|
|
1796
1796
|
isDisabled: i,
|
|
1797
|
-
navigate:
|
|
1797
|
+
navigate: n
|
|
1798
1798
|
}) : t.layout === "horizontal" ? (h(), H(pt, {
|
|
1799
1799
|
key: 1,
|
|
1800
1800
|
class: "isolate"
|
|
1801
1801
|
}, {
|
|
1802
1802
|
default: L(() => [
|
|
1803
|
-
(h(!0), y(D, null, B(l.value, (g) => (h(), H(
|
|
1803
|
+
(h(!0), y(D, null, B(l.value, (g) => (h(), H(G, {
|
|
1804
1804
|
key: g.id,
|
|
1805
1805
|
size: "xl",
|
|
1806
1806
|
variant: o(g) ? "primary" : "secondary",
|
|
1807
1807
|
disabled: i(g),
|
|
1808
|
-
onClick: (
|
|
1808
|
+
onClick: (_) => n(g)
|
|
1809
1809
|
}, {
|
|
1810
1810
|
default: L(() => [
|
|
1811
|
-
g.icon ? (h(), H(
|
|
1811
|
+
g.icon ? (h(), H(C(he), {
|
|
1812
1812
|
key: 0,
|
|
1813
|
-
icon:
|
|
1813
|
+
icon: C(F)[g.icon],
|
|
1814
1814
|
class: "mr-1.5 size-4"
|
|
1815
1815
|
}, null, 8, ["icon"])) : T("", !0),
|
|
1816
1816
|
A(" " + M(g.label) + " ", 1),
|
|
1817
1817
|
g.badge != null ? (h(), y("span", {
|
|
1818
1818
|
key: 1,
|
|
1819
|
-
class: V(
|
|
1819
|
+
class: V(w(g))
|
|
1820
1820
|
}, M(g.badge), 3)) : T("", !0)
|
|
1821
1821
|
]),
|
|
1822
1822
|
_: 2
|
|
@@ -1827,22 +1827,22 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1827
1827
|
key: g.id,
|
|
1828
1828
|
class: V(p(g)),
|
|
1829
1829
|
disabled: i(g) || void 0,
|
|
1830
|
-
onClick: (
|
|
1830
|
+
onClick: (_) => n(g)
|
|
1831
1831
|
}, [
|
|
1832
|
-
o(g) && t.layout === "vertical" ? (h(), H(
|
|
1832
|
+
o(g) && t.layout === "vertical" ? (h(), H(C(he), {
|
|
1833
1833
|
key: 0,
|
|
1834
|
-
icon:
|
|
1834
|
+
icon: C(F).farCircleCheck,
|
|
1835
1835
|
class: "mr-2 size-4"
|
|
1836
1836
|
}, null, 8, ["icon"])) : T("", !0),
|
|
1837
|
-
g.icon && !(o(g) && t.layout === "vertical") ? (h(), H(
|
|
1837
|
+
g.icon && !(o(g) && t.layout === "vertical") ? (h(), H(C(he), {
|
|
1838
1838
|
key: 1,
|
|
1839
|
-
icon:
|
|
1839
|
+
icon: C(F)[g.icon],
|
|
1840
1840
|
class: V(["mr-2", d.value])
|
|
1841
1841
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
1842
1842
|
m("span", null, M(g.label), 1),
|
|
1843
1843
|
g.badge != null ? (h(), y("span", {
|
|
1844
1844
|
key: 2,
|
|
1845
|
-
class: V(
|
|
1845
|
+
class: V(w(g))
|
|
1846
1846
|
}, M(g.badge), 3)) : T("", !0)
|
|
1847
1847
|
], 10, La))), 128))
|
|
1848
1848
|
], 2));
|
|
@@ -1859,11 +1859,11 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1859
1859
|
return;
|
|
1860
1860
|
const l = document.createElement("span");
|
|
1861
1861
|
l.classList.add("spark-table-head-sorting"), l.innerHTML = te({ prefix: "fad", iconName: "sort" }).html + te({ prefix: "fad", iconName: "sort-up" }).html + te({ prefix: "fad", iconName: "sort-down" }).html, a.appendChild(l), a.addEventListener("click", async () => {
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1862
|
+
const r = t.params.orderBy, o = t.params.sortedBy;
|
|
1863
|
+
return r === e && o === "asc" ? (a.classList.remove("asc"), a.classList.add("desc"), t.methods.applyParams({
|
|
1864
1864
|
orderBy: e,
|
|
1865
1865
|
sortedBy: "desc"
|
|
1866
|
-
})) :
|
|
1866
|
+
})) : r === e ? (a.classList.remove("desc"), await t.methods.clearParams(["orderBy", "sortedBy"])) : (a.classList.add("asc"), t.methods.applyParams({
|
|
1867
1867
|
orderBy: e,
|
|
1868
1868
|
sortedBy: "asc"
|
|
1869
1869
|
}));
|
|
@@ -1873,16 +1873,16 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1873
1873
|
return;
|
|
1874
1874
|
const a = document.createElement("div"), l = document.createElement("input");
|
|
1875
1875
|
l.type = "text", l.placeholder = "Filter...", a.className = "spark-table-head-filter", a.appendChild(l);
|
|
1876
|
-
const
|
|
1877
|
-
const
|
|
1878
|
-
if (
|
|
1879
|
-
return t.params[c] && t.params[c] ===
|
|
1876
|
+
const r = lt(async (o, i) => {
|
|
1877
|
+
const n = i.target.value, c = `filter[${o}]`;
|
|
1878
|
+
if (n)
|
|
1879
|
+
return t.params[c] && t.params[c] === n ? void 0 : t.methods.applyParams({
|
|
1880
1880
|
page: 1,
|
|
1881
|
-
[c]:
|
|
1881
|
+
[c]: n
|
|
1882
1882
|
});
|
|
1883
1883
|
await t.methods.removeParam(c);
|
|
1884
1884
|
}, 200);
|
|
1885
|
-
l.addEventListener("keyup", (o) =>
|
|
1885
|
+
l.addEventListener("keyup", (o) => r(e, o)), s.appendChild(a);
|
|
1886
1886
|
}, Ha = (e, s, t) => {
|
|
1887
1887
|
e.classList.add("spark-table-head"), t && t.columnSort && e.classList.add("can-sort"), t && t.columnFilter && e.classList.add("can-filter"), e.querySelector(".relative").classList.add("spark-table-head-title-wrapper");
|
|
1888
1888
|
const l = e.querySelector(".colHeader");
|
|
@@ -1893,8 +1893,8 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1893
1893
|
if (e < 0)
|
|
1894
1894
|
return;
|
|
1895
1895
|
let a = 2;
|
|
1896
|
-
const l = t.methods.colToProp(e),
|
|
1897
|
-
s.childElementCount === 1 && ((!
|
|
1896
|
+
const l = t.methods.colToProp(e), r = t.methods.getSettingsForProp(l);
|
|
1897
|
+
s.childElementCount === 1 && ((!r || !r.columnSort) && a--, (!r || !r.columnFilter) && a--, r && r.columnSort && Ma(l, s, t), r && r.columnFilter && Va(l, s, t)), (s.childElementCount === a || a === 0) && Ha(s, l, r);
|
|
1898
1898
|
}, Fa = (e) => {
|
|
1899
1899
|
if (!e.hotInstance || !e.hotInstance.rootElement)
|
|
1900
1900
|
return;
|
|
@@ -1902,10 +1902,10 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1902
1902
|
a.forEach((l) => {
|
|
1903
1903
|
l.classList.remove("asc", "desc");
|
|
1904
1904
|
}), s && t && a.forEach((l) => {
|
|
1905
|
-
const
|
|
1905
|
+
const r = l.closest("th"), o = Array.from(r.parentElement.children).indexOf(r);
|
|
1906
1906
|
e.methods.colToProp(o) === s && l.classList.add(t);
|
|
1907
1907
|
});
|
|
1908
|
-
}, Da = (e) => (s, t, a, l,
|
|
1908
|
+
}, Da = (e) => (s, t, a, l, r, o, i) => {
|
|
1909
1909
|
t.innerHTML = "", t.classList.add("spark-table-cell-actions");
|
|
1910
1910
|
const c = (i.rendererConfig || {}).actions || [];
|
|
1911
1911
|
if (c.length === 0)
|
|
@@ -1914,17 +1914,17 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1914
1914
|
p.classList.add("flex", "items-center", "gap-2"), c.forEach((f) => {
|
|
1915
1915
|
if (f.condition && typeof f.condition == "function" && !f.condition(d))
|
|
1916
1916
|
return;
|
|
1917
|
-
const
|
|
1918
|
-
if (
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1917
|
+
const x = document.createElement("button");
|
|
1918
|
+
if (x.type = "button", x.classList.add("spark-table-action-button"), f.icon) {
|
|
1919
|
+
const w = document.createElement("span");
|
|
1920
|
+
w.innerHTML = te({ prefix: "far", iconName: f.icon }).html, w.classList.add("size-4"), x.appendChild(w);
|
|
1921
1921
|
}
|
|
1922
1922
|
if (f.label) {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1923
|
+
const w = document.createElement("span");
|
|
1924
|
+
w.textContent = f.label, x.appendChild(w);
|
|
1925
1925
|
}
|
|
1926
|
-
|
|
1927
|
-
if (
|
|
1926
|
+
x.addEventListener("click", async (w) => {
|
|
1927
|
+
if (w.preventDefault(), w.stopPropagation(), f.confirm) {
|
|
1928
1928
|
const v = typeof f.confirm == "string" ? f.confirm : `Are you sure you want to ${f.label?.toLowerCase() || "perform this action"}?`;
|
|
1929
1929
|
if (!await J.confirm({
|
|
1930
1930
|
title: f.confirmTitle,
|
|
@@ -1937,7 +1937,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1937
1937
|
return;
|
|
1938
1938
|
}
|
|
1939
1939
|
f.event && e.methods.fireEvent(f.event, d), f.handler && typeof f.handler == "function" && f.handler(d);
|
|
1940
|
-
}), p.appendChild(
|
|
1940
|
+
}), p.appendChild(x);
|
|
1941
1941
|
}), t.appendChild(p);
|
|
1942
1942
|
}, Ve = {
|
|
1943
1943
|
green: "bg-green-100 text-green-800",
|
|
@@ -1948,7 +1948,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1948
1948
|
purple: "bg-purple-100 text-purple-800",
|
|
1949
1949
|
pink: "bg-pink-100 text-pink-800",
|
|
1950
1950
|
indigo: "bg-indigo-100 text-indigo-800"
|
|
1951
|
-
}, Ea = (e) => (s, t, a, l,
|
|
1951
|
+
}, Ea = (e) => (s, t, a, l, r, o, i) => {
|
|
1952
1952
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-badge"), !o)
|
|
1953
1953
|
return;
|
|
1954
1954
|
const c = (i.rendererConfig || {}).colorMap || {}, d = c[o] || c[o?.toLowerCase()] || "gray", p = Ve[d] || Ve.gray, f = document.createElement("span");
|
|
@@ -1982,9 +1982,9 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1982
1982
|
return s === "1" || s === "yes" || s === "true";
|
|
1983
1983
|
}
|
|
1984
1984
|
return !1;
|
|
1985
|
-
}, Ia = (e) => (s, t, a, l,
|
|
1985
|
+
}, Ia = (e) => (s, t, a, l, r, o, i) => {
|
|
1986
1986
|
t.innerHTML = "", t.classList.add("spark-table-cell-boolean");
|
|
1987
|
-
const
|
|
1987
|
+
const n = i.rendererConfig || {}, c = Aa(o), d = c ? n.trueIcon || "check" : n.falseIcon || "xmark", p = c ? n.trueColor || "green" : n.falseColor || "red", f = n.size || 32, x = n.iconPrefix || "far", w = He[p] || He.gray;
|
|
1988
1988
|
t.dataset.copyValue = c ? "true" : "false";
|
|
1989
1989
|
const v = document.createElement("div");
|
|
1990
1990
|
v.classList.add(
|
|
@@ -1992,24 +1992,24 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1992
1992
|
"items-center",
|
|
1993
1993
|
"justify-center",
|
|
1994
1994
|
"rounded-full",
|
|
1995
|
-
|
|
1996
|
-
|
|
1995
|
+
w.bg,
|
|
1996
|
+
w.text
|
|
1997
1997
|
), v.style.width = `${f}px`, v.style.height = `${f}px`;
|
|
1998
1998
|
const u = document.createElement("span");
|
|
1999
|
-
u.innerHTML = te({ prefix:
|
|
1999
|
+
u.innerHTML = te({ prefix: x, iconName: d }).html, u.classList.add("flex", "items-center", "justify-center");
|
|
2000
2000
|
const g = Math.round(f * 0.5);
|
|
2001
2001
|
u.style.fontSize = `${g}px`, v.appendChild(u), t.appendChild(v);
|
|
2002
2002
|
}, Oa = (e, s = 2) => {
|
|
2003
2003
|
const t = Number(e);
|
|
2004
2004
|
if (isNaN(t)) return null;
|
|
2005
|
-
const a = t < 0,
|
|
2005
|
+
const a = t < 0, r = Math.abs(t).toLocaleString("en-AU", {
|
|
2006
2006
|
minimumFractionDigits: s,
|
|
2007
2007
|
maximumFractionDigits: s
|
|
2008
2008
|
});
|
|
2009
|
-
return a ? `-$${
|
|
2010
|
-
}, Ba = (e) => (s, t, a, l,
|
|
2009
|
+
return a ? `-$${r}` : `$${r}`;
|
|
2010
|
+
}, Ba = (e) => (s, t, a, l, r, o, i) => {
|
|
2011
2011
|
t.innerHTML = "", t.classList.add("spark-table-cell-currency");
|
|
2012
|
-
const
|
|
2012
|
+
const n = i.rendererConfig || {}, { decimals: c = 2, emptyText: d = "" } = n;
|
|
2013
2013
|
if (o == null || o === "") {
|
|
2014
2014
|
t.textContent = d;
|
|
2015
2015
|
return;
|
|
@@ -2021,49 +2021,49 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
2021
2021
|
}
|
|
2022
2022
|
const f = document.createElement("span");
|
|
2023
2023
|
f.textContent = p, t.appendChild(f);
|
|
2024
|
-
}, za = (e) => (s, t, a, l,
|
|
2024
|
+
}, za = (e) => (s, t, a, l, r, o, i) => {
|
|
2025
2025
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-link"), !o)
|
|
2026
2026
|
return;
|
|
2027
|
-
const
|
|
2027
|
+
const n = i.rendererConfig || {}, c = s.getSourceDataAtRow(s.toPhysicalRow(a));
|
|
2028
2028
|
let d = o;
|
|
2029
|
-
|
|
2029
|
+
n.href && (typeof n.href == "function" ? d = n.href(c) : n.href === "email" ? d = `mailto:${o}` : n.href === "tel" ? d = `tel:${o}` : typeof n.href == "string" && (d = c[n.href] || o));
|
|
2030
2030
|
const p = document.createElement("a");
|
|
2031
|
-
p.href = d, p.textContent = o, p.classList.add("text-primary-600", "hover:text-primary-900", "hover:underline"),
|
|
2031
|
+
p.href = d, p.textContent = o, p.classList.add("text-primary-600", "hover:text-primary-900", "hover:underline"), n.target && (p.target = n.target), n.rel && (p.rel = n.rel), p.addEventListener("click", (f) => {
|
|
2032
2032
|
f.stopPropagation();
|
|
2033
2033
|
}), t.appendChild(p);
|
|
2034
2034
|
}, Re = {
|
|
2035
2035
|
sm: "h-6 w-6",
|
|
2036
2036
|
md: "h-8 w-8",
|
|
2037
2037
|
lg: "h-12 w-12"
|
|
2038
|
-
}, ja = (e) => (s, t, a, l,
|
|
2038
|
+
}, ja = (e) => (s, t, a, l, r, o, i) => {
|
|
2039
2039
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !o)
|
|
2040
2040
|
return;
|
|
2041
|
-
const
|
|
2042
|
-
let
|
|
2043
|
-
typeof
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
}, Na = (e) => (s, t, a, l,
|
|
2041
|
+
const n = i.rendererConfig || {}, c = s.getSourceDataAtRow(s.toPhysicalRow(a)), d = n.size || "md", p = Re[d] || Re.md, f = n.rounded !== !1;
|
|
2042
|
+
let x = n.alt || "";
|
|
2043
|
+
typeof n.alt == "string" && c[n.alt] && (x = c[n.alt]);
|
|
2044
|
+
const w = document.createElement("img");
|
|
2045
|
+
w.src = o, w.alt = x, w.classList.add(...p.split(" "), "object-cover"), f ? w.classList.add("rounded-full") : w.classList.add("rounded"), t.appendChild(w);
|
|
2046
|
+
}, Na = (e) => (s, t, a, l, r, o, i) => {
|
|
2047
2047
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !o)
|
|
2048
2048
|
return;
|
|
2049
|
-
const
|
|
2049
|
+
const n = i.rendererConfig || {}, c = n.format || "short", d = n.locale || "en-US";
|
|
2050
2050
|
let p = o;
|
|
2051
2051
|
try {
|
|
2052
|
-
const
|
|
2053
|
-
isNaN(
|
|
2052
|
+
const x = new Date(o);
|
|
2053
|
+
isNaN(x.getTime()) ? p = o : typeof c == "function" ? p = c(x) : c === "short" ? p = x.toLocaleDateString(d) : c === "long" ? p = x.toLocaleDateString(d, {
|
|
2054
2054
|
year: "numeric",
|
|
2055
2055
|
month: "long",
|
|
2056
2056
|
day: "numeric"
|
|
2057
|
-
}) : c === "relative" ? p = Za(
|
|
2058
|
-
} catch (
|
|
2059
|
-
console.error("Error formatting date:",
|
|
2057
|
+
}) : c === "relative" ? p = Za(x) : c === "datetime" ? p = x.toLocaleString(d) : p = x.toLocaleDateString(d);
|
|
2058
|
+
} catch (x) {
|
|
2059
|
+
console.error("Error formatting date:", x), p = o;
|
|
2060
2060
|
}
|
|
2061
2061
|
const f = document.createElement("span");
|
|
2062
2062
|
f.textContent = p, t.appendChild(f);
|
|
2063
2063
|
};
|
|
2064
2064
|
function Za(e) {
|
|
2065
|
-
const t = /* @__PURE__ */ new Date() - e, a = Math.floor(Math.abs(t) / 1e3), l = Math.floor(a / 60),
|
|
2066
|
-
return a < 60 ? c ? "just now" : "in a moment" : l < 60 ? c ? `${l} minute${l > 1 ? "s" : ""} ago` : `in ${l} minute${l > 1 ? "s" : ""}` :
|
|
2065
|
+
const t = /* @__PURE__ */ new Date() - e, a = Math.floor(Math.abs(t) / 1e3), l = Math.floor(a / 60), r = Math.floor(l / 60), o = Math.floor(r / 24), i = Math.floor(o / 30), n = Math.floor(o / 365), c = t > 0;
|
|
2066
|
+
return a < 60 ? c ? "just now" : "in a moment" : l < 60 ? c ? `${l} minute${l > 1 ? "s" : ""} ago` : `in ${l} minute${l > 1 ? "s" : ""}` : r < 24 ? c ? `${r} hour${r > 1 ? "s" : ""} ago` : `in ${r} hour${r > 1 ? "s" : ""}` : o < 30 ? c ? `${o} day${o > 1 ? "s" : ""} ago` : `in ${o} day${o > 1 ? "s" : ""}` : i < 12 ? c ? `${i} month${i > 1 ? "s" : ""} ago` : `in ${i} month${i > 1 ? "s" : ""}` : c ? `${n} year${n > 1 ? "s" : ""} ago` : `in ${n} year${n > 1 ? "s" : ""}`;
|
|
2067
2067
|
}
|
|
2068
2068
|
const qa = (e) => {
|
|
2069
2069
|
const s = ["th", "st", "nd", "rd"], t = e % 100;
|
|
@@ -2082,7 +2082,7 @@ const qa = (e) => {
|
|
|
2082
2082
|
e.minute || 0,
|
|
2083
2083
|
e.second || 0,
|
|
2084
2084
|
e.millisecond || 0
|
|
2085
|
-
),
|
|
2085
|
+
), Wa = (e) => {
|
|
2086
2086
|
const s = e.hour || 0, t = s % 12 || 12, a = s >= 12;
|
|
2087
2087
|
return {
|
|
2088
2088
|
year: e.year,
|
|
@@ -2103,10 +2103,10 @@ const qa = (e) => {
|
|
|
2103
2103
|
}, Fe = (e, s = !0) => {
|
|
2104
2104
|
if (!e.offsetNanoseconds && e.offsetNanoseconds !== 0)
|
|
2105
2105
|
return "";
|
|
2106
|
-
const t = Math.round(e.offsetNanoseconds / 6e10), a = t >= 0 ? "+" : "-", l = Math.abs(t),
|
|
2107
|
-
return s ? `${a}${N(
|
|
2108
|
-
},
|
|
2109
|
-
const t =
|
|
2106
|
+
const t = Math.round(e.offsetNanoseconds / 6e10), a = t >= 0 ? "+" : "-", l = Math.abs(t), r = Math.floor(l / 60), o = l % 60;
|
|
2107
|
+
return s ? `${a}${N(r)}:${N(o)}` : `${a}${N(r)}${N(o)}`;
|
|
2108
|
+
}, Ga = (e, s) => {
|
|
2109
|
+
const t = Wa(e), a = Ka(e), l = t.dayOfWeek === 7 ? 0 : t.dayOfWeek;
|
|
2110
2110
|
return [
|
|
2111
2111
|
// Year
|
|
2112
2112
|
["YYYY", () => String(t.year)],
|
|
@@ -2162,18 +2162,18 @@ const qa = (e) => {
|
|
|
2162
2162
|
if (e.includes("[") || e.includes("Z") || /[+-]\d{2}:\d{2}$/.test(e))
|
|
2163
2163
|
l = Temporal.ZonedDateTime.from(e);
|
|
2164
2164
|
else {
|
|
2165
|
-
const
|
|
2166
|
-
l = Temporal.PlainDateTime.from(
|
|
2165
|
+
const n = e.replace(" ", "T");
|
|
2166
|
+
l = Temporal.PlainDateTime.from(n);
|
|
2167
2167
|
}
|
|
2168
|
-
} catch (
|
|
2169
|
-
return console.error("Failed to parse date string:", e,
|
|
2168
|
+
} catch (n) {
|
|
2169
|
+
return console.error("Failed to parse date string:", e, n), e;
|
|
2170
2170
|
}
|
|
2171
|
-
const
|
|
2172
|
-
return s.replace(i, (
|
|
2171
|
+
const r = Ga(l, a), o = r.map(([n]) => n).join("|"), i = new RegExp(`\\[([^\\]]+)\\]|(${o})`, "g");
|
|
2172
|
+
return s.replace(i, (n, c, d) => {
|
|
2173
2173
|
if (c !== void 0)
|
|
2174
2174
|
return c;
|
|
2175
|
-
const p =
|
|
2176
|
-
return p ? p[1]() :
|
|
2175
|
+
const p = r.find(([f]) => f === d);
|
|
2176
|
+
return p ? p[1]() : n;
|
|
2177
2177
|
});
|
|
2178
2178
|
}, Xa = (e, s = {}) => {
|
|
2179
2179
|
const { fromTimezone: t, toTimezone: a } = s;
|
|
@@ -2181,36 +2181,36 @@ const qa = (e) => {
|
|
|
2181
2181
|
return null;
|
|
2182
2182
|
const l = e.replace(" ", "T");
|
|
2183
2183
|
return t && a ? Temporal.PlainDateTime.from(l).toZonedDateTime(t).withTimeZone(a) : t ? Temporal.PlainDateTime.from(l).toZonedDateTime(t) : Temporal.PlainDateTime.from(l);
|
|
2184
|
-
}, Ja = (e) => (s, t, a, l,
|
|
2184
|
+
}, Ja = (e) => (s, t, a, l, r, o, i) => {
|
|
2185
2185
|
t.innerHTML = "", t.classList.add("spark-table-cell-datetime");
|
|
2186
|
-
const
|
|
2186
|
+
const n = i.rendererConfig || {}, {
|
|
2187
2187
|
format: c = "DD MMM YYYY, HH:mm",
|
|
2188
2188
|
fromTimezone: d,
|
|
2189
2189
|
toTimezone: p,
|
|
2190
2190
|
locale: f = "en-US",
|
|
2191
|
-
emptyText:
|
|
2192
|
-
} =
|
|
2191
|
+
emptyText: x = ""
|
|
2192
|
+
} = n;
|
|
2193
2193
|
if (!o) {
|
|
2194
|
-
t.textContent =
|
|
2194
|
+
t.textContent = x;
|
|
2195
2195
|
return;
|
|
2196
2196
|
}
|
|
2197
2197
|
try {
|
|
2198
|
-
const
|
|
2199
|
-
if (!
|
|
2200
|
-
t.textContent =
|
|
2198
|
+
const w = Xa(o, { fromTimezone: d, toTimezone: p });
|
|
2199
|
+
if (!w) {
|
|
2200
|
+
t.textContent = x;
|
|
2201
2201
|
return;
|
|
2202
2202
|
}
|
|
2203
|
-
const v = Ya(
|
|
2203
|
+
const v = Ya(w, c, { locale: f }), u = document.createElement("span");
|
|
2204
2204
|
u.textContent = v, t.appendChild(u);
|
|
2205
|
-
} catch (
|
|
2206
|
-
console.error("Error formatting datetime:",
|
|
2205
|
+
} catch (w) {
|
|
2206
|
+
console.error("Error formatting datetime:", w, { value: o, format: c }), t.textContent = o;
|
|
2207
2207
|
}
|
|
2208
2208
|
}, Qa = /* @__PURE__ */ new Map(), X = (e, s) => {
|
|
2209
|
-
gs(e, (t, a, l,
|
|
2210
|
-
ys.apply(null, [t, a, l,
|
|
2209
|
+
gs(e, (t, a, l, r, o, i, n) => {
|
|
2210
|
+
ys.apply(null, [t, a, l, r, o, i, n]), s(t, a, l, r, o, i, n);
|
|
2211
2211
|
}), Qa.set(e, s);
|
|
2212
2212
|
}, eo = (e) => {
|
|
2213
|
-
X("spark.actions", Da(e)), X("spark.badge", Ea()), X("spark.boolean", Ia()), X("spark.currency", Ba()), X("spark.link", za()), X("spark.image", ja()), X("spark.date", Na()), X("spark.datetime", Ja()), X("style.capitalize", (s, t, a, l,
|
|
2213
|
+
X("spark.actions", Da(e)), X("spark.badge", Ea()), X("spark.boolean", Ia()), X("spark.currency", Ba()), X("spark.link", za()), X("spark.image", ja()), X("spark.date", Na()), X("spark.datetime", Ja()), X("style.capitalize", (s, t, a, l, r, o) => {
|
|
2214
2214
|
if (!o || o.length === 0) {
|
|
2215
2215
|
t.innerText = "";
|
|
2216
2216
|
return;
|
|
@@ -2220,10 +2220,10 @@ const qa = (e) => {
|
|
|
2220
2220
|
});
|
|
2221
2221
|
}, to = () => {
|
|
2222
2222
|
}, so = (e, s = {}) => {
|
|
2223
|
-
const t =
|
|
2223
|
+
const t = W(), a = se(), l = s.namespace, r = l === null, o = s.syncToRoute !== !1, i = s.persistToStorage === !0, n = s.restoreOnMount !== !1, c = s.storageTTL || 7, d = r ? `spark-table:${a.path}` : `spark-table:${l}`, p = (b, k = "") => {
|
|
2224
2224
|
const P = {};
|
|
2225
2225
|
return Object.keys(b).forEach((I) => {
|
|
2226
|
-
const Y = b[I], fe =
|
|
2226
|
+
const Y = b[I], fe = k ? `${k}[${I}]` : I;
|
|
2227
2227
|
Y != null && (typeof Y == "object" && !Array.isArray(Y) ? Object.assign(P, p(Y, fe)) : P[fe] = String(Y));
|
|
2228
2228
|
}), P;
|
|
2229
2229
|
}, f = () => {
|
|
@@ -2237,22 +2237,22 @@ const qa = (e) => {
|
|
|
2237
2237
|
} catch (b) {
|
|
2238
2238
|
console.warn("Failed to save table state to localStorage:", b);
|
|
2239
2239
|
}
|
|
2240
|
-
},
|
|
2240
|
+
}, x = () => {
|
|
2241
2241
|
if (!i) return null;
|
|
2242
2242
|
try {
|
|
2243
2243
|
const b = localStorage.getItem(d);
|
|
2244
2244
|
if (!b) return null;
|
|
2245
|
-
const
|
|
2245
|
+
const k = JSON.parse(b);
|
|
2246
2246
|
if (c > 0) {
|
|
2247
|
-
const P = Date.now() -
|
|
2247
|
+
const P = Date.now() - k.timestamp, I = c * 24 * 60 * 60 * 1e3;
|
|
2248
2248
|
if (P > I)
|
|
2249
2249
|
return localStorage.removeItem(d), null;
|
|
2250
2250
|
}
|
|
2251
|
-
return
|
|
2251
|
+
return k.params;
|
|
2252
2252
|
} catch (b) {
|
|
2253
2253
|
return console.warn("Failed to load table state from localStorage:", b), null;
|
|
2254
2254
|
}
|
|
2255
|
-
},
|
|
2255
|
+
}, w = () => {
|
|
2256
2256
|
try {
|
|
2257
2257
|
localStorage.removeItem(d);
|
|
2258
2258
|
} catch (b) {
|
|
@@ -2261,37 +2261,37 @@ const qa = (e) => {
|
|
|
2261
2261
|
}, v = () => {
|
|
2262
2262
|
if (!o) return;
|
|
2263
2263
|
const b = { ...a.query };
|
|
2264
|
-
if (
|
|
2264
|
+
if (r) {
|
|
2265
2265
|
Object.keys(b).forEach((P) => {
|
|
2266
2266
|
u(P) && delete b[P];
|
|
2267
2267
|
});
|
|
2268
|
-
const
|
|
2269
|
-
Object.assign(b,
|
|
2268
|
+
const k = p(e.params);
|
|
2269
|
+
Object.assign(b, k);
|
|
2270
2270
|
} else {
|
|
2271
2271
|
Object.keys(b).forEach((P) => {
|
|
2272
2272
|
(P.startsWith(`${l}[`) || P === l) && delete b[P];
|
|
2273
2273
|
});
|
|
2274
|
-
const
|
|
2275
|
-
Object.assign(b,
|
|
2274
|
+
const k = p(e.params, l);
|
|
2275
|
+
Object.assign(b, k);
|
|
2276
2276
|
}
|
|
2277
2277
|
t.replace({ query: b });
|
|
2278
|
-
}, u = (b) => !!(["page", "limit", "search", "orderBy", "sortedBy"].includes(b) || b.includes("[")), g = (b,
|
|
2279
|
-
if (["page", "limit"].includes(b) &&
|
|
2280
|
-
const I = parseInt(
|
|
2281
|
-
return isNaN(I) ?
|
|
2278
|
+
}, u = (b) => !!(["page", "limit", "search", "orderBy", "sortedBy"].includes(b) || b.includes("[")), g = (b, k) => {
|
|
2279
|
+
if (["page", "limit"].includes(b) && k !== null && k !== void 0) {
|
|
2280
|
+
const I = parseInt(k, 10);
|
|
2281
|
+
return isNaN(I) ? k : I;
|
|
2282
2282
|
}
|
|
2283
|
-
return
|
|
2284
|
-
},
|
|
2285
|
-
if (
|
|
2283
|
+
return k;
|
|
2284
|
+
}, _ = () => {
|
|
2285
|
+
if (r)
|
|
2286
2286
|
Object.keys(a.query).forEach((b) => {
|
|
2287
2287
|
u(b) && (e.params[b] = g(b, a.query[b]));
|
|
2288
2288
|
});
|
|
2289
2289
|
else {
|
|
2290
2290
|
const b = `${l}[`;
|
|
2291
|
-
Object.keys(a.query).forEach((
|
|
2292
|
-
if (
|
|
2293
|
-
const P =
|
|
2294
|
-
e.params[P] = g(P, a.query[
|
|
2291
|
+
Object.keys(a.query).forEach((k) => {
|
|
2292
|
+
if (k.startsWith(b)) {
|
|
2293
|
+
const P = k.slice(b.length, -1);
|
|
2294
|
+
e.params[P] = g(P, a.query[k]);
|
|
2295
2295
|
}
|
|
2296
2296
|
});
|
|
2297
2297
|
}
|
|
@@ -2302,32 +2302,32 @@ const qa = (e) => {
|
|
|
2302
2302
|
o && v(), i && f();
|
|
2303
2303
|
},
|
|
2304
2304
|
{ deep: !0 }
|
|
2305
|
-
),
|
|
2305
|
+
), n && ye(() => {
|
|
2306
2306
|
let b = !1;
|
|
2307
2307
|
if (o) {
|
|
2308
|
-
let
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2308
|
+
let k = !1;
|
|
2309
|
+
if (r)
|
|
2310
|
+
k = Object.keys(a.query).some((P) => u(P));
|
|
2311
2311
|
else {
|
|
2312
2312
|
const P = `${l}[`;
|
|
2313
|
-
|
|
2313
|
+
k = Object.keys(a.query).some(
|
|
2314
2314
|
(I) => I.startsWith(P)
|
|
2315
2315
|
);
|
|
2316
2316
|
}
|
|
2317
|
-
|
|
2317
|
+
k && (b = !0, _());
|
|
2318
2318
|
}
|
|
2319
2319
|
if (!b && i) {
|
|
2320
|
-
const
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
}), Object.assign(e.params,
|
|
2320
|
+
const k = x();
|
|
2321
|
+
k && Object.keys(k).length > 0 && (Object.keys(k).forEach((P) => {
|
|
2322
|
+
k[P] = g(P, k[P]);
|
|
2323
|
+
}), Object.assign(e.params, k));
|
|
2324
2324
|
}
|
|
2325
2325
|
}), {
|
|
2326
2326
|
syncToRoute: v,
|
|
2327
|
-
restoreFromRoute:
|
|
2327
|
+
restoreFromRoute: _,
|
|
2328
2328
|
saveToStorage: f,
|
|
2329
|
-
loadFromStorage:
|
|
2330
|
-
clearStorage:
|
|
2329
|
+
loadFromStorage: x,
|
|
2330
|
+
clearStorage: w
|
|
2331
2331
|
};
|
|
2332
2332
|
}, ao = { class: "flex items-center gap-4 py-3" }, oo = { class: "shrink-0" }, ro = { class: "text-sm text-gray-700" }, no = { class: "font-medium" }, lo = { class: "font-medium" }, io = { class: "font-medium" }, co = {
|
|
2333
2333
|
__name: "SparkTablePaginationDetails",
|
|
@@ -2372,15 +2372,15 @@ const qa = (e) => {
|
|
|
2372
2372
|
emits: ["paginate"],
|
|
2373
2373
|
setup(e, { emit: s }) {
|
|
2374
2374
|
const t = e, a = s, l = (d) => {
|
|
2375
|
-
|
|
2376
|
-
},
|
|
2375
|
+
r(t.sparkTable.params.page + d);
|
|
2376
|
+
}, r = (d) => {
|
|
2377
2377
|
d < 1 || d > t.sparkTable.response.meta.last_page || a("paginate", {
|
|
2378
2378
|
page: d
|
|
2379
2379
|
});
|
|
2380
2380
|
}, o = $(() => t.sparkTable.params.page ? Math.ceil(t.sparkTable.params.page / 10) * 10 : 1), i = $(() => t.sparkTable.computed.ready ? ls(
|
|
2381
2381
|
Math.floor((o.value - 1) / 10) * 10 + 1,
|
|
2382
2382
|
o.value > t.sparkTable.response.meta.last_page ? t.sparkTable.response.meta.last_page + 1 : o.value + 1
|
|
2383
|
-
) : []),
|
|
2383
|
+
) : []), n = $(
|
|
2384
2384
|
() => t.sparkTable.params.page < ee(t.sparkTable.response.meta, "last_page", 1)
|
|
2385
2385
|
), c = $(() => t.sparkTable.params.page > 1);
|
|
2386
2386
|
return (d, p) => {
|
|
@@ -2393,29 +2393,29 @@ const qa = (e) => {
|
|
|
2393
2393
|
m("a", {
|
|
2394
2394
|
class: V([c.value ? "" : "disabled", "relative inline-flex items-center rounded-l-md px-2 py-[9px] text-gray-400 ring-1 ring-gray-300 ring-inset hover:bg-gray-50 focus:z-20 focus:outline-offset-0"]),
|
|
2395
2395
|
href: "#",
|
|
2396
|
-
onClick: p[0] || (p[0] = U((
|
|
2396
|
+
onClick: p[0] || (p[0] = U((x) => l(-1), ["prevent"]))
|
|
2397
2397
|
}, [
|
|
2398
2398
|
S(f, {
|
|
2399
|
-
icon:
|
|
2399
|
+
icon: C(F).farChevronLeft,
|
|
2400
2400
|
class: "size-5"
|
|
2401
2401
|
}, null, 8, ["icon"])
|
|
2402
2402
|
], 2),
|
|
2403
|
-
(h(!0), y(D, null, B(i.value, (
|
|
2404
|
-
key: `page-${
|
|
2403
|
+
(h(!0), y(D, null, B(i.value, (x) => (h(), y("a", {
|
|
2404
|
+
key: `page-${x}`,
|
|
2405
2405
|
href: "#",
|
|
2406
2406
|
class: V([
|
|
2407
2407
|
"relative inline-flex items-center px-4 py-[9px] text-sm font-semibold ring-1 ring-inset",
|
|
2408
|
-
e.sparkTable.params.page ===
|
|
2408
|
+
e.sparkTable.params.page === x ? "z-10 text-white bg-primary-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 hover:bg-primary-600" : "text-gray-900 hover:bg-gray-50 ring-gray-300 focus:z-20 focus:outline-offset-0"
|
|
2409
2409
|
]),
|
|
2410
|
-
onClick: (
|
|
2411
|
-
}, M(
|
|
2410
|
+
onClick: (w) => r(x)
|
|
2411
|
+
}, M(x), 11, mo))), 128)),
|
|
2412
2412
|
m("a", {
|
|
2413
|
-
class: V([
|
|
2414
|
-
onClick: p[1] || (p[1] = U((
|
|
2413
|
+
class: V([n.value ? "" : "disabled", "relative inline-flex items-center rounded-r-md px-2 py-[9px] text-gray-400 ring-1 ring-gray-300 ring-inset hover:bg-gray-50 focus:z-20 focus:outline-offset-0"]),
|
|
2414
|
+
onClick: p[1] || (p[1] = U((x) => l(1), ["prevent"])),
|
|
2415
2415
|
href: "#"
|
|
2416
2416
|
}, [
|
|
2417
2417
|
S(f, {
|
|
2418
|
-
icon:
|
|
2418
|
+
icon: C(F).farChevronRight,
|
|
2419
2419
|
class: "size-5"
|
|
2420
2420
|
}, null, 8, ["icon"])
|
|
2421
2421
|
], 2)
|
|
@@ -2444,23 +2444,23 @@ const qa = (e) => {
|
|
|
2444
2444
|
const t = e, a = s, l = $(() => t.sparkTable.options.perPages.map((o) => ({
|
|
2445
2445
|
label: String(o),
|
|
2446
2446
|
value: o
|
|
2447
|
-
}))),
|
|
2447
|
+
}))), r = (o) => {
|
|
2448
2448
|
a("paginate", {
|
|
2449
2449
|
page: 1,
|
|
2450
2450
|
limit: parseInt(o)
|
|
2451
2451
|
});
|
|
2452
2452
|
};
|
|
2453
2453
|
return (o, i) => {
|
|
2454
|
-
const
|
|
2454
|
+
const n = E("FormKit");
|
|
2455
2455
|
return h(), y("div", go, [
|
|
2456
|
-
S(
|
|
2456
|
+
S(n, {
|
|
2457
2457
|
"model-value": e.sparkTable.params.limit,
|
|
2458
2458
|
type: "select",
|
|
2459
2459
|
options: l.value,
|
|
2460
2460
|
"outer-class": "!mb-0",
|
|
2461
2461
|
"wrapper-class": "!mb-0",
|
|
2462
2462
|
"input-class": "!py-2",
|
|
2463
|
-
onInput:
|
|
2463
|
+
onInput: r
|
|
2464
2464
|
}, null, 8, ["model-value", "options"])
|
|
2465
2465
|
]);
|
|
2466
2466
|
};
|
|
@@ -2476,14 +2476,14 @@ const qa = (e) => {
|
|
|
2476
2476
|
},
|
|
2477
2477
|
setup(e) {
|
|
2478
2478
|
const s = e, t = Be(), a = $(() => !!t.default), l = $(() => {
|
|
2479
|
-
const
|
|
2480
|
-
return s.position === "footer" ? `${
|
|
2479
|
+
const r = "spark-table-toolbar flex flex-wrap items-center gap-x-5 w-full";
|
|
2480
|
+
return s.position === "footer" ? `${r} spark-table-toolbar-footer justify-between` : `${r} spark-table-toolbar-header gap-y-5 py-5`;
|
|
2481
2481
|
});
|
|
2482
|
-
return (
|
|
2482
|
+
return (r, o) => a.value ? (h(), y("div", {
|
|
2483
2483
|
key: 0,
|
|
2484
2484
|
class: V(l.value)
|
|
2485
2485
|
}, [
|
|
2486
|
-
O(
|
|
2486
|
+
O(r.$slots, "default")
|
|
2487
2487
|
], 2)) : T("", !0);
|
|
2488
2488
|
}
|
|
2489
2489
|
}, bo = { class: "spark-table-search" }, xo = {
|
|
@@ -2518,20 +2518,20 @@ const qa = (e) => {
|
|
|
2518
2518
|
j(t, (o) => {
|
|
2519
2519
|
l(o);
|
|
2520
2520
|
});
|
|
2521
|
-
const
|
|
2521
|
+
const r = s.config.placeholder || "Search...";
|
|
2522
2522
|
return j(
|
|
2523
2523
|
() => s.sparkTable.params[a],
|
|
2524
2524
|
(o) => {
|
|
2525
2525
|
o && o !== t.value ? t.value = o : !o && t.value && (t.value = "");
|
|
2526
2526
|
}
|
|
2527
2527
|
), (o, i) => {
|
|
2528
|
-
const
|
|
2528
|
+
const n = E("FormKit");
|
|
2529
2529
|
return h(), y("div", bo, [
|
|
2530
|
-
S(
|
|
2530
|
+
S(n, q({
|
|
2531
2531
|
modelValue: t.value,
|
|
2532
2532
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2533
2533
|
type: "text",
|
|
2534
|
-
placeholder:
|
|
2534
|
+
placeholder: C(r),
|
|
2535
2535
|
suffixIcon: "search",
|
|
2536
2536
|
"outer-class": "!mb-0",
|
|
2537
2537
|
"wrapper-class": "!mb-0",
|
|
@@ -2560,7 +2560,7 @@ const qa = (e) => {
|
|
|
2560
2560
|
s.sparkTable.params[a] ? t.value = s.sparkTable.params[a] : s.config.initialValue !== void 0 && s.config.initialValue !== null && (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2561
2561
|
[a]: s.config.initialValue
|
|
2562
2562
|
}));
|
|
2563
|
-
const l = s.config.label || null,
|
|
2563
|
+
const l = s.config.label || null, r = $(() => [
|
|
2564
2564
|
{ label: s.config.placeholder || "All", value: "" },
|
|
2565
2565
|
...s.config.options
|
|
2566
2566
|
]);
|
|
@@ -2575,14 +2575,14 @@ const qa = (e) => {
|
|
|
2575
2575
|
o != null && o !== "" ? t.value !== o && (t.value = o) : t.value && (t.value = "");
|
|
2576
2576
|
}
|
|
2577
2577
|
), (o, i) => {
|
|
2578
|
-
const
|
|
2578
|
+
const n = E("FormKit");
|
|
2579
2579
|
return h(), y("div", wo, [
|
|
2580
|
-
S(
|
|
2580
|
+
S(n, q({
|
|
2581
2581
|
modelValue: t.value,
|
|
2582
2582
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2583
2583
|
type: "select",
|
|
2584
|
-
label:
|
|
2585
|
-
options:
|
|
2584
|
+
label: C(l),
|
|
2585
|
+
options: r.value,
|
|
2586
2586
|
placeholder: e.config.placeholder || "All",
|
|
2587
2587
|
"outer-class": "!mb-0",
|
|
2588
2588
|
"wrapper-class": "!mb-0"
|
|
@@ -2613,7 +2613,7 @@ const qa = (e) => {
|
|
|
2613
2613
|
s.sparkTable.params[l] !== void 0 ? t.value = s.sparkTable.params[l] : s.config.initialValue !== void 0 && (t.value = s.config.initialValue, s.config.initialValue !== null && s.sparkTable.methods.applyParams({
|
|
2614
2614
|
[l]: s.config.initialValue
|
|
2615
2615
|
}));
|
|
2616
|
-
const
|
|
2616
|
+
const r = (i) => i == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === i, o = (i) => {
|
|
2617
2617
|
t.value = i, i == null || i === "" ? s.sparkTable.methods.removeParam(l) : s.sparkTable.methods.applyParams({
|
|
2618
2618
|
page: 1,
|
|
2619
2619
|
[l]: i
|
|
@@ -2624,15 +2624,15 @@ const qa = (e) => {
|
|
|
2624
2624
|
(i) => {
|
|
2625
2625
|
(i == null || i === "") && t.value ? t.value = null : i !== t.value && (t.value = i);
|
|
2626
2626
|
}
|
|
2627
|
-
), (i,
|
|
2628
|
-
|
|
2627
|
+
), (i, n) => (h(), y("div", So, [
|
|
2628
|
+
C(a) ? (h(), y("span", $o, M(C(a)), 1)) : T("", !0),
|
|
2629
2629
|
S(pt, { class: "isolate" }, {
|
|
2630
2630
|
default: L(() => [
|
|
2631
|
-
(h(!0), y(D, null, B(e.config.options, (c) => (h(), H(
|
|
2631
|
+
(h(!0), y(D, null, B(e.config.options, (c) => (h(), H(G, {
|
|
2632
2632
|
key: c.value,
|
|
2633
2633
|
size: "xl",
|
|
2634
2634
|
"button-class": "px-3.5",
|
|
2635
|
-
variant:
|
|
2635
|
+
variant: r(c.value) ? "primary" : "secondary",
|
|
2636
2636
|
onClick: (d) => o(c.value)
|
|
2637
2637
|
}, {
|
|
2638
2638
|
default: L(() => [
|
|
@@ -2661,7 +2661,7 @@ const qa = (e) => {
|
|
|
2661
2661
|
}
|
|
2662
2662
|
},
|
|
2663
2663
|
setup(e) {
|
|
2664
|
-
const s = e, t = R(null), a = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`,
|
|
2664
|
+
const s = e, t = R(null), a = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`, r = R(`${l}-0`);
|
|
2665
2665
|
return s.sparkTable.params[l] ? t.value = s.sparkTable.params[l] : s.config.initialValue ? (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2666
2666
|
[l]: s.config.initialValue
|
|
2667
2667
|
})) : t.value = null, j(t, (o) => {
|
|
@@ -2674,20 +2674,20 @@ const qa = (e) => {
|
|
|
2674
2674
|
(o) => {
|
|
2675
2675
|
if ((o == null || o === "") && t.value) {
|
|
2676
2676
|
t.value = null;
|
|
2677
|
-
const i = parseInt(
|
|
2678
|
-
|
|
2677
|
+
const i = parseInt(r.value.split("-").pop()) || 0;
|
|
2678
|
+
r.value = `${l}-${i + 1}`;
|
|
2679
2679
|
} else o && o !== t.value && (t.value = o);
|
|
2680
2680
|
}
|
|
2681
2681
|
), (o, i) => {
|
|
2682
|
-
const
|
|
2682
|
+
const n = E("FormKit");
|
|
2683
2683
|
return h(), y("div", Po, [
|
|
2684
|
-
(h(), H(
|
|
2685
|
-
key:
|
|
2684
|
+
(h(), H(n, q({
|
|
2685
|
+
key: r.value,
|
|
2686
2686
|
modelValue: t.value,
|
|
2687
2687
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2688
2688
|
type: "datepicker",
|
|
2689
2689
|
"picker-only": "",
|
|
2690
|
-
label:
|
|
2690
|
+
label: C(a),
|
|
2691
2691
|
placeholder: e.config.placeholder || "Select date",
|
|
2692
2692
|
overlay: !0,
|
|
2693
2693
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2714,16 +2714,16 @@ const qa = (e) => {
|
|
|
2714
2714
|
},
|
|
2715
2715
|
setup(e) {
|
|
2716
2716
|
const s = e, t = () => {
|
|
2717
|
-
const a = s.sparkTable.plugins || {}, l = [],
|
|
2717
|
+
const a = s.sparkTable.plugins || {}, l = [], r = {};
|
|
2718
2718
|
Object.entries(a).forEach(([c, d]) => {
|
|
2719
2719
|
if (!d || d.type === "reset" || !(typeof d.enabled == "function" ? d.enabled(s.sparkTable.params) : d.enabled))
|
|
2720
2720
|
return;
|
|
2721
2721
|
let f = null;
|
|
2722
|
-
d.type === "search" ? f = d.param || "search" : d.type === "filterSelect" || d.type === "filterButtons" ? f = d.param || `filter[${d.key}]` : d.type === "datePicker" && (f = d.param || `filter[${d.key}]`), f && (d.initialValue !== void 0 && d.initialValue !== null ?
|
|
2722
|
+
d.type === "search" ? f = d.param || "search" : d.type === "filterSelect" || d.type === "filterButtons" ? f = d.param || `filter[${d.key}]` : d.type === "datePicker" && (f = d.param || `filter[${d.key}]`), f && (d.initialValue !== void 0 && d.initialValue !== null ? r[f] = d.initialValue : l.push(f));
|
|
2723
2723
|
});
|
|
2724
2724
|
const o = l.filter(
|
|
2725
2725
|
(c) => s.sparkTable.params[c] !== void 0 && s.sparkTable.params[c] !== null && s.sparkTable.params[c] !== ""
|
|
2726
|
-
), i = Object.entries(
|
|
2726
|
+
), i = Object.entries(r).filter(
|
|
2727
2727
|
([c, d]) => s.sparkTable.params[c] !== d
|
|
2728
2728
|
);
|
|
2729
2729
|
if (o.length === 0 && i.length === 0)
|
|
@@ -2731,20 +2731,20 @@ const qa = (e) => {
|
|
|
2731
2731
|
o.forEach((c) => {
|
|
2732
2732
|
delete s.sparkTable.params[c];
|
|
2733
2733
|
});
|
|
2734
|
-
const
|
|
2735
|
-
s.sparkTable.methods.applyParams({ ...
|
|
2734
|
+
const n = Object.fromEntries(i);
|
|
2735
|
+
s.sparkTable.methods.applyParams({ ...n, page: 1 });
|
|
2736
2736
|
};
|
|
2737
2737
|
return (a, l) => {
|
|
2738
|
-
const
|
|
2738
|
+
const r = E("font-awesome-icon");
|
|
2739
2739
|
return h(), y("div", Ho, [
|
|
2740
|
-
S(
|
|
2740
|
+
S(G, {
|
|
2741
2741
|
onClick: t,
|
|
2742
2742
|
variant: "secondary",
|
|
2743
2743
|
"button-class": "px-3.5",
|
|
2744
2744
|
size: "xl"
|
|
2745
2745
|
}, {
|
|
2746
2746
|
default: L(() => [
|
|
2747
|
-
e.config.icon ? (h(), H(
|
|
2747
|
+
e.config.icon ? (h(), H(r, {
|
|
2748
2748
|
key: 0,
|
|
2749
2749
|
icon: ["far", e.config.icon],
|
|
2750
2750
|
class: V({ "mr-1.5": e.config.label })
|
|
@@ -2790,7 +2790,7 @@ const qa = (e) => {
|
|
|
2790
2790
|
dataTransformer: {
|
|
2791
2791
|
type: Function,
|
|
2792
2792
|
default: (e, s) => ({
|
|
2793
|
-
data: ee(s.settings, "nestedHeaders") ? e.data.data.map((a) => (s.settings.columnKeys || []).map((
|
|
2793
|
+
data: ee(s.settings, "nestedHeaders") ? e.data.data.map((a) => (s.settings.columnKeys || []).map((r) => a[r])) : e.data.data,
|
|
2794
2794
|
meta: {
|
|
2795
2795
|
last_page: e.data.last_page,
|
|
2796
2796
|
from: e.data.from,
|
|
@@ -2844,7 +2844,7 @@ const qa = (e) => {
|
|
|
2844
2844
|
setup(e, { expose: s, emit: t }) {
|
|
2845
2845
|
const a = e;
|
|
2846
2846
|
hs(), me(ds), me(ps), me(fs), ee(a, "settings.nestedHeaders") && me(ms);
|
|
2847
|
-
const l = t,
|
|
2847
|
+
const l = t, r = $e("axios"), o = R(null), i = R(!1), n = R(null);
|
|
2848
2848
|
let c = !1;
|
|
2849
2849
|
const d = {
|
|
2850
2850
|
search: ko,
|
|
@@ -2873,13 +2873,13 @@ const qa = (e) => {
|
|
|
2873
2873
|
},
|
|
2874
2874
|
loadTable: async (u) => {
|
|
2875
2875
|
if (!(!o.value || !o.value.hotInstance)) {
|
|
2876
|
-
i.value = !0,
|
|
2876
|
+
i.value = !0, n.value = null, l("loading", !0), ve.start(), p.hotInstance = o.value.hotInstance;
|
|
2877
2877
|
try {
|
|
2878
2878
|
if (a.dataProvider) {
|
|
2879
2879
|
const b = await a.dataProvider(p.computed.params);
|
|
2880
2880
|
p.response = a.dataTransformer(b, a);
|
|
2881
2881
|
} else if (a.url) {
|
|
2882
|
-
const b = await
|
|
2882
|
+
const b = await r.get(a.url, {
|
|
2883
2883
|
params: p.computed.params
|
|
2884
2884
|
});
|
|
2885
2885
|
p.response = a.dataTransformer(b, a);
|
|
@@ -2890,14 +2890,14 @@ const qa = (e) => {
|
|
|
2890
2890
|
if (c) return;
|
|
2891
2891
|
p.hotInstance.updateData(p.response.data), p.options.callback && typeof p.options.callback == "function" && await p.options.callback();
|
|
2892
2892
|
const g = p.hotInstance.getPlugin("autoColumnSize");
|
|
2893
|
-
ee(a.settings, "columns", []).forEach((b,
|
|
2894
|
-
b.width || g.calculateColumnsWidth(
|
|
2893
|
+
ee(a.settings, "columns", []).forEach((b, k) => {
|
|
2894
|
+
b.width || g.calculateColumnsWidth(k, k, !0);
|
|
2895
2895
|
}), l("load", {
|
|
2896
2896
|
data: p.response.data,
|
|
2897
2897
|
meta: p.response.meta
|
|
2898
2898
|
}), u && typeof u == "function" && u();
|
|
2899
2899
|
} catch (g) {
|
|
2900
|
-
|
|
2900
|
+
n.value = g, l("error", g), console.error("Error loading table data:", g);
|
|
2901
2901
|
} finally {
|
|
2902
2902
|
i.value = !1, l("loading", !1), ve.done();
|
|
2903
2903
|
}
|
|
@@ -2917,8 +2917,8 @@ const qa = (e) => {
|
|
|
2917
2917
|
},
|
|
2918
2918
|
clearParam: (u) => p.methods.removeParam(u),
|
|
2919
2919
|
clearParams: (u) => {
|
|
2920
|
-
(Array.isArray(u) ? u : [u]).forEach((
|
|
2921
|
-
p.params[
|
|
2920
|
+
(Array.isArray(u) ? u : [u]).forEach((_) => {
|
|
2921
|
+
p.params[_] !== void 0 && delete p.params[_];
|
|
2922
2922
|
}), p.methods.applyParams({ page: 1 });
|
|
2923
2923
|
}
|
|
2924
2924
|
},
|
|
@@ -2955,13 +2955,13 @@ const qa = (e) => {
|
|
|
2955
2955
|
* This ensures custom renderers copy their visual output, not the underlying data
|
|
2956
2956
|
*/
|
|
2957
2957
|
beforeCopy: (u, g) => {
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2960
|
-
for (let
|
|
2958
|
+
const _ = o.value?.hotInstance;
|
|
2959
|
+
_ && g.forEach((b) => {
|
|
2960
|
+
for (let k = b.startRow; k <= b.endRow; k++)
|
|
2961
2961
|
for (let P = b.startCol; P <= b.endCol; P++) {
|
|
2962
|
-
const I =
|
|
2962
|
+
const I = _.getCell(k, P);
|
|
2963
2963
|
if (I) {
|
|
2964
|
-
const Y =
|
|
2964
|
+
const Y = k - g[0].startRow, fe = P - g[0].startCol;
|
|
2965
2965
|
u[Y][fe] = I.dataset.copyValue ?? I.textContent ?? "";
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
@@ -2971,7 +2971,7 @@ const qa = (e) => {
|
|
|
2971
2971
|
}))
|
|
2972
2972
|
}), f = $(
|
|
2973
2973
|
() => p.computed.ready && p.response.data?.length === 0
|
|
2974
|
-
),
|
|
2974
|
+
), x = (u) => {
|
|
2975
2975
|
if (!u) return null;
|
|
2976
2976
|
switch (u.type) {
|
|
2977
2977
|
case "search":
|
|
@@ -2983,16 +2983,16 @@ const qa = (e) => {
|
|
|
2983
2983
|
default:
|
|
2984
2984
|
return null;
|
|
2985
2985
|
}
|
|
2986
|
-
},
|
|
2986
|
+
}, w = (u) => u ? typeof u.enabled == "function" ? u.enabled(p.params) : u.enabled : !1, v = $(() => Object.entries(a.plugins).filter(([u, g]) => w(g)).map(([u, g]) => ({ name: u, config: g })));
|
|
2987
2987
|
if (j(
|
|
2988
2988
|
() => ({ ...p.params }),
|
|
2989
2989
|
() => {
|
|
2990
2990
|
const u = [];
|
|
2991
2991
|
Object.values(a.plugins).forEach((g) => {
|
|
2992
|
-
const
|
|
2993
|
-
if (!
|
|
2994
|
-
const b =
|
|
2995
|
-
!b &&
|
|
2992
|
+
const _ = x(g);
|
|
2993
|
+
if (!_) return;
|
|
2994
|
+
const b = w(g), k = p.params[_] !== void 0;
|
|
2995
|
+
!b && k && u.push(_);
|
|
2996
2996
|
}), u.length > 0 && u.forEach((g) => {
|
|
2997
2997
|
delete p.params[g];
|
|
2998
2998
|
});
|
|
@@ -3036,11 +3036,11 @@ const qa = (e) => {
|
|
|
3036
3036
|
clearParams: (u) => p.methods.clearParams(u),
|
|
3037
3037
|
applyParams: (u) => p.methods.applyParams(u),
|
|
3038
3038
|
loading: i,
|
|
3039
|
-
error:
|
|
3039
|
+
error: n,
|
|
3040
3040
|
sparkTable: p,
|
|
3041
3041
|
table: o
|
|
3042
3042
|
}), (u, g) => {
|
|
3043
|
-
const
|
|
3043
|
+
const _ = E("font-awesome-icon");
|
|
3044
3044
|
return h(), y("div", Eo, [
|
|
3045
3045
|
p.computed.ready && v.value && v.value.length ? (h(), H(De, {
|
|
3046
3046
|
key: 0,
|
|
@@ -3056,12 +3056,12 @@ const qa = (e) => {
|
|
|
3056
3056
|
O(u.$slots, "header", {
|
|
3057
3057
|
sparkTable: p,
|
|
3058
3058
|
loading: i.value,
|
|
3059
|
-
error:
|
|
3059
|
+
error: n.value
|
|
3060
3060
|
})
|
|
3061
3061
|
]),
|
|
3062
3062
|
_: 3
|
|
3063
3063
|
})) : (h(), y("div", Ao)),
|
|
3064
|
-
bt(S(
|
|
3064
|
+
bt(S(C(us), {
|
|
3065
3065
|
"theme-name": "ht-theme-classic",
|
|
3066
3066
|
ref_key: "table",
|
|
3067
3067
|
ref: o,
|
|
@@ -3070,8 +3070,8 @@ const qa = (e) => {
|
|
|
3070
3070
|
[xt, !f.value]
|
|
3071
3071
|
]),
|
|
3072
3072
|
f.value ? (h(), y("div", Io, [
|
|
3073
|
-
S(
|
|
3074
|
-
icon:
|
|
3073
|
+
S(_, {
|
|
3074
|
+
icon: C(F).farInbox,
|
|
3075
3075
|
class: "size-12 mb-4 text-gray-300"
|
|
3076
3076
|
}, null, 8, ["icon"]),
|
|
3077
3077
|
g[0] || (g[0] = m("p", { class: "text-sm" }, "No records found", -1))
|
|
@@ -3098,7 +3098,7 @@ const qa = (e) => {
|
|
|
3098
3098
|
O(u.$slots, "footer", {
|
|
3099
3099
|
sparkTable: p,
|
|
3100
3100
|
loading: i.value,
|
|
3101
|
-
error:
|
|
3101
|
+
error: n.value
|
|
3102
3102
|
})
|
|
3103
3103
|
])
|
|
3104
3104
|
]),
|
|
@@ -3121,8 +3121,8 @@ function Ae() {
|
|
|
3121
3121
|
e.isVisible = !1, e.content = null, e.props = {}, e.eventHandlers = {}, e.size = "md";
|
|
3122
3122
|
}, a = () => {
|
|
3123
3123
|
e.isVisible = !0;
|
|
3124
|
-
}, l = (o, i = {},
|
|
3125
|
-
e.content = ce(o), e.props = i, e.eventHandlers =
|
|
3124
|
+
}, l = (o, i = {}, n = {}, c = {}) => {
|
|
3125
|
+
e.content = ce(o), e.props = i, e.eventHandlers = n, e.size = c.size || "md";
|
|
3126
3126
|
};
|
|
3127
3127
|
return {
|
|
3128
3128
|
state: e,
|
|
@@ -3130,8 +3130,8 @@ function Ae() {
|
|
|
3130
3130
|
close: t,
|
|
3131
3131
|
open: a,
|
|
3132
3132
|
setContent: l,
|
|
3133
|
-
show: (o, i = {},
|
|
3134
|
-
o && l(o, i,
|
|
3133
|
+
show: (o, i = {}, n = {}, c = {}) => {
|
|
3134
|
+
o && l(o, i, n, c), a();
|
|
3135
3135
|
}
|
|
3136
3136
|
};
|
|
3137
3137
|
}
|
|
@@ -3140,22 +3140,22 @@ class zo {
|
|
|
3140
3140
|
this.left = Ae(), this.right = Ae();
|
|
3141
3141
|
}
|
|
3142
3142
|
showLeft = (s, t = {}, a = {}, l = {}) => {
|
|
3143
|
-
const
|
|
3143
|
+
const r = {
|
|
3144
3144
|
close: () => {
|
|
3145
3145
|
a.close?.(), this.closeLeft();
|
|
3146
3146
|
},
|
|
3147
3147
|
...a
|
|
3148
3148
|
};
|
|
3149
|
-
this.left.show(s, t,
|
|
3149
|
+
this.left.show(s, t, r, l);
|
|
3150
3150
|
};
|
|
3151
3151
|
showRight = (s, t = {}, a = {}, l = {}) => {
|
|
3152
|
-
const
|
|
3152
|
+
const r = {
|
|
3153
3153
|
close: () => {
|
|
3154
3154
|
a.close?.(), this.closeRight();
|
|
3155
3155
|
},
|
|
3156
3156
|
...a
|
|
3157
3157
|
};
|
|
3158
|
-
this.right.show(s, t,
|
|
3158
|
+
this.right.show(s, t, r, l);
|
|
3159
3159
|
};
|
|
3160
3160
|
closeLeft = () => {
|
|
3161
3161
|
this.left.close();
|
|
@@ -3175,12 +3175,12 @@ const ae = new zo(), jo = (e) => {
|
|
|
3175
3175
|
maxAge: a = 31536e3,
|
|
3176
3176
|
// 365 days in seconds
|
|
3177
3177
|
domain: l = ft(),
|
|
3178
|
-
secure:
|
|
3178
|
+
secure: r = !0,
|
|
3179
3179
|
sameSite: o = "Lax",
|
|
3180
3180
|
path: i = "/"
|
|
3181
3181
|
} = t;
|
|
3182
|
-
let
|
|
3183
|
-
l && (
|
|
3182
|
+
let n = `${e}=${s}; max-age=${a}; path=${i}; samesite=${o}`;
|
|
3183
|
+
l && (n += `; domain=${l}`), r && (n += "; secure"), document.cookie = n;
|
|
3184
3184
|
}, Zo = (e, s = {}) => {
|
|
3185
3185
|
const { domain: t = ft(), path: a = "/" } = s;
|
|
3186
3186
|
let l = `${e}=; max-age=0; path=${a}`;
|
|
@@ -3249,7 +3249,7 @@ const ke = "bolt-next-token", Q = pe("auth", () => {
|
|
|
3249
3249
|
No(ke, c), e.token = c;
|
|
3250
3250
|
}, a = () => {
|
|
3251
3251
|
Zo(ke), e.token = null;
|
|
3252
|
-
}, l = () => jo(ke),
|
|
3252
|
+
}, l = () => jo(ke), r = async (c) => {
|
|
3253
3253
|
const d = await le.post(e.endpoints.login, c), p = d.headers.authorization;
|
|
3254
3254
|
return t(p), e.user = d.data, e.callbacks.onLoginSuccess && await e.callbacks.onLoginSuccess(d.data), d.data;
|
|
3255
3255
|
}, o = async () => {
|
|
@@ -3284,14 +3284,14 @@ const ke = "bolt-next-token", Q = pe("auth", () => {
|
|
|
3284
3284
|
} finally {
|
|
3285
3285
|
e.ready = !0;
|
|
3286
3286
|
}
|
|
3287
|
-
},
|
|
3287
|
+
}, n = $(() => e.overrideToken ? !0 : !!e.token && !!e.user);
|
|
3288
3288
|
return {
|
|
3289
3289
|
state: e,
|
|
3290
3290
|
initialize: s,
|
|
3291
|
-
login:
|
|
3291
|
+
login: r,
|
|
3292
3292
|
logout: o,
|
|
3293
3293
|
fetchUser: i,
|
|
3294
|
-
check:
|
|
3294
|
+
check: n,
|
|
3295
3295
|
setTokenCookie: t,
|
|
3296
3296
|
clearTokenCookie: a,
|
|
3297
3297
|
getTokenCookie: l
|
|
@@ -3341,12 +3341,12 @@ let ne = null;
|
|
|
3341
3341
|
function sl(e, s = {}) {
|
|
3342
3342
|
return ne = Ko(s), e.provide("axios", ne), e.config.globalProperties.$axios = ne, ne;
|
|
3343
3343
|
}
|
|
3344
|
-
function
|
|
3344
|
+
function Wo() {
|
|
3345
3345
|
if (!ne)
|
|
3346
3346
|
throw new Error("Axios instance not initialized. Call setupAxios() first.");
|
|
3347
3347
|
return ne;
|
|
3348
3348
|
}
|
|
3349
|
-
function
|
|
3349
|
+
function Go(e) {
|
|
3350
3350
|
return e?.status !== 422 ? null : e.data?.errors || null;
|
|
3351
3351
|
}
|
|
3352
3352
|
function Ie(e) {
|
|
@@ -3361,66 +3361,66 @@ function al(e = {}) {
|
|
|
3361
3361
|
createMessage: t = "Created successfully!",
|
|
3362
3362
|
updateMessage: a = "Updated successfully!",
|
|
3363
3363
|
redirectTo: l = null,
|
|
3364
|
-
onSuccess:
|
|
3364
|
+
onSuccess: r = null,
|
|
3365
3365
|
onError: o = null,
|
|
3366
3366
|
showNotification: i = !0,
|
|
3367
|
-
setFieldErrors:
|
|
3367
|
+
setFieldErrors: n = !0,
|
|
3368
3368
|
setFormErrors: c = !1
|
|
3369
|
-
} = e, d =
|
|
3370
|
-
async function f(
|
|
3371
|
-
const { submitFn: v, method: u = "create", node: g = null, isEditMode:
|
|
3369
|
+
} = e, d = W(), p = R(!1);
|
|
3370
|
+
async function f(w) {
|
|
3371
|
+
const { submitFn: v, method: u = "create", node: g = null, isEditMode: _ = !1 } = w;
|
|
3372
3372
|
p.value = !0, g && g.clearErrors();
|
|
3373
3373
|
try {
|
|
3374
|
-
const
|
|
3374
|
+
const k = (await v()).data;
|
|
3375
3375
|
if (i) {
|
|
3376
|
-
const P =
|
|
3376
|
+
const P = _ ? a : u === "create" ? t : s;
|
|
3377
3377
|
z.show({
|
|
3378
3378
|
type: "success",
|
|
3379
3379
|
message: P
|
|
3380
3380
|
});
|
|
3381
3381
|
}
|
|
3382
|
-
if (
|
|
3383
|
-
const P = typeof l == "function" ? l(
|
|
3382
|
+
if (r && await r(k), !_ && l) {
|
|
3383
|
+
const P = typeof l == "function" ? l(k) : l;
|
|
3384
3384
|
await d.push(P);
|
|
3385
3385
|
}
|
|
3386
|
-
return { success: !0, data:
|
|
3386
|
+
return { success: !0, data: k, error: null };
|
|
3387
3387
|
} catch (b) {
|
|
3388
|
-
const
|
|
3388
|
+
const k = b.response;
|
|
3389
3389
|
if (o && await o(b) === !0)
|
|
3390
3390
|
return { success: !1, data: null, error: b };
|
|
3391
|
-
if (Yo(
|
|
3392
|
-
const P =
|
|
3393
|
-
P && g &&
|
|
3391
|
+
if (Yo(k)) {
|
|
3392
|
+
const P = Go(k);
|
|
3393
|
+
P && g && n && g.setErrors([], P), c && z.show({
|
|
3394
3394
|
type: "danger",
|
|
3395
|
-
message: Ie(
|
|
3395
|
+
message: Ie(k)
|
|
3396
3396
|
});
|
|
3397
3397
|
} else
|
|
3398
3398
|
z.show({
|
|
3399
3399
|
type: "danger",
|
|
3400
|
-
message: Ie(
|
|
3400
|
+
message: Ie(k)
|
|
3401
3401
|
});
|
|
3402
3402
|
return { success: !1, data: null, error: b };
|
|
3403
3403
|
} finally {
|
|
3404
3404
|
p.value = !1;
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
|
-
async function w
|
|
3408
|
-
const { url: v, payload: u, method: g = "post", node:
|
|
3407
|
+
async function x(w) {
|
|
3408
|
+
const { url: v, payload: u, method: g = "post", node: _, isEditMode: b } = w, k = Wo();
|
|
3409
3409
|
return f({
|
|
3410
|
-
submitFn: () =>
|
|
3410
|
+
submitFn: () => k[g](v, u),
|
|
3411
3411
|
method: b ? "update" : "create",
|
|
3412
|
-
node:
|
|
3412
|
+
node: _,
|
|
3413
3413
|
isEditMode: b
|
|
3414
3414
|
});
|
|
3415
3415
|
}
|
|
3416
3416
|
return {
|
|
3417
3417
|
submitting: p,
|
|
3418
3418
|
submit: f,
|
|
3419
|
-
submitToApi:
|
|
3419
|
+
submitToApi: x
|
|
3420
3420
|
};
|
|
3421
3421
|
}
|
|
3422
3422
|
function ol(e = {}) {
|
|
3423
|
-
const { items: s = [], defaultId: t = null } = e, a =
|
|
3423
|
+
const { items: s = [], defaultId: t = null } = e, a = W(), l = se(), r = R(s.map(o));
|
|
3424
3424
|
function o(u) {
|
|
3425
3425
|
return {
|
|
3426
3426
|
id: u.id,
|
|
@@ -3439,67 +3439,67 @@ function ol(e = {}) {
|
|
|
3439
3439
|
function i(u) {
|
|
3440
3440
|
return typeof u == "function" ? u() : u;
|
|
3441
3441
|
}
|
|
3442
|
-
const
|
|
3442
|
+
const n = $(() => r.value.filter((u) => !i(u.hidden)));
|
|
3443
3443
|
function c(u) {
|
|
3444
|
-
const g = typeof u == "string" ?
|
|
3444
|
+
const g = typeof u == "string" ? r.value.find((_) => _.id === u) : u;
|
|
3445
3445
|
return g ? i(g.disabled) : !1;
|
|
3446
3446
|
}
|
|
3447
3447
|
function d(u) {
|
|
3448
|
-
const g = typeof u == "string" ?
|
|
3448
|
+
const g = typeof u == "string" ? r.value.find((b) => b.id === u) : u;
|
|
3449
3449
|
if (!g || !g.route) return !1;
|
|
3450
|
-
const
|
|
3451
|
-
if (
|
|
3450
|
+
const _ = typeof g.route == "string" ? { name: g.route } : g.route;
|
|
3451
|
+
if (_.name && l.name === _.name)
|
|
3452
3452
|
return !0;
|
|
3453
|
-
if (
|
|
3454
|
-
const b = a.resolve(
|
|
3453
|
+
if (_.path) {
|
|
3454
|
+
const b = a.resolve(_);
|
|
3455
3455
|
return l.path === b.path;
|
|
3456
3456
|
}
|
|
3457
3457
|
return !1;
|
|
3458
3458
|
}
|
|
3459
3459
|
const p = $(() => {
|
|
3460
|
-
const u =
|
|
3461
|
-
return u || (t ?
|
|
3460
|
+
const u = n.value.find((g) => d(g));
|
|
3461
|
+
return u || (t ? n.value.find((g) => g.id === t) || n.value[0] : n.value[0] || null);
|
|
3462
3462
|
}), f = $(() => p.value?.id || null);
|
|
3463
|
-
async function
|
|
3464
|
-
const g = typeof u == "string" ?
|
|
3463
|
+
async function x(u) {
|
|
3464
|
+
const g = typeof u == "string" ? r.value.find((_) => _.id === u) : u;
|
|
3465
3465
|
if (!g)
|
|
3466
3466
|
return console.warn(`[useSubNavigation] Item not found: ${u}`), !1;
|
|
3467
3467
|
if (c(g))
|
|
3468
3468
|
return !1;
|
|
3469
3469
|
if (g.route) {
|
|
3470
|
-
const
|
|
3471
|
-
return await a.push(
|
|
3470
|
+
const _ = typeof g.route == "string" ? { name: g.route } : g.route;
|
|
3471
|
+
return await a.push(_), !0;
|
|
3472
3472
|
}
|
|
3473
3473
|
if (g.overlay) {
|
|
3474
|
-
const { component:
|
|
3475
|
-
return ae[P === "left" ? "showLeft" : "showRight"](ce(
|
|
3474
|
+
const { component: _, props: b = {}, eventHandlers: k = {}, position: P = "right", size: I } = g.overlay;
|
|
3475
|
+
return ae[P === "left" ? "showLeft" : "showRight"](ce(_), b, k, { size: I }), !0;
|
|
3476
3476
|
}
|
|
3477
3477
|
if (g.modal) {
|
|
3478
|
-
const { component:
|
|
3479
|
-
return J.show(ce(
|
|
3478
|
+
const { component: _, props: b = {}, eventHandlers: k = {} } = g.modal;
|
|
3479
|
+
return J.show(ce(_), b, k), !0;
|
|
3480
3480
|
}
|
|
3481
3481
|
if (g.action) {
|
|
3482
|
-
const
|
|
3483
|
-
return
|
|
3482
|
+
const _ = g.action(g);
|
|
3483
|
+
return _ instanceof Promise && await _, !0;
|
|
3484
3484
|
}
|
|
3485
3485
|
return !1;
|
|
3486
3486
|
}
|
|
3487
|
-
function
|
|
3488
|
-
|
|
3487
|
+
function w(u) {
|
|
3488
|
+
r.value = u.map(o);
|
|
3489
3489
|
}
|
|
3490
3490
|
function v(u, g) {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3491
|
+
const _ = r.value.findIndex((b) => b.id === u);
|
|
3492
|
+
_ !== -1 && (r.value[_] = o({ ...r.value[_], ...g }));
|
|
3493
3493
|
}
|
|
3494
3494
|
return {
|
|
3495
|
-
items:
|
|
3496
|
-
visibleItems:
|
|
3495
|
+
items: r,
|
|
3496
|
+
visibleItems: n,
|
|
3497
3497
|
activeItem: p,
|
|
3498
3498
|
activeId: f,
|
|
3499
|
-
navigateTo:
|
|
3499
|
+
navigateTo: x,
|
|
3500
3500
|
isActive: d,
|
|
3501
3501
|
isDisabled: c,
|
|
3502
|
-
setItems:
|
|
3502
|
+
setItems: w,
|
|
3503
3503
|
updateItem: v
|
|
3504
3504
|
};
|
|
3505
3505
|
}
|
|
@@ -3527,18 +3527,18 @@ function rl(e = {}) {
|
|
|
3527
3527
|
title: t = "Unsaved Changes",
|
|
3528
3528
|
confirmText: a = "Leave",
|
|
3529
3529
|
cancelText: l = "Stay",
|
|
3530
|
-
useRouteGuard:
|
|
3530
|
+
useRouteGuard: r = !0
|
|
3531
3531
|
} = e, o = `form-${++Xo}`, i = R(!1);
|
|
3532
3532
|
ie.set(o, {
|
|
3533
3533
|
isDirty: !1,
|
|
3534
3534
|
message: s
|
|
3535
3535
|
});
|
|
3536
|
-
const
|
|
3536
|
+
const n = (v = !0) => {
|
|
3537
3537
|
i.value = v;
|
|
3538
3538
|
const u = ie.get(o);
|
|
3539
3539
|
u && (u.isDirty = v);
|
|
3540
3540
|
}, c = () => {
|
|
3541
|
-
|
|
3541
|
+
n(!1);
|
|
3542
3542
|
}, d = async (v = {}) => {
|
|
3543
3543
|
if (!i.value)
|
|
3544
3544
|
return !0;
|
|
@@ -3555,20 +3555,20 @@ function rl(e = {}) {
|
|
|
3555
3555
|
const f = (v) => {
|
|
3556
3556
|
if (i.value)
|
|
3557
3557
|
return v.preventDefault(), v.returnValue = "", "";
|
|
3558
|
-
},
|
|
3558
|
+
}, x = () => {
|
|
3559
3559
|
p || (window.addEventListener("beforeunload", f), p = !0);
|
|
3560
|
-
},
|
|
3560
|
+
}, w = () => {
|
|
3561
3561
|
p && (window.removeEventListener("beforeunload", f), p = !1);
|
|
3562
3562
|
};
|
|
3563
|
-
return
|
|
3564
|
-
ie.delete(o),
|
|
3563
|
+
return r && ns(async () => await d()), ze(() => {
|
|
3564
|
+
ie.delete(o), w();
|
|
3565
3565
|
}), {
|
|
3566
3566
|
isDirty: i,
|
|
3567
|
-
setDirty:
|
|
3567
|
+
setDirty: n,
|
|
3568
3568
|
setClean: c,
|
|
3569
3569
|
checkDirty: d,
|
|
3570
|
-
enableBrowserWarning:
|
|
3571
|
-
disableBrowserWarning:
|
|
3570
|
+
enableBrowserWarning: x,
|
|
3571
|
+
disableBrowserWarning: w
|
|
3572
3572
|
};
|
|
3573
3573
|
}
|
|
3574
3574
|
const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex flex-1 flex-col" }, ar = {
|
|
@@ -3604,29 +3604,29 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3604
3604
|
},
|
|
3605
3605
|
emits: ["overlayClose"],
|
|
3606
3606
|
setup(e, { emit: s }) {
|
|
3607
|
-
const t = e, a = s, l = Be(),
|
|
3608
|
-
const
|
|
3609
|
-
l["app-selector-bottom"] ?
|
|
3610
|
-
select: (
|
|
3607
|
+
const t = e, a = s, l = Be(), r = se(), o = (v) => v.href ? !!(v.href === r.name || v.href === r.path || r.path.startsWith(v.href + "/")) : !1, i = dt(), n = it(), c = $(() => n.getAppIcon(t.appStore.state.app)), d = $(() => r.meta.hideBrandSelector === !0 ? !1 : t.appStore.state.showBrandSelector), p = () => {
|
|
3608
|
+
const v = {};
|
|
3609
|
+
l["app-selector-bottom"] ? v.bottomSlot = () => Te("div", {}, l["app-selector-bottom"]()) : t.appSelectorSlots.bottomSlot && (v.bottomSlot = t.appSelectorSlots.bottomSlot), l["app-selector-footer"] ? v.footerSlot = () => Te("div", {}, l["app-selector-footer"]()) : t.appSelectorSlots.footerSlot && (v.footerSlot = t.appSelectorSlots.footerSlot), ae.showRight(Os, v, {
|
|
3610
|
+
select: (u) => {
|
|
3611
3611
|
ae.closeRight();
|
|
3612
3612
|
}
|
|
3613
3613
|
});
|
|
3614
|
-
},
|
|
3614
|
+
}, f = () => {
|
|
3615
3615
|
ae.showLeft(
|
|
3616
3616
|
ia,
|
|
3617
3617
|
{},
|
|
3618
3618
|
{
|
|
3619
|
-
select: (
|
|
3620
|
-
|
|
3619
|
+
select: (v) => {
|
|
3620
|
+
i.toggleBrand(v), ae.closeLeft();
|
|
3621
3621
|
}
|
|
3622
3622
|
}
|
|
3623
3623
|
);
|
|
3624
|
-
},
|
|
3625
|
-
return (
|
|
3626
|
-
const
|
|
3624
|
+
}, x = $(() => t.mainNavStore.state.hidden ? ["w-0 overflow-hidden"] : [t.mainNavStore.state.collapsed ? "w-[80px]" : "w-[240px]"]), w = $(() => t.mainNavStore.state.hidden ? ["pl-2.5"] : [t.mainNavStore.state.collapsed ? "pl-[80px]" : "pl-[240px]"]);
|
|
3625
|
+
return (v, u) => {
|
|
3626
|
+
const g = E("font-awesome-icon"), _ = E("router-view");
|
|
3627
3627
|
return h(), y(D, null, [
|
|
3628
3628
|
m("div", {
|
|
3629
|
-
class: V([
|
|
3629
|
+
class: V([x.value, "fixed inset-y-0 flex transition-all z-100"])
|
|
3630
3630
|
}, [
|
|
3631
3631
|
m("div", tr, [
|
|
3632
3632
|
m("nav", sr, [
|
|
@@ -3636,66 +3636,66 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3636
3636
|
m("li", nr, [
|
|
3637
3637
|
m("a", {
|
|
3638
3638
|
class: "grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer",
|
|
3639
|
-
onClick:
|
|
3639
|
+
onClick: u[0] || (u[0] = U((b) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"]))
|
|
3640
3640
|
}, [
|
|
3641
|
-
S(
|
|
3642
|
-
icon:
|
|
3641
|
+
S(g, {
|
|
3642
|
+
icon: C(F)[c.value],
|
|
3643
3643
|
class: "size-5"
|
|
3644
3644
|
}, null, 8, ["icon"])
|
|
3645
3645
|
]),
|
|
3646
3646
|
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("a", {
|
|
3647
3647
|
key: 0,
|
|
3648
|
-
onClick:
|
|
3648
|
+
onClick: u[1] || (u[1] = U((b) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"])),
|
|
3649
3649
|
class: "font-medium text-gray-800 ml-[10px] cursor-pointer"
|
|
3650
3650
|
}, M(e.appStore.state.app), 1))
|
|
3651
3651
|
]),
|
|
3652
|
-
(h(!0), y(D, null, B(e.mainNavStore.state.menu, (
|
|
3653
|
-
key:
|
|
3652
|
+
(h(!0), y(D, null, B(e.mainNavStore.state.menu, (b) => (h(), y("li", {
|
|
3653
|
+
key: b.name,
|
|
3654
3654
|
class: V({
|
|
3655
|
-
"mt-[10px]":
|
|
3656
|
-
"mt-auto":
|
|
3655
|
+
"mt-[10px]": b.children,
|
|
3656
|
+
"mt-auto": b.footerSection
|
|
3657
3657
|
})
|
|
3658
3658
|
}, [
|
|
3659
3659
|
m("a", {
|
|
3660
3660
|
class: V([{
|
|
3661
|
-
"bg-gray-100":
|
|
3662
|
-
"hover:bg-gray-100":
|
|
3661
|
+
"bg-gray-100": o(b),
|
|
3662
|
+
"hover:bg-gray-100": b?.href
|
|
3663
3663
|
}, "h-[37px] sgroup flex items-center gap-x-2 rounded-md p-3 text-gray-800 leading-5 transition-all duration-300 ease-in-out"]),
|
|
3664
|
-
href:
|
|
3665
|
-
onClick: U((
|
|
3664
|
+
href: b?.href,
|
|
3665
|
+
onClick: U((k) => e.mainNavStore.goto(b.href), ["prevent"])
|
|
3666
3666
|
}, [
|
|
3667
|
-
|
|
3667
|
+
b.icon ? (h(), H(g, {
|
|
3668
3668
|
key: 0,
|
|
3669
|
-
icon:
|
|
3670
|
-
class: V([[(
|
|
3669
|
+
icon: C(F)[b.icon],
|
|
3670
|
+
class: V([[(o(b), "text-gray-400")], "size-4"])
|
|
3671
3671
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
3672
|
-
e.mainNavStore.state.collapsed ?
|
|
3672
|
+
e.mainNavStore.state.collapsed ? b?.children ? (h(), y("div", ir, [...u[6] || (u[6] = [
|
|
3673
3673
|
m("div", { class: "w-[10px] h-px bg-gray-400" }, null, -1)
|
|
3674
3674
|
])])) : T("", !0) : (h(), y("span", {
|
|
3675
3675
|
key: 1,
|
|
3676
3676
|
class: V({
|
|
3677
|
-
"text-[11px]":
|
|
3678
|
-
"text-[13px]": !
|
|
3679
|
-
"font-semibold":
|
|
3680
|
-
"text-gray-500":
|
|
3677
|
+
"text-[11px]": b?.children,
|
|
3678
|
+
"text-[13px]": !b?.children,
|
|
3679
|
+
"font-semibold": b?.children,
|
|
3680
|
+
"text-gray-500": b?.children
|
|
3681
3681
|
})
|
|
3682
|
-
}, M(
|
|
3682
|
+
}, M(b.name), 3))
|
|
3683
3683
|
], 10, lr),
|
|
3684
|
-
|
|
3685
|
-
(h(!0), y(D, null, B(
|
|
3686
|
-
key:
|
|
3684
|
+
b.children ? (h(), y("ul", cr, [
|
|
3685
|
+
(h(!0), y(D, null, B(b.children, (k) => (h(), y("li", {
|
|
3686
|
+
key: k.name
|
|
3687
3687
|
}, [
|
|
3688
3688
|
m("a", {
|
|
3689
|
-
class: V([[
|
|
3690
|
-
href:
|
|
3691
|
-
onClick: U((
|
|
3689
|
+
class: V([[o(k) ? "bg-gray-100" : "", "hover:bg-gray-100"], "h-[37px] sgroup flex items-center gap-x-2 rounded-md p-3 text-gray-800 leading-5 transition-all duration-300 ease-in-out"]),
|
|
3690
|
+
href: k.href,
|
|
3691
|
+
onClick: U((P) => e.mainNavStore.goto(k.href), ["prevent"])
|
|
3692
3692
|
}, [
|
|
3693
|
-
|
|
3693
|
+
k.icon ? (h(), H(g, {
|
|
3694
3694
|
key: 0,
|
|
3695
|
-
icon:
|
|
3696
|
-
class: V([[(
|
|
3695
|
+
icon: C(F)[k.icon],
|
|
3696
|
+
class: V([[(o(k), "text-gray-400")], "size-4"])
|
|
3697
3697
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
3698
|
-
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("span", dr, M(
|
|
3698
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("span", dr, M(k.name), 1))
|
|
3699
3699
|
], 10, ur)
|
|
3700
3700
|
]))), 128))
|
|
3701
3701
|
])) : T("", !0)
|
|
@@ -3703,14 +3703,14 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3703
3703
|
])
|
|
3704
3704
|
]),
|
|
3705
3705
|
m("li", pr, [
|
|
3706
|
-
O(
|
|
3706
|
+
O(v.$slots, "sidebar-footer"),
|
|
3707
3707
|
m("a", {
|
|
3708
3708
|
class: "font-medium grid place-content-center gap-x-3 rounded-md h-10 p-2.5 text-gray-800 text-[13px] hover:bg-gray-100 transition-all duration-300 ease-in-out",
|
|
3709
3709
|
href: "#",
|
|
3710
|
-
onClick:
|
|
3710
|
+
onClick: u[2] || (u[2] = U((b) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
|
|
3711
3711
|
}, [
|
|
3712
|
-
S(
|
|
3713
|
-
icon:
|
|
3712
|
+
S(g, {
|
|
3713
|
+
icon: C(F)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
|
|
3714
3714
|
class: "class-5"
|
|
3715
3715
|
}, null, 8, ["icon"])
|
|
3716
3716
|
])
|
|
@@ -3725,39 +3725,39 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3725
3725
|
m("div", fr, [
|
|
3726
3726
|
m("div", mr, [
|
|
3727
3727
|
m("div", hr, [
|
|
3728
|
-
O(
|
|
3728
|
+
O(v.$slots, "header-left", {}, () => [
|
|
3729
3729
|
m("div", gr, [
|
|
3730
|
-
S(
|
|
3731
|
-
icon:
|
|
3730
|
+
S(g, {
|
|
3731
|
+
icon: C(F).farBarsSort,
|
|
3732
3732
|
class: "size-5",
|
|
3733
|
-
onClick:
|
|
3733
|
+
onClick: u[3] || (u[3] = (b) => e.mainNavStore.toggleHidden())
|
|
3734
3734
|
}, null, 8, ["icon"])
|
|
3735
3735
|
])
|
|
3736
3736
|
]),
|
|
3737
|
-
O(
|
|
3738
|
-
|
|
3737
|
+
O(v.$slots, "header-center", {}, () => [
|
|
3738
|
+
d.value ? (h(), y("div", {
|
|
3739
3739
|
key: 0,
|
|
3740
3740
|
class: "absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center",
|
|
3741
|
-
onClick:
|
|
3741
|
+
onClick: f
|
|
3742
3742
|
}, [
|
|
3743
|
-
|
|
3743
|
+
C(i).currentBrand ? (h(), y("img", {
|
|
3744
3744
|
key: 0,
|
|
3745
|
-
src:
|
|
3745
|
+
src: C(i).currentBrand.logo,
|
|
3746
3746
|
alt: "",
|
|
3747
3747
|
class: "h-[30px] w-auto"
|
|
3748
3748
|
}, null, 8, yr)) : T("", !0)
|
|
3749
3749
|
])) : T("", !0)
|
|
3750
3750
|
]),
|
|
3751
3751
|
m("div", vr, [
|
|
3752
|
-
O(
|
|
3752
|
+
O(v.$slots, "header-right", {}, () => [
|
|
3753
3753
|
e.appStore.state.showAppSelector ? (h(), y("button", {
|
|
3754
3754
|
key: 0,
|
|
3755
3755
|
class: "rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300",
|
|
3756
3756
|
type: "button",
|
|
3757
|
-
onClick:
|
|
3757
|
+
onClick: p
|
|
3758
3758
|
}, [
|
|
3759
|
-
S(
|
|
3760
|
-
icon:
|
|
3759
|
+
S(g, {
|
|
3760
|
+
icon: C(F).farGripDotsVertical,
|
|
3761
3761
|
class: "size-4 text-gray-400"
|
|
3762
3762
|
}, null, 8, ["icon"])
|
|
3763
3763
|
])) : T("", !0)
|
|
@@ -3767,20 +3767,20 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3767
3767
|
])
|
|
3768
3768
|
]),
|
|
3769
3769
|
m("main", br, [
|
|
3770
|
-
S(
|
|
3770
|
+
S(_)
|
|
3771
3771
|
])
|
|
3772
3772
|
], 2),
|
|
3773
|
-
S(
|
|
3773
|
+
S(C(Me), {
|
|
3774
3774
|
position: "left",
|
|
3775
|
-
"overlay-instance":
|
|
3776
|
-
onClose:
|
|
3775
|
+
"overlay-instance": C(ae).left,
|
|
3776
|
+
onClose: u[4] || (u[4] = (b) => a("overlayClose", "left"))
|
|
3777
3777
|
}, null, 8, ["overlay-instance"]),
|
|
3778
|
-
S(
|
|
3778
|
+
S(C(Me), {
|
|
3779
3779
|
position: "right",
|
|
3780
|
-
"overlay-instance":
|
|
3781
|
-
onClose:
|
|
3780
|
+
"overlay-instance": C(ae).right,
|
|
3781
|
+
onClose: u[5] || (u[5] = (b) => a("overlayClose", "right"))
|
|
3782
3782
|
}, null, 8, ["overlay-instance"]),
|
|
3783
|
-
S(
|
|
3783
|
+
S(C($a))
|
|
3784
3784
|
], 64);
|
|
3785
3785
|
};
|
|
3786
3786
|
}
|
|
@@ -3818,7 +3818,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3818
3818
|
}
|
|
3819
3819
|
},
|
|
3820
3820
|
setup(e) {
|
|
3821
|
-
const s =
|
|
3821
|
+
const s = W(), t = se(), a = ct(), l = Q(), r = e, o = R(!1), i = R(""), n = async (c) => {
|
|
3822
3822
|
o.value = !0, i.value = "";
|
|
3823
3823
|
try {
|
|
3824
3824
|
await l.login(c);
|
|
@@ -3830,7 +3830,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3830
3830
|
}
|
|
3831
3831
|
await s.push(d);
|
|
3832
3832
|
} else
|
|
3833
|
-
await s.push(
|
|
3833
|
+
await s.push(r.defaultRedirect);
|
|
3834
3834
|
} catch (d) {
|
|
3835
3835
|
i.value = d.response?.data?.message || d.message || "Login failed. Please try again.";
|
|
3836
3836
|
} finally {
|
|
@@ -3841,9 +3841,9 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3841
3841
|
const p = E("FormKit"), f = E("router-link");
|
|
3842
3842
|
return h(), y("div", _r, [
|
|
3843
3843
|
m("div", Cr, [
|
|
3844
|
-
|
|
3844
|
+
r.logo ? (h(), y("img", {
|
|
3845
3845
|
key: 0,
|
|
3846
|
-
src:
|
|
3846
|
+
src: r.logo,
|
|
3847
3847
|
alt: "Logo",
|
|
3848
3848
|
class: "h-[23px] w-auto"
|
|
3849
3849
|
}, null, 8, Sr)) : (h(), y("svg", $r, [...d[0] || (d[0] = [
|
|
@@ -3868,11 +3868,11 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3868
3868
|
m("div", Tr, [
|
|
3869
3869
|
m("div", Lr, [
|
|
3870
3870
|
d[1] || (d[1] = m("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Log in", -1)),
|
|
3871
|
-
m("p", Pr, " Welcome back" + M(
|
|
3871
|
+
m("p", Pr, " Welcome back" + M(C(a).state.app ? ` to ${C(a).state.app}` : "") + "! Please enter your details. ", 1)
|
|
3872
3872
|
]),
|
|
3873
3873
|
S(p, {
|
|
3874
3874
|
type: "form",
|
|
3875
|
-
onSubmit:
|
|
3875
|
+
onSubmit: n,
|
|
3876
3876
|
actions: !1
|
|
3877
3877
|
}, {
|
|
3878
3878
|
default: L(() => [
|
|
@@ -3883,7 +3883,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3883
3883
|
type: "email",
|
|
3884
3884
|
validation: "required|email",
|
|
3885
3885
|
"outer-class": "max-w-full",
|
|
3886
|
-
value:
|
|
3886
|
+
value: C(l).state.devCredentials.username
|
|
3887
3887
|
}, null, 8, ["value"]),
|
|
3888
3888
|
S(p, {
|
|
3889
3889
|
label: "Password",
|
|
@@ -3892,12 +3892,12 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3892
3892
|
type: "password",
|
|
3893
3893
|
validation: "required",
|
|
3894
3894
|
"outer-class": "max-w-full",
|
|
3895
|
-
value:
|
|
3895
|
+
value: C(l).state.devCredentials.password
|
|
3896
3896
|
}, null, 8, ["value"]),
|
|
3897
3897
|
m("div", Mr, [
|
|
3898
3898
|
d[3] || (d[3] = m("span", null, null, -1)),
|
|
3899
3899
|
S(f, {
|
|
3900
|
-
to:
|
|
3900
|
+
to: r.forgotPasswordRoute,
|
|
3901
3901
|
class: "text-sm text-primary-600 font-semibold"
|
|
3902
3902
|
}, {
|
|
3903
3903
|
default: L(() => [...d[2] || (d[2] = [
|
|
@@ -3907,7 +3907,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3907
3907
|
}, 8, ["to"])
|
|
3908
3908
|
]),
|
|
3909
3909
|
i.value ? (h(), y("div", Vr, M(i.value), 1)) : T("", !0),
|
|
3910
|
-
S(
|
|
3910
|
+
S(C(G), {
|
|
3911
3911
|
type: "submit",
|
|
3912
3912
|
size: "xl",
|
|
3913
3913
|
disabled: o.value,
|
|
@@ -3934,12 +3934,12 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3934
3934
|
}
|
|
3935
3935
|
},
|
|
3936
3936
|
setup(e) {
|
|
3937
|
-
const s =
|
|
3937
|
+
const s = W(), t = se(), a = Q(), l = e;
|
|
3938
3938
|
return ye(async () => {
|
|
3939
3939
|
await a.logout();
|
|
3940
|
-
const
|
|
3941
|
-
|
|
3942
|
-
}), (
|
|
3940
|
+
const r = t.query.redirect;
|
|
3941
|
+
r && r.startsWith("http") ? window.location.href = r : await s.push(r || l.defaultRedirect);
|
|
3942
|
+
}), (r, o) => null;
|
|
3943
3943
|
}
|
|
3944
3944
|
}, Er = { class: "h-full grid place-content-center relative" }, Ar = { class: "absolute top-8 left-8" }, Ir = ["src"], Or = {
|
|
3945
3945
|
key: 1,
|
|
@@ -3967,17 +3967,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3967
3967
|
}
|
|
3968
3968
|
},
|
|
3969
3969
|
setup(e) {
|
|
3970
|
-
const s = Q(), t = e, a = R(!1), l = R(""),
|
|
3971
|
-
a.value = !0, l.value = "",
|
|
3970
|
+
const s = Q(), t = e, a = R(!1), l = R(""), r = R(""), o = async ({ email: i }) => {
|
|
3971
|
+
a.value = !0, l.value = "", r.value = "";
|
|
3972
3972
|
try {
|
|
3973
|
-
await le.post(s.state.endpoints.passwordEmail, { email: i }),
|
|
3974
|
-
} catch (
|
|
3975
|
-
l.value =
|
|
3973
|
+
await le.post(s.state.endpoints.passwordEmail, { email: i }), r.value = "Password reset link sent! Check your email.";
|
|
3974
|
+
} catch (n) {
|
|
3975
|
+
l.value = n.response?.data?.message || "Failed to send reset link.";
|
|
3976
3976
|
} finally {
|
|
3977
3977
|
a.value = !1;
|
|
3978
3978
|
}
|
|
3979
3979
|
};
|
|
3980
|
-
return (i,
|
|
3980
|
+
return (i, n) => {
|
|
3981
3981
|
const c = E("FormKit"), d = E("router-link");
|
|
3982
3982
|
return h(), y("div", Er, [
|
|
3983
3983
|
m("div", Ar, [
|
|
@@ -3986,7 +3986,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3986
3986
|
src: t.logo,
|
|
3987
3987
|
alt: "Logo",
|
|
3988
3988
|
class: "h-[23px] w-auto"
|
|
3989
|
-
}, null, 8, Ir)) : (h(), y("svg", Or, [...
|
|
3989
|
+
}, null, 8, Ir)) : (h(), y("svg", Or, [...n[0] || (n[0] = [
|
|
3990
3990
|
m("path", {
|
|
3991
3991
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3992
3992
|
fill: "#1C64F2"
|
|
@@ -4006,7 +4006,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4006
4006
|
])]))
|
|
4007
4007
|
]),
|
|
4008
4008
|
m("div", Br, [
|
|
4009
|
-
|
|
4009
|
+
n[2] || (n[2] = m("div", { class: "mb-7" }, [
|
|
4010
4010
|
m("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Reset password"),
|
|
4011
4011
|
m("p", { class: "text-gray-600" }, " Enter your email and we'll send you a link to reset your password. ")
|
|
4012
4012
|
], -1)),
|
|
@@ -4025,8 +4025,8 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4025
4025
|
"outer-class": "max-w-full"
|
|
4026
4026
|
}),
|
|
4027
4027
|
l.value ? (h(), y("div", zr, M(l.value), 1)) : T("", !0),
|
|
4028
|
-
|
|
4029
|
-
S(
|
|
4028
|
+
r.value ? (h(), y("div", jr, M(r.value), 1)) : T("", !0),
|
|
4029
|
+
S(C(G), {
|
|
4030
4030
|
type: "submit",
|
|
4031
4031
|
size: "xl",
|
|
4032
4032
|
disabled: a.value,
|
|
@@ -4041,7 +4041,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4041
4041
|
to: t.loginRoute,
|
|
4042
4042
|
class: "text-sm text-center text-primary-600 font-semibold block"
|
|
4043
4043
|
}, {
|
|
4044
|
-
default: L(() => [...
|
|
4044
|
+
default: L(() => [...n[1] || (n[1] = [
|
|
4045
4045
|
A(" Back to login ", -1)
|
|
4046
4046
|
])]),
|
|
4047
4047
|
_: 1
|
|
@@ -4053,7 +4053,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4053
4053
|
]);
|
|
4054
4054
|
};
|
|
4055
4055
|
}
|
|
4056
|
-
}, Ur = { class: "h-full grid place-content-center relative" }, Kr = { class: "absolute top-8 left-8" },
|
|
4056
|
+
}, Ur = { class: "h-full grid place-content-center relative" }, Kr = { class: "absolute top-8 left-8" }, Wr = ["src"], Gr = {
|
|
4057
4057
|
key: 1,
|
|
4058
4058
|
width: "59",
|
|
4059
4059
|
height: "23",
|
|
@@ -4076,22 +4076,22 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4076
4076
|
}
|
|
4077
4077
|
},
|
|
4078
4078
|
setup(e) {
|
|
4079
|
-
const s =
|
|
4080
|
-
|
|
4079
|
+
const s = W(), t = se(), a = Q(), l = e, r = R(!1), o = R(""), i = async ({ password: n, password_confirmation: c }) => {
|
|
4080
|
+
r.value = !0, o.value = "";
|
|
4081
4081
|
try {
|
|
4082
4082
|
await le.post(a.state.endpoints.passwordReset, {
|
|
4083
4083
|
email: t.query.email,
|
|
4084
4084
|
token: t.query.token,
|
|
4085
|
-
password:
|
|
4085
|
+
password: n,
|
|
4086
4086
|
password_confirmation: c
|
|
4087
4087
|
}), await s.push(l.loginRoute);
|
|
4088
4088
|
} catch (d) {
|
|
4089
4089
|
o.value = d.response?.data?.message || "Failed to reset password.";
|
|
4090
4090
|
} finally {
|
|
4091
|
-
|
|
4091
|
+
r.value = !1;
|
|
4092
4092
|
}
|
|
4093
4093
|
};
|
|
4094
|
-
return (
|
|
4094
|
+
return (n, c) => {
|
|
4095
4095
|
const d = E("FormKit");
|
|
4096
4096
|
return h(), y("div", Ur, [
|
|
4097
4097
|
m("div", Kr, [
|
|
@@ -4100,7 +4100,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4100
4100
|
src: l.logo,
|
|
4101
4101
|
alt: "Logo",
|
|
4102
4102
|
class: "h-[23px] w-auto"
|
|
4103
|
-
}, null, 8,
|
|
4103
|
+
}, null, 8, Wr)) : (h(), y("svg", Gr, [...c[0] || (c[0] = [
|
|
4104
4104
|
m("path", {
|
|
4105
4105
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4106
4106
|
fill: "#1C64F2"
|
|
@@ -4147,14 +4147,14 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4147
4147
|
"outer-class": "max-w-full"
|
|
4148
4148
|
}),
|
|
4149
4149
|
o.value ? (h(), y("div", Xr, M(o.value), 1)) : T("", !0),
|
|
4150
|
-
S(
|
|
4150
|
+
S(C(G), {
|
|
4151
4151
|
type: "submit",
|
|
4152
4152
|
size: "xl",
|
|
4153
|
-
disabled:
|
|
4153
|
+
disabled: r.value,
|
|
4154
4154
|
"button-class": "w-full mb-2"
|
|
4155
4155
|
}, {
|
|
4156
4156
|
default: L(() => [
|
|
4157
|
-
|
|
4157
|
+
r.value ? (h(), y("span", Qr, "Resetting...")) : (h(), y("span", Jr, "Reset password"))
|
|
4158
4158
|
]),
|
|
4159
4159
|
_: 1
|
|
4160
4160
|
}, 8, ["disabled"])
|
|
@@ -4185,17 +4185,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4185
4185
|
}
|
|
4186
4186
|
},
|
|
4187
4187
|
setup(e) {
|
|
4188
|
-
const s =
|
|
4188
|
+
const s = W(), t = e, a = () => {
|
|
4189
4189
|
s.push(t.homeRoute);
|
|
4190
4190
|
};
|
|
4191
|
-
return (l,
|
|
4191
|
+
return (l, r) => (h(), y("div", tn, [
|
|
4192
4192
|
m("div", sn, [
|
|
4193
4193
|
t.logo ? (h(), y("img", {
|
|
4194
4194
|
key: 0,
|
|
4195
4195
|
src: t.logo,
|
|
4196
4196
|
alt: "Logo",
|
|
4197
4197
|
class: "h-[23px] w-auto"
|
|
4198
|
-
}, null, 8, an)) : (h(), y("svg", on, [...
|
|
4198
|
+
}, null, 8, an)) : (h(), y("svg", on, [...r[0] || (r[0] = [
|
|
4199
4199
|
m("path", {
|
|
4200
4200
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4201
4201
|
fill: "#1C64F2"
|
|
@@ -4215,7 +4215,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4215
4215
|
])]))
|
|
4216
4216
|
]),
|
|
4217
4217
|
m("div", rn, [
|
|
4218
|
-
|
|
4218
|
+
r[2] || (r[2] = m("div", null, [
|
|
4219
4219
|
m("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "403"),
|
|
4220
4220
|
m("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Access Forbidden "),
|
|
4221
4221
|
m("p", { class: "text-gray-600" }, [
|
|
@@ -4225,11 +4225,11 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4225
4225
|
])
|
|
4226
4226
|
], -1)),
|
|
4227
4227
|
m("div", nn, [
|
|
4228
|
-
S(
|
|
4228
|
+
S(C(G), {
|
|
4229
4229
|
onClick: a,
|
|
4230
4230
|
size: "lg"
|
|
4231
4231
|
}, {
|
|
4232
|
-
default: L(() => [...
|
|
4232
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4233
4233
|
A(" Go to Home ", -1)
|
|
4234
4234
|
])]),
|
|
4235
4235
|
_: 1
|
|
@@ -4258,17 +4258,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4258
4258
|
}
|
|
4259
4259
|
},
|
|
4260
4260
|
setup(e) {
|
|
4261
|
-
const s =
|
|
4261
|
+
const s = W(), t = e, a = () => {
|
|
4262
4262
|
s.push(t.homeRoute);
|
|
4263
4263
|
};
|
|
4264
|
-
return (l,
|
|
4264
|
+
return (l, r) => (h(), y("div", cn, [
|
|
4265
4265
|
m("div", un, [
|
|
4266
4266
|
t.logo ? (h(), y("img", {
|
|
4267
4267
|
key: 0,
|
|
4268
4268
|
src: t.logo,
|
|
4269
4269
|
alt: "Logo",
|
|
4270
4270
|
class: "h-[23px] w-auto"
|
|
4271
|
-
}, null, 8, dn)) : (h(), y("svg", pn, [...
|
|
4271
|
+
}, null, 8, dn)) : (h(), y("svg", pn, [...r[0] || (r[0] = [
|
|
4272
4272
|
m("path", {
|
|
4273
4273
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4274
4274
|
fill: "#1C64F2"
|
|
@@ -4288,17 +4288,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4288
4288
|
])]))
|
|
4289
4289
|
]),
|
|
4290
4290
|
m("div", fn, [
|
|
4291
|
-
|
|
4291
|
+
r[2] || (r[2] = m("div", null, [
|
|
4292
4292
|
m("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "404"),
|
|
4293
4293
|
m("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Page Not Found "),
|
|
4294
4294
|
m("p", { class: "text-gray-600" }, " The page you're looking for doesn't exist or has been moved. ")
|
|
4295
4295
|
], -1)),
|
|
4296
4296
|
m("div", mn, [
|
|
4297
|
-
S(
|
|
4297
|
+
S(C(G), {
|
|
4298
4298
|
onClick: a,
|
|
4299
4299
|
size: "lg"
|
|
4300
4300
|
}, {
|
|
4301
|
-
default: L(() => [...
|
|
4301
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4302
4302
|
A(" Go to Home ", -1)
|
|
4303
4303
|
])]),
|
|
4304
4304
|
_: 1
|
|
@@ -4339,17 +4339,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4339
4339
|
}
|
|
4340
4340
|
},
|
|
4341
4341
|
setup(e) {
|
|
4342
|
-
const s =
|
|
4342
|
+
const s = W(), t = e, a = () => {
|
|
4343
4343
|
s.push(t.homeRoute);
|
|
4344
4344
|
};
|
|
4345
|
-
return (l,
|
|
4345
|
+
return (l, r) => (h(), y("div", gn, [
|
|
4346
4346
|
m("div", yn, [
|
|
4347
4347
|
t.logo ? (h(), y("img", {
|
|
4348
4348
|
key: 0,
|
|
4349
4349
|
src: t.logo,
|
|
4350
4350
|
alt: "Logo",
|
|
4351
4351
|
class: "h-[23px] w-auto"
|
|
4352
|
-
}, null, 8, vn)) : (h(), y("svg", bn, [...
|
|
4352
|
+
}, null, 8, vn)) : (h(), y("svg", bn, [...r[0] || (r[0] = [
|
|
4353
4353
|
m("path", {
|
|
4354
4354
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4355
4355
|
fill: "#1C64F2"
|
|
@@ -4375,11 +4375,11 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4375
4375
|
m("p", _n, M(t.message || "An unexpected error occurred. Please try again later."), 1)
|
|
4376
4376
|
]),
|
|
4377
4377
|
m("div", Cn, [
|
|
4378
|
-
S(
|
|
4378
|
+
S(C(G), {
|
|
4379
4379
|
onClick: a,
|
|
4380
4380
|
size: "lg"
|
|
4381
4381
|
}, {
|
|
4382
|
-
default: L(() => [...
|
|
4382
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4383
4383
|
A(" Go to Home ", -1)
|
|
4384
4384
|
])]),
|
|
4385
4385
|
_: 1
|
|
@@ -4395,7 +4395,7 @@ function cl(e = {}) {
|
|
|
4395
4395
|
logoutPath: t = "/logout",
|
|
4396
4396
|
forgotPasswordPath: a = "/forgot-password",
|
|
4397
4397
|
resetPasswordPath: l = "/password/reset",
|
|
4398
|
-
logo:
|
|
4398
|
+
logo: r = "",
|
|
4399
4399
|
defaultRedirect: o = "/dashboard"
|
|
4400
4400
|
} = e;
|
|
4401
4401
|
return [
|
|
@@ -4403,7 +4403,7 @@ function cl(e = {}) {
|
|
|
4403
4403
|
path: s,
|
|
4404
4404
|
name: "login",
|
|
4405
4405
|
component: Fr,
|
|
4406
|
-
props: { logo:
|
|
4406
|
+
props: { logo: r, defaultRedirect: o },
|
|
4407
4407
|
meta: { auth: !1 }
|
|
4408
4408
|
},
|
|
4409
4409
|
{
|
|
@@ -4417,32 +4417,32 @@ function cl(e = {}) {
|
|
|
4417
4417
|
path: a,
|
|
4418
4418
|
name: "forgot-password",
|
|
4419
4419
|
component: qr,
|
|
4420
|
-
props: { logo:
|
|
4420
|
+
props: { logo: r, loginRoute: s },
|
|
4421
4421
|
meta: { auth: !1 }
|
|
4422
4422
|
},
|
|
4423
4423
|
{
|
|
4424
4424
|
path: l,
|
|
4425
4425
|
name: "password-reset",
|
|
4426
4426
|
component: en,
|
|
4427
|
-
props: { logo:
|
|
4427
|
+
props: { logo: r, loginRoute: s },
|
|
4428
4428
|
meta: { auth: !1 }
|
|
4429
4429
|
}
|
|
4430
4430
|
];
|
|
4431
4431
|
}
|
|
4432
4432
|
function ul(e, s = {}) {
|
|
4433
4433
|
const { defaultAuthenticatedRoute: t = "/dashboard" } = s;
|
|
4434
|
-
e.beforeEach(async (a, l,
|
|
4434
|
+
e.beforeEach(async (a, l, r) => {
|
|
4435
4435
|
const o = Q();
|
|
4436
|
-
o.state.ready || await o.fetchUser(), Sn(a,
|
|
4436
|
+
o.state.ready || await o.fetchUser(), Sn(a, r, o, t);
|
|
4437
4437
|
});
|
|
4438
4438
|
}
|
|
4439
4439
|
function Sn(e, s, t, a) {
|
|
4440
|
-
const l = e.meta.auth !== !1,
|
|
4440
|
+
const l = e.meta.auth !== !1, r = t.check;
|
|
4441
4441
|
if (t.state.overrideToken && e.path === "/logout") {
|
|
4442
4442
|
s({ path: a });
|
|
4443
4443
|
return;
|
|
4444
4444
|
}
|
|
4445
|
-
if (!
|
|
4445
|
+
if (!r) {
|
|
4446
4446
|
if (!l) {
|
|
4447
4447
|
if (e.path === "/logout") {
|
|
4448
4448
|
s({ path: t.state.routes.auth });
|
|
@@ -4462,7 +4462,7 @@ function Sn(e, s, t, a) {
|
|
|
4462
4462
|
});
|
|
4463
4463
|
return;
|
|
4464
4464
|
}
|
|
4465
|
-
if (
|
|
4465
|
+
if (r) {
|
|
4466
4466
|
if (!l && e.path === t.state.routes.auth) {
|
|
4467
4467
|
s({ path: a });
|
|
4468
4468
|
return;
|
|
@@ -4514,11 +4514,11 @@ function ml(e, s = {}) {
|
|
|
4514
4514
|
title: t = "Unsaved Changes",
|
|
4515
4515
|
message: a = "You have unsaved changes. Leave anyway?",
|
|
4516
4516
|
confirmText: l = "Leave",
|
|
4517
|
-
cancelText:
|
|
4517
|
+
cancelText: r = "Stay"
|
|
4518
4518
|
} = s;
|
|
4519
|
-
e.beforeEach(async (o, i,
|
|
4519
|
+
e.beforeEach(async (o, i, n) => {
|
|
4520
4520
|
if (!Jo()) {
|
|
4521
|
-
|
|
4521
|
+
n();
|
|
4522
4522
|
return;
|
|
4523
4523
|
}
|
|
4524
4524
|
const c = Qo() || a;
|
|
@@ -4526,9 +4526,9 @@ function ml(e, s = {}) {
|
|
|
4526
4526
|
title: t,
|
|
4527
4527
|
message: c,
|
|
4528
4528
|
confirmText: l,
|
|
4529
|
-
cancelText:
|
|
4529
|
+
cancelText: r,
|
|
4530
4530
|
type: "warning"
|
|
4531
|
-
}) ? (er(),
|
|
4531
|
+
}) ? (er(), n()) : n(!1);
|
|
4532
4532
|
});
|
|
4533
4533
|
}
|
|
4534
4534
|
const hl = pe("sparkNav", () => {
|
|
@@ -4536,8 +4536,8 @@ const hl = pe("sparkNav", () => {
|
|
|
4536
4536
|
menu: [],
|
|
4537
4537
|
collapsed: !1,
|
|
4538
4538
|
hidden: !1
|
|
4539
|
-
}), s =
|
|
4540
|
-
e.menu = c,
|
|
4539
|
+
}), s = W(), t = se(), a = (c = []) => {
|
|
4540
|
+
e.menu = c, n();
|
|
4541
4541
|
}, l = (c, d) => {
|
|
4542
4542
|
for (const p of c) {
|
|
4543
4543
|
if (p.href === d) return p;
|
|
@@ -4547,7 +4547,7 @@ const hl = pe("sparkNav", () => {
|
|
|
4547
4547
|
}
|
|
4548
4548
|
}
|
|
4549
4549
|
return null;
|
|
4550
|
-
},
|
|
4550
|
+
}, r = async (c) => {
|
|
4551
4551
|
if (c) {
|
|
4552
4552
|
const d = l(e.menu, c);
|
|
4553
4553
|
if (d && typeof d.action == "function") {
|
|
@@ -4560,7 +4560,7 @@ const hl = pe("sparkNav", () => {
|
|
|
4560
4560
|
e.collapsed = !e.collapsed;
|
|
4561
4561
|
}, i = () => {
|
|
4562
4562
|
e.hidden = !e.hidden;
|
|
4563
|
-
},
|
|
4563
|
+
}, n = () => {
|
|
4564
4564
|
const c = t.name || t.path.replace("/", "");
|
|
4565
4565
|
if (c) {
|
|
4566
4566
|
const d = (p) => {
|
|
@@ -4574,16 +4574,16 @@ const hl = pe("sparkNav", () => {
|
|
|
4574
4574
|
return j(
|
|
4575
4575
|
() => t.path,
|
|
4576
4576
|
() => {
|
|
4577
|
-
|
|
4577
|
+
n();
|
|
4578
4578
|
},
|
|
4579
4579
|
{ immediate: !0 }
|
|
4580
4580
|
), {
|
|
4581
4581
|
state: e,
|
|
4582
4582
|
initialize: a,
|
|
4583
|
-
goto:
|
|
4583
|
+
goto: r,
|
|
4584
4584
|
toggleCollapsed: o,
|
|
4585
4585
|
toggleHidden: i,
|
|
4586
|
-
syncWithRoute:
|
|
4586
|
+
syncWithRoute: n
|
|
4587
4587
|
};
|
|
4588
4588
|
});
|
|
4589
4589
|
export {
|
|
@@ -4591,7 +4591,7 @@ export {
|
|
|
4591
4591
|
re as SparkAlert,
|
|
4592
4592
|
Os as SparkAppSelector,
|
|
4593
4593
|
ia as SparkBrandSelector,
|
|
4594
|
-
|
|
4594
|
+
G as SparkButton,
|
|
4595
4595
|
pt as SparkButtonGroup,
|
|
4596
4596
|
Xn as SparkCard,
|
|
4597
4597
|
nl as SparkDefaultContainer,
|
|
@@ -4604,7 +4604,7 @@ export {
|
|
|
4604
4604
|
Dr as SparkLogoutView,
|
|
4605
4605
|
$a as SparkModalContainer,
|
|
4606
4606
|
wa as SparkModalDialog,
|
|
4607
|
-
|
|
4607
|
+
Gn as SparkNotificationOutlet,
|
|
4608
4608
|
Me as SparkOverlay,
|
|
4609
4609
|
ll as SparkPublicContainer,
|
|
4610
4610
|
en as SparkResetPasswordView,
|
|
@@ -4632,7 +4632,7 @@ export {
|
|
|
4632
4632
|
Un as formKitIconLoader,
|
|
4633
4633
|
Zn as formKitIcons,
|
|
4634
4634
|
Ya as formatTemporal,
|
|
4635
|
-
|
|
4635
|
+
Wo as getAxiosInstance,
|
|
4636
4636
|
jo as getCookie,
|
|
4637
4637
|
Qo as getDirtyFormMessage,
|
|
4638
4638
|
ft as getDomain,
|
|
@@ -4640,14 +4640,14 @@ export {
|
|
|
4640
4640
|
Jo as hasAnyDirtyForm,
|
|
4641
4641
|
Yo as isValidationError,
|
|
4642
4642
|
Xa as parseDatetime,
|
|
4643
|
-
|
|
4643
|
+
Go as parseLaravelErrors,
|
|
4644
4644
|
Pa as renderHeaderTitle,
|
|
4645
4645
|
No as setCookie,
|
|
4646
4646
|
ul as setupAuthGuards,
|
|
4647
4647
|
sl as setupAxios,
|
|
4648
4648
|
fl as setupBootstrapGuard,
|
|
4649
4649
|
ml as setupDirtyFormGuard,
|
|
4650
|
-
|
|
4650
|
+
Wn as setupFontAwesome,
|
|
4651
4651
|
J as sparkModalService,
|
|
4652
4652
|
z as sparkNotificationService,
|
|
4653
4653
|
ae as sparkOverlayService,
|