@wishbone-media/spark 0.21.0 → 0.22.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 +1305 -1144
- package/package.json +1 -1
- package/src/assets/css/spark-table.css +13 -0
- package/src/components/SparkTable.vue +23 -0
- package/src/utils/formatTemporal.js +335 -0
- package/src/utils/index.js +1 -0
- package/src/utils/sparkTable/renderers/boolean.js +3 -0
- package/src/utils/sparkTable/renderers/datetime.js +106 -0
- package/src/utils/sparkTable/renderers/index.js +2 -0
package/dist/index.js
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { computed as S, resolveComponent as A, createElementBlock as g, openBlock as m, normalizeClass as
|
|
2
|
-
import { library as
|
|
3
|
-
import { FontAwesomeIcon as
|
|
4
|
-
import { faCloudDownload as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { TransitionRoot as
|
|
7
|
-
import
|
|
8
|
-
import { range as
|
|
9
|
-
import { HotTable as
|
|
1
|
+
import { computed as S, resolveComponent as A, createElementBlock as g, openBlock as m, normalizeClass as H, createElementVNode as p, createCommentVNode as T, createVNode as b, unref as _, renderSlot as F, reactive as q, Fragment as R, renderList as z, toDisplayString as L, createBlock as V, resolveDynamicComponent as N, markRaw as fe, ref as E, watch as I, Transition as Ue, withCtx as C, normalizeProps as Ke, mergeProps as Z, createTextVNode as B, Teleport as Ge, TransitionGroup as le, inject as Ve, provide as We, toHandlers as Re, onMounted as be, withModifiers as Q, useSlots as Be, onUnmounted as Ye, h as ke } from "vue";
|
|
2
|
+
import { library as Ee, icon as ce } from "@fortawesome/fontawesome-svg-core";
|
|
3
|
+
import { FontAwesomeIcon as Xe } from "@fortawesome/vue-fontawesome";
|
|
4
|
+
import { faCloudDownload as Je, faBolt as Qe, faUndo as et, faEye as tt, faSignOut as st, faXmark as ot, faTrash as at, faTimes as rt, faStreetView as nt, faSortUp as lt, faSortDown as it, faSort as ct, faScaleBalanced as ut, faSatelliteDish as dt, faLayerPlus as pt, faLaptopMobile as ft, faInfoCircle as mt, faGripDotsVertical as ht, faGearComplex as gt, faFlag as yt, faFaceSmileWink as vt, faFaceSmileRelaxed as bt, faExclamationTriangle as xt, faEllipsisVertical as kt, faEllipsis as _t, faEdit as wt, faComments as St, faCircleXmark as Ct, faCircleUser as $t, faChevronUp as Tt, faChevronRight as Lt, faChevronLeft as Pt, faChevronDown as Mt, faCheckCircle as Ht, faCheck as Vt, faBullhorn as Rt, faBellRing as Bt, faBarsSort as Et, faArrowRightToLine as At, faArrowLeftToLine as Ot } from "@fortawesome/pro-regular-svg-icons";
|
|
5
|
+
import { defineStore as ue } from "pinia";
|
|
6
|
+
import { TransitionRoot as Ae, Dialog as Oe, TransitionChild as pe, DialogPanel as Fe } from "@headlessui/vue";
|
|
7
|
+
import me from "nprogress";
|
|
8
|
+
import { range as Ft, get as Y, find as zt, has as Dt } from "lodash";
|
|
9
|
+
import { HotTable as jt } from "@handsontable/vue3";
|
|
10
10
|
import "handsontable/styles/handsontable.css";
|
|
11
11
|
import "handsontable/styles/ht-theme-classic.css";
|
|
12
|
-
import { registerPlugin as
|
|
13
|
-
import { registerAllCellTypes as
|
|
14
|
-
import { useDebounceFn as
|
|
15
|
-
import { registerRenderer as
|
|
16
|
-
import { useRouter as
|
|
17
|
-
import
|
|
18
|
-
var
|
|
12
|
+
import { registerPlugin as de, AutoColumnSize as It, CopyPaste as Nt, StretchColumns as Zt, NestedHeaders as qt } from "handsontable/plugins";
|
|
13
|
+
import { registerAllCellTypes as Ut } from "handsontable/cellTypes";
|
|
14
|
+
import { useDebounceFn as ze, watchDebounced as _e } from "@vueuse/core";
|
|
15
|
+
import { registerRenderer as Kt, baseRenderer as Gt } from "handsontable/renderers";
|
|
16
|
+
import { useRouter as J, useRoute as ne } from "vue-router";
|
|
17
|
+
import re from "axios";
|
|
18
|
+
var Wt = {
|
|
19
19
|
prefix: "fad",
|
|
20
20
|
iconName: "sort-up",
|
|
21
21
|
icon: [384, 512, ["sort-asc"], "f0de", ["", "M32 224c-12.9 0-24.6-7.8-29.6-19.8S.2 178.5 9.4 169.4l160-160c12.5-12.5 32.8-12.5 45.3 0l160 160c9.2 9.2 11.9 22.9 6.9 34.9S364.9 224 352 224L32 224z"]]
|
|
22
|
-
},
|
|
22
|
+
}, Yt = {
|
|
23
23
|
prefix: "fad",
|
|
24
24
|
iconName: "sort",
|
|
25
25
|
icon: [384, 512, ["unsorted"], "f0dc", ["M2.4 307.8c-5 12-2.2 25.7 6.9 34.9l160 160c12.5 12.5 32.8 12.5 45.3 0l160-160c9.2-9.2 11.9-22.9 6.9-34.9S364.9 288 352 288L32 288c-12.9 0-24.6 7.8-29.6 19.8z", "M32 224c-12.9 0-24.6-7.8-29.6-19.8S.2 178.5 9.4 169.4l160-160c12.5-12.5 32.8-12.5 45.3 0l160 160c9.2 9.2 11.9 22.9 6.9 34.9S364.9 224 352 224L32 224z"]]
|
|
26
|
-
},
|
|
26
|
+
}, Xt = {
|
|
27
27
|
prefix: "fad",
|
|
28
28
|
iconName: "sort-down",
|
|
29
29
|
icon: [384, 512, ["sort-desc"], "f0dd", ["", "M32 288c-12.9 0-24.6 7.8-29.6 19.8S.2 333.5 9.4 342.6l160 160c12.5 12.5 32.8 12.5 45.3 0l160-160c9.2-9.2 11.9-22.9 6.9-34.9S364.9 288 352 288L32 288z"]]
|
|
30
30
|
};
|
|
31
|
-
const
|
|
32
|
-
farArrowLeftToLine:
|
|
33
|
-
farArrowRightToLine:
|
|
34
|
-
farBarsSort:
|
|
35
|
-
farBellRing:
|
|
36
|
-
farBullhorn:
|
|
37
|
-
farCheck:
|
|
38
|
-
farCheckCircle:
|
|
39
|
-
farChevronDown:
|
|
40
|
-
farChevronLeft:
|
|
41
|
-
farChevronRight:
|
|
42
|
-
farChevronUp:
|
|
43
|
-
farCircleUser:
|
|
44
|
-
farCircleXmark:
|
|
45
|
-
farComments:
|
|
46
|
-
farEdit:
|
|
47
|
-
farEllipsis:
|
|
48
|
-
farEllipsisVertical:
|
|
49
|
-
farExclamationTriangle:
|
|
50
|
-
farFaceSmileRelaxed:
|
|
51
|
-
farFaceSmileWink:
|
|
52
|
-
farFlag:
|
|
53
|
-
farGearComplex:
|
|
54
|
-
farGripDotsVertical:
|
|
55
|
-
farInfoCircle:
|
|
56
|
-
farLaptopMobile:
|
|
57
|
-
farLayerPlus:
|
|
58
|
-
farSatelliteDish:
|
|
59
|
-
farScaleBalanced:
|
|
60
|
-
farSort:
|
|
61
|
-
farSortDown:
|
|
62
|
-
farSortUp:
|
|
63
|
-
farStreetView:
|
|
64
|
-
farTimes:
|
|
65
|
-
farTrash:
|
|
66
|
-
farXmark:
|
|
67
|
-
farSignOut:
|
|
68
|
-
farEye:
|
|
69
|
-
farUndo:
|
|
70
|
-
farBolt:
|
|
71
|
-
farCloudDownload:
|
|
72
|
-
fadSort:
|
|
73
|
-
fadSortDown:
|
|
74
|
-
fadSortUp:
|
|
31
|
+
const O = {
|
|
32
|
+
farArrowLeftToLine: Ot,
|
|
33
|
+
farArrowRightToLine: At,
|
|
34
|
+
farBarsSort: Et,
|
|
35
|
+
farBellRing: Bt,
|
|
36
|
+
farBullhorn: Rt,
|
|
37
|
+
farCheck: Vt,
|
|
38
|
+
farCheckCircle: Ht,
|
|
39
|
+
farChevronDown: Mt,
|
|
40
|
+
farChevronLeft: Pt,
|
|
41
|
+
farChevronRight: Lt,
|
|
42
|
+
farChevronUp: Tt,
|
|
43
|
+
farCircleUser: $t,
|
|
44
|
+
farCircleXmark: Ct,
|
|
45
|
+
farComments: St,
|
|
46
|
+
farEdit: wt,
|
|
47
|
+
farEllipsis: _t,
|
|
48
|
+
farEllipsisVertical: kt,
|
|
49
|
+
farExclamationTriangle: xt,
|
|
50
|
+
farFaceSmileRelaxed: bt,
|
|
51
|
+
farFaceSmileWink: vt,
|
|
52
|
+
farFlag: yt,
|
|
53
|
+
farGearComplex: gt,
|
|
54
|
+
farGripDotsVertical: ht,
|
|
55
|
+
farInfoCircle: mt,
|
|
56
|
+
farLaptopMobile: ft,
|
|
57
|
+
farLayerPlus: pt,
|
|
58
|
+
farSatelliteDish: dt,
|
|
59
|
+
farScaleBalanced: ut,
|
|
60
|
+
farSort: ct,
|
|
61
|
+
farSortDown: it,
|
|
62
|
+
farSortUp: lt,
|
|
63
|
+
farStreetView: nt,
|
|
64
|
+
farTimes: rt,
|
|
65
|
+
farTrash: at,
|
|
66
|
+
farXmark: ot,
|
|
67
|
+
farSignOut: st,
|
|
68
|
+
farEye: tt,
|
|
69
|
+
farUndo: et,
|
|
70
|
+
farBolt: Qe,
|
|
71
|
+
farCloudDownload: Je,
|
|
72
|
+
fadSort: Yt,
|
|
73
|
+
fadSortDown: Xt,
|
|
74
|
+
fadSortUp: Wt
|
|
75
75
|
};
|
|
76
|
-
function
|
|
77
|
-
Object.assign(
|
|
76
|
+
function an(e) {
|
|
77
|
+
Object.assign(O, e), Ee.add(...Object.values(e));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function rn(e) {
|
|
80
|
+
Ee.add(...Object.values(O)), e.component("FontAwesomeIcon", Xe);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const Jt = { class: "flex items-center" }, Qt = { class: "shrink-0 self-start" }, es = { class: "ml-3" }, ts = {
|
|
83
83
|
key: 0,
|
|
84
84
|
class: "ml-auto pl-3 pt-1 self-start"
|
|
85
|
-
},
|
|
85
|
+
}, ss = { class: "-mx-1.5 -my-1.5" }, se = {
|
|
86
86
|
__name: "SparkAlert",
|
|
87
87
|
props: {
|
|
88
88
|
type: {
|
|
@@ -102,7 +102,7 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
102
102
|
warning: "bg-yellow-50 border-yellow-200 text-yellow-700",
|
|
103
103
|
danger: "bg-red-50 border-red-200 text-red-700",
|
|
104
104
|
info: "bg-blue-50 border-blue-200 text-blue-700"
|
|
105
|
-
})[s.type]),
|
|
105
|
+
})[s.type]), o = S(() => ({
|
|
106
106
|
success: "text-green-400",
|
|
107
107
|
warning: "text-yellow-400",
|
|
108
108
|
danger: "text-red-400",
|
|
@@ -118,39 +118,39 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
118
118
|
danger: "text-red-400 hover:bg-red-100",
|
|
119
119
|
info: "text-blue-400 hover:bg-blue-100"
|
|
120
120
|
})[s.type]);
|
|
121
|
-
return (
|
|
121
|
+
return (a, c) => {
|
|
122
122
|
const r = A("font-awesome-icon");
|
|
123
123
|
return m(), g("div", {
|
|
124
|
-
class:
|
|
124
|
+
class: H(["rounded-md border p-4", t.value])
|
|
125
125
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
icon:
|
|
130
|
-
class:
|
|
126
|
+
p("div", Jt, [
|
|
127
|
+
p("div", Qt, [
|
|
128
|
+
b(r, {
|
|
129
|
+
icon: _(O)[l.value],
|
|
130
|
+
class: H(o.value)
|
|
131
131
|
}, null, 8, ["icon", "class"])
|
|
132
132
|
]),
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
p("div", es, [
|
|
134
|
+
F(a.$slots, "default")
|
|
135
135
|
]),
|
|
136
|
-
e.closeable ? (m(), g("div",
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
e.closeable ? (m(), g("div", ts, [
|
|
137
|
+
p("div", ss, [
|
|
138
|
+
p("button", {
|
|
139
139
|
type: "button",
|
|
140
|
-
class:
|
|
141
|
-
onClick: c[0] || (c[0] = (i) =>
|
|
140
|
+
class: H(["inline-flex rounded-md px-2 py-1.5", n.value]),
|
|
141
|
+
onClick: c[0] || (c[0] = (i) => a.$emit("close"))
|
|
142
142
|
}, [
|
|
143
|
-
|
|
144
|
-
icon:
|
|
143
|
+
b(r, {
|
|
144
|
+
icon: _(O).farXmark
|
|
145
145
|
}, null, 8, ["icon"])
|
|
146
146
|
], 2)
|
|
147
147
|
])
|
|
148
|
-
])) :
|
|
148
|
+
])) : T("", !0)
|
|
149
149
|
])
|
|
150
150
|
], 2);
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
},
|
|
153
|
+
}, he = [
|
|
154
154
|
{
|
|
155
155
|
name: "Bolt",
|
|
156
156
|
description: "Job management",
|
|
@@ -199,16 +199,16 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
199
199
|
href: "https://tabula.letsbolt.io",
|
|
200
200
|
icon: "farCompass"
|
|
201
201
|
}
|
|
202
|
-
],
|
|
202
|
+
], De = ue("sparkAppSelector", () => {
|
|
203
203
|
const e = q({
|
|
204
|
-
apps: [...
|
|
204
|
+
apps: [...he]
|
|
205
205
|
}), s = (n = {}) => {
|
|
206
206
|
if (n.apps && Array.isArray(n.apps)) {
|
|
207
|
-
const
|
|
207
|
+
const a = n.apps.filter((c) => {
|
|
208
208
|
const r = c.name && c.description && c.icon && c.href;
|
|
209
209
|
return r || console.warn("useSparkAppSelectorStore: Invalid app object", c), r;
|
|
210
210
|
});
|
|
211
|
-
e.apps =
|
|
211
|
+
e.apps = a.map((c) => ({
|
|
212
212
|
name: c.name,
|
|
213
213
|
description: c.description,
|
|
214
214
|
icon: c.icon,
|
|
@@ -217,11 +217,11 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
if (n.appHrefs && typeof n.appHrefs == "object") {
|
|
220
|
-
const
|
|
220
|
+
const a = /* @__PURE__ */ new Map();
|
|
221
221
|
Object.keys(n.appHrefs).forEach((c) => {
|
|
222
|
-
|
|
223
|
-
}), e.apps =
|
|
224
|
-
const r =
|
|
222
|
+
a.set(c.toLowerCase(), n.appHrefs[c]);
|
|
223
|
+
}), e.apps = he.map((c) => {
|
|
224
|
+
const r = a.get(c.name.toLowerCase());
|
|
225
225
|
return {
|
|
226
226
|
...c,
|
|
227
227
|
href: r || c.href
|
|
@@ -229,23 +229,23 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
229
229
|
});
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
e.apps = [...
|
|
233
|
-
}, t = S(() => e.apps),
|
|
232
|
+
e.apps = [...he];
|
|
233
|
+
}, t = S(() => e.apps), o = (n) => {
|
|
234
234
|
if (!n) return null;
|
|
235
|
-
const
|
|
236
|
-
return e.apps.find((c) => c.name.toLowerCase() ===
|
|
235
|
+
const a = n.toLowerCase();
|
|
236
|
+
return e.apps.find((c) => c.name.toLowerCase() === a) || null;
|
|
237
237
|
};
|
|
238
238
|
return {
|
|
239
239
|
state: e,
|
|
240
240
|
initialize: s,
|
|
241
241
|
allApps: t,
|
|
242
|
-
getAppByName:
|
|
242
|
+
getAppByName: o,
|
|
243
243
|
getAppIcon: (n) => {
|
|
244
|
-
const
|
|
245
|
-
return
|
|
244
|
+
const a = o(n);
|
|
245
|
+
return a ? a.icon : "";
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
}),
|
|
248
|
+
}), je = ue("sparkApp", () => {
|
|
249
249
|
const e = q({
|
|
250
250
|
app: "",
|
|
251
251
|
homeRoute: "dashboard",
|
|
@@ -258,16 +258,16 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
258
258
|
e.app = t.app || "", e.homeRoute = t.homeRoute ?? "dashboard", e.showBrandSelector = t.showBrandSelector ?? !0, e.showAppSelector = t.showAppSelector ?? !0;
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
}),
|
|
261
|
+
}), os = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, as = { class: "flex flex-1 flex-col" }, rs = { class: "divide-y divide-gray-200" }, ns = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, ls = { class: "ml-auto flex items-center" }, is = ["href", "onClick"], cs = { class: "gap-y-1" }, us = { class: "text-base text-gray-800 flex items-center" }, ds = { class: "font-medium" }, ps = {
|
|
262
262
|
key: 0,
|
|
263
263
|
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"
|
|
264
|
-
},
|
|
264
|
+
}, fs = { class: "text-sm text-gray-500" }, ms = { class: "ml-auto flex items-center" }, hs = { class: "mt-auto" }, gs = {
|
|
265
265
|
key: 0,
|
|
266
266
|
class: "p-6"
|
|
267
|
-
},
|
|
267
|
+
}, ys = {
|
|
268
268
|
key: 1,
|
|
269
269
|
class: "bg-gray-50 p-6"
|
|
270
|
-
},
|
|
270
|
+
}, vs = {
|
|
271
271
|
__name: "SparkAppSelector",
|
|
272
272
|
props: {
|
|
273
273
|
bottomSlot: {
|
|
@@ -281,25 +281,25 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
281
281
|
},
|
|
282
282
|
emits: ["close", "select"],
|
|
283
283
|
setup(e, { emit: s }) {
|
|
284
|
-
const t = s,
|
|
284
|
+
const t = s, o = De(), l = je(), n = S(() => {
|
|
285
285
|
const c = l.state.app;
|
|
286
|
-
return
|
|
286
|
+
return o.state.apps.map((r) => ({
|
|
287
287
|
...r,
|
|
288
288
|
current: c && r.name.toLowerCase() === c.toLowerCase()
|
|
289
289
|
}));
|
|
290
|
-
}),
|
|
290
|
+
}), a = (c, r) => {
|
|
291
291
|
t("select", c);
|
|
292
292
|
};
|
|
293
293
|
return (c, r) => {
|
|
294
294
|
const i = A("font-awesome-icon");
|
|
295
|
-
return m(), g("div",
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
r[1] || (r[1] =
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
icon:
|
|
295
|
+
return m(), g("div", os, [
|
|
296
|
+
p("div", as, [
|
|
297
|
+
p("div", rs, [
|
|
298
|
+
p("div", ns, [
|
|
299
|
+
r[1] || (r[1] = p("div", null, "Mr Group Network", -1)),
|
|
300
|
+
p("div", ls, [
|
|
301
|
+
b(i, {
|
|
302
|
+
icon: _(O).farTimes,
|
|
303
303
|
class: "h-[15px] w-[15px] shrink-0 text-gray-400 cursor-pointer",
|
|
304
304
|
onClick: r[0] || (r[0] = (u) => t("close"))
|
|
305
305
|
}, null, 8, ["icon"])
|
|
@@ -309,49 +309,49 @@ const Gt = { class: "flex items-center" }, Wt = { class: "shrink-0 self-start" }
|
|
|
309
309
|
key: u.name,
|
|
310
310
|
href: u.href,
|
|
311
311
|
target: "_blank",
|
|
312
|
-
class:
|
|
313
|
-
onClick: (
|
|
312
|
+
class: H([u.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
|
|
313
|
+
onClick: (d) => u.current ? d.preventDefault() : a(u)
|
|
314
314
|
}, [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
u.current ? (m(), g("span",
|
|
315
|
+
p("div", cs, [
|
|
316
|
+
p("div", us, [
|
|
317
|
+
p("div", ds, L(u.name), 1),
|
|
318
|
+
u.current ? (m(), g("span", ps, " Active ")) : T("", !0)
|
|
319
319
|
]),
|
|
320
|
-
|
|
320
|
+
p("div", fs, L(u.description), 1)
|
|
321
321
|
]),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
class:
|
|
325
|
-
icon:
|
|
322
|
+
p("div", ms, [
|
|
323
|
+
b(i, {
|
|
324
|
+
class: H([u.current ? "text-gray-700" : "text-gray-400", "h-5 w-5 shrink-0"]),
|
|
325
|
+
icon: _(O)[u.icon]
|
|
326
326
|
}, null, 8, ["class", "icon"])
|
|
327
327
|
])
|
|
328
|
-
], 10,
|
|
329
|
-
r[2] || (r[2] =
|
|
328
|
+
], 10, is))), 128)),
|
|
329
|
+
r[2] || (r[2] = p("div", null, null, -1))
|
|
330
330
|
]),
|
|
331
|
-
|
|
332
|
-
c.$slots.bottom || e.bottomSlot ? (m(), g("div",
|
|
333
|
-
|
|
334
|
-
e.bottomSlot ? (m(),
|
|
331
|
+
p("div", hs, [
|
|
332
|
+
c.$slots.bottom || e.bottomSlot ? (m(), g("div", gs, [
|
|
333
|
+
F(c.$slots, "bottom", {}, () => [
|
|
334
|
+
e.bottomSlot ? (m(), V(N(e.bottomSlot), { key: 0 })) : T("", !0)
|
|
335
335
|
])
|
|
336
|
-
])) :
|
|
337
|
-
c.$slots.footer || e.footerSlot ? (m(), g("div",
|
|
338
|
-
|
|
339
|
-
e.footerSlot ? (m(),
|
|
336
|
+
])) : T("", !0),
|
|
337
|
+
c.$slots.footer || e.footerSlot ? (m(), g("div", ys, [
|
|
338
|
+
F(c.$slots, "footer", {}, () => [
|
|
339
|
+
e.footerSlot ? (m(), V(N(e.footerSlot), { key: 0 })) : T("", !0)
|
|
340
340
|
])
|
|
341
|
-
])) :
|
|
341
|
+
])) : T("", !0)
|
|
342
342
|
])
|
|
343
343
|
])
|
|
344
344
|
]);
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
},
|
|
347
|
+
}, Ie = {
|
|
348
348
|
success: 5e3,
|
|
349
349
|
info: 5e3,
|
|
350
350
|
warning: 5e3,
|
|
351
351
|
danger: 0
|
|
352
352
|
// sticky by default
|
|
353
|
-
},
|
|
354
|
-
function
|
|
353
|
+
}, we = ["top-left", "top-right", "center", "bottom-left", "bottom-right"];
|
|
354
|
+
function bs() {
|
|
355
355
|
const e = q({
|
|
356
356
|
isVisible: !1,
|
|
357
357
|
type: "info",
|
|
@@ -361,14 +361,14 @@ function hs() {
|
|
|
361
361
|
closeable: !0,
|
|
362
362
|
duration: null
|
|
363
363
|
});
|
|
364
|
-
let s = null, t = 0,
|
|
364
|
+
let s = null, t = 0, o = !1, l = null;
|
|
365
365
|
const n = () => {
|
|
366
|
-
s && (clearTimeout(s), s = null), t = 0,
|
|
367
|
-
},
|
|
366
|
+
s && (clearTimeout(s), s = null), t = 0, o = !1, l = null;
|
|
367
|
+
}, a = () => {
|
|
368
368
|
n(), e.isVisible = !1;
|
|
369
369
|
}, c = (f) => {
|
|
370
370
|
f <= 0 || (t = f, l = Date.now(), s = setTimeout(() => {
|
|
371
|
-
|
|
371
|
+
a();
|
|
372
372
|
}, f));
|
|
373
373
|
};
|
|
374
374
|
return {
|
|
@@ -379,32 +379,32 @@ function hs() {
|
|
|
379
379
|
type: y = "info",
|
|
380
380
|
message: k = null,
|
|
381
381
|
component: h = null,
|
|
382
|
-
props:
|
|
383
|
-
closeable:
|
|
382
|
+
props: x = {},
|
|
383
|
+
closeable: P = !0,
|
|
384
384
|
duration: w = null
|
|
385
385
|
} = f;
|
|
386
|
-
e.type = y, e.message = k, e.component = h ?
|
|
387
|
-
const
|
|
388
|
-
e.duration =
|
|
386
|
+
e.type = y, e.message = k, e.component = h ? fe(h) : null, e.props = x, e.closeable = P, e.isVisible = !0;
|
|
387
|
+
const v = w !== null ? w : Ie[y];
|
|
388
|
+
e.duration = v, v > 0 && c(v);
|
|
389
389
|
},
|
|
390
|
-
hide:
|
|
390
|
+
hide: a,
|
|
391
391
|
reset: () => {
|
|
392
|
-
|
|
392
|
+
a(), e.type = "info", e.message = null, e.component = null, e.props = {}, e.closeable = !0, e.duration = null;
|
|
393
393
|
},
|
|
394
394
|
pause: () => {
|
|
395
|
-
if (!s ||
|
|
395
|
+
if (!s || o) return;
|
|
396
396
|
clearTimeout(s), s = null;
|
|
397
397
|
const f = Date.now() - l;
|
|
398
|
-
t = Math.max(0, t - f),
|
|
398
|
+
t = Math.max(0, t - f), o = !0;
|
|
399
399
|
},
|
|
400
400
|
resume: () => {
|
|
401
|
-
!
|
|
402
|
-
|
|
401
|
+
!o || t <= 0 || (o = !1, l = Date.now(), s = setTimeout(() => {
|
|
402
|
+
a();
|
|
403
403
|
}, t));
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
class
|
|
407
|
+
class xs {
|
|
408
408
|
constructor() {
|
|
409
409
|
this.outlets = /* @__PURE__ */ new Map(), this.toastState = q({
|
|
410
410
|
toasts: [],
|
|
@@ -422,7 +422,7 @@ class gs {
|
|
|
422
422
|
* @returns {Object} Notification outlet instance
|
|
423
423
|
*/
|
|
424
424
|
getOutlet(s = "default") {
|
|
425
|
-
return this.outlets.has(s) || this.outlets.set(s,
|
|
425
|
+
return this.outlets.has(s) || this.outlets.set(s, bs()), this.outlets.get(s);
|
|
426
426
|
}
|
|
427
427
|
/**
|
|
428
428
|
* Show a banner notification in the specified outlet
|
|
@@ -493,7 +493,7 @@ class gs {
|
|
|
493
493
|
* @param {boolean} options.newestOnTop - Whether newest toasts appear on top (default: true)
|
|
494
494
|
*/
|
|
495
495
|
configureToasts(s = {}) {
|
|
496
|
-
s.maxToasts !== void 0 && (this.toastState.maxToasts = s.maxToasts), s.defaultPosition !== void 0 &&
|
|
496
|
+
s.maxToasts !== void 0 && (this.toastState.maxToasts = s.maxToasts), s.defaultPosition !== void 0 && we.includes(s.defaultPosition) && (this.toastState.defaultPosition = s.defaultPosition), s.newestOnTop !== void 0 && (this.toastState.newestOnTop = s.newestOnTop);
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
499
499
|
* Show a toast notification
|
|
@@ -510,20 +510,20 @@ class gs {
|
|
|
510
510
|
toast(s = {}) {
|
|
511
511
|
const {
|
|
512
512
|
type: t = "info",
|
|
513
|
-
message:
|
|
513
|
+
message: o = null,
|
|
514
514
|
component: l = null,
|
|
515
515
|
props: n = {},
|
|
516
|
-
closeable:
|
|
516
|
+
closeable: a = !0,
|
|
517
517
|
duration: c = null,
|
|
518
518
|
position: r = null
|
|
519
|
-
} = s, i = ++this._toastIdCounter, u = r &&
|
|
519
|
+
} = s, i = ++this._toastIdCounter, u = r && we.includes(r) ? r : this.toastState.defaultPosition, d = c !== null ? c : Ie[t], f = {
|
|
520
520
|
id: i,
|
|
521
521
|
type: t,
|
|
522
|
-
message:
|
|
523
|
-
component: l ?
|
|
522
|
+
message: o,
|
|
523
|
+
component: l ? fe(l) : null,
|
|
524
524
|
props: n,
|
|
525
|
-
closeable:
|
|
526
|
-
duration:
|
|
525
|
+
closeable: a,
|
|
526
|
+
duration: d,
|
|
527
527
|
position: u,
|
|
528
528
|
createdAt: Date.now()
|
|
529
529
|
}, y = this.toastState.toasts.filter((k) => k.position === u);
|
|
@@ -536,7 +536,7 @@ class gs {
|
|
|
536
536
|
k === -1 ? this.toastState.toasts.push(f) : this.toastState.toasts.splice(k, 0, f);
|
|
537
537
|
} else
|
|
538
538
|
this.toastState.toasts.push(f);
|
|
539
|
-
return
|
|
539
|
+
return d > 0 && this._startToastTimer(i, d), i;
|
|
540
540
|
}
|
|
541
541
|
/**
|
|
542
542
|
* Hide a specific toast by ID
|
|
@@ -544,7 +544,7 @@ class gs {
|
|
|
544
544
|
*/
|
|
545
545
|
hideToast(s) {
|
|
546
546
|
this._clearToastTimer(s);
|
|
547
|
-
const t = this.toastState.toasts.findIndex((
|
|
547
|
+
const t = this.toastState.toasts.findIndex((o) => o.id === s);
|
|
548
548
|
t !== -1 && this.toastState.toasts.splice(t, 1);
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
@@ -563,8 +563,8 @@ class gs {
|
|
|
563
563
|
const t = this._toastTimers.get(s);
|
|
564
564
|
if (!t || t.isPaused) return;
|
|
565
565
|
clearTimeout(t.timeout), t.timeout = null;
|
|
566
|
-
const
|
|
567
|
-
t.remainingTime = Math.max(0, t.remainingTime -
|
|
566
|
+
const o = Date.now() - t.startedAt;
|
|
567
|
+
t.remainingTime = Math.max(0, t.remainingTime - o), t.isPaused = !0;
|
|
568
568
|
}
|
|
569
569
|
/**
|
|
570
570
|
* Resume auto-dismiss timer for a specific toast
|
|
@@ -591,15 +591,15 @@ class gs {
|
|
|
591
591
|
* @private
|
|
592
592
|
*/
|
|
593
593
|
_startToastTimer(s, t) {
|
|
594
|
-
const
|
|
594
|
+
const o = {
|
|
595
595
|
timeout: null,
|
|
596
596
|
remainingTime: t,
|
|
597
597
|
startedAt: Date.now(),
|
|
598
598
|
isPaused: !1
|
|
599
599
|
};
|
|
600
|
-
|
|
600
|
+
o.timeout = setTimeout(() => {
|
|
601
601
|
this.hideToast(s);
|
|
602
|
-
}, t), this._toastTimers.set(s,
|
|
602
|
+
}, t), this._toastTimers.set(s, o);
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
605
605
|
* @private
|
|
@@ -609,7 +609,7 @@ class gs {
|
|
|
609
609
|
t && (t.timeout && clearTimeout(t.timeout), this._toastTimers.delete(s));
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
const
|
|
612
|
+
const X = new xs(), nn = {
|
|
613
613
|
__name: "SparkNotificationOutlet",
|
|
614
614
|
props: {
|
|
615
615
|
name: {
|
|
@@ -618,21 +618,21 @@ const G = new gs(), Gr = {
|
|
|
618
618
|
}
|
|
619
619
|
},
|
|
620
620
|
setup(e) {
|
|
621
|
-
const s = e, t = S(() =>
|
|
622
|
-
|
|
621
|
+
const s = e, t = S(() => X.getOutlet(s.name)), o = E(0);
|
|
622
|
+
I(
|
|
623
623
|
() => [t.value.state.message, t.value.state.component, t.value.state.type],
|
|
624
624
|
() => {
|
|
625
|
-
t.value.state.isVisible &&
|
|
625
|
+
t.value.state.isVisible && o.value++;
|
|
626
626
|
}
|
|
627
627
|
);
|
|
628
628
|
const l = () => {
|
|
629
|
-
|
|
629
|
+
X.hide(s.name);
|
|
630
630
|
}, n = () => {
|
|
631
|
-
|
|
632
|
-
},
|
|
633
|
-
|
|
631
|
+
X.pause(s.name);
|
|
632
|
+
}, a = () => {
|
|
633
|
+
X.resume(s.name);
|
|
634
634
|
};
|
|
635
|
-
return (c, r) => (m(),
|
|
635
|
+
return (c, r) => (m(), V(Ue, {
|
|
636
636
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
637
637
|
"enter-from-class": "opacity-0 -translate-y-2",
|
|
638
638
|
"enter-to-class": "opacity-100 translate-y-0",
|
|
@@ -642,48 +642,48 @@ const G = new gs(), Gr = {
|
|
|
642
642
|
mode: "out-in"
|
|
643
643
|
}, {
|
|
644
644
|
default: C(() => [
|
|
645
|
-
t.value.state.isVisible ? (m(),
|
|
646
|
-
key:
|
|
645
|
+
t.value.state.isVisible ? (m(), V(se, {
|
|
646
|
+
key: o.value,
|
|
647
647
|
type: t.value.state.type,
|
|
648
648
|
closeable: t.value.state.closeable,
|
|
649
649
|
onClose: l,
|
|
650
650
|
onMouseenter: n,
|
|
651
|
-
onMouseleave:
|
|
651
|
+
onMouseleave: a
|
|
652
652
|
}, {
|
|
653
653
|
default: C(() => [
|
|
654
|
-
t.value.state.component ? (m(),
|
|
654
|
+
t.value.state.component ? (m(), V(N(t.value.state.component), Ke(Z({ key: 0 }, t.value.state.props)), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
655
655
|
B(L(t.value.state.message), 1)
|
|
656
656
|
], 64))
|
|
657
657
|
]),
|
|
658
658
|
_: 1
|
|
659
|
-
}, 8, ["type", "closeable"])) :
|
|
659
|
+
}, 8, ["type", "closeable"])) : T("", !0)
|
|
660
660
|
]),
|
|
661
661
|
_: 1
|
|
662
662
|
}));
|
|
663
663
|
}
|
|
664
|
-
},
|
|
664
|
+
}, ks = { class: "fixed top-4 left-4 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, _s = { class: "fixed top-4 right-4 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, ws = { 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" }, Ss = { class: "fixed bottom-4 left-4 z-[2000] flex flex-col-reverse gap-3 max-w-sm w-full pointer-events-none" }, Cs = { class: "fixed bottom-4 right-4 z-[2000] flex flex-col-reverse gap-3 max-w-sm w-full pointer-events-none" }, ln = {
|
|
665
665
|
__name: "SparkToastContainer",
|
|
666
666
|
setup(e) {
|
|
667
|
-
const s =
|
|
667
|
+
const s = X.toastState, t = S(
|
|
668
668
|
() => s.toasts.filter((u) => u.position === "top-left")
|
|
669
|
-
),
|
|
669
|
+
), o = S(
|
|
670
670
|
() => s.toasts.filter((u) => u.position === "top-right")
|
|
671
671
|
), l = S(
|
|
672
672
|
() => s.toasts.filter((u) => u.position === "center")
|
|
673
673
|
), n = S(
|
|
674
674
|
() => s.toasts.filter((u) => u.position === "bottom-left")
|
|
675
|
-
),
|
|
675
|
+
), a = S(
|
|
676
676
|
() => s.toasts.filter((u) => u.position === "bottom-right")
|
|
677
677
|
), c = (u) => {
|
|
678
|
-
|
|
678
|
+
X.hideToast(u);
|
|
679
679
|
}, r = (u) => {
|
|
680
|
-
|
|
680
|
+
X.pauseToast(u);
|
|
681
681
|
}, i = (u) => {
|
|
682
|
-
|
|
682
|
+
X.resumeToast(u);
|
|
683
683
|
};
|
|
684
|
-
return (u,
|
|
685
|
-
|
|
686
|
-
|
|
684
|
+
return (u, d) => (m(), V(Ge, { to: "body" }, [
|
|
685
|
+
p("div", ks, [
|
|
686
|
+
b(le, {
|
|
687
687
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
688
688
|
"enter-from-class": "opacity-0 -translate-x-4",
|
|
689
689
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -696,7 +696,7 @@ const G = new gs(), Gr = {
|
|
|
696
696
|
key: f.id,
|
|
697
697
|
class: "pointer-events-auto"
|
|
698
698
|
}, [
|
|
699
|
-
|
|
699
|
+
b(se, {
|
|
700
700
|
type: f.type,
|
|
701
701
|
closeable: f.closeable,
|
|
702
702
|
onClose: (y) => c(f.id),
|
|
@@ -704,7 +704,7 @@ const G = new gs(), Gr = {
|
|
|
704
704
|
onMouseleave: (y) => i(f.id)
|
|
705
705
|
}, {
|
|
706
706
|
default: C(() => [
|
|
707
|
-
f.component ? (m(),
|
|
707
|
+
f.component ? (m(), V(N(f.component), Z({
|
|
708
708
|
key: 0,
|
|
709
709
|
ref_for: !0
|
|
710
710
|
}, f.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
@@ -718,8 +718,8 @@ const G = new gs(), Gr = {
|
|
|
718
718
|
_: 1
|
|
719
719
|
})
|
|
720
720
|
]),
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
p("div", _s, [
|
|
722
|
+
b(le, {
|
|
723
723
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
724
724
|
"enter-from-class": "opacity-0 translate-x-4",
|
|
725
725
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -728,11 +728,11 @@ const G = new gs(), Gr = {
|
|
|
728
728
|
"leave-to-class": "opacity-0 translate-x-4"
|
|
729
729
|
}, {
|
|
730
730
|
default: C(() => [
|
|
731
|
-
(m(!0), g(R, null, z(
|
|
731
|
+
(m(!0), g(R, null, z(o.value, (f) => (m(), g("div", {
|
|
732
732
|
key: f.id,
|
|
733
733
|
class: "pointer-events-auto"
|
|
734
734
|
}, [
|
|
735
|
-
|
|
735
|
+
b(se, {
|
|
736
736
|
type: f.type,
|
|
737
737
|
closeable: f.closeable,
|
|
738
738
|
onClose: (y) => c(f.id),
|
|
@@ -740,7 +740,7 @@ const G = new gs(), Gr = {
|
|
|
740
740
|
onMouseleave: (y) => i(f.id)
|
|
741
741
|
}, {
|
|
742
742
|
default: C(() => [
|
|
743
|
-
f.component ? (m(),
|
|
743
|
+
f.component ? (m(), V(N(f.component), Z({
|
|
744
744
|
key: 0,
|
|
745
745
|
ref_for: !0
|
|
746
746
|
}, f.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
@@ -754,8 +754,8 @@ const G = new gs(), Gr = {
|
|
|
754
754
|
_: 1
|
|
755
755
|
})
|
|
756
756
|
]),
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
p("div", ws, [
|
|
758
|
+
b(le, {
|
|
759
759
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
760
760
|
"enter-from-class": "opacity-0 scale-95",
|
|
761
761
|
"enter-to-class": "opacity-100 scale-100",
|
|
@@ -768,7 +768,7 @@ const G = new gs(), Gr = {
|
|
|
768
768
|
key: f.id,
|
|
769
769
|
class: "pointer-events-auto"
|
|
770
770
|
}, [
|
|
771
|
-
|
|
771
|
+
b(se, {
|
|
772
772
|
type: f.type,
|
|
773
773
|
closeable: f.closeable,
|
|
774
774
|
onClose: (y) => c(f.id),
|
|
@@ -776,7 +776,7 @@ const G = new gs(), Gr = {
|
|
|
776
776
|
onMouseleave: (y) => i(f.id)
|
|
777
777
|
}, {
|
|
778
778
|
default: C(() => [
|
|
779
|
-
f.component ? (m(),
|
|
779
|
+
f.component ? (m(), V(N(f.component), Z({
|
|
780
780
|
key: 0,
|
|
781
781
|
ref_for: !0
|
|
782
782
|
}, f.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
@@ -790,8 +790,8 @@ const G = new gs(), Gr = {
|
|
|
790
790
|
_: 1
|
|
791
791
|
})
|
|
792
792
|
]),
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
p("div", Ss, [
|
|
794
|
+
b(le, {
|
|
795
795
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
796
796
|
"enter-from-class": "opacity-0 -translate-x-4",
|
|
797
797
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -804,7 +804,7 @@ const G = new gs(), Gr = {
|
|
|
804
804
|
key: f.id,
|
|
805
805
|
class: "pointer-events-auto"
|
|
806
806
|
}, [
|
|
807
|
-
|
|
807
|
+
b(se, {
|
|
808
808
|
type: f.type,
|
|
809
809
|
closeable: f.closeable,
|
|
810
810
|
onClose: (y) => c(f.id),
|
|
@@ -812,7 +812,7 @@ const G = new gs(), Gr = {
|
|
|
812
812
|
onMouseleave: (y) => i(f.id)
|
|
813
813
|
}, {
|
|
814
814
|
default: C(() => [
|
|
815
|
-
f.component ? (m(),
|
|
815
|
+
f.component ? (m(), V(N(f.component), Z({
|
|
816
816
|
key: 0,
|
|
817
817
|
ref_for: !0
|
|
818
818
|
}, f.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
@@ -826,8 +826,8 @@ const G = new gs(), Gr = {
|
|
|
826
826
|
_: 1
|
|
827
827
|
})
|
|
828
828
|
]),
|
|
829
|
-
|
|
830
|
-
|
|
829
|
+
p("div", Cs, [
|
|
830
|
+
b(le, {
|
|
831
831
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
832
832
|
"enter-from-class": "opacity-0 translate-x-4",
|
|
833
833
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -836,11 +836,11 @@ const G = new gs(), Gr = {
|
|
|
836
836
|
"leave-to-class": "opacity-0 translate-x-4"
|
|
837
837
|
}, {
|
|
838
838
|
default: C(() => [
|
|
839
|
-
(m(!0), g(R, null, z(
|
|
839
|
+
(m(!0), g(R, null, z(a.value, (f) => (m(), g("div", {
|
|
840
840
|
key: f.id,
|
|
841
841
|
class: "pointer-events-auto"
|
|
842
842
|
}, [
|
|
843
|
-
|
|
843
|
+
b(se, {
|
|
844
844
|
type: f.type,
|
|
845
845
|
closeable: f.closeable,
|
|
846
846
|
onClose: (y) => c(f.id),
|
|
@@ -848,7 +848,7 @@ const G = new gs(), Gr = {
|
|
|
848
848
|
onMouseleave: (y) => i(f.id)
|
|
849
849
|
}, {
|
|
850
850
|
default: C(() => [
|
|
851
|
-
f.component ? (m(),
|
|
851
|
+
f.component ? (m(), V(N(f.component), Z({
|
|
852
852
|
key: 0,
|
|
853
853
|
ref_for: !0
|
|
854
854
|
}, f.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
@@ -864,7 +864,7 @@ const G = new gs(), Gr = {
|
|
|
864
864
|
])
|
|
865
865
|
]));
|
|
866
866
|
}
|
|
867
|
-
},
|
|
867
|
+
}, Ne = ue(
|
|
868
868
|
"brandFilter",
|
|
869
869
|
() => {
|
|
870
870
|
const e = q({
|
|
@@ -874,31 +874,31 @@ const G = new gs(), Gr = {
|
|
|
874
874
|
console.warn("useSparkBrandFilterStore: No brands provided to initialize()"), e.brands = [];
|
|
875
875
|
return;
|
|
876
876
|
}
|
|
877
|
-
const
|
|
877
|
+
const a = n.brands.filter((r) => {
|
|
878
878
|
const i = r.name && r.logo;
|
|
879
879
|
return i || console.warn("useSparkBrandFilterStore: Invalid brand object", r), i;
|
|
880
|
-
}), c =
|
|
881
|
-
c.length === 0 &&
|
|
880
|
+
}), c = a.filter((r) => r.current);
|
|
881
|
+
c.length === 0 && a.length > 0 ? a[0].current = !0 : c.length > 1 && a.forEach((r) => {
|
|
882
882
|
r.current = r === c[0];
|
|
883
|
-
}), e.brands =
|
|
883
|
+
}), e.brands = a.map((r) => ({
|
|
884
884
|
id: r.id,
|
|
885
885
|
name: r.name,
|
|
886
886
|
logo: r.logo,
|
|
887
887
|
current: r.current || !1
|
|
888
888
|
}));
|
|
889
|
-
}, t = S(() => e.brands.find((n) => n.current) || null),
|
|
889
|
+
}, t = S(() => e.brands.find((n) => n.current) || null), o = S(() => e.brands);
|
|
890
890
|
return {
|
|
891
891
|
state: e,
|
|
892
892
|
initialize: s,
|
|
893
893
|
currentBrand: t,
|
|
894
|
-
allBrands:
|
|
894
|
+
allBrands: o,
|
|
895
895
|
toggleBrand: (n) => {
|
|
896
896
|
if (!n || !e.brands.includes(n)) {
|
|
897
897
|
console.warn("useSparkBrandFilterStore: Invalid brand provided to toggleBrand()");
|
|
898
898
|
return;
|
|
899
899
|
}
|
|
900
|
-
e.brands.forEach((
|
|
901
|
-
|
|
900
|
+
e.brands.forEach((a) => {
|
|
901
|
+
a.current = a === n;
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
904
|
};
|
|
@@ -908,65 +908,65 @@ const G = new gs(), Gr = {
|
|
|
908
908
|
paths: ["state.brands"]
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
),
|
|
911
|
+
), $s = { class: "flex grow flex-col gap-y-5 overflow-y-auto bg-white rounded-lg" }, Ts = { class: "flex flex-1 flex-col" }, Ls = { class: "divide-y divide-gray-200" }, Ps = { class: "flex px-[22px] py-2.5 text-[12px] items-center" }, Ms = { class: "ml-auto flex items-center" }, Hs = {
|
|
912
912
|
key: 0,
|
|
913
913
|
class: "flex px-[22px] py-[15px] text-gray-500 text-sm"
|
|
914
|
-
},
|
|
914
|
+
}, Vs = ["onClick"], Rs = { class: "w-full gap-y-1 flex justify-between" }, Bs = { class: "flex flex-col" }, Es = { class: "flex items-center" }, As = { class: "font-medium text-base text-gray-900" }, Os = {
|
|
915
915
|
key: 0,
|
|
916
916
|
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"
|
|
917
|
-
},
|
|
917
|
+
}, Fs = { class: "text-sm text-gray-500 font-normal" }, zs = { class: "flex items-center" }, Ds = ["src", "alt"], js = {
|
|
918
918
|
__name: "SparkBrandSelector",
|
|
919
919
|
emits: ["close", "select"],
|
|
920
920
|
setup(e, { emit: s }) {
|
|
921
|
-
const t = s,
|
|
921
|
+
const t = s, o = Ne(), l = (n) => {
|
|
922
922
|
t("select", n);
|
|
923
923
|
};
|
|
924
|
-
return (n,
|
|
924
|
+
return (n, a) => {
|
|
925
925
|
const c = A("font-awesome-icon");
|
|
926
|
-
return m(), g("div",
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
icon:
|
|
926
|
+
return m(), g("div", $s, [
|
|
927
|
+
p("div", Ts, [
|
|
928
|
+
p("div", Ls, [
|
|
929
|
+
p("div", Ps, [
|
|
930
|
+
a[1] || (a[1] = p("div", null, "Filter by Brand", -1)),
|
|
931
|
+
p("div", Ms, [
|
|
932
|
+
b(c, {
|
|
933
|
+
icon: _(O).farTimes,
|
|
934
934
|
class: "size-4 text-gray-400 cursor-pointer",
|
|
935
|
-
onClick:
|
|
935
|
+
onClick: a[0] || (a[0] = (r) => t("close"))
|
|
936
936
|
}, null, 8, ["icon"])
|
|
937
937
|
])
|
|
938
938
|
]),
|
|
939
|
-
|
|
940
|
-
(m(!0), g(R, null, z(
|
|
939
|
+
_(o).allBrands.length === 0 ? (m(), g("div", Hs, " No brands configured ")) : T("", !0),
|
|
940
|
+
(m(!0), g(R, null, z(_(o).allBrands, (r) => (m(), g("div", {
|
|
941
941
|
key: r.id,
|
|
942
|
-
class:
|
|
942
|
+
class: H([r.current ? "bg-gray-50" : "hover:bg-gray-50", "flex px-[22px] py-[15px] cursor-pointer"]),
|
|
943
943
|
onClick: (i) => l(r)
|
|
944
944
|
}, [
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
r.current ? (m(), g("span",
|
|
945
|
+
p("div", Rs, [
|
|
946
|
+
p("div", Bs, [
|
|
947
|
+
p("div", Es, [
|
|
948
|
+
p("div", As, L(r.name), 1),
|
|
949
|
+
r.current ? (m(), g("span", Os, " Current ")) : T("", !0)
|
|
950
950
|
]),
|
|
951
|
-
|
|
951
|
+
p("div", Fs, L(r.current ? "Current Brand" : "Change to"), 1)
|
|
952
952
|
]),
|
|
953
|
-
|
|
954
|
-
|
|
953
|
+
p("div", zs, [
|
|
954
|
+
p("img", {
|
|
955
955
|
src: r.logo,
|
|
956
956
|
alt: `${r.name} logo`,
|
|
957
957
|
class: "h-8 w-auto"
|
|
958
|
-
}, null, 8,
|
|
958
|
+
}, null, 8, Ds)
|
|
959
959
|
])
|
|
960
960
|
])
|
|
961
|
-
], 10,
|
|
962
|
-
|
|
961
|
+
], 10, Vs))), 128)),
|
|
962
|
+
a[2] || (a[2] = p("div", null, null, -1))
|
|
963
963
|
]),
|
|
964
|
-
|
|
964
|
+
a[3] || (a[3] = p("div", { class: "mt-auto" }, null, -1))
|
|
965
965
|
])
|
|
966
966
|
]);
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
},
|
|
969
|
+
}, Is = ["disabled"], K = {
|
|
970
970
|
__name: "SparkButton",
|
|
971
971
|
props: {
|
|
972
972
|
size: {
|
|
@@ -989,9 +989,9 @@ const G = new gs(), Gr = {
|
|
|
989
989
|
},
|
|
990
990
|
emits: ["click"],
|
|
991
991
|
setup(e) {
|
|
992
|
-
const s = e, t = E(null),
|
|
993
|
-
if (!
|
|
994
|
-
const r =
|
|
992
|
+
const s = e, t = E(null), o = Ve("buttonGroup", null), l = S(() => {
|
|
993
|
+
if (!o?.isInGroup || !t.value) return null;
|
|
994
|
+
const r = o.getButtonIndex(t.value), i = o.getButtonCount();
|
|
995
995
|
return {
|
|
996
996
|
isFirst: r === 0,
|
|
997
997
|
isLast: r === i - 1,
|
|
@@ -1008,17 +1008,17 @@ const G = new gs(), Gr = {
|
|
|
1008
1008
|
borderRadius: /^rounded-/,
|
|
1009
1009
|
background: /^bg-/,
|
|
1010
1010
|
text: /^text-(?!white|black)/
|
|
1011
|
-
},
|
|
1011
|
+
}, a = (r, i) => {
|
|
1012
1012
|
if (!i) return r;
|
|
1013
|
-
const u = r.split(" ").filter(Boolean),
|
|
1014
|
-
return [...u.filter((y) => !
|
|
1013
|
+
const u = r.split(" ").filter(Boolean), d = i.split(" ").filter(Boolean);
|
|
1014
|
+
return [...u.filter((y) => !d.some((k) => {
|
|
1015
1015
|
const h = Object.entries(n).find(
|
|
1016
|
-
([
|
|
1017
|
-
)?.[0],
|
|
1018
|
-
([
|
|
1016
|
+
([P, w]) => w.test(y)
|
|
1017
|
+
)?.[0], x = Object.entries(n).find(
|
|
1018
|
+
([P, w]) => w.test(k)
|
|
1019
1019
|
)?.[0];
|
|
1020
|
-
return h && h ===
|
|
1021
|
-
})), ...
|
|
1020
|
+
return h && h === x;
|
|
1021
|
+
})), ...d].join(" ");
|
|
1022
1022
|
}, c = S(() => {
|
|
1023
1023
|
let r = "", i = "";
|
|
1024
1024
|
switch (s.size) {
|
|
@@ -1038,9 +1038,9 @@ const G = new gs(), Gr = {
|
|
|
1038
1038
|
r += " px-3.5 py-2.5 min-h-[42px] text-sm", i = "md";
|
|
1039
1039
|
break;
|
|
1040
1040
|
}
|
|
1041
|
-
if (
|
|
1042
|
-
const { isFirst: u, isLast:
|
|
1043
|
-
r += " relative inline-flex items-center focus:z-10", u &&
|
|
1041
|
+
if (o?.isInGroup && l.value) {
|
|
1042
|
+
const { isFirst: u, isLast: d } = l.value;
|
|
1043
|
+
r += " relative inline-flex items-center focus:z-10", u && d ? r += ` rounded-${i}` : u ? r += ` rounded-l-${i} rounded-r-none` : d ? r += ` rounded-r-${i} rounded-l-none -ml-px` : r += " rounded-none -ml-px";
|
|
1044
1044
|
} else
|
|
1045
1045
|
r += ` shadow-xs rounded-${i}`;
|
|
1046
1046
|
switch (s.variant) {
|
|
@@ -1065,24 +1065,24 @@ const G = new gs(), Gr = {
|
|
|
1065
1065
|
default:
|
|
1066
1066
|
r += ` bg-${s.variant}-600 hover:bg-${s.variant}-500 text-white`;
|
|
1067
1067
|
}
|
|
1068
|
-
return r =
|
|
1068
|
+
return r = a(r, s.buttonClass), r;
|
|
1069
1069
|
});
|
|
1070
1070
|
return (r, i) => (m(), g("button", {
|
|
1071
1071
|
type: "button",
|
|
1072
1072
|
ref_key: "buttonRef",
|
|
1073
1073
|
ref: t,
|
|
1074
|
-
class:
|
|
1074
|
+
class: H(c.value),
|
|
1075
1075
|
disabled: e.disabled,
|
|
1076
1076
|
onClick: i[0] || (i[0] = (u) => r.$emit("click"))
|
|
1077
1077
|
}, [
|
|
1078
|
-
|
|
1079
|
-
], 10,
|
|
1078
|
+
F(r.$slots, "default")
|
|
1079
|
+
], 10, Is));
|
|
1080
1080
|
}
|
|
1081
|
-
},
|
|
1081
|
+
}, Ns = {
|
|
1082
1082
|
__name: "SparkButtonGroup",
|
|
1083
1083
|
setup(e) {
|
|
1084
1084
|
const s = E(null);
|
|
1085
|
-
return
|
|
1085
|
+
return We("buttonGroup", {
|
|
1086
1086
|
isInGroup: !0,
|
|
1087
1087
|
getButtonIndex: (l) => s.value ? Array.from(s.value.children).indexOf(l) : -1,
|
|
1088
1088
|
getButtonCount: () => s.value?.children.length || 0
|
|
@@ -1091,16 +1091,16 @@ const G = new gs(), Gr = {
|
|
|
1091
1091
|
ref_key: "groupRef",
|
|
1092
1092
|
ref: s
|
|
1093
1093
|
}, [
|
|
1094
|
-
|
|
1094
|
+
F(l.$slots, "default")
|
|
1095
1095
|
], 512));
|
|
1096
1096
|
}
|
|
1097
|
-
},
|
|
1097
|
+
}, Zs = { class: "divide-y divide-gray-300 rounded-lg border border-gray-300 text-gray-700 bg-gray-100" }, qs = {
|
|
1098
1098
|
key: 0,
|
|
1099
1099
|
class: "p-5"
|
|
1100
|
-
},
|
|
1100
|
+
}, Us = {
|
|
1101
1101
|
key: 1,
|
|
1102
1102
|
class: "p-5"
|
|
1103
|
-
},
|
|
1103
|
+
}, cn = {
|
|
1104
1104
|
__name: "SparkCard",
|
|
1105
1105
|
props: {
|
|
1106
1106
|
padded: {
|
|
@@ -1114,24 +1114,24 @@ const G = new gs(), Gr = {
|
|
|
1114
1114
|
},
|
|
1115
1115
|
setup(e) {
|
|
1116
1116
|
const s = e;
|
|
1117
|
-
return (t,
|
|
1118
|
-
t.$slots.header ? (m(), g("div",
|
|
1119
|
-
|
|
1120
|
-
])) :
|
|
1121
|
-
|
|
1122
|
-
class:
|
|
1117
|
+
return (t, o) => (m(), g("div", Zs, [
|
|
1118
|
+
t.$slots.header ? (m(), g("div", qs, [
|
|
1119
|
+
F(t.$slots, "header")
|
|
1120
|
+
])) : T("", !0),
|
|
1121
|
+
p("div", {
|
|
1122
|
+
class: H([s.padded ? s.paddedClass : ""])
|
|
1123
1123
|
}, [
|
|
1124
|
-
|
|
1124
|
+
F(t.$slots, "default")
|
|
1125
1125
|
], 2),
|
|
1126
|
-
t.$slots.footer ? (m(), g("div",
|
|
1127
|
-
|
|
1128
|
-
])) :
|
|
1126
|
+
t.$slots.footer ? (m(), g("div", Us, [
|
|
1127
|
+
F(t.$slots, "footer")
|
|
1128
|
+
])) : T("", !0)
|
|
1129
1129
|
]));
|
|
1130
1130
|
}
|
|
1131
|
-
},
|
|
1131
|
+
}, Ks = { class: "px-4 pt-5 pb-4 sm:p-6" }, Gs = {
|
|
1132
1132
|
key: 0,
|
|
1133
1133
|
class: "text-lg font-medium text-gray-900"
|
|
1134
|
-
},
|
|
1134
|
+
}, Ws = {
|
|
1135
1135
|
__name: "SparkModalDialog",
|
|
1136
1136
|
props: {
|
|
1137
1137
|
title: {
|
|
@@ -1181,7 +1181,7 @@ const G = new gs(), Gr = {
|
|
|
1181
1181
|
"input"
|
|
1182
1182
|
],
|
|
1183
1183
|
setup(e) {
|
|
1184
|
-
const s = e, t = S(() => !s.buttons || s.buttons.length === 0 ? [{ text: "OK", variant: "primary", event: "ok" }] : s.buttons),
|
|
1184
|
+
const s = e, t = S(() => !s.buttons || s.buttons.length === 0 ? [{ text: "OK", variant: "primary", event: "ok" }] : s.buttons), o = S(() => {
|
|
1185
1185
|
switch (t.value.length) {
|
|
1186
1186
|
case 1:
|
|
1187
1187
|
return "sm:grid sm:grid-flow-row-dense";
|
|
@@ -1197,7 +1197,7 @@ const G = new gs(), Gr = {
|
|
|
1197
1197
|
success: "farCheckCircle",
|
|
1198
1198
|
warning: "farExclamationTriangle",
|
|
1199
1199
|
danger: "farCircleXmark"
|
|
1200
|
-
}, n = S(() => s.icon || l[s.type]),
|
|
1200
|
+
}, n = S(() => s.icon || l[s.type]), a = S(() => ({
|
|
1201
1201
|
info: "bg-blue-100",
|
|
1202
1202
|
success: "bg-green-100",
|
|
1203
1203
|
warning: "bg-yellow-100",
|
|
@@ -1210,35 +1210,35 @@ const G = new gs(), Gr = {
|
|
|
1210
1210
|
})[s.type]);
|
|
1211
1211
|
return (r, i) => {
|
|
1212
1212
|
const u = A("font-awesome-icon");
|
|
1213
|
-
return m(), g("div",
|
|
1213
|
+
return m(), g("div", Ks, [
|
|
1214
1214
|
n.value ? (m(), g("div", {
|
|
1215
1215
|
key: 0,
|
|
1216
|
-
class:
|
|
1216
|
+
class: H(["mx-auto flex size-12 items-center justify-center rounded-full", a.value])
|
|
1217
1217
|
}, [
|
|
1218
|
-
|
|
1219
|
-
icon:
|
|
1220
|
-
class:
|
|
1218
|
+
b(u, {
|
|
1219
|
+
icon: _(O)[n.value],
|
|
1220
|
+
class: H(["h-5 w-5", c.value])
|
|
1221
1221
|
}, null, 8, ["icon", "class"])
|
|
1222
|
-
], 2)) :
|
|
1223
|
-
|
|
1224
|
-
class:
|
|
1222
|
+
], 2)) : T("", !0),
|
|
1223
|
+
p("div", {
|
|
1224
|
+
class: H(["text-center", { "mt-3 sm:mt-5": n.value }])
|
|
1225
1225
|
}, [
|
|
1226
|
-
e.title ? (m(), g("h3",
|
|
1226
|
+
e.title ? (m(), g("h3", Gs, L(e.title), 1)) : T("", !0),
|
|
1227
1227
|
e.message ? (m(), g("div", {
|
|
1228
1228
|
key: 1,
|
|
1229
|
-
class:
|
|
1230
|
-
}, L(e.message), 3)) :
|
|
1229
|
+
class: H([{ "mt-2": e.title }, "text-sm text-gray-500"])
|
|
1230
|
+
}, L(e.message), 3)) : T("", !0)
|
|
1231
1231
|
], 2),
|
|
1232
|
-
|
|
1233
|
-
class:
|
|
1232
|
+
p("div", {
|
|
1233
|
+
class: H(["mt-5 sm:mt-6", o.value])
|
|
1234
1234
|
}, [
|
|
1235
|
-
(m(!0), g(R, null, z(t.value, (
|
|
1235
|
+
(m(!0), g(R, null, z(t.value, (d, f) => (m(), V(_(K), {
|
|
1236
1236
|
key: f,
|
|
1237
|
-
variant:
|
|
1238
|
-
onClick: (y) => r.$emit(
|
|
1237
|
+
variant: d.variant,
|
|
1238
|
+
onClick: (y) => r.$emit(d.event, d)
|
|
1239
1239
|
}, {
|
|
1240
1240
|
default: C(() => [
|
|
1241
|
-
B(L(
|
|
1241
|
+
B(L(d.text), 1)
|
|
1242
1242
|
]),
|
|
1243
1243
|
_: 2
|
|
1244
1244
|
}, 1032, ["variant", "onClick"]))), 128))
|
|
@@ -1247,7 +1247,7 @@ const G = new gs(), Gr = {
|
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
|
-
class
|
|
1250
|
+
class Ys {
|
|
1251
1251
|
constructor() {
|
|
1252
1252
|
this.state = q({
|
|
1253
1253
|
isVisible: !1,
|
|
@@ -1256,8 +1256,8 @@ class Ks {
|
|
|
1256
1256
|
eventHandlers: {}
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
|
-
show = (s, t = {},
|
|
1260
|
-
this.state.content =
|
|
1259
|
+
show = (s, t = {}, o = {}) => {
|
|
1260
|
+
this.state.content = fe(s), this.state.props = t, this.state.eventHandlers = o, this.state.isVisible = !0;
|
|
1261
1261
|
};
|
|
1262
1262
|
hide = () => {
|
|
1263
1263
|
this.state.isVisible = !1, this.state.eventHandlers = {};
|
|
@@ -1276,21 +1276,21 @@ class Ks {
|
|
|
1276
1276
|
*/
|
|
1277
1277
|
confirm = (s = {}) => new Promise((t) => {
|
|
1278
1278
|
const {
|
|
1279
|
-
title:
|
|
1279
|
+
title: o = "Confirm",
|
|
1280
1280
|
message: l = "Are you sure?",
|
|
1281
1281
|
type: n = "warning",
|
|
1282
|
-
confirmText:
|
|
1282
|
+
confirmText: a = "Confirm",
|
|
1283
1283
|
cancelText: c = "Cancel",
|
|
1284
1284
|
confirmVariant: r = "primary"
|
|
1285
1285
|
} = s;
|
|
1286
1286
|
this.show(
|
|
1287
|
-
|
|
1287
|
+
Ws,
|
|
1288
1288
|
{
|
|
1289
|
-
title:
|
|
1289
|
+
title: o,
|
|
1290
1290
|
message: l,
|
|
1291
1291
|
type: n,
|
|
1292
1292
|
buttons: [
|
|
1293
|
-
{ text:
|
|
1293
|
+
{ text: a, variant: r, event: "confirm" },
|
|
1294
1294
|
{ text: c, variant: "secondary", event: "cancel" }
|
|
1295
1295
|
]
|
|
1296
1296
|
},
|
|
@@ -1305,20 +1305,20 @@ class Ks {
|
|
|
1305
1305
|
);
|
|
1306
1306
|
});
|
|
1307
1307
|
}
|
|
1308
|
-
const
|
|
1308
|
+
const oe = new Ys(), Xs = { class: "fixed inset-0 z-10 w-screen overflow-y-auto" }, Js = { class: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0" }, Qs = {
|
|
1309
1309
|
__name: "SparkModalContainer",
|
|
1310
1310
|
setup(e) {
|
|
1311
|
-
return (s, t) => (m(),
|
|
1311
|
+
return (s, t) => (m(), V(_(Ae), {
|
|
1312
1312
|
as: "template",
|
|
1313
|
-
show:
|
|
1313
|
+
show: _(oe).state.isVisible
|
|
1314
1314
|
}, {
|
|
1315
1315
|
default: C(() => [
|
|
1316
|
-
|
|
1316
|
+
b(_(Oe), {
|
|
1317
1317
|
class: "relative z-1000",
|
|
1318
|
-
onClose:
|
|
1318
|
+
onClose: _(oe).hide
|
|
1319
1319
|
}, {
|
|
1320
1320
|
default: C(() => [
|
|
1321
|
-
|
|
1321
|
+
b(_(pe), {
|
|
1322
1322
|
as: "template",
|
|
1323
1323
|
enter: "ease-out duration-300",
|
|
1324
1324
|
"enter-from": "opacity-0",
|
|
@@ -1328,13 +1328,13 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1328
1328
|
"leave-to": "opacity-0"
|
|
1329
1329
|
}, {
|
|
1330
1330
|
default: C(() => [...t[0] || (t[0] = [
|
|
1331
|
-
|
|
1331
|
+
p("div", { class: "fixed inset-0 bg-gray-500/75 transition-opacity" }, null, -1)
|
|
1332
1332
|
])]),
|
|
1333
1333
|
_: 1
|
|
1334
1334
|
}),
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1335
|
+
p("div", Xs, [
|
|
1336
|
+
p("div", Js, [
|
|
1337
|
+
b(_(pe), {
|
|
1338
1338
|
as: "template",
|
|
1339
1339
|
enter: "ease-out duration-300",
|
|
1340
1340
|
"enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
@@ -1344,9 +1344,9 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1344
1344
|
"leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
1345
1345
|
}, {
|
|
1346
1346
|
default: C(() => [
|
|
1347
|
-
|
|
1347
|
+
b(_(Fe), { 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" }, {
|
|
1348
1348
|
default: C(() => [
|
|
1349
|
-
(m(),
|
|
1349
|
+
(m(), V(N(_(oe).state.content), Z(_(oe).state.props, Re(_(oe).state.eventHandlers)), null, 16))
|
|
1350
1350
|
]),
|
|
1351
1351
|
_: 1
|
|
1352
1352
|
})
|
|
@@ -1362,7 +1362,7 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1362
1362
|
_: 1
|
|
1363
1363
|
}, 8, ["show"]));
|
|
1364
1364
|
}
|
|
1365
|
-
},
|
|
1365
|
+
}, eo = { class: "fixed inset-0 flex" }, Se = {
|
|
1366
1366
|
__name: "SparkOverlay",
|
|
1367
1367
|
props: {
|
|
1368
1368
|
position: {
|
|
@@ -1377,27 +1377,27 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1377
1377
|
},
|
|
1378
1378
|
emits: ["close"],
|
|
1379
1379
|
setup(e, { emit: s }) {
|
|
1380
|
-
const t = E(null),
|
|
1380
|
+
const t = E(null), o = {
|
|
1381
1381
|
xs: "w-[250px]",
|
|
1382
1382
|
sm: "w-[300px]",
|
|
1383
1383
|
md: "w-[450px]",
|
|
1384
1384
|
lg: "w-[810px]",
|
|
1385
1385
|
xl: "w-[1000px]"
|
|
1386
|
-
}, l = e, n = s,
|
|
1386
|
+
}, l = e, n = s, a = S(() => o[l.overlayInstance.state.size] || o.md), c = () => {
|
|
1387
1387
|
l.overlayInstance.close(), n("close");
|
|
1388
1388
|
};
|
|
1389
|
-
return (r, i) => (m(),
|
|
1389
|
+
return (r, i) => (m(), V(_(Ae), {
|
|
1390
1390
|
show: e.overlayInstance.state.isVisible,
|
|
1391
1391
|
as: "template"
|
|
1392
1392
|
}, {
|
|
1393
1393
|
default: C(() => [
|
|
1394
|
-
|
|
1394
|
+
b(_(Oe), {
|
|
1395
1395
|
initialFocus: t.value,
|
|
1396
1396
|
class: "relative z-1000",
|
|
1397
1397
|
onClose: c
|
|
1398
1398
|
}, {
|
|
1399
1399
|
default: C(() => [
|
|
1400
|
-
|
|
1400
|
+
b(_(pe), {
|
|
1401
1401
|
as: "template",
|
|
1402
1402
|
enter: "transition-opacity ease-linear duration-150",
|
|
1403
1403
|
"enter-from": "opacity-0",
|
|
@@ -1407,12 +1407,12 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1407
1407
|
"leave-to": "opacity-0"
|
|
1408
1408
|
}, {
|
|
1409
1409
|
default: C(() => [...i[0] || (i[0] = [
|
|
1410
|
-
|
|
1410
|
+
p("div", { class: "fixed inset-0 bg-gray-600/30" }, null, -1)
|
|
1411
1411
|
])]),
|
|
1412
1412
|
_: 1
|
|
1413
1413
|
}),
|
|
1414
|
-
|
|
1415
|
-
|
|
1414
|
+
p("div", eo, [
|
|
1415
|
+
b(_(pe), {
|
|
1416
1416
|
as: "template",
|
|
1417
1417
|
enter: "transition ease-in-out duration-150 transform",
|
|
1418
1418
|
"enter-from": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0",
|
|
@@ -1422,17 +1422,17 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1422
1422
|
"leave-to": e.position === "left" ? "-translate-x-full opacity-0" : "translate-x-full opacity-0"
|
|
1423
1423
|
}, {
|
|
1424
1424
|
default: C(() => [
|
|
1425
|
-
|
|
1425
|
+
b(_(Fe), {
|
|
1426
1426
|
ref_key: "panelRef",
|
|
1427
1427
|
ref: t,
|
|
1428
|
-
class:
|
|
1428
|
+
class: H([
|
|
1429
1429
|
"flex py-2.5",
|
|
1430
|
-
|
|
1430
|
+
a.value,
|
|
1431
1431
|
e.position === "left" ? "relative left-[10px]" : "absolute right-[10px] h-full"
|
|
1432
1432
|
])
|
|
1433
1433
|
}, {
|
|
1434
1434
|
default: C(() => [
|
|
1435
|
-
(m(),
|
|
1435
|
+
(m(), V(N(e.overlayInstance.state.content), Z(e.overlayInstance.state.props, Re(e.overlayInstance.state.eventHandlers)), null, 16))
|
|
1436
1436
|
]),
|
|
1437
1437
|
_: 1
|
|
1438
1438
|
}, 8, ["class"])
|
|
@@ -1447,34 +1447,34 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1447
1447
|
_: 1
|
|
1448
1448
|
}, 8, ["show"]));
|
|
1449
1449
|
}
|
|
1450
|
-
},
|
|
1450
|
+
}, to = (e) => {
|
|
1451
1451
|
if (e.includes(".")) {
|
|
1452
1452
|
const s = e.split(".");
|
|
1453
1453
|
e = s[s.length - 1];
|
|
1454
1454
|
}
|
|
1455
1455
|
return e.replace(/_/g, " ");
|
|
1456
|
-
},
|
|
1457
|
-
const
|
|
1458
|
-
if (!
|
|
1456
|
+
}, so = (e, s, t) => {
|
|
1457
|
+
const o = s.querySelector(".relative");
|
|
1458
|
+
if (!o || o.querySelector(".spark-table-head-sorting"))
|
|
1459
1459
|
return;
|
|
1460
1460
|
const l = document.createElement("span");
|
|
1461
|
-
l.classList.add("spark-table-head-sorting"), l.innerHTML =
|
|
1462
|
-
const n = t.params.orderBy,
|
|
1463
|
-
return n === e &&
|
|
1461
|
+
l.classList.add("spark-table-head-sorting"), l.innerHTML = ce({ prefix: "fad", iconName: "sort" }).html + ce({ prefix: "fad", iconName: "sort-up" }).html + ce({ prefix: "fad", iconName: "sort-down" }).html, o.appendChild(l), o.addEventListener("click", async () => {
|
|
1462
|
+
const n = t.params.orderBy, a = t.params.sortedBy;
|
|
1463
|
+
return n === e && a === "asc" ? (o.classList.remove("asc"), o.classList.add("desc"), t.methods.applyParams({
|
|
1464
1464
|
orderBy: e,
|
|
1465
1465
|
sortedBy: "desc"
|
|
1466
|
-
})) : n === e ? (
|
|
1466
|
+
})) : n === e ? (o.classList.remove("desc"), await t.methods.clearParams(["orderBy", "sortedBy"])) : (o.classList.add("asc"), t.methods.applyParams({
|
|
1467
1467
|
orderBy: e,
|
|
1468
1468
|
sortedBy: "asc"
|
|
1469
1469
|
}));
|
|
1470
1470
|
});
|
|
1471
|
-
},
|
|
1471
|
+
}, oo = (e, s, t) => {
|
|
1472
1472
|
if (s.querySelector(".spark-table-head-filter"))
|
|
1473
1473
|
return;
|
|
1474
|
-
const
|
|
1475
|
-
l.type = "text", l.placeholder = "Filter...",
|
|
1476
|
-
const n =
|
|
1477
|
-
const r = c.target.value, i = `filter[${
|
|
1474
|
+
const o = document.createElement("div"), l = document.createElement("input");
|
|
1475
|
+
l.type = "text", l.placeholder = "Filter...", o.className = "spark-table-head-filter", o.appendChild(l);
|
|
1476
|
+
const n = ze(async (a, c) => {
|
|
1477
|
+
const r = c.target.value, i = `filter[${a}]`;
|
|
1478
1478
|
if (r)
|
|
1479
1479
|
return t.params[i] && t.params[i] === r ? void 0 : t.methods.applyParams({
|
|
1480
1480
|
page: 1,
|
|
@@ -1482,42 +1482,42 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1482
1482
|
});
|
|
1483
1483
|
await t.methods.removeParam(i);
|
|
1484
1484
|
}, 200);
|
|
1485
|
-
l.addEventListener("keyup", (
|
|
1486
|
-
},
|
|
1485
|
+
l.addEventListener("keyup", (a) => n(e, a)), s.appendChild(o);
|
|
1486
|
+
}, ao = (e, s, t) => {
|
|
1487
1487
|
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");
|
|
1488
1488
|
const l = e.querySelector(".colHeader");
|
|
1489
|
-
l.classList.add("spark-table-head-title"), l.innerHTML =
|
|
1490
|
-
},
|
|
1489
|
+
l.classList.add("spark-table-head-title"), l.innerHTML = to(s);
|
|
1490
|
+
}, ro = (e, s, t) => {
|
|
1491
1491
|
if (typeof e != "number")
|
|
1492
1492
|
return e;
|
|
1493
1493
|
if (e < 0)
|
|
1494
1494
|
return;
|
|
1495
|
-
let
|
|
1495
|
+
let o = 2;
|
|
1496
1496
|
const l = t.methods.colToProp(e), n = t.methods.getSettingsForProp(l);
|
|
1497
|
-
s.childElementCount === 1 && ((!n || !n.columnSort) &&
|
|
1498
|
-
},
|
|
1497
|
+
s.childElementCount === 1 && ((!n || !n.columnSort) && o--, (!n || !n.columnFilter) && o--, n && n.columnSort && so(l, s, t), n && n.columnFilter && oo(l, s, t)), (s.childElementCount === o || o === 0) && ao(s, l, n);
|
|
1498
|
+
}, no = (e) => {
|
|
1499
1499
|
if (!e.hotInstance || !e.hotInstance.rootElement)
|
|
1500
1500
|
return;
|
|
1501
|
-
const s = e.params.orderBy, t = e.params.sortedBy,
|
|
1502
|
-
|
|
1501
|
+
const s = e.params.orderBy, t = e.params.sortedBy, o = e.hotInstance.rootElement.querySelectorAll("thead th.can-sort .relative");
|
|
1502
|
+
o.forEach((l) => {
|
|
1503
1503
|
l.classList.remove("asc", "desc");
|
|
1504
|
-
}), s && t &&
|
|
1505
|
-
const n = l.closest("th"),
|
|
1506
|
-
e.methods.colToProp(
|
|
1504
|
+
}), s && t && o.forEach((l) => {
|
|
1505
|
+
const n = l.closest("th"), a = Array.from(n.parentElement.children).indexOf(n);
|
|
1506
|
+
e.methods.colToProp(a) === s && l.classList.add(t);
|
|
1507
1507
|
});
|
|
1508
|
-
},
|
|
1508
|
+
}, lo = (e) => (s, t, o, l, n, a, c) => {
|
|
1509
1509
|
t.innerHTML = "", t.classList.add("spark-table-cell-actions");
|
|
1510
1510
|
const i = (c.rendererConfig || {}).actions || [];
|
|
1511
1511
|
if (i.length === 0)
|
|
1512
1512
|
return;
|
|
1513
|
-
const u = s.getSourceDataAtRow(s.toPhysicalRow(
|
|
1514
|
-
|
|
1513
|
+
const u = s.getSourceDataAtRow(s.toPhysicalRow(o)), d = document.createElement("div");
|
|
1514
|
+
d.classList.add("flex", "items-center", "gap-2"), i.forEach((f) => {
|
|
1515
1515
|
if (f.condition && typeof f.condition == "function" && !f.condition(u))
|
|
1516
1516
|
return;
|
|
1517
1517
|
const y = document.createElement("button");
|
|
1518
1518
|
if (y.type = "button", y.classList.add("spark-table-action-button"), f.icon) {
|
|
1519
1519
|
const k = document.createElement("span");
|
|
1520
|
-
k.innerHTML =
|
|
1520
|
+
k.innerHTML = ce({ prefix: "far", iconName: f.icon }).html, k.classList.add("size-4"), y.appendChild(k);
|
|
1521
1521
|
}
|
|
1522
1522
|
if (f.label) {
|
|
1523
1523
|
const k = document.createElement("span");
|
|
@@ -1526,7 +1526,7 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1526
1526
|
y.addEventListener("click", async (k) => {
|
|
1527
1527
|
if (k.preventDefault(), k.stopPropagation(), f.confirm) {
|
|
1528
1528
|
const h = typeof f.confirm == "string" ? f.confirm : `Are you sure you want to ${f.label?.toLowerCase() || "perform this action"}?`;
|
|
1529
|
-
if (!await
|
|
1529
|
+
if (!await oe.confirm({
|
|
1530
1530
|
title: f.confirmTitle,
|
|
1531
1531
|
message: h,
|
|
1532
1532
|
type: f.confirmType,
|
|
@@ -1537,9 +1537,9 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1537
1537
|
return;
|
|
1538
1538
|
}
|
|
1539
1539
|
f.event && e.methods.fireEvent(f.event, u), f.handler && typeof f.handler == "function" && f.handler(u);
|
|
1540
|
-
}),
|
|
1541
|
-
}), t.appendChild(
|
|
1542
|
-
},
|
|
1540
|
+
}), d.appendChild(y);
|
|
1541
|
+
}), t.appendChild(d);
|
|
1542
|
+
}, Ce = {
|
|
1543
1543
|
green: "bg-green-100 text-green-800",
|
|
1544
1544
|
red: "bg-red-100 text-red-800",
|
|
1545
1545
|
yellow: "bg-yellow-100 text-yellow-800",
|
|
@@ -1548,10 +1548,10 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1548
1548
|
purple: "bg-purple-100 text-purple-800",
|
|
1549
1549
|
pink: "bg-pink-100 text-pink-800",
|
|
1550
1550
|
indigo: "bg-indigo-100 text-indigo-800"
|
|
1551
|
-
},
|
|
1552
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-badge"), !
|
|
1551
|
+
}, io = (e) => (s, t, o, l, n, a, c) => {
|
|
1552
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-badge"), !a)
|
|
1553
1553
|
return;
|
|
1554
|
-
const i = (c.rendererConfig || {}).colorMap || {}, u = i[
|
|
1554
|
+
const i = (c.rendererConfig || {}).colorMap || {}, u = i[a] || i[a?.toLowerCase()] || "gray", d = Ce[u] || Ce.gray, f = document.createElement("span");
|
|
1555
1555
|
f.classList.add(
|
|
1556
1556
|
"inline-flex",
|
|
1557
1557
|
"items-center",
|
|
@@ -1561,16 +1561,16 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1561
1561
|
"text-xs",
|
|
1562
1562
|
"font-medium",
|
|
1563
1563
|
"capitalize",
|
|
1564
|
-
...
|
|
1565
|
-
), f.textContent =
|
|
1566
|
-
},
|
|
1564
|
+
...d.split(" ")
|
|
1565
|
+
), f.textContent = a, t.appendChild(f);
|
|
1566
|
+
}, $e = {
|
|
1567
1567
|
green: { bg: "bg-green-100", text: "text-green-500" },
|
|
1568
1568
|
red: { bg: "bg-red-100", text: "text-red-500" },
|
|
1569
1569
|
yellow: { bg: "bg-yellow-100", text: "text-yellow-500" },
|
|
1570
1570
|
blue: { bg: "bg-blue-100", text: "text-blue-500" },
|
|
1571
1571
|
gray: { bg: "bg-gray-100", text: "text-gray-500" },
|
|
1572
1572
|
purple: { bg: "bg-purple-100", text: "text-purple-500" }
|
|
1573
|
-
},
|
|
1573
|
+
}, co = (e) => {
|
|
1574
1574
|
if (e == null || e === "")
|
|
1575
1575
|
return !1;
|
|
1576
1576
|
if (typeof e == "boolean")
|
|
@@ -1582,9 +1582,11 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1582
1582
|
return s === "1" || s === "yes" || s === "true";
|
|
1583
1583
|
}
|
|
1584
1584
|
return !1;
|
|
1585
|
-
},
|
|
1585
|
+
}, uo = (e) => (s, t, o, l, n, a, c) => {
|
|
1586
1586
|
t.innerHTML = "", t.classList.add("spark-table-cell-boolean");
|
|
1587
|
-
const r = c.rendererConfig || {}, i =
|
|
1587
|
+
const r = c.rendererConfig || {}, i = co(a), u = i ? r.trueIcon || "check" : r.falseIcon || "xmark", d = i ? r.trueColor || "green" : r.falseColor || "red", f = r.size || 32, y = r.iconPrefix || "far", k = $e[d] || $e.gray;
|
|
1588
|
+
t.dataset.copyValue = i ? "true" : "false";
|
|
1589
|
+
const h = document.createElement("div");
|
|
1588
1590
|
h.classList.add(
|
|
1589
1591
|
"inline-flex",
|
|
1590
1592
|
"items-center",
|
|
@@ -1593,170 +1595,310 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1593
1595
|
k.bg,
|
|
1594
1596
|
k.text
|
|
1595
1597
|
), h.style.width = `${f}px`, h.style.height = `${f}px`;
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1600
|
-
},
|
|
1601
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-link"), !
|
|
1598
|
+
const x = document.createElement("span");
|
|
1599
|
+
x.innerHTML = ce({ prefix: y, iconName: u }).html, x.classList.add("flex", "items-center", "justify-center");
|
|
1600
|
+
const P = Math.round(f * 0.5);
|
|
1601
|
+
x.style.fontSize = `${P}px`, h.appendChild(x), t.appendChild(h);
|
|
1602
|
+
}, po = (e) => (s, t, o, l, n, a, c) => {
|
|
1603
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-link"), !a)
|
|
1602
1604
|
return;
|
|
1603
|
-
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(
|
|
1604
|
-
let u =
|
|
1605
|
-
r.href && (typeof r.href == "function" ? u = r.href(i) : r.href === "email" ? u = `mailto:${
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1605
|
+
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(o));
|
|
1606
|
+
let u = a;
|
|
1607
|
+
r.href && (typeof r.href == "function" ? u = r.href(i) : r.href === "email" ? u = `mailto:${a}` : r.href === "tel" ? u = `tel:${a}` : typeof r.href == "string" && (u = i[r.href] || a));
|
|
1608
|
+
const d = document.createElement("a");
|
|
1609
|
+
d.href = u, d.textContent = a, d.classList.add("text-primary-600", "hover:text-primary-900", "hover:underline"), r.target && (d.target = r.target), r.rel && (d.rel = r.rel), d.addEventListener("click", (f) => {
|
|
1608
1610
|
f.stopPropagation();
|
|
1609
|
-
}), t.appendChild(
|
|
1610
|
-
},
|
|
1611
|
+
}), t.appendChild(d);
|
|
1612
|
+
}, Te = {
|
|
1611
1613
|
sm: "h-6 w-6",
|
|
1612
1614
|
md: "h-8 w-8",
|
|
1613
1615
|
lg: "h-12 w-12"
|
|
1614
|
-
},
|
|
1615
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !
|
|
1616
|
+
}, fo = (e) => (s, t, o, l, n, a, c) => {
|
|
1617
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !a)
|
|
1616
1618
|
return;
|
|
1617
|
-
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(
|
|
1619
|
+
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(o)), u = r.size || "md", d = Te[u] || Te.md, f = r.rounded !== !1;
|
|
1618
1620
|
let y = r.alt || "";
|
|
1619
1621
|
typeof r.alt == "string" && i[r.alt] && (y = i[r.alt]);
|
|
1620
1622
|
const k = document.createElement("img");
|
|
1621
|
-
k.src =
|
|
1622
|
-
},
|
|
1623
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !
|
|
1623
|
+
k.src = a, k.alt = y, k.classList.add(...d.split(" "), "object-cover"), f ? k.classList.add("rounded-full") : k.classList.add("rounded"), t.appendChild(k);
|
|
1624
|
+
}, mo = (e) => (s, t, o, l, n, a, c) => {
|
|
1625
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !a)
|
|
1624
1626
|
return;
|
|
1625
1627
|
const r = c.rendererConfig || {}, i = r.format || "short", u = r.locale || "en-US";
|
|
1626
|
-
let
|
|
1628
|
+
let d = a;
|
|
1627
1629
|
try {
|
|
1628
|
-
const y = new Date(
|
|
1629
|
-
isNaN(y.getTime()) ?
|
|
1630
|
+
const y = new Date(a);
|
|
1631
|
+
isNaN(y.getTime()) ? d = a : typeof i == "function" ? d = i(y) : i === "short" ? d = y.toLocaleDateString(u) : i === "long" ? d = y.toLocaleDateString(u, {
|
|
1630
1632
|
year: "numeric",
|
|
1631
1633
|
month: "long",
|
|
1632
1634
|
day: "numeric"
|
|
1633
|
-
}) : i === "relative" ?
|
|
1635
|
+
}) : i === "relative" ? d = ho(y) : i === "datetime" ? d = y.toLocaleString(u) : d = y.toLocaleDateString(u);
|
|
1634
1636
|
} catch (y) {
|
|
1635
|
-
console.error("Error formatting date:", y),
|
|
1637
|
+
console.error("Error formatting date:", y), d = a;
|
|
1636
1638
|
}
|
|
1637
1639
|
const f = document.createElement("span");
|
|
1638
|
-
f.textContent =
|
|
1640
|
+
f.textContent = d, t.appendChild(f);
|
|
1639
1641
|
};
|
|
1640
|
-
function
|
|
1641
|
-
const t = /* @__PURE__ */ new Date() - e,
|
|
1642
|
-
return
|
|
1642
|
+
function ho(e) {
|
|
1643
|
+
const t = /* @__PURE__ */ new Date() - e, o = Math.floor(Math.abs(t) / 1e3), l = Math.floor(o / 60), n = Math.floor(l / 60), a = Math.floor(n / 24), c = Math.floor(a / 30), r = Math.floor(a / 365), i = t > 0;
|
|
1644
|
+
return o < 60 ? i ? "just now" : "in a moment" : l < 60 ? i ? `${l} minute${l > 1 ? "s" : ""} ago` : `in ${l} minute${l > 1 ? "s" : ""}` : n < 24 ? i ? `${n} hour${n > 1 ? "s" : ""} ago` : `in ${n} hour${n > 1 ? "s" : ""}` : a < 30 ? i ? `${a} day${a > 1 ? "s" : ""} ago` : `in ${a} day${a > 1 ? "s" : ""}` : c < 12 ? i ? `${c} month${c > 1 ? "s" : ""} ago` : `in ${c} month${c > 1 ? "s" : ""}` : i ? `${r} year${r > 1 ? "s" : ""} ago` : `in ${r} year${r > 1 ? "s" : ""}`;
|
|
1643
1645
|
}
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1646
|
+
const go = (e) => {
|
|
1647
|
+
const s = ["th", "st", "nd", "rd"], t = e % 100;
|
|
1648
|
+
return e + (s[(t - 20) % 10] || s[t] || s[0]);
|
|
1649
|
+
}, j = (e, s = 2) => String(e).padStart(s, "0"), ge = /* @__PURE__ */ new Map(), yo = (e, s) => {
|
|
1650
|
+
const t = `${e}:${JSON.stringify(s)}`;
|
|
1651
|
+
return ge.has(t) || ge.set(t, new Intl.DateTimeFormat(e, s)), ge.get(t);
|
|
1652
|
+
}, ie = (e, s, t, o) => {
|
|
1653
|
+
const a = yo(s, t).formatToParts(e).find((c) => c.type === o);
|
|
1654
|
+
return a ? a.value : "";
|
|
1655
|
+
}, vo = (e) => e.epochMilliseconds !== void 0 ? new Date(e.epochMilliseconds) : new Date(
|
|
1656
|
+
e.year,
|
|
1657
|
+
e.month - 1,
|
|
1658
|
+
e.day,
|
|
1659
|
+
e.hour || 0,
|
|
1660
|
+
e.minute || 0,
|
|
1661
|
+
e.second || 0,
|
|
1662
|
+
e.millisecond || 0
|
|
1663
|
+
), bo = (e) => {
|
|
1664
|
+
const s = e.hour || 0, t = s % 12 || 12, o = s >= 12;
|
|
1665
|
+
return {
|
|
1666
|
+
year: e.year,
|
|
1667
|
+
month: e.month,
|
|
1668
|
+
day: e.day,
|
|
1669
|
+
hour24: s,
|
|
1670
|
+
hour12: t,
|
|
1671
|
+
hourFrom1: s === 0 ? 24 : s,
|
|
1672
|
+
// k format (1-24)
|
|
1673
|
+
minute: e.minute || 0,
|
|
1674
|
+
second: e.second || 0,
|
|
1675
|
+
millisecond: e.millisecond || 0,
|
|
1676
|
+
dayOfWeek: e.dayOfWeek,
|
|
1677
|
+
// 1=Monday, 7=Sunday in Temporal
|
|
1678
|
+
isPM: o,
|
|
1679
|
+
quarter: Math.ceil(e.month / 3)
|
|
1680
|
+
};
|
|
1681
|
+
}, Le = (e, s = !0) => {
|
|
1682
|
+
if (!e.offsetNanoseconds && e.offsetNanoseconds !== 0)
|
|
1683
|
+
return "";
|
|
1684
|
+
const t = Math.round(e.offsetNanoseconds / 6e10), o = t >= 0 ? "+" : "-", l = Math.abs(t), n = Math.floor(l / 60), a = l % 60;
|
|
1685
|
+
return s ? `${o}${j(n)}:${j(a)}` : `${o}${j(n)}${j(a)}`;
|
|
1686
|
+
}, xo = (e, s) => {
|
|
1687
|
+
const t = bo(e), o = vo(e), l = t.dayOfWeek === 7 ? 0 : t.dayOfWeek;
|
|
1688
|
+
return [
|
|
1689
|
+
// Year
|
|
1690
|
+
["YYYY", () => String(t.year)],
|
|
1691
|
+
["YY", () => String(t.year).slice(-2)],
|
|
1692
|
+
// Month
|
|
1693
|
+
["MMMM", () => ie(o, s, { month: "long" }, "month")],
|
|
1694
|
+
["MMM", () => ie(o, s, { month: "short" }, "month")],
|
|
1695
|
+
["MM", () => j(t.month)],
|
|
1696
|
+
["M", () => String(t.month)],
|
|
1697
|
+
// Day of month
|
|
1698
|
+
["DD", () => j(t.day)],
|
|
1699
|
+
["Do", () => go(t.day)],
|
|
1700
|
+
["D", () => String(t.day)],
|
|
1701
|
+
// Day of week
|
|
1702
|
+
["dddd", () => ie(o, s, { weekday: "long" }, "weekday")],
|
|
1703
|
+
["ddd", () => ie(o, s, { weekday: "short" }, "weekday")],
|
|
1704
|
+
["dd", () => ie(o, s, { weekday: "short" }, "weekday").slice(0, 2)],
|
|
1705
|
+
["d", () => String(l)],
|
|
1706
|
+
// Hour
|
|
1707
|
+
["HH", () => j(t.hour24)],
|
|
1708
|
+
["H", () => String(t.hour24)],
|
|
1709
|
+
["hh", () => j(t.hour12)],
|
|
1710
|
+
["h", () => String(t.hour12)],
|
|
1711
|
+
["kk", () => j(t.hourFrom1)],
|
|
1712
|
+
["k", () => String(t.hourFrom1)],
|
|
1713
|
+
// Minute
|
|
1714
|
+
["mm", () => j(t.minute)],
|
|
1715
|
+
["m", () => String(t.minute)],
|
|
1716
|
+
// Second
|
|
1717
|
+
["ss", () => j(t.second)],
|
|
1718
|
+
["s", () => String(t.second)],
|
|
1719
|
+
// Millisecond
|
|
1720
|
+
["SSS", () => j(t.millisecond, 3)],
|
|
1721
|
+
// AM/PM
|
|
1722
|
+
["A", () => t.isPM ? "PM" : "AM"],
|
|
1723
|
+
["a", () => t.isPM ? "pm" : "am"],
|
|
1724
|
+
// Timezone offset
|
|
1725
|
+
["ZZ", () => Le(e, !1)],
|
|
1726
|
+
["Z", () => Le(e, !0)],
|
|
1727
|
+
// Quarter
|
|
1728
|
+
["Q", () => String(t.quarter)],
|
|
1729
|
+
// Unix timestamp
|
|
1730
|
+
["x", () => String(e.epochMilliseconds ?? o.getTime())],
|
|
1731
|
+
["X", () => String(Math.floor((e.epochMilliseconds ?? o.getTime()) / 1e3))]
|
|
1732
|
+
];
|
|
1733
|
+
}, ko = (e, s, t = {}) => {
|
|
1734
|
+
const { locale: o = "en-US" } = t;
|
|
1735
|
+
if (!e)
|
|
1736
|
+
return "";
|
|
1737
|
+
let l = e;
|
|
1738
|
+
if (typeof e == "string")
|
|
1739
|
+
try {
|
|
1740
|
+
if (e.includes("[") || e.includes("Z") || /[+-]\d{2}:\d{2}$/.test(e))
|
|
1741
|
+
l = Temporal.ZonedDateTime.from(e);
|
|
1742
|
+
else {
|
|
1743
|
+
const r = e.replace(" ", "T");
|
|
1744
|
+
l = Temporal.PlainDateTime.from(r);
|
|
1745
|
+
}
|
|
1746
|
+
} catch (r) {
|
|
1747
|
+
return console.error("Failed to parse date string:", e, r), e;
|
|
1748
|
+
}
|
|
1749
|
+
const n = xo(l, o), a = n.map(([r]) => r).join("|"), c = new RegExp(`\\[([^\\]]+)\\]|(${a})`, "g");
|
|
1750
|
+
return s.replace(c, (r, i, u) => {
|
|
1751
|
+
if (i !== void 0)
|
|
1752
|
+
return i;
|
|
1753
|
+
const d = n.find(([f]) => f === u);
|
|
1754
|
+
return d ? d[1]() : r;
|
|
1755
|
+
});
|
|
1756
|
+
}, _o = (e, s = {}) => {
|
|
1757
|
+
const { fromTimezone: t, toTimezone: o } = s;
|
|
1758
|
+
if (!e)
|
|
1759
|
+
return null;
|
|
1760
|
+
const l = e.replace(" ", "T");
|
|
1761
|
+
return t && o ? Temporal.PlainDateTime.from(l).toZonedDateTime(t).withTimeZone(o) : t ? Temporal.PlainDateTime.from(l).toZonedDateTime(t) : Temporal.PlainDateTime.from(l);
|
|
1762
|
+
}, wo = (e) => (s, t, o, l, n, a, c) => {
|
|
1763
|
+
t.innerHTML = "", t.classList.add("spark-table-cell-datetime");
|
|
1764
|
+
const r = c.rendererConfig || {}, {
|
|
1765
|
+
format: i = "DD MMM YYYY, HH:mm",
|
|
1766
|
+
fromTimezone: u,
|
|
1767
|
+
toTimezone: d,
|
|
1768
|
+
locale: f = "en-US",
|
|
1769
|
+
emptyText: y = ""
|
|
1770
|
+
} = r;
|
|
1771
|
+
if (!a) {
|
|
1772
|
+
t.textContent = y;
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
try {
|
|
1776
|
+
const k = _o(a, { fromTimezone: u, toTimezone: d });
|
|
1777
|
+
if (!k) {
|
|
1778
|
+
t.textContent = y;
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1781
|
+
const h = ko(k, i, { locale: f }), x = document.createElement("span");
|
|
1782
|
+
x.textContent = h, t.appendChild(x);
|
|
1783
|
+
} catch (k) {
|
|
1784
|
+
console.error("Error formatting datetime:", k, { value: a, format: i }), t.textContent = a;
|
|
1785
|
+
}
|
|
1786
|
+
}, So = /* @__PURE__ */ new Map(), W = (e, s) => {
|
|
1787
|
+
Kt(e, (t, o, l, n, a, c, r) => {
|
|
1788
|
+
Gt.apply(null, [t, o, l, n, a, c, r]), s(t, o, l, n, a, c, r);
|
|
1789
|
+
}), So.set(e, s);
|
|
1790
|
+
}, Co = (e) => {
|
|
1791
|
+
W("spark.actions", lo(e)), W("spark.badge", io()), W("spark.boolean", uo()), W("spark.link", po()), W("spark.image", fo()), W("spark.date", mo()), W("spark.datetime", wo()), W("style.capitalize", (s, t, o, l, n, a) => {
|
|
1792
|
+
if (!a || a.length === 0) {
|
|
1651
1793
|
t.innerText = "";
|
|
1652
1794
|
return;
|
|
1653
1795
|
}
|
|
1654
1796
|
const c = document.createElement("span");
|
|
1655
|
-
c.innerHTML =
|
|
1797
|
+
c.innerHTML = a, c.classList.add("capitalize"), t.replaceChildren(c);
|
|
1656
1798
|
});
|
|
1657
|
-
},
|
|
1658
|
-
},
|
|
1659
|
-
const t =
|
|
1660
|
-
const
|
|
1661
|
-
return Object.keys(
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1664
|
-
}),
|
|
1799
|
+
}, $o = () => {
|
|
1800
|
+
}, To = (e, s = {}) => {
|
|
1801
|
+
const t = J(), o = ne(), l = s.namespace, n = l === null, a = s.syncToRoute !== !1, c = s.persistToStorage === !0, r = s.restoreOnMount !== !1, i = s.storageTTL || 7, u = n ? `spark-table:${o.path}` : `spark-table:${l}`, d = (v, $ = "") => {
|
|
1802
|
+
const M = {};
|
|
1803
|
+
return Object.keys(v).forEach((D) => {
|
|
1804
|
+
const G = v[D], xe = $ ? `${$}[${D}]` : D;
|
|
1805
|
+
G != null && (typeof G == "object" && !Array.isArray(G) ? Object.assign(M, d(G, xe)) : M[xe] = String(G));
|
|
1806
|
+
}), M;
|
|
1665
1807
|
}, f = () => {
|
|
1666
1808
|
if (c)
|
|
1667
1809
|
try {
|
|
1668
|
-
const
|
|
1810
|
+
const v = {
|
|
1669
1811
|
params: e.params,
|
|
1670
1812
|
timestamp: Date.now()
|
|
1671
1813
|
};
|
|
1672
|
-
localStorage.setItem(u, JSON.stringify(
|
|
1673
|
-
} catch (
|
|
1674
|
-
console.warn("Failed to save table state to localStorage:",
|
|
1814
|
+
localStorage.setItem(u, JSON.stringify(v));
|
|
1815
|
+
} catch (v) {
|
|
1816
|
+
console.warn("Failed to save table state to localStorage:", v);
|
|
1675
1817
|
}
|
|
1676
1818
|
}, y = () => {
|
|
1677
1819
|
if (!c) return null;
|
|
1678
1820
|
try {
|
|
1679
|
-
const
|
|
1680
|
-
if (!
|
|
1681
|
-
const
|
|
1821
|
+
const v = localStorage.getItem(u);
|
|
1822
|
+
if (!v) return null;
|
|
1823
|
+
const $ = JSON.parse(v);
|
|
1682
1824
|
if (i > 0) {
|
|
1683
|
-
const
|
|
1684
|
-
if (
|
|
1825
|
+
const M = Date.now() - $.timestamp, D = i * 24 * 60 * 60 * 1e3;
|
|
1826
|
+
if (M > D)
|
|
1685
1827
|
return localStorage.removeItem(u), null;
|
|
1686
1828
|
}
|
|
1687
|
-
return
|
|
1688
|
-
} catch (
|
|
1689
|
-
return console.warn("Failed to load table state from localStorage:",
|
|
1829
|
+
return $.params;
|
|
1830
|
+
} catch (v) {
|
|
1831
|
+
return console.warn("Failed to load table state from localStorage:", v), null;
|
|
1690
1832
|
}
|
|
1691
1833
|
}, k = () => {
|
|
1692
1834
|
try {
|
|
1693
1835
|
localStorage.removeItem(u);
|
|
1694
|
-
} catch (
|
|
1695
|
-
console.warn("Failed to clear table state from localStorage:",
|
|
1836
|
+
} catch (v) {
|
|
1837
|
+
console.warn("Failed to clear table state from localStorage:", v);
|
|
1696
1838
|
}
|
|
1697
1839
|
}, h = () => {
|
|
1698
|
-
if (!
|
|
1699
|
-
const
|
|
1840
|
+
if (!a) return;
|
|
1841
|
+
const v = { ...o.query };
|
|
1700
1842
|
if (n) {
|
|
1701
|
-
Object.keys(
|
|
1702
|
-
|
|
1843
|
+
Object.keys(v).forEach((M) => {
|
|
1844
|
+
x(M) && delete v[M];
|
|
1703
1845
|
});
|
|
1704
|
-
const
|
|
1705
|
-
Object.assign(
|
|
1846
|
+
const $ = d(e.params);
|
|
1847
|
+
Object.assign(v, $);
|
|
1706
1848
|
} else {
|
|
1707
|
-
Object.keys(
|
|
1708
|
-
(
|
|
1849
|
+
Object.keys(v).forEach((M) => {
|
|
1850
|
+
(M.startsWith(`${l}[`) || M === l) && delete v[M];
|
|
1709
1851
|
});
|
|
1710
|
-
const
|
|
1711
|
-
Object.assign(
|
|
1852
|
+
const $ = d(e.params, l);
|
|
1853
|
+
Object.assign(v, $);
|
|
1712
1854
|
}
|
|
1713
|
-
t.replace({ query:
|
|
1714
|
-
},
|
|
1715
|
-
if (["page", "limit"].includes(
|
|
1716
|
-
const
|
|
1717
|
-
return isNaN(
|
|
1855
|
+
t.replace({ query: v });
|
|
1856
|
+
}, x = (v) => !!(["page", "limit", "search", "orderBy", "sortedBy"].includes(v) || v.includes("[")), P = (v, $) => {
|
|
1857
|
+
if (["page", "limit"].includes(v) && $ !== null && $ !== void 0) {
|
|
1858
|
+
const D = parseInt($, 10);
|
|
1859
|
+
return isNaN(D) ? $ : D;
|
|
1718
1860
|
}
|
|
1719
|
-
return
|
|
1861
|
+
return $;
|
|
1720
1862
|
}, w = () => {
|
|
1721
1863
|
if (n)
|
|
1722
|
-
Object.keys(
|
|
1723
|
-
|
|
1864
|
+
Object.keys(o.query).forEach((v) => {
|
|
1865
|
+
x(v) && (e.params[v] = P(v, o.query[v]));
|
|
1724
1866
|
});
|
|
1725
1867
|
else {
|
|
1726
|
-
const
|
|
1727
|
-
Object.keys(
|
|
1728
|
-
if (
|
|
1729
|
-
const
|
|
1730
|
-
e.params[
|
|
1868
|
+
const v = `${l}[`;
|
|
1869
|
+
Object.keys(o.query).forEach(($) => {
|
|
1870
|
+
if ($.startsWith(v)) {
|
|
1871
|
+
const M = $.slice(v.length, -1);
|
|
1872
|
+
e.params[M] = P(M, o.query[$]);
|
|
1731
1873
|
}
|
|
1732
1874
|
});
|
|
1733
1875
|
}
|
|
1734
1876
|
};
|
|
1735
|
-
return
|
|
1877
|
+
return I(
|
|
1736
1878
|
() => e.params,
|
|
1737
1879
|
() => {
|
|
1738
|
-
|
|
1880
|
+
a && h(), c && f();
|
|
1739
1881
|
},
|
|
1740
1882
|
{ deep: !0 }
|
|
1741
|
-
), r &&
|
|
1742
|
-
let
|
|
1743
|
-
if (
|
|
1744
|
-
let
|
|
1883
|
+
), r && be(() => {
|
|
1884
|
+
let v = !1;
|
|
1885
|
+
if (a) {
|
|
1886
|
+
let $ = !1;
|
|
1745
1887
|
if (n)
|
|
1746
|
-
|
|
1888
|
+
$ = Object.keys(o.query).some((M) => x(M));
|
|
1747
1889
|
else {
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1750
|
-
(
|
|
1890
|
+
const M = `${l}[`;
|
|
1891
|
+
$ = Object.keys(o.query).some(
|
|
1892
|
+
(D) => D.startsWith(M)
|
|
1751
1893
|
);
|
|
1752
1894
|
}
|
|
1753
|
-
|
|
1895
|
+
$ && (v = !0, w());
|
|
1754
1896
|
}
|
|
1755
|
-
if (!
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}), Object.assign(e.params,
|
|
1897
|
+
if (!v && c) {
|
|
1898
|
+
const $ = y();
|
|
1899
|
+
$ && Object.keys($).length > 0 && (Object.keys($).forEach((M) => {
|
|
1900
|
+
$[M] = P(M, $[M]);
|
|
1901
|
+
}), Object.assign(e.params, $));
|
|
1760
1902
|
}
|
|
1761
1903
|
}), {
|
|
1762
1904
|
syncToRoute: h,
|
|
@@ -1765,7 +1907,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1765
1907
|
loadFromStorage: y,
|
|
1766
1908
|
clearStorage: k
|
|
1767
1909
|
};
|
|
1768
|
-
},
|
|
1910
|
+
}, Lo = { class: "flex items-center gap-4 py-3" }, Po = { class: "shrink-0" }, Mo = { class: "text-sm text-gray-700" }, Ho = { class: "font-medium" }, Vo = { class: "font-medium" }, Ro = { class: "font-medium" }, Bo = {
|
|
1769
1911
|
__name: "SparkTablePaginationDetails",
|
|
1770
1912
|
props: {
|
|
1771
1913
|
sparkTable: {
|
|
@@ -1775,29 +1917,29 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1775
1917
|
},
|
|
1776
1918
|
setup(e) {
|
|
1777
1919
|
const s = e;
|
|
1778
|
-
return (t,
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1920
|
+
return (t, o) => (m(), g("div", null, [
|
|
1921
|
+
p("div", Lo, [
|
|
1922
|
+
p("div", Po, [
|
|
1923
|
+
p("div", Mo, [
|
|
1924
|
+
o[0] || (o[0] = B(" Showing ", -1)),
|
|
1925
|
+
p("span", Ho, L(s.sparkTable.response.meta.from), 1),
|
|
1926
|
+
o[1] || (o[1] = B(" to ", -1)),
|
|
1927
|
+
p("span", Vo, L(s.sparkTable.response.meta.to), 1),
|
|
1928
|
+
o[2] || (o[2] = B(" of ", -1)),
|
|
1929
|
+
p("span", Ro, L(s.sparkTable.response.meta.total), 1),
|
|
1930
|
+
o[3] || (o[3] = B(" results ", -1))
|
|
1789
1931
|
])
|
|
1790
1932
|
])
|
|
1791
1933
|
])
|
|
1792
1934
|
]));
|
|
1793
1935
|
}
|
|
1794
|
-
},
|
|
1936
|
+
}, Eo = { class: "flex items-center gap-4 px-4 py-3" }, Ao = {
|
|
1795
1937
|
key: 0,
|
|
1796
1938
|
class: "shrink-0 ml-auto"
|
|
1797
|
-
},
|
|
1939
|
+
}, Oo = {
|
|
1798
1940
|
class: "isolate inline-flex -space-x-px rounded-md shadow-xs bg-white",
|
|
1799
1941
|
"aria-label": "Pagination"
|
|
1800
|
-
},
|
|
1942
|
+
}, Fo = ["onClick"], zo = {
|
|
1801
1943
|
__name: "SparkTablePaginationPaging",
|
|
1802
1944
|
props: {
|
|
1803
1945
|
sparkTable: {
|
|
@@ -1807,67 +1949,67 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1807
1949
|
},
|
|
1808
1950
|
emits: ["paginate"],
|
|
1809
1951
|
setup(e, { emit: s }) {
|
|
1810
|
-
const t = e,
|
|
1952
|
+
const t = e, o = s, l = (u) => {
|
|
1811
1953
|
n(t.sparkTable.params.page + u);
|
|
1812
1954
|
}, n = (u) => {
|
|
1813
|
-
u < 1 || u > t.sparkTable.response.meta.last_page ||
|
|
1955
|
+
u < 1 || u > t.sparkTable.response.meta.last_page || o("paginate", {
|
|
1814
1956
|
page: u
|
|
1815
1957
|
});
|
|
1816
|
-
},
|
|
1817
|
-
Math.floor((
|
|
1818
|
-
|
|
1958
|
+
}, a = S(() => t.sparkTable.params.page ? Math.ceil(t.sparkTable.params.page / 10) * 10 : 1), c = S(() => t.sparkTable.computed.ready ? Ft(
|
|
1959
|
+
Math.floor((a.value - 1) / 10) * 10 + 1,
|
|
1960
|
+
a.value > t.sparkTable.response.meta.last_page ? t.sparkTable.response.meta.last_page + 1 : a.value + 1
|
|
1819
1961
|
) : []), r = S(
|
|
1820
|
-
() => t.sparkTable.params.page <
|
|
1962
|
+
() => t.sparkTable.params.page < Y(t.sparkTable.response.meta, "last_page", 1)
|
|
1821
1963
|
), i = S(() => t.sparkTable.params.page > 1);
|
|
1822
|
-
return (u,
|
|
1964
|
+
return (u, d) => {
|
|
1823
1965
|
const f = A("font-awesome-icon");
|
|
1824
1966
|
return m(), g("div", null, [
|
|
1825
|
-
|
|
1826
|
-
c.value.length > 1 ? (m(), g("div",
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
class:
|
|
1967
|
+
p("div", Eo, [
|
|
1968
|
+
c.value.length > 1 ? (m(), g("div", Ao, [
|
|
1969
|
+
p("div", null, [
|
|
1970
|
+
p("nav", Oo, [
|
|
1971
|
+
p("a", {
|
|
1972
|
+
class: H([i.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"]),
|
|
1831
1973
|
href: "#",
|
|
1832
|
-
onClick:
|
|
1974
|
+
onClick: d[0] || (d[0] = Q((y) => l(-1), ["prevent"]))
|
|
1833
1975
|
}, [
|
|
1834
|
-
|
|
1835
|
-
icon:
|
|
1976
|
+
b(f, {
|
|
1977
|
+
icon: _(O).farChevronLeft,
|
|
1836
1978
|
class: "size-5"
|
|
1837
1979
|
}, null, 8, ["icon"])
|
|
1838
1980
|
], 2),
|
|
1839
1981
|
(m(!0), g(R, null, z(c.value, (y) => (m(), g("a", {
|
|
1840
1982
|
key: `page-${y}`,
|
|
1841
1983
|
href: "#",
|
|
1842
|
-
class:
|
|
1984
|
+
class: H([
|
|
1843
1985
|
"relative inline-flex items-center px-4 py-[9px] text-sm font-semibold ring-1 ring-inset",
|
|
1844
1986
|
e.sparkTable.params.page === y ? "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"
|
|
1845
1987
|
]),
|
|
1846
1988
|
onClick: (k) => n(y)
|
|
1847
|
-
}, L(y), 11,
|
|
1848
|
-
|
|
1849
|
-
class:
|
|
1850
|
-
onClick:
|
|
1989
|
+
}, L(y), 11, Fo))), 128)),
|
|
1990
|
+
p("a", {
|
|
1991
|
+
class: H([r.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"]),
|
|
1992
|
+
onClick: d[1] || (d[1] = Q((y) => l(1), ["prevent"])),
|
|
1851
1993
|
href: "#"
|
|
1852
1994
|
}, [
|
|
1853
|
-
|
|
1854
|
-
icon:
|
|
1995
|
+
b(f, {
|
|
1996
|
+
icon: _(O).farChevronRight,
|
|
1855
1997
|
class: "size-5"
|
|
1856
1998
|
}, null, 8, ["icon"])
|
|
1857
1999
|
], 2)
|
|
1858
2000
|
])
|
|
1859
2001
|
])
|
|
1860
|
-
])) :
|
|
2002
|
+
])) : T("", !0)
|
|
1861
2003
|
])
|
|
1862
2004
|
]);
|
|
1863
2005
|
};
|
|
1864
2006
|
}
|
|
1865
|
-
},
|
|
2007
|
+
}, ee = (e, s) => {
|
|
1866
2008
|
const t = e.__vccOpts || e;
|
|
1867
|
-
for (const [
|
|
1868
|
-
t[
|
|
2009
|
+
for (const [o, l] of s)
|
|
2010
|
+
t[o] = l;
|
|
1869
2011
|
return t;
|
|
1870
|
-
},
|
|
2012
|
+
}, Do = { class: "spark-table-pagination-per-page" }, jo = {
|
|
1871
2013
|
__name: "SparkTablePaginationPerPage",
|
|
1872
2014
|
props: {
|
|
1873
2015
|
sparkTable: {
|
|
@@ -1877,19 +2019,19 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1877
2019
|
},
|
|
1878
2020
|
emits: ["paginate"],
|
|
1879
2021
|
setup(e, { emit: s }) {
|
|
1880
|
-
const t = e,
|
|
1881
|
-
label: String(
|
|
1882
|
-
value:
|
|
1883
|
-
}))), n = (
|
|
1884
|
-
|
|
2022
|
+
const t = e, o = s, l = S(() => t.sparkTable.options.perPages.map((a) => ({
|
|
2023
|
+
label: String(a),
|
|
2024
|
+
value: a
|
|
2025
|
+
}))), n = (a) => {
|
|
2026
|
+
o("paginate", {
|
|
1885
2027
|
page: 1,
|
|
1886
|
-
limit: parseInt(
|
|
2028
|
+
limit: parseInt(a)
|
|
1887
2029
|
});
|
|
1888
2030
|
};
|
|
1889
|
-
return (
|
|
2031
|
+
return (a, c) => {
|
|
1890
2032
|
const r = A("FormKit");
|
|
1891
|
-
return m(), g("div",
|
|
1892
|
-
|
|
2033
|
+
return m(), g("div", Do, [
|
|
2034
|
+
b(r, {
|
|
1893
2035
|
"model-value": e.sparkTable.params.limit,
|
|
1894
2036
|
type: "select",
|
|
1895
2037
|
options: l.value,
|
|
@@ -1901,7 +2043,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1901
2043
|
]);
|
|
1902
2044
|
};
|
|
1903
2045
|
}
|
|
1904
|
-
},
|
|
2046
|
+
}, Io = /* @__PURE__ */ ee(jo, [["__scopeId", "data-v-9ef8544b"]]), Pe = {
|
|
1905
2047
|
__name: "SparkTableToolbar",
|
|
1906
2048
|
props: {
|
|
1907
2049
|
position: {
|
|
@@ -1911,18 +2053,18 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1911
2053
|
}
|
|
1912
2054
|
},
|
|
1913
2055
|
setup(e) {
|
|
1914
|
-
const s = e, t =
|
|
2056
|
+
const s = e, t = Be(), o = S(() => !!t.default), l = S(() => {
|
|
1915
2057
|
const n = "spark-table-toolbar flex flex-wrap items-center gap-x-5 w-full";
|
|
1916
2058
|
return s.position === "footer" ? `${n} spark-table-toolbar-footer justify-between` : `${n} spark-table-toolbar-header gap-y-5 py-5`;
|
|
1917
2059
|
});
|
|
1918
|
-
return (n,
|
|
2060
|
+
return (n, a) => o.value ? (m(), g("div", {
|
|
1919
2061
|
key: 0,
|
|
1920
|
-
class:
|
|
2062
|
+
class: H(l.value)
|
|
1921
2063
|
}, [
|
|
1922
|
-
|
|
1923
|
-
], 2)) :
|
|
2064
|
+
F(n.$slots, "default")
|
|
2065
|
+
], 2)) : T("", !0);
|
|
1924
2066
|
}
|
|
1925
|
-
},
|
|
2067
|
+
}, No = { class: "spark-table-search" }, Zo = {
|
|
1926
2068
|
__name: "SparkTableSearch",
|
|
1927
2069
|
props: {
|
|
1928
2070
|
/** SparkTable instance object */
|
|
@@ -1941,33 +2083,33 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1941
2083
|
}
|
|
1942
2084
|
},
|
|
1943
2085
|
setup(e) {
|
|
1944
|
-
const s = e, t = E(""),
|
|
1945
|
-
s.sparkTable.params[
|
|
1946
|
-
[
|
|
2086
|
+
const s = e, t = E(""), o = s.config.param || "search";
|
|
2087
|
+
s.sparkTable.params[o] ? t.value = s.sparkTable.params[o] : s.config.initialValue && (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2088
|
+
[o]: s.config.initialValue
|
|
1947
2089
|
}));
|
|
1948
|
-
const l =
|
|
1949
|
-
|
|
2090
|
+
const l = ze((a) => {
|
|
2091
|
+
a ? s.sparkTable.methods.applyParams({
|
|
1950
2092
|
page: 1,
|
|
1951
|
-
[
|
|
1952
|
-
}) : s.sparkTable.methods.removeParam(
|
|
2093
|
+
[o]: a
|
|
2094
|
+
}) : s.sparkTable.methods.removeParam(o);
|
|
1953
2095
|
}, s.config.debounce || 300);
|
|
1954
|
-
|
|
1955
|
-
l(
|
|
2096
|
+
I(t, (a) => {
|
|
2097
|
+
l(a);
|
|
1956
2098
|
});
|
|
1957
2099
|
const n = s.config.placeholder || "Search...";
|
|
1958
|
-
return
|
|
1959
|
-
() => s.sparkTable.params[
|
|
1960
|
-
(
|
|
1961
|
-
|
|
2100
|
+
return I(
|
|
2101
|
+
() => s.sparkTable.params[o],
|
|
2102
|
+
(a) => {
|
|
2103
|
+
a && a !== t.value ? t.value = a : !a && t.value && (t.value = "");
|
|
1962
2104
|
}
|
|
1963
|
-
), (
|
|
2105
|
+
), (a, c) => {
|
|
1964
2106
|
const r = A("FormKit");
|
|
1965
|
-
return m(), g("div",
|
|
1966
|
-
|
|
2107
|
+
return m(), g("div", No, [
|
|
2108
|
+
b(r, Z({
|
|
1967
2109
|
modelValue: t.value,
|
|
1968
2110
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
1969
2111
|
type: "text",
|
|
1970
|
-
placeholder:
|
|
2112
|
+
placeholder: _(n),
|
|
1971
2113
|
suffixIcon: "search",
|
|
1972
2114
|
"outer-class": "!mb-0",
|
|
1973
2115
|
"wrapper-class": "!mb-0",
|
|
@@ -1976,7 +2118,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1976
2118
|
]);
|
|
1977
2119
|
};
|
|
1978
2120
|
}
|
|
1979
|
-
},
|
|
2121
|
+
}, qo = /* @__PURE__ */ ee(Zo, [["__scopeId", "data-v-976170dc"]]), Uo = { class: "spark-table-filter-select" }, Ko = {
|
|
1980
2122
|
__name: "SparkTableFilterSelect",
|
|
1981
2123
|
props: {
|
|
1982
2124
|
/** SparkTable instance object */
|
|
@@ -1992,32 +2134,32 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1992
2134
|
}
|
|
1993
2135
|
},
|
|
1994
2136
|
setup(e) {
|
|
1995
|
-
const s = e, t = E(""),
|
|
1996
|
-
s.sparkTable.params[
|
|
1997
|
-
[
|
|
2137
|
+
const s = e, t = E(""), o = s.config.param || `filter[${s.config.key}]`;
|
|
2138
|
+
s.sparkTable.params[o] ? t.value = s.sparkTable.params[o] : s.config.initialValue !== void 0 && s.config.initialValue !== null && (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2139
|
+
[o]: s.config.initialValue
|
|
1998
2140
|
}));
|
|
1999
2141
|
const l = s.config.label || null, n = S(() => [
|
|
2000
2142
|
{ label: s.config.placeholder || "All", value: "" },
|
|
2001
2143
|
...s.config.options
|
|
2002
2144
|
]);
|
|
2003
|
-
return
|
|
2004
|
-
|
|
2145
|
+
return I(t, (a) => {
|
|
2146
|
+
a ? s.sparkTable.methods.applyParams({
|
|
2005
2147
|
page: 1,
|
|
2006
|
-
[
|
|
2007
|
-
}) : s.sparkTable.methods.removeParam(
|
|
2008
|
-
}),
|
|
2009
|
-
() => s.sparkTable.params[
|
|
2010
|
-
(
|
|
2011
|
-
|
|
2148
|
+
[o]: a
|
|
2149
|
+
}) : s.sparkTable.methods.removeParam(o);
|
|
2150
|
+
}), I(
|
|
2151
|
+
() => s.sparkTable.params[o],
|
|
2152
|
+
(a) => {
|
|
2153
|
+
a != null && a !== "" ? t.value !== a && (t.value = a) : t.value && (t.value = "");
|
|
2012
2154
|
}
|
|
2013
|
-
), (
|
|
2155
|
+
), (a, c) => {
|
|
2014
2156
|
const r = A("FormKit");
|
|
2015
|
-
return m(), g("div",
|
|
2016
|
-
|
|
2157
|
+
return m(), g("div", Uo, [
|
|
2158
|
+
b(r, Z({
|
|
2017
2159
|
modelValue: t.value,
|
|
2018
2160
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
2019
2161
|
type: "select",
|
|
2020
|
-
label:
|
|
2162
|
+
label: _(l),
|
|
2021
2163
|
options: n.value,
|
|
2022
2164
|
placeholder: e.config.placeholder || "All",
|
|
2023
2165
|
"outer-class": "!mb-0",
|
|
@@ -2026,10 +2168,10 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2026
2168
|
]);
|
|
2027
2169
|
};
|
|
2028
2170
|
}
|
|
2029
|
-
},
|
|
2171
|
+
}, Go = /* @__PURE__ */ ee(Ko, [["__scopeId", "data-v-642dbc69"]]), Wo = { class: "spark-table-filter-buttons" }, Yo = {
|
|
2030
2172
|
key: 0,
|
|
2031
2173
|
class: "spark-table-filter-buttons-label"
|
|
2032
|
-
},
|
|
2174
|
+
}, Xo = {
|
|
2033
2175
|
__name: "SparkTableFilterButtons",
|
|
2034
2176
|
props: {
|
|
2035
2177
|
/** SparkTable instance object */
|
|
@@ -2045,30 +2187,30 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2045
2187
|
}
|
|
2046
2188
|
},
|
|
2047
2189
|
setup(e) {
|
|
2048
|
-
const s = e, t = E(null),
|
|
2190
|
+
const s = e, t = E(null), o = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`;
|
|
2049
2191
|
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({
|
|
2050
2192
|
[l]: s.config.initialValue
|
|
2051
2193
|
}));
|
|
2052
|
-
const n = (c) => c == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === c,
|
|
2194
|
+
const n = (c) => c == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === c, a = (c) => {
|
|
2053
2195
|
t.value = c, c == null || c === "" ? s.sparkTable.methods.removeParam(l) : s.sparkTable.methods.applyParams({
|
|
2054
2196
|
page: 1,
|
|
2055
2197
|
[l]: c
|
|
2056
2198
|
});
|
|
2057
2199
|
};
|
|
2058
|
-
return
|
|
2200
|
+
return I(
|
|
2059
2201
|
() => s.sparkTable.params[l],
|
|
2060
2202
|
(c) => {
|
|
2061
2203
|
(c == null || c === "") && t.value ? t.value = null : c !== t.value && (t.value = c);
|
|
2062
2204
|
}
|
|
2063
|
-
), (c, r) => (m(), g("div",
|
|
2064
|
-
|
|
2065
|
-
|
|
2205
|
+
), (c, r) => (m(), g("div", Wo, [
|
|
2206
|
+
_(o) ? (m(), g("span", Yo, L(_(o)), 1)) : T("", !0),
|
|
2207
|
+
b(Ns, { class: "isolate" }, {
|
|
2066
2208
|
default: C(() => [
|
|
2067
|
-
(m(!0), g(R, null, z(e.config.options, (i) => (m(),
|
|
2209
|
+
(m(!0), g(R, null, z(e.config.options, (i) => (m(), V(K, {
|
|
2068
2210
|
key: i.value,
|
|
2069
2211
|
size: "xl",
|
|
2070
2212
|
variant: n(i.value) ? "primary" : "secondary",
|
|
2071
|
-
onClick: (u) =>
|
|
2213
|
+
onClick: (u) => a(i.value)
|
|
2072
2214
|
}, {
|
|
2073
2215
|
default: C(() => [
|
|
2074
2216
|
B(L(i.label), 1)
|
|
@@ -2080,7 +2222,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2080
2222
|
})
|
|
2081
2223
|
]));
|
|
2082
2224
|
}
|
|
2083
|
-
},
|
|
2225
|
+
}, Jo = /* @__PURE__ */ ee(Xo, [["__scopeId", "data-v-0fcd0cce"]]), Qo = { class: "spark-table-date-picker" }, ea = {
|
|
2084
2226
|
__name: "SparkTableDatePicker",
|
|
2085
2227
|
props: {
|
|
2086
2228
|
/** SparkTable instance object */
|
|
@@ -2096,33 +2238,33 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2096
2238
|
}
|
|
2097
2239
|
},
|
|
2098
2240
|
setup(e) {
|
|
2099
|
-
const s = e, t = E(null),
|
|
2241
|
+
const s = e, t = E(null), o = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`, n = E(`${l}-0`);
|
|
2100
2242
|
return s.sparkTable.params[l] ? t.value = s.sparkTable.params[l] : s.config.initialValue ? (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2101
2243
|
[l]: s.config.initialValue
|
|
2102
|
-
})) : t.value = null,
|
|
2103
|
-
|
|
2244
|
+
})) : t.value = null, I(t, (a) => {
|
|
2245
|
+
a ? s.sparkTable.methods.applyParams({
|
|
2104
2246
|
page: 1,
|
|
2105
|
-
[l]:
|
|
2247
|
+
[l]: a
|
|
2106
2248
|
}) : s.sparkTable.methods.removeParam(l);
|
|
2107
|
-
}),
|
|
2249
|
+
}), I(
|
|
2108
2250
|
() => s.sparkTable.params[l],
|
|
2109
|
-
(
|
|
2110
|
-
if ((
|
|
2251
|
+
(a) => {
|
|
2252
|
+
if ((a == null || a === "") && t.value) {
|
|
2111
2253
|
t.value = null;
|
|
2112
2254
|
const c = parseInt(n.value.split("-").pop()) || 0;
|
|
2113
2255
|
n.value = `${l}-${c + 1}`;
|
|
2114
|
-
} else
|
|
2256
|
+
} else a && a !== t.value && (t.value = a);
|
|
2115
2257
|
}
|
|
2116
|
-
), (
|
|
2258
|
+
), (a, c) => {
|
|
2117
2259
|
const r = A("FormKit");
|
|
2118
|
-
return m(), g("div",
|
|
2119
|
-
(m(),
|
|
2260
|
+
return m(), g("div", Qo, [
|
|
2261
|
+
(m(), V(r, Z({
|
|
2120
2262
|
key: n.value,
|
|
2121
2263
|
modelValue: t.value,
|
|
2122
2264
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
2123
2265
|
type: "datepicker",
|
|
2124
2266
|
"picker-only": "",
|
|
2125
|
-
label:
|
|
2267
|
+
label: _(o),
|
|
2126
2268
|
placeholder: e.config.placeholder || "Select date",
|
|
2127
2269
|
overlay: !0,
|
|
2128
2270
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2133,7 +2275,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2133
2275
|
]);
|
|
2134
2276
|
};
|
|
2135
2277
|
}
|
|
2136
|
-
},
|
|
2278
|
+
}, ta = /* @__PURE__ */ ee(ea, [["__scopeId", "data-v-44ef9cb8"]]), sa = { class: "spark-table-reset" }, oa = { key: 1 }, aa = {
|
|
2137
2279
|
__name: "SparkTableReset",
|
|
2138
2280
|
props: {
|
|
2139
2281
|
/** SparkTable instance object */
|
|
@@ -2149,57 +2291,57 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2149
2291
|
},
|
|
2150
2292
|
setup(e) {
|
|
2151
2293
|
const s = e, t = () => {
|
|
2152
|
-
const
|
|
2153
|
-
Object.entries(
|
|
2294
|
+
const o = s.sparkTable.plugins || {}, l = [], n = {};
|
|
2295
|
+
Object.entries(o).forEach(([i, u]) => {
|
|
2154
2296
|
if (!u || u.type === "reset" || !(typeof u.enabled == "function" ? u.enabled(s.sparkTable.params) : u.enabled))
|
|
2155
2297
|
return;
|
|
2156
2298
|
let f = null;
|
|
2157
2299
|
u.type === "search" ? f = u.param || "search" : u.type === "filterSelect" || u.type === "filterButtons" ? f = u.param || `filter[${u.key}]` : u.type === "datePicker" && (f = u.param || `filter[${u.key}]`), f && (u.initialValue !== void 0 && u.initialValue !== null ? n[f] = u.initialValue : l.push(f));
|
|
2158
2300
|
});
|
|
2159
|
-
const
|
|
2301
|
+
const a = l.filter(
|
|
2160
2302
|
(i) => s.sparkTable.params[i] !== void 0 && s.sparkTable.params[i] !== null && s.sparkTable.params[i] !== ""
|
|
2161
2303
|
), c = Object.entries(n).filter(
|
|
2162
2304
|
([i, u]) => s.sparkTable.params[i] !== u
|
|
2163
2305
|
);
|
|
2164
|
-
if (
|
|
2306
|
+
if (a.length === 0 && c.length === 0)
|
|
2165
2307
|
return;
|
|
2166
|
-
|
|
2308
|
+
a.forEach((i) => {
|
|
2167
2309
|
delete s.sparkTable.params[i];
|
|
2168
2310
|
});
|
|
2169
2311
|
const r = Object.fromEntries(c);
|
|
2170
2312
|
s.sparkTable.methods.applyParams({ ...r, page: 1 });
|
|
2171
2313
|
};
|
|
2172
|
-
return (
|
|
2314
|
+
return (o, l) => {
|
|
2173
2315
|
const n = A("font-awesome-icon");
|
|
2174
|
-
return m(), g("div",
|
|
2175
|
-
|
|
2316
|
+
return m(), g("div", sa, [
|
|
2317
|
+
b(K, {
|
|
2176
2318
|
onClick: t,
|
|
2177
2319
|
variant: "secondary",
|
|
2178
2320
|
size: "xl"
|
|
2179
2321
|
}, {
|
|
2180
2322
|
default: C(() => [
|
|
2181
|
-
e.config.icon ? (m(),
|
|
2323
|
+
e.config.icon ? (m(), V(n, {
|
|
2182
2324
|
key: 0,
|
|
2183
2325
|
icon: ["far", e.config.icon],
|
|
2184
|
-
class:
|
|
2185
|
-
}, null, 8, ["icon", "class"])) :
|
|
2186
|
-
e.config.label ? (m(), g("span",
|
|
2326
|
+
class: H({ "mr-1.5": e.config.label })
|
|
2327
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2328
|
+
e.config.label ? (m(), g("span", oa, L(e.config.label), 1)) : T("", !0)
|
|
2187
2329
|
]),
|
|
2188
2330
|
_: 1
|
|
2189
2331
|
})
|
|
2190
2332
|
]);
|
|
2191
2333
|
};
|
|
2192
2334
|
}
|
|
2193
|
-
},
|
|
2335
|
+
}, ra = /* @__PURE__ */ ee(aa, [["__scopeId", "data-v-45343158"]]), na = { class: "spark-table" }, la = {
|
|
2194
2336
|
key: 1,
|
|
2195
2337
|
class: "pt-5"
|
|
2196
|
-
},
|
|
2338
|
+
}, ia = { class: "flex items-center gap-x-3" }, ve = {
|
|
2197
2339
|
perPages: [15, 30, 50, 100, 200, 500],
|
|
2198
2340
|
limit: 15
|
|
2199
|
-
},
|
|
2341
|
+
}, ca = {
|
|
2200
2342
|
page: 1,
|
|
2201
|
-
limit:
|
|
2202
|
-
},
|
|
2343
|
+
limit: ve.limit
|
|
2344
|
+
}, Me = {
|
|
2203
2345
|
colHeaders: !0,
|
|
2204
2346
|
filters: !1,
|
|
2205
2347
|
stretchH: "all",
|
|
@@ -2209,7 +2351,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2209
2351
|
tableClassName: "spark-table-table",
|
|
2210
2352
|
readOnlyCellClassName: "read-only",
|
|
2211
2353
|
licenseKey: "non-commercial-and-evaluation"
|
|
2212
|
-
},
|
|
2354
|
+
}, un = {
|
|
2213
2355
|
__name: "SparkTable",
|
|
2214
2356
|
props: {
|
|
2215
2357
|
url: {
|
|
@@ -2221,7 +2363,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2221
2363
|
dataTransformer: {
|
|
2222
2364
|
type: Function,
|
|
2223
2365
|
default: (e, s) => ({
|
|
2224
|
-
data:
|
|
2366
|
+
data: Y(s.settings, "nestedHeaders") ? e.data.data.map((o) => (s.settings.columnKeys || []).map((n) => o[n])) : e.data.data,
|
|
2225
2367
|
meta: {
|
|
2226
2368
|
last_page: e.data.last_page,
|
|
2227
2369
|
from: e.data.from,
|
|
@@ -2233,19 +2375,19 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2233
2375
|
params: {
|
|
2234
2376
|
type: Object,
|
|
2235
2377
|
default() {
|
|
2236
|
-
return
|
|
2378
|
+
return ca;
|
|
2237
2379
|
}
|
|
2238
2380
|
},
|
|
2239
2381
|
options: {
|
|
2240
2382
|
type: Object,
|
|
2241
2383
|
default() {
|
|
2242
|
-
return
|
|
2384
|
+
return ve;
|
|
2243
2385
|
}
|
|
2244
2386
|
},
|
|
2245
2387
|
settings: {
|
|
2246
2388
|
type: Object,
|
|
2247
2389
|
default() {
|
|
2248
|
-
return
|
|
2390
|
+
return Me;
|
|
2249
2391
|
}
|
|
2250
2392
|
},
|
|
2251
2393
|
plugins: {
|
|
@@ -2273,115 +2415,132 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2273
2415
|
"page-change"
|
|
2274
2416
|
],
|
|
2275
2417
|
setup(e, { expose: s, emit: t }) {
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
const l = t, n =
|
|
2418
|
+
const o = e;
|
|
2419
|
+
Ut(), de(It), de(Nt), de(Zt), Y(o, "settings.nestedHeaders") && de(qt);
|
|
2420
|
+
const l = t, n = Ve("axios"), a = E(null), c = E(!1), r = E(null);
|
|
2279
2421
|
let i = !1;
|
|
2280
2422
|
const u = {
|
|
2281
|
-
search:
|
|
2282
|
-
filterSelect:
|
|
2283
|
-
filterButtons:
|
|
2284
|
-
datePicker:
|
|
2285
|
-
reset:
|
|
2286
|
-
},
|
|
2423
|
+
search: qo,
|
|
2424
|
+
filterSelect: Go,
|
|
2425
|
+
filterButtons: Jo,
|
|
2426
|
+
datePicker: ta,
|
|
2427
|
+
reset: ra
|
|
2428
|
+
}, d = q({
|
|
2287
2429
|
hotInstance: null,
|
|
2288
|
-
url: S(() =>
|
|
2289
|
-
plugins:
|
|
2430
|
+
url: S(() => o.url),
|
|
2431
|
+
plugins: o.plugins,
|
|
2290
2432
|
response: {},
|
|
2291
2433
|
params: {
|
|
2292
2434
|
page: 1,
|
|
2293
|
-
limit:
|
|
2435
|
+
limit: o.options.limit
|
|
2294
2436
|
},
|
|
2295
2437
|
methods: {
|
|
2296
2438
|
applyParams: (h) => {
|
|
2297
|
-
h && (
|
|
2298
|
-
...
|
|
2439
|
+
h && (d.params = {
|
|
2440
|
+
...d.params,
|
|
2299
2441
|
...h
|
|
2300
|
-
}, l("page-change",
|
|
2442
|
+
}, l("page-change", d.params));
|
|
2301
2443
|
},
|
|
2302
2444
|
removeParam: async (h) => {
|
|
2303
|
-
|
|
2445
|
+
d.params[h] && (delete d.params[h], await d.methods.loadTable());
|
|
2304
2446
|
},
|
|
2305
2447
|
loadTable: async (h) => {
|
|
2306
|
-
if (!(!
|
|
2307
|
-
c.value = !0, r.value = null, l("loading", !0),
|
|
2448
|
+
if (!(!a.value || !a.value.hotInstance)) {
|
|
2449
|
+
c.value = !0, r.value = null, l("loading", !0), me.start(), d.hotInstance = a.value.hotInstance;
|
|
2308
2450
|
try {
|
|
2309
|
-
if (
|
|
2310
|
-
const w = await
|
|
2311
|
-
|
|
2312
|
-
} else if (
|
|
2313
|
-
const w = await n.get(
|
|
2314
|
-
params:
|
|
2451
|
+
if (o.dataProvider) {
|
|
2452
|
+
const w = await o.dataProvider(d.computed.params);
|
|
2453
|
+
d.response = o.dataTransformer(w, o);
|
|
2454
|
+
} else if (o.url) {
|
|
2455
|
+
const w = await n.get(o.url, {
|
|
2456
|
+
params: d.computed.params
|
|
2315
2457
|
});
|
|
2316
|
-
|
|
2458
|
+
d.response = o.dataTransformer(w, o);
|
|
2317
2459
|
} else {
|
|
2318
|
-
console.error("No data provider or URL provided"), c.value = !1, l("loading", !1),
|
|
2460
|
+
console.error("No data provider or URL provided"), c.value = !1, l("loading", !1), me.done();
|
|
2319
2461
|
return;
|
|
2320
2462
|
}
|
|
2321
2463
|
if (i) return;
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2325
|
-
w.width ||
|
|
2464
|
+
d.hotInstance.updateData(d.response.data), d.options.callback && typeof d.options.callback == "function" && await d.options.callback();
|
|
2465
|
+
const x = d.hotInstance.getPlugin("autoColumnSize");
|
|
2466
|
+
Y(o.settings, "columns", []).forEach((w, v) => {
|
|
2467
|
+
w.width || x.calculateColumnsWidth(v, v, !0);
|
|
2326
2468
|
}), l("load", {
|
|
2327
|
-
data:
|
|
2328
|
-
meta:
|
|
2469
|
+
data: d.response.data,
|
|
2470
|
+
meta: d.response.meta
|
|
2329
2471
|
}), h && typeof h == "function" && h();
|
|
2330
|
-
} catch (
|
|
2331
|
-
r.value =
|
|
2472
|
+
} catch (x) {
|
|
2473
|
+
r.value = x, l("error", x), console.error("Error loading table data:", x);
|
|
2332
2474
|
} finally {
|
|
2333
|
-
c.value = !1, l("loading", !1),
|
|
2475
|
+
c.value = !1, l("loading", !1), me.done();
|
|
2334
2476
|
}
|
|
2335
2477
|
}
|
|
2336
2478
|
},
|
|
2337
2479
|
// can't use sparkTable.hotInstance here because the ref isn't ready
|
|
2338
|
-
colToProp: (h) =>
|
|
2339
|
-
fireEvent: (h,
|
|
2340
|
-
l(h,
|
|
2480
|
+
colToProp: (h) => a.value.hotInstance.colToProp(h),
|
|
2481
|
+
fireEvent: (h, x) => {
|
|
2482
|
+
l(h, x);
|
|
2341
2483
|
},
|
|
2342
|
-
getSettingsForProp: (h) =>
|
|
2484
|
+
getSettingsForProp: (h) => zt(Y(d.tableSettings, "columns"), { data: h }),
|
|
2343
2485
|
// Helper methods for easier param access
|
|
2344
|
-
getParams: () =>
|
|
2345
|
-
getParam: (h) =>
|
|
2346
|
-
setParam: (h,
|
|
2347
|
-
|
|
2486
|
+
getParams: () => d.computed.params,
|
|
2487
|
+
getParam: (h) => d.computed.params[h],
|
|
2488
|
+
setParam: (h, x) => {
|
|
2489
|
+
d.methods.applyParams({ [h]: x });
|
|
2348
2490
|
},
|
|
2349
|
-
clearParam: (h) =>
|
|
2491
|
+
clearParam: (h) => d.methods.removeParam(h),
|
|
2350
2492
|
clearParams: (h) => {
|
|
2351
|
-
(Array.isArray(h) ? h : [h]).forEach((
|
|
2352
|
-
|
|
2353
|
-
}),
|
|
2493
|
+
(Array.isArray(h) ? h : [h]).forEach((P) => {
|
|
2494
|
+
d.params[P] !== void 0 && delete d.params[P];
|
|
2495
|
+
}), d.methods.applyParams({ page: 1 });
|
|
2354
2496
|
}
|
|
2355
2497
|
},
|
|
2356
2498
|
computed: {
|
|
2357
2499
|
params: S(() => ({
|
|
2358
|
-
...
|
|
2359
|
-
...
|
|
2500
|
+
...o.params,
|
|
2501
|
+
...d.params
|
|
2360
2502
|
})),
|
|
2361
|
-
ready: S(() =>
|
|
2503
|
+
ready: S(() => Dt(d, "response.meta.last_page"))
|
|
2362
2504
|
},
|
|
2363
2505
|
options: S(() => ({
|
|
2364
|
-
...
|
|
2365
|
-
...
|
|
2506
|
+
...ve,
|
|
2507
|
+
...o.options
|
|
2366
2508
|
})),
|
|
2367
2509
|
tableSettings: S(() => ({
|
|
2368
|
-
|
|
2369
|
-
nestedHeaders:
|
|
2370
|
-
...!
|
|
2371
|
-
afterGetColHeader: (h,
|
|
2510
|
+
...Me,
|
|
2511
|
+
nestedHeaders: Y(o.settings, "nestedHeaders", []),
|
|
2512
|
+
...!Y(o.settings, "nestedHeaders") && {
|
|
2513
|
+
afterGetColHeader: (h, x) => ro(h, x, d)
|
|
2372
2514
|
},
|
|
2373
|
-
afterChange: (h,
|
|
2374
|
-
afterRender: () =>
|
|
2515
|
+
afterChange: (h, x) => $o(),
|
|
2516
|
+
afterRender: () => no(d),
|
|
2375
2517
|
/**
|
|
2376
2518
|
* Prevent columns with explicit width from being stretched
|
|
2377
2519
|
* This hook fires BEFORE stretchH is applied, allowing us to cap specific columns
|
|
2378
2520
|
* while letting others stretch normally
|
|
2379
2521
|
*/
|
|
2380
|
-
beforeStretchingColumnWidth: (h,
|
|
2381
|
-
const w =
|
|
2522
|
+
beforeStretchingColumnWidth: (h, x) => {
|
|
2523
|
+
const w = Y(o.settings, "columns", [])[x];
|
|
2382
2524
|
return w && w.width !== void 0 ? w.width : h;
|
|
2383
2525
|
},
|
|
2384
|
-
|
|
2526
|
+
/**
|
|
2527
|
+
* Copy displayed cell content instead of raw data values
|
|
2528
|
+
* This ensures custom renderers copy their visual output, not the underlying data
|
|
2529
|
+
*/
|
|
2530
|
+
beforeCopy: (h, x) => {
|
|
2531
|
+
const P = a.value?.hotInstance;
|
|
2532
|
+
P && x.forEach((w) => {
|
|
2533
|
+
for (let v = w.startRow; v <= w.endRow; v++)
|
|
2534
|
+
for (let $ = w.startCol; $ <= w.endCol; $++) {
|
|
2535
|
+
const M = P.getCell(v, $);
|
|
2536
|
+
if (M) {
|
|
2537
|
+
const D = v - x[0].startRow, G = $ - x[0].startCol;
|
|
2538
|
+
h[D][G] = M.dataset.copyValue ?? M.textContent ?? "";
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
});
|
|
2542
|
+
},
|
|
2543
|
+
...o.settings
|
|
2385
2544
|
}))
|
|
2386
2545
|
}), f = (h) => {
|
|
2387
2546
|
if (!h) return null;
|
|
@@ -2395,116 +2554,116 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2395
2554
|
default:
|
|
2396
2555
|
return null;
|
|
2397
2556
|
}
|
|
2398
|
-
}, y = (h) => h ? typeof h.enabled == "function" ? h.enabled(
|
|
2399
|
-
if (
|
|
2400
|
-
() => ({ ...
|
|
2557
|
+
}, y = (h) => h ? typeof h.enabled == "function" ? h.enabled(d.params) : h.enabled : !1, k = S(() => Object.entries(o.plugins).filter(([h, x]) => y(x)).map(([h, x]) => ({ name: h, config: x })));
|
|
2558
|
+
if (I(
|
|
2559
|
+
() => ({ ...d.params }),
|
|
2401
2560
|
() => {
|
|
2402
2561
|
const h = [];
|
|
2403
|
-
Object.values(
|
|
2404
|
-
const
|
|
2405
|
-
if (!
|
|
2406
|
-
const w = y(
|
|
2407
|
-
!w &&
|
|
2408
|
-
}), h.length > 0 && h.forEach((
|
|
2409
|
-
delete
|
|
2562
|
+
Object.values(o.plugins).forEach((x) => {
|
|
2563
|
+
const P = f(x);
|
|
2564
|
+
if (!P) return;
|
|
2565
|
+
const w = y(x), v = d.params[P] !== void 0;
|
|
2566
|
+
!w && v && h.push(P);
|
|
2567
|
+
}), h.length > 0 && h.forEach((x) => {
|
|
2568
|
+
delete d.params[x];
|
|
2410
2569
|
});
|
|
2411
2570
|
},
|
|
2412
2571
|
{ deep: !0, flush: "sync" }
|
|
2413
|
-
),
|
|
2414
|
-
const h = typeof
|
|
2415
|
-
|
|
2416
|
-
namespace: h ?
|
|
2417
|
-
syncToRoute: !!
|
|
2418
|
-
persistToStorage:
|
|
2572
|
+
), o.syncToRoute || o.persistToStorage) {
|
|
2573
|
+
const h = typeof o.syncToRoute == "string";
|
|
2574
|
+
To(d, {
|
|
2575
|
+
namespace: h ? o.syncToRoute : null,
|
|
2576
|
+
syncToRoute: !!o.syncToRoute,
|
|
2577
|
+
persistToStorage: o.persistToStorage
|
|
2419
2578
|
});
|
|
2420
2579
|
}
|
|
2421
|
-
return
|
|
2422
|
-
() =>
|
|
2580
|
+
return _e(
|
|
2581
|
+
() => o.params,
|
|
2423
2582
|
async () => {
|
|
2424
|
-
|
|
2583
|
+
d.params.page = 1, await d.methods.loadTable();
|
|
2425
2584
|
},
|
|
2426
2585
|
{ debounce: 50, maxWait: 1e3 }
|
|
2427
|
-
),
|
|
2428
|
-
() =>
|
|
2586
|
+
), _e(
|
|
2587
|
+
() => d.params,
|
|
2429
2588
|
async () => {
|
|
2430
|
-
await
|
|
2589
|
+
await d.methods.loadTable();
|
|
2431
2590
|
},
|
|
2432
2591
|
{ debounce: 50, maxWait: 1e3 }
|
|
2433
|
-
),
|
|
2434
|
-
() =>
|
|
2435
|
-
async (h,
|
|
2436
|
-
h !==
|
|
2592
|
+
), I(
|
|
2593
|
+
() => o.url,
|
|
2594
|
+
async (h, x) => {
|
|
2595
|
+
h !== x && (d.params.page = 1, await d.methods.loadTable());
|
|
2437
2596
|
}
|
|
2438
|
-
),
|
|
2439
|
-
await
|
|
2440
|
-
}),
|
|
2597
|
+
), be(async () => {
|
|
2598
|
+
await d.methods.loadTable(), l("ready");
|
|
2599
|
+
}), Ye(() => {
|
|
2441
2600
|
i = !0;
|
|
2442
|
-
}),
|
|
2443
|
-
refresh: () =>
|
|
2444
|
-
getParams: () =>
|
|
2445
|
-
getParam: (h) =>
|
|
2446
|
-
setParam: (h,
|
|
2447
|
-
clearParam: (h) =>
|
|
2448
|
-
clearParams: (h) =>
|
|
2449
|
-
applyParams: (h) =>
|
|
2601
|
+
}), Co(d), s({
|
|
2602
|
+
refresh: () => d.methods.loadTable(),
|
|
2603
|
+
getParams: () => d.methods.getParams(),
|
|
2604
|
+
getParam: (h) => d.methods.getParam(h),
|
|
2605
|
+
setParam: (h, x) => d.methods.setParam(h, x),
|
|
2606
|
+
clearParam: (h) => d.methods.clearParam(h),
|
|
2607
|
+
clearParams: (h) => d.methods.clearParams(h),
|
|
2608
|
+
applyParams: (h) => d.methods.applyParams(h),
|
|
2450
2609
|
loading: c,
|
|
2451
2610
|
error: r,
|
|
2452
|
-
sparkTable:
|
|
2453
|
-
table:
|
|
2454
|
-
}), (h,
|
|
2455
|
-
|
|
2611
|
+
sparkTable: d,
|
|
2612
|
+
table: a
|
|
2613
|
+
}), (h, x) => (m(), g("div", na, [
|
|
2614
|
+
d.computed.ready && k.value && k.value.length ? (m(), V(Pe, {
|
|
2456
2615
|
key: 0,
|
|
2457
2616
|
position: "header"
|
|
2458
2617
|
}, {
|
|
2459
2618
|
default: C(() => [
|
|
2460
|
-
(m(!0), g(R, null, z(k.value, (
|
|
2461
|
-
key:
|
|
2462
|
-
class: P
|
|
2463
|
-
"spark-table":
|
|
2464
|
-
config:
|
|
2619
|
+
(m(!0), g(R, null, z(k.value, (P) => (m(), V(N(u[P.config.type]), {
|
|
2620
|
+
key: P.name,
|
|
2621
|
+
class: H(P.config.align ? `self-${P.config.align}` : ""),
|
|
2622
|
+
"spark-table": d,
|
|
2623
|
+
config: P.config
|
|
2465
2624
|
}, null, 8, ["class", "spark-table", "config"]))), 128)),
|
|
2466
|
-
|
|
2467
|
-
sparkTable:
|
|
2625
|
+
F(h.$slots, "header", {
|
|
2626
|
+
sparkTable: d,
|
|
2468
2627
|
loading: c.value,
|
|
2469
2628
|
error: r.value
|
|
2470
2629
|
})
|
|
2471
2630
|
]),
|
|
2472
2631
|
_: 3
|
|
2473
|
-
})) : (m(), g("div",
|
|
2474
|
-
|
|
2632
|
+
})) : (m(), g("div", la)),
|
|
2633
|
+
b(_(jt), {
|
|
2475
2634
|
"theme-name": "ht-theme-classic",
|
|
2476
2635
|
ref_key: "table",
|
|
2477
|
-
ref:
|
|
2478
|
-
settings:
|
|
2636
|
+
ref: a,
|
|
2637
|
+
settings: d.tableSettings
|
|
2479
2638
|
}, null, 8, ["settings"]),
|
|
2480
|
-
|
|
2639
|
+
d.computed.ready ? (m(), V(Pe, {
|
|
2481
2640
|
key: 2,
|
|
2482
2641
|
position: "footer"
|
|
2483
2642
|
}, {
|
|
2484
2643
|
default: C(() => [
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
"spark-table":
|
|
2489
|
-
onPaginate:
|
|
2644
|
+
b(Bo, { "spark-table": d }, null, 8, ["spark-table"]),
|
|
2645
|
+
p("div", ia, [
|
|
2646
|
+
b(zo, {
|
|
2647
|
+
"spark-table": d,
|
|
2648
|
+
onPaginate: d.methods.applyParams
|
|
2490
2649
|
}, null, 8, ["spark-table", "onPaginate"]),
|
|
2491
|
-
|
|
2492
|
-
"spark-table":
|
|
2493
|
-
onPaginate:
|
|
2650
|
+
b(Io, {
|
|
2651
|
+
"spark-table": d,
|
|
2652
|
+
onPaginate: d.methods.applyParams
|
|
2494
2653
|
}, null, 8, ["spark-table", "onPaginate"]),
|
|
2495
|
-
|
|
2496
|
-
sparkTable:
|
|
2654
|
+
F(h.$slots, "footer", {
|
|
2655
|
+
sparkTable: d,
|
|
2497
2656
|
loading: c.value,
|
|
2498
2657
|
error: r.value
|
|
2499
2658
|
})
|
|
2500
2659
|
])
|
|
2501
2660
|
]),
|
|
2502
2661
|
_: 3
|
|
2503
|
-
})) :
|
|
2662
|
+
})) : T("", !0)
|
|
2504
2663
|
]));
|
|
2505
2664
|
}
|
|
2506
2665
|
};
|
|
2507
|
-
function
|
|
2666
|
+
function He() {
|
|
2508
2667
|
const e = q({
|
|
2509
2668
|
isVisible: !1,
|
|
2510
2669
|
content: null,
|
|
@@ -2515,41 +2674,41 @@ function Te() {
|
|
|
2515
2674
|
e.isVisible = !e.isVisible;
|
|
2516
2675
|
}, t = () => {
|
|
2517
2676
|
e.isVisible = !1, e.content = null, e.props = {}, e.eventHandlers = {}, e.size = "md";
|
|
2518
|
-
},
|
|
2677
|
+
}, o = () => {
|
|
2519
2678
|
e.isVisible = !0;
|
|
2520
|
-
}, l = (
|
|
2521
|
-
e.content =
|
|
2679
|
+
}, l = (a, c = {}, r = {}, i = {}) => {
|
|
2680
|
+
e.content = fe(a), e.props = c, e.eventHandlers = r, e.size = i.size || "md";
|
|
2522
2681
|
};
|
|
2523
2682
|
return {
|
|
2524
2683
|
state: e,
|
|
2525
2684
|
toggle: s,
|
|
2526
2685
|
close: t,
|
|
2527
|
-
open:
|
|
2686
|
+
open: o,
|
|
2528
2687
|
setContent: l,
|
|
2529
|
-
show: (
|
|
2530
|
-
|
|
2688
|
+
show: (a, c = {}, r = {}, i = {}) => {
|
|
2689
|
+
a && l(a, c, r, i), o();
|
|
2531
2690
|
}
|
|
2532
2691
|
};
|
|
2533
2692
|
}
|
|
2534
|
-
class
|
|
2693
|
+
class ua {
|
|
2535
2694
|
constructor() {
|
|
2536
|
-
this.left =
|
|
2695
|
+
this.left = He(), this.right = He();
|
|
2537
2696
|
}
|
|
2538
|
-
showLeft = (s, t = {},
|
|
2697
|
+
showLeft = (s, t = {}, o = {}, l = {}) => {
|
|
2539
2698
|
const n = {
|
|
2540
2699
|
close: () => {
|
|
2541
|
-
|
|
2700
|
+
o.close?.(), this.closeLeft();
|
|
2542
2701
|
},
|
|
2543
|
-
...
|
|
2702
|
+
...o
|
|
2544
2703
|
};
|
|
2545
2704
|
this.left.show(s, t, n, l);
|
|
2546
2705
|
};
|
|
2547
|
-
showRight = (s, t = {},
|
|
2706
|
+
showRight = (s, t = {}, o = {}, l = {}) => {
|
|
2548
2707
|
const n = {
|
|
2549
2708
|
close: () => {
|
|
2550
|
-
|
|
2709
|
+
o.close?.(), this.closeRight();
|
|
2551
2710
|
},
|
|
2552
|
-
...
|
|
2711
|
+
...o
|
|
2553
2712
|
};
|
|
2554
2713
|
this.right.show(s, t, n, l);
|
|
2555
2714
|
};
|
|
@@ -2563,22 +2722,22 @@ class Xa {
|
|
|
2563
2722
|
this.left.close(), this.right.close();
|
|
2564
2723
|
};
|
|
2565
2724
|
}
|
|
2566
|
-
const
|
|
2725
|
+
const te = new ua(), da = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, pa = { class: "flex flex-1 flex-col" }, fa = {
|
|
2567
2726
|
class: "flex flex-1 flex-col gap-y-7",
|
|
2568
2727
|
role: "list"
|
|
2569
|
-
},
|
|
2728
|
+
}, ma = { class: "flex flex-1 flex-col" }, ha = {
|
|
2570
2729
|
role: "list",
|
|
2571
2730
|
class: "flex flex-1 flex-col"
|
|
2572
|
-
},
|
|
2731
|
+
}, ga = { class: "flex items-center pb-8" }, ya = ["href", "onClick"], va = {
|
|
2573
2732
|
key: 2,
|
|
2574
2733
|
class: "w-full flex justify-center"
|
|
2575
|
-
},
|
|
2734
|
+
}, ba = {
|
|
2576
2735
|
key: 0,
|
|
2577
2736
|
class: "mt-[5px] flex flex-col gap-[5px]"
|
|
2578
|
-
},
|
|
2737
|
+
}, xa = ["href", "onClick"], ka = {
|
|
2579
2738
|
key: 1,
|
|
2580
2739
|
class: "text-[13px]"
|
|
2581
|
-
},
|
|
2740
|
+
}, _a = { class: "mt-auto" }, wa = { class: "p-[10px] flex-shrink-0" }, Sa = { class: "flex flex-1 items-center gap-x-6" }, Ca = { class: "relative flex flex-1 items-center gap-4" }, $a = { class: "cursor-pointer" }, Ta = ["src"], La = { class: "ml-auto" }, Pa = { class: "mr-[10px] pb-[10px] flex-1 flex flex-col" }, dn = {
|
|
2582
2741
|
__name: "SparkDefaultContainer",
|
|
2583
2742
|
props: {
|
|
2584
2743
|
appStore: {
|
|
@@ -2596,113 +2755,113 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2596
2755
|
},
|
|
2597
2756
|
emits: ["overlayClose"],
|
|
2598
2757
|
setup(e, { emit: s }) {
|
|
2599
|
-
const t = e,
|
|
2758
|
+
const t = e, o = s, l = Be(), n = ne(), a = Ne(), c = De(), r = S(() => c.getAppIcon(t.appStore.state.app)), i = S(() => n.meta.hideBrandSelector === !0 ? !1 : t.appStore.state.showBrandSelector), u = () => {
|
|
2600
2759
|
const k = {};
|
|
2601
|
-
l["app-selector-bottom"] ? k.bottomSlot = () =>
|
|
2760
|
+
l["app-selector-bottom"] ? k.bottomSlot = () => ke("div", {}, l["app-selector-bottom"]()) : t.appSelectorSlots.bottomSlot && (k.bottomSlot = t.appSelectorSlots.bottomSlot), l["app-selector-footer"] ? k.footerSlot = () => ke("div", {}, l["app-selector-footer"]()) : t.appSelectorSlots.footerSlot && (k.footerSlot = t.appSelectorSlots.footerSlot), te.showRight(vs, k, {
|
|
2602
2761
|
select: (h) => {
|
|
2603
|
-
|
|
2762
|
+
te.closeRight();
|
|
2604
2763
|
}
|
|
2605
2764
|
});
|
|
2606
|
-
},
|
|
2607
|
-
|
|
2608
|
-
|
|
2765
|
+
}, d = () => {
|
|
2766
|
+
te.showLeft(
|
|
2767
|
+
js,
|
|
2609
2768
|
{},
|
|
2610
2769
|
{
|
|
2611
2770
|
select: (k) => {
|
|
2612
|
-
|
|
2771
|
+
a.toggleBrand(k), te.closeLeft();
|
|
2613
2772
|
}
|
|
2614
2773
|
}
|
|
2615
2774
|
);
|
|
2616
2775
|
}, f = S(() => t.mainNavStore.state.hidden ? ["w-0 overflow-hidden"] : [t.mainNavStore.state.collapsed ? "w-[80px]" : "w-[240px]"]), y = S(() => t.mainNavStore.state.hidden ? ["pl-2.5"] : [t.mainNavStore.state.collapsed ? "pl-[80px]" : "pl-[240px]"]);
|
|
2617
2776
|
return (k, h) => {
|
|
2618
|
-
const
|
|
2777
|
+
const x = A("font-awesome-icon"), P = A("router-view");
|
|
2619
2778
|
return m(), g(R, null, [
|
|
2620
|
-
|
|
2621
|
-
class:
|
|
2779
|
+
p("div", {
|
|
2780
|
+
class: H([f.value, "fixed inset-y-0 flex transition-all z-100"])
|
|
2622
2781
|
}, [
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2782
|
+
p("div", da, [
|
|
2783
|
+
p("nav", pa, [
|
|
2784
|
+
p("ul", fa, [
|
|
2785
|
+
p("li", ma, [
|
|
2786
|
+
p("ul", ha, [
|
|
2787
|
+
p("li", ga, [
|
|
2788
|
+
p("a", {
|
|
2630
2789
|
class: "grid w-[40px] h-[40px] place-items-center rounded-md bg-primary-600 text-white text-[13px] cursor-pointer",
|
|
2631
|
-
onClick: h[0] || (h[0] =
|
|
2790
|
+
onClick: h[0] || (h[0] = Q((w) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"]))
|
|
2632
2791
|
}, [
|
|
2633
|
-
|
|
2634
|
-
icon:
|
|
2792
|
+
b(x, {
|
|
2793
|
+
icon: _(O)[r.value],
|
|
2635
2794
|
class: "size-5"
|
|
2636
2795
|
}, null, 8, ["icon"])
|
|
2637
2796
|
]),
|
|
2638
|
-
e.mainNavStore.state.collapsed ?
|
|
2797
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (m(), g("a", {
|
|
2639
2798
|
key: 0,
|
|
2640
|
-
onClick: h[1] || (h[1] =
|
|
2799
|
+
onClick: h[1] || (h[1] = Q((w) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"])),
|
|
2641
2800
|
class: "font-medium text-gray-800 ml-[10px] cursor-pointer"
|
|
2642
2801
|
}, L(e.appStore.state.app), 1))
|
|
2643
2802
|
]),
|
|
2644
2803
|
(m(!0), g(R, null, z(e.mainNavStore.state.menu, (w) => (m(), g("li", {
|
|
2645
2804
|
key: w.name,
|
|
2646
|
-
class:
|
|
2805
|
+
class: H({
|
|
2647
2806
|
"mt-[10px]": w.children,
|
|
2648
2807
|
"mt-auto": w.footerSection
|
|
2649
2808
|
})
|
|
2650
2809
|
}, [
|
|
2651
|
-
|
|
2652
|
-
class:
|
|
2810
|
+
p("a", {
|
|
2811
|
+
class: H([{
|
|
2653
2812
|
"bg-gray-100": w.current,
|
|
2654
2813
|
"hover:bg-gray-100": w?.href
|
|
2655
2814
|
}, "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"]),
|
|
2656
2815
|
href: w?.href,
|
|
2657
|
-
onClick:
|
|
2816
|
+
onClick: Q((v) => e.mainNavStore.goto(w.href), ["prevent"])
|
|
2658
2817
|
}, [
|
|
2659
|
-
w.icon ? (m(),
|
|
2818
|
+
w.icon ? (m(), V(x, {
|
|
2660
2819
|
key: 0,
|
|
2661
|
-
icon:
|
|
2662
|
-
class:
|
|
2663
|
-
}, null, 8, ["icon", "class"])) :
|
|
2664
|
-
e.mainNavStore.state.collapsed ? w?.children ? (m(), g("div",
|
|
2665
|
-
|
|
2666
|
-
])])) :
|
|
2820
|
+
icon: _(O)[w.icon],
|
|
2821
|
+
class: H([[(w.current, "text-gray-400")], "size-4"])
|
|
2822
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2823
|
+
e.mainNavStore.state.collapsed ? w?.children ? (m(), g("div", va, [...h[6] || (h[6] = [
|
|
2824
|
+
p("div", { class: "w-[10px] h-px bg-gray-400" }, null, -1)
|
|
2825
|
+
])])) : T("", !0) : (m(), g("span", {
|
|
2667
2826
|
key: 1,
|
|
2668
|
-
class:
|
|
2827
|
+
class: H({
|
|
2669
2828
|
"text-[11px]": w?.children,
|
|
2670
2829
|
"text-[13px]": !w?.children,
|
|
2671
2830
|
"font-semibold": w?.children,
|
|
2672
2831
|
"text-gray-500": w?.children
|
|
2673
2832
|
})
|
|
2674
2833
|
}, L(w.name), 3))
|
|
2675
|
-
], 10,
|
|
2676
|
-
w.children ? (m(), g("ul",
|
|
2677
|
-
(m(!0), g(R, null, z(w.children, (
|
|
2678
|
-
key:
|
|
2834
|
+
], 10, ya),
|
|
2835
|
+
w.children ? (m(), g("ul", ba, [
|
|
2836
|
+
(m(!0), g(R, null, z(w.children, (v) => (m(), g("li", {
|
|
2837
|
+
key: v.name
|
|
2679
2838
|
}, [
|
|
2680
|
-
|
|
2681
|
-
class:
|
|
2682
|
-
href:
|
|
2683
|
-
onClick:
|
|
2839
|
+
p("a", {
|
|
2840
|
+
class: H([[v.current ? "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"]),
|
|
2841
|
+
href: v.href,
|
|
2842
|
+
onClick: Q(($) => e.mainNavStore.goto(v.href), ["prevent"])
|
|
2684
2843
|
}, [
|
|
2685
|
-
|
|
2844
|
+
v.icon ? (m(), V(x, {
|
|
2686
2845
|
key: 0,
|
|
2687
|
-
icon:
|
|
2688
|
-
class:
|
|
2689
|
-
}, null, 8, ["icon", "class"])) :
|
|
2690
|
-
e.mainNavStore.state.collapsed ?
|
|
2691
|
-
], 10,
|
|
2846
|
+
icon: _(O)[v.icon],
|
|
2847
|
+
class: H([[(v.current, "text-gray-400")], "size-4"])
|
|
2848
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2849
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (m(), g("span", ka, L(v.name), 1))
|
|
2850
|
+
], 10, xa)
|
|
2692
2851
|
]))), 128))
|
|
2693
|
-
])) :
|
|
2852
|
+
])) : T("", !0)
|
|
2694
2853
|
], 2))), 128))
|
|
2695
2854
|
])
|
|
2696
2855
|
]),
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2856
|
+
p("li", _a, [
|
|
2857
|
+
F(k.$slots, "sidebar-footer"),
|
|
2858
|
+
p("a", {
|
|
2700
2859
|
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",
|
|
2701
2860
|
href: "#",
|
|
2702
|
-
onClick: h[2] || (h[2] =
|
|
2861
|
+
onClick: h[2] || (h[2] = Q((w) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
|
|
2703
2862
|
}, [
|
|
2704
|
-
|
|
2705
|
-
icon:
|
|
2863
|
+
b(x, {
|
|
2864
|
+
icon: _(O)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
|
|
2706
2865
|
class: "class-5"
|
|
2707
2866
|
}, null, 8, ["icon"])
|
|
2708
2867
|
])
|
|
@@ -2711,109 +2870,109 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2711
2870
|
])
|
|
2712
2871
|
])
|
|
2713
2872
|
], 2),
|
|
2714
|
-
|
|
2715
|
-
class:
|
|
2873
|
+
p("div", {
|
|
2874
|
+
class: H([y.value, "h-full transition-all flex flex-col"])
|
|
2716
2875
|
}, [
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
icon:
|
|
2876
|
+
p("div", wa, [
|
|
2877
|
+
p("div", Sa, [
|
|
2878
|
+
p("div", Ca, [
|
|
2879
|
+
F(k.$slots, "header-left", {}, () => [
|
|
2880
|
+
p("div", $a, [
|
|
2881
|
+
b(x, {
|
|
2882
|
+
icon: _(O).farBarsSort,
|
|
2724
2883
|
class: "size-5",
|
|
2725
2884
|
onClick: h[3] || (h[3] = (w) => e.mainNavStore.toggleHidden())
|
|
2726
2885
|
}, null, 8, ["icon"])
|
|
2727
2886
|
])
|
|
2728
2887
|
]),
|
|
2729
|
-
|
|
2888
|
+
F(k.$slots, "header-center", {}, () => [
|
|
2730
2889
|
i.value ? (m(), g("div", {
|
|
2731
2890
|
key: 0,
|
|
2732
2891
|
class: "absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center",
|
|
2733
|
-
onClick:
|
|
2892
|
+
onClick: d
|
|
2734
2893
|
}, [
|
|
2735
|
-
|
|
2894
|
+
_(a).currentBrand ? (m(), g("img", {
|
|
2736
2895
|
key: 0,
|
|
2737
|
-
src:
|
|
2896
|
+
src: _(a).currentBrand.logo,
|
|
2738
2897
|
alt: "",
|
|
2739
2898
|
class: "h-[30px] w-auto"
|
|
2740
|
-
}, null, 8,
|
|
2741
|
-
])) :
|
|
2899
|
+
}, null, 8, Ta)) : T("", !0)
|
|
2900
|
+
])) : T("", !0)
|
|
2742
2901
|
]),
|
|
2743
|
-
|
|
2744
|
-
|
|
2902
|
+
p("div", La, [
|
|
2903
|
+
F(k.$slots, "header-right", {}, () => [
|
|
2745
2904
|
e.appStore.state.showAppSelector ? (m(), g("button", {
|
|
2746
2905
|
key: 0,
|
|
2747
2906
|
class: "rounded-sm bg-white w-[42px] h-[42px] ring-1 ring-inset ring-gray-300",
|
|
2748
2907
|
type: "button",
|
|
2749
2908
|
onClick: u
|
|
2750
2909
|
}, [
|
|
2751
|
-
|
|
2752
|
-
icon:
|
|
2910
|
+
b(x, {
|
|
2911
|
+
icon: _(O).farGripDotsVertical,
|
|
2753
2912
|
class: "size-4 text-gray-400"
|
|
2754
2913
|
}, null, 8, ["icon"])
|
|
2755
|
-
])) :
|
|
2914
|
+
])) : T("", !0)
|
|
2756
2915
|
])
|
|
2757
2916
|
])
|
|
2758
2917
|
])
|
|
2759
2918
|
])
|
|
2760
2919
|
]),
|
|
2761
|
-
|
|
2762
|
-
|
|
2920
|
+
p("main", Pa, [
|
|
2921
|
+
b(P)
|
|
2763
2922
|
])
|
|
2764
2923
|
], 2),
|
|
2765
|
-
|
|
2924
|
+
b(_(Se), {
|
|
2766
2925
|
position: "left",
|
|
2767
|
-
"overlay-instance":
|
|
2768
|
-
onClose: h[4] || (h[4] = (w) =>
|
|
2926
|
+
"overlay-instance": _(te).left,
|
|
2927
|
+
onClose: h[4] || (h[4] = (w) => o("overlayClose", "left"))
|
|
2769
2928
|
}, null, 8, ["overlay-instance"]),
|
|
2770
|
-
|
|
2929
|
+
b(_(Se), {
|
|
2771
2930
|
position: "right",
|
|
2772
|
-
"overlay-instance":
|
|
2773
|
-
onClose: h[5] || (h[5] = (w) =>
|
|
2931
|
+
"overlay-instance": _(te).right,
|
|
2932
|
+
onClose: h[5] || (h[5] = (w) => o("overlayClose", "right"))
|
|
2774
2933
|
}, null, 8, ["overlay-instance"]),
|
|
2775
|
-
|
|
2934
|
+
b(_(Qs))
|
|
2776
2935
|
], 64);
|
|
2777
2936
|
};
|
|
2778
2937
|
}
|
|
2779
|
-
},
|
|
2780
|
-
function
|
|
2938
|
+
}, Ma = {}, Ha = { class: "h-full" };
|
|
2939
|
+
function Va(e, s) {
|
|
2781
2940
|
const t = A("router-view");
|
|
2782
|
-
return m(), g("main",
|
|
2783
|
-
|
|
2941
|
+
return m(), g("main", Ha, [
|
|
2942
|
+
b(t)
|
|
2784
2943
|
]);
|
|
2785
2944
|
}
|
|
2786
|
-
const
|
|
2945
|
+
const pn = /* @__PURE__ */ ee(Ma, [["render", Va]]), Ra = (e) => {
|
|
2787
2946
|
const s = document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));
|
|
2788
2947
|
return s ? s[2] : null;
|
|
2789
|
-
},
|
|
2948
|
+
}, Ba = (e, s, t = {}) => {
|
|
2790
2949
|
const {
|
|
2791
|
-
maxAge:
|
|
2950
|
+
maxAge: o = 31536e3,
|
|
2792
2951
|
// 365 days in seconds
|
|
2793
|
-
domain: l =
|
|
2952
|
+
domain: l = Ze(),
|
|
2794
2953
|
secure: n = !0,
|
|
2795
|
-
sameSite:
|
|
2954
|
+
sameSite: a = "Lax",
|
|
2796
2955
|
path: c = "/"
|
|
2797
2956
|
} = t;
|
|
2798
|
-
let r = `${e}=${s}; max-age=${
|
|
2957
|
+
let r = `${e}=${s}; max-age=${o}; path=${c}; samesite=${a}`;
|
|
2799
2958
|
l && (r += `; domain=${l}`), n && (r += "; secure"), document.cookie = r;
|
|
2800
|
-
},
|
|
2801
|
-
const { domain: t =
|
|
2802
|
-
let l = `${e}=; max-age=0; path=${
|
|
2959
|
+
}, Ea = (e, s = {}) => {
|
|
2960
|
+
const { domain: t = Ze(), path: o = "/" } = s;
|
|
2961
|
+
let l = `${e}=; max-age=0; path=${o}`;
|
|
2803
2962
|
t && (l += `; domain=${t}`), document.cookie = l;
|
|
2804
|
-
},
|
|
2963
|
+
}, Ze = () => {
|
|
2805
2964
|
const e = window.location.hostname;
|
|
2806
2965
|
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;
|
|
2807
|
-
},
|
|
2808
|
-
function
|
|
2809
|
-
|
|
2966
|
+
}, qe = [];
|
|
2967
|
+
function Aa(e) {
|
|
2968
|
+
qe.push(e);
|
|
2810
2969
|
}
|
|
2811
|
-
function
|
|
2812
|
-
|
|
2970
|
+
function Oa() {
|
|
2971
|
+
qe.forEach((e) => e());
|
|
2813
2972
|
}
|
|
2814
|
-
function
|
|
2973
|
+
function fn(e) {
|
|
2815
2974
|
let s = !1;
|
|
2816
|
-
return
|
|
2975
|
+
return Aa(() => {
|
|
2817
2976
|
s = !1;
|
|
2818
2977
|
}), {
|
|
2819
2978
|
bootstrapApp: async () => {
|
|
@@ -2826,7 +2985,7 @@ function en(e) {
|
|
|
2826
2985
|
}
|
|
2827
2986
|
};
|
|
2828
2987
|
}
|
|
2829
|
-
const
|
|
2988
|
+
const ye = "bolt-next-token", U = ue("auth", () => {
|
|
2830
2989
|
const e = q({
|
|
2831
2990
|
user: null,
|
|
2832
2991
|
token: null,
|
|
@@ -2862,15 +3021,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2862
3021
|
}), s = (i = {}) => {
|
|
2863
3022
|
i.endpoints && Object.assign(e.endpoints, i.endpoints), i.routes && Object.assign(e.routes, i.routes), i.devCredentials && Object.assign(e.devCredentials, i.devCredentials), i.callbacks && Object.assign(e.callbacks, i.callbacks), i.overrideToken && (e.overrideToken = i.overrideToken);
|
|
2864
3023
|
}, t = (i) => {
|
|
2865
|
-
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2868
|
-
}, l = () =>
|
|
2869
|
-
const u = await
|
|
2870
|
-
return t(
|
|
2871
|
-
},
|
|
3024
|
+
Ba(ye, i), e.token = i;
|
|
3025
|
+
}, o = () => {
|
|
3026
|
+
Ea(ye), e.token = null;
|
|
3027
|
+
}, l = () => Ra(ye), n = async (i) => {
|
|
3028
|
+
const u = await re.post(e.endpoints.login, i), d = u.headers.authorization;
|
|
3029
|
+
return t(d), e.user = u.data, e.callbacks.onLoginSuccess && await e.callbacks.onLoginSuccess(u.data), u.data;
|
|
3030
|
+
}, a = async () => {
|
|
2872
3031
|
try {
|
|
2873
|
-
await
|
|
3032
|
+
await re.post(
|
|
2874
3033
|
e.endpoints.logout,
|
|
2875
3034
|
{},
|
|
2876
3035
|
{
|
|
@@ -2882,21 +3041,21 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2882
3041
|
} catch (i) {
|
|
2883
3042
|
throw e.callbacks.onLogoutError && await e.callbacks.onLogoutError(i), i;
|
|
2884
3043
|
} finally {
|
|
2885
|
-
|
|
3044
|
+
o(), e.user = null, Oa();
|
|
2886
3045
|
}
|
|
2887
3046
|
}, c = async () => {
|
|
2888
3047
|
const i = e.overrideToken || l();
|
|
2889
3048
|
if (!i)
|
|
2890
3049
|
return e.ready = !0, null;
|
|
2891
3050
|
try {
|
|
2892
|
-
const { data: u } = await
|
|
3051
|
+
const { data: u } = await re.get(e.endpoints.fetch, {
|
|
2893
3052
|
headers: {
|
|
2894
3053
|
Authorization: `Bearer ${i}`
|
|
2895
3054
|
}
|
|
2896
3055
|
});
|
|
2897
3056
|
e.user = u, e.overrideToken || (e.token = i);
|
|
2898
3057
|
} catch {
|
|
2899
|
-
e.overrideToken ||
|
|
3058
|
+
e.overrideToken || o();
|
|
2900
3059
|
} finally {
|
|
2901
3060
|
e.ready = !0;
|
|
2902
3061
|
}
|
|
@@ -2905,24 +3064,24 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2905
3064
|
state: e,
|
|
2906
3065
|
initialize: s,
|
|
2907
3066
|
login: n,
|
|
2908
|
-
logout:
|
|
3067
|
+
logout: a,
|
|
2909
3068
|
fetchUser: c,
|
|
2910
3069
|
check: r,
|
|
2911
3070
|
setTokenCookie: t,
|
|
2912
|
-
clearTokenCookie:
|
|
3071
|
+
clearTokenCookie: o,
|
|
2913
3072
|
getTokenCookie: l
|
|
2914
3073
|
};
|
|
2915
|
-
}),
|
|
3074
|
+
}), Fa = { class: "h-full grid place-content-center relative" }, za = { class: "absolute top-8 left-8" }, Da = ["src"], ja = {
|
|
2916
3075
|
key: 1,
|
|
2917
3076
|
width: "59",
|
|
2918
3077
|
height: "23",
|
|
2919
3078
|
viewBox: "0 0 59 23",
|
|
2920
3079
|
fill: "none",
|
|
2921
3080
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2922
|
-
},
|
|
3081
|
+
}, Ia = { class: "max-w-sm grid gap-y-1 -mt-8" }, Na = { class: "mb-7" }, Za = { class: "text-gray-600" }, qa = { class: "grid grid-flow-col justify-between mt-1 mb-4" }, Ua = {
|
|
2923
3082
|
key: 0,
|
|
2924
3083
|
class: "text-red-600 text-sm mb-2"
|
|
2925
|
-
},
|
|
3084
|
+
}, Ka = { key: 0 }, Ga = { key: 1 }, Wa = {
|
|
2926
3085
|
__name: "SparkLoginView",
|
|
2927
3086
|
props: {
|
|
2928
3087
|
logo: {
|
|
@@ -2939,8 +3098,8 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2939
3098
|
}
|
|
2940
3099
|
},
|
|
2941
3100
|
setup(e) {
|
|
2942
|
-
const s =
|
|
2943
|
-
|
|
3101
|
+
const s = J(), t = ne(), o = je(), l = U(), n = e, a = E(!1), c = E(""), r = async (i) => {
|
|
3102
|
+
a.value = !0, c.value = "";
|
|
2944
3103
|
try {
|
|
2945
3104
|
await l.login(i);
|
|
2946
3105
|
const u = t.query.redirect;
|
|
@@ -2955,69 +3114,69 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2955
3114
|
} catch (u) {
|
|
2956
3115
|
c.value = u.response?.data?.message || u.message || "Login failed. Please try again.";
|
|
2957
3116
|
} finally {
|
|
2958
|
-
|
|
3117
|
+
a.value = !1;
|
|
2959
3118
|
}
|
|
2960
3119
|
};
|
|
2961
3120
|
return (i, u) => {
|
|
2962
|
-
const
|
|
2963
|
-
return m(), g("div",
|
|
2964
|
-
|
|
3121
|
+
const d = A("FormKit"), f = A("router-link");
|
|
3122
|
+
return m(), g("div", Fa, [
|
|
3123
|
+
p("div", za, [
|
|
2965
3124
|
n.logo ? (m(), g("img", {
|
|
2966
3125
|
key: 0,
|
|
2967
3126
|
src: n.logo,
|
|
2968
3127
|
alt: "Logo",
|
|
2969
3128
|
class: "h-[23px] w-auto"
|
|
2970
|
-
}, null, 8,
|
|
2971
|
-
|
|
3129
|
+
}, null, 8, Da)) : (m(), g("svg", ja, [...u[0] || (u[0] = [
|
|
3130
|
+
p("path", {
|
|
2972
3131
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
2973
3132
|
fill: "#1C64F2"
|
|
2974
3133
|
}, null, -1),
|
|
2975
|
-
|
|
3134
|
+
p("path", {
|
|
2976
3135
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
2977
3136
|
fill: "#1C64F2"
|
|
2978
3137
|
}, null, -1),
|
|
2979
|
-
|
|
3138
|
+
p("path", {
|
|
2980
3139
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
2981
3140
|
fill: "#1C64F2"
|
|
2982
3141
|
}, null, -1),
|
|
2983
|
-
|
|
3142
|
+
p("path", {
|
|
2984
3143
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
2985
3144
|
fill: "#1C64F2"
|
|
2986
3145
|
}, null, -1)
|
|
2987
3146
|
])]))
|
|
2988
3147
|
]),
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
u[1] || (u[1] =
|
|
2992
|
-
|
|
3148
|
+
p("div", Ia, [
|
|
3149
|
+
p("div", Na, [
|
|
3150
|
+
u[1] || (u[1] = p("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Log in", -1)),
|
|
3151
|
+
p("p", Za, " Welcome back" + L(_(o).state.app ? ` to ${_(o).state.app}` : "") + "! Please enter your details. ", 1)
|
|
2993
3152
|
]),
|
|
2994
|
-
|
|
3153
|
+
b(d, {
|
|
2995
3154
|
type: "form",
|
|
2996
3155
|
onSubmit: r,
|
|
2997
3156
|
actions: !1
|
|
2998
3157
|
}, {
|
|
2999
3158
|
default: C(() => [
|
|
3000
|
-
|
|
3159
|
+
b(d, {
|
|
3001
3160
|
label: "Email",
|
|
3002
3161
|
name: "email",
|
|
3003
3162
|
placeholder: "Enter your email",
|
|
3004
3163
|
type: "email",
|
|
3005
3164
|
validation: "required|email",
|
|
3006
3165
|
"outer-class": "max-w-full",
|
|
3007
|
-
value:
|
|
3166
|
+
value: _(l).state.devCredentials.username
|
|
3008
3167
|
}, null, 8, ["value"]),
|
|
3009
|
-
|
|
3168
|
+
b(d, {
|
|
3010
3169
|
label: "Password",
|
|
3011
3170
|
name: "password",
|
|
3012
3171
|
placeholder: "••••••••",
|
|
3013
3172
|
type: "password",
|
|
3014
3173
|
validation: "required",
|
|
3015
3174
|
"outer-class": "max-w-full",
|
|
3016
|
-
value:
|
|
3175
|
+
value: _(l).state.devCredentials.password
|
|
3017
3176
|
}, null, 8, ["value"]),
|
|
3018
|
-
|
|
3019
|
-
u[3] || (u[3] =
|
|
3020
|
-
|
|
3177
|
+
p("div", qa, [
|
|
3178
|
+
u[3] || (u[3] = p("span", null, null, -1)),
|
|
3179
|
+
b(f, {
|
|
3021
3180
|
to: n.forgotPasswordRoute,
|
|
3022
3181
|
class: "text-sm text-primary-600 font-semibold"
|
|
3023
3182
|
}, {
|
|
@@ -3027,15 +3186,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3027
3186
|
_: 1
|
|
3028
3187
|
}, 8, ["to"])
|
|
3029
3188
|
]),
|
|
3030
|
-
c.value ? (m(), g("div",
|
|
3031
|
-
|
|
3189
|
+
c.value ? (m(), g("div", Ua, L(c.value), 1)) : T("", !0),
|
|
3190
|
+
b(_(K), {
|
|
3032
3191
|
type: "submit",
|
|
3033
3192
|
size: "xl",
|
|
3034
|
-
disabled:
|
|
3193
|
+
disabled: a.value,
|
|
3035
3194
|
"button-class": "w-full mb-2"
|
|
3036
3195
|
}, {
|
|
3037
3196
|
default: C(() => [
|
|
3038
|
-
|
|
3197
|
+
a.value ? (m(), g("span", Ga, "Signing in...")) : (m(), g("span", Ka, "Sign in"))
|
|
3039
3198
|
]),
|
|
3040
3199
|
_: 1
|
|
3041
3200
|
}, 8, ["disabled"])
|
|
@@ -3046,7 +3205,7 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3046
3205
|
]);
|
|
3047
3206
|
};
|
|
3048
3207
|
}
|
|
3049
|
-
},
|
|
3208
|
+
}, Ya = {
|
|
3050
3209
|
__name: "SparkLogoutView",
|
|
3051
3210
|
props: {
|
|
3052
3211
|
defaultRedirect: {
|
|
@@ -3055,27 +3214,27 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3055
3214
|
}
|
|
3056
3215
|
},
|
|
3057
3216
|
setup(e) {
|
|
3058
|
-
const s =
|
|
3059
|
-
return
|
|
3060
|
-
await
|
|
3217
|
+
const s = J(), t = ne(), o = U(), l = e;
|
|
3218
|
+
return be(async () => {
|
|
3219
|
+
await o.logout();
|
|
3061
3220
|
const n = t.query.redirect;
|
|
3062
3221
|
n && n.startsWith("http") ? window.location.href = n : await s.push(n || l.defaultRedirect);
|
|
3063
|
-
}), (n,
|
|
3222
|
+
}), (n, a) => null;
|
|
3064
3223
|
}
|
|
3065
|
-
},
|
|
3224
|
+
}, Xa = { class: "h-full grid place-content-center relative" }, Ja = { class: "absolute top-8 left-8" }, Qa = ["src"], er = {
|
|
3066
3225
|
key: 1,
|
|
3067
3226
|
width: "59",
|
|
3068
3227
|
height: "23",
|
|
3069
3228
|
viewBox: "0 0 59 23",
|
|
3070
3229
|
fill: "none",
|
|
3071
3230
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3072
|
-
},
|
|
3231
|
+
}, tr = { class: "max-w-sm grid gap-y-1 -mt-8" }, sr = {
|
|
3073
3232
|
key: 0,
|
|
3074
3233
|
class: "text-red-600 text-sm mb-2"
|
|
3075
|
-
},
|
|
3234
|
+
}, or = {
|
|
3076
3235
|
key: 1,
|
|
3077
3236
|
class: "text-green-600 text-sm mb-2"
|
|
3078
|
-
},
|
|
3237
|
+
}, ar = { key: 0 }, rr = { key: 1 }, nr = {
|
|
3079
3238
|
__name: "SparkForgotPasswordView",
|
|
3080
3239
|
props: {
|
|
3081
3240
|
logo: {
|
|
@@ -3088,56 +3247,56 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3088
3247
|
}
|
|
3089
3248
|
},
|
|
3090
3249
|
setup(e) {
|
|
3091
|
-
const s =
|
|
3092
|
-
|
|
3250
|
+
const s = U(), t = e, o = E(!1), l = E(""), n = E(""), a = async ({ email: c }) => {
|
|
3251
|
+
o.value = !0, l.value = "", n.value = "";
|
|
3093
3252
|
try {
|
|
3094
|
-
await
|
|
3253
|
+
await re.post(s.state.endpoints.passwordEmail, { email: c }), n.value = "Password reset link sent! Check your email.";
|
|
3095
3254
|
} catch (r) {
|
|
3096
3255
|
l.value = r.response?.data?.message || "Failed to send reset link.";
|
|
3097
3256
|
} finally {
|
|
3098
|
-
|
|
3257
|
+
o.value = !1;
|
|
3099
3258
|
}
|
|
3100
3259
|
};
|
|
3101
3260
|
return (c, r) => {
|
|
3102
3261
|
const i = A("FormKit"), u = A("router-link");
|
|
3103
|
-
return m(), g("div",
|
|
3104
|
-
|
|
3262
|
+
return m(), g("div", Xa, [
|
|
3263
|
+
p("div", Ja, [
|
|
3105
3264
|
t.logo ? (m(), g("img", {
|
|
3106
3265
|
key: 0,
|
|
3107
3266
|
src: t.logo,
|
|
3108
3267
|
alt: "Logo",
|
|
3109
3268
|
class: "h-[23px] w-auto"
|
|
3110
|
-
}, null, 8,
|
|
3111
|
-
|
|
3269
|
+
}, null, 8, Qa)) : (m(), g("svg", er, [...r[0] || (r[0] = [
|
|
3270
|
+
p("path", {
|
|
3112
3271
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3113
3272
|
fill: "#1C64F2"
|
|
3114
3273
|
}, null, -1),
|
|
3115
|
-
|
|
3274
|
+
p("path", {
|
|
3116
3275
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3117
3276
|
fill: "#1C64F2"
|
|
3118
3277
|
}, null, -1),
|
|
3119
|
-
|
|
3278
|
+
p("path", {
|
|
3120
3279
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
3121
3280
|
fill: "#1C64F2"
|
|
3122
3281
|
}, null, -1),
|
|
3123
|
-
|
|
3282
|
+
p("path", {
|
|
3124
3283
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
3125
3284
|
fill: "#1C64F2"
|
|
3126
3285
|
}, null, -1)
|
|
3127
3286
|
])]))
|
|
3128
3287
|
]),
|
|
3129
|
-
|
|
3130
|
-
r[2] || (r[2] =
|
|
3131
|
-
|
|
3132
|
-
|
|
3288
|
+
p("div", tr, [
|
|
3289
|
+
r[2] || (r[2] = p("div", { class: "mb-7" }, [
|
|
3290
|
+
p("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Reset password"),
|
|
3291
|
+
p("p", { class: "text-gray-600" }, " Enter your email and we'll send you a link to reset your password. ")
|
|
3133
3292
|
], -1)),
|
|
3134
|
-
|
|
3293
|
+
b(i, {
|
|
3135
3294
|
type: "form",
|
|
3136
|
-
onSubmit:
|
|
3295
|
+
onSubmit: a,
|
|
3137
3296
|
actions: !1
|
|
3138
3297
|
}, {
|
|
3139
3298
|
default: C(() => [
|
|
3140
|
-
|
|
3299
|
+
b(i, {
|
|
3141
3300
|
label: "Email",
|
|
3142
3301
|
name: "email",
|
|
3143
3302
|
placeholder: "Enter your email",
|
|
@@ -3145,20 +3304,20 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3145
3304
|
validation: "required|email",
|
|
3146
3305
|
"outer-class": "max-w-full"
|
|
3147
3306
|
}),
|
|
3148
|
-
l.value ? (m(), g("div",
|
|
3149
|
-
n.value ? (m(), g("div",
|
|
3150
|
-
|
|
3307
|
+
l.value ? (m(), g("div", sr, L(l.value), 1)) : T("", !0),
|
|
3308
|
+
n.value ? (m(), g("div", or, L(n.value), 1)) : T("", !0),
|
|
3309
|
+
b(_(K), {
|
|
3151
3310
|
type: "submit",
|
|
3152
3311
|
size: "xl",
|
|
3153
|
-
disabled:
|
|
3312
|
+
disabled: o.value,
|
|
3154
3313
|
"button-class": "w-full mb-2"
|
|
3155
3314
|
}, {
|
|
3156
3315
|
default: C(() => [
|
|
3157
|
-
|
|
3316
|
+
o.value ? (m(), g("span", rr, "Sending...")) : (m(), g("span", ar, "Send reset link"))
|
|
3158
3317
|
]),
|
|
3159
3318
|
_: 1
|
|
3160
3319
|
}, 8, ["disabled"]),
|
|
3161
|
-
|
|
3320
|
+
b(u, {
|
|
3162
3321
|
to: t.loginRoute,
|
|
3163
3322
|
class: "text-sm text-center text-primary-600 font-semibold block"
|
|
3164
3323
|
}, {
|
|
@@ -3174,17 +3333,17 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3174
3333
|
]);
|
|
3175
3334
|
};
|
|
3176
3335
|
}
|
|
3177
|
-
},
|
|
3336
|
+
}, lr = { class: "h-full grid place-content-center relative" }, ir = { class: "absolute top-8 left-8" }, cr = ["src"], ur = {
|
|
3178
3337
|
key: 1,
|
|
3179
3338
|
width: "59",
|
|
3180
3339
|
height: "23",
|
|
3181
3340
|
viewBox: "0 0 59 23",
|
|
3182
3341
|
fill: "none",
|
|
3183
3342
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3184
|
-
},
|
|
3343
|
+
}, dr = { class: "max-w-sm grid gap-y-1 -mt-8" }, pr = {
|
|
3185
3344
|
key: 0,
|
|
3186
3345
|
class: "text-red-600 text-sm mb-2"
|
|
3187
|
-
},
|
|
3346
|
+
}, fr = { key: 0 }, mr = { key: 1 }, hr = {
|
|
3188
3347
|
__name: "SparkResetPasswordView",
|
|
3189
3348
|
props: {
|
|
3190
3349
|
logo: {
|
|
@@ -3197,61 +3356,61 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3197
3356
|
}
|
|
3198
3357
|
},
|
|
3199
3358
|
setup(e) {
|
|
3200
|
-
const s =
|
|
3201
|
-
n.value = !0,
|
|
3359
|
+
const s = J(), t = ne(), o = U(), l = e, n = E(!1), a = E(""), c = async ({ password: r, password_confirmation: i }) => {
|
|
3360
|
+
n.value = !0, a.value = "";
|
|
3202
3361
|
try {
|
|
3203
|
-
await
|
|
3362
|
+
await re.post(o.state.endpoints.passwordReset, {
|
|
3204
3363
|
email: t.query.email,
|
|
3205
3364
|
token: t.query.token,
|
|
3206
3365
|
password: r,
|
|
3207
3366
|
password_confirmation: i
|
|
3208
3367
|
}), await s.push(l.loginRoute);
|
|
3209
3368
|
} catch (u) {
|
|
3210
|
-
|
|
3369
|
+
a.value = u.response?.data?.message || "Failed to reset password.";
|
|
3211
3370
|
} finally {
|
|
3212
3371
|
n.value = !1;
|
|
3213
3372
|
}
|
|
3214
3373
|
};
|
|
3215
3374
|
return (r, i) => {
|
|
3216
3375
|
const u = A("FormKit");
|
|
3217
|
-
return m(), g("div",
|
|
3218
|
-
|
|
3376
|
+
return m(), g("div", lr, [
|
|
3377
|
+
p("div", ir, [
|
|
3219
3378
|
l.logo ? (m(), g("img", {
|
|
3220
3379
|
key: 0,
|
|
3221
3380
|
src: l.logo,
|
|
3222
3381
|
alt: "Logo",
|
|
3223
3382
|
class: "h-[23px] w-auto"
|
|
3224
|
-
}, null, 8,
|
|
3225
|
-
|
|
3383
|
+
}, null, 8, cr)) : (m(), g("svg", ur, [...i[0] || (i[0] = [
|
|
3384
|
+
p("path", {
|
|
3226
3385
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3227
3386
|
fill: "#1C64F2"
|
|
3228
3387
|
}, null, -1),
|
|
3229
|
-
|
|
3388
|
+
p("path", {
|
|
3230
3389
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3231
3390
|
fill: "#1C64F2"
|
|
3232
3391
|
}, null, -1),
|
|
3233
|
-
|
|
3392
|
+
p("path", {
|
|
3234
3393
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
3235
3394
|
fill: "#1C64F2"
|
|
3236
3395
|
}, null, -1),
|
|
3237
|
-
|
|
3396
|
+
p("path", {
|
|
3238
3397
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
3239
3398
|
fill: "#1C64F2"
|
|
3240
3399
|
}, null, -1)
|
|
3241
3400
|
])]))
|
|
3242
3401
|
]),
|
|
3243
|
-
|
|
3244
|
-
i[1] || (i[1] =
|
|
3245
|
-
|
|
3246
|
-
|
|
3402
|
+
p("div", dr, [
|
|
3403
|
+
i[1] || (i[1] = p("div", { class: "mb-7" }, [
|
|
3404
|
+
p("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Set new password"),
|
|
3405
|
+
p("p", { class: "text-gray-600" }, " Enter your new password below. ")
|
|
3247
3406
|
], -1)),
|
|
3248
|
-
|
|
3407
|
+
b(u, {
|
|
3249
3408
|
type: "form",
|
|
3250
3409
|
onSubmit: c,
|
|
3251
3410
|
actions: !1
|
|
3252
3411
|
}, {
|
|
3253
3412
|
default: C(() => [
|
|
3254
|
-
|
|
3413
|
+
b(u, {
|
|
3255
3414
|
label: "New Password",
|
|
3256
3415
|
name: "password",
|
|
3257
3416
|
placeholder: "••••••••",
|
|
@@ -3259,7 +3418,7 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3259
3418
|
validation: "required|length:8",
|
|
3260
3419
|
"outer-class": "max-w-full"
|
|
3261
3420
|
}),
|
|
3262
|
-
|
|
3421
|
+
b(u, {
|
|
3263
3422
|
label: "Confirm Password",
|
|
3264
3423
|
name: "password_confirmation",
|
|
3265
3424
|
placeholder: "••••••••",
|
|
@@ -3267,15 +3426,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3267
3426
|
validation: "required|confirm:password",
|
|
3268
3427
|
"outer-class": "max-w-full"
|
|
3269
3428
|
}),
|
|
3270
|
-
|
|
3271
|
-
|
|
3429
|
+
a.value ? (m(), g("div", pr, L(a.value), 1)) : T("", !0),
|
|
3430
|
+
b(_(K), {
|
|
3272
3431
|
type: "submit",
|
|
3273
3432
|
size: "xl",
|
|
3274
3433
|
disabled: n.value,
|
|
3275
3434
|
"button-class": "w-full mb-2"
|
|
3276
3435
|
}, {
|
|
3277
3436
|
default: C(() => [
|
|
3278
|
-
n.value ? (m(), g("span",
|
|
3437
|
+
n.value ? (m(), g("span", mr, "Resetting...")) : (m(), g("span", fr, "Reset password"))
|
|
3279
3438
|
]),
|
|
3280
3439
|
_: 1
|
|
3281
3440
|
}, 8, ["disabled"])
|
|
@@ -3286,14 +3445,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3286
3445
|
]);
|
|
3287
3446
|
};
|
|
3288
3447
|
}
|
|
3289
|
-
},
|
|
3448
|
+
}, gr = { class: "h-full grid place-content-center relative" }, yr = { class: "absolute top-8 left-8" }, vr = ["src"], br = {
|
|
3290
3449
|
key: 1,
|
|
3291
3450
|
width: "59",
|
|
3292
3451
|
height: "23",
|
|
3293
3452
|
viewBox: "0 0 59 23",
|
|
3294
3453
|
fill: "none",
|
|
3295
3454
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3296
|
-
},
|
|
3455
|
+
}, xr = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, kr = { class: "flex gap-4 justify-center" }, _r = {
|
|
3297
3456
|
__name: "SparkError403View",
|
|
3298
3457
|
props: {
|
|
3299
3458
|
logo: {
|
|
@@ -3306,48 +3465,48 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3306
3465
|
}
|
|
3307
3466
|
},
|
|
3308
3467
|
setup(e) {
|
|
3309
|
-
const s =
|
|
3468
|
+
const s = J(), t = e, o = () => {
|
|
3310
3469
|
s.push(t.homeRoute);
|
|
3311
3470
|
};
|
|
3312
|
-
return (l, n) => (m(), g("div",
|
|
3313
|
-
|
|
3471
|
+
return (l, n) => (m(), g("div", gr, [
|
|
3472
|
+
p("div", yr, [
|
|
3314
3473
|
t.logo ? (m(), g("img", {
|
|
3315
3474
|
key: 0,
|
|
3316
3475
|
src: t.logo,
|
|
3317
3476
|
alt: "Logo",
|
|
3318
3477
|
class: "h-[23px] w-auto"
|
|
3319
|
-
}, null, 8,
|
|
3320
|
-
|
|
3478
|
+
}, null, 8, vr)) : (m(), g("svg", br, [...n[0] || (n[0] = [
|
|
3479
|
+
p("path", {
|
|
3321
3480
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3322
3481
|
fill: "#1C64F2"
|
|
3323
3482
|
}, null, -1),
|
|
3324
|
-
|
|
3483
|
+
p("path", {
|
|
3325
3484
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3326
3485
|
fill: "#1C64F2"
|
|
3327
3486
|
}, null, -1),
|
|
3328
|
-
|
|
3487
|
+
p("path", {
|
|
3329
3488
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
3330
3489
|
fill: "#1C64F2"
|
|
3331
3490
|
}, null, -1),
|
|
3332
|
-
|
|
3491
|
+
p("path", {
|
|
3333
3492
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
3334
3493
|
fill: "#1C64F2"
|
|
3335
3494
|
}, null, -1)
|
|
3336
3495
|
])]))
|
|
3337
3496
|
]),
|
|
3338
|
-
|
|
3339
|
-
n[2] || (n[2] =
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3497
|
+
p("div", xr, [
|
|
3498
|
+
n[2] || (n[2] = p("div", null, [
|
|
3499
|
+
p("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "403"),
|
|
3500
|
+
p("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Access Forbidden "),
|
|
3501
|
+
p("p", { class: "text-gray-600" }, [
|
|
3343
3502
|
B(" You don't have permission to access this resource."),
|
|
3344
|
-
|
|
3503
|
+
p("br"),
|
|
3345
3504
|
B(" If you believe this is an error, please contact your administrator. ")
|
|
3346
3505
|
])
|
|
3347
3506
|
], -1)),
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
onClick:
|
|
3507
|
+
p("div", kr, [
|
|
3508
|
+
b(_(K), {
|
|
3509
|
+
onClick: o,
|
|
3351
3510
|
size: "lg"
|
|
3352
3511
|
}, {
|
|
3353
3512
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3359,14 +3518,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3359
3518
|
])
|
|
3360
3519
|
]));
|
|
3361
3520
|
}
|
|
3362
|
-
},
|
|
3521
|
+
}, wr = { class: "h-full grid place-content-center relative" }, Sr = { class: "absolute top-8 left-8" }, Cr = ["src"], $r = {
|
|
3363
3522
|
key: 1,
|
|
3364
3523
|
width: "59",
|
|
3365
3524
|
height: "23",
|
|
3366
3525
|
viewBox: "0 0 59 23",
|
|
3367
3526
|
fill: "none",
|
|
3368
3527
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3369
|
-
},
|
|
3528
|
+
}, Tr = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, Lr = { class: "flex gap-4 justify-center" }, Pr = {
|
|
3370
3529
|
__name: "SparkError404View",
|
|
3371
3530
|
props: {
|
|
3372
3531
|
logo: {
|
|
@@ -3379,44 +3538,44 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3379
3538
|
}
|
|
3380
3539
|
},
|
|
3381
3540
|
setup(e) {
|
|
3382
|
-
const s =
|
|
3541
|
+
const s = J(), t = e, o = () => {
|
|
3383
3542
|
s.push(t.homeRoute);
|
|
3384
3543
|
};
|
|
3385
|
-
return (l, n) => (m(), g("div",
|
|
3386
|
-
|
|
3544
|
+
return (l, n) => (m(), g("div", wr, [
|
|
3545
|
+
p("div", Sr, [
|
|
3387
3546
|
t.logo ? (m(), g("img", {
|
|
3388
3547
|
key: 0,
|
|
3389
3548
|
src: t.logo,
|
|
3390
3549
|
alt: "Logo",
|
|
3391
3550
|
class: "h-[23px] w-auto"
|
|
3392
|
-
}, null, 8,
|
|
3393
|
-
|
|
3551
|
+
}, null, 8, Cr)) : (m(), g("svg", $r, [...n[0] || (n[0] = [
|
|
3552
|
+
p("path", {
|
|
3394
3553
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3395
3554
|
fill: "#1C64F2"
|
|
3396
3555
|
}, null, -1),
|
|
3397
|
-
|
|
3556
|
+
p("path", {
|
|
3398
3557
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3399
3558
|
fill: "#1C64F2"
|
|
3400
3559
|
}, null, -1),
|
|
3401
|
-
|
|
3560
|
+
p("path", {
|
|
3402
3561
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
3403
3562
|
fill: "#1C64F2"
|
|
3404
3563
|
}, null, -1),
|
|
3405
|
-
|
|
3564
|
+
p("path", {
|
|
3406
3565
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
3407
3566
|
fill: "#1C64F2"
|
|
3408
3567
|
}, null, -1)
|
|
3409
3568
|
])]))
|
|
3410
3569
|
]),
|
|
3411
|
-
|
|
3412
|
-
n[2] || (n[2] =
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3570
|
+
p("div", Tr, [
|
|
3571
|
+
n[2] || (n[2] = p("div", null, [
|
|
3572
|
+
p("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "404"),
|
|
3573
|
+
p("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Page Not Found "),
|
|
3574
|
+
p("p", { class: "text-gray-600" }, " The page you're looking for doesn't exist or has been moved. ")
|
|
3416
3575
|
], -1)),
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
onClick:
|
|
3576
|
+
p("div", Lr, [
|
|
3577
|
+
b(_(K), {
|
|
3578
|
+
onClick: o,
|
|
3420
3579
|
size: "lg"
|
|
3421
3580
|
}, {
|
|
3422
3581
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3428,14 +3587,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3428
3587
|
])
|
|
3429
3588
|
]));
|
|
3430
3589
|
}
|
|
3431
|
-
},
|
|
3590
|
+
}, Mr = { class: "h-full grid place-content-center relative" }, Hr = { class: "absolute top-8 left-8" }, Vr = ["src"], Rr = {
|
|
3432
3591
|
key: 1,
|
|
3433
3592
|
width: "59",
|
|
3434
3593
|
height: "23",
|
|
3435
3594
|
viewBox: "0 0 59 23",
|
|
3436
3595
|
fill: "none",
|
|
3437
3596
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3438
|
-
},
|
|
3597
|
+
}, Br = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, Er = { class: "text-primary-600 text-7xl font-bold mb-4" }, Ar = { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, Or = { class: "text-gray-600" }, Fr = { class: "flex gap-4 justify-center" }, mn = {
|
|
3439
3598
|
__name: "SparkErrorGeneralView",
|
|
3440
3599
|
props: {
|
|
3441
3600
|
logo: {
|
|
@@ -3460,44 +3619,44 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3460
3619
|
}
|
|
3461
3620
|
},
|
|
3462
3621
|
setup(e) {
|
|
3463
|
-
const s =
|
|
3622
|
+
const s = J(), t = e, o = () => {
|
|
3464
3623
|
s.push(t.homeRoute);
|
|
3465
3624
|
};
|
|
3466
|
-
return (l, n) => (m(), g("div",
|
|
3467
|
-
|
|
3625
|
+
return (l, n) => (m(), g("div", Mr, [
|
|
3626
|
+
p("div", Hr, [
|
|
3468
3627
|
t.logo ? (m(), g("img", {
|
|
3469
3628
|
key: 0,
|
|
3470
3629
|
src: t.logo,
|
|
3471
3630
|
alt: "Logo",
|
|
3472
3631
|
class: "h-[23px] w-auto"
|
|
3473
|
-
}, null, 8,
|
|
3474
|
-
|
|
3632
|
+
}, null, 8, Vr)) : (m(), g("svg", Rr, [...n[0] || (n[0] = [
|
|
3633
|
+
p("path", {
|
|
3475
3634
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3476
3635
|
fill: "#1C64F2"
|
|
3477
3636
|
}, null, -1),
|
|
3478
|
-
|
|
3637
|
+
p("path", {
|
|
3479
3638
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3480
3639
|
fill: "#1C64F2"
|
|
3481
3640
|
}, null, -1),
|
|
3482
|
-
|
|
3641
|
+
p("path", {
|
|
3483
3642
|
d: "M28.3161 0C29.1499 0 29.7522 0.798785 29.5209 1.59757L27.1856 9.77748H30.9046C31.747 9.77748 32.4279 10.4584 32.4279 11.3008C32.4279 11.7504 32.2315 12.1738 31.891 12.4619L20.5989 22.0517C20.3719 22.2438 20.0839 22.3485 19.787 22.3485C18.9533 22.3485 18.351 21.5497 18.5823 20.751L20.9176 12.571H17.1463C16.33 12.571 15.6709 11.9119 15.6709 11.1001C15.6709 10.6679 15.8586 10.262 16.186 9.98263L27.5043 0.301181C27.7312 0.104759 28.0193 0 28.3161 0ZM26.7404 3.71021L18.8311 10.4759H22.3056C22.633 10.4759 22.9429 10.6286 23.1437 10.8905C23.3445 11.1524 23.4056 11.4929 23.3139 11.8072L21.3584 18.6601L29.355 11.8727H25.7976C25.4702 11.8727 25.1603 11.7199 24.9595 11.458C24.7587 11.1961 24.6976 10.8556 24.7893 10.5413L26.7404 3.71021Z",
|
|
3484
3643
|
fill: "#1C64F2"
|
|
3485
3644
|
}, null, -1),
|
|
3486
|
-
|
|
3645
|
+
p("path", {
|
|
3487
3646
|
d: "M0 17.1264V5.22235H10.192C13.6 5.22235 14.544 6.53435 14.544 7.94235V8.16635C14.544 9.70235 13.232 10.3264 12.656 10.4864C13.472 10.6944 15.216 11.3984 15.216 13.4784V13.7024C15.216 15.5904 14.144 17.1264 10.288 17.1264H0ZM9.552 7.73435H3.728V9.67035H9.552C10.592 9.67035 10.848 9.19035 10.848 8.71035V8.67835C10.848 8.18235 10.592 7.73435 9.552 7.73435ZM9.872 12.1984H3.728V14.5344H9.872C11.12 14.5344 11.344 13.8464 11.344 13.3664V13.3024C11.344 12.7904 11.104 12.1984 9.872 12.1984Z",
|
|
3488
3647
|
fill: "#1C64F2"
|
|
3489
3648
|
}, null, -1)
|
|
3490
3649
|
])]))
|
|
3491
3650
|
]),
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3651
|
+
p("div", Br, [
|
|
3652
|
+
p("div", null, [
|
|
3653
|
+
p("div", Er, L(t.errorCode || "Error"), 1),
|
|
3654
|
+
p("h1", Ar, L(t.title || "Something went wrong"), 1),
|
|
3655
|
+
p("p", Or, L(t.message || "An unexpected error occurred. Please try again later."), 1)
|
|
3497
3656
|
]),
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
onClick:
|
|
3657
|
+
p("div", Fr, [
|
|
3658
|
+
b(_(K), {
|
|
3659
|
+
onClick: o,
|
|
3501
3660
|
size: "lg"
|
|
3502
3661
|
}, {
|
|
3503
3662
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3510,57 +3669,57 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3510
3669
|
]));
|
|
3511
3670
|
}
|
|
3512
3671
|
};
|
|
3513
|
-
function
|
|
3672
|
+
function hn(e = {}) {
|
|
3514
3673
|
const {
|
|
3515
3674
|
loginPath: s = "/login",
|
|
3516
3675
|
logoutPath: t = "/logout",
|
|
3517
|
-
forgotPasswordPath:
|
|
3676
|
+
forgotPasswordPath: o = "/forgot-password",
|
|
3518
3677
|
resetPasswordPath: l = "/password/reset",
|
|
3519
3678
|
logo: n = "",
|
|
3520
|
-
defaultRedirect:
|
|
3679
|
+
defaultRedirect: a = "/dashboard"
|
|
3521
3680
|
} = e;
|
|
3522
3681
|
return [
|
|
3523
3682
|
{
|
|
3524
3683
|
path: s,
|
|
3525
3684
|
name: "login",
|
|
3526
|
-
component:
|
|
3527
|
-
props: { logo: n, defaultRedirect:
|
|
3685
|
+
component: Wa,
|
|
3686
|
+
props: { logo: n, defaultRedirect: a },
|
|
3528
3687
|
meta: { auth: !1 }
|
|
3529
3688
|
},
|
|
3530
3689
|
{
|
|
3531
3690
|
path: t,
|
|
3532
3691
|
name: "logout",
|
|
3533
|
-
component:
|
|
3692
|
+
component: Ya,
|
|
3534
3693
|
props: { defaultRedirect: s },
|
|
3535
3694
|
meta: { auth: !1 }
|
|
3536
3695
|
},
|
|
3537
3696
|
{
|
|
3538
|
-
path:
|
|
3697
|
+
path: o,
|
|
3539
3698
|
name: "forgot-password",
|
|
3540
|
-
component:
|
|
3699
|
+
component: nr,
|
|
3541
3700
|
props: { logo: n, loginRoute: s },
|
|
3542
3701
|
meta: { auth: !1 }
|
|
3543
3702
|
},
|
|
3544
3703
|
{
|
|
3545
3704
|
path: l,
|
|
3546
3705
|
name: "password-reset",
|
|
3547
|
-
component:
|
|
3706
|
+
component: hr,
|
|
3548
3707
|
props: { logo: n, loginRoute: s },
|
|
3549
3708
|
meta: { auth: !1 }
|
|
3550
3709
|
}
|
|
3551
3710
|
];
|
|
3552
3711
|
}
|
|
3553
|
-
function
|
|
3712
|
+
function gn(e, s = {}) {
|
|
3554
3713
|
const { defaultAuthenticatedRoute: t = "/dashboard" } = s;
|
|
3555
|
-
e.beforeEach(async (
|
|
3556
|
-
const
|
|
3557
|
-
|
|
3714
|
+
e.beforeEach(async (o, l, n) => {
|
|
3715
|
+
const a = U();
|
|
3716
|
+
a.state.ready || await a.fetchUser(), zr(o, n, a, t);
|
|
3558
3717
|
});
|
|
3559
3718
|
}
|
|
3560
|
-
function
|
|
3719
|
+
function zr(e, s, t, o) {
|
|
3561
3720
|
const l = e.meta.auth !== !1, n = t.check;
|
|
3562
3721
|
if (t.state.overrideToken && e.path === "/logout") {
|
|
3563
|
-
s({ path:
|
|
3722
|
+
s({ path: o });
|
|
3564
3723
|
return;
|
|
3565
3724
|
}
|
|
3566
3725
|
if (!n) {
|
|
@@ -3572,44 +3731,44 @@ function Tr(e, s, t, a) {
|
|
|
3572
3731
|
s();
|
|
3573
3732
|
return;
|
|
3574
3733
|
}
|
|
3575
|
-
let
|
|
3576
|
-
if (
|
|
3734
|
+
let a = e.fullPath;
|
|
3735
|
+
if (a === "/" || a === "" || a === o) {
|
|
3577
3736
|
s({ path: t.state.routes.auth });
|
|
3578
3737
|
return;
|
|
3579
3738
|
}
|
|
3580
|
-
|
|
3739
|
+
a.includes("%") && (a = decodeURIComponent(a)), s({
|
|
3581
3740
|
path: t.state.routes.auth,
|
|
3582
|
-
query: { redirect:
|
|
3741
|
+
query: { redirect: a }
|
|
3583
3742
|
});
|
|
3584
3743
|
return;
|
|
3585
3744
|
}
|
|
3586
3745
|
if (n) {
|
|
3587
3746
|
if (!l && e.path === t.state.routes.auth) {
|
|
3588
|
-
s({ path:
|
|
3747
|
+
s({ path: o });
|
|
3589
3748
|
return;
|
|
3590
3749
|
}
|
|
3591
3750
|
if (e.path === "/") {
|
|
3592
|
-
s({ path:
|
|
3751
|
+
s({ path: o });
|
|
3593
3752
|
return;
|
|
3594
3753
|
}
|
|
3595
3754
|
s();
|
|
3596
3755
|
}
|
|
3597
3756
|
}
|
|
3598
|
-
function
|
|
3757
|
+
function yn(e = {}) {
|
|
3599
3758
|
const {
|
|
3600
3759
|
forbiddenPath: s = "/error/403",
|
|
3601
3760
|
logo: t = "",
|
|
3602
|
-
homeRoute:
|
|
3761
|
+
homeRoute: o = "/dashboard"
|
|
3603
3762
|
} = e;
|
|
3604
3763
|
return {
|
|
3605
3764
|
path: s,
|
|
3606
3765
|
name: "error-403",
|
|
3607
|
-
component:
|
|
3608
|
-
props: { logo: t, homeRoute:
|
|
3766
|
+
component: _r,
|
|
3767
|
+
props: { logo: t, homeRoute: o },
|
|
3609
3768
|
meta: { auth: !1 }
|
|
3610
3769
|
};
|
|
3611
3770
|
}
|
|
3612
|
-
function
|
|
3771
|
+
function vn(e = {}) {
|
|
3613
3772
|
const {
|
|
3614
3773
|
logo: s = "",
|
|
3615
3774
|
homeRoute: t = "/dashboard"
|
|
@@ -3617,21 +3776,21 @@ function rn(e = {}) {
|
|
|
3617
3776
|
return {
|
|
3618
3777
|
path: "/:pathMatch(.*)*",
|
|
3619
3778
|
name: "error-404",
|
|
3620
|
-
component:
|
|
3779
|
+
component: Pr,
|
|
3621
3780
|
props: { logo: s, homeRoute: t },
|
|
3622
3781
|
meta: { auth: !1 }
|
|
3623
3782
|
};
|
|
3624
3783
|
}
|
|
3625
|
-
function
|
|
3784
|
+
function bn(e, s) {
|
|
3626
3785
|
e.beforeResolve(async (t) => {
|
|
3627
3786
|
if (t.meta.auth !== !1) {
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3787
|
+
const o = U();
|
|
3788
|
+
o.state.ready && o.check && await s();
|
|
3630
3789
|
}
|
|
3631
3790
|
});
|
|
3632
3791
|
}
|
|
3633
|
-
function
|
|
3634
|
-
const s =
|
|
3792
|
+
function Dr(e = {}) {
|
|
3793
|
+
const s = re.create({
|
|
3635
3794
|
baseURL: e.baseURL || "",
|
|
3636
3795
|
timeout: e.timeout || 3e4,
|
|
3637
3796
|
headers: {
|
|
@@ -3642,8 +3801,8 @@ function Lr(e = {}) {
|
|
|
3642
3801
|
return s.interceptors.request.use(
|
|
3643
3802
|
(t) => {
|
|
3644
3803
|
try {
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3804
|
+
const o = U();
|
|
3805
|
+
o.state.overrideToken ? t.headers.Authorization = `Bearer ${o.state.overrideToken}` : o.state.token && (t.headers.Authorization = `Bearer ${o.state.token}`);
|
|
3647
3806
|
} catch {
|
|
3648
3807
|
}
|
|
3649
3808
|
return t;
|
|
@@ -3654,43 +3813,43 @@ function Lr(e = {}) {
|
|
|
3654
3813
|
async (t) => {
|
|
3655
3814
|
if (t.response?.status === 401)
|
|
3656
3815
|
try {
|
|
3657
|
-
const
|
|
3658
|
-
await
|
|
3659
|
-
} catch (
|
|
3660
|
-
console.error("Error during auto-logout:",
|
|
3816
|
+
const o = U();
|
|
3817
|
+
await o.logout(), window.location.href = o.state.routes.auth;
|
|
3818
|
+
} catch (o) {
|
|
3819
|
+
console.error("Error during auto-logout:", o), window.location.href = "/login";
|
|
3661
3820
|
}
|
|
3662
3821
|
if (t.response?.status === 403)
|
|
3663
3822
|
try {
|
|
3664
|
-
const
|
|
3665
|
-
window.location.href =
|
|
3666
|
-
} catch (
|
|
3667
|
-
console.error("Error during 403 redirect:",
|
|
3823
|
+
const o = U();
|
|
3824
|
+
window.location.href = o.state.routes.forbidden;
|
|
3825
|
+
} catch (o) {
|
|
3826
|
+
console.error("Error during 403 redirect:", o), window.location.href = "/error/403";
|
|
3668
3827
|
}
|
|
3669
3828
|
return Promise.reject(t);
|
|
3670
3829
|
}
|
|
3671
3830
|
), s;
|
|
3672
3831
|
}
|
|
3673
3832
|
let ae = null;
|
|
3674
|
-
function
|
|
3675
|
-
return ae =
|
|
3833
|
+
function xn(e, s = {}) {
|
|
3834
|
+
return ae = Dr(s), e.provide("axios", ae), e.config.globalProperties.$axios = ae, ae;
|
|
3676
3835
|
}
|
|
3677
|
-
function
|
|
3836
|
+
function kn() {
|
|
3678
3837
|
if (!ae)
|
|
3679
3838
|
throw new Error("Axios instance not initialized. Call setupAxios() first.");
|
|
3680
3839
|
return ae;
|
|
3681
3840
|
}
|
|
3682
|
-
const
|
|
3841
|
+
const _n = ue("sparkNav", () => {
|
|
3683
3842
|
const e = q({
|
|
3684
3843
|
menu: [],
|
|
3685
3844
|
collapsed: !1,
|
|
3686
3845
|
hidden: !1
|
|
3687
|
-
}), s =
|
|
3846
|
+
}), s = J(), t = ne(), o = (i = []) => {
|
|
3688
3847
|
e.menu = i, r();
|
|
3689
3848
|
}, l = (i, u) => {
|
|
3690
|
-
for (const
|
|
3691
|
-
if (
|
|
3692
|
-
if (
|
|
3693
|
-
const f = l(
|
|
3849
|
+
for (const d of i) {
|
|
3850
|
+
if (d.href === u) return d;
|
|
3851
|
+
if (d.children) {
|
|
3852
|
+
const f = l(d.children, u);
|
|
3694
3853
|
if (f) return f;
|
|
3695
3854
|
}
|
|
3696
3855
|
}
|
|
@@ -3704,22 +3863,22 @@ const un = ie("sparkNav", () => {
|
|
|
3704
3863
|
}
|
|
3705
3864
|
await s.push(i);
|
|
3706
3865
|
}
|
|
3707
|
-
},
|
|
3866
|
+
}, a = () => {
|
|
3708
3867
|
e.collapsed = !e.collapsed;
|
|
3709
3868
|
}, c = () => {
|
|
3710
3869
|
e.hidden = !e.hidden;
|
|
3711
3870
|
}, r = () => {
|
|
3712
3871
|
const i = t.name || t.path.replace("/", "");
|
|
3713
3872
|
if (i) {
|
|
3714
|
-
const u = (
|
|
3715
|
-
|
|
3873
|
+
const u = (d) => {
|
|
3874
|
+
d.forEach((f) => {
|
|
3716
3875
|
f.current = f.href === i, f.children && u(f.children);
|
|
3717
3876
|
});
|
|
3718
3877
|
};
|
|
3719
3878
|
u(e.menu);
|
|
3720
3879
|
}
|
|
3721
3880
|
};
|
|
3722
|
-
return
|
|
3881
|
+
return I(
|
|
3723
3882
|
() => t.path,
|
|
3724
3883
|
() => {
|
|
3725
3884
|
r();
|
|
@@ -3727,70 +3886,72 @@ const un = ie("sparkNav", () => {
|
|
|
3727
3886
|
{ immediate: !0 }
|
|
3728
3887
|
), {
|
|
3729
3888
|
state: e,
|
|
3730
|
-
initialize:
|
|
3889
|
+
initialize: o,
|
|
3731
3890
|
goto: n,
|
|
3732
|
-
toggleCollapsed:
|
|
3891
|
+
toggleCollapsed: a,
|
|
3733
3892
|
toggleHidden: c,
|
|
3734
3893
|
syncWithRoute: r
|
|
3735
3894
|
};
|
|
3736
3895
|
});
|
|
3737
3896
|
export {
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3897
|
+
O as Icons,
|
|
3898
|
+
se as SparkAlert,
|
|
3899
|
+
vs as SparkAppSelector,
|
|
3900
|
+
js as SparkBrandSelector,
|
|
3742
3901
|
K as SparkButton,
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
_o as
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3902
|
+
Ns as SparkButtonGroup,
|
|
3903
|
+
cn as SparkCard,
|
|
3904
|
+
dn as SparkDefaultContainer,
|
|
3905
|
+
_r as SparkError403View,
|
|
3906
|
+
Pr as SparkError404View,
|
|
3907
|
+
mn as SparkErrorGeneralView,
|
|
3908
|
+
nr as SparkForgotPasswordView,
|
|
3909
|
+
Wa as SparkLoginView,
|
|
3910
|
+
Ya as SparkLogoutView,
|
|
3911
|
+
Qs as SparkModalContainer,
|
|
3912
|
+
Ws as SparkModalDialog,
|
|
3913
|
+
nn as SparkNotificationOutlet,
|
|
3914
|
+
Se as SparkOverlay,
|
|
3915
|
+
pn as SparkPublicContainer,
|
|
3916
|
+
hr as SparkResetPasswordView,
|
|
3917
|
+
un as SparkTable,
|
|
3918
|
+
ta as SparkTableDatePicker,
|
|
3919
|
+
Jo as SparkTableFilterButtons,
|
|
3920
|
+
Go as SparkTableFilterSelect,
|
|
3921
|
+
zo as SparkTablePaginationPaging,
|
|
3922
|
+
Io as SparkTablePaginationPerPage,
|
|
3923
|
+
ra as SparkTableReset,
|
|
3924
|
+
qo as SparkTableSearch,
|
|
3925
|
+
Pe as SparkTableToolbar,
|
|
3926
|
+
ln as SparkToastContainer,
|
|
3927
|
+
an as addIcons,
|
|
3928
|
+
yn as create403Route,
|
|
3929
|
+
vn as create404Route,
|
|
3930
|
+
hn as createAuthRoutes,
|
|
3931
|
+
Dr as createAxiosInstance,
|
|
3932
|
+
fn as createBootstrapService,
|
|
3933
|
+
ro as customiseHeader,
|
|
3934
|
+
Ea as deleteCookie,
|
|
3935
|
+
ko as formatTemporal,
|
|
3936
|
+
kn as getAxiosInstance,
|
|
3937
|
+
Ra as getCookie,
|
|
3938
|
+
Ze as getDomain,
|
|
3939
|
+
_o as parseDatetime,
|
|
3940
|
+
to as renderHeaderTitle,
|
|
3941
|
+
Ba as setCookie,
|
|
3942
|
+
gn as setupAuthGuards,
|
|
3943
|
+
xn as setupAxios,
|
|
3944
|
+
bn as setupBootstrapGuard,
|
|
3945
|
+
rn as setupFontAwesome,
|
|
3946
|
+
oe as sparkModalService,
|
|
3947
|
+
X as sparkNotificationService,
|
|
3948
|
+
te as sparkOverlayService,
|
|
3949
|
+
$o as updateRow,
|
|
3950
|
+
De as useSparkAppSelectorStore,
|
|
3951
|
+
je as useSparkAppStore,
|
|
3952
|
+
U as useSparkAuthStore,
|
|
3953
|
+
Ne as useSparkBrandFilterStore,
|
|
3954
|
+
_n as useSparkNavStore,
|
|
3955
|
+
He as useSparkOverlay,
|
|
3956
|
+
To as useSparkTableRouteSync
|
|
3796
3957
|
};
|