@wishbone-media/spark 0.30.0 → 0.31.0
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 +1031 -1030
- package/package.json +1 -1
- package/src/containers/SparkDefaultContainer.vue +18 -4
- package/src/plugins/fontawesome.js +2 -0
package/dist/index.js
CHANGED
|
@@ -1,93 +1,94 @@
|
|
|
1
|
-
import { computed as $, resolveComponent as
|
|
1
|
+
import { computed as $, resolveComponent as A, 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 E, 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
|
|
5
|
-
import { faSortUp 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, faCloudArrowUp as Ct, faCloudDownload as St, faBolt as $t, faUndo as Tt, faEye as Lt, faSignOut as Pt, faXmark as _e, faTrash as Qe, faTimes as Mt, faStreetView as Vt, faSortUp as Ht, faSortDown as Rt, faSort as Ft, faScaleBalanced as Dt, faSatelliteDish as At, faLayerPlus as Et, faLaptopMobile as It, faInfoCircle as Ot, faGripDotsVertical as et, faGearComplex as Bt, faFlag as zt, faFaceSmileWink as jt, faFaceSmileRelaxed as Nt, faExclamationTriangle as Zt, faEllipsisVertical as qt, faEllipsis as Ut, faEdit as Kt, faComments as Wt, faCircleXmark as Gt, faCircleUser as Yt, faChevronUp as Xt, faChevronRight as tt, faChevronLeft as st, faChevronDown as at, faCheckCircle as Jt, faCheck as Ce, faBullhorn as Qt, faBellRing as es, faBarsSort as ts, faArrowRightToLine as ss, faArrowLeftToLine as as } from "@fortawesome/pro-regular-svg-icons";
|
|
5
|
+
import { faSortUp as os, faSortDown as rs, faSort as ns } 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 ls } 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
|
-
import { range as
|
|
11
|
-
import { HotTable as
|
|
10
|
+
import { range as is, get as ee, find as cs, has as us } from "lodash";
|
|
11
|
+
import { HotTable as ds } from "@handsontable/vue3";
|
|
12
12
|
import "handsontable/styles/handsontable.css";
|
|
13
13
|
import "handsontable/styles/ht-theme-classic.css";
|
|
14
|
-
import { registerPlugin as me, AutoColumnSize as
|
|
15
|
-
import { registerAllCellTypes as
|
|
14
|
+
import { registerPlugin as me, AutoColumnSize as ps, CopyPaste as fs, StretchColumns as ms, NestedHeaders as hs } from "handsontable/plugins";
|
|
15
|
+
import { registerAllCellTypes as gs } from "handsontable/cellTypes";
|
|
16
16
|
import { useDebounceFn as lt, watchDebounced as Le } from "@vueuse/core";
|
|
17
|
-
import { registerRenderer as
|
|
17
|
+
import { registerRenderer as ys, baseRenderer as vs } from "handsontable/renderers";
|
|
18
18
|
import le from "axios";
|
|
19
19
|
const F = {
|
|
20
|
-
farArrowLeftToLine:
|
|
21
|
-
farArrowRightToLine:
|
|
22
|
-
farBarsSort:
|
|
23
|
-
farBellRing:
|
|
24
|
-
farBullhorn:
|
|
20
|
+
farArrowLeftToLine: as,
|
|
21
|
+
farArrowRightToLine: ss,
|
|
22
|
+
farBarsSort: ts,
|
|
23
|
+
farBellRing: es,
|
|
24
|
+
farBullhorn: Qt,
|
|
25
25
|
farCheck: Ce,
|
|
26
|
-
farCheckCircle:
|
|
26
|
+
farCheckCircle: Jt,
|
|
27
27
|
farChevronDown: at,
|
|
28
28
|
farChevronLeft: st,
|
|
29
29
|
farChevronRight: tt,
|
|
30
|
-
farChevronUp:
|
|
31
|
-
farCircleUser:
|
|
30
|
+
farChevronUp: Xt,
|
|
31
|
+
farCircleUser: Yt,
|
|
32
32
|
farCircleXmark: Gt,
|
|
33
|
-
farComments:
|
|
34
|
-
farEdit:
|
|
35
|
-
farEllipsis:
|
|
36
|
-
farEllipsisVertical:
|
|
37
|
-
farExclamationTriangle:
|
|
38
|
-
farFaceSmileRelaxed:
|
|
39
|
-
farFaceSmileWink:
|
|
40
|
-
farFlag:
|
|
41
|
-
farGearComplex:
|
|
33
|
+
farComments: Wt,
|
|
34
|
+
farEdit: Kt,
|
|
35
|
+
farEllipsis: Ut,
|
|
36
|
+
farEllipsisVertical: qt,
|
|
37
|
+
farExclamationTriangle: Zt,
|
|
38
|
+
farFaceSmileRelaxed: Nt,
|
|
39
|
+
farFaceSmileWink: jt,
|
|
40
|
+
farFlag: zt,
|
|
41
|
+
farGearComplex: Bt,
|
|
42
42
|
farGripDotsVertical: et,
|
|
43
|
-
farInfoCircle:
|
|
44
|
-
farLaptopMobile:
|
|
43
|
+
farInfoCircle: Ot,
|
|
44
|
+
farLaptopMobile: It,
|
|
45
45
|
farLayerPlus: Et,
|
|
46
|
-
farSatelliteDish:
|
|
47
|
-
farScaleBalanced:
|
|
48
|
-
farSort:
|
|
49
|
-
farSortDown:
|
|
50
|
-
farSortUp:
|
|
51
|
-
farStreetView:
|
|
52
|
-
farTimes:
|
|
46
|
+
farSatelliteDish: At,
|
|
47
|
+
farScaleBalanced: Dt,
|
|
48
|
+
farSort: Ft,
|
|
49
|
+
farSortDown: Rt,
|
|
50
|
+
farSortUp: Ht,
|
|
51
|
+
farStreetView: Vt,
|
|
52
|
+
farTimes: Mt,
|
|
53
53
|
farTrash: Qe,
|
|
54
54
|
farXmark: _e,
|
|
55
|
-
farSignOut:
|
|
56
|
-
farEye:
|
|
57
|
-
farUndo:
|
|
58
|
-
farBolt:
|
|
59
|
-
farCloudDownload:
|
|
55
|
+
farSignOut: Pt,
|
|
56
|
+
farEye: Lt,
|
|
57
|
+
farUndo: Tt,
|
|
58
|
+
farBolt: $t,
|
|
59
|
+
farCloudDownload: St,
|
|
60
|
+
farCloudArrowUp: Ct,
|
|
60
61
|
farInbox: _t,
|
|
61
62
|
farCircleCheck: wt,
|
|
62
|
-
fadSort:
|
|
63
|
-
fadSortDown:
|
|
64
|
-
fadSortUp:
|
|
63
|
+
fadSort: ns,
|
|
64
|
+
fadSortDown: rs,
|
|
65
|
+
fadSortUp: os,
|
|
65
66
|
// Additional icons for FormKit genesis replacement
|
|
66
67
|
farPlus: Je,
|
|
67
68
|
farArrowDown: Xe,
|
|
68
69
|
farArrowUp: Ye,
|
|
69
|
-
farCalendar:
|
|
70
|
+
farCalendar: Ge,
|
|
70
71
|
farFile: we,
|
|
71
72
|
farCircle: kt,
|
|
72
|
-
farSpinner:
|
|
73
|
+
farSpinner: We,
|
|
73
74
|
farStar: Ke,
|
|
74
75
|
farAnglesRight: Ue,
|
|
75
76
|
farAnglesLeft: qe,
|
|
76
77
|
farEyeDropper: Ze,
|
|
77
78
|
farCircleDot: Ne
|
|
78
|
-
},
|
|
79
|
+
}, qn = Object.fromEntries(
|
|
79
80
|
Object.entries(F).map(([e, s]) => {
|
|
80
81
|
const t = te(s);
|
|
81
82
|
return [e, t?.html?.[0] || ""];
|
|
82
83
|
})
|
|
83
|
-
),
|
|
84
|
+
), bs = {
|
|
84
85
|
add: Je,
|
|
85
86
|
arrowDown: Xe,
|
|
86
87
|
arrowUp: Ye,
|
|
87
88
|
check: Ce,
|
|
88
89
|
close: _e,
|
|
89
90
|
checkboxDecorator: Ce,
|
|
90
|
-
date:
|
|
91
|
+
date: Ge,
|
|
91
92
|
dragHandle: et,
|
|
92
93
|
fileItem: we,
|
|
93
94
|
fileRemove: _e,
|
|
@@ -95,7 +96,7 @@ const F = {
|
|
|
95
96
|
radioDecorator: Ne,
|
|
96
97
|
// Circle with dot for radio indicator
|
|
97
98
|
select: at,
|
|
98
|
-
spinner:
|
|
99
|
+
spinner: We,
|
|
99
100
|
star: Ke,
|
|
100
101
|
trash: Qe,
|
|
101
102
|
fastForward: Ue,
|
|
@@ -103,13 +104,13 @@ const F = {
|
|
|
103
104
|
left: st,
|
|
104
105
|
rewind: qe,
|
|
105
106
|
color: Ze
|
|
106
|
-
},
|
|
107
|
-
Object.entries(
|
|
107
|
+
}, Un = Object.fromEntries(
|
|
108
|
+
Object.entries(bs).map(([e, s]) => {
|
|
108
109
|
const t = te(s);
|
|
109
110
|
return [e, t?.html?.[0] || ""];
|
|
110
111
|
})
|
|
111
112
|
);
|
|
112
|
-
function
|
|
113
|
+
function Kn(e) {
|
|
113
114
|
const s = F[e];
|
|
114
115
|
if (s) {
|
|
115
116
|
const t = te(s);
|
|
@@ -117,16 +118,16 @@ function Un(e) {
|
|
|
117
118
|
}
|
|
118
119
|
return Promise.resolve(void 0);
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function Wn(e) {
|
|
121
122
|
Object.assign(F, e), je.add(...Object.values(e));
|
|
122
123
|
}
|
|
123
124
|
function Gn(e) {
|
|
124
125
|
je.add(...Object.values(F)), e.component("FontAwesomeIcon", he);
|
|
125
126
|
}
|
|
126
|
-
const
|
|
127
|
+
const xs = { class: "flex items-center" }, ks = { class: "shrink-0 self-start" }, ws = { class: "ml-3" }, _s = {
|
|
127
128
|
key: 0,
|
|
128
129
|
class: "ml-auto pl-3 pt-1 self-start"
|
|
129
|
-
},
|
|
130
|
+
}, Cs = { class: "-mx-1.5 -my-1.5" }, re = {
|
|
130
131
|
__name: "SparkAlert",
|
|
131
132
|
props: {
|
|
132
133
|
type: {
|
|
@@ -156,36 +157,36 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
156
157
|
warning: "farExclamationTriangle",
|
|
157
158
|
danger: "farCircleXmark",
|
|
158
159
|
info: "farInfoCircle"
|
|
159
|
-
})[s.type]),
|
|
160
|
+
})[s.type]), r = $(() => ({
|
|
160
161
|
success: "text-green-400 hover:bg-green-100",
|
|
161
162
|
warning: "text-yellow-400 hover:bg-yellow-100",
|
|
162
163
|
danger: "text-red-400 hover:bg-red-100",
|
|
163
164
|
info: "text-blue-400 hover:bg-blue-100"
|
|
164
165
|
})[s.type]);
|
|
165
166
|
return (o, i) => {
|
|
166
|
-
const
|
|
167
|
+
const n = A("font-awesome-icon");
|
|
167
168
|
return h(), y("div", {
|
|
168
169
|
class: V(["rounded-md border p-4", t.value])
|
|
169
170
|
}, [
|
|
170
|
-
m("div",
|
|
171
|
-
m("div",
|
|
172
|
-
S(
|
|
173
|
-
icon:
|
|
171
|
+
m("div", xs, [
|
|
172
|
+
m("div", ks, [
|
|
173
|
+
S(n, {
|
|
174
|
+
icon: C(F)[l.value],
|
|
174
175
|
class: V(a.value)
|
|
175
176
|
}, null, 8, ["icon", "class"])
|
|
176
177
|
]),
|
|
177
|
-
m("div",
|
|
178
|
+
m("div", ws, [
|
|
178
179
|
O(o.$slots, "default")
|
|
179
180
|
]),
|
|
180
|
-
e.closeable ? (h(), y("div",
|
|
181
|
-
m("div",
|
|
181
|
+
e.closeable ? (h(), y("div", _s, [
|
|
182
|
+
m("div", Cs, [
|
|
182
183
|
m("button", {
|
|
183
184
|
type: "button",
|
|
184
|
-
class: V(["inline-flex rounded-md px-2 py-1.5",
|
|
185
|
+
class: V(["inline-flex rounded-md px-2 py-1.5", r.value]),
|
|
185
186
|
onClick: i[0] || (i[0] = (c) => o.$emit("close"))
|
|
186
187
|
}, [
|
|
187
|
-
S(
|
|
188
|
-
icon:
|
|
188
|
+
S(n, {
|
|
189
|
+
icon: C(F).farXmark
|
|
189
190
|
}, null, 8, ["icon"])
|
|
190
191
|
], 2)
|
|
191
192
|
])
|
|
@@ -246,11 +247,11 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
246
247
|
], it = pe("sparkAppSelector", () => {
|
|
247
248
|
const e = K({
|
|
248
249
|
apps: [...be]
|
|
249
|
-
}), s = (
|
|
250
|
-
if (
|
|
251
|
-
const o =
|
|
252
|
-
const
|
|
253
|
-
return
|
|
250
|
+
}), s = (r = {}) => {
|
|
251
|
+
if (r.apps && Array.isArray(r.apps)) {
|
|
252
|
+
const o = r.apps.filter((i) => {
|
|
253
|
+
const n = i.name && i.description && i.icon && i.href;
|
|
254
|
+
return n || console.warn("useSparkAppSelectorStore: Invalid app object", i), n;
|
|
254
255
|
});
|
|
255
256
|
e.apps = o.map((i) => ({
|
|
256
257
|
name: i.name,
|
|
@@ -260,23 +261,23 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
260
261
|
}));
|
|
261
262
|
return;
|
|
262
263
|
}
|
|
263
|
-
if (
|
|
264
|
+
if (r.appHrefs && typeof r.appHrefs == "object") {
|
|
264
265
|
const o = /* @__PURE__ */ new Map();
|
|
265
|
-
Object.keys(
|
|
266
|
-
o.set(i.toLowerCase(),
|
|
266
|
+
Object.keys(r.appHrefs).forEach((i) => {
|
|
267
|
+
o.set(i.toLowerCase(), r.appHrefs[i]);
|
|
267
268
|
}), e.apps = be.map((i) => {
|
|
268
|
-
const
|
|
269
|
+
const n = o.get(i.name.toLowerCase());
|
|
269
270
|
return {
|
|
270
271
|
...i,
|
|
271
|
-
href:
|
|
272
|
+
href: n || i.href
|
|
272
273
|
};
|
|
273
274
|
});
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
277
|
e.apps = [...be];
|
|
277
|
-
}, t = $(() => e.apps), a = (
|
|
278
|
-
if (!
|
|
279
|
-
const o =
|
|
278
|
+
}, t = $(() => e.apps), a = (r) => {
|
|
279
|
+
if (!r) return null;
|
|
280
|
+
const o = r.toLowerCase();
|
|
280
281
|
return e.apps.find((i) => i.name.toLowerCase() === o) || null;
|
|
281
282
|
};
|
|
282
283
|
return {
|
|
@@ -284,8 +285,8 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
284
285
|
initialize: s,
|
|
285
286
|
allApps: t,
|
|
286
287
|
getAppByName: a,
|
|
287
|
-
getAppIcon: (
|
|
288
|
-
const o = a(
|
|
288
|
+
getAppIcon: (r) => {
|
|
289
|
+
const o = a(r);
|
|
289
290
|
return o ? o.icon : "";
|
|
290
291
|
}
|
|
291
292
|
};
|
|
@@ -302,16 +303,16 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
302
303
|
e.app = t.app || "", e.homeRoute = t.homeRoute ?? "dashboard", e.showBrandSelector = t.showBrandSelector ?? !0, e.showAppSelector = t.showAppSelector ?? !0;
|
|
303
304
|
}
|
|
304
305
|
};
|
|
305
|
-
}),
|
|
306
|
+
}), Ss = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, $s = { class: "flex flex-1 flex-col" }, Ts = { class: "divide-y divide-gray-200" }, Ls = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, Ps = { class: "ml-auto flex items-center" }, Ms = ["href", "onClick"], Vs = { class: "gap-y-1" }, Hs = { class: "text-base text-gray-800 flex items-center" }, Rs = { class: "font-medium" }, Fs = {
|
|
306
307
|
key: 0,
|
|
307
308
|
class: "inline-flex items-center rounded-full bg-green-100 px-1.5 py-0.5 text-xs font-medium text-green-700 ml-1"
|
|
308
|
-
},
|
|
309
|
+
}, Ds = { class: "text-sm text-gray-500" }, As = { class: "ml-auto flex items-center" }, Es = { class: "mt-auto" }, Is = {
|
|
309
310
|
key: 0,
|
|
310
311
|
class: "p-6"
|
|
311
|
-
},
|
|
312
|
+
}, Os = {
|
|
312
313
|
key: 1,
|
|
313
314
|
class: "bg-gray-50 p-6"
|
|
314
|
-
},
|
|
315
|
+
}, Bs = {
|
|
315
316
|
__name: "SparkAppSelector",
|
|
316
317
|
props: {
|
|
317
318
|
bottomSlot: {
|
|
@@ -325,60 +326,60 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
325
326
|
},
|
|
326
327
|
emits: ["close", "select"],
|
|
327
328
|
setup(e, { emit: s }) {
|
|
328
|
-
const t = s, a = it(), l = ct(),
|
|
329
|
+
const t = s, a = it(), l = ct(), r = $(() => {
|
|
329
330
|
const i = l.state.app;
|
|
330
|
-
return a.state.apps.map((
|
|
331
|
-
...
|
|
332
|
-
current: i &&
|
|
331
|
+
return a.state.apps.map((n) => ({
|
|
332
|
+
...n,
|
|
333
|
+
current: i && n.name.toLowerCase() === i.toLowerCase()
|
|
333
334
|
}));
|
|
334
|
-
}), o = (i,
|
|
335
|
+
}), o = (i, n) => {
|
|
335
336
|
t("select", i);
|
|
336
337
|
};
|
|
337
|
-
return (i,
|
|
338
|
-
const c =
|
|
339
|
-
return h(), y("div",
|
|
340
|
-
m("div",
|
|
341
|
-
m("div",
|
|
342
|
-
m("div",
|
|
343
|
-
|
|
344
|
-
m("div",
|
|
338
|
+
return (i, n) => {
|
|
339
|
+
const c = A("font-awesome-icon");
|
|
340
|
+
return h(), y("div", Ss, [
|
|
341
|
+
m("div", $s, [
|
|
342
|
+
m("div", Ts, [
|
|
343
|
+
m("div", Ls, [
|
|
344
|
+
n[1] || (n[1] = m("div", null, "Mr Group Network", -1)),
|
|
345
|
+
m("div", Ps, [
|
|
345
346
|
S(c, {
|
|
346
|
-
icon:
|
|
347
|
+
icon: C(F).farTimes,
|
|
347
348
|
class: "h-[15px] w-[15px] shrink-0 text-gray-400 cursor-pointer",
|
|
348
|
-
onClick:
|
|
349
|
+
onClick: n[0] || (n[0] = (d) => t("close"))
|
|
349
350
|
}, null, 8, ["icon"])
|
|
350
351
|
])
|
|
351
352
|
]),
|
|
352
|
-
(h(!0), y(D, null, B(
|
|
353
|
+
(h(!0), y(D, null, B(r.value, (d) => (h(), y("a", {
|
|
353
354
|
key: d.name,
|
|
354
355
|
href: d.href,
|
|
355
356
|
target: "_blank",
|
|
356
357
|
class: V([d.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
|
|
357
358
|
onClick: (p) => d.current ? p.preventDefault() : o(d)
|
|
358
359
|
}, [
|
|
359
|
-
m("div",
|
|
360
|
-
m("div",
|
|
361
|
-
m("div",
|
|
362
|
-
d.current ? (h(), y("span",
|
|
360
|
+
m("div", Vs, [
|
|
361
|
+
m("div", Hs, [
|
|
362
|
+
m("div", Rs, M(d.name), 1),
|
|
363
|
+
d.current ? (h(), y("span", Fs, " Active ")) : T("", !0)
|
|
363
364
|
]),
|
|
364
|
-
m("div",
|
|
365
|
+
m("div", Ds, M(d.description), 1)
|
|
365
366
|
]),
|
|
366
|
-
m("div",
|
|
367
|
+
m("div", As, [
|
|
367
368
|
S(c, {
|
|
368
369
|
class: V([d.current ? "text-gray-700" : "text-gray-400", "h-5 w-5 shrink-0"]),
|
|
369
|
-
icon:
|
|
370
|
+
icon: C(F)[d.icon]
|
|
370
371
|
}, null, 8, ["class", "icon"])
|
|
371
372
|
])
|
|
372
|
-
], 10,
|
|
373
|
-
|
|
373
|
+
], 10, Ms))), 128)),
|
|
374
|
+
n[2] || (n[2] = m("div", null, null, -1))
|
|
374
375
|
]),
|
|
375
376
|
m("div", Es, [
|
|
376
|
-
i.$slots.bottom || e.bottomSlot ? (h(), y("div",
|
|
377
|
+
i.$slots.bottom || e.bottomSlot ? (h(), y("div", Is, [
|
|
377
378
|
O(i.$slots, "bottom", {}, () => [
|
|
378
379
|
e.bottomSlot ? (h(), H(Z(e.bottomSlot), { key: 0 })) : T("", !0)
|
|
379
380
|
])
|
|
380
381
|
])) : T("", !0),
|
|
381
|
-
i.$slots.footer || e.footerSlot ? (h(), y("div",
|
|
382
|
+
i.$slots.footer || e.footerSlot ? (h(), y("div", Os, [
|
|
382
383
|
O(i.$slots, "footer", {}, () => [
|
|
383
384
|
e.footerSlot ? (h(), H(Z(e.footerSlot), { key: 0 })) : T("", !0)
|
|
384
385
|
])
|
|
@@ -395,7 +396,7 @@ const bs = { class: "flex items-center" }, xs = { class: "shrink-0 self-start" }
|
|
|
395
396
|
danger: 0
|
|
396
397
|
// sticky by default
|
|
397
398
|
}, Pe = ["top-left", "top-right", "center", "bottom-left", "bottom-right"];
|
|
398
|
-
function
|
|
399
|
+
function zs() {
|
|
399
400
|
const e = K({
|
|
400
401
|
isVisible: !1,
|
|
401
402
|
type: "info",
|
|
@@ -408,10 +409,10 @@ function Bs() {
|
|
|
408
409
|
shownOnPath: null
|
|
409
410
|
});
|
|
410
411
|
let s = null, t = 0, a = !1, l = null;
|
|
411
|
-
const
|
|
412
|
+
const r = () => {
|
|
412
413
|
s && (clearTimeout(s), s = null), t = 0, a = !1, l = null;
|
|
413
414
|
}, o = () => {
|
|
414
|
-
|
|
415
|
+
r(), e.isVisible = !1;
|
|
415
416
|
}, i = (f) => {
|
|
416
417
|
f <= 0 || (t = f, l = Date.now(), s = setTimeout(() => {
|
|
417
418
|
o();
|
|
@@ -420,19 +421,19 @@ function Bs() {
|
|
|
420
421
|
return {
|
|
421
422
|
state: e,
|
|
422
423
|
show: (f = {}) => {
|
|
423
|
-
|
|
424
|
+
r();
|
|
424
425
|
const {
|
|
425
|
-
type:
|
|
426
|
-
message:
|
|
426
|
+
type: x = "info",
|
|
427
|
+
message: w = null,
|
|
427
428
|
component: v = null,
|
|
428
429
|
props: u = {},
|
|
429
430
|
closeable: g = !0,
|
|
430
|
-
duration:
|
|
431
|
+
duration: _ = null,
|
|
431
432
|
persistent: b = !1
|
|
432
433
|
} = f;
|
|
433
|
-
e.type =
|
|
434
|
-
const
|
|
435
|
-
e.duration =
|
|
434
|
+
e.type = x, e.message = w, e.component = v ? ce(v) : null, e.props = u, e.closeable = g, e.persistent = b, e.isVisible = !0;
|
|
435
|
+
const k = _ !== null ? _ : ut[x];
|
|
436
|
+
e.duration = k, k > 0 && i(k);
|
|
436
437
|
},
|
|
437
438
|
hide: o,
|
|
438
439
|
reset: () => {
|
|
@@ -451,7 +452,7 @@ function Bs() {
|
|
|
451
452
|
}
|
|
452
453
|
};
|
|
453
454
|
}
|
|
454
|
-
class
|
|
455
|
+
class js {
|
|
455
456
|
constructor() {
|
|
456
457
|
this.outlets = /* @__PURE__ */ new Map(), this.toastState = K({
|
|
457
458
|
toasts: [],
|
|
@@ -469,7 +470,7 @@ class zs {
|
|
|
469
470
|
* @returns {Object} Notification outlet instance
|
|
470
471
|
*/
|
|
471
472
|
getOutlet(s = "default") {
|
|
472
|
-
return this.outlets.has(s) || this.outlets.set(s,
|
|
473
|
+
return this.outlets.has(s) || this.outlets.set(s, zs()), this.outlets.get(s);
|
|
473
474
|
}
|
|
474
475
|
/**
|
|
475
476
|
* Show a banner notification in the specified outlet
|
|
@@ -568,28 +569,28 @@ class zs {
|
|
|
568
569
|
type: t = "info",
|
|
569
570
|
message: a = null,
|
|
570
571
|
component: l = null,
|
|
571
|
-
props:
|
|
572
|
+
props: r = {},
|
|
572
573
|
closeable: o = !0,
|
|
573
574
|
duration: i = null,
|
|
574
|
-
position:
|
|
575
|
-
} = s, c = ++this._toastIdCounter, d =
|
|
575
|
+
position: n = null
|
|
576
|
+
} = s, c = ++this._toastIdCounter, d = n && Pe.includes(n) ? n : this.toastState.defaultPosition, p = i !== null ? i : ut[t], f = {
|
|
576
577
|
id: c,
|
|
577
578
|
type: t,
|
|
578
579
|
message: a,
|
|
579
580
|
component: l ? ce(l) : null,
|
|
580
|
-
props:
|
|
581
|
+
props: r,
|
|
581
582
|
closeable: o,
|
|
582
583
|
duration: p,
|
|
583
584
|
position: d,
|
|
584
585
|
createdAt: Date.now()
|
|
585
|
-
},
|
|
586
|
-
if (
|
|
587
|
-
const
|
|
588
|
-
this.hideToast(
|
|
586
|
+
}, x = this.toastState.toasts.filter((w) => w.position === d);
|
|
587
|
+
if (x.length >= this.toastState.maxToasts) {
|
|
588
|
+
const w = this.toastState.newestOnTop ? x[x.length - 1] : x[0];
|
|
589
|
+
this.hideToast(w.id);
|
|
589
590
|
}
|
|
590
591
|
if (this.toastState.newestOnTop) {
|
|
591
|
-
const
|
|
592
|
-
|
|
592
|
+
const w = this.toastState.toasts.findIndex((v) => v.position === d);
|
|
593
|
+
w === -1 ? this.toastState.toasts.push(f) : this.toastState.toasts.splice(w, 0, f);
|
|
593
594
|
} else
|
|
594
595
|
this.toastState.toasts.push(f);
|
|
595
596
|
return p > 0 && this._startToastTimer(c, p), c;
|
|
@@ -665,7 +666,7 @@ class zs {
|
|
|
665
666
|
t && (t.timeout && clearTimeout(t.timeout), this._toastTimers.delete(s));
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
|
-
const z = new
|
|
669
|
+
const z = new js(), Yn = {
|
|
669
670
|
__name: "SparkNotificationOutlet",
|
|
670
671
|
props: {
|
|
671
672
|
name: {
|
|
@@ -686,8 +687,8 @@ const z = new zs(), Wn = {
|
|
|
686
687
|
}
|
|
687
688
|
), j(
|
|
688
689
|
() => a.value.state.isVisible,
|
|
689
|
-
(
|
|
690
|
-
|
|
690
|
+
(n) => {
|
|
691
|
+
n && !a.value.state.shownOnPath && (a.value.state.shownOnPath = t.path);
|
|
691
692
|
},
|
|
692
693
|
{ immediate: !0 }
|
|
693
694
|
), ye(() => {
|
|
@@ -698,14 +699,14 @@ const z = new zs(), Wn = {
|
|
|
698
699
|
s.clearOnRouteChange && (t.meta.preserveNotifications || a.value.state.isVisible && (a.value.state.persistent || a.value.hide()));
|
|
699
700
|
}
|
|
700
701
|
);
|
|
701
|
-
const
|
|
702
|
+
const r = () => {
|
|
702
703
|
z.hide(s.name);
|
|
703
704
|
}, o = () => {
|
|
704
705
|
z.pause(s.name);
|
|
705
706
|
}, i = () => {
|
|
706
707
|
z.resume(s.name);
|
|
707
708
|
};
|
|
708
|
-
return (
|
|
709
|
+
return (n, c) => (h(), H(ht, {
|
|
709
710
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
710
711
|
"enter-from-class": "opacity-0 -translate-y-2",
|
|
711
712
|
"enter-to-class": "opacity-100 translate-y-0",
|
|
@@ -719,13 +720,13 @@ const z = new zs(), Wn = {
|
|
|
719
720
|
key: l.value,
|
|
720
721
|
type: a.value.state.type,
|
|
721
722
|
closeable: a.value.state.closeable,
|
|
722
|
-
onClose:
|
|
723
|
+
onClose: r,
|
|
723
724
|
onMouseenter: o,
|
|
724
725
|
onMouseleave: i
|
|
725
726
|
}, {
|
|
726
727
|
default: L(() => [
|
|
727
728
|
a.value.state.component ? (h(), H(Z(a.value.state.component), gt(q({ key: 0 }, a.value.state.props)), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
728
|
-
|
|
729
|
+
E(M(a.value.state.message), 1)
|
|
729
730
|
], 64))
|
|
730
731
|
]),
|
|
731
732
|
_: 1
|
|
@@ -734,7 +735,7 @@ const z = new zs(), Wn = {
|
|
|
734
735
|
_: 1
|
|
735
736
|
}));
|
|
736
737
|
}
|
|
737
|
-
},
|
|
738
|
+
}, Ns = { class: "fixed top-4 left-4 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, Zs = { class: "fixed top-4 right-4 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, qs = { class: "fixed top-[40%] left-1/2 -translate-x-1/2 -translate-y-1/2 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, Us = { class: "fixed bottom-4 left-4 z-[2000] flex flex-col-reverse gap-3 max-w-sm w-full pointer-events-none" }, Ks = { class: "fixed bottom-4 right-4 z-[2000] flex flex-col-reverse gap-3 max-w-sm w-full pointer-events-none" }, Xn = {
|
|
738
739
|
__name: "SparkToastContainer",
|
|
739
740
|
setup(e) {
|
|
740
741
|
const s = z.toastState, t = $(
|
|
@@ -743,19 +744,19 @@ const z = new zs(), Wn = {
|
|
|
743
744
|
() => s.toasts.filter((d) => d.position === "top-right")
|
|
744
745
|
), l = $(
|
|
745
746
|
() => s.toasts.filter((d) => d.position === "center")
|
|
746
|
-
),
|
|
747
|
+
), r = $(
|
|
747
748
|
() => s.toasts.filter((d) => d.position === "bottom-left")
|
|
748
749
|
), o = $(
|
|
749
750
|
() => s.toasts.filter((d) => d.position === "bottom-right")
|
|
750
751
|
), i = (d) => {
|
|
751
752
|
z.hideToast(d);
|
|
752
|
-
},
|
|
753
|
+
}, n = (d) => {
|
|
753
754
|
z.pauseToast(d);
|
|
754
755
|
}, c = (d) => {
|
|
755
756
|
z.resumeToast(d);
|
|
756
757
|
};
|
|
757
758
|
return (d, p) => (h(), H(yt, { to: "body" }, [
|
|
758
|
-
m("div",
|
|
759
|
+
m("div", Ns, [
|
|
759
760
|
S(ue, {
|
|
760
761
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
761
762
|
"enter-from-class": "opacity-0 -translate-x-4",
|
|
@@ -772,16 +773,16 @@ const z = new zs(), Wn = {
|
|
|
772
773
|
S(re, {
|
|
773
774
|
type: f.type,
|
|
774
775
|
closeable: f.closeable,
|
|
775
|
-
onClose: (
|
|
776
|
-
onMouseenter: (
|
|
777
|
-
onMouseleave: (
|
|
776
|
+
onClose: (x) => i(f.id),
|
|
777
|
+
onMouseenter: (x) => n(f.id),
|
|
778
|
+
onMouseleave: (x) => c(f.id)
|
|
778
779
|
}, {
|
|
779
780
|
default: L(() => [
|
|
780
781
|
f.component ? (h(), H(Z(f.component), q({
|
|
781
782
|
key: 0,
|
|
782
783
|
ref_for: !0
|
|
783
784
|
}, f.props), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
784
|
-
|
|
785
|
+
E(M(f.message), 1)
|
|
785
786
|
], 64))
|
|
786
787
|
]),
|
|
787
788
|
_: 2
|
|
@@ -791,7 +792,7 @@ const z = new zs(), Wn = {
|
|
|
791
792
|
_: 1
|
|
792
793
|
})
|
|
793
794
|
]),
|
|
794
|
-
m("div",
|
|
795
|
+
m("div", Zs, [
|
|
795
796
|
S(ue, {
|
|
796
797
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
797
798
|
"enter-from-class": "opacity-0 translate-x-4",
|
|
@@ -808,16 +809,16 @@ const z = new zs(), Wn = {
|
|
|
808
809
|
S(re, {
|
|
809
810
|
type: f.type,
|
|
810
811
|
closeable: f.closeable,
|
|
811
|
-
onClose: (
|
|
812
|
-
onMouseenter: (
|
|
813
|
-
onMouseleave: (
|
|
812
|
+
onClose: (x) => i(f.id),
|
|
813
|
+
onMouseenter: (x) => n(f.id),
|
|
814
|
+
onMouseleave: (x) => c(f.id)
|
|
814
815
|
}, {
|
|
815
816
|
default: L(() => [
|
|
816
817
|
f.component ? (h(), H(Z(f.component), q({
|
|
817
818
|
key: 0,
|
|
818
819
|
ref_for: !0
|
|
819
820
|
}, f.props), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
820
|
-
|
|
821
|
+
E(M(f.message), 1)
|
|
821
822
|
], 64))
|
|
822
823
|
]),
|
|
823
824
|
_: 2
|
|
@@ -827,7 +828,7 @@ const z = new zs(), Wn = {
|
|
|
827
828
|
_: 1
|
|
828
829
|
})
|
|
829
830
|
]),
|
|
830
|
-
m("div",
|
|
831
|
+
m("div", qs, [
|
|
831
832
|
S(ue, {
|
|
832
833
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
833
834
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -844,16 +845,16 @@ const z = new zs(), Wn = {
|
|
|
844
845
|
S(re, {
|
|
845
846
|
type: f.type,
|
|
846
847
|
closeable: f.closeable,
|
|
847
|
-
onClose: (
|
|
848
|
-
onMouseenter: (
|
|
849
|
-
onMouseleave: (
|
|
848
|
+
onClose: (x) => i(f.id),
|
|
849
|
+
onMouseenter: (x) => n(f.id),
|
|
850
|
+
onMouseleave: (x) => c(f.id)
|
|
850
851
|
}, {
|
|
851
852
|
default: L(() => [
|
|
852
853
|
f.component ? (h(), H(Z(f.component), q({
|
|
853
854
|
key: 0,
|
|
854
855
|
ref_for: !0
|
|
855
856
|
}, f.props), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
856
|
-
|
|
857
|
+
E(M(f.message), 1)
|
|
857
858
|
], 64))
|
|
858
859
|
]),
|
|
859
860
|
_: 2
|
|
@@ -863,7 +864,7 @@ const z = new zs(), Wn = {
|
|
|
863
864
|
_: 1
|
|
864
865
|
})
|
|
865
866
|
]),
|
|
866
|
-
m("div",
|
|
867
|
+
m("div", Us, [
|
|
867
868
|
S(ue, {
|
|
868
869
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
869
870
|
"enter-from-class": "opacity-0 -translate-x-4",
|
|
@@ -873,23 +874,23 @@ const z = new zs(), Wn = {
|
|
|
873
874
|
"leave-to-class": "opacity-0 -translate-x-4"
|
|
874
875
|
}, {
|
|
875
876
|
default: L(() => [
|
|
876
|
-
(h(!0), y(D, null, B(
|
|
877
|
+
(h(!0), y(D, null, B(r.value, (f) => (h(), y("div", {
|
|
877
878
|
key: f.id,
|
|
878
879
|
class: "pointer-events-auto"
|
|
879
880
|
}, [
|
|
880
881
|
S(re, {
|
|
881
882
|
type: f.type,
|
|
882
883
|
closeable: f.closeable,
|
|
883
|
-
onClose: (
|
|
884
|
-
onMouseenter: (
|
|
885
|
-
onMouseleave: (
|
|
884
|
+
onClose: (x) => i(f.id),
|
|
885
|
+
onMouseenter: (x) => n(f.id),
|
|
886
|
+
onMouseleave: (x) => c(f.id)
|
|
886
887
|
}, {
|
|
887
888
|
default: L(() => [
|
|
888
889
|
f.component ? (h(), H(Z(f.component), q({
|
|
889
890
|
key: 0,
|
|
890
891
|
ref_for: !0
|
|
891
892
|
}, f.props), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
892
|
-
|
|
893
|
+
E(M(f.message), 1)
|
|
893
894
|
], 64))
|
|
894
895
|
]),
|
|
895
896
|
_: 2
|
|
@@ -899,7 +900,7 @@ const z = new zs(), Wn = {
|
|
|
899
900
|
_: 1
|
|
900
901
|
})
|
|
901
902
|
]),
|
|
902
|
-
m("div",
|
|
903
|
+
m("div", Ks, [
|
|
903
904
|
S(ue, {
|
|
904
905
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
905
906
|
"enter-from-class": "opacity-0 translate-x-4",
|
|
@@ -916,16 +917,16 @@ const z = new zs(), Wn = {
|
|
|
916
917
|
S(re, {
|
|
917
918
|
type: f.type,
|
|
918
919
|
closeable: f.closeable,
|
|
919
|
-
onClose: (
|
|
920
|
-
onMouseenter: (
|
|
921
|
-
onMouseleave: (
|
|
920
|
+
onClose: (x) => i(f.id),
|
|
921
|
+
onMouseenter: (x) => n(f.id),
|
|
922
|
+
onMouseleave: (x) => c(f.id)
|
|
922
923
|
}, {
|
|
923
924
|
default: L(() => [
|
|
924
925
|
f.component ? (h(), H(Z(f.component), q({
|
|
925
926
|
key: 0,
|
|
926
927
|
ref_for: !0
|
|
927
928
|
}, f.props), null, 16)) : (h(), y(D, { key: 1 }, [
|
|
928
|
-
|
|
929
|
+
E(M(f.message), 1)
|
|
929
930
|
], 64))
|
|
930
931
|
]),
|
|
931
932
|
_: 2
|
|
@@ -942,36 +943,36 @@ const z = new zs(), Wn = {
|
|
|
942
943
|
() => {
|
|
943
944
|
const e = K({
|
|
944
945
|
brands: []
|
|
945
|
-
}), s = (
|
|
946
|
-
if (!
|
|
946
|
+
}), s = (r = {}) => {
|
|
947
|
+
if (!r.brands || !Array.isArray(r.brands)) {
|
|
947
948
|
console.warn("useSparkBrandFilterStore: No brands provided to initialize()"), e.brands = [];
|
|
948
949
|
return;
|
|
949
950
|
}
|
|
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:
|
|
951
|
+
const o = r.brands.filter((n) => {
|
|
952
|
+
const c = n.name && n.logo;
|
|
953
|
+
return c || console.warn("useSparkBrandFilterStore: Invalid brand object", n), c;
|
|
954
|
+
}), i = o.filter((n) => n.current);
|
|
955
|
+
i.length === 0 && o.length > 0 ? o[0].current = !0 : i.length > 1 && o.forEach((n) => {
|
|
956
|
+
n.current = n === i[0];
|
|
957
|
+
}), e.brands = o.map((n) => ({
|
|
958
|
+
id: n.id,
|
|
959
|
+
name: n.name,
|
|
960
|
+
logo: n.logo,
|
|
961
|
+
current: n.current || !1
|
|
961
962
|
}));
|
|
962
|
-
}, t = $(() => e.brands.find((
|
|
963
|
+
}, t = $(() => e.brands.find((r) => r.current) || null), a = $(() => e.brands);
|
|
963
964
|
return {
|
|
964
965
|
state: e,
|
|
965
966
|
initialize: s,
|
|
966
967
|
currentBrand: t,
|
|
967
968
|
allBrands: a,
|
|
968
|
-
toggleBrand: (
|
|
969
|
-
if (!
|
|
969
|
+
toggleBrand: (r) => {
|
|
970
|
+
if (!r || !e.brands.includes(r)) {
|
|
970
971
|
console.warn("useSparkBrandFilterStore: Invalid brand provided to toggleBrand()");
|
|
971
972
|
return;
|
|
972
973
|
}
|
|
973
974
|
e.brands.forEach((o) => {
|
|
974
|
-
o.current = o ===
|
|
975
|
+
o.current = o === r;
|
|
975
976
|
});
|
|
976
977
|
}
|
|
977
978
|
};
|
|
@@ -981,57 +982,57 @@ const z = new zs(), Wn = {
|
|
|
981
982
|
paths: ["state.brands"]
|
|
982
983
|
}
|
|
983
984
|
}
|
|
984
|
-
),
|
|
985
|
+
), Ws = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, Gs = { class: "flex flex-1 flex-col" }, Ys = { class: "divide-y divide-gray-200" }, Xs = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, Js = { class: "ml-auto flex items-center" }, Qs = {
|
|
985
986
|
key: 0,
|
|
986
987
|
class: "flex px-[22px] py-[15px] text-gray-500 text-sm"
|
|
987
|
-
},
|
|
988
|
+
}, ea = ["onClick"], ta = { class: "w-full gap-y-1 flex justify-between" }, sa = { class: "flex flex-col" }, aa = { class: "flex items-center" }, oa = { class: "font-medium text-base text-gray-900" }, ra = {
|
|
988
989
|
key: 0,
|
|
989
990
|
class: "inline-flex items-center rounded-full bg-green-100 px-1.5 py-0.5 text-xs font-medium text-green-800 ml-1"
|
|
990
|
-
},
|
|
991
|
+
}, na = { class: "text-sm text-gray-500 font-normal" }, la = { class: "flex items-center" }, ia = ["src", "alt"], ca = {
|
|
991
992
|
__name: "SparkBrandSelector",
|
|
992
993
|
emits: ["close", "select"],
|
|
993
994
|
setup(e, { emit: s }) {
|
|
994
|
-
const t = s, a = dt(), l = (
|
|
995
|
-
t("select",
|
|
995
|
+
const t = s, a = dt(), l = (r) => {
|
|
996
|
+
t("select", r);
|
|
996
997
|
};
|
|
997
|
-
return (
|
|
998
|
-
const i =
|
|
999
|
-
return h(), y("div",
|
|
998
|
+
return (r, o) => {
|
|
999
|
+
const i = A("font-awesome-icon");
|
|
1000
|
+
return h(), y("div", Ws, [
|
|
1000
1001
|
m("div", Gs, [
|
|
1001
|
-
m("div",
|
|
1002
|
-
m("div",
|
|
1002
|
+
m("div", Ys, [
|
|
1003
|
+
m("div", Xs, [
|
|
1003
1004
|
o[1] || (o[1] = m("div", null, "Filter by Brand", -1)),
|
|
1004
|
-
m("div",
|
|
1005
|
+
m("div", Js, [
|
|
1005
1006
|
S(i, {
|
|
1006
|
-
icon:
|
|
1007
|
+
icon: C(F).farTimes,
|
|
1007
1008
|
class: "size-4 text-gray-400 cursor-pointer",
|
|
1008
|
-
onClick: o[0] || (o[0] = (
|
|
1009
|
+
onClick: o[0] || (o[0] = (n) => t("close"))
|
|
1009
1010
|
}, null, 8, ["icon"])
|
|
1010
1011
|
])
|
|
1011
1012
|
]),
|
|
1012
|
-
|
|
1013
|
-
(h(!0), y(D, null, B(
|
|
1014
|
-
key:
|
|
1015
|
-
class: V([
|
|
1016
|
-
onClick: (c) => l(
|
|
1013
|
+
C(a).allBrands.length === 0 ? (h(), y("div", Qs, " No brands configured ")) : T("", !0),
|
|
1014
|
+
(h(!0), y(D, null, B(C(a).allBrands, (n) => (h(), y("div", {
|
|
1015
|
+
key: n.id,
|
|
1016
|
+
class: V([n.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
|
|
1017
|
+
onClick: (c) => l(n)
|
|
1017
1018
|
}, [
|
|
1018
|
-
m("div",
|
|
1019
|
-
m("div",
|
|
1020
|
-
m("div",
|
|
1021
|
-
m("div",
|
|
1022
|
-
|
|
1019
|
+
m("div", ta, [
|
|
1020
|
+
m("div", sa, [
|
|
1021
|
+
m("div", aa, [
|
|
1022
|
+
m("div", oa, M(n.name), 1),
|
|
1023
|
+
n.current ? (h(), y("span", ra, " Current ")) : T("", !0)
|
|
1023
1024
|
]),
|
|
1024
|
-
m("div",
|
|
1025
|
+
m("div", na, M(n.current ? "Current Brand" : "Change to"), 1)
|
|
1025
1026
|
]),
|
|
1026
|
-
m("div",
|
|
1027
|
+
m("div", la, [
|
|
1027
1028
|
m("img", {
|
|
1028
|
-
src:
|
|
1029
|
-
alt: `${
|
|
1029
|
+
src: n.logo,
|
|
1030
|
+
alt: `${n.name} logo`,
|
|
1030
1031
|
class: "h-8 w-auto"
|
|
1031
|
-
}, null, 8,
|
|
1032
|
+
}, null, 8, ia)
|
|
1032
1033
|
])
|
|
1033
1034
|
])
|
|
1034
|
-
], 10,
|
|
1035
|
+
], 10, ea))), 128)),
|
|
1035
1036
|
o[2] || (o[2] = m("div", null, null, -1))
|
|
1036
1037
|
]),
|
|
1037
1038
|
o[3] || (o[3] = m("div", { class: "mt-auto" }, null, -1))
|
|
@@ -1039,7 +1040,7 @@ const z = new zs(), Wn = {
|
|
|
1039
1040
|
]);
|
|
1040
1041
|
};
|
|
1041
1042
|
}
|
|
1042
|
-
},
|
|
1043
|
+
}, ua = ["disabled"], G = {
|
|
1043
1044
|
__name: "SparkButton",
|
|
1044
1045
|
props: {
|
|
1045
1046
|
size: {
|
|
@@ -1064,14 +1065,14 @@ const z = new zs(), Wn = {
|
|
|
1064
1065
|
setup(e) {
|
|
1065
1066
|
const s = e, t = R(null), a = $e("buttonGroup", null), l = $(() => {
|
|
1066
1067
|
if (!a?.isInGroup || !t.value) return null;
|
|
1067
|
-
const
|
|
1068
|
+
const n = a.getButtonIndex(t.value), c = a.getButtonCount();
|
|
1068
1069
|
return {
|
|
1069
|
-
isFirst:
|
|
1070
|
-
isLast:
|
|
1071
|
-
index:
|
|
1070
|
+
isFirst: n === 0,
|
|
1071
|
+
isLast: n === c - 1,
|
|
1072
|
+
index: n,
|
|
1072
1073
|
total: c
|
|
1073
1074
|
};
|
|
1074
|
-
}),
|
|
1075
|
+
}), r = {
|
|
1075
1076
|
paddingX: /^px-/,
|
|
1076
1077
|
paddingY: /^py-/,
|
|
1077
1078
|
paddingAll: /^p-/,
|
|
@@ -1081,75 +1082,75 @@ const z = new zs(), Wn = {
|
|
|
1081
1082
|
borderRadius: /^rounded-/,
|
|
1082
1083
|
background: /^bg-/,
|
|
1083
1084
|
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,
|
|
1085
|
+
}, o = (n, c) => {
|
|
1086
|
+
if (!c) return n;
|
|
1087
|
+
const d = n.split(" ").filter(Boolean), p = c.split(" ").filter(Boolean);
|
|
1088
|
+
return [...d.filter((x) => !p.some((w) => {
|
|
1089
|
+
const v = Object.entries(r).find(
|
|
1090
|
+
([g, _]) => _.test(x)
|
|
1091
|
+
)?.[0], u = Object.entries(r).find(
|
|
1092
|
+
([g, _]) => _.test(w)
|
|
1092
1093
|
)?.[0];
|
|
1093
1094
|
return v && v === u;
|
|
1094
1095
|
})), ...p].join(" ");
|
|
1095
1096
|
}, i = $(() => {
|
|
1096
|
-
let
|
|
1097
|
+
let n = "", c = "";
|
|
1097
1098
|
switch (s.size) {
|
|
1098
1099
|
case "xs":
|
|
1099
|
-
|
|
1100
|
+
n += " px-4 py-1 text-xs", c = "sm";
|
|
1100
1101
|
break;
|
|
1101
1102
|
case "sm":
|
|
1102
|
-
|
|
1103
|
+
n += " px-4 py-1 text-sm", c = "sm";
|
|
1103
1104
|
break;
|
|
1104
1105
|
case "md":
|
|
1105
|
-
|
|
1106
|
+
n += " px-5 py-1.5 text-sm", c = "md";
|
|
1106
1107
|
break;
|
|
1107
1108
|
case "lg":
|
|
1108
|
-
|
|
1109
|
+
n += " px-6 py-2 text-sm", c = "md";
|
|
1109
1110
|
break;
|
|
1110
1111
|
case "xl":
|
|
1111
|
-
|
|
1112
|
+
n += " px-7 py-2.5 min-h-[42px] text-sm", c = "md";
|
|
1112
1113
|
break;
|
|
1113
1114
|
}
|
|
1114
1115
|
if (a?.isInGroup && l.value) {
|
|
1115
1116
|
const { isFirst: d, isLast: p } = l.value;
|
|
1116
|
-
|
|
1117
|
+
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
1118
|
} else
|
|
1118
|
-
|
|
1119
|
+
n += ` shadow-xs rounded-${c}`;
|
|
1119
1120
|
switch (s.variant) {
|
|
1120
1121
|
case "primary":
|
|
1121
|
-
|
|
1122
|
+
n += " bg-primary-600 hover:bg-primary-500 text-white";
|
|
1122
1123
|
break;
|
|
1123
1124
|
case "secondary":
|
|
1124
|
-
|
|
1125
|
+
n += " ring-1 ring-gray-300 ring-inset bg-white hover:bg-gray-50 text-gray-900";
|
|
1125
1126
|
break;
|
|
1126
1127
|
case "success":
|
|
1127
|
-
|
|
1128
|
+
n += " bg-green-600 hover:bg-green-500 text-white";
|
|
1128
1129
|
break;
|
|
1129
1130
|
case "warning":
|
|
1130
|
-
|
|
1131
|
+
n += " bg-amber-600 hover:bg-amber-500 text-white";
|
|
1131
1132
|
break;
|
|
1132
1133
|
case "danger":
|
|
1133
|
-
|
|
1134
|
+
n += " bg-red-600 hover:bg-red-500 text-white";
|
|
1134
1135
|
break;
|
|
1135
1136
|
case "info":
|
|
1136
|
-
|
|
1137
|
+
n += " bg-cyan-600 hover:bg-cyan-500 text-white";
|
|
1137
1138
|
break;
|
|
1138
1139
|
default:
|
|
1139
|
-
|
|
1140
|
+
n += ` bg-${s.variant}-600 hover:bg-${s.variant}-500 text-white`;
|
|
1140
1141
|
}
|
|
1141
|
-
return
|
|
1142
|
+
return n = o(n, s.buttonClass), n;
|
|
1142
1143
|
});
|
|
1143
|
-
return (
|
|
1144
|
+
return (n, c) => (h(), y("button", {
|
|
1144
1145
|
type: "button",
|
|
1145
1146
|
ref_key: "buttonRef",
|
|
1146
1147
|
ref: t,
|
|
1147
1148
|
class: V(i.value),
|
|
1148
1149
|
disabled: e.disabled,
|
|
1149
|
-
onClick: c[0] || (c[0] = (d) =>
|
|
1150
|
+
onClick: c[0] || (c[0] = (d) => n.$emit("click"))
|
|
1150
1151
|
}, [
|
|
1151
|
-
O(
|
|
1152
|
-
], 10,
|
|
1152
|
+
O(n.$slots, "default")
|
|
1153
|
+
], 10, ua));
|
|
1153
1154
|
}
|
|
1154
1155
|
}, pt = {
|
|
1155
1156
|
__name: "SparkButtonGroup",
|
|
@@ -1159,7 +1160,7 @@ const z = new zs(), Wn = {
|
|
|
1159
1160
|
isInGroup: !0,
|
|
1160
1161
|
getButtonIndex: (l) => s.value ? Array.from(s.value.children).indexOf(l) : -1,
|
|
1161
1162
|
getButtonCount: () => s.value?.children.length || 0
|
|
1162
|
-
}), (l,
|
|
1163
|
+
}), (l, r) => (h(), y("div", {
|
|
1163
1164
|
class: "inline-flex rounded-md shadow-xs",
|
|
1164
1165
|
ref_key: "groupRef",
|
|
1165
1166
|
ref: s
|
|
@@ -1167,13 +1168,13 @@ const z = new zs(), Wn = {
|
|
|
1167
1168
|
O(l.$slots, "default")
|
|
1168
1169
|
], 512));
|
|
1169
1170
|
}
|
|
1170
|
-
},
|
|
1171
|
+
}, da = { class: "divide-y divide-gray-300 rounded-lg border border-gray-300 text-gray-700 bg-gray-100" }, pa = {
|
|
1171
1172
|
key: 0,
|
|
1172
1173
|
class: "px-[30px] py-5"
|
|
1173
|
-
},
|
|
1174
|
+
}, fa = {
|
|
1174
1175
|
key: 1,
|
|
1175
1176
|
class: "p-5"
|
|
1176
|
-
},
|
|
1177
|
+
}, Jn = {
|
|
1177
1178
|
__name: "SparkCard",
|
|
1178
1179
|
props: {
|
|
1179
1180
|
padded: {
|
|
@@ -1187,8 +1188,8 @@ const z = new zs(), Wn = {
|
|
|
1187
1188
|
},
|
|
1188
1189
|
setup(e) {
|
|
1189
1190
|
const s = e;
|
|
1190
|
-
return (t, a) => (h(), y("div",
|
|
1191
|
-
t.$slots.header ? (h(), y("div",
|
|
1191
|
+
return (t, a) => (h(), y("div", da, [
|
|
1192
|
+
t.$slots.header ? (h(), y("div", pa, [
|
|
1192
1193
|
O(t.$slots, "header")
|
|
1193
1194
|
])) : T("", !0),
|
|
1194
1195
|
m("div", {
|
|
@@ -1196,24 +1197,24 @@ const z = new zs(), Wn = {
|
|
|
1196
1197
|
}, [
|
|
1197
1198
|
O(t.$slots, "default")
|
|
1198
1199
|
], 2),
|
|
1199
|
-
t.$slots.footer ? (h(), y("div",
|
|
1200
|
+
t.$slots.footer ? (h(), y("div", fa, [
|
|
1200
1201
|
O(t.$slots, "footer")
|
|
1201
1202
|
])) : T("", !0)
|
|
1202
1203
|
]));
|
|
1203
1204
|
}
|
|
1204
|
-
},
|
|
1205
|
+
}, ma = {
|
|
1205
1206
|
key: 0,
|
|
1206
1207
|
class: "block text-sm font-medium text-gray-700 mb-2"
|
|
1207
|
-
},
|
|
1208
|
+
}, ha = {
|
|
1208
1209
|
key: 1,
|
|
1209
1210
|
class: "mb-2 relative inline-block"
|
|
1210
|
-
},
|
|
1211
|
+
}, ga = ["href"], ya = ["src", "alt"], va = ["disabled"], ba = {
|
|
1211
1212
|
key: 0,
|
|
1212
1213
|
class: "absolute inset-0 flex items-center justify-center bg-blue-50/80 rounded-md pointer-events-none"
|
|
1213
|
-
},
|
|
1214
|
+
}, xa = {
|
|
1214
1215
|
key: 3,
|
|
1215
1216
|
class: "text-sm text-gray-500 mt-1"
|
|
1216
|
-
},
|
|
1217
|
+
}, Qn = {
|
|
1217
1218
|
__name: "SparkImageUpload",
|
|
1218
1219
|
props: {
|
|
1219
1220
|
modelValue: {
|
|
@@ -1259,19 +1260,19 @@ const z = new zs(), Wn = {
|
|
|
1259
1260
|
},
|
|
1260
1261
|
emits: ["update:modelValue", "upload-start", "upload-success", "upload-error"],
|
|
1261
1262
|
setup(e, { emit: s }) {
|
|
1262
|
-
const t = e, a = s, l = $e("axios"),
|
|
1263
|
+
const t = e, a = s, l = $e("axios"), r = R(!1), o = R(!1);
|
|
1263
1264
|
function i() {
|
|
1264
1265
|
a("update:modelValue", "");
|
|
1265
1266
|
}
|
|
1266
|
-
function
|
|
1267
|
-
t.disabled ||
|
|
1267
|
+
function n() {
|
|
1268
|
+
t.disabled || r.value || (o.value = !0);
|
|
1268
1269
|
}
|
|
1269
1270
|
function c() {
|
|
1270
1271
|
o.value = !1;
|
|
1271
1272
|
}
|
|
1272
|
-
function d(
|
|
1273
|
-
if (o.value = !1, t.disabled ||
|
|
1274
|
-
const v =
|
|
1273
|
+
function d(w) {
|
|
1274
|
+
if (o.value = !1, t.disabled || r.value) return;
|
|
1275
|
+
const v = w.dataTransfer?.files?.[0];
|
|
1275
1276
|
if (v) {
|
|
1276
1277
|
if (!p(v)) {
|
|
1277
1278
|
z.show({
|
|
@@ -1280,33 +1281,33 @@ const z = new zs(), Wn = {
|
|
|
1280
1281
|
});
|
|
1281
1282
|
return;
|
|
1282
1283
|
}
|
|
1283
|
-
|
|
1284
|
+
x(v);
|
|
1284
1285
|
}
|
|
1285
1286
|
}
|
|
1286
|
-
function p(
|
|
1287
|
+
function p(w) {
|
|
1287
1288
|
const v = t.accept.split(",").map((u) => u.trim());
|
|
1288
1289
|
for (const u of v) {
|
|
1289
1290
|
if (u === "*/*") return !0;
|
|
1290
1291
|
if (u.endsWith("/*")) {
|
|
1291
1292
|
const g = u.slice(0, -2);
|
|
1292
|
-
if (
|
|
1293
|
+
if (w.type.startsWith(g + "/")) return !0;
|
|
1293
1294
|
} else if (u.startsWith(".")) {
|
|
1294
|
-
if (
|
|
1295
|
-
} else if (
|
|
1295
|
+
if (w.name.toLowerCase().endsWith(u.toLowerCase())) return !0;
|
|
1296
|
+
} else if (w.type === u) return !0;
|
|
1296
1297
|
}
|
|
1297
1298
|
return !1;
|
|
1298
1299
|
}
|
|
1299
|
-
function f(
|
|
1300
|
-
if (!
|
|
1301
|
-
const v =
|
|
1302
|
-
v &&
|
|
1300
|
+
function f(w) {
|
|
1301
|
+
if (!w || w.length === 0) return;
|
|
1302
|
+
const v = w[0].file;
|
|
1303
|
+
v && x(v);
|
|
1303
1304
|
}
|
|
1304
|
-
async function w
|
|
1305
|
-
|
|
1305
|
+
async function x(w) {
|
|
1306
|
+
r.value = !0, a("upload-start");
|
|
1306
1307
|
try {
|
|
1307
1308
|
const v = new FormData();
|
|
1308
|
-
v.append(t.fieldName,
|
|
1309
|
-
v.append(
|
|
1309
|
+
v.append(t.fieldName, w), Object.entries(t.extraFields).forEach(([_, b]) => {
|
|
1310
|
+
v.append(_, b);
|
|
1310
1311
|
});
|
|
1311
1312
|
const u = await l.post(t.uploadUrl, v, {
|
|
1312
1313
|
headers: { "Content-Type": "multipart/form-data" }
|
|
@@ -1321,14 +1322,14 @@ const z = new zs(), Wn = {
|
|
|
1321
1322
|
message: v.response?.data?.message || "Failed to upload image."
|
|
1322
1323
|
});
|
|
1323
1324
|
} finally {
|
|
1324
|
-
|
|
1325
|
+
r.value = !1;
|
|
1325
1326
|
}
|
|
1326
1327
|
}
|
|
1327
|
-
return (
|
|
1328
|
-
const u =
|
|
1328
|
+
return (w, v) => {
|
|
1329
|
+
const u = A("font-awesome-icon"), g = A("FormKit");
|
|
1329
1330
|
return h(), y("div", null, [
|
|
1330
|
-
e.label ? (h(), y("label",
|
|
1331
|
-
e.modelValue ? (h(), y("div",
|
|
1331
|
+
e.label ? (h(), y("label", ma, M(e.label), 1)) : T("", !0),
|
|
1332
|
+
e.modelValue ? (h(), y("div", ha, [
|
|
1332
1333
|
m("a", {
|
|
1333
1334
|
href: e.modelValue,
|
|
1334
1335
|
target: "_blank",
|
|
@@ -1338,8 +1339,8 @@ const z = new zs(), Wn = {
|
|
|
1338
1339
|
src: e.modelValue,
|
|
1339
1340
|
alt: e.label || "Image preview",
|
|
1340
1341
|
class: V([e.height, "w-auto object-contain border border-gray-300 rounded-md cursor-pointer hover:opacity-80 transition-opacity"])
|
|
1341
|
-
}, null, 10,
|
|
1342
|
-
], 8,
|
|
1342
|
+
}, null, 10, ya)
|
|
1343
|
+
], 8, ga),
|
|
1343
1344
|
m("button", {
|
|
1344
1345
|
type: "button",
|
|
1345
1346
|
class: "absolute -top-2 -right-2 w-5 h-5 bg-white/80 hover:bg-white text-gray-500 hover:text-gray-700 rounded-full flex items-center justify-center shadow-sm border border-gray-200",
|
|
@@ -1347,18 +1348,18 @@ const z = new zs(), Wn = {
|
|
|
1347
1348
|
onClick: i
|
|
1348
1349
|
}, [
|
|
1349
1350
|
S(u, {
|
|
1350
|
-
icon:
|
|
1351
|
+
icon: C(F).farXmark,
|
|
1351
1352
|
class: "text-xs"
|
|
1352
1353
|
}, null, 8, ["icon"])
|
|
1353
|
-
], 8,
|
|
1354
|
+
], 8, va)
|
|
1354
1355
|
])) : T("", !0),
|
|
1355
1356
|
e.modelValue ? T("", !0) : (h(), y("div", {
|
|
1356
1357
|
key: 2,
|
|
1357
1358
|
class: V(["relative rounded-md transition-colors", {
|
|
1358
1359
|
"ring-2 ring-blue-500 ring-offset-2 bg-blue-50": o.value
|
|
1359
1360
|
}]),
|
|
1360
|
-
onDragover: U(
|
|
1361
|
-
onDragenter: U(
|
|
1361
|
+
onDragover: U(n, ["prevent"]),
|
|
1362
|
+
onDragenter: U(n, ["prevent"]),
|
|
1362
1363
|
onDragleave: U(c, ["prevent"]),
|
|
1363
1364
|
onDrop: U(d, ["prevent"])
|
|
1364
1365
|
}, [
|
|
@@ -1366,21 +1367,21 @@ const z = new zs(), Wn = {
|
|
|
1366
1367
|
type: "file",
|
|
1367
1368
|
name: e.name,
|
|
1368
1369
|
accept: e.accept,
|
|
1369
|
-
disabled: e.disabled ||
|
|
1370
|
+
disabled: e.disabled || r.value,
|
|
1370
1371
|
onInput: f
|
|
1371
1372
|
}, null, 8, ["name", "accept", "disabled"]),
|
|
1372
|
-
o.value ? (h(), y("div",
|
|
1373
|
+
o.value ? (h(), y("div", ba, [...v[0] || (v[0] = [
|
|
1373
1374
|
m("span", { class: "text-sm text-blue-600 font-medium" }, "Drop image here", -1)
|
|
1374
1375
|
])])) : T("", !0)
|
|
1375
1376
|
], 34)),
|
|
1376
|
-
|
|
1377
|
+
r.value ? (h(), y("p", xa, "Uploading...")) : T("", !0)
|
|
1377
1378
|
]);
|
|
1378
1379
|
};
|
|
1379
1380
|
}
|
|
1380
|
-
},
|
|
1381
|
+
}, ka = { class: "px-4 pt-5 pb-4 sm:p-6" }, wa = {
|
|
1381
1382
|
key: 0,
|
|
1382
1383
|
class: "text-lg font-medium text-gray-900"
|
|
1383
|
-
},
|
|
1384
|
+
}, _a = {
|
|
1384
1385
|
__name: "SparkModalDialog",
|
|
1385
1386
|
props: {
|
|
1386
1387
|
title: {
|
|
@@ -1446,7 +1447,7 @@ const z = new zs(), Wn = {
|
|
|
1446
1447
|
success: "farCheckCircle",
|
|
1447
1448
|
warning: "farExclamationTriangle",
|
|
1448
1449
|
danger: "farCircleXmark"
|
|
1449
|
-
},
|
|
1450
|
+
}, r = $(() => s.icon || l[s.type]), o = $(() => ({
|
|
1450
1451
|
info: "bg-blue-100",
|
|
1451
1452
|
success: "bg-green-100",
|
|
1452
1453
|
warning: "bg-yellow-100",
|
|
@@ -1457,22 +1458,22 @@ const z = new zs(), Wn = {
|
|
|
1457
1458
|
warning: "text-yellow-400",
|
|
1458
1459
|
danger: "text-red-400"
|
|
1459
1460
|
})[s.type]);
|
|
1460
|
-
return (
|
|
1461
|
-
const d =
|
|
1462
|
-
return h(), y("div",
|
|
1463
|
-
|
|
1461
|
+
return (n, c) => {
|
|
1462
|
+
const d = A("font-awesome-icon");
|
|
1463
|
+
return h(), y("div", ka, [
|
|
1464
|
+
r.value ? (h(), y("div", {
|
|
1464
1465
|
key: 0,
|
|
1465
1466
|
class: V(["mx-auto flex size-12 items-center justify-center rounded-full", o.value])
|
|
1466
1467
|
}, [
|
|
1467
1468
|
S(d, {
|
|
1468
|
-
icon:
|
|
1469
|
+
icon: C(F)[r.value],
|
|
1469
1470
|
class: V(["h-5 w-5", i.value])
|
|
1470
1471
|
}, null, 8, ["icon", "class"])
|
|
1471
1472
|
], 2)) : T("", !0),
|
|
1472
1473
|
m("div", {
|
|
1473
|
-
class: V(["text-center", { "mt-3 sm:mt-5":
|
|
1474
|
+
class: V(["text-center", { "mt-3 sm:mt-5": r.value }])
|
|
1474
1475
|
}, [
|
|
1475
|
-
e.title ? (h(), y("h3",
|
|
1476
|
+
e.title ? (h(), y("h3", wa, M(e.title), 1)) : T("", !0),
|
|
1476
1477
|
e.message ? (h(), y("div", {
|
|
1477
1478
|
key: 1,
|
|
1478
1479
|
class: V([{ "mt-2": e.title }, "text-sm text-gray-500"])
|
|
@@ -1481,13 +1482,13 @@ const z = new zs(), Wn = {
|
|
|
1481
1482
|
m("div", {
|
|
1482
1483
|
class: V(["mt-5 sm:mt-6", a.value])
|
|
1483
1484
|
}, [
|
|
1484
|
-
(h(!0), y(D, null, B(t.value, (p, f) => (h(), H(
|
|
1485
|
+
(h(!0), y(D, null, B(t.value, (p, f) => (h(), H(C(G), {
|
|
1485
1486
|
key: f,
|
|
1486
1487
|
variant: p.variant,
|
|
1487
|
-
onClick: (
|
|
1488
|
+
onClick: (x) => n.$emit(p.event, p)
|
|
1488
1489
|
}, {
|
|
1489
1490
|
default: L(() => [
|
|
1490
|
-
|
|
1491
|
+
E(M(p.text), 1)
|
|
1491
1492
|
]),
|
|
1492
1493
|
_: 2
|
|
1493
1494
|
}, 1032, ["variant", "onClick"]))), 128))
|
|
@@ -1496,7 +1497,7 @@ const z = new zs(), Wn = {
|
|
|
1496
1497
|
};
|
|
1497
1498
|
}
|
|
1498
1499
|
};
|
|
1499
|
-
class
|
|
1500
|
+
class Ca {
|
|
1500
1501
|
constructor() {
|
|
1501
1502
|
this.state = K({
|
|
1502
1503
|
isVisible: !1,
|
|
@@ -1527,19 +1528,19 @@ class _a {
|
|
|
1527
1528
|
const {
|
|
1528
1529
|
title: a = "Confirm",
|
|
1529
1530
|
message: l = "Are you sure?",
|
|
1530
|
-
type:
|
|
1531
|
+
type: r = "warning",
|
|
1531
1532
|
confirmText: o = "Confirm",
|
|
1532
1533
|
cancelText: i = "Cancel",
|
|
1533
|
-
confirmVariant:
|
|
1534
|
+
confirmVariant: n = "primary"
|
|
1534
1535
|
} = s;
|
|
1535
1536
|
this.show(
|
|
1536
|
-
|
|
1537
|
+
_a,
|
|
1537
1538
|
{
|
|
1538
1539
|
title: a,
|
|
1539
1540
|
message: l,
|
|
1540
|
-
type:
|
|
1541
|
+
type: r,
|
|
1541
1542
|
buttons: [
|
|
1542
|
-
{ text: o, variant:
|
|
1543
|
+
{ text: o, variant: n, event: "confirm" },
|
|
1543
1544
|
{ text: i, variant: "secondary", event: "cancel" }
|
|
1544
1545
|
]
|
|
1545
1546
|
},
|
|
@@ -1554,20 +1555,20 @@ class _a {
|
|
|
1554
1555
|
);
|
|
1555
1556
|
});
|
|
1556
1557
|
}
|
|
1557
|
-
const J = new
|
|
1558
|
+
const J = new Ca(), Sa = { class: "fixed inset-0 z-10 w-screen overflow-y-auto" }, $a = { class: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" }, Ta = {
|
|
1558
1559
|
__name: "SparkModalContainer",
|
|
1559
1560
|
setup(e) {
|
|
1560
|
-
return (s, t) => (h(), H(
|
|
1561
|
+
return (s, t) => (h(), H(C(ot), {
|
|
1561
1562
|
as: "template",
|
|
1562
|
-
show:
|
|
1563
|
+
show: C(J).state.isVisible
|
|
1563
1564
|
}, {
|
|
1564
1565
|
default: L(() => [
|
|
1565
|
-
S(
|
|
1566
|
+
S(C(rt), {
|
|
1566
1567
|
class: "relative z-1000",
|
|
1567
|
-
onClose:
|
|
1568
|
+
onClose: C(J).hide
|
|
1568
1569
|
}, {
|
|
1569
1570
|
default: L(() => [
|
|
1570
|
-
S(
|
|
1571
|
+
S(C(ge), {
|
|
1571
1572
|
as: "template",
|
|
1572
1573
|
enter: "ease-out duration-300",
|
|
1573
1574
|
"enter-from": "opacity-0",
|
|
@@ -1581,9 +1582,9 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1581
1582
|
])]),
|
|
1582
1583
|
_: 1
|
|
1583
1584
|
}),
|
|
1584
|
-
m("div",
|
|
1585
|
-
m("div",
|
|
1586
|
-
S(
|
|
1585
|
+
m("div", Sa, [
|
|
1586
|
+
m("div", $a, [
|
|
1587
|
+
S(C(ge), {
|
|
1587
1588
|
as: "template",
|
|
1588
1589
|
enter: "ease-out duration-300",
|
|
1589
1590
|
"enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
@@ -1593,9 +1594,9 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1593
1594
|
"leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
1594
1595
|
}, {
|
|
1595
1596
|
default: L(() => [
|
|
1596
|
-
S(
|
|
1597
|
+
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
1598
|
default: L(() => [
|
|
1598
|
-
(h(), H(Z(
|
|
1599
|
+
(h(), H(Z(C(J).state.content), q(C(J).state.props, Oe(C(J).state.eventHandlers)), null, 16))
|
|
1599
1600
|
]),
|
|
1600
1601
|
_: 1
|
|
1601
1602
|
})
|
|
@@ -1611,7 +1612,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1611
1612
|
_: 1
|
|
1612
1613
|
}, 8, ["show"]));
|
|
1613
1614
|
}
|
|
1614
|
-
},
|
|
1615
|
+
}, La = { class: "fixed inset-0 flex" }, Me = {
|
|
1615
1616
|
__name: "SparkOverlay",
|
|
1616
1617
|
props: {
|
|
1617
1618
|
position: {
|
|
@@ -1632,21 +1633,21 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1632
1633
|
md: "w-[450px]",
|
|
1633
1634
|
lg: "w-[810px]",
|
|
1634
1635
|
xl: "w-[1000px]"
|
|
1635
|
-
}, l = e,
|
|
1636
|
-
l.overlayInstance.close(),
|
|
1636
|
+
}, l = e, r = s, o = $(() => a[l.overlayInstance.state.size] || a.md), i = () => {
|
|
1637
|
+
l.overlayInstance.close(), r("close");
|
|
1637
1638
|
};
|
|
1638
|
-
return (
|
|
1639
|
+
return (n, c) => (h(), H(C(ot), {
|
|
1639
1640
|
show: e.overlayInstance.state.isVisible,
|
|
1640
1641
|
as: "template"
|
|
1641
1642
|
}, {
|
|
1642
1643
|
default: L(() => [
|
|
1643
|
-
S(
|
|
1644
|
+
S(C(rt), {
|
|
1644
1645
|
initialFocus: t.value,
|
|
1645
1646
|
class: "relative z-1000",
|
|
1646
1647
|
onClose: i
|
|
1647
1648
|
}, {
|
|
1648
1649
|
default: L(() => [
|
|
1649
|
-
S(
|
|
1650
|
+
S(C(ge), {
|
|
1650
1651
|
as: "template",
|
|
1651
1652
|
enter: "transition-opacity ease-linear duration-150",
|
|
1652
1653
|
"enter-from": "opacity-0",
|
|
@@ -1660,8 +1661,8 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1660
1661
|
])]),
|
|
1661
1662
|
_: 1
|
|
1662
1663
|
}),
|
|
1663
|
-
m("div",
|
|
1664
|
-
S(
|
|
1664
|
+
m("div", La, [
|
|
1665
|
+
S(C(ge), {
|
|
1665
1666
|
as: "template",
|
|
1666
1667
|
enter: "transition ease-in-out duration-150 transform",
|
|
1667
1668
|
"enter-from": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0",
|
|
@@ -1671,7 +1672,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1671
1672
|
"leave-to": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
|
|
1672
1673
|
}, {
|
|
1673
1674
|
default: L(() => [
|
|
1674
|
-
S(
|
|
1675
|
+
S(C(nt), {
|
|
1675
1676
|
ref_key: "panelRef",
|
|
1676
1677
|
ref: t,
|
|
1677
1678
|
class: V([
|
|
@@ -1696,7 +1697,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1696
1697
|
_: 1
|
|
1697
1698
|
}, 8, ["show"]));
|
|
1698
1699
|
}
|
|
1699
|
-
},
|
|
1700
|
+
}, Pa = ["disabled", "onClick"], el = {
|
|
1700
1701
|
__name: "SparkSubNav",
|
|
1701
1702
|
props: {
|
|
1702
1703
|
/**
|
|
@@ -1743,14 +1744,14 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1743
1744
|
},
|
|
1744
1745
|
emits: ["navigate", "update:activeId"],
|
|
1745
1746
|
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))),
|
|
1747
|
+
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
1748
|
function o(v) {
|
|
1748
1749
|
return t.navInstance ? t.navInstance.isActive(v) : v.id === t.activeId;
|
|
1749
1750
|
}
|
|
1750
1751
|
function i(v) {
|
|
1751
1752
|
return t.navInstance ? t.navInstance.isDisabled(v) : typeof v.disabled == "function" ? v.disabled() : v.disabled;
|
|
1752
1753
|
}
|
|
1753
|
-
async function
|
|
1754
|
+
async function n(v) {
|
|
1754
1755
|
i(v) || (t.navInstance && await t.navInstance.navigateTo(v), a("navigate", v), a("update:activeId", v.id));
|
|
1755
1756
|
}
|
|
1756
1757
|
const c = $(() => ["spark-sub-nav", {
|
|
@@ -1761,21 +1762,21 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1761
1762
|
custom: ""
|
|
1762
1763
|
}[t.layout]]), d = $(() => t.compact ? "text-sm" : "");
|
|
1763
1764
|
function p(v) {
|
|
1764
|
-
const u = o(v), g = i(v),
|
|
1765
|
+
const u = o(v), g = i(v), _ = [
|
|
1765
1766
|
"inline-flex items-center transition-colors cursor-pointer",
|
|
1766
1767
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1"
|
|
1767
1768
|
];
|
|
1768
|
-
return g &&
|
|
1769
|
+
return g && _.push("opacity-50 cursor-not-allowed"), t.layout === "tabs" ? _.push(...f(u, g)) : t.layout === "vertical" && _.push(...x(u, g)), _;
|
|
1769
1770
|
}
|
|
1770
1771
|
function f(v, u) {
|
|
1771
|
-
const g = ["border-b-2 -mb-px rounded-t font-medium"],
|
|
1772
|
-
return g.push(
|
|
1772
|
+
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";
|
|
1773
|
+
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
1774
|
}
|
|
1774
|
-
function
|
|
1775
|
+
function x(v, u) {
|
|
1775
1776
|
const g = ["font-medium text-sm py-1"];
|
|
1776
1777
|
return v ? g.push("text-primary-600") : u ? g.push("text-gray-400") : g.push("text-gray-600 hover:text-gray-900"), g;
|
|
1777
1778
|
}
|
|
1778
|
-
function
|
|
1779
|
+
function w(v) {
|
|
1779
1780
|
const u = v.badgeVariant || "primary", g = {
|
|
1780
1781
|
primary: "bg-primary-100 text-primary-700",
|
|
1781
1782
|
secondary: "bg-gray-100 text-gray-700",
|
|
@@ -1791,32 +1792,32 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1791
1792
|
t.layout === "custom" ? O(v.$slots, "default", {
|
|
1792
1793
|
key: 0,
|
|
1793
1794
|
items: l.value,
|
|
1794
|
-
activeId:
|
|
1795
|
+
activeId: r.value,
|
|
1795
1796
|
isActive: o,
|
|
1796
1797
|
isDisabled: i,
|
|
1797
|
-
navigate:
|
|
1798
|
+
navigate: n
|
|
1798
1799
|
}) : t.layout === "horizontal" ? (h(), H(pt, {
|
|
1799
1800
|
key: 1,
|
|
1800
1801
|
class: "isolate"
|
|
1801
1802
|
}, {
|
|
1802
1803
|
default: L(() => [
|
|
1803
|
-
(h(!0), y(D, null, B(l.value, (g) => (h(), H(
|
|
1804
|
+
(h(!0), y(D, null, B(l.value, (g) => (h(), H(G, {
|
|
1804
1805
|
key: g.id,
|
|
1805
1806
|
size: "xl",
|
|
1806
1807
|
variant: o(g) ? "primary" : "secondary",
|
|
1807
1808
|
disabled: i(g),
|
|
1808
|
-
onClick: (
|
|
1809
|
+
onClick: (_) => n(g)
|
|
1809
1810
|
}, {
|
|
1810
1811
|
default: L(() => [
|
|
1811
|
-
g.icon ? (h(), H(
|
|
1812
|
+
g.icon ? (h(), H(C(he), {
|
|
1812
1813
|
key: 0,
|
|
1813
|
-
icon:
|
|
1814
|
+
icon: C(F)[g.icon],
|
|
1814
1815
|
class: "mr-1.5 size-4"
|
|
1815
1816
|
}, null, 8, ["icon"])) : T("", !0),
|
|
1816
|
-
|
|
1817
|
+
E(" " + M(g.label) + " ", 1),
|
|
1817
1818
|
g.badge != null ? (h(), y("span", {
|
|
1818
1819
|
key: 1,
|
|
1819
|
-
class: V(
|
|
1820
|
+
class: V(w(g))
|
|
1820
1821
|
}, M(g.badge), 3)) : T("", !0)
|
|
1821
1822
|
]),
|
|
1822
1823
|
_: 2
|
|
@@ -1827,85 +1828,85 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1827
1828
|
key: g.id,
|
|
1828
1829
|
class: V(p(g)),
|
|
1829
1830
|
disabled: i(g) || void 0,
|
|
1830
|
-
onClick: (
|
|
1831
|
+
onClick: (_) => n(g)
|
|
1831
1832
|
}, [
|
|
1832
|
-
o(g) && t.layout === "vertical" ? (h(), H(
|
|
1833
|
+
o(g) && t.layout === "vertical" ? (h(), H(C(he), {
|
|
1833
1834
|
key: 0,
|
|
1834
|
-
icon:
|
|
1835
|
+
icon: C(F).farCircleCheck,
|
|
1835
1836
|
class: "mr-2 size-4"
|
|
1836
1837
|
}, null, 8, ["icon"])) : T("", !0),
|
|
1837
|
-
g.icon && !(o(g) && t.layout === "vertical") ? (h(), H(
|
|
1838
|
+
g.icon && !(o(g) && t.layout === "vertical") ? (h(), H(C(he), {
|
|
1838
1839
|
key: 1,
|
|
1839
|
-
icon:
|
|
1840
|
+
icon: C(F)[g.icon],
|
|
1840
1841
|
class: V(["mr-2", d.value])
|
|
1841
1842
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
1842
1843
|
m("span", null, M(g.label), 1),
|
|
1843
1844
|
g.badge != null ? (h(), y("span", {
|
|
1844
1845
|
key: 2,
|
|
1845
|
-
class: V(
|
|
1846
|
+
class: V(w(g))
|
|
1846
1847
|
}, M(g.badge), 3)) : T("", !0)
|
|
1847
|
-
], 10,
|
|
1848
|
+
], 10, Pa))), 128))
|
|
1848
1849
|
], 2));
|
|
1849
1850
|
}
|
|
1850
|
-
},
|
|
1851
|
+
}, Ma = (e) => {
|
|
1851
1852
|
if (e.includes(".")) {
|
|
1852
1853
|
const s = e.split(".");
|
|
1853
1854
|
e = s[s.length - 1];
|
|
1854
1855
|
}
|
|
1855
1856
|
return e.replace(/_/g, " ");
|
|
1856
|
-
},
|
|
1857
|
+
}, Va = (e, s, t) => {
|
|
1857
1858
|
const a = s.querySelector(".relative");
|
|
1858
1859
|
if (!a || a.querySelector(".spark-table-head-sorting"))
|
|
1859
1860
|
return;
|
|
1860
1861
|
const l = document.createElement("span");
|
|
1861
1862
|
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
|
|
1863
|
+
const r = t.params.orderBy, o = t.params.sortedBy;
|
|
1864
|
+
return r === e && o === "asc" ? (a.classList.remove("asc"), a.classList.add("desc"), t.methods.applyParams({
|
|
1864
1865
|
orderBy: e,
|
|
1865
1866
|
sortedBy: "desc"
|
|
1866
|
-
})) :
|
|
1867
|
+
})) : r === e ? (a.classList.remove("desc"), await t.methods.clearParams(["orderBy", "sortedBy"])) : (a.classList.add("asc"), t.methods.applyParams({
|
|
1867
1868
|
orderBy: e,
|
|
1868
1869
|
sortedBy: "asc"
|
|
1869
1870
|
}));
|
|
1870
1871
|
});
|
|
1871
|
-
},
|
|
1872
|
+
}, Ha = (e, s, t) => {
|
|
1872
1873
|
if (s.querySelector(".spark-table-head-filter"))
|
|
1873
1874
|
return;
|
|
1874
1875
|
const a = document.createElement("div"), l = document.createElement("input");
|
|
1875
1876
|
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] ===
|
|
1877
|
+
const r = lt(async (o, i) => {
|
|
1878
|
+
const n = i.target.value, c = `filter[${o}]`;
|
|
1879
|
+
if (n)
|
|
1880
|
+
return t.params[c] && t.params[c] === n ? void 0 : t.methods.applyParams({
|
|
1880
1881
|
page: 1,
|
|
1881
|
-
[c]:
|
|
1882
|
+
[c]: n
|
|
1882
1883
|
});
|
|
1883
1884
|
await t.methods.removeParam(c);
|
|
1884
1885
|
}, 200);
|
|
1885
|
-
l.addEventListener("keyup", (o) =>
|
|
1886
|
-
},
|
|
1886
|
+
l.addEventListener("keyup", (o) => r(e, o)), s.appendChild(a);
|
|
1887
|
+
}, Ra = (e, s, t) => {
|
|
1887
1888
|
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
1889
|
const l = e.querySelector(".colHeader");
|
|
1889
|
-
l.classList.add("spark-table-head-title"), l.innerHTML =
|
|
1890
|
-
},
|
|
1890
|
+
l.classList.add("spark-table-head-title"), l.innerHTML = Ma(s);
|
|
1891
|
+
}, Fa = (e, s, t) => {
|
|
1891
1892
|
if (typeof e != "number")
|
|
1892
1893
|
return e;
|
|
1893
1894
|
if (e < 0)
|
|
1894
1895
|
return;
|
|
1895
1896
|
let a = 2;
|
|
1896
|
-
const l = t.methods.colToProp(e),
|
|
1897
|
-
s.childElementCount === 1 && ((!
|
|
1898
|
-
},
|
|
1897
|
+
const l = t.methods.colToProp(e), r = t.methods.getSettingsForProp(l);
|
|
1898
|
+
s.childElementCount === 1 && ((!r || !r.columnSort) && a--, (!r || !r.columnFilter) && a--, r && r.columnSort && Va(l, s, t), r && r.columnFilter && Ha(l, s, t)), (s.childElementCount === a || a === 0) && Ra(s, l, r);
|
|
1899
|
+
}, Da = (e) => {
|
|
1899
1900
|
if (!e.hotInstance || !e.hotInstance.rootElement)
|
|
1900
1901
|
return;
|
|
1901
1902
|
const s = e.params.orderBy, t = e.params.sortedBy, a = e.hotInstance.rootElement.querySelectorAll("thead th.can-sort .relative");
|
|
1902
1903
|
a.forEach((l) => {
|
|
1903
1904
|
l.classList.remove("asc", "desc");
|
|
1904
1905
|
}), s && t && a.forEach((l) => {
|
|
1905
|
-
const
|
|
1906
|
+
const r = l.closest("th"), o = Array.from(r.parentElement.children).indexOf(r);
|
|
1906
1907
|
e.methods.colToProp(o) === s && l.classList.add(t);
|
|
1907
1908
|
});
|
|
1908
|
-
},
|
|
1909
|
+
}, Aa = (e) => (s, t, a, l, r, o, i) => {
|
|
1909
1910
|
t.innerHTML = "", t.classList.add("spark-table-cell-actions");
|
|
1910
1911
|
const c = (i.rendererConfig || {}).actions || [];
|
|
1911
1912
|
if (c.length === 0)
|
|
@@ -1914,17 +1915,17 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1914
1915
|
p.classList.add("flex", "items-center", "gap-2"), c.forEach((f) => {
|
|
1915
1916
|
if (f.condition && typeof f.condition == "function" && !f.condition(d))
|
|
1916
1917
|
return;
|
|
1917
|
-
const
|
|
1918
|
-
if (
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1918
|
+
const x = document.createElement("button");
|
|
1919
|
+
if (x.type = "button", x.classList.add("spark-table-action-button"), f.icon) {
|
|
1920
|
+
const w = document.createElement("span");
|
|
1921
|
+
w.innerHTML = te({ prefix: "far", iconName: f.icon }).html, w.classList.add("size-4"), x.appendChild(w);
|
|
1921
1922
|
}
|
|
1922
1923
|
if (f.label) {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1924
|
+
const w = document.createElement("span");
|
|
1925
|
+
w.textContent = f.label, x.appendChild(w);
|
|
1925
1926
|
}
|
|
1926
|
-
|
|
1927
|
-
if (
|
|
1927
|
+
x.addEventListener("click", async (w) => {
|
|
1928
|
+
if (w.preventDefault(), w.stopPropagation(), f.confirm) {
|
|
1928
1929
|
const v = typeof f.confirm == "string" ? f.confirm : `Are you sure you want to ${f.label?.toLowerCase() || "perform this action"}?`;
|
|
1929
1930
|
if (!await J.confirm({
|
|
1930
1931
|
title: f.confirmTitle,
|
|
@@ -1937,7 +1938,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1937
1938
|
return;
|
|
1938
1939
|
}
|
|
1939
1940
|
f.event && e.methods.fireEvent(f.event, d), f.handler && typeof f.handler == "function" && f.handler(d);
|
|
1940
|
-
}), p.appendChild(
|
|
1941
|
+
}), p.appendChild(x);
|
|
1941
1942
|
}), t.appendChild(p);
|
|
1942
1943
|
}, Ve = {
|
|
1943
1944
|
green: "bg-green-100 text-green-800",
|
|
@@ -1948,7 +1949,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1948
1949
|
purple: "bg-purple-100 text-purple-800",
|
|
1949
1950
|
pink: "bg-pink-100 text-pink-800",
|
|
1950
1951
|
indigo: "bg-indigo-100 text-indigo-800"
|
|
1951
|
-
}, Ea = (e) => (s, t, a, l,
|
|
1952
|
+
}, Ea = (e) => (s, t, a, l, r, o, i) => {
|
|
1952
1953
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-badge"), !o)
|
|
1953
1954
|
return;
|
|
1954
1955
|
const c = (i.rendererConfig || {}).colorMap || {}, d = c[o] || c[o?.toLowerCase()] || "gray", p = Ve[d] || Ve.gray, f = document.createElement("span");
|
|
@@ -1970,7 +1971,7 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1970
1971
|
blue: { bg: "bg-blue-100", text: "text-blue-500" },
|
|
1971
1972
|
gray: { bg: "bg-gray-100", text: "text-gray-500" },
|
|
1972
1973
|
purple: { bg: "bg-purple-100", text: "text-purple-500" }
|
|
1973
|
-
},
|
|
1974
|
+
}, Ia = (e) => {
|
|
1974
1975
|
if (e == null || e === "")
|
|
1975
1976
|
return !1;
|
|
1976
1977
|
if (typeof e == "boolean")
|
|
@@ -1982,9 +1983,9 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1982
1983
|
return s === "1" || s === "yes" || s === "true";
|
|
1983
1984
|
}
|
|
1984
1985
|
return !1;
|
|
1985
|
-
},
|
|
1986
|
+
}, Oa = (e) => (s, t, a, l, r, o, i) => {
|
|
1986
1987
|
t.innerHTML = "", t.classList.add("spark-table-cell-boolean");
|
|
1987
|
-
const
|
|
1988
|
+
const n = i.rendererConfig || {}, c = Ia(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
1989
|
t.dataset.copyValue = c ? "true" : "false";
|
|
1989
1990
|
const v = document.createElement("div");
|
|
1990
1991
|
v.classList.add(
|
|
@@ -1992,89 +1993,89 @@ const J = new _a(), Ca = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1992
1993
|
"items-center",
|
|
1993
1994
|
"justify-center",
|
|
1994
1995
|
"rounded-full",
|
|
1995
|
-
|
|
1996
|
-
|
|
1996
|
+
w.bg,
|
|
1997
|
+
w.text
|
|
1997
1998
|
), v.style.width = `${f}px`, v.style.height = `${f}px`;
|
|
1998
1999
|
const u = document.createElement("span");
|
|
1999
|
-
u.innerHTML = te({ prefix:
|
|
2000
|
+
u.innerHTML = te({ prefix: x, iconName: d }).html, u.classList.add("flex", "items-center", "justify-center");
|
|
2000
2001
|
const g = Math.round(f * 0.5);
|
|
2001
2002
|
u.style.fontSize = `${g}px`, v.appendChild(u), t.appendChild(v);
|
|
2002
|
-
},
|
|
2003
|
+
}, Ba = (e, s = 2) => {
|
|
2003
2004
|
const t = Number(e);
|
|
2004
2005
|
if (isNaN(t)) return null;
|
|
2005
|
-
const a = t < 0,
|
|
2006
|
+
const a = t < 0, r = Math.abs(t).toLocaleString("en-AU", {
|
|
2006
2007
|
minimumFractionDigits: s,
|
|
2007
2008
|
maximumFractionDigits: s
|
|
2008
2009
|
});
|
|
2009
|
-
return a ? `-$${
|
|
2010
|
-
},
|
|
2010
|
+
return a ? `-$${r}` : `$${r}`;
|
|
2011
|
+
}, za = (e) => (s, t, a, l, r, o, i) => {
|
|
2011
2012
|
t.innerHTML = "", t.classList.add("spark-table-cell-currency");
|
|
2012
|
-
const
|
|
2013
|
+
const n = i.rendererConfig || {}, { decimals: c = 2, emptyText: d = "" } = n;
|
|
2013
2014
|
if (o == null || o === "") {
|
|
2014
2015
|
t.textContent = d;
|
|
2015
2016
|
return;
|
|
2016
2017
|
}
|
|
2017
|
-
const p =
|
|
2018
|
+
const p = Ba(o, c);
|
|
2018
2019
|
if (p === null) {
|
|
2019
2020
|
t.textContent = d;
|
|
2020
2021
|
return;
|
|
2021
2022
|
}
|
|
2022
2023
|
const f = document.createElement("span");
|
|
2023
2024
|
f.textContent = p, t.appendChild(f);
|
|
2024
|
-
},
|
|
2025
|
+
}, ja = (e) => (s, t, a, l, r, o, i) => {
|
|
2025
2026
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-link"), !o)
|
|
2026
2027
|
return;
|
|
2027
|
-
const
|
|
2028
|
+
const n = i.rendererConfig || {}, c = s.getSourceDataAtRow(s.toPhysicalRow(a));
|
|
2028
2029
|
let d = o;
|
|
2029
|
-
|
|
2030
|
+
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
2031
|
const p = document.createElement("a");
|
|
2031
|
-
p.href = d, p.textContent = o, p.classList.add("text-primary-600", "hover:text-primary-900", "hover:underline"),
|
|
2032
|
+
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
2033
|
f.stopPropagation();
|
|
2033
2034
|
}), t.appendChild(p);
|
|
2034
2035
|
}, Re = {
|
|
2035
2036
|
sm: "h-6 w-6",
|
|
2036
2037
|
md: "h-8 w-8",
|
|
2037
2038
|
lg: "h-12 w-12"
|
|
2038
|
-
},
|
|
2039
|
+
}, Na = (e) => (s, t, a, l, r, o, i) => {
|
|
2039
2040
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !o)
|
|
2040
2041
|
return;
|
|
2041
|
-
const
|
|
2042
|
-
let
|
|
2043
|
-
typeof
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
},
|
|
2042
|
+
const n = i.rendererConfig || {}, c = s.getSourceDataAtRow(s.toPhysicalRow(a)), d = n.size || "md", p = Re[d] || Re.md, f = n.rounded !== !1;
|
|
2043
|
+
let x = n.alt || "";
|
|
2044
|
+
typeof n.alt == "string" && c[n.alt] && (x = c[n.alt]);
|
|
2045
|
+
const w = document.createElement("img");
|
|
2046
|
+
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);
|
|
2047
|
+
}, Za = (e) => (s, t, a, l, r, o, i) => {
|
|
2047
2048
|
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !o)
|
|
2048
2049
|
return;
|
|
2049
|
-
const
|
|
2050
|
+
const n = i.rendererConfig || {}, c = n.format || "short", d = n.locale || "en-US";
|
|
2050
2051
|
let p = o;
|
|
2051
2052
|
try {
|
|
2052
|
-
const
|
|
2053
|
-
isNaN(
|
|
2053
|
+
const x = new Date(o);
|
|
2054
|
+
isNaN(x.getTime()) ? p = o : typeof c == "function" ? p = c(x) : c === "short" ? p = x.toLocaleDateString(d) : c === "long" ? p = x.toLocaleDateString(d, {
|
|
2054
2055
|
year: "numeric",
|
|
2055
2056
|
month: "long",
|
|
2056
2057
|
day: "numeric"
|
|
2057
|
-
}) : c === "relative" ? p =
|
|
2058
|
-
} catch (
|
|
2059
|
-
console.error("Error formatting date:",
|
|
2058
|
+
}) : c === "relative" ? p = qa(x) : c === "datetime" ? p = x.toLocaleString(d) : p = x.toLocaleDateString(d);
|
|
2059
|
+
} catch (x) {
|
|
2060
|
+
console.error("Error formatting date:", x), p = o;
|
|
2060
2061
|
}
|
|
2061
2062
|
const f = document.createElement("span");
|
|
2062
2063
|
f.textContent = p, t.appendChild(f);
|
|
2063
2064
|
};
|
|
2064
|
-
function
|
|
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
|
+
function qa(e) {
|
|
2066
|
+
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;
|
|
2067
|
+
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
2068
|
}
|
|
2068
|
-
const
|
|
2069
|
+
const Ua = (e) => {
|
|
2069
2070
|
const s = ["th", "st", "nd", "rd"], t = e % 100;
|
|
2070
2071
|
return e + (s[(t - 20) % 10] || s[t] || s[0]);
|
|
2071
|
-
}, N = (e, s = 2) => String(e).padStart(s, "0"), xe = /* @__PURE__ */ new Map(),
|
|
2072
|
+
}, N = (e, s = 2) => String(e).padStart(s, "0"), xe = /* @__PURE__ */ new Map(), Ka = (e, s) => {
|
|
2072
2073
|
const t = `${e}:${JSON.stringify(s)}`;
|
|
2073
2074
|
return xe.has(t) || xe.set(t, new Intl.DateTimeFormat(e, s)), xe.get(t);
|
|
2074
2075
|
}, de = (e, s, t, a) => {
|
|
2075
|
-
const o =
|
|
2076
|
+
const o = Ka(s, t).formatToParts(e).find((i) => i.type === a);
|
|
2076
2077
|
return o ? o.value : "";
|
|
2077
|
-
},
|
|
2078
|
+
}, Wa = (e) => e.epochMilliseconds !== void 0 ? new Date(e.epochMilliseconds) : new Date(
|
|
2078
2079
|
e.year,
|
|
2079
2080
|
e.month - 1,
|
|
2080
2081
|
e.day,
|
|
@@ -2103,10 +2104,10 @@ const qa = (e) => {
|
|
|
2103
2104
|
}, Fe = (e, s = !0) => {
|
|
2104
2105
|
if (!e.offsetNanoseconds && e.offsetNanoseconds !== 0)
|
|
2105
2106
|
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 = Ga(e), a =
|
|
2107
|
+
const t = Math.round(e.offsetNanoseconds / 6e10), a = t >= 0 ? "+" : "-", l = Math.abs(t), r = Math.floor(l / 60), o = l % 60;
|
|
2108
|
+
return s ? `${a}${N(r)}:${N(o)}` : `${a}${N(r)}${N(o)}`;
|
|
2109
|
+
}, Ya = (e, s) => {
|
|
2110
|
+
const t = Ga(e), a = Wa(e), l = t.dayOfWeek === 7 ? 0 : t.dayOfWeek;
|
|
2110
2111
|
return [
|
|
2111
2112
|
// Year
|
|
2112
2113
|
["YYYY", () => String(t.year)],
|
|
@@ -2118,7 +2119,7 @@ const qa = (e) => {
|
|
|
2118
2119
|
["M", () => String(t.month)],
|
|
2119
2120
|
// Day of month
|
|
2120
2121
|
["DD", () => N(t.day)],
|
|
2121
|
-
["Do", () =>
|
|
2122
|
+
["Do", () => Ua(t.day)],
|
|
2122
2123
|
["D", () => String(t.day)],
|
|
2123
2124
|
// Day of week
|
|
2124
2125
|
["dddd", () => de(a, s, { weekday: "long" }, "weekday")],
|
|
@@ -2152,7 +2153,7 @@ const qa = (e) => {
|
|
|
2152
2153
|
["x", () => String(e.epochMilliseconds ?? a.getTime())],
|
|
2153
2154
|
["X", () => String(Math.floor((e.epochMilliseconds ?? a.getTime()) / 1e3))]
|
|
2154
2155
|
];
|
|
2155
|
-
},
|
|
2156
|
+
}, Xa = (e, s, t = {}) => {
|
|
2156
2157
|
const { locale: a = "en-US" } = t;
|
|
2157
2158
|
if (!e)
|
|
2158
2159
|
return "";
|
|
@@ -2162,55 +2163,55 @@ const qa = (e) => {
|
|
|
2162
2163
|
if (e.includes("[") || e.includes("Z") || /[+-]\d{2}:\d{2}$/.test(e))
|
|
2163
2164
|
l = Temporal.ZonedDateTime.from(e);
|
|
2164
2165
|
else {
|
|
2165
|
-
const
|
|
2166
|
-
l = Temporal.PlainDateTime.from(
|
|
2166
|
+
const n = e.replace(" ", "T");
|
|
2167
|
+
l = Temporal.PlainDateTime.from(n);
|
|
2167
2168
|
}
|
|
2168
|
-
} catch (
|
|
2169
|
-
return console.error("Failed to parse date string:", e,
|
|
2169
|
+
} catch (n) {
|
|
2170
|
+
return console.error("Failed to parse date string:", e, n), e;
|
|
2170
2171
|
}
|
|
2171
|
-
const
|
|
2172
|
-
return s.replace(i, (
|
|
2172
|
+
const r = Ya(l, a), o = r.map(([n]) => n).join("|"), i = new RegExp(`\\[([^\\]]+)\\]|(${o})`, "g");
|
|
2173
|
+
return s.replace(i, (n, c, d) => {
|
|
2173
2174
|
if (c !== void 0)
|
|
2174
2175
|
return c;
|
|
2175
|
-
const p =
|
|
2176
|
-
return p ? p[1]() :
|
|
2176
|
+
const p = r.find(([f]) => f === d);
|
|
2177
|
+
return p ? p[1]() : n;
|
|
2177
2178
|
});
|
|
2178
|
-
},
|
|
2179
|
+
}, Ja = (e, s = {}) => {
|
|
2179
2180
|
const { fromTimezone: t, toTimezone: a } = s;
|
|
2180
2181
|
if (!e)
|
|
2181
2182
|
return null;
|
|
2182
2183
|
const l = e.replace(" ", "T");
|
|
2183
2184
|
return t && a ? Temporal.PlainDateTime.from(l).toZonedDateTime(t).withTimeZone(a) : t ? Temporal.PlainDateTime.from(l).toZonedDateTime(t) : Temporal.PlainDateTime.from(l);
|
|
2184
|
-
},
|
|
2185
|
+
}, Qa = (e) => (s, t, a, l, r, o, i) => {
|
|
2185
2186
|
t.innerHTML = "", t.classList.add("spark-table-cell-datetime");
|
|
2186
|
-
const
|
|
2187
|
+
const n = i.rendererConfig || {}, {
|
|
2187
2188
|
format: c = "DD MMM YYYY, HH:mm",
|
|
2188
2189
|
fromTimezone: d,
|
|
2189
2190
|
toTimezone: p,
|
|
2190
2191
|
locale: f = "en-US",
|
|
2191
|
-
emptyText:
|
|
2192
|
-
} =
|
|
2192
|
+
emptyText: x = ""
|
|
2193
|
+
} = n;
|
|
2193
2194
|
if (!o) {
|
|
2194
|
-
t.textContent =
|
|
2195
|
+
t.textContent = x;
|
|
2195
2196
|
return;
|
|
2196
2197
|
}
|
|
2197
2198
|
try {
|
|
2198
|
-
const
|
|
2199
|
-
if (!
|
|
2200
|
-
t.textContent =
|
|
2199
|
+
const w = Ja(o, { fromTimezone: d, toTimezone: p });
|
|
2200
|
+
if (!w) {
|
|
2201
|
+
t.textContent = x;
|
|
2201
2202
|
return;
|
|
2202
2203
|
}
|
|
2203
|
-
const v =
|
|
2204
|
+
const v = Xa(w, c, { locale: f }), u = document.createElement("span");
|
|
2204
2205
|
u.textContent = v, t.appendChild(u);
|
|
2205
|
-
} catch (
|
|
2206
|
-
console.error("Error formatting datetime:",
|
|
2206
|
+
} catch (w) {
|
|
2207
|
+
console.error("Error formatting datetime:", w, { value: o, format: c }), t.textContent = o;
|
|
2207
2208
|
}
|
|
2208
|
-
},
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
}),
|
|
2212
|
-
},
|
|
2213
|
-
X("spark.actions",
|
|
2209
|
+
}, eo = /* @__PURE__ */ new Map(), X = (e, s) => {
|
|
2210
|
+
ys(e, (t, a, l, r, o, i, n) => {
|
|
2211
|
+
vs.apply(null, [t, a, l, r, o, i, n]), s(t, a, l, r, o, i, n);
|
|
2212
|
+
}), eo.set(e, s);
|
|
2213
|
+
}, to = (e) => {
|
|
2214
|
+
X("spark.actions", Aa(e)), X("spark.badge", Ea()), X("spark.boolean", Oa()), X("spark.currency", za()), X("spark.link", ja()), X("spark.image", Na()), X("spark.date", Za()), X("spark.datetime", Qa()), X("style.capitalize", (s, t, a, l, r, o) => {
|
|
2214
2215
|
if (!o || o.length === 0) {
|
|
2215
2216
|
t.innerText = "";
|
|
2216
2217
|
return;
|
|
@@ -2218,12 +2219,12 @@ const qa = (e) => {
|
|
|
2218
2219
|
const i = document.createElement("span");
|
|
2219
2220
|
i.innerHTML = o, i.classList.add("capitalize"), t.replaceChildren(i);
|
|
2220
2221
|
});
|
|
2221
|
-
},
|
|
2222
|
-
},
|
|
2223
|
-
const t =
|
|
2222
|
+
}, so = () => {
|
|
2223
|
+
}, ao = (e, s = {}) => {
|
|
2224
|
+
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
2225
|
const P = {};
|
|
2225
2226
|
return Object.keys(b).forEach((I) => {
|
|
2226
|
-
const Y = b[I], fe =
|
|
2227
|
+
const Y = b[I], fe = k ? `${k}[${I}]` : I;
|
|
2227
2228
|
Y != null && (typeof Y == "object" && !Array.isArray(Y) ? Object.assign(P, p(Y, fe)) : P[fe] = String(Y));
|
|
2228
2229
|
}), P;
|
|
2229
2230
|
}, f = () => {
|
|
@@ -2237,22 +2238,22 @@ const qa = (e) => {
|
|
|
2237
2238
|
} catch (b) {
|
|
2238
2239
|
console.warn("Failed to save table state to localStorage:", b);
|
|
2239
2240
|
}
|
|
2240
|
-
},
|
|
2241
|
+
}, x = () => {
|
|
2241
2242
|
if (!i) return null;
|
|
2242
2243
|
try {
|
|
2243
2244
|
const b = localStorage.getItem(d);
|
|
2244
2245
|
if (!b) return null;
|
|
2245
|
-
const
|
|
2246
|
+
const k = JSON.parse(b);
|
|
2246
2247
|
if (c > 0) {
|
|
2247
|
-
const P = Date.now() -
|
|
2248
|
+
const P = Date.now() - k.timestamp, I = c * 24 * 60 * 60 * 1e3;
|
|
2248
2249
|
if (P > I)
|
|
2249
2250
|
return localStorage.removeItem(d), null;
|
|
2250
2251
|
}
|
|
2251
|
-
return
|
|
2252
|
+
return k.params;
|
|
2252
2253
|
} catch (b) {
|
|
2253
2254
|
return console.warn("Failed to load table state from localStorage:", b), null;
|
|
2254
2255
|
}
|
|
2255
|
-
},
|
|
2256
|
+
}, w = () => {
|
|
2256
2257
|
try {
|
|
2257
2258
|
localStorage.removeItem(d);
|
|
2258
2259
|
} catch (b) {
|
|
@@ -2261,37 +2262,37 @@ const qa = (e) => {
|
|
|
2261
2262
|
}, v = () => {
|
|
2262
2263
|
if (!o) return;
|
|
2263
2264
|
const b = { ...a.query };
|
|
2264
|
-
if (
|
|
2265
|
+
if (r) {
|
|
2265
2266
|
Object.keys(b).forEach((P) => {
|
|
2266
2267
|
u(P) && delete b[P];
|
|
2267
2268
|
});
|
|
2268
|
-
const
|
|
2269
|
-
Object.assign(b,
|
|
2269
|
+
const k = p(e.params);
|
|
2270
|
+
Object.assign(b, k);
|
|
2270
2271
|
} else {
|
|
2271
2272
|
Object.keys(b).forEach((P) => {
|
|
2272
2273
|
(P.startsWith(`${l}[`) || P === l) && delete b[P];
|
|
2273
2274
|
});
|
|
2274
|
-
const
|
|
2275
|
-
Object.assign(b,
|
|
2275
|
+
const k = p(e.params, l);
|
|
2276
|
+
Object.assign(b, k);
|
|
2276
2277
|
}
|
|
2277
2278
|
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) ?
|
|
2279
|
+
}, u = (b) => !!(["page", "limit", "search", "orderBy", "sortedBy"].includes(b) || b.includes("[")), g = (b, k) => {
|
|
2280
|
+
if (["page", "limit"].includes(b) && k !== null && k !== void 0) {
|
|
2281
|
+
const I = parseInt(k, 10);
|
|
2282
|
+
return isNaN(I) ? k : I;
|
|
2282
2283
|
}
|
|
2283
|
-
return
|
|
2284
|
-
},
|
|
2285
|
-
if (
|
|
2284
|
+
return k;
|
|
2285
|
+
}, _ = () => {
|
|
2286
|
+
if (r)
|
|
2286
2287
|
Object.keys(a.query).forEach((b) => {
|
|
2287
2288
|
u(b) && (e.params[b] = g(b, a.query[b]));
|
|
2288
2289
|
});
|
|
2289
2290
|
else {
|
|
2290
2291
|
const b = `${l}[`;
|
|
2291
|
-
Object.keys(a.query).forEach((
|
|
2292
|
-
if (
|
|
2293
|
-
const P =
|
|
2294
|
-
e.params[P] = g(P, a.query[
|
|
2292
|
+
Object.keys(a.query).forEach((k) => {
|
|
2293
|
+
if (k.startsWith(b)) {
|
|
2294
|
+
const P = k.slice(b.length, -1);
|
|
2295
|
+
e.params[P] = g(P, a.query[k]);
|
|
2295
2296
|
}
|
|
2296
2297
|
});
|
|
2297
2298
|
}
|
|
@@ -2302,34 +2303,34 @@ const qa = (e) => {
|
|
|
2302
2303
|
o && v(), i && f();
|
|
2303
2304
|
},
|
|
2304
2305
|
{ deep: !0 }
|
|
2305
|
-
),
|
|
2306
|
+
), n && ye(() => {
|
|
2306
2307
|
let b = !1;
|
|
2307
2308
|
if (o) {
|
|
2308
|
-
let
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2309
|
+
let k = !1;
|
|
2310
|
+
if (r)
|
|
2311
|
+
k = Object.keys(a.query).some((P) => u(P));
|
|
2311
2312
|
else {
|
|
2312
2313
|
const P = `${l}[`;
|
|
2313
|
-
|
|
2314
|
+
k = Object.keys(a.query).some(
|
|
2314
2315
|
(I) => I.startsWith(P)
|
|
2315
2316
|
);
|
|
2316
2317
|
}
|
|
2317
|
-
|
|
2318
|
+
k && (b = !0, _());
|
|
2318
2319
|
}
|
|
2319
2320
|
if (!b && i) {
|
|
2320
|
-
const
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
}), Object.assign(e.params,
|
|
2321
|
+
const k = x();
|
|
2322
|
+
k && Object.keys(k).length > 0 && (Object.keys(k).forEach((P) => {
|
|
2323
|
+
k[P] = g(P, k[P]);
|
|
2324
|
+
}), Object.assign(e.params, k));
|
|
2324
2325
|
}
|
|
2325
2326
|
}), {
|
|
2326
2327
|
syncToRoute: v,
|
|
2327
|
-
restoreFromRoute:
|
|
2328
|
+
restoreFromRoute: _,
|
|
2328
2329
|
saveToStorage: f,
|
|
2329
|
-
loadFromStorage:
|
|
2330
|
-
clearStorage:
|
|
2330
|
+
loadFromStorage: x,
|
|
2331
|
+
clearStorage: w
|
|
2331
2332
|
};
|
|
2332
|
-
},
|
|
2333
|
+
}, oo = { class: "flex items-center gap-4 py-3" }, ro = { class: "shrink-0" }, no = { class: "text-sm text-gray-700" }, lo = { class: "font-medium" }, io = { class: "font-medium" }, co = { class: "font-medium" }, uo = {
|
|
2333
2334
|
__name: "SparkTablePaginationDetails",
|
|
2334
2335
|
props: {
|
|
2335
2336
|
sparkTable: {
|
|
@@ -2340,28 +2341,28 @@ const qa = (e) => {
|
|
|
2340
2341
|
setup(e) {
|
|
2341
2342
|
const s = e;
|
|
2342
2343
|
return (t, a) => (h(), y("div", null, [
|
|
2343
|
-
m("div",
|
|
2344
|
-
m("div",
|
|
2345
|
-
m("div",
|
|
2346
|
-
a[0] || (a[0] =
|
|
2347
|
-
m("span",
|
|
2348
|
-
a[1] || (a[1] =
|
|
2349
|
-
m("span",
|
|
2350
|
-
a[2] || (a[2] =
|
|
2351
|
-
m("span",
|
|
2352
|
-
a[3] || (a[3] =
|
|
2344
|
+
m("div", oo, [
|
|
2345
|
+
m("div", ro, [
|
|
2346
|
+
m("div", no, [
|
|
2347
|
+
a[0] || (a[0] = E(" Showing ", -1)),
|
|
2348
|
+
m("span", lo, M(s.sparkTable.response.meta.from), 1),
|
|
2349
|
+
a[1] || (a[1] = E(" to ", -1)),
|
|
2350
|
+
m("span", io, M(s.sparkTable.response.meta.to), 1),
|
|
2351
|
+
a[2] || (a[2] = E(" of ", -1)),
|
|
2352
|
+
m("span", co, M(s.sparkTable.response.meta.total), 1),
|
|
2353
|
+
a[3] || (a[3] = E(" results ", -1))
|
|
2353
2354
|
])
|
|
2354
2355
|
])
|
|
2355
2356
|
])
|
|
2356
2357
|
]));
|
|
2357
2358
|
}
|
|
2358
|
-
},
|
|
2359
|
+
}, po = { class: "flex items-center gap-4 px-4 py-3" }, fo = {
|
|
2359
2360
|
key: 0,
|
|
2360
2361
|
class: "shrink-0 ml-auto"
|
|
2361
|
-
},
|
|
2362
|
+
}, mo = {
|
|
2362
2363
|
class: "isolate inline-flex -space-x-px rounded-md shadow-xs bg-white",
|
|
2363
2364
|
"aria-label": "Pagination"
|
|
2364
|
-
},
|
|
2365
|
+
}, ho = ["onClick"], go = {
|
|
2365
2366
|
__name: "SparkTablePaginationPaging",
|
|
2366
2367
|
props: {
|
|
2367
2368
|
sparkTable: {
|
|
@@ -2372,50 +2373,50 @@ const qa = (e) => {
|
|
|
2372
2373
|
emits: ["paginate"],
|
|
2373
2374
|
setup(e, { emit: s }) {
|
|
2374
2375
|
const t = e, a = s, l = (d) => {
|
|
2375
|
-
|
|
2376
|
-
},
|
|
2376
|
+
r(t.sparkTable.params.page + d);
|
|
2377
|
+
}, r = (d) => {
|
|
2377
2378
|
d < 1 || d > t.sparkTable.response.meta.last_page || a("paginate", {
|
|
2378
2379
|
page: d
|
|
2379
2380
|
});
|
|
2380
|
-
}, o = $(() => t.sparkTable.params.page ? Math.ceil(t.sparkTable.params.page / 10) * 10 : 1), i = $(() => t.sparkTable.computed.ready ?
|
|
2381
|
+
}, o = $(() => t.sparkTable.params.page ? Math.ceil(t.sparkTable.params.page / 10) * 10 : 1), i = $(() => t.sparkTable.computed.ready ? is(
|
|
2381
2382
|
Math.floor((o.value - 1) / 10) * 10 + 1,
|
|
2382
2383
|
o.value > t.sparkTable.response.meta.last_page ? t.sparkTable.response.meta.last_page + 1 : o.value + 1
|
|
2383
|
-
) : []),
|
|
2384
|
+
) : []), n = $(
|
|
2384
2385
|
() => t.sparkTable.params.page < ee(t.sparkTable.response.meta, "last_page", 1)
|
|
2385
2386
|
), c = $(() => t.sparkTable.params.page > 1);
|
|
2386
2387
|
return (d, p) => {
|
|
2387
|
-
const f =
|
|
2388
|
+
const f = A("font-awesome-icon");
|
|
2388
2389
|
return h(), y("div", null, [
|
|
2389
|
-
m("div",
|
|
2390
|
-
i.value.length > 1 ? (h(), y("div",
|
|
2390
|
+
m("div", po, [
|
|
2391
|
+
i.value.length > 1 ? (h(), y("div", fo, [
|
|
2391
2392
|
m("div", null, [
|
|
2392
|
-
m("nav",
|
|
2393
|
+
m("nav", mo, [
|
|
2393
2394
|
m("a", {
|
|
2394
2395
|
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
2396
|
href: "#",
|
|
2396
|
-
onClick: p[0] || (p[0] = U((
|
|
2397
|
+
onClick: p[0] || (p[0] = U((x) => l(-1), ["prevent"]))
|
|
2397
2398
|
}, [
|
|
2398
2399
|
S(f, {
|
|
2399
|
-
icon:
|
|
2400
|
+
icon: C(F).farChevronLeft,
|
|
2400
2401
|
class: "size-5"
|
|
2401
2402
|
}, null, 8, ["icon"])
|
|
2402
2403
|
], 2),
|
|
2403
|
-
(h(!0), y(D, null, B(i.value, (
|
|
2404
|
-
key: `page-${
|
|
2404
|
+
(h(!0), y(D, null, B(i.value, (x) => (h(), y("a", {
|
|
2405
|
+
key: `page-${x}`,
|
|
2405
2406
|
href: "#",
|
|
2406
2407
|
class: V([
|
|
2407
2408
|
"relative inline-flex items-center px-4 py-[9px] text-sm font-semibold ring-1 ring-inset",
|
|
2408
|
-
e.sparkTable.params.page ===
|
|
2409
|
+
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
2410
|
]),
|
|
2410
|
-
onClick: (
|
|
2411
|
-
}, M(
|
|
2411
|
+
onClick: (w) => r(x)
|
|
2412
|
+
}, M(x), 11, ho))), 128)),
|
|
2412
2413
|
m("a", {
|
|
2413
|
-
class: V([
|
|
2414
|
-
onClick: p[1] || (p[1] = U((
|
|
2414
|
+
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"]),
|
|
2415
|
+
onClick: p[1] || (p[1] = U((x) => l(1), ["prevent"])),
|
|
2415
2416
|
href: "#"
|
|
2416
2417
|
}, [
|
|
2417
2418
|
S(f, {
|
|
2418
|
-
icon:
|
|
2419
|
+
icon: C(F).farChevronRight,
|
|
2419
2420
|
class: "size-5"
|
|
2420
2421
|
}, null, 8, ["icon"])
|
|
2421
2422
|
], 2)
|
|
@@ -2431,7 +2432,7 @@ const qa = (e) => {
|
|
|
2431
2432
|
for (const [a, l] of s)
|
|
2432
2433
|
t[a] = l;
|
|
2433
2434
|
return t;
|
|
2434
|
-
},
|
|
2435
|
+
}, yo = { class: "spark-table-pagination-per-page" }, vo = {
|
|
2435
2436
|
__name: "SparkTablePaginationPerPage",
|
|
2436
2437
|
props: {
|
|
2437
2438
|
sparkTable: {
|
|
@@ -2444,28 +2445,28 @@ const qa = (e) => {
|
|
|
2444
2445
|
const t = e, a = s, l = $(() => t.sparkTable.options.perPages.map((o) => ({
|
|
2445
2446
|
label: String(o),
|
|
2446
2447
|
value: o
|
|
2447
|
-
}))),
|
|
2448
|
+
}))), r = (o) => {
|
|
2448
2449
|
a("paginate", {
|
|
2449
2450
|
page: 1,
|
|
2450
2451
|
limit: parseInt(o)
|
|
2451
2452
|
});
|
|
2452
2453
|
};
|
|
2453
2454
|
return (o, i) => {
|
|
2454
|
-
const
|
|
2455
|
-
return h(), y("div",
|
|
2456
|
-
S(
|
|
2455
|
+
const n = A("FormKit");
|
|
2456
|
+
return h(), y("div", yo, [
|
|
2457
|
+
S(n, {
|
|
2457
2458
|
"model-value": e.sparkTable.params.limit,
|
|
2458
2459
|
type: "select",
|
|
2459
2460
|
options: l.value,
|
|
2460
2461
|
"outer-class": "!mb-0",
|
|
2461
2462
|
"wrapper-class": "!mb-0",
|
|
2462
2463
|
"input-class": "!py-2",
|
|
2463
|
-
onInput:
|
|
2464
|
+
onInput: r
|
|
2464
2465
|
}, null, 8, ["model-value", "options"])
|
|
2465
2466
|
]);
|
|
2466
2467
|
};
|
|
2467
2468
|
}
|
|
2468
|
-
},
|
|
2469
|
+
}, bo = /* @__PURE__ */ oe(vo, [["__scopeId", "data-v-9ef8544b"]]), De = {
|
|
2469
2470
|
__name: "SparkTableToolbar",
|
|
2470
2471
|
props: {
|
|
2471
2472
|
position: {
|
|
@@ -2476,17 +2477,17 @@ const qa = (e) => {
|
|
|
2476
2477
|
},
|
|
2477
2478
|
setup(e) {
|
|
2478
2479
|
const s = e, t = Be(), a = $(() => !!t.default), l = $(() => {
|
|
2479
|
-
const
|
|
2480
|
-
return s.position === "footer" ? `${
|
|
2480
|
+
const r = "spark-table-toolbar flex flex-wrap items-center gap-x-5 w-full";
|
|
2481
|
+
return s.position === "footer" ? `${r} spark-table-toolbar-footer justify-between` : `${r} spark-table-toolbar-header gap-y-5 py-5`;
|
|
2481
2482
|
});
|
|
2482
|
-
return (
|
|
2483
|
+
return (r, o) => a.value ? (h(), y("div", {
|
|
2483
2484
|
key: 0,
|
|
2484
2485
|
class: V(l.value)
|
|
2485
2486
|
}, [
|
|
2486
|
-
O(
|
|
2487
|
+
O(r.$slots, "default")
|
|
2487
2488
|
], 2)) : T("", !0);
|
|
2488
2489
|
}
|
|
2489
|
-
},
|
|
2490
|
+
}, xo = { class: "spark-table-search" }, ko = {
|
|
2490
2491
|
__name: "SparkTableSearch",
|
|
2491
2492
|
props: {
|
|
2492
2493
|
/** SparkTable instance object */
|
|
@@ -2518,20 +2519,20 @@ const qa = (e) => {
|
|
|
2518
2519
|
j(t, (o) => {
|
|
2519
2520
|
l(o);
|
|
2520
2521
|
});
|
|
2521
|
-
const
|
|
2522
|
+
const r = s.config.placeholder || "Search...";
|
|
2522
2523
|
return j(
|
|
2523
2524
|
() => s.sparkTable.params[a],
|
|
2524
2525
|
(o) => {
|
|
2525
2526
|
o && o !== t.value ? t.value = o : !o && t.value && (t.value = "");
|
|
2526
2527
|
}
|
|
2527
2528
|
), (o, i) => {
|
|
2528
|
-
const
|
|
2529
|
-
return h(), y("div",
|
|
2530
|
-
S(
|
|
2529
|
+
const n = A("FormKit");
|
|
2530
|
+
return h(), y("div", xo, [
|
|
2531
|
+
S(n, q({
|
|
2531
2532
|
modelValue: t.value,
|
|
2532
2533
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2533
2534
|
type: "text",
|
|
2534
|
-
placeholder:
|
|
2535
|
+
placeholder: C(r),
|
|
2535
2536
|
suffixIcon: "search",
|
|
2536
2537
|
"outer-class": "!mb-0",
|
|
2537
2538
|
"wrapper-class": "!mb-0",
|
|
@@ -2540,7 +2541,7 @@ const qa = (e) => {
|
|
|
2540
2541
|
]);
|
|
2541
2542
|
};
|
|
2542
2543
|
}
|
|
2543
|
-
},
|
|
2544
|
+
}, wo = /* @__PURE__ */ oe(ko, [["__scopeId", "data-v-976170dc"]]), _o = { class: "spark-table-filter-select" }, Co = {
|
|
2544
2545
|
__name: "SparkTableFilterSelect",
|
|
2545
2546
|
props: {
|
|
2546
2547
|
/** SparkTable instance object */
|
|
@@ -2560,7 +2561,7 @@ const qa = (e) => {
|
|
|
2560
2561
|
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
2562
|
[a]: s.config.initialValue
|
|
2562
2563
|
}));
|
|
2563
|
-
const l = s.config.label || null,
|
|
2564
|
+
const l = s.config.label || null, r = $(() => [
|
|
2564
2565
|
{ label: s.config.placeholder || "All", value: "" },
|
|
2565
2566
|
...s.config.options
|
|
2566
2567
|
]);
|
|
@@ -2575,14 +2576,14 @@ const qa = (e) => {
|
|
|
2575
2576
|
o != null && o !== "" ? t.value !== o && (t.value = o) : t.value && (t.value = "");
|
|
2576
2577
|
}
|
|
2577
2578
|
), (o, i) => {
|
|
2578
|
-
const
|
|
2579
|
-
return h(), y("div",
|
|
2580
|
-
S(
|
|
2579
|
+
const n = A("FormKit");
|
|
2580
|
+
return h(), y("div", _o, [
|
|
2581
|
+
S(n, q({
|
|
2581
2582
|
modelValue: t.value,
|
|
2582
2583
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2583
2584
|
type: "select",
|
|
2584
|
-
label:
|
|
2585
|
-
options:
|
|
2585
|
+
label: C(l),
|
|
2586
|
+
options: r.value,
|
|
2586
2587
|
placeholder: e.config.placeholder || "All",
|
|
2587
2588
|
"outer-class": "!mb-0",
|
|
2588
2589
|
"wrapper-class": "!mb-0"
|
|
@@ -2590,10 +2591,10 @@ const qa = (e) => {
|
|
|
2590
2591
|
]);
|
|
2591
2592
|
};
|
|
2592
2593
|
}
|
|
2593
|
-
},
|
|
2594
|
+
}, So = /* @__PURE__ */ oe(Co, [["__scopeId", "data-v-642dbc69"]]), $o = { class: "spark-table-filter-buttons" }, To = {
|
|
2594
2595
|
key: 0,
|
|
2595
2596
|
class: "spark-table-filter-buttons-label"
|
|
2596
|
-
},
|
|
2597
|
+
}, Lo = {
|
|
2597
2598
|
__name: "SparkTableFilterButtons",
|
|
2598
2599
|
props: {
|
|
2599
2600
|
/** SparkTable instance object */
|
|
@@ -2613,7 +2614,7 @@ const qa = (e) => {
|
|
|
2613
2614
|
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
2615
|
[l]: s.config.initialValue
|
|
2615
2616
|
}));
|
|
2616
|
-
const
|
|
2617
|
+
const r = (i) => i == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === i, o = (i) => {
|
|
2617
2618
|
t.value = i, i == null || i === "" ? s.sparkTable.methods.removeParam(l) : s.sparkTable.methods.applyParams({
|
|
2618
2619
|
page: 1,
|
|
2619
2620
|
[l]: i
|
|
@@ -2624,19 +2625,19 @@ const qa = (e) => {
|
|
|
2624
2625
|
(i) => {
|
|
2625
2626
|
(i == null || i === "") && t.value ? t.value = null : i !== t.value && (t.value = i);
|
|
2626
2627
|
}
|
|
2627
|
-
), (i,
|
|
2628
|
-
|
|
2628
|
+
), (i, n) => (h(), y("div", $o, [
|
|
2629
|
+
C(a) ? (h(), y("span", To, M(C(a)), 1)) : T("", !0),
|
|
2629
2630
|
S(pt, { class: "isolate" }, {
|
|
2630
2631
|
default: L(() => [
|
|
2631
|
-
(h(!0), y(D, null, B(e.config.options, (c) => (h(), H(
|
|
2632
|
+
(h(!0), y(D, null, B(e.config.options, (c) => (h(), H(G, {
|
|
2632
2633
|
key: c.value,
|
|
2633
2634
|
size: "xl",
|
|
2634
2635
|
"button-class": "px-3.5",
|
|
2635
|
-
variant:
|
|
2636
|
+
variant: r(c.value) ? "primary" : "secondary",
|
|
2636
2637
|
onClick: (d) => o(c.value)
|
|
2637
2638
|
}, {
|
|
2638
2639
|
default: L(() => [
|
|
2639
|
-
|
|
2640
|
+
E(M(c.label), 1)
|
|
2640
2641
|
]),
|
|
2641
2642
|
_: 2
|
|
2642
2643
|
}, 1032, ["variant", "onClick"]))), 128))
|
|
@@ -2645,7 +2646,7 @@ const qa = (e) => {
|
|
|
2645
2646
|
})
|
|
2646
2647
|
]));
|
|
2647
2648
|
}
|
|
2648
|
-
},
|
|
2649
|
+
}, Po = /* @__PURE__ */ oe(Lo, [["__scopeId", "data-v-01a49899"]]), Mo = { class: "spark-table-date-picker" }, Vo = {
|
|
2649
2650
|
__name: "SparkTableDatePicker",
|
|
2650
2651
|
props: {
|
|
2651
2652
|
/** SparkTable instance object */
|
|
@@ -2661,7 +2662,7 @@ const qa = (e) => {
|
|
|
2661
2662
|
}
|
|
2662
2663
|
},
|
|
2663
2664
|
setup(e) {
|
|
2664
|
-
const s = e, t = R(null), a = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`,
|
|
2665
|
+
const s = e, t = R(null), a = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`, r = R(`${l}-0`);
|
|
2665
2666
|
return s.sparkTable.params[l] ? t.value = s.sparkTable.params[l] : s.config.initialValue ? (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2666
2667
|
[l]: s.config.initialValue
|
|
2667
2668
|
})) : t.value = null, j(t, (o) => {
|
|
@@ -2674,20 +2675,20 @@ const qa = (e) => {
|
|
|
2674
2675
|
(o) => {
|
|
2675
2676
|
if ((o == null || o === "") && t.value) {
|
|
2676
2677
|
t.value = null;
|
|
2677
|
-
const i = parseInt(
|
|
2678
|
-
|
|
2678
|
+
const i = parseInt(r.value.split("-").pop()) || 0;
|
|
2679
|
+
r.value = `${l}-${i + 1}`;
|
|
2679
2680
|
} else o && o !== t.value && (t.value = o);
|
|
2680
2681
|
}
|
|
2681
2682
|
), (o, i) => {
|
|
2682
|
-
const
|
|
2683
|
-
return h(), y("div",
|
|
2684
|
-
(h(), H(
|
|
2685
|
-
key:
|
|
2683
|
+
const n = A("FormKit");
|
|
2684
|
+
return h(), y("div", Mo, [
|
|
2685
|
+
(h(), H(n, q({
|
|
2686
|
+
key: r.value,
|
|
2686
2687
|
modelValue: t.value,
|
|
2687
2688
|
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c),
|
|
2688
2689
|
type: "datepicker",
|
|
2689
2690
|
"picker-only": "",
|
|
2690
|
-
label:
|
|
2691
|
+
label: C(a),
|
|
2691
2692
|
placeholder: e.config.placeholder || "Select date",
|
|
2692
2693
|
overlay: !0,
|
|
2693
2694
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2698,7 +2699,7 @@ const qa = (e) => {
|
|
|
2698
2699
|
]);
|
|
2699
2700
|
};
|
|
2700
2701
|
}
|
|
2701
|
-
},
|
|
2702
|
+
}, Ho = /* @__PURE__ */ oe(Vo, [["__scopeId", "data-v-44ef9cb8"]]), Ro = { class: "spark-table-reset" }, Fo = { key: 1 }, Do = {
|
|
2702
2703
|
__name: "SparkTableReset",
|
|
2703
2704
|
props: {
|
|
2704
2705
|
/** SparkTable instance object */
|
|
@@ -2714,16 +2715,16 @@ const qa = (e) => {
|
|
|
2714
2715
|
},
|
|
2715
2716
|
setup(e) {
|
|
2716
2717
|
const s = e, t = () => {
|
|
2717
|
-
const a = s.sparkTable.plugins || {}, l = [],
|
|
2718
|
+
const a = s.sparkTable.plugins || {}, l = [], r = {};
|
|
2718
2719
|
Object.entries(a).forEach(([c, d]) => {
|
|
2719
2720
|
if (!d || d.type === "reset" || !(typeof d.enabled == "function" ? d.enabled(s.sparkTable.params) : d.enabled))
|
|
2720
2721
|
return;
|
|
2721
2722
|
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 ?
|
|
2723
|
+
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
2724
|
});
|
|
2724
2725
|
const o = l.filter(
|
|
2725
2726
|
(c) => s.sparkTable.params[c] !== void 0 && s.sparkTable.params[c] !== null && s.sparkTable.params[c] !== ""
|
|
2726
|
-
), i = Object.entries(
|
|
2727
|
+
), i = Object.entries(r).filter(
|
|
2727
2728
|
([c, d]) => s.sparkTable.params[c] !== d
|
|
2728
2729
|
);
|
|
2729
2730
|
if (o.length === 0 && i.length === 0)
|
|
@@ -2731,44 +2732,44 @@ const qa = (e) => {
|
|
|
2731
2732
|
o.forEach((c) => {
|
|
2732
2733
|
delete s.sparkTable.params[c];
|
|
2733
2734
|
});
|
|
2734
|
-
const
|
|
2735
|
-
s.sparkTable.methods.applyParams({ ...
|
|
2735
|
+
const n = Object.fromEntries(i);
|
|
2736
|
+
s.sparkTable.methods.applyParams({ ...n, page: 1 });
|
|
2736
2737
|
};
|
|
2737
2738
|
return (a, l) => {
|
|
2738
|
-
const
|
|
2739
|
-
return h(), y("div",
|
|
2740
|
-
S(
|
|
2739
|
+
const r = A("font-awesome-icon");
|
|
2740
|
+
return h(), y("div", Ro, [
|
|
2741
|
+
S(G, {
|
|
2741
2742
|
onClick: t,
|
|
2742
2743
|
variant: "secondary",
|
|
2743
2744
|
"button-class": "px-3.5",
|
|
2744
2745
|
size: "xl"
|
|
2745
2746
|
}, {
|
|
2746
2747
|
default: L(() => [
|
|
2747
|
-
e.config.icon ? (h(), H(
|
|
2748
|
+
e.config.icon ? (h(), H(r, {
|
|
2748
2749
|
key: 0,
|
|
2749
2750
|
icon: ["far", e.config.icon],
|
|
2750
2751
|
class: V({ "mr-1.5": e.config.label })
|
|
2751
2752
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2752
|
-
e.config.label ? (h(), y("span",
|
|
2753
|
+
e.config.label ? (h(), y("span", Fo, M(e.config.label), 1)) : T("", !0)
|
|
2753
2754
|
]),
|
|
2754
2755
|
_: 1
|
|
2755
2756
|
})
|
|
2756
2757
|
]);
|
|
2757
2758
|
};
|
|
2758
2759
|
}
|
|
2759
|
-
},
|
|
2760
|
+
}, Ao = /* @__PURE__ */ oe(Do, [["__scopeId", "data-v-0894e3bf"]]), Eo = { class: "spark-table" }, Io = {
|
|
2760
2761
|
key: 1,
|
|
2761
2762
|
class: "pt-5"
|
|
2762
|
-
},
|
|
2763
|
+
}, Oo = {
|
|
2763
2764
|
key: 2,
|
|
2764
2765
|
class: "flex flex-col items-center justify-center py-16 text-gray-500 rounded-md border border-gray-300 bg-white"
|
|
2765
|
-
},
|
|
2766
|
+
}, Bo = { class: "flex items-center gap-x-3 ml-auto" }, Se = {
|
|
2766
2767
|
perPages: [15, 30, 50, 100, 200, 500],
|
|
2767
2768
|
limit: 15
|
|
2768
|
-
},
|
|
2769
|
+
}, zo = {
|
|
2769
2770
|
page: 1,
|
|
2770
2771
|
limit: Se.limit
|
|
2771
|
-
},
|
|
2772
|
+
}, Ae = {
|
|
2772
2773
|
colHeaders: !0,
|
|
2773
2774
|
filters: !1,
|
|
2774
2775
|
stretchH: "all",
|
|
@@ -2778,7 +2779,7 @@ const qa = (e) => {
|
|
|
2778
2779
|
tableClassName: "spark-table-table",
|
|
2779
2780
|
readOnlyCellClassName: "read-only",
|
|
2780
2781
|
licenseKey: "non-commercial-and-evaluation"
|
|
2781
|
-
},
|
|
2782
|
+
}, tl = {
|
|
2782
2783
|
__name: "SparkTable",
|
|
2783
2784
|
props: {
|
|
2784
2785
|
url: {
|
|
@@ -2790,7 +2791,7 @@ const qa = (e) => {
|
|
|
2790
2791
|
dataTransformer: {
|
|
2791
2792
|
type: Function,
|
|
2792
2793
|
default: (e, s) => ({
|
|
2793
|
-
data: ee(s.settings, "nestedHeaders") ? e.data.data.map((a) => (s.settings.columnKeys || []).map((
|
|
2794
|
+
data: ee(s.settings, "nestedHeaders") ? e.data.data.map((a) => (s.settings.columnKeys || []).map((r) => a[r])) : e.data.data,
|
|
2794
2795
|
meta: {
|
|
2795
2796
|
last_page: e.data.last_page,
|
|
2796
2797
|
from: e.data.from,
|
|
@@ -2802,7 +2803,7 @@ const qa = (e) => {
|
|
|
2802
2803
|
params: {
|
|
2803
2804
|
type: Object,
|
|
2804
2805
|
default() {
|
|
2805
|
-
return
|
|
2806
|
+
return zo;
|
|
2806
2807
|
}
|
|
2807
2808
|
},
|
|
2808
2809
|
options: {
|
|
@@ -2814,7 +2815,7 @@ const qa = (e) => {
|
|
|
2814
2815
|
settings: {
|
|
2815
2816
|
type: Object,
|
|
2816
2817
|
default() {
|
|
2817
|
-
return
|
|
2818
|
+
return Ae;
|
|
2818
2819
|
}
|
|
2819
2820
|
},
|
|
2820
2821
|
plugins: {
|
|
@@ -2843,15 +2844,15 @@ const qa = (e) => {
|
|
|
2843
2844
|
],
|
|
2844
2845
|
setup(e, { expose: s, emit: t }) {
|
|
2845
2846
|
const a = e;
|
|
2846
|
-
|
|
2847
|
-
const l = t,
|
|
2847
|
+
gs(), me(ps), me(fs), me(ms), ee(a, "settings.nestedHeaders") && me(hs);
|
|
2848
|
+
const l = t, r = $e("axios"), o = R(null), i = R(!1), n = R(null);
|
|
2848
2849
|
let c = !1;
|
|
2849
2850
|
const d = {
|
|
2850
|
-
search:
|
|
2851
|
-
filterSelect:
|
|
2852
|
-
filterButtons:
|
|
2853
|
-
datePicker:
|
|
2854
|
-
reset:
|
|
2851
|
+
search: wo,
|
|
2852
|
+
filterSelect: So,
|
|
2853
|
+
filterButtons: Po,
|
|
2854
|
+
datePicker: Ho,
|
|
2855
|
+
reset: Ao
|
|
2855
2856
|
}, p = K({
|
|
2856
2857
|
hotInstance: null,
|
|
2857
2858
|
url: $(() => a.url),
|
|
@@ -2873,13 +2874,13 @@ const qa = (e) => {
|
|
|
2873
2874
|
},
|
|
2874
2875
|
loadTable: async (u) => {
|
|
2875
2876
|
if (!(!o.value || !o.value.hotInstance)) {
|
|
2876
|
-
i.value = !0,
|
|
2877
|
+
i.value = !0, n.value = null, l("loading", !0), ve.start(), p.hotInstance = o.value.hotInstance;
|
|
2877
2878
|
try {
|
|
2878
2879
|
if (a.dataProvider) {
|
|
2879
2880
|
const b = await a.dataProvider(p.computed.params);
|
|
2880
2881
|
p.response = a.dataTransformer(b, a);
|
|
2881
2882
|
} else if (a.url) {
|
|
2882
|
-
const b = await
|
|
2883
|
+
const b = await r.get(a.url, {
|
|
2883
2884
|
params: p.computed.params
|
|
2884
2885
|
});
|
|
2885
2886
|
p.response = a.dataTransformer(b, a);
|
|
@@ -2890,14 +2891,14 @@ const qa = (e) => {
|
|
|
2890
2891
|
if (c) return;
|
|
2891
2892
|
p.hotInstance.updateData(p.response.data), p.options.callback && typeof p.options.callback == "function" && await p.options.callback();
|
|
2892
2893
|
const g = p.hotInstance.getPlugin("autoColumnSize");
|
|
2893
|
-
ee(a.settings, "columns", []).forEach((b,
|
|
2894
|
-
b.width || g.calculateColumnsWidth(
|
|
2894
|
+
ee(a.settings, "columns", []).forEach((b, k) => {
|
|
2895
|
+
b.width || g.calculateColumnsWidth(k, k, !0);
|
|
2895
2896
|
}), l("load", {
|
|
2896
2897
|
data: p.response.data,
|
|
2897
2898
|
meta: p.response.meta
|
|
2898
2899
|
}), u && typeof u == "function" && u();
|
|
2899
2900
|
} catch (g) {
|
|
2900
|
-
|
|
2901
|
+
n.value = g, l("error", g), console.error("Error loading table data:", g);
|
|
2901
2902
|
} finally {
|
|
2902
2903
|
i.value = !1, l("loading", !1), ve.done();
|
|
2903
2904
|
}
|
|
@@ -2908,7 +2909,7 @@ const qa = (e) => {
|
|
|
2908
2909
|
fireEvent: (u, g) => {
|
|
2909
2910
|
l(u, g);
|
|
2910
2911
|
},
|
|
2911
|
-
getSettingsForProp: (u) =>
|
|
2912
|
+
getSettingsForProp: (u) => cs(ee(p.tableSettings, "columns"), { data: u }),
|
|
2912
2913
|
// Helper methods for easier param access
|
|
2913
2914
|
getParams: () => p.computed.params,
|
|
2914
2915
|
getParam: (u) => p.computed.params[u],
|
|
@@ -2917,8 +2918,8 @@ const qa = (e) => {
|
|
|
2917
2918
|
},
|
|
2918
2919
|
clearParam: (u) => p.methods.removeParam(u),
|
|
2919
2920
|
clearParams: (u) => {
|
|
2920
|
-
(Array.isArray(u) ? u : [u]).forEach((
|
|
2921
|
-
p.params[
|
|
2921
|
+
(Array.isArray(u) ? u : [u]).forEach((_) => {
|
|
2922
|
+
p.params[_] !== void 0 && delete p.params[_];
|
|
2922
2923
|
}), p.methods.applyParams({ page: 1 });
|
|
2923
2924
|
}
|
|
2924
2925
|
},
|
|
@@ -2927,20 +2928,20 @@ const qa = (e) => {
|
|
|
2927
2928
|
...a.params,
|
|
2928
2929
|
...p.params
|
|
2929
2930
|
})),
|
|
2930
|
-
ready: $(() =>
|
|
2931
|
+
ready: $(() => us(p, "response.meta.last_page"))
|
|
2931
2932
|
},
|
|
2932
2933
|
options: $(() => ({
|
|
2933
2934
|
...Se,
|
|
2934
2935
|
...a.options
|
|
2935
2936
|
})),
|
|
2936
2937
|
tableSettings: $(() => ({
|
|
2937
|
-
...
|
|
2938
|
+
...Ae,
|
|
2938
2939
|
nestedHeaders: ee(a.settings, "nestedHeaders", []),
|
|
2939
2940
|
...!ee(a.settings, "nestedHeaders") && {
|
|
2940
|
-
afterGetColHeader: (u, g) =>
|
|
2941
|
+
afterGetColHeader: (u, g) => Fa(u, g, p)
|
|
2941
2942
|
},
|
|
2942
|
-
afterChange: (u, g) =>
|
|
2943
|
-
afterRender: () =>
|
|
2943
|
+
afterChange: (u, g) => so(),
|
|
2944
|
+
afterRender: () => Da(p),
|
|
2944
2945
|
/**
|
|
2945
2946
|
* Prevent columns with explicit width from being stretched
|
|
2946
2947
|
* This hook fires BEFORE stretchH is applied, allowing us to cap specific columns
|
|
@@ -2955,13 +2956,13 @@ const qa = (e) => {
|
|
|
2955
2956
|
* This ensures custom renderers copy their visual output, not the underlying data
|
|
2956
2957
|
*/
|
|
2957
2958
|
beforeCopy: (u, g) => {
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2960
|
-
for (let
|
|
2959
|
+
const _ = o.value?.hotInstance;
|
|
2960
|
+
_ && g.forEach((b) => {
|
|
2961
|
+
for (let k = b.startRow; k <= b.endRow; k++)
|
|
2961
2962
|
for (let P = b.startCol; P <= b.endCol; P++) {
|
|
2962
|
-
const I =
|
|
2963
|
+
const I = _.getCell(k, P);
|
|
2963
2964
|
if (I) {
|
|
2964
|
-
const Y =
|
|
2965
|
+
const Y = k - g[0].startRow, fe = P - g[0].startCol;
|
|
2965
2966
|
u[Y][fe] = I.dataset.copyValue ?? I.textContent ?? "";
|
|
2966
2967
|
}
|
|
2967
2968
|
}
|
|
@@ -2971,7 +2972,7 @@ const qa = (e) => {
|
|
|
2971
2972
|
}))
|
|
2972
2973
|
}), f = $(
|
|
2973
2974
|
() => p.computed.ready && p.response.data?.length === 0
|
|
2974
|
-
),
|
|
2975
|
+
), x = (u) => {
|
|
2975
2976
|
if (!u) return null;
|
|
2976
2977
|
switch (u.type) {
|
|
2977
2978
|
case "search":
|
|
@@ -2983,16 +2984,16 @@ const qa = (e) => {
|
|
|
2983
2984
|
default:
|
|
2984
2985
|
return null;
|
|
2985
2986
|
}
|
|
2986
|
-
},
|
|
2987
|
+
}, 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
2988
|
if (j(
|
|
2988
2989
|
() => ({ ...p.params }),
|
|
2989
2990
|
() => {
|
|
2990
2991
|
const u = [];
|
|
2991
2992
|
Object.values(a.plugins).forEach((g) => {
|
|
2992
|
-
const
|
|
2993
|
-
if (!
|
|
2994
|
-
const b =
|
|
2995
|
-
!b &&
|
|
2993
|
+
const _ = x(g);
|
|
2994
|
+
if (!_) return;
|
|
2995
|
+
const b = w(g), k = p.params[_] !== void 0;
|
|
2996
|
+
!b && k && u.push(_);
|
|
2996
2997
|
}), u.length > 0 && u.forEach((g) => {
|
|
2997
2998
|
delete p.params[g];
|
|
2998
2999
|
});
|
|
@@ -3000,7 +3001,7 @@ const qa = (e) => {
|
|
|
3000
3001
|
{ deep: !0, flush: "sync" }
|
|
3001
3002
|
), a.syncToRoute || a.persistToStorage) {
|
|
3002
3003
|
const u = typeof a.syncToRoute == "string";
|
|
3003
|
-
|
|
3004
|
+
ao(p, {
|
|
3004
3005
|
namespace: u ? a.syncToRoute : null,
|
|
3005
3006
|
syncToRoute: !!a.syncToRoute,
|
|
3006
3007
|
persistToStorage: a.persistToStorage
|
|
@@ -3027,7 +3028,7 @@ const qa = (e) => {
|
|
|
3027
3028
|
await p.methods.loadTable(), l("ready");
|
|
3028
3029
|
}), ze(() => {
|
|
3029
3030
|
c = !0;
|
|
3030
|
-
}),
|
|
3031
|
+
}), to(p), s({
|
|
3031
3032
|
refresh: () => p.methods.loadTable(),
|
|
3032
3033
|
getParams: () => p.methods.getParams(),
|
|
3033
3034
|
getParam: (u) => p.methods.getParam(u),
|
|
@@ -3036,11 +3037,11 @@ const qa = (e) => {
|
|
|
3036
3037
|
clearParams: (u) => p.methods.clearParams(u),
|
|
3037
3038
|
applyParams: (u) => p.methods.applyParams(u),
|
|
3038
3039
|
loading: i,
|
|
3039
|
-
error:
|
|
3040
|
+
error: n,
|
|
3040
3041
|
sparkTable: p,
|
|
3041
3042
|
table: o
|
|
3042
3043
|
}), (u, g) => {
|
|
3043
|
-
const
|
|
3044
|
+
const _ = A("font-awesome-icon");
|
|
3044
3045
|
return h(), y("div", Eo, [
|
|
3045
3046
|
p.computed.ready && v.value && v.value.length ? (h(), H(De, {
|
|
3046
3047
|
key: 0,
|
|
@@ -3056,12 +3057,12 @@ const qa = (e) => {
|
|
|
3056
3057
|
O(u.$slots, "header", {
|
|
3057
3058
|
sparkTable: p,
|
|
3058
3059
|
loading: i.value,
|
|
3059
|
-
error:
|
|
3060
|
+
error: n.value
|
|
3060
3061
|
})
|
|
3061
3062
|
]),
|
|
3062
3063
|
_: 3
|
|
3063
|
-
})) : (h(), y("div",
|
|
3064
|
-
bt(S(
|
|
3064
|
+
})) : (h(), y("div", Io)),
|
|
3065
|
+
bt(S(C(ds), {
|
|
3065
3066
|
"theme-name": "ht-theme-classic",
|
|
3066
3067
|
ref_key: "table",
|
|
3067
3068
|
ref: o,
|
|
@@ -3069,9 +3070,9 @@ const qa = (e) => {
|
|
|
3069
3070
|
}, null, 8, ["settings"]), [
|
|
3070
3071
|
[xt, !f.value]
|
|
3071
3072
|
]),
|
|
3072
|
-
f.value ? (h(), y("div",
|
|
3073
|
-
S(
|
|
3074
|
-
icon:
|
|
3073
|
+
f.value ? (h(), y("div", Oo, [
|
|
3074
|
+
S(_, {
|
|
3075
|
+
icon: C(F).farInbox,
|
|
3075
3076
|
class: "size-12 mb-4 text-gray-300"
|
|
3076
3077
|
}, null, 8, ["icon"]),
|
|
3077
3078
|
g[0] || (g[0] = m("p", { class: "text-sm" }, "No records found", -1))
|
|
@@ -3081,24 +3082,24 @@ const qa = (e) => {
|
|
|
3081
3082
|
position: "footer"
|
|
3082
3083
|
}, {
|
|
3083
3084
|
default: L(() => [
|
|
3084
|
-
f.value ? T("", !0) : (h(), H(
|
|
3085
|
+
f.value ? T("", !0) : (h(), H(uo, {
|
|
3085
3086
|
key: 0,
|
|
3086
3087
|
"spark-table": p
|
|
3087
3088
|
}, null, 8, ["spark-table"])),
|
|
3088
|
-
m("div",
|
|
3089
|
-
f.value ? T("", !0) : (h(), H(
|
|
3089
|
+
m("div", Bo, [
|
|
3090
|
+
f.value ? T("", !0) : (h(), H(go, {
|
|
3090
3091
|
key: 0,
|
|
3091
3092
|
"spark-table": p,
|
|
3092
3093
|
onPaginate: p.methods.applyParams
|
|
3093
3094
|
}, null, 8, ["spark-table", "onPaginate"])),
|
|
3094
|
-
S(
|
|
3095
|
+
S(bo, {
|
|
3095
3096
|
"spark-table": p,
|
|
3096
3097
|
onPaginate: p.methods.applyParams
|
|
3097
3098
|
}, null, 8, ["spark-table", "onPaginate"]),
|
|
3098
3099
|
O(u.$slots, "footer", {
|
|
3099
3100
|
sparkTable: p,
|
|
3100
3101
|
loading: i.value,
|
|
3101
|
-
error:
|
|
3102
|
+
error: n.value
|
|
3102
3103
|
})
|
|
3103
3104
|
])
|
|
3104
3105
|
]),
|
|
@@ -3108,7 +3109,7 @@ const qa = (e) => {
|
|
|
3108
3109
|
};
|
|
3109
3110
|
}
|
|
3110
3111
|
};
|
|
3111
|
-
function
|
|
3112
|
+
function Ee() {
|
|
3112
3113
|
const e = K({
|
|
3113
3114
|
isVisible: !1,
|
|
3114
3115
|
content: null,
|
|
@@ -3121,8 +3122,8 @@ function Ae() {
|
|
|
3121
3122
|
e.isVisible = !1, e.content = null, e.props = {}, e.eventHandlers = {}, e.size = "md";
|
|
3122
3123
|
}, a = () => {
|
|
3123
3124
|
e.isVisible = !0;
|
|
3124
|
-
}, l = (o, i = {},
|
|
3125
|
-
e.content = ce(o), e.props = i, e.eventHandlers =
|
|
3125
|
+
}, l = (o, i = {}, n = {}, c = {}) => {
|
|
3126
|
+
e.content = ce(o), e.props = i, e.eventHandlers = n, e.size = c.size || "md";
|
|
3126
3127
|
};
|
|
3127
3128
|
return {
|
|
3128
3129
|
state: e,
|
|
@@ -3130,32 +3131,32 @@ function Ae() {
|
|
|
3130
3131
|
close: t,
|
|
3131
3132
|
open: a,
|
|
3132
3133
|
setContent: l,
|
|
3133
|
-
show: (o, i = {},
|
|
3134
|
-
o && l(o, i,
|
|
3134
|
+
show: (o, i = {}, n = {}, c = {}) => {
|
|
3135
|
+
o && l(o, i, n, c), a();
|
|
3135
3136
|
}
|
|
3136
3137
|
};
|
|
3137
3138
|
}
|
|
3138
|
-
class
|
|
3139
|
+
class jo {
|
|
3139
3140
|
constructor() {
|
|
3140
|
-
this.left =
|
|
3141
|
+
this.left = Ee(), this.right = Ee();
|
|
3141
3142
|
}
|
|
3142
3143
|
showLeft = (s, t = {}, a = {}, l = {}) => {
|
|
3143
|
-
const
|
|
3144
|
+
const r = {
|
|
3144
3145
|
close: () => {
|
|
3145
3146
|
a.close?.(), this.closeLeft();
|
|
3146
3147
|
},
|
|
3147
3148
|
...a
|
|
3148
3149
|
};
|
|
3149
|
-
this.left.show(s, t,
|
|
3150
|
+
this.left.show(s, t, r, l);
|
|
3150
3151
|
};
|
|
3151
3152
|
showRight = (s, t = {}, a = {}, l = {}) => {
|
|
3152
|
-
const
|
|
3153
|
+
const r = {
|
|
3153
3154
|
close: () => {
|
|
3154
3155
|
a.close?.(), this.closeRight();
|
|
3155
3156
|
},
|
|
3156
3157
|
...a
|
|
3157
3158
|
};
|
|
3158
|
-
this.right.show(s, t,
|
|
3159
|
+
this.right.show(s, t, r, l);
|
|
3159
3160
|
};
|
|
3160
3161
|
closeLeft = () => {
|
|
3161
3162
|
this.left.close();
|
|
@@ -3167,21 +3168,21 @@ class zo {
|
|
|
3167
3168
|
this.left.close(), this.right.close();
|
|
3168
3169
|
};
|
|
3169
3170
|
}
|
|
3170
|
-
const ae = new
|
|
3171
|
+
const ae = new jo(), No = (e) => {
|
|
3171
3172
|
const s = document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));
|
|
3172
3173
|
return s ? s[2] : null;
|
|
3173
|
-
},
|
|
3174
|
+
}, Zo = (e, s, t = {}) => {
|
|
3174
3175
|
const {
|
|
3175
3176
|
maxAge: a = 31536e3,
|
|
3176
3177
|
// 365 days in seconds
|
|
3177
3178
|
domain: l = ft(),
|
|
3178
|
-
secure:
|
|
3179
|
+
secure: r = !0,
|
|
3179
3180
|
sameSite: o = "Lax",
|
|
3180
3181
|
path: i = "/"
|
|
3181
3182
|
} = t;
|
|
3182
|
-
let
|
|
3183
|
-
l && (
|
|
3184
|
-
},
|
|
3183
|
+
let n = `${e}=${s}; max-age=${a}; path=${i}; samesite=${o}`;
|
|
3184
|
+
l && (n += `; domain=${l}`), r && (n += "; secure"), document.cookie = n;
|
|
3185
|
+
}, qo = (e, s = {}) => {
|
|
3185
3186
|
const { domain: t = ft(), path: a = "/" } = s;
|
|
3186
3187
|
let l = `${e}=; max-age=0; path=${a}`;
|
|
3187
3188
|
t && (l += `; domain=${t}`), document.cookie = l;
|
|
@@ -3189,15 +3190,15 @@ const ae = new zo(), jo = (e) => {
|
|
|
3189
3190
|
const e = window.location.hostname;
|
|
3190
3191
|
return e === "localhost" ? "localhost" : e.endsWith(".test") || e.endsWith(".io") ? "." + e.split(".").slice(-2).join(".") : e.endsWith(".com.au") ? "." + e.split(".").slice(-3).join(".") : e;
|
|
3191
3192
|
}, mt = [];
|
|
3192
|
-
function
|
|
3193
|
+
function Uo(e) {
|
|
3193
3194
|
mt.push(e);
|
|
3194
3195
|
}
|
|
3195
|
-
function
|
|
3196
|
+
function Ko() {
|
|
3196
3197
|
mt.forEach((e) => e());
|
|
3197
3198
|
}
|
|
3198
|
-
function
|
|
3199
|
+
function sl(e) {
|
|
3199
3200
|
let s = !1;
|
|
3200
|
-
return
|
|
3201
|
+
return Uo(() => {
|
|
3201
3202
|
s = !1;
|
|
3202
3203
|
}), {
|
|
3203
3204
|
bootstrapApp: async () => {
|
|
@@ -3246,10 +3247,10 @@ const ke = "bolt-next-token", Q = pe("auth", () => {
|
|
|
3246
3247
|
}), s = (c = {}) => {
|
|
3247
3248
|
c.endpoints && Object.assign(e.endpoints, c.endpoints), c.routes && Object.assign(e.routes, c.routes), c.devCredentials && Object.assign(e.devCredentials, c.devCredentials), c.callbacks && Object.assign(e.callbacks, c.callbacks), c.overrideToken && (e.overrideToken = c.overrideToken);
|
|
3248
3249
|
}, t = (c) => {
|
|
3249
|
-
|
|
3250
|
+
Zo(ke, c), e.token = c;
|
|
3250
3251
|
}, a = () => {
|
|
3251
|
-
|
|
3252
|
-
}, l = () =>
|
|
3252
|
+
qo(ke), e.token = null;
|
|
3253
|
+
}, l = () => No(ke), r = async (c) => {
|
|
3253
3254
|
const d = await le.post(e.endpoints.login, c), p = d.headers.authorization;
|
|
3254
3255
|
return t(p), e.user = d.data, e.callbacks.onLoginSuccess && await e.callbacks.onLoginSuccess(d.data), d.data;
|
|
3255
3256
|
}, o = async () => {
|
|
@@ -3266,7 +3267,7 @@ const ke = "bolt-next-token", Q = pe("auth", () => {
|
|
|
3266
3267
|
} catch (c) {
|
|
3267
3268
|
throw e.callbacks.onLogoutError && await e.callbacks.onLogoutError(c), c;
|
|
3268
3269
|
} finally {
|
|
3269
|
-
a(), e.user = null,
|
|
3270
|
+
a(), e.user = null, Ko();
|
|
3270
3271
|
}
|
|
3271
3272
|
}, i = async () => {
|
|
3272
3273
|
const c = e.overrideToken || l();
|
|
@@ -3284,20 +3285,20 @@ const ke = "bolt-next-token", Q = pe("auth", () => {
|
|
|
3284
3285
|
} finally {
|
|
3285
3286
|
e.ready = !0;
|
|
3286
3287
|
}
|
|
3287
|
-
},
|
|
3288
|
+
}, n = $(() => e.overrideToken ? !0 : !!e.token && !!e.user);
|
|
3288
3289
|
return {
|
|
3289
3290
|
state: e,
|
|
3290
3291
|
initialize: s,
|
|
3291
|
-
login:
|
|
3292
|
+
login: r,
|
|
3292
3293
|
logout: o,
|
|
3293
3294
|
fetchUser: i,
|
|
3294
|
-
check:
|
|
3295
|
+
check: n,
|
|
3295
3296
|
setTokenCookie: t,
|
|
3296
3297
|
clearTokenCookie: a,
|
|
3297
3298
|
getTokenCookie: l
|
|
3298
3299
|
};
|
|
3299
3300
|
});
|
|
3300
|
-
function
|
|
3301
|
+
function Wo(e = {}) {
|
|
3301
3302
|
const s = le.create({
|
|
3302
3303
|
baseURL: e.baseURL || "",
|
|
3303
3304
|
timeout: e.timeout || 3e4,
|
|
@@ -3338,89 +3339,89 @@ function Ko(e = {}) {
|
|
|
3338
3339
|
), s;
|
|
3339
3340
|
}
|
|
3340
3341
|
let ne = null;
|
|
3341
|
-
function
|
|
3342
|
-
return ne =
|
|
3342
|
+
function al(e, s = {}) {
|
|
3343
|
+
return ne = Wo(s), e.provide("axios", ne), e.config.globalProperties.$axios = ne, ne;
|
|
3343
3344
|
}
|
|
3344
3345
|
function Go() {
|
|
3345
3346
|
if (!ne)
|
|
3346
3347
|
throw new Error("Axios instance not initialized. Call setupAxios() first.");
|
|
3347
3348
|
return ne;
|
|
3348
3349
|
}
|
|
3349
|
-
function
|
|
3350
|
+
function Yo(e) {
|
|
3350
3351
|
return e?.status !== 422 ? null : e.data?.errors || null;
|
|
3351
3352
|
}
|
|
3352
3353
|
function Ie(e) {
|
|
3353
3354
|
return e?.status === 422 ? e.data?.message || "Please fix the validation errors." : e?.data?.message || "An error occurred.";
|
|
3354
3355
|
}
|
|
3355
|
-
function
|
|
3356
|
+
function Xo(e) {
|
|
3356
3357
|
return e?.status === 422;
|
|
3357
3358
|
}
|
|
3358
|
-
function
|
|
3359
|
+
function ol(e = {}) {
|
|
3359
3360
|
const {
|
|
3360
3361
|
successMessage: s = "Saved successfully!",
|
|
3361
3362
|
createMessage: t = "Created successfully!",
|
|
3362
3363
|
updateMessage: a = "Updated successfully!",
|
|
3363
3364
|
redirectTo: l = null,
|
|
3364
|
-
onSuccess:
|
|
3365
|
+
onSuccess: r = null,
|
|
3365
3366
|
onError: o = null,
|
|
3366
3367
|
showNotification: i = !0,
|
|
3367
|
-
setFieldErrors:
|
|
3368
|
+
setFieldErrors: n = !0,
|
|
3368
3369
|
setFormErrors: c = !1
|
|
3369
|
-
} = e, d =
|
|
3370
|
-
async function f(
|
|
3371
|
-
const { submitFn: v, method: u = "create", node: g = null, isEditMode:
|
|
3370
|
+
} = e, d = W(), p = R(!1);
|
|
3371
|
+
async function f(w) {
|
|
3372
|
+
const { submitFn: v, method: u = "create", node: g = null, isEditMode: _ = !1 } = w;
|
|
3372
3373
|
p.value = !0, g && g.clearErrors();
|
|
3373
3374
|
try {
|
|
3374
|
-
const
|
|
3375
|
+
const k = (await v()).data;
|
|
3375
3376
|
if (i) {
|
|
3376
|
-
const P =
|
|
3377
|
+
const P = _ ? a : u === "create" ? t : s;
|
|
3377
3378
|
z.show({
|
|
3378
3379
|
type: "success",
|
|
3379
3380
|
message: P
|
|
3380
3381
|
});
|
|
3381
3382
|
}
|
|
3382
|
-
if (
|
|
3383
|
-
const P = typeof l == "function" ? l(
|
|
3383
|
+
if (r && await r(k), !_ && l) {
|
|
3384
|
+
const P = typeof l == "function" ? l(k) : l;
|
|
3384
3385
|
await d.push(P);
|
|
3385
3386
|
}
|
|
3386
|
-
return { success: !0, data:
|
|
3387
|
+
return { success: !0, data: k, error: null };
|
|
3387
3388
|
} catch (b) {
|
|
3388
|
-
const
|
|
3389
|
+
const k = b.response;
|
|
3389
3390
|
if (o && await o(b) === !0)
|
|
3390
3391
|
return { success: !1, data: null, error: b };
|
|
3391
|
-
if (
|
|
3392
|
-
const P =
|
|
3393
|
-
P && g &&
|
|
3392
|
+
if (Xo(k)) {
|
|
3393
|
+
const P = Yo(k);
|
|
3394
|
+
P && g && n && g.setErrors([], P), c && z.show({
|
|
3394
3395
|
type: "danger",
|
|
3395
|
-
message: Ie(
|
|
3396
|
+
message: Ie(k)
|
|
3396
3397
|
});
|
|
3397
3398
|
} else
|
|
3398
3399
|
z.show({
|
|
3399
3400
|
type: "danger",
|
|
3400
|
-
message: Ie(
|
|
3401
|
+
message: Ie(k)
|
|
3401
3402
|
});
|
|
3402
3403
|
return { success: !1, data: null, error: b };
|
|
3403
3404
|
} finally {
|
|
3404
3405
|
p.value = !1;
|
|
3405
3406
|
}
|
|
3406
3407
|
}
|
|
3407
|
-
async function w
|
|
3408
|
-
const { url: v, payload: u, method: g = "post", node:
|
|
3408
|
+
async function x(w) {
|
|
3409
|
+
const { url: v, payload: u, method: g = "post", node: _, isEditMode: b } = w, k = Go();
|
|
3409
3410
|
return f({
|
|
3410
|
-
submitFn: () =>
|
|
3411
|
+
submitFn: () => k[g](v, u),
|
|
3411
3412
|
method: b ? "update" : "create",
|
|
3412
|
-
node:
|
|
3413
|
+
node: _,
|
|
3413
3414
|
isEditMode: b
|
|
3414
3415
|
});
|
|
3415
3416
|
}
|
|
3416
3417
|
return {
|
|
3417
3418
|
submitting: p,
|
|
3418
3419
|
submit: f,
|
|
3419
|
-
submitToApi:
|
|
3420
|
+
submitToApi: x
|
|
3420
3421
|
};
|
|
3421
3422
|
}
|
|
3422
|
-
function
|
|
3423
|
-
const { items: s = [], defaultId: t = null } = e, a =
|
|
3423
|
+
function rl(e = {}) {
|
|
3424
|
+
const { items: s = [], defaultId: t = null } = e, a = W(), l = se(), r = R(s.map(o));
|
|
3424
3425
|
function o(u) {
|
|
3425
3426
|
return {
|
|
3426
3427
|
id: u.id,
|
|
@@ -3439,106 +3440,106 @@ function ol(e = {}) {
|
|
|
3439
3440
|
function i(u) {
|
|
3440
3441
|
return typeof u == "function" ? u() : u;
|
|
3441
3442
|
}
|
|
3442
|
-
const
|
|
3443
|
+
const n = $(() => r.value.filter((u) => !i(u.hidden)));
|
|
3443
3444
|
function c(u) {
|
|
3444
|
-
const g = typeof u == "string" ?
|
|
3445
|
+
const g = typeof u == "string" ? r.value.find((_) => _.id === u) : u;
|
|
3445
3446
|
return g ? i(g.disabled) : !1;
|
|
3446
3447
|
}
|
|
3447
3448
|
function d(u) {
|
|
3448
|
-
const g = typeof u == "string" ?
|
|
3449
|
+
const g = typeof u == "string" ? r.value.find((b) => b.id === u) : u;
|
|
3449
3450
|
if (!g || !g.route) return !1;
|
|
3450
|
-
const
|
|
3451
|
-
if (
|
|
3451
|
+
const _ = typeof g.route == "string" ? { name: g.route } : g.route;
|
|
3452
|
+
if (_.name && l.name === _.name)
|
|
3452
3453
|
return !0;
|
|
3453
|
-
if (
|
|
3454
|
-
const b = a.resolve(
|
|
3454
|
+
if (_.path) {
|
|
3455
|
+
const b = a.resolve(_);
|
|
3455
3456
|
return l.path === b.path;
|
|
3456
3457
|
}
|
|
3457
3458
|
return !1;
|
|
3458
3459
|
}
|
|
3459
3460
|
const p = $(() => {
|
|
3460
|
-
const u =
|
|
3461
|
-
return u || (t ?
|
|
3461
|
+
const u = n.value.find((g) => d(g));
|
|
3462
|
+
return u || (t ? n.value.find((g) => g.id === t) || n.value[0] : n.value[0] || null);
|
|
3462
3463
|
}), f = $(() => p.value?.id || null);
|
|
3463
|
-
async function
|
|
3464
|
-
const g = typeof u == "string" ?
|
|
3464
|
+
async function x(u) {
|
|
3465
|
+
const g = typeof u == "string" ? r.value.find((_) => _.id === u) : u;
|
|
3465
3466
|
if (!g)
|
|
3466
3467
|
return console.warn(`[useSubNavigation] Item not found: ${u}`), !1;
|
|
3467
3468
|
if (c(g))
|
|
3468
3469
|
return !1;
|
|
3469
3470
|
if (g.route) {
|
|
3470
|
-
const
|
|
3471
|
-
return await a.push(
|
|
3471
|
+
const _ = typeof g.route == "string" ? { name: g.route } : g.route;
|
|
3472
|
+
return await a.push(_), !0;
|
|
3472
3473
|
}
|
|
3473
3474
|
if (g.overlay) {
|
|
3474
|
-
const { component:
|
|
3475
|
-
return ae[P === "left" ? "showLeft" : "showRight"](ce(
|
|
3475
|
+
const { component: _, props: b = {}, eventHandlers: k = {}, position: P = "right", size: I } = g.overlay;
|
|
3476
|
+
return ae[P === "left" ? "showLeft" : "showRight"](ce(_), b, k, { size: I }), !0;
|
|
3476
3477
|
}
|
|
3477
3478
|
if (g.modal) {
|
|
3478
|
-
const { component:
|
|
3479
|
-
return J.show(ce(
|
|
3479
|
+
const { component: _, props: b = {}, eventHandlers: k = {} } = g.modal;
|
|
3480
|
+
return J.show(ce(_), b, k), !0;
|
|
3480
3481
|
}
|
|
3481
3482
|
if (g.action) {
|
|
3482
|
-
const
|
|
3483
|
-
return
|
|
3483
|
+
const _ = g.action(g);
|
|
3484
|
+
return _ instanceof Promise && await _, !0;
|
|
3484
3485
|
}
|
|
3485
3486
|
return !1;
|
|
3486
3487
|
}
|
|
3487
|
-
function
|
|
3488
|
-
|
|
3488
|
+
function w(u) {
|
|
3489
|
+
r.value = u.map(o);
|
|
3489
3490
|
}
|
|
3490
3491
|
function v(u, g) {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3492
|
+
const _ = r.value.findIndex((b) => b.id === u);
|
|
3493
|
+
_ !== -1 && (r.value[_] = o({ ...r.value[_], ...g }));
|
|
3493
3494
|
}
|
|
3494
3495
|
return {
|
|
3495
|
-
items:
|
|
3496
|
-
visibleItems:
|
|
3496
|
+
items: r,
|
|
3497
|
+
visibleItems: n,
|
|
3497
3498
|
activeItem: p,
|
|
3498
3499
|
activeId: f,
|
|
3499
|
-
navigateTo:
|
|
3500
|
+
navigateTo: x,
|
|
3500
3501
|
isActive: d,
|
|
3501
3502
|
isDisabled: c,
|
|
3502
|
-
setItems:
|
|
3503
|
+
setItems: w,
|
|
3503
3504
|
updateItem: v
|
|
3504
3505
|
};
|
|
3505
3506
|
}
|
|
3506
3507
|
const ie = /* @__PURE__ */ new Map();
|
|
3507
|
-
let
|
|
3508
|
-
function
|
|
3508
|
+
let Jo = 0;
|
|
3509
|
+
function Qo() {
|
|
3509
3510
|
for (const e of ie.values())
|
|
3510
3511
|
if (e.isDirty)
|
|
3511
3512
|
return !0;
|
|
3512
3513
|
return !1;
|
|
3513
3514
|
}
|
|
3514
|
-
function
|
|
3515
|
+
function er() {
|
|
3515
3516
|
for (const e of ie.values())
|
|
3516
3517
|
if (e.isDirty && e.message)
|
|
3517
3518
|
return e.message;
|
|
3518
3519
|
return null;
|
|
3519
3520
|
}
|
|
3520
|
-
function
|
|
3521
|
+
function tr() {
|
|
3521
3522
|
for (const e of ie.values())
|
|
3522
3523
|
e.isDirty = !1;
|
|
3523
3524
|
}
|
|
3524
|
-
function
|
|
3525
|
+
function nl(e = {}) {
|
|
3525
3526
|
const {
|
|
3526
3527
|
message: s = "You have unsaved changes. Leave anyway?",
|
|
3527
3528
|
title: t = "Unsaved Changes",
|
|
3528
3529
|
confirmText: a = "Leave",
|
|
3529
3530
|
cancelText: l = "Stay",
|
|
3530
|
-
useRouteGuard:
|
|
3531
|
-
} = e, o = `form-${++
|
|
3531
|
+
useRouteGuard: r = !0
|
|
3532
|
+
} = e, o = `form-${++Jo}`, i = R(!1);
|
|
3532
3533
|
ie.set(o, {
|
|
3533
3534
|
isDirty: !1,
|
|
3534
3535
|
message: s
|
|
3535
3536
|
});
|
|
3536
|
-
const
|
|
3537
|
+
const n = (v = !0) => {
|
|
3537
3538
|
i.value = v;
|
|
3538
3539
|
const u = ie.get(o);
|
|
3539
3540
|
u && (u.isDirty = v);
|
|
3540
3541
|
}, c = () => {
|
|
3541
|
-
|
|
3542
|
+
n(!1);
|
|
3542
3543
|
}, d = async (v = {}) => {
|
|
3543
3544
|
if (!i.value)
|
|
3544
3545
|
return !0;
|
|
@@ -3555,38 +3556,38 @@ function rl(e = {}) {
|
|
|
3555
3556
|
const f = (v) => {
|
|
3556
3557
|
if (i.value)
|
|
3557
3558
|
return v.preventDefault(), v.returnValue = "", "";
|
|
3558
|
-
},
|
|
3559
|
+
}, x = () => {
|
|
3559
3560
|
p || (window.addEventListener("beforeunload", f), p = !0);
|
|
3560
|
-
},
|
|
3561
|
+
}, w = () => {
|
|
3561
3562
|
p && (window.removeEventListener("beforeunload", f), p = !1);
|
|
3562
3563
|
};
|
|
3563
|
-
return
|
|
3564
|
-
ie.delete(o),
|
|
3564
|
+
return r && ls(async () => await d()), ze(() => {
|
|
3565
|
+
ie.delete(o), w();
|
|
3565
3566
|
}), {
|
|
3566
3567
|
isDirty: i,
|
|
3567
|
-
setDirty:
|
|
3568
|
+
setDirty: n,
|
|
3568
3569
|
setClean: c,
|
|
3569
3570
|
checkDirty: d,
|
|
3570
|
-
enableBrowserWarning:
|
|
3571
|
-
disableBrowserWarning:
|
|
3571
|
+
enableBrowserWarning: x,
|
|
3572
|
+
disableBrowserWarning: w
|
|
3572
3573
|
};
|
|
3573
3574
|
}
|
|
3574
|
-
const
|
|
3575
|
+
const sr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, ar = { class: "flex flex-1 flex-col" }, or = {
|
|
3575
3576
|
class: "flex flex-1 flex-col gap-y-7",
|
|
3576
3577
|
role: "list"
|
|
3577
|
-
},
|
|
3578
|
+
}, rr = { class: "flex flex-1 flex-col" }, nr = {
|
|
3578
3579
|
role: "list",
|
|
3579
3580
|
class: "flex flex-1 flex-col"
|
|
3580
|
-
},
|
|
3581
|
+
}, lr = { class: "flex items-center pb-8" }, ir = ["href", "onClick"], cr = {
|
|
3581
3582
|
key: 2,
|
|
3582
3583
|
class: "w-full flex justify-center"
|
|
3583
|
-
},
|
|
3584
|
+
}, ur = {
|
|
3584
3585
|
key: 0,
|
|
3585
3586
|
class: "mt-[5px] flex flex-col gap-[5px]"
|
|
3586
|
-
},
|
|
3587
|
+
}, dr = ["href", "onClick"], pr = {
|
|
3587
3588
|
key: 1,
|
|
3588
3589
|
class: "text-[13px]"
|
|
3589
|
-
},
|
|
3590
|
+
}, fr = { class: "mt-auto" }, mr = { class: "p-[10px] flex-shrink-0" }, hr = { class: "flex flex-1 items-center gap-x-6" }, gr = { class: "relative flex flex-1 items-center gap-4" }, yr = { class: "cursor-pointer" }, vr = ["src"], br = { class: "ml-auto" }, xr = { class: "mr-[10px] pb-[10px] flex-1 flex flex-col" }, ll = {
|
|
3590
3591
|
__name: "SparkDefaultContainer",
|
|
3591
3592
|
props: {
|
|
3592
3593
|
appStore: {
|
|
@@ -3604,113 +3605,113 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3604
3605
|
},
|
|
3605
3606
|
emits: ["overlayClose"],
|
|
3606
3607
|
setup(e, { emit: s }) {
|
|
3607
|
-
const t = e, a = s, l = Be(),
|
|
3608
|
-
const
|
|
3609
|
-
l["app-selector-bottom"] ?
|
|
3610
|
-
select: (
|
|
3608
|
+
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 = () => {
|
|
3609
|
+
const v = {};
|
|
3610
|
+
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(Bs, v, {
|
|
3611
|
+
select: (u) => {
|
|
3611
3612
|
ae.closeRight();
|
|
3612
3613
|
}
|
|
3613
3614
|
});
|
|
3614
|
-
},
|
|
3615
|
+
}, f = () => {
|
|
3615
3616
|
ae.showLeft(
|
|
3616
|
-
|
|
3617
|
+
ca,
|
|
3617
3618
|
{},
|
|
3618
3619
|
{
|
|
3619
|
-
select: (
|
|
3620
|
-
|
|
3620
|
+
select: (v) => {
|
|
3621
|
+
i.toggleBrand(v), ae.closeLeft();
|
|
3621
3622
|
}
|
|
3622
3623
|
}
|
|
3623
3624
|
);
|
|
3624
|
-
},
|
|
3625
|
-
return (
|
|
3626
|
-
const
|
|
3625
|
+
}, 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]"]);
|
|
3626
|
+
return (v, u) => {
|
|
3627
|
+
const g = A("font-awesome-icon"), _ = A("router-view");
|
|
3627
3628
|
return h(), y(D, null, [
|
|
3628
3629
|
m("div", {
|
|
3629
|
-
class: V([
|
|
3630
|
+
class: V([x.value, "fixed inset-y-0 flex transition-all z-100"])
|
|
3630
3631
|
}, [
|
|
3631
|
-
m("div",
|
|
3632
|
-
m("nav",
|
|
3633
|
-
m("ul",
|
|
3634
|
-
m("li",
|
|
3635
|
-
m("ul",
|
|
3636
|
-
m("li",
|
|
3632
|
+
m("div", sr, [
|
|
3633
|
+
m("nav", ar, [
|
|
3634
|
+
m("ul", or, [
|
|
3635
|
+
m("li", rr, [
|
|
3636
|
+
m("ul", nr, [
|
|
3637
|
+
m("li", lr, [
|
|
3637
3638
|
m("a", {
|
|
3638
3639
|
class: "grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer",
|
|
3639
|
-
onClick:
|
|
3640
|
+
onClick: u[0] || (u[0] = U((b) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"]))
|
|
3640
3641
|
}, [
|
|
3641
|
-
S(
|
|
3642
|
-
icon:
|
|
3642
|
+
S(g, {
|
|
3643
|
+
icon: C(F)[c.value],
|
|
3643
3644
|
class: "size-5"
|
|
3644
3645
|
}, null, 8, ["icon"])
|
|
3645
3646
|
]),
|
|
3646
3647
|
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("a", {
|
|
3647
3648
|
key: 0,
|
|
3648
|
-
onClick:
|
|
3649
|
+
onClick: u[1] || (u[1] = U((b) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"])),
|
|
3649
3650
|
class: "font-medium text-gray-800 ml-[10px] cursor-pointer"
|
|
3650
3651
|
}, M(e.appStore.state.app), 1))
|
|
3651
3652
|
]),
|
|
3652
|
-
(h(!0), y(D, null, B(e.mainNavStore.state.menu, (
|
|
3653
|
-
key:
|
|
3653
|
+
(h(!0), y(D, null, B(e.mainNavStore.state.menu, (b) => (h(), y("li", {
|
|
3654
|
+
key: b.name,
|
|
3654
3655
|
class: V({
|
|
3655
|
-
"mt-[10px]":
|
|
3656
|
-
"mt-auto":
|
|
3656
|
+
"mt-[10px]": b.children,
|
|
3657
|
+
"mt-auto": b.footerSection
|
|
3657
3658
|
})
|
|
3658
3659
|
}, [
|
|
3659
3660
|
m("a", {
|
|
3660
3661
|
class: V([{
|
|
3661
|
-
"bg-gray-100":
|
|
3662
|
-
"hover:bg-gray-100":
|
|
3662
|
+
"bg-gray-100": o(b),
|
|
3663
|
+
"hover:bg-gray-100": b?.href
|
|
3663
3664
|
}, "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((
|
|
3665
|
+
href: b?.href,
|
|
3666
|
+
onClick: U((k) => e.mainNavStore.goto(b.href), ["prevent"])
|
|
3666
3667
|
}, [
|
|
3667
|
-
|
|
3668
|
+
b.icon ? (h(), H(g, {
|
|
3668
3669
|
key: 0,
|
|
3669
|
-
icon:
|
|
3670
|
-
class: V([[(
|
|
3670
|
+
icon: C(F)[b.icon],
|
|
3671
|
+
class: V([[(o(b), "text-gray-400")], "size-4"])
|
|
3671
3672
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
3672
|
-
e.mainNavStore.state.collapsed ?
|
|
3673
|
+
e.mainNavStore.state.collapsed ? b?.children ? (h(), y("div", cr, [...u[6] || (u[6] = [
|
|
3673
3674
|
m("div", { class: "w-[10px] h-px bg-gray-400" }, null, -1)
|
|
3674
3675
|
])])) : T("", !0) : (h(), y("span", {
|
|
3675
3676
|
key: 1,
|
|
3676
3677
|
class: V({
|
|
3677
|
-
"text-[11px]":
|
|
3678
|
-
"text-[13px]": !
|
|
3679
|
-
"font-semibold":
|
|
3680
|
-
"text-gray-500":
|
|
3678
|
+
"text-[11px]": b?.children,
|
|
3679
|
+
"text-[13px]": !b?.children,
|
|
3680
|
+
"font-semibold": b?.children,
|
|
3681
|
+
"text-gray-500": b?.children
|
|
3681
3682
|
})
|
|
3682
|
-
}, M(
|
|
3683
|
-
], 10,
|
|
3684
|
-
|
|
3685
|
-
(h(!0), y(D, null, B(
|
|
3686
|
-
key:
|
|
3683
|
+
}, M(b.name), 3))
|
|
3684
|
+
], 10, ir),
|
|
3685
|
+
b.children ? (h(), y("ul", ur, [
|
|
3686
|
+
(h(!0), y(D, null, B(b.children, (k) => (h(), y("li", {
|
|
3687
|
+
key: k.name
|
|
3687
3688
|
}, [
|
|
3688
3689
|
m("a", {
|
|
3689
|
-
class: V([[
|
|
3690
|
-
href:
|
|
3691
|
-
onClick: U((
|
|
3690
|
+
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"]),
|
|
3691
|
+
href: k.href,
|
|
3692
|
+
onClick: U((P) => e.mainNavStore.goto(k.href), ["prevent"])
|
|
3692
3693
|
}, [
|
|
3693
|
-
|
|
3694
|
+
k.icon ? (h(), H(g, {
|
|
3694
3695
|
key: 0,
|
|
3695
|
-
icon:
|
|
3696
|
-
class: V([[(
|
|
3696
|
+
icon: C(F)[k.icon],
|
|
3697
|
+
class: V([[(o(k), "text-gray-400")], "size-4"])
|
|
3697
3698
|
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
3698
|
-
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("span",
|
|
3699
|
-
], 10,
|
|
3699
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (h(), y("span", pr, M(k.name), 1))
|
|
3700
|
+
], 10, dr)
|
|
3700
3701
|
]))), 128))
|
|
3701
3702
|
])) : T("", !0)
|
|
3702
3703
|
], 2))), 128))
|
|
3703
3704
|
])
|
|
3704
3705
|
]),
|
|
3705
|
-
m("li",
|
|
3706
|
-
O(
|
|
3706
|
+
m("li", fr, [
|
|
3707
|
+
O(v.$slots, "sidebar-footer"),
|
|
3707
3708
|
m("a", {
|
|
3708
3709
|
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
3710
|
href: "#",
|
|
3710
|
-
onClick:
|
|
3711
|
+
onClick: u[2] || (u[2] = U((b) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
|
|
3711
3712
|
}, [
|
|
3712
|
-
S(
|
|
3713
|
-
icon:
|
|
3713
|
+
S(g, {
|
|
3714
|
+
icon: C(F)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
|
|
3714
3715
|
class: "class-5"
|
|
3715
3716
|
}, null, 8, ["icon"])
|
|
3716
3717
|
])
|
|
@@ -3722,42 +3723,42 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3722
3723
|
m("div", {
|
|
3723
3724
|
class: V([w.value, "h-full transition-all flex flex-col"])
|
|
3724
3725
|
}, [
|
|
3725
|
-
m("div",
|
|
3726
|
-
m("div",
|
|
3727
|
-
m("div",
|
|
3728
|
-
O(
|
|
3729
|
-
m("div",
|
|
3730
|
-
S(
|
|
3731
|
-
icon:
|
|
3726
|
+
m("div", mr, [
|
|
3727
|
+
m("div", hr, [
|
|
3728
|
+
m("div", gr, [
|
|
3729
|
+
O(v.$slots, "header-left", {}, () => [
|
|
3730
|
+
m("div", yr, [
|
|
3731
|
+
S(g, {
|
|
3732
|
+
icon: C(F).farBarsSort,
|
|
3732
3733
|
class: "size-5",
|
|
3733
|
-
onClick:
|
|
3734
|
+
onClick: u[3] || (u[3] = (b) => e.mainNavStore.toggleHidden())
|
|
3734
3735
|
}, null, 8, ["icon"])
|
|
3735
3736
|
])
|
|
3736
3737
|
]),
|
|
3737
|
-
O(
|
|
3738
|
-
|
|
3738
|
+
O(v.$slots, "header-center", {}, () => [
|
|
3739
|
+
d.value ? (h(), y("div", {
|
|
3739
3740
|
key: 0,
|
|
3740
3741
|
class: "absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center",
|
|
3741
|
-
onClick:
|
|
3742
|
+
onClick: f
|
|
3742
3743
|
}, [
|
|
3743
|
-
|
|
3744
|
+
C(i).currentBrand ? (h(), y("img", {
|
|
3744
3745
|
key: 0,
|
|
3745
|
-
src:
|
|
3746
|
+
src: C(i).currentBrand.logo,
|
|
3746
3747
|
alt: "",
|
|
3747
3748
|
class: "h-[30px] w-auto"
|
|
3748
|
-
}, null, 8,
|
|
3749
|
+
}, null, 8, vr)) : T("", !0)
|
|
3749
3750
|
])) : T("", !0)
|
|
3750
3751
|
]),
|
|
3751
|
-
m("div",
|
|
3752
|
-
O(
|
|
3752
|
+
m("div", br, [
|
|
3753
|
+
O(v.$slots, "header-right", {}, () => [
|
|
3753
3754
|
e.appStore.state.showAppSelector ? (h(), y("button", {
|
|
3754
3755
|
key: 0,
|
|
3755
3756
|
class: "rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300",
|
|
3756
3757
|
type: "button",
|
|
3757
|
-
onClick:
|
|
3758
|
+
onClick: p
|
|
3758
3759
|
}, [
|
|
3759
|
-
S(
|
|
3760
|
-
icon:
|
|
3760
|
+
S(g, {
|
|
3761
|
+
icon: C(F).farGripDotsVertical,
|
|
3761
3762
|
class: "size-4 text-gray-400"
|
|
3762
3763
|
}, null, 8, ["icon"])
|
|
3763
3764
|
])) : T("", !0)
|
|
@@ -3766,42 +3767,42 @@ const tr = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, sr = { class: "flex
|
|
|
3766
3767
|
])
|
|
3767
3768
|
])
|
|
3768
3769
|
]),
|
|
3769
|
-
m("main",
|
|
3770
|
-
S(
|
|
3770
|
+
m("main", xr, [
|
|
3771
|
+
S(_)
|
|
3771
3772
|
])
|
|
3772
3773
|
], 2),
|
|
3773
|
-
S(
|
|
3774
|
+
S(C(Me), {
|
|
3774
3775
|
position: "left",
|
|
3775
|
-
"overlay-instance":
|
|
3776
|
-
onClose:
|
|
3776
|
+
"overlay-instance": C(ae).left,
|
|
3777
|
+
onClose: u[4] || (u[4] = (b) => a("overlayClose", "left"))
|
|
3777
3778
|
}, null, 8, ["overlay-instance"]),
|
|
3778
|
-
S(
|
|
3779
|
+
S(C(Me), {
|
|
3779
3780
|
position: "right",
|
|
3780
|
-
"overlay-instance":
|
|
3781
|
-
onClose:
|
|
3781
|
+
"overlay-instance": C(ae).right,
|
|
3782
|
+
onClose: u[5] || (u[5] = (b) => a("overlayClose", "right"))
|
|
3782
3783
|
}, null, 8, ["overlay-instance"]),
|
|
3783
|
-
S(
|
|
3784
|
+
S(C(Ta))
|
|
3784
3785
|
], 64);
|
|
3785
3786
|
};
|
|
3786
3787
|
}
|
|
3787
|
-
},
|
|
3788
|
-
function
|
|
3789
|
-
const t =
|
|
3790
|
-
return h(), y("main",
|
|
3788
|
+
}, kr = {}, wr = { class: "h-full" };
|
|
3789
|
+
function _r(e, s) {
|
|
3790
|
+
const t = A("router-view");
|
|
3791
|
+
return h(), y("main", wr, [
|
|
3791
3792
|
S(t)
|
|
3792
3793
|
]);
|
|
3793
3794
|
}
|
|
3794
|
-
const
|
|
3795
|
+
const il = /* @__PURE__ */ oe(kr, [["render", _r]]), Cr = { class: "h-full grid place-content-center relative" }, Sr = { class: "absolute top-8 left-8" }, $r = ["src"], Tr = {
|
|
3795
3796
|
key: 1,
|
|
3796
3797
|
width: "59",
|
|
3797
3798
|
height: "23",
|
|
3798
3799
|
viewBox: "0 0 59 23",
|
|
3799
3800
|
fill: "none",
|
|
3800
3801
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3801
|
-
},
|
|
3802
|
+
}, Lr = { class: "max-w-sm grid gap-y-1 -mt-8" }, Pr = { class: "mb-7" }, Mr = { class: "text-gray-600" }, Vr = { class: "grid grid-flow-col justify-between mt-1 mb-4" }, Hr = {
|
|
3802
3803
|
key: 0,
|
|
3803
3804
|
class: "text-red-600 text-sm mb-2"
|
|
3804
|
-
},
|
|
3805
|
+
}, Rr = { key: 0 }, Fr = { key: 1 }, Dr = {
|
|
3805
3806
|
__name: "SparkLoginView",
|
|
3806
3807
|
props: {
|
|
3807
3808
|
logo: {
|
|
@@ -3818,7 +3819,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3818
3819
|
}
|
|
3819
3820
|
},
|
|
3820
3821
|
setup(e) {
|
|
3821
|
-
const s =
|
|
3822
|
+
const s = W(), t = se(), a = ct(), l = Q(), r = e, o = R(!1), i = R(""), n = async (c) => {
|
|
3822
3823
|
o.value = !0, i.value = "";
|
|
3823
3824
|
try {
|
|
3824
3825
|
await l.login(c);
|
|
@@ -3830,7 +3831,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3830
3831
|
}
|
|
3831
3832
|
await s.push(d);
|
|
3832
3833
|
} else
|
|
3833
|
-
await s.push(
|
|
3834
|
+
await s.push(r.defaultRedirect);
|
|
3834
3835
|
} catch (d) {
|
|
3835
3836
|
i.value = d.response?.data?.message || d.message || "Login failed. Please try again.";
|
|
3836
3837
|
} finally {
|
|
@@ -3838,15 +3839,15 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3838
3839
|
}
|
|
3839
3840
|
};
|
|
3840
3841
|
return (c, d) => {
|
|
3841
|
-
const p =
|
|
3842
|
-
return h(), y("div",
|
|
3843
|
-
m("div",
|
|
3844
|
-
|
|
3842
|
+
const p = A("FormKit"), f = A("router-link");
|
|
3843
|
+
return h(), y("div", Cr, [
|
|
3844
|
+
m("div", Sr, [
|
|
3845
|
+
r.logo ? (h(), y("img", {
|
|
3845
3846
|
key: 0,
|
|
3846
|
-
src:
|
|
3847
|
+
src: r.logo,
|
|
3847
3848
|
alt: "Logo",
|
|
3848
3849
|
class: "h-[23px] w-auto"
|
|
3849
|
-
}, null, 8,
|
|
3850
|
+
}, null, 8, $r)) : (h(), y("svg", Tr, [...d[0] || (d[0] = [
|
|
3850
3851
|
m("path", {
|
|
3851
3852
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3852
3853
|
fill: "#1C64F2"
|
|
@@ -3865,14 +3866,14 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3865
3866
|
}, null, -1)
|
|
3866
3867
|
])]))
|
|
3867
3868
|
]),
|
|
3868
|
-
m("div",
|
|
3869
|
-
m("div",
|
|
3869
|
+
m("div", Lr, [
|
|
3870
|
+
m("div", Pr, [
|
|
3870
3871
|
d[1] || (d[1] = m("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Log in", -1)),
|
|
3871
|
-
m("p",
|
|
3872
|
+
m("p", Mr, " Welcome back" + M(C(a).state.app ? ` to ${C(a).state.app}` : "") + "! Please enter your details. ", 1)
|
|
3872
3873
|
]),
|
|
3873
3874
|
S(p, {
|
|
3874
3875
|
type: "form",
|
|
3875
|
-
onSubmit:
|
|
3876
|
+
onSubmit: n,
|
|
3876
3877
|
actions: !1
|
|
3877
3878
|
}, {
|
|
3878
3879
|
default: L(() => [
|
|
@@ -3883,7 +3884,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3883
3884
|
type: "email",
|
|
3884
3885
|
validation: "required|email",
|
|
3885
3886
|
"outer-class": "max-w-full",
|
|
3886
|
-
value:
|
|
3887
|
+
value: C(l).state.devCredentials.username
|
|
3887
3888
|
}, null, 8, ["value"]),
|
|
3888
3889
|
S(p, {
|
|
3889
3890
|
label: "Password",
|
|
@@ -3892,29 +3893,29 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3892
3893
|
type: "password",
|
|
3893
3894
|
validation: "required",
|
|
3894
3895
|
"outer-class": "max-w-full",
|
|
3895
|
-
value:
|
|
3896
|
+
value: C(l).state.devCredentials.password
|
|
3896
3897
|
}, null, 8, ["value"]),
|
|
3897
|
-
m("div",
|
|
3898
|
+
m("div", Vr, [
|
|
3898
3899
|
d[3] || (d[3] = m("span", null, null, -1)),
|
|
3899
3900
|
S(f, {
|
|
3900
|
-
to:
|
|
3901
|
+
to: r.forgotPasswordRoute,
|
|
3901
3902
|
class: "text-sm text-primary-600 font-semibold"
|
|
3902
3903
|
}, {
|
|
3903
3904
|
default: L(() => [...d[2] || (d[2] = [
|
|
3904
|
-
|
|
3905
|
+
E(" Forgot password ", -1)
|
|
3905
3906
|
])]),
|
|
3906
3907
|
_: 1
|
|
3907
3908
|
}, 8, ["to"])
|
|
3908
3909
|
]),
|
|
3909
|
-
i.value ? (h(), y("div",
|
|
3910
|
-
S(
|
|
3910
|
+
i.value ? (h(), y("div", Hr, M(i.value), 1)) : T("", !0),
|
|
3911
|
+
S(C(G), {
|
|
3911
3912
|
type: "submit",
|
|
3912
3913
|
size: "xl",
|
|
3913
3914
|
disabled: o.value,
|
|
3914
3915
|
"button-class": "w-full mb-2"
|
|
3915
3916
|
}, {
|
|
3916
3917
|
default: L(() => [
|
|
3917
|
-
o.value ? (h(), y("span",
|
|
3918
|
+
o.value ? (h(), y("span", Fr, "Signing in...")) : (h(), y("span", Rr, "Sign in"))
|
|
3918
3919
|
]),
|
|
3919
3920
|
_: 1
|
|
3920
3921
|
}, 8, ["disabled"])
|
|
@@ -3925,7 +3926,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3925
3926
|
]);
|
|
3926
3927
|
};
|
|
3927
3928
|
}
|
|
3928
|
-
},
|
|
3929
|
+
}, Ar = {
|
|
3929
3930
|
__name: "SparkLogoutView",
|
|
3930
3931
|
props: {
|
|
3931
3932
|
defaultRedirect: {
|
|
@@ -3934,27 +3935,27 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3934
3935
|
}
|
|
3935
3936
|
},
|
|
3936
3937
|
setup(e) {
|
|
3937
|
-
const s =
|
|
3938
|
+
const s = W(), t = se(), a = Q(), l = e;
|
|
3938
3939
|
return ye(async () => {
|
|
3939
3940
|
await a.logout();
|
|
3940
|
-
const
|
|
3941
|
-
|
|
3942
|
-
}), (
|
|
3941
|
+
const r = t.query.redirect;
|
|
3942
|
+
r && r.startsWith("http") ? window.location.href = r : await s.push(r || l.defaultRedirect);
|
|
3943
|
+
}), (r, o) => null;
|
|
3943
3944
|
}
|
|
3944
|
-
}, Er = { class: "h-full grid place-content-center relative" },
|
|
3945
|
+
}, Er = { class: "h-full grid place-content-center relative" }, Ir = { class: "absolute top-8 left-8" }, Or = ["src"], Br = {
|
|
3945
3946
|
key: 1,
|
|
3946
3947
|
width: "59",
|
|
3947
3948
|
height: "23",
|
|
3948
3949
|
viewBox: "0 0 59 23",
|
|
3949
3950
|
fill: "none",
|
|
3950
3951
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3951
|
-
},
|
|
3952
|
+
}, zr = { class: "max-w-sm grid gap-y-1 -mt-8" }, jr = {
|
|
3952
3953
|
key: 0,
|
|
3953
3954
|
class: "text-red-600 text-sm mb-2"
|
|
3954
|
-
},
|
|
3955
|
+
}, Nr = {
|
|
3955
3956
|
key: 1,
|
|
3956
3957
|
class: "text-green-600 text-sm mb-2"
|
|
3957
|
-
},
|
|
3958
|
+
}, Zr = { key: 0 }, qr = { key: 1 }, Ur = {
|
|
3958
3959
|
__name: "SparkForgotPasswordView",
|
|
3959
3960
|
props: {
|
|
3960
3961
|
logo: {
|
|
@@ -3967,26 +3968,26 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
3967
3968
|
}
|
|
3968
3969
|
},
|
|
3969
3970
|
setup(e) {
|
|
3970
|
-
const s = Q(), t = e, a = R(!1), l = R(""),
|
|
3971
|
-
a.value = !0, l.value = "",
|
|
3971
|
+
const s = Q(), t = e, a = R(!1), l = R(""), r = R(""), o = async ({ email: i }) => {
|
|
3972
|
+
a.value = !0, l.value = "", r.value = "";
|
|
3972
3973
|
try {
|
|
3973
|
-
await le.post(s.state.endpoints.passwordEmail, { email: i }),
|
|
3974
|
-
} catch (
|
|
3975
|
-
l.value =
|
|
3974
|
+
await le.post(s.state.endpoints.passwordEmail, { email: i }), r.value = "Password reset link sent! Check your email.";
|
|
3975
|
+
} catch (n) {
|
|
3976
|
+
l.value = n.response?.data?.message || "Failed to send reset link.";
|
|
3976
3977
|
} finally {
|
|
3977
3978
|
a.value = !1;
|
|
3978
3979
|
}
|
|
3979
3980
|
};
|
|
3980
|
-
return (i,
|
|
3981
|
-
const c =
|
|
3981
|
+
return (i, n) => {
|
|
3982
|
+
const c = A("FormKit"), d = A("router-link");
|
|
3982
3983
|
return h(), y("div", Er, [
|
|
3983
|
-
m("div",
|
|
3984
|
+
m("div", Ir, [
|
|
3984
3985
|
t.logo ? (h(), y("img", {
|
|
3985
3986
|
key: 0,
|
|
3986
3987
|
src: t.logo,
|
|
3987
3988
|
alt: "Logo",
|
|
3988
3989
|
class: "h-[23px] w-auto"
|
|
3989
|
-
}, null, 8,
|
|
3990
|
+
}, null, 8, Or)) : (h(), y("svg", Br, [...n[0] || (n[0] = [
|
|
3990
3991
|
m("path", {
|
|
3991
3992
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3992
3993
|
fill: "#1C64F2"
|
|
@@ -4005,8 +4006,8 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4005
4006
|
}, null, -1)
|
|
4006
4007
|
])]))
|
|
4007
4008
|
]),
|
|
4008
|
-
m("div",
|
|
4009
|
-
|
|
4009
|
+
m("div", zr, [
|
|
4010
|
+
n[2] || (n[2] = m("div", { class: "mb-7" }, [
|
|
4010
4011
|
m("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Reset password"),
|
|
4011
4012
|
m("p", { class: "text-gray-600" }, " Enter your email and we'll send you a link to reset your password. ")
|
|
4012
4013
|
], -1)),
|
|
@@ -4024,16 +4025,16 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4024
4025
|
validation: "required|email",
|
|
4025
4026
|
"outer-class": "max-w-full"
|
|
4026
4027
|
}),
|
|
4027
|
-
l.value ? (h(), y("div",
|
|
4028
|
-
|
|
4029
|
-
S(
|
|
4028
|
+
l.value ? (h(), y("div", jr, M(l.value), 1)) : T("", !0),
|
|
4029
|
+
r.value ? (h(), y("div", Nr, M(r.value), 1)) : T("", !0),
|
|
4030
|
+
S(C(G), {
|
|
4030
4031
|
type: "submit",
|
|
4031
4032
|
size: "xl",
|
|
4032
4033
|
disabled: a.value,
|
|
4033
4034
|
"button-class": "w-full mb-2"
|
|
4034
4035
|
}, {
|
|
4035
4036
|
default: L(() => [
|
|
4036
|
-
a.value ? (h(), y("span",
|
|
4037
|
+
a.value ? (h(), y("span", qr, "Sending...")) : (h(), y("span", Zr, "Send reset link"))
|
|
4037
4038
|
]),
|
|
4038
4039
|
_: 1
|
|
4039
4040
|
}, 8, ["disabled"]),
|
|
@@ -4041,8 +4042,8 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4041
4042
|
to: t.loginRoute,
|
|
4042
4043
|
class: "text-sm text-center text-primary-600 font-semibold block"
|
|
4043
4044
|
}, {
|
|
4044
|
-
default: L(() => [...
|
|
4045
|
-
|
|
4045
|
+
default: L(() => [...n[1] || (n[1] = [
|
|
4046
|
+
E(" Back to login ", -1)
|
|
4046
4047
|
])]),
|
|
4047
4048
|
_: 1
|
|
4048
4049
|
}, 8, ["to"])
|
|
@@ -4053,17 +4054,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4053
4054
|
]);
|
|
4054
4055
|
};
|
|
4055
4056
|
}
|
|
4056
|
-
},
|
|
4057
|
+
}, Kr = { class: "h-full grid place-content-center relative" }, Wr = { class: "absolute top-8 left-8" }, Gr = ["src"], Yr = {
|
|
4057
4058
|
key: 1,
|
|
4058
4059
|
width: "59",
|
|
4059
4060
|
height: "23",
|
|
4060
4061
|
viewBox: "0 0 59 23",
|
|
4061
4062
|
fill: "none",
|
|
4062
4063
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4063
|
-
},
|
|
4064
|
+
}, Xr = { class: "max-w-sm grid gap-y-1 -mt-8" }, Jr = {
|
|
4064
4065
|
key: 0,
|
|
4065
4066
|
class: "text-red-600 text-sm mb-2"
|
|
4066
|
-
},
|
|
4067
|
+
}, Qr = { key: 0 }, en = { key: 1 }, tn = {
|
|
4067
4068
|
__name: "SparkResetPasswordView",
|
|
4068
4069
|
props: {
|
|
4069
4070
|
logo: {
|
|
@@ -4076,31 +4077,31 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4076
4077
|
}
|
|
4077
4078
|
},
|
|
4078
4079
|
setup(e) {
|
|
4079
|
-
const s =
|
|
4080
|
-
|
|
4080
|
+
const s = W(), t = se(), a = Q(), l = e, r = R(!1), o = R(""), i = async ({ password: n, password_confirmation: c }) => {
|
|
4081
|
+
r.value = !0, o.value = "";
|
|
4081
4082
|
try {
|
|
4082
4083
|
await le.post(a.state.endpoints.passwordReset, {
|
|
4083
4084
|
email: t.query.email,
|
|
4084
4085
|
token: t.query.token,
|
|
4085
|
-
password:
|
|
4086
|
+
password: n,
|
|
4086
4087
|
password_confirmation: c
|
|
4087
4088
|
}), await s.push(l.loginRoute);
|
|
4088
4089
|
} catch (d) {
|
|
4089
4090
|
o.value = d.response?.data?.message || "Failed to reset password.";
|
|
4090
4091
|
} finally {
|
|
4091
|
-
|
|
4092
|
+
r.value = !1;
|
|
4092
4093
|
}
|
|
4093
4094
|
};
|
|
4094
|
-
return (
|
|
4095
|
-
const d =
|
|
4096
|
-
return h(), y("div",
|
|
4097
|
-
m("div",
|
|
4095
|
+
return (n, c) => {
|
|
4096
|
+
const d = A("FormKit");
|
|
4097
|
+
return h(), y("div", Kr, [
|
|
4098
|
+
m("div", Wr, [
|
|
4098
4099
|
l.logo ? (h(), y("img", {
|
|
4099
4100
|
key: 0,
|
|
4100
4101
|
src: l.logo,
|
|
4101
4102
|
alt: "Logo",
|
|
4102
4103
|
class: "h-[23px] w-auto"
|
|
4103
|
-
}, null, 8, Gr)) : (h(), y("svg",
|
|
4104
|
+
}, null, 8, Gr)) : (h(), y("svg", Yr, [...c[0] || (c[0] = [
|
|
4104
4105
|
m("path", {
|
|
4105
4106
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4106
4107
|
fill: "#1C64F2"
|
|
@@ -4119,7 +4120,7 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4119
4120
|
}, null, -1)
|
|
4120
4121
|
])]))
|
|
4121
4122
|
]),
|
|
4122
|
-
m("div",
|
|
4123
|
+
m("div", Xr, [
|
|
4123
4124
|
c[1] || (c[1] = m("div", { class: "mb-7" }, [
|
|
4124
4125
|
m("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Set new password"),
|
|
4125
4126
|
m("p", { class: "text-gray-600" }, " Enter your new password below. ")
|
|
@@ -4146,15 +4147,15 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4146
4147
|
validation: "required|confirm:password",
|
|
4147
4148
|
"outer-class": "max-w-full"
|
|
4148
4149
|
}),
|
|
4149
|
-
o.value ? (h(), y("div",
|
|
4150
|
-
S(
|
|
4150
|
+
o.value ? (h(), y("div", Jr, M(o.value), 1)) : T("", !0),
|
|
4151
|
+
S(C(G), {
|
|
4151
4152
|
type: "submit",
|
|
4152
4153
|
size: "xl",
|
|
4153
|
-
disabled:
|
|
4154
|
+
disabled: r.value,
|
|
4154
4155
|
"button-class": "w-full mb-2"
|
|
4155
4156
|
}, {
|
|
4156
4157
|
default: L(() => [
|
|
4157
|
-
|
|
4158
|
+
r.value ? (h(), y("span", en, "Resetting...")) : (h(), y("span", Qr, "Reset password"))
|
|
4158
4159
|
]),
|
|
4159
4160
|
_: 1
|
|
4160
4161
|
}, 8, ["disabled"])
|
|
@@ -4165,14 +4166,14 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4165
4166
|
]);
|
|
4166
4167
|
};
|
|
4167
4168
|
}
|
|
4168
|
-
},
|
|
4169
|
+
}, sn = { class: "h-full grid place-content-center relative" }, an = { class: "absolute top-8 left-8" }, on = ["src"], rn = {
|
|
4169
4170
|
key: 1,
|
|
4170
4171
|
width: "59",
|
|
4171
4172
|
height: "23",
|
|
4172
4173
|
viewBox: "0 0 59 23",
|
|
4173
4174
|
fill: "none",
|
|
4174
4175
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4175
|
-
},
|
|
4176
|
+
}, nn = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, ln = { class: "flex gap-4 justify-center" }, cn = {
|
|
4176
4177
|
__name: "SparkError403View",
|
|
4177
4178
|
props: {
|
|
4178
4179
|
logo: {
|
|
@@ -4185,17 +4186,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4185
4186
|
}
|
|
4186
4187
|
},
|
|
4187
4188
|
setup(e) {
|
|
4188
|
-
const s =
|
|
4189
|
+
const s = W(), t = e, a = () => {
|
|
4189
4190
|
s.push(t.homeRoute);
|
|
4190
4191
|
};
|
|
4191
|
-
return (l,
|
|
4192
|
-
m("div",
|
|
4192
|
+
return (l, r) => (h(), y("div", sn, [
|
|
4193
|
+
m("div", an, [
|
|
4193
4194
|
t.logo ? (h(), y("img", {
|
|
4194
4195
|
key: 0,
|
|
4195
4196
|
src: t.logo,
|
|
4196
4197
|
alt: "Logo",
|
|
4197
4198
|
class: "h-[23px] w-auto"
|
|
4198
|
-
}, null, 8,
|
|
4199
|
+
}, null, 8, on)) : (h(), y("svg", rn, [...r[0] || (r[0] = [
|
|
4199
4200
|
m("path", {
|
|
4200
4201
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4201
4202
|
fill: "#1C64F2"
|
|
@@ -4214,23 +4215,23 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4214
4215
|
}, null, -1)
|
|
4215
4216
|
])]))
|
|
4216
4217
|
]),
|
|
4217
|
-
m("div",
|
|
4218
|
-
|
|
4218
|
+
m("div", nn, [
|
|
4219
|
+
r[2] || (r[2] = m("div", null, [
|
|
4219
4220
|
m("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "403"),
|
|
4220
4221
|
m("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Access Forbidden "),
|
|
4221
4222
|
m("p", { class: "text-gray-600" }, [
|
|
4222
|
-
|
|
4223
|
+
E(" You don't have permission to access this resource."),
|
|
4223
4224
|
m("br"),
|
|
4224
|
-
|
|
4225
|
+
E(" If you believe this is an error, please contact your administrator. ")
|
|
4225
4226
|
])
|
|
4226
4227
|
], -1)),
|
|
4227
|
-
m("div",
|
|
4228
|
-
S(
|
|
4228
|
+
m("div", ln, [
|
|
4229
|
+
S(C(G), {
|
|
4229
4230
|
onClick: a,
|
|
4230
4231
|
size: "lg"
|
|
4231
4232
|
}, {
|
|
4232
|
-
default: L(() => [...
|
|
4233
|
-
|
|
4233
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4234
|
+
E(" Go to Home ", -1)
|
|
4234
4235
|
])]),
|
|
4235
4236
|
_: 1
|
|
4236
4237
|
})
|
|
@@ -4238,14 +4239,14 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4238
4239
|
])
|
|
4239
4240
|
]));
|
|
4240
4241
|
}
|
|
4241
|
-
},
|
|
4242
|
+
}, un = { class: "h-full grid place-content-center relative" }, dn = { class: "absolute top-8 left-8" }, pn = ["src"], fn = {
|
|
4242
4243
|
key: 1,
|
|
4243
4244
|
width: "59",
|
|
4244
4245
|
height: "23",
|
|
4245
4246
|
viewBox: "0 0 59 23",
|
|
4246
4247
|
fill: "none",
|
|
4247
4248
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4248
|
-
},
|
|
4249
|
+
}, mn = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, hn = { class: "flex gap-4 justify-center" }, gn = {
|
|
4249
4250
|
__name: "SparkError404View",
|
|
4250
4251
|
props: {
|
|
4251
4252
|
logo: {
|
|
@@ -4258,17 +4259,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4258
4259
|
}
|
|
4259
4260
|
},
|
|
4260
4261
|
setup(e) {
|
|
4261
|
-
const s =
|
|
4262
|
+
const s = W(), t = e, a = () => {
|
|
4262
4263
|
s.push(t.homeRoute);
|
|
4263
4264
|
};
|
|
4264
|
-
return (l,
|
|
4265
|
-
m("div",
|
|
4265
|
+
return (l, r) => (h(), y("div", un, [
|
|
4266
|
+
m("div", dn, [
|
|
4266
4267
|
t.logo ? (h(), y("img", {
|
|
4267
4268
|
key: 0,
|
|
4268
4269
|
src: t.logo,
|
|
4269
4270
|
alt: "Logo",
|
|
4270
4271
|
class: "h-[23px] w-auto"
|
|
4271
|
-
}, null, 8,
|
|
4272
|
+
}, null, 8, pn)) : (h(), y("svg", fn, [...r[0] || (r[0] = [
|
|
4272
4273
|
m("path", {
|
|
4273
4274
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4274
4275
|
fill: "#1C64F2"
|
|
@@ -4287,19 +4288,19 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4287
4288
|
}, null, -1)
|
|
4288
4289
|
])]))
|
|
4289
4290
|
]),
|
|
4290
|
-
m("div",
|
|
4291
|
-
|
|
4291
|
+
m("div", mn, [
|
|
4292
|
+
r[2] || (r[2] = m("div", null, [
|
|
4292
4293
|
m("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "404"),
|
|
4293
4294
|
m("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Page Not Found "),
|
|
4294
4295
|
m("p", { class: "text-gray-600" }, " The page you're looking for doesn't exist or has been moved. ")
|
|
4295
4296
|
], -1)),
|
|
4296
|
-
m("div",
|
|
4297
|
-
S(
|
|
4297
|
+
m("div", hn, [
|
|
4298
|
+
S(C(G), {
|
|
4298
4299
|
onClick: a,
|
|
4299
4300
|
size: "lg"
|
|
4300
4301
|
}, {
|
|
4301
|
-
default: L(() => [...
|
|
4302
|
-
|
|
4302
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4303
|
+
E(" Go to Home ", -1)
|
|
4303
4304
|
])]),
|
|
4304
4305
|
_: 1
|
|
4305
4306
|
})
|
|
@@ -4307,14 +4308,14 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4307
4308
|
])
|
|
4308
4309
|
]));
|
|
4309
4310
|
}
|
|
4310
|
-
},
|
|
4311
|
+
}, yn = { class: "h-full grid place-content-center relative" }, vn = { class: "absolute top-8 left-8" }, bn = ["src"], xn = {
|
|
4311
4312
|
key: 1,
|
|
4312
4313
|
width: "59",
|
|
4313
4314
|
height: "23",
|
|
4314
4315
|
viewBox: "0 0 59 23",
|
|
4315
4316
|
fill: "none",
|
|
4316
4317
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4317
|
-
},
|
|
4318
|
+
}, kn = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, wn = { class: "text-primary-600 text-7xl font-bold mb-4" }, _n = { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, Cn = { class: "text-gray-600" }, Sn = { class: "flex gap-4 justify-center" }, cl = {
|
|
4318
4319
|
__name: "SparkErrorGeneralView",
|
|
4319
4320
|
props: {
|
|
4320
4321
|
logo: {
|
|
@@ -4339,17 +4340,17 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4339
4340
|
}
|
|
4340
4341
|
},
|
|
4341
4342
|
setup(e) {
|
|
4342
|
-
const s =
|
|
4343
|
+
const s = W(), t = e, a = () => {
|
|
4343
4344
|
s.push(t.homeRoute);
|
|
4344
4345
|
};
|
|
4345
|
-
return (l,
|
|
4346
|
-
m("div",
|
|
4346
|
+
return (l, r) => (h(), y("div", yn, [
|
|
4347
|
+
m("div", vn, [
|
|
4347
4348
|
t.logo ? (h(), y("img", {
|
|
4348
4349
|
key: 0,
|
|
4349
4350
|
src: t.logo,
|
|
4350
4351
|
alt: "Logo",
|
|
4351
4352
|
class: "h-[23px] w-auto"
|
|
4352
|
-
}, null, 8,
|
|
4353
|
+
}, null, 8, bn)) : (h(), y("svg", xn, [...r[0] || (r[0] = [
|
|
4353
4354
|
m("path", {
|
|
4354
4355
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
4355
4356
|
fill: "#1C64F2"
|
|
@@ -4368,19 +4369,19 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4368
4369
|
}, null, -1)
|
|
4369
4370
|
])]))
|
|
4370
4371
|
]),
|
|
4371
|
-
m("div",
|
|
4372
|
+
m("div", kn, [
|
|
4372
4373
|
m("div", null, [
|
|
4373
|
-
m("div",
|
|
4374
|
-
m("h1",
|
|
4375
|
-
m("p",
|
|
4374
|
+
m("div", wn, M(t.errorCode || "Error"), 1),
|
|
4375
|
+
m("h1", _n, M(t.title || "Something went wrong"), 1),
|
|
4376
|
+
m("p", Cn, M(t.message || "An unexpected error occurred. Please try again later."), 1)
|
|
4376
4377
|
]),
|
|
4377
|
-
m("div",
|
|
4378
|
-
S(
|
|
4378
|
+
m("div", Sn, [
|
|
4379
|
+
S(C(G), {
|
|
4379
4380
|
onClick: a,
|
|
4380
4381
|
size: "lg"
|
|
4381
4382
|
}, {
|
|
4382
|
-
default: L(() => [...
|
|
4383
|
-
|
|
4383
|
+
default: L(() => [...r[1] || (r[1] = [
|
|
4384
|
+
E(" Go to Home ", -1)
|
|
4384
4385
|
])]),
|
|
4385
4386
|
_: 1
|
|
4386
4387
|
})
|
|
@@ -4389,60 +4390,60 @@ const ll = /* @__PURE__ */ oe(xr, [["render", wr]]), _r = { class: "h-full grid
|
|
|
4389
4390
|
]));
|
|
4390
4391
|
}
|
|
4391
4392
|
};
|
|
4392
|
-
function
|
|
4393
|
+
function ul(e = {}) {
|
|
4393
4394
|
const {
|
|
4394
4395
|
loginPath: s = "/login",
|
|
4395
4396
|
logoutPath: t = "/logout",
|
|
4396
4397
|
forgotPasswordPath: a = "/forgot-password",
|
|
4397
4398
|
resetPasswordPath: l = "/password/reset",
|
|
4398
|
-
logo:
|
|
4399
|
+
logo: r = "",
|
|
4399
4400
|
defaultRedirect: o = "/dashboard"
|
|
4400
4401
|
} = e;
|
|
4401
4402
|
return [
|
|
4402
4403
|
{
|
|
4403
4404
|
path: s,
|
|
4404
4405
|
name: "login",
|
|
4405
|
-
component:
|
|
4406
|
-
props: { logo:
|
|
4406
|
+
component: Dr,
|
|
4407
|
+
props: { logo: r, defaultRedirect: o },
|
|
4407
4408
|
meta: { auth: !1 }
|
|
4408
4409
|
},
|
|
4409
4410
|
{
|
|
4410
4411
|
path: t,
|
|
4411
4412
|
name: "logout",
|
|
4412
|
-
component:
|
|
4413
|
+
component: Ar,
|
|
4413
4414
|
props: { defaultRedirect: s },
|
|
4414
4415
|
meta: { auth: !1 }
|
|
4415
4416
|
},
|
|
4416
4417
|
{
|
|
4417
4418
|
path: a,
|
|
4418
4419
|
name: "forgot-password",
|
|
4419
|
-
component:
|
|
4420
|
-
props: { logo:
|
|
4420
|
+
component: Ur,
|
|
4421
|
+
props: { logo: r, loginRoute: s },
|
|
4421
4422
|
meta: { auth: !1 }
|
|
4422
4423
|
},
|
|
4423
4424
|
{
|
|
4424
4425
|
path: l,
|
|
4425
4426
|
name: "password-reset",
|
|
4426
|
-
component:
|
|
4427
|
-
props: { logo:
|
|
4427
|
+
component: tn,
|
|
4428
|
+
props: { logo: r, loginRoute: s },
|
|
4428
4429
|
meta: { auth: !1 }
|
|
4429
4430
|
}
|
|
4430
4431
|
];
|
|
4431
4432
|
}
|
|
4432
|
-
function
|
|
4433
|
+
function dl(e, s = {}) {
|
|
4433
4434
|
const { defaultAuthenticatedRoute: t = "/dashboard" } = s;
|
|
4434
|
-
e.beforeEach(async (a, l,
|
|
4435
|
+
e.beforeEach(async (a, l, r) => {
|
|
4435
4436
|
const o = Q();
|
|
4436
|
-
o.state.ready || await o.fetchUser(),
|
|
4437
|
+
o.state.ready || await o.fetchUser(), $n(a, r, o, t);
|
|
4437
4438
|
});
|
|
4438
4439
|
}
|
|
4439
|
-
function
|
|
4440
|
-
const l = e.meta.auth !== !1,
|
|
4440
|
+
function $n(e, s, t, a) {
|
|
4441
|
+
const l = e.meta.auth !== !1, r = t.check;
|
|
4441
4442
|
if (t.state.overrideToken && e.path === "/logout") {
|
|
4442
4443
|
s({ path: a });
|
|
4443
4444
|
return;
|
|
4444
4445
|
}
|
|
4445
|
-
if (!
|
|
4446
|
+
if (!r) {
|
|
4446
4447
|
if (!l) {
|
|
4447
4448
|
if (e.path === "/logout") {
|
|
4448
4449
|
s({ path: t.state.routes.auth });
|
|
@@ -4462,7 +4463,7 @@ function Sn(e, s, t, a) {
|
|
|
4462
4463
|
});
|
|
4463
4464
|
return;
|
|
4464
4465
|
}
|
|
4465
|
-
if (
|
|
4466
|
+
if (r) {
|
|
4466
4467
|
if (!l && e.path === t.state.routes.auth) {
|
|
4467
4468
|
s({ path: a });
|
|
4468
4469
|
return;
|
|
@@ -4474,7 +4475,7 @@ function Sn(e, s, t, a) {
|
|
|
4474
4475
|
s();
|
|
4475
4476
|
}
|
|
4476
4477
|
}
|
|
4477
|
-
function
|
|
4478
|
+
function pl(e = {}) {
|
|
4478
4479
|
const {
|
|
4479
4480
|
forbiddenPath: s = "/error/403",
|
|
4480
4481
|
logo: t = "",
|
|
@@ -4483,12 +4484,12 @@ function dl(e = {}) {
|
|
|
4483
4484
|
return {
|
|
4484
4485
|
path: s,
|
|
4485
4486
|
name: "error-403",
|
|
4486
|
-
component:
|
|
4487
|
+
component: cn,
|
|
4487
4488
|
props: { logo: t, homeRoute: a },
|
|
4488
4489
|
meta: { auth: !1 }
|
|
4489
4490
|
};
|
|
4490
4491
|
}
|
|
4491
|
-
function
|
|
4492
|
+
function fl(e = {}) {
|
|
4492
4493
|
const {
|
|
4493
4494
|
logo: s = "",
|
|
4494
4495
|
homeRoute: t = "/dashboard"
|
|
@@ -4496,12 +4497,12 @@ function pl(e = {}) {
|
|
|
4496
4497
|
return {
|
|
4497
4498
|
path: "/:pathMatch(.*)*",
|
|
4498
4499
|
name: "error-404",
|
|
4499
|
-
component:
|
|
4500
|
+
component: gn,
|
|
4500
4501
|
props: { logo: s, homeRoute: t },
|
|
4501
4502
|
meta: { auth: !1 }
|
|
4502
4503
|
};
|
|
4503
4504
|
}
|
|
4504
|
-
function
|
|
4505
|
+
function ml(e, s) {
|
|
4505
4506
|
e.beforeResolve(async (t) => {
|
|
4506
4507
|
if (t.meta.auth !== !1) {
|
|
4507
4508
|
const a = Q();
|
|
@@ -4509,35 +4510,35 @@ function fl(e, s) {
|
|
|
4509
4510
|
}
|
|
4510
4511
|
});
|
|
4511
4512
|
}
|
|
4512
|
-
function
|
|
4513
|
+
function hl(e, s = {}) {
|
|
4513
4514
|
const {
|
|
4514
4515
|
title: t = "Unsaved Changes",
|
|
4515
4516
|
message: a = "You have unsaved changes. Leave anyway?",
|
|
4516
4517
|
confirmText: l = "Leave",
|
|
4517
|
-
cancelText:
|
|
4518
|
+
cancelText: r = "Stay"
|
|
4518
4519
|
} = s;
|
|
4519
|
-
e.beforeEach(async (o, i,
|
|
4520
|
-
if (!
|
|
4521
|
-
|
|
4520
|
+
e.beforeEach(async (o, i, n) => {
|
|
4521
|
+
if (!Qo()) {
|
|
4522
|
+
n();
|
|
4522
4523
|
return;
|
|
4523
4524
|
}
|
|
4524
|
-
const c =
|
|
4525
|
+
const c = er() || a;
|
|
4525
4526
|
await J.confirm({
|
|
4526
4527
|
title: t,
|
|
4527
4528
|
message: c,
|
|
4528
4529
|
confirmText: l,
|
|
4529
|
-
cancelText:
|
|
4530
|
+
cancelText: r,
|
|
4530
4531
|
type: "warning"
|
|
4531
|
-
}) ? (
|
|
4532
|
+
}) ? (tr(), n()) : n(!1);
|
|
4532
4533
|
});
|
|
4533
4534
|
}
|
|
4534
|
-
const
|
|
4535
|
+
const gl = pe("sparkNav", () => {
|
|
4535
4536
|
const e = K({
|
|
4536
4537
|
menu: [],
|
|
4537
4538
|
collapsed: !1,
|
|
4538
4539
|
hidden: !1
|
|
4539
|
-
}), s =
|
|
4540
|
-
e.menu = c,
|
|
4540
|
+
}), s = W(), t = se(), a = (c = []) => {
|
|
4541
|
+
e.menu = c, n();
|
|
4541
4542
|
}, l = (c, d) => {
|
|
4542
4543
|
for (const p of c) {
|
|
4543
4544
|
if (p.href === d) return p;
|
|
@@ -4547,7 +4548,7 @@ const hl = pe("sparkNav", () => {
|
|
|
4547
4548
|
}
|
|
4548
4549
|
}
|
|
4549
4550
|
return null;
|
|
4550
|
-
},
|
|
4551
|
+
}, r = async (c) => {
|
|
4551
4552
|
if (c) {
|
|
4552
4553
|
const d = l(e.menu, c);
|
|
4553
4554
|
if (d && typeof d.action == "function") {
|
|
@@ -4560,7 +4561,7 @@ const hl = pe("sparkNav", () => {
|
|
|
4560
4561
|
e.collapsed = !e.collapsed;
|
|
4561
4562
|
}, i = () => {
|
|
4562
4563
|
e.hidden = !e.hidden;
|
|
4563
|
-
},
|
|
4564
|
+
}, n = () => {
|
|
4564
4565
|
const c = t.name || t.path.replace("/", "");
|
|
4565
4566
|
if (c) {
|
|
4566
4567
|
const d = (p) => {
|
|
@@ -4574,92 +4575,92 @@ const hl = pe("sparkNav", () => {
|
|
|
4574
4575
|
return j(
|
|
4575
4576
|
() => t.path,
|
|
4576
4577
|
() => {
|
|
4577
|
-
|
|
4578
|
+
n();
|
|
4578
4579
|
},
|
|
4579
4580
|
{ immediate: !0 }
|
|
4580
4581
|
), {
|
|
4581
4582
|
state: e,
|
|
4582
4583
|
initialize: a,
|
|
4583
|
-
goto:
|
|
4584
|
+
goto: r,
|
|
4584
4585
|
toggleCollapsed: o,
|
|
4585
4586
|
toggleHidden: i,
|
|
4586
|
-
syncWithRoute:
|
|
4587
|
+
syncWithRoute: n
|
|
4587
4588
|
};
|
|
4588
4589
|
});
|
|
4589
4590
|
export {
|
|
4590
4591
|
F as Icons,
|
|
4591
4592
|
re as SparkAlert,
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4593
|
+
Bs as SparkAppSelector,
|
|
4594
|
+
ca as SparkBrandSelector,
|
|
4595
|
+
G as SparkButton,
|
|
4595
4596
|
pt as SparkButtonGroup,
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4597
|
+
Jn as SparkCard,
|
|
4598
|
+
ll as SparkDefaultContainer,
|
|
4599
|
+
cn as SparkError403View,
|
|
4600
|
+
gn as SparkError404View,
|
|
4601
|
+
cl as SparkErrorGeneralView,
|
|
4602
|
+
Ur as SparkForgotPasswordView,
|
|
4603
|
+
Qn as SparkImageUpload,
|
|
4604
|
+
Dr as SparkLoginView,
|
|
4605
|
+
Ar as SparkLogoutView,
|
|
4606
|
+
Ta as SparkModalContainer,
|
|
4607
|
+
_a as SparkModalDialog,
|
|
4608
|
+
Yn as SparkNotificationOutlet,
|
|
4608
4609
|
Me as SparkOverlay,
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4610
|
+
il as SparkPublicContainer,
|
|
4611
|
+
tn as SparkResetPasswordView,
|
|
4612
|
+
el as SparkSubNav,
|
|
4613
|
+
tl as SparkTable,
|
|
4614
|
+
Ho as SparkTableDatePicker,
|
|
4615
|
+
Po as SparkTableFilterButtons,
|
|
4616
|
+
So as SparkTableFilterSelect,
|
|
4617
|
+
go as SparkTablePaginationPaging,
|
|
4618
|
+
bo as SparkTablePaginationPerPage,
|
|
4619
|
+
Ao as SparkTableReset,
|
|
4620
|
+
wo as SparkTableSearch,
|
|
4620
4621
|
De as SparkTableToolbar,
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4622
|
+
Xn as SparkToastContainer,
|
|
4623
|
+
Wn as addIcons,
|
|
4624
|
+
tr as clearAllDirtyForms,
|
|
4625
|
+
pl as create403Route,
|
|
4626
|
+
fl as create404Route,
|
|
4627
|
+
ul as createAuthRoutes,
|
|
4628
|
+
Wo as createAxiosInstance,
|
|
4629
|
+
sl as createBootstrapService,
|
|
4630
|
+
Fa as customiseHeader,
|
|
4631
|
+
qo as deleteCookie,
|
|
4632
|
+
Un as formKitGenesisOverride,
|
|
4633
|
+
Kn as formKitIconLoader,
|
|
4634
|
+
qn as formKitIcons,
|
|
4635
|
+
Xa as formatTemporal,
|
|
4635
4636
|
Go as getAxiosInstance,
|
|
4636
|
-
|
|
4637
|
-
|
|
4637
|
+
No as getCookie,
|
|
4638
|
+
er as getDirtyFormMessage,
|
|
4638
4639
|
ft as getDomain,
|
|
4639
4640
|
Ie as getFormLevelMessage,
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4641
|
+
Qo as hasAnyDirtyForm,
|
|
4642
|
+
Xo as isValidationError,
|
|
4643
|
+
Ja as parseDatetime,
|
|
4644
|
+
Yo as parseLaravelErrors,
|
|
4645
|
+
Ma as renderHeaderTitle,
|
|
4646
|
+
Zo as setCookie,
|
|
4647
|
+
dl as setupAuthGuards,
|
|
4648
|
+
al as setupAxios,
|
|
4649
|
+
ml as setupBootstrapGuard,
|
|
4650
|
+
hl as setupDirtyFormGuard,
|
|
4650
4651
|
Gn as setupFontAwesome,
|
|
4651
4652
|
J as sparkModalService,
|
|
4652
4653
|
z as sparkNotificationService,
|
|
4653
4654
|
ae as sparkOverlayService,
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4655
|
+
so as updateRow,
|
|
4656
|
+
nl as useFormDirtyGuard,
|
|
4657
|
+
ol as useFormSubmission,
|
|
4657
4658
|
it as useSparkAppSelectorStore,
|
|
4658
4659
|
ct as useSparkAppStore,
|
|
4659
4660
|
Q as useSparkAuthStore,
|
|
4660
4661
|
dt as useSparkBrandFilterStore,
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4662
|
+
gl as useSparkNavStore,
|
|
4663
|
+
Ee as useSparkOverlay,
|
|
4664
|
+
ao as useSparkTableRouteSync,
|
|
4665
|
+
rl as useSubNavigation
|
|
4665
4666
|
};
|