@wishbone-media/spark 0.21.0 → 0.23.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 +1406 -1223
- 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/currency.js +71 -0
- package/src/utils/sparkTable/renderers/datetime.js +106 -0
- package/src/utils/sparkTable/renderers/index.js +6 -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 f, createCommentVNode as T, createVNode as b, unref as w, renderSlot as O, reactive as q, Fragment as R, renderList as z, toDisplayString as L, createBlock as V, resolveDynamicComponent as I, markRaw as fe, ref as E, watch as N, 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 wt, faEdit as _t, 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 Ft } from "@fortawesome/pro-regular-svg-icons";
|
|
5
|
+
import { defineStore as ue } from "pinia";
|
|
6
|
+
import { TransitionRoot as Ae, Dialog as Fe, TransitionChild as pe, DialogPanel as Oe } from "@headlessui/vue";
|
|
7
|
+
import me from "nprogress";
|
|
8
|
+
import { range as Ot, 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 Nt, CopyPaste as It, StretchColumns as Zt, NestedHeaders as qt } from "handsontable/plugins";
|
|
13
|
+
import { registerAllCellTypes as Ut } from "handsontable/cellTypes";
|
|
14
|
+
import { useDebounceFn as ze, watchDebounced as we } 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
31
|
const F = {
|
|
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:
|
|
32
|
+
farArrowLeftToLine: Ft,
|
|
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: _t,
|
|
47
|
+
farEllipsis: wt,
|
|
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(F, e),
|
|
76
|
+
function nn(e) {
|
|
77
|
+
Object.assign(F, e), Ee.add(...Object.values(e));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function ln(e) {
|
|
80
|
+
Ee.add(...Object.values(F)), 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
|
+
f("div", Jt, [
|
|
127
|
+
f("div", Qt, [
|
|
128
|
+
b(r, {
|
|
129
|
+
icon: w(F)[l.value],
|
|
130
|
+
class: H(o.value)
|
|
131
131
|
}, null, 8, ["icon", "class"])
|
|
132
132
|
]),
|
|
133
|
-
|
|
134
|
-
O(
|
|
133
|
+
f("div", es, [
|
|
134
|
+
O(a.$slots, "default")
|
|
135
135
|
]),
|
|
136
|
-
e.closeable ? (m(), g("div",
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
e.closeable ? (m(), g("div", ts, [
|
|
137
|
+
f("div", ss, [
|
|
138
|
+
f("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: w(F).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
|
+
f("div", as, [
|
|
297
|
+
f("div", rs, [
|
|
298
|
+
f("div", ns, [
|
|
299
|
+
r[1] || (r[1] = f("div", null, "Mr Group Network", -1)),
|
|
300
|
+
f("div", ls, [
|
|
301
|
+
b(i, {
|
|
302
|
+
icon: w(F).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
|
+
f("div", cs, [
|
|
316
|
+
f("div", us, [
|
|
317
|
+
f("div", ds, L(u.name), 1),
|
|
318
|
+
u.current ? (m(), g("span", ps, " Active ")) : T("", !0)
|
|
319
319
|
]),
|
|
320
|
-
|
|
320
|
+
f("div", fs, L(u.description), 1)
|
|
321
321
|
]),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
class:
|
|
325
|
-
icon:
|
|
322
|
+
f("div", ms, [
|
|
323
|
+
b(i, {
|
|
324
|
+
class: H([u.current ? "text-gray-700" : "text-gray-400", "h-5 w-5 shrink-0"]),
|
|
325
|
+
icon: w(F)[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] = f("div", null, null, -1))
|
|
330
330
|
]),
|
|
331
|
-
|
|
332
|
-
c.$slots.bottom || e.bottomSlot ? (m(), g("div",
|
|
331
|
+
f("div", hs, [
|
|
332
|
+
c.$slots.bottom || e.bottomSlot ? (m(), g("div", gs, [
|
|
333
333
|
O(c.$slots, "bottom", {}, () => [
|
|
334
|
-
e.bottomSlot ? (m(),
|
|
334
|
+
e.bottomSlot ? (m(), V(I(e.bottomSlot), { key: 0 })) : T("", !0)
|
|
335
335
|
])
|
|
336
|
-
])) :
|
|
337
|
-
c.$slots.footer || e.footerSlot ? (m(), g("div",
|
|
336
|
+
])) : T("", !0),
|
|
337
|
+
c.$slots.footer || e.footerSlot ? (m(), g("div", ys, [
|
|
338
338
|
O(c.$slots, "footer", {}, () => [
|
|
339
|
-
e.footerSlot ? (m(),
|
|
339
|
+
e.footerSlot ? (m(), V(I(e.footerSlot), { key: 0 })) : T("", !0)
|
|
340
340
|
])
|
|
341
|
-
])) :
|
|
341
|
+
])) : T("", !0)
|
|
342
342
|
])
|
|
343
343
|
])
|
|
344
344
|
]);
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
},
|
|
347
|
+
}, Ne = {
|
|
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
|
+
}, _e = ["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,50 +361,50 @@ 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
|
-
}, c = (
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
369
|
+
}, c = (p) => {
|
|
370
|
+
p <= 0 || (t = p, l = Date.now(), s = setTimeout(() => {
|
|
371
|
+
a();
|
|
372
|
+
}, p));
|
|
373
373
|
};
|
|
374
374
|
return {
|
|
375
375
|
state: e,
|
|
376
|
-
show: (
|
|
376
|
+
show: (p = {}) => {
|
|
377
377
|
n();
|
|
378
378
|
const {
|
|
379
379
|
type: y = "info",
|
|
380
380
|
message: k = null,
|
|
381
381
|
component: h = null,
|
|
382
|
-
props:
|
|
383
|
-
closeable:
|
|
384
|
-
duration:
|
|
385
|
-
} =
|
|
386
|
-
e.type = y, e.message = k, e.component = h ?
|
|
387
|
-
const
|
|
388
|
-
e.duration =
|
|
382
|
+
props: x = {},
|
|
383
|
+
closeable: P = !0,
|
|
384
|
+
duration: _ = null
|
|
385
|
+
} = p;
|
|
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 = _ !== null ? _ : Ne[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
|
-
const
|
|
398
|
-
t = Math.max(0, t -
|
|
397
|
+
const p = Date.now() - l;
|
|
398
|
+
t = Math.max(0, t - p), 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 && _e.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 && _e.includes(r) ? r : this.toastState.defaultPosition, d = c !== null ? c : Ne[t], p = {
|
|
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);
|
|
@@ -533,10 +533,10 @@ class gs {
|
|
|
533
533
|
}
|
|
534
534
|
if (this.toastState.newestOnTop) {
|
|
535
535
|
const k = this.toastState.toasts.findIndex((h) => h.position === u);
|
|
536
|
-
k === -1 ? this.toastState.toasts.push(
|
|
536
|
+
k === -1 ? this.toastState.toasts.push(p) : this.toastState.toasts.splice(k, 0, p);
|
|
537
537
|
} else
|
|
538
|
-
this.toastState.toasts.push(
|
|
539
|
-
return
|
|
538
|
+
this.toastState.toasts.push(p);
|
|
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(), cn = {
|
|
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
|
+
N(
|
|
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(I(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" }, ws = { class: "fixed top-4 right-4 z-[2000] flex flex-col gap-3 max-w-sm w-full pointer-events-none" }, _s = { 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" }, un = {
|
|
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
|
+
f("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",
|
|
@@ -692,23 +692,23 @@ const G = new gs(), Gr = {
|
|
|
692
692
|
"leave-to-class": "opacity-0 -translate-x-4"
|
|
693
693
|
}, {
|
|
694
694
|
default: C(() => [
|
|
695
|
-
(m(!0), g(R, null, z(t.value, (
|
|
696
|
-
key:
|
|
695
|
+
(m(!0), g(R, null, z(t.value, (p) => (m(), g("div", {
|
|
696
|
+
key: p.id,
|
|
697
697
|
class: "pointer-events-auto"
|
|
698
698
|
}, [
|
|
699
|
-
|
|
700
|
-
type:
|
|
701
|
-
closeable:
|
|
702
|
-
onClose: (y) => c(
|
|
703
|
-
onMouseenter: (y) => r(
|
|
704
|
-
onMouseleave: (y) => i(
|
|
699
|
+
b(se, {
|
|
700
|
+
type: p.type,
|
|
701
|
+
closeable: p.closeable,
|
|
702
|
+
onClose: (y) => c(p.id),
|
|
703
|
+
onMouseenter: (y) => r(p.id),
|
|
704
|
+
onMouseleave: (y) => i(p.id)
|
|
705
705
|
}, {
|
|
706
706
|
default: C(() => [
|
|
707
|
-
|
|
707
|
+
p.component ? (m(), V(I(p.component), Z({
|
|
708
708
|
key: 0,
|
|
709
709
|
ref_for: !0
|
|
710
|
-
},
|
|
711
|
-
B(L(
|
|
710
|
+
}, p.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
711
|
+
B(L(p.message), 1)
|
|
712
712
|
], 64))
|
|
713
713
|
]),
|
|
714
714
|
_: 2
|
|
@@ -718,8 +718,8 @@ const G = new gs(), Gr = {
|
|
|
718
718
|
_: 1
|
|
719
719
|
})
|
|
720
720
|
]),
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
f("div", ws, [
|
|
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,23 +728,23 @@ 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(
|
|
732
|
-
key:
|
|
731
|
+
(m(!0), g(R, null, z(o.value, (p) => (m(), g("div", {
|
|
732
|
+
key: p.id,
|
|
733
733
|
class: "pointer-events-auto"
|
|
734
734
|
}, [
|
|
735
|
-
|
|
736
|
-
type:
|
|
737
|
-
closeable:
|
|
738
|
-
onClose: (y) => c(
|
|
739
|
-
onMouseenter: (y) => r(
|
|
740
|
-
onMouseleave: (y) => i(
|
|
735
|
+
b(se, {
|
|
736
|
+
type: p.type,
|
|
737
|
+
closeable: p.closeable,
|
|
738
|
+
onClose: (y) => c(p.id),
|
|
739
|
+
onMouseenter: (y) => r(p.id),
|
|
740
|
+
onMouseleave: (y) => i(p.id)
|
|
741
741
|
}, {
|
|
742
742
|
default: C(() => [
|
|
743
|
-
|
|
743
|
+
p.component ? (m(), V(I(p.component), Z({
|
|
744
744
|
key: 0,
|
|
745
745
|
ref_for: !0
|
|
746
|
-
},
|
|
747
|
-
B(L(
|
|
746
|
+
}, p.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
747
|
+
B(L(p.message), 1)
|
|
748
748
|
], 64))
|
|
749
749
|
]),
|
|
750
750
|
_: 2
|
|
@@ -754,8 +754,8 @@ const G = new gs(), Gr = {
|
|
|
754
754
|
_: 1
|
|
755
755
|
})
|
|
756
756
|
]),
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
f("div", _s, [
|
|
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",
|
|
@@ -764,23 +764,23 @@ const G = new gs(), Gr = {
|
|
|
764
764
|
"leave-to-class": "opacity-0 scale-95"
|
|
765
765
|
}, {
|
|
766
766
|
default: C(() => [
|
|
767
|
-
(m(!0), g(R, null, z(l.value, (
|
|
768
|
-
key:
|
|
767
|
+
(m(!0), g(R, null, z(l.value, (p) => (m(), g("div", {
|
|
768
|
+
key: p.id,
|
|
769
769
|
class: "pointer-events-auto"
|
|
770
770
|
}, [
|
|
771
|
-
|
|
772
|
-
type:
|
|
773
|
-
closeable:
|
|
774
|
-
onClose: (y) => c(
|
|
775
|
-
onMouseenter: (y) => r(
|
|
776
|
-
onMouseleave: (y) => i(
|
|
771
|
+
b(se, {
|
|
772
|
+
type: p.type,
|
|
773
|
+
closeable: p.closeable,
|
|
774
|
+
onClose: (y) => c(p.id),
|
|
775
|
+
onMouseenter: (y) => r(p.id),
|
|
776
|
+
onMouseleave: (y) => i(p.id)
|
|
777
777
|
}, {
|
|
778
778
|
default: C(() => [
|
|
779
|
-
|
|
779
|
+
p.component ? (m(), V(I(p.component), Z({
|
|
780
780
|
key: 0,
|
|
781
781
|
ref_for: !0
|
|
782
|
-
},
|
|
783
|
-
B(L(
|
|
782
|
+
}, p.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
783
|
+
B(L(p.message), 1)
|
|
784
784
|
], 64))
|
|
785
785
|
]),
|
|
786
786
|
_: 2
|
|
@@ -790,8 +790,8 @@ const G = new gs(), Gr = {
|
|
|
790
790
|
_: 1
|
|
791
791
|
})
|
|
792
792
|
]),
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
f("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",
|
|
@@ -800,23 +800,23 @@ const G = new gs(), Gr = {
|
|
|
800
800
|
"leave-to-class": "opacity-0 -translate-x-4"
|
|
801
801
|
}, {
|
|
802
802
|
default: C(() => [
|
|
803
|
-
(m(!0), g(R, null, z(n.value, (
|
|
804
|
-
key:
|
|
803
|
+
(m(!0), g(R, null, z(n.value, (p) => (m(), g("div", {
|
|
804
|
+
key: p.id,
|
|
805
805
|
class: "pointer-events-auto"
|
|
806
806
|
}, [
|
|
807
|
-
|
|
808
|
-
type:
|
|
809
|
-
closeable:
|
|
810
|
-
onClose: (y) => c(
|
|
811
|
-
onMouseenter: (y) => r(
|
|
812
|
-
onMouseleave: (y) => i(
|
|
807
|
+
b(se, {
|
|
808
|
+
type: p.type,
|
|
809
|
+
closeable: p.closeable,
|
|
810
|
+
onClose: (y) => c(p.id),
|
|
811
|
+
onMouseenter: (y) => r(p.id),
|
|
812
|
+
onMouseleave: (y) => i(p.id)
|
|
813
813
|
}, {
|
|
814
814
|
default: C(() => [
|
|
815
|
-
|
|
815
|
+
p.component ? (m(), V(I(p.component), Z({
|
|
816
816
|
key: 0,
|
|
817
817
|
ref_for: !0
|
|
818
|
-
},
|
|
819
|
-
B(L(
|
|
818
|
+
}, p.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
819
|
+
B(L(p.message), 1)
|
|
820
820
|
], 64))
|
|
821
821
|
]),
|
|
822
822
|
_: 2
|
|
@@ -826,8 +826,8 @@ const G = new gs(), Gr = {
|
|
|
826
826
|
_: 1
|
|
827
827
|
})
|
|
828
828
|
]),
|
|
829
|
-
|
|
830
|
-
|
|
829
|
+
f("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,23 +836,23 @@ 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(
|
|
840
|
-
key:
|
|
839
|
+
(m(!0), g(R, null, z(a.value, (p) => (m(), g("div", {
|
|
840
|
+
key: p.id,
|
|
841
841
|
class: "pointer-events-auto"
|
|
842
842
|
}, [
|
|
843
|
-
|
|
844
|
-
type:
|
|
845
|
-
closeable:
|
|
846
|
-
onClose: (y) => c(
|
|
847
|
-
onMouseenter: (y) => r(
|
|
848
|
-
onMouseleave: (y) => i(
|
|
843
|
+
b(se, {
|
|
844
|
+
type: p.type,
|
|
845
|
+
closeable: p.closeable,
|
|
846
|
+
onClose: (y) => c(p.id),
|
|
847
|
+
onMouseenter: (y) => r(p.id),
|
|
848
|
+
onMouseleave: (y) => i(p.id)
|
|
849
849
|
}, {
|
|
850
850
|
default: C(() => [
|
|
851
|
-
|
|
851
|
+
p.component ? (m(), V(I(p.component), Z({
|
|
852
852
|
key: 0,
|
|
853
853
|
ref_for: !0
|
|
854
|
-
},
|
|
855
|
-
B(L(
|
|
854
|
+
}, p.props), null, 16)) : (m(), g(R, { key: 1 }, [
|
|
855
|
+
B(L(p.message), 1)
|
|
856
856
|
], 64))
|
|
857
857
|
]),
|
|
858
858
|
_: 2
|
|
@@ -864,7 +864,7 @@ const G = new gs(), Gr = {
|
|
|
864
864
|
])
|
|
865
865
|
]));
|
|
866
866
|
}
|
|
867
|
-
},
|
|
867
|
+
}, Ie = 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" }, Fs = {
|
|
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
|
+
}, Os = { 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 = Ie(), 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
|
+
f("div", Ts, [
|
|
928
|
+
f("div", Ls, [
|
|
929
|
+
f("div", Ps, [
|
|
930
|
+
a[1] || (a[1] = f("div", null, "Filter by Brand", -1)),
|
|
931
|
+
f("div", Ms, [
|
|
932
|
+
b(c, {
|
|
933
|
+
icon: w(F).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
|
+
w(o).allBrands.length === 0 ? (m(), g("div", Hs, " No brands configured ")) : T("", !0),
|
|
940
|
+
(m(!0), g(R, null, z(w(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
|
+
f("div", Rs, [
|
|
946
|
+
f("div", Bs, [
|
|
947
|
+
f("div", Es, [
|
|
948
|
+
f("div", As, L(r.name), 1),
|
|
949
|
+
r.current ? (m(), g("span", Fs, " Current ")) : T("", !0)
|
|
950
950
|
]),
|
|
951
|
-
|
|
951
|
+
f("div", Os, L(r.current ? "Current Brand" : "Change to"), 1)
|
|
952
952
|
]),
|
|
953
|
-
|
|
954
|
-
|
|
953
|
+
f("div", zs, [
|
|
954
|
+
f("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] = f("div", null, null, -1))
|
|
963
963
|
]),
|
|
964
|
-
|
|
964
|
+
a[3] || (a[3] = f("div", { class: "mt-auto" }, null, -1))
|
|
965
965
|
])
|
|
966
966
|
]);
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
},
|
|
969
|
+
}, Ns = ["disabled"], G = {
|
|
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, _]) => _.test(y)
|
|
1017
|
+
)?.[0], x = Object.entries(n).find(
|
|
1018
|
+
([P, _]) => _.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
1078
|
O(r.$slots, "default")
|
|
1079
|
-
], 10,
|
|
1079
|
+
], 10, Ns));
|
|
1080
1080
|
}
|
|
1081
|
-
},
|
|
1081
|
+
}, Is = {
|
|
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
|
|
@@ -1094,13 +1094,13 @@ const G = new gs(), Gr = {
|
|
|
1094
1094
|
O(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
|
+
}, dn = {
|
|
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",
|
|
1117
|
+
return (t, o) => (m(), g("div", Zs, [
|
|
1118
|
+
t.$slots.header ? (m(), g("div", qs, [
|
|
1119
1119
|
O(t.$slots, "header")
|
|
1120
|
-
])) :
|
|
1121
|
-
|
|
1122
|
-
class:
|
|
1120
|
+
])) : T("", !0),
|
|
1121
|
+
f("div", {
|
|
1122
|
+
class: H([s.padded ? s.paddedClass : ""])
|
|
1123
1123
|
}, [
|
|
1124
1124
|
O(t.$slots, "default")
|
|
1125
1125
|
], 2),
|
|
1126
|
-
t.$slots.footer ? (m(), g("div",
|
|
1126
|
+
t.$slots.footer ? (m(), g("div", Us, [
|
|
1127
1127
|
O(t.$slots, "footer")
|
|
1128
|
-
])) :
|
|
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: w(F)[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
|
+
f("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
|
+
f("div", {
|
|
1233
|
+
class: H(["mt-5 sm:mt-6", o.value])
|
|
1234
1234
|
}, [
|
|
1235
|
-
(m(!0), g(R, null, z(t.value, (
|
|
1236
|
-
key:
|
|
1237
|
-
variant:
|
|
1238
|
-
onClick: (y) => r.$emit(
|
|
1235
|
+
(m(!0), g(R, null, z(t.value, (d, p) => (m(), V(w(G), {
|
|
1236
|
+
key: p,
|
|
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(w(Ae), {
|
|
1312
1312
|
as: "template",
|
|
1313
|
-
show:
|
|
1313
|
+
show: w(oe).state.isVisible
|
|
1314
1314
|
}, {
|
|
1315
1315
|
default: C(() => [
|
|
1316
|
-
|
|
1316
|
+
b(w(Fe), {
|
|
1317
1317
|
class: "relative z-1000",
|
|
1318
|
-
onClose:
|
|
1318
|
+
onClose: w(oe).hide
|
|
1319
1319
|
}, {
|
|
1320
1320
|
default: C(() => [
|
|
1321
|
-
|
|
1321
|
+
b(w(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
|
+
f("div", { class: "fixed inset-0 bg-gray-500/75 transition-opacity" }, null, -1)
|
|
1332
1332
|
])]),
|
|
1333
1333
|
_: 1
|
|
1334
1334
|
}),
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1335
|
+
f("div", Xs, [
|
|
1336
|
+
f("div", Js, [
|
|
1337
|
+
b(w(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(w(Oe), { 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(I(w(oe).state.content), Z(w(oe).state.props, Re(w(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(w(Ae), {
|
|
1390
1390
|
show: e.overlayInstance.state.isVisible,
|
|
1391
1391
|
as: "template"
|
|
1392
1392
|
}, {
|
|
1393
1393
|
default: C(() => [
|
|
1394
|
-
|
|
1394
|
+
b(w(Fe), {
|
|
1395
1395
|
initialFocus: t.value,
|
|
1396
1396
|
class: "relative z-1000",
|
|
1397
1397
|
onClose: c
|
|
1398
1398
|
}, {
|
|
1399
1399
|
default: C(() => [
|
|
1400
|
-
|
|
1400
|
+
b(w(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
|
+
f("div", { class: "fixed inset-0 bg-gray-600/30" }, null, -1)
|
|
1411
1411
|
])]),
|
|
1412
1412
|
_: 1
|
|
1413
1413
|
}),
|
|
1414
|
-
|
|
1415
|
-
|
|
1414
|
+
f("div", eo, [
|
|
1415
|
+
b(w(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(w(Oe), {
|
|
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(I(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,64 +1482,64 @@ 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
|
-
|
|
1515
|
-
if (
|
|
1513
|
+
const u = s.getSourceDataAtRow(s.toPhysicalRow(o)), d = document.createElement("div");
|
|
1514
|
+
d.classList.add("flex", "items-center", "gap-2"), i.forEach((p) => {
|
|
1515
|
+
if (p.condition && typeof p.condition == "function" && !p.condition(u))
|
|
1516
1516
|
return;
|
|
1517
1517
|
const y = document.createElement("button");
|
|
1518
|
-
if (y.type = "button", y.classList.add("spark-table-action-button"),
|
|
1518
|
+
if (y.type = "button", y.classList.add("spark-table-action-button"), p.icon) {
|
|
1519
1519
|
const k = document.createElement("span");
|
|
1520
|
-
k.innerHTML =
|
|
1520
|
+
k.innerHTML = ce({ prefix: "far", iconName: p.icon }).html, k.classList.add("size-4"), y.appendChild(k);
|
|
1521
1521
|
}
|
|
1522
|
-
if (
|
|
1522
|
+
if (p.label) {
|
|
1523
1523
|
const k = document.createElement("span");
|
|
1524
|
-
k.textContent =
|
|
1524
|
+
k.textContent = p.label, y.appendChild(k);
|
|
1525
1525
|
}
|
|
1526
1526
|
y.addEventListener("click", async (k) => {
|
|
1527
|
-
if (k.preventDefault(), k.stopPropagation(),
|
|
1528
|
-
const h = typeof
|
|
1529
|
-
if (!await
|
|
1530
|
-
title:
|
|
1527
|
+
if (k.preventDefault(), k.stopPropagation(), p.confirm) {
|
|
1528
|
+
const h = typeof p.confirm == "string" ? p.confirm : `Are you sure you want to ${p.label?.toLowerCase() || "perform this action"}?`;
|
|
1529
|
+
if (!await oe.confirm({
|
|
1530
|
+
title: p.confirmTitle,
|
|
1531
1531
|
message: h,
|
|
1532
|
-
type:
|
|
1533
|
-
confirmText:
|
|
1534
|
-
cancelText:
|
|
1535
|
-
confirmVariant:
|
|
1532
|
+
type: p.confirmType,
|
|
1533
|
+
confirmText: p.confirmText,
|
|
1534
|
+
cancelText: p.cancelText,
|
|
1535
|
+
confirmVariant: p.confirmVariant
|
|
1536
1536
|
}))
|
|
1537
1537
|
return;
|
|
1538
1538
|
}
|
|
1539
|
-
|
|
1540
|
-
}),
|
|
1541
|
-
}), t.appendChild(
|
|
1542
|
-
},
|
|
1539
|
+
p.event && e.methods.fireEvent(p.event, u), p.handler && typeof p.handler == "function" && p.handler(u);
|
|
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,11 +1548,11 @@ 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[
|
|
1555
|
-
|
|
1554
|
+
const i = (c.rendererConfig || {}).colorMap || {}, u = i[a] || i[a?.toLowerCase()] || "gray", d = Ce[u] || Ce.gray, p = document.createElement("span");
|
|
1555
|
+
p.classList.add(
|
|
1556
1556
|
"inline-flex",
|
|
1557
1557
|
"items-center",
|
|
1558
1558
|
"px-2.5",
|
|
@@ -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
|
-
),
|
|
1566
|
-
},
|
|
1564
|
+
...d.split(" ")
|
|
1565
|
+
), p.textContent = a, t.appendChild(p);
|
|
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", p = 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",
|
|
@@ -1592,180 +1594,342 @@ const se = new Ks(), Us = { class: "fixed inset-0 z-10 w-screen overflow-y-auto"
|
|
|
1592
1594
|
"rounded-full",
|
|
1593
1595
|
k.bg,
|
|
1594
1596
|
k.text
|
|
1595
|
-
), h.style.width = `${
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1600
|
-
},
|
|
1601
|
-
|
|
1597
|
+
), h.style.width = `${p}px`, h.style.height = `${p}px`;
|
|
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(p * 0.5);
|
|
1601
|
+
x.style.fontSize = `${P}px`, h.appendChild(x), t.appendChild(h);
|
|
1602
|
+
}, po = (e, s = 2) => {
|
|
1603
|
+
const t = Number(e);
|
|
1604
|
+
if (isNaN(t)) return null;
|
|
1605
|
+
const o = t < 0, n = Math.abs(t).toLocaleString("en-AU", {
|
|
1606
|
+
minimumFractionDigits: s,
|
|
1607
|
+
maximumFractionDigits: s
|
|
1608
|
+
});
|
|
1609
|
+
return o ? `-$${n}` : `$${n}`;
|
|
1610
|
+
}, fo = (e) => (s, t, o, l, n, a, c) => {
|
|
1611
|
+
t.innerHTML = "", t.classList.add("spark-table-cell-currency");
|
|
1612
|
+
const r = c.rendererConfig || {}, { decimals: i = 2, emptyText: u = "" } = r;
|
|
1613
|
+
if (a == null || a === "") {
|
|
1614
|
+
t.textContent = u;
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
const d = po(a, i);
|
|
1618
|
+
if (d === null) {
|
|
1619
|
+
t.textContent = u;
|
|
1602
1620
|
return;
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1621
|
+
}
|
|
1622
|
+
const p = document.createElement("span");
|
|
1623
|
+
p.textContent = d, t.appendChild(p);
|
|
1624
|
+
}, mo = (e) => (s, t, o, l, n, a, c) => {
|
|
1625
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-link"), !a)
|
|
1626
|
+
return;
|
|
1627
|
+
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(o));
|
|
1628
|
+
let u = a;
|
|
1629
|
+
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));
|
|
1630
|
+
const d = document.createElement("a");
|
|
1631
|
+
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", (p) => {
|
|
1632
|
+
p.stopPropagation();
|
|
1633
|
+
}), t.appendChild(d);
|
|
1634
|
+
}, Te = {
|
|
1611
1635
|
sm: "h-6 w-6",
|
|
1612
1636
|
md: "h-8 w-8",
|
|
1613
1637
|
lg: "h-12 w-12"
|
|
1614
|
-
},
|
|
1615
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !
|
|
1638
|
+
}, ho = (e) => (s, t, o, l, n, a, c) => {
|
|
1639
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-image"), !a)
|
|
1616
1640
|
return;
|
|
1617
|
-
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(
|
|
1641
|
+
const r = c.rendererConfig || {}, i = s.getSourceDataAtRow(s.toPhysicalRow(o)), u = r.size || "md", d = Te[u] || Te.md, p = r.rounded !== !1;
|
|
1618
1642
|
let y = r.alt || "";
|
|
1619
1643
|
typeof r.alt == "string" && i[r.alt] && (y = i[r.alt]);
|
|
1620
1644
|
const k = document.createElement("img");
|
|
1621
|
-
k.src =
|
|
1622
|
-
},
|
|
1623
|
-
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !
|
|
1645
|
+
k.src = a, k.alt = y, k.classList.add(...d.split(" "), "object-cover"), p ? k.classList.add("rounded-full") : k.classList.add("rounded"), t.appendChild(k);
|
|
1646
|
+
}, go = (e) => (s, t, o, l, n, a, c) => {
|
|
1647
|
+
if (t.innerHTML = "", t.classList.add("spark-table-cell-date"), !a)
|
|
1624
1648
|
return;
|
|
1625
1649
|
const r = c.rendererConfig || {}, i = r.format || "short", u = r.locale || "en-US";
|
|
1626
|
-
let
|
|
1650
|
+
let d = a;
|
|
1627
1651
|
try {
|
|
1628
|
-
const y = new Date(
|
|
1629
|
-
isNaN(y.getTime()) ?
|
|
1652
|
+
const y = new Date(a);
|
|
1653
|
+
isNaN(y.getTime()) ? d = a : typeof i == "function" ? d = i(y) : i === "short" ? d = y.toLocaleDateString(u) : i === "long" ? d = y.toLocaleDateString(u, {
|
|
1630
1654
|
year: "numeric",
|
|
1631
1655
|
month: "long",
|
|
1632
1656
|
day: "numeric"
|
|
1633
|
-
}) : i === "relative" ?
|
|
1657
|
+
}) : i === "relative" ? d = yo(y) : i === "datetime" ? d = y.toLocaleString(u) : d = y.toLocaleDateString(u);
|
|
1634
1658
|
} catch (y) {
|
|
1635
|
-
console.error("Error formatting date:", y),
|
|
1659
|
+
console.error("Error formatting date:", y), d = a;
|
|
1636
1660
|
}
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1661
|
+
const p = document.createElement("span");
|
|
1662
|
+
p.textContent = d, t.appendChild(p);
|
|
1639
1663
|
};
|
|
1640
|
-
function
|
|
1641
|
-
const t = /* @__PURE__ */ new Date() - e,
|
|
1642
|
-
return
|
|
1664
|
+
function yo(e) {
|
|
1665
|
+
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;
|
|
1666
|
+
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
1667
|
}
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1668
|
+
const vo = (e) => {
|
|
1669
|
+
const s = ["th", "st", "nd", "rd"], t = e % 100;
|
|
1670
|
+
return e + (s[(t - 20) % 10] || s[t] || s[0]);
|
|
1671
|
+
}, j = (e, s = 2) => String(e).padStart(s, "0"), ge = /* @__PURE__ */ new Map(), bo = (e, s) => {
|
|
1672
|
+
const t = `${e}:${JSON.stringify(s)}`;
|
|
1673
|
+
return ge.has(t) || ge.set(t, new Intl.DateTimeFormat(e, s)), ge.get(t);
|
|
1674
|
+
}, ie = (e, s, t, o) => {
|
|
1675
|
+
const a = bo(s, t).formatToParts(e).find((c) => c.type === o);
|
|
1676
|
+
return a ? a.value : "";
|
|
1677
|
+
}, xo = (e) => e.epochMilliseconds !== void 0 ? new Date(e.epochMilliseconds) : new Date(
|
|
1678
|
+
e.year,
|
|
1679
|
+
e.month - 1,
|
|
1680
|
+
e.day,
|
|
1681
|
+
e.hour || 0,
|
|
1682
|
+
e.minute || 0,
|
|
1683
|
+
e.second || 0,
|
|
1684
|
+
e.millisecond || 0
|
|
1685
|
+
), ko = (e) => {
|
|
1686
|
+
const s = e.hour || 0, t = s % 12 || 12, o = s >= 12;
|
|
1687
|
+
return {
|
|
1688
|
+
year: e.year,
|
|
1689
|
+
month: e.month,
|
|
1690
|
+
day: e.day,
|
|
1691
|
+
hour24: s,
|
|
1692
|
+
hour12: t,
|
|
1693
|
+
hourFrom1: s === 0 ? 24 : s,
|
|
1694
|
+
// k format (1-24)
|
|
1695
|
+
minute: e.minute || 0,
|
|
1696
|
+
second: e.second || 0,
|
|
1697
|
+
millisecond: e.millisecond || 0,
|
|
1698
|
+
dayOfWeek: e.dayOfWeek,
|
|
1699
|
+
// 1=Monday, 7=Sunday in Temporal
|
|
1700
|
+
isPM: o,
|
|
1701
|
+
quarter: Math.ceil(e.month / 3)
|
|
1702
|
+
};
|
|
1703
|
+
}, Le = (e, s = !0) => {
|
|
1704
|
+
if (!e.offsetNanoseconds && e.offsetNanoseconds !== 0)
|
|
1705
|
+
return "";
|
|
1706
|
+
const t = Math.round(e.offsetNanoseconds / 6e10), o = t >= 0 ? "+" : "-", l = Math.abs(t), n = Math.floor(l / 60), a = l % 60;
|
|
1707
|
+
return s ? `${o}${j(n)}:${j(a)}` : `${o}${j(n)}${j(a)}`;
|
|
1708
|
+
}, wo = (e, s) => {
|
|
1709
|
+
const t = ko(e), o = xo(e), l = t.dayOfWeek === 7 ? 0 : t.dayOfWeek;
|
|
1710
|
+
return [
|
|
1711
|
+
// Year
|
|
1712
|
+
["YYYY", () => String(t.year)],
|
|
1713
|
+
["YY", () => String(t.year).slice(-2)],
|
|
1714
|
+
// Month
|
|
1715
|
+
["MMMM", () => ie(o, s, { month: "long" }, "month")],
|
|
1716
|
+
["MMM", () => ie(o, s, { month: "short" }, "month")],
|
|
1717
|
+
["MM", () => j(t.month)],
|
|
1718
|
+
["M", () => String(t.month)],
|
|
1719
|
+
// Day of month
|
|
1720
|
+
["DD", () => j(t.day)],
|
|
1721
|
+
["Do", () => vo(t.day)],
|
|
1722
|
+
["D", () => String(t.day)],
|
|
1723
|
+
// Day of week
|
|
1724
|
+
["dddd", () => ie(o, s, { weekday: "long" }, "weekday")],
|
|
1725
|
+
["ddd", () => ie(o, s, { weekday: "short" }, "weekday")],
|
|
1726
|
+
["dd", () => ie(o, s, { weekday: "short" }, "weekday").slice(0, 2)],
|
|
1727
|
+
["d", () => String(l)],
|
|
1728
|
+
// Hour
|
|
1729
|
+
["HH", () => j(t.hour24)],
|
|
1730
|
+
["H", () => String(t.hour24)],
|
|
1731
|
+
["hh", () => j(t.hour12)],
|
|
1732
|
+
["h", () => String(t.hour12)],
|
|
1733
|
+
["kk", () => j(t.hourFrom1)],
|
|
1734
|
+
["k", () => String(t.hourFrom1)],
|
|
1735
|
+
// Minute
|
|
1736
|
+
["mm", () => j(t.minute)],
|
|
1737
|
+
["m", () => String(t.minute)],
|
|
1738
|
+
// Second
|
|
1739
|
+
["ss", () => j(t.second)],
|
|
1740
|
+
["s", () => String(t.second)],
|
|
1741
|
+
// Millisecond
|
|
1742
|
+
["SSS", () => j(t.millisecond, 3)],
|
|
1743
|
+
// AM/PM
|
|
1744
|
+
["A", () => t.isPM ? "PM" : "AM"],
|
|
1745
|
+
["a", () => t.isPM ? "pm" : "am"],
|
|
1746
|
+
// Timezone offset
|
|
1747
|
+
["ZZ", () => Le(e, !1)],
|
|
1748
|
+
["Z", () => Le(e, !0)],
|
|
1749
|
+
// Quarter
|
|
1750
|
+
["Q", () => String(t.quarter)],
|
|
1751
|
+
// Unix timestamp
|
|
1752
|
+
["x", () => String(e.epochMilliseconds ?? o.getTime())],
|
|
1753
|
+
["X", () => String(Math.floor((e.epochMilliseconds ?? o.getTime()) / 1e3))]
|
|
1754
|
+
];
|
|
1755
|
+
}, _o = (e, s, t = {}) => {
|
|
1756
|
+
const { locale: o = "en-US" } = t;
|
|
1757
|
+
if (!e)
|
|
1758
|
+
return "";
|
|
1759
|
+
let l = e;
|
|
1760
|
+
if (typeof e == "string")
|
|
1761
|
+
try {
|
|
1762
|
+
if (e.includes("[") || e.includes("Z") || /[+-]\d{2}:\d{2}$/.test(e))
|
|
1763
|
+
l = Temporal.ZonedDateTime.from(e);
|
|
1764
|
+
else {
|
|
1765
|
+
const r = e.replace(" ", "T");
|
|
1766
|
+
l = Temporal.PlainDateTime.from(r);
|
|
1767
|
+
}
|
|
1768
|
+
} catch (r) {
|
|
1769
|
+
return console.error("Failed to parse date string:", e, r), e;
|
|
1770
|
+
}
|
|
1771
|
+
const n = wo(l, o), a = n.map(([r]) => r).join("|"), c = new RegExp(`\\[([^\\]]+)\\]|(${a})`, "g");
|
|
1772
|
+
return s.replace(c, (r, i, u) => {
|
|
1773
|
+
if (i !== void 0)
|
|
1774
|
+
return i;
|
|
1775
|
+
const d = n.find(([p]) => p === u);
|
|
1776
|
+
return d ? d[1]() : r;
|
|
1777
|
+
});
|
|
1778
|
+
}, So = (e, s = {}) => {
|
|
1779
|
+
const { fromTimezone: t, toTimezone: o } = s;
|
|
1780
|
+
if (!e)
|
|
1781
|
+
return null;
|
|
1782
|
+
const l = e.replace(" ", "T");
|
|
1783
|
+
return t && o ? Temporal.PlainDateTime.from(l).toZonedDateTime(t).withTimeZone(o) : t ? Temporal.PlainDateTime.from(l).toZonedDateTime(t) : Temporal.PlainDateTime.from(l);
|
|
1784
|
+
}, Co = (e) => (s, t, o, l, n, a, c) => {
|
|
1785
|
+
t.innerHTML = "", t.classList.add("spark-table-cell-datetime");
|
|
1786
|
+
const r = c.rendererConfig || {}, {
|
|
1787
|
+
format: i = "DD MMM YYYY, HH:mm",
|
|
1788
|
+
fromTimezone: u,
|
|
1789
|
+
toTimezone: d,
|
|
1790
|
+
locale: p = "en-US",
|
|
1791
|
+
emptyText: y = ""
|
|
1792
|
+
} = r;
|
|
1793
|
+
if (!a) {
|
|
1794
|
+
t.textContent = y;
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
try {
|
|
1798
|
+
const k = So(a, { fromTimezone: u, toTimezone: d });
|
|
1799
|
+
if (!k) {
|
|
1800
|
+
t.textContent = y;
|
|
1801
|
+
return;
|
|
1802
|
+
}
|
|
1803
|
+
const h = _o(k, i, { locale: p }), x = document.createElement("span");
|
|
1804
|
+
x.textContent = h, t.appendChild(x);
|
|
1805
|
+
} catch (k) {
|
|
1806
|
+
console.error("Error formatting datetime:", k, { value: a, format: i }), t.textContent = a;
|
|
1807
|
+
}
|
|
1808
|
+
}, $o = /* @__PURE__ */ new Map(), U = (e, s) => {
|
|
1809
|
+
Kt(e, (t, o, l, n, a, c, r) => {
|
|
1810
|
+
Gt.apply(null, [t, o, l, n, a, c, r]), s(t, o, l, n, a, c, r);
|
|
1811
|
+
}), $o.set(e, s);
|
|
1812
|
+
}, To = (e) => {
|
|
1813
|
+
U("spark.actions", lo(e)), U("spark.badge", io()), U("spark.boolean", uo()), U("spark.currency", fo()), U("spark.link", mo()), U("spark.image", ho()), U("spark.date", go()), U("spark.datetime", Co()), U("style.capitalize", (s, t, o, l, n, a) => {
|
|
1814
|
+
if (!a || a.length === 0) {
|
|
1651
1815
|
t.innerText = "";
|
|
1652
1816
|
return;
|
|
1653
1817
|
}
|
|
1654
1818
|
const c = document.createElement("span");
|
|
1655
|
-
c.innerHTML =
|
|
1819
|
+
c.innerHTML = a, c.classList.add("capitalize"), t.replaceChildren(c);
|
|
1656
1820
|
});
|
|
1657
|
-
},
|
|
1658
|
-
},
|
|
1659
|
-
const t =
|
|
1660
|
-
const
|
|
1661
|
-
return Object.keys(
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1664
|
-
}),
|
|
1665
|
-
},
|
|
1821
|
+
}, Lo = () => {
|
|
1822
|
+
}, Po = (e, s = {}) => {
|
|
1823
|
+
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, $ = "") => {
|
|
1824
|
+
const M = {};
|
|
1825
|
+
return Object.keys(v).forEach((D) => {
|
|
1826
|
+
const W = v[D], xe = $ ? `${$}[${D}]` : D;
|
|
1827
|
+
W != null && (typeof W == "object" && !Array.isArray(W) ? Object.assign(M, d(W, xe)) : M[xe] = String(W));
|
|
1828
|
+
}), M;
|
|
1829
|
+
}, p = () => {
|
|
1666
1830
|
if (c)
|
|
1667
1831
|
try {
|
|
1668
|
-
const
|
|
1832
|
+
const v = {
|
|
1669
1833
|
params: e.params,
|
|
1670
1834
|
timestamp: Date.now()
|
|
1671
1835
|
};
|
|
1672
|
-
localStorage.setItem(u, JSON.stringify(
|
|
1673
|
-
} catch (
|
|
1674
|
-
console.warn("Failed to save table state to localStorage:",
|
|
1836
|
+
localStorage.setItem(u, JSON.stringify(v));
|
|
1837
|
+
} catch (v) {
|
|
1838
|
+
console.warn("Failed to save table state to localStorage:", v);
|
|
1675
1839
|
}
|
|
1676
1840
|
}, y = () => {
|
|
1677
1841
|
if (!c) return null;
|
|
1678
1842
|
try {
|
|
1679
|
-
const
|
|
1680
|
-
if (!
|
|
1681
|
-
const
|
|
1843
|
+
const v = localStorage.getItem(u);
|
|
1844
|
+
if (!v) return null;
|
|
1845
|
+
const $ = JSON.parse(v);
|
|
1682
1846
|
if (i > 0) {
|
|
1683
|
-
const
|
|
1684
|
-
if (
|
|
1847
|
+
const M = Date.now() - $.timestamp, D = i * 24 * 60 * 60 * 1e3;
|
|
1848
|
+
if (M > D)
|
|
1685
1849
|
return localStorage.removeItem(u), null;
|
|
1686
1850
|
}
|
|
1687
|
-
return
|
|
1688
|
-
} catch (
|
|
1689
|
-
return console.warn("Failed to load table state from localStorage:",
|
|
1851
|
+
return $.params;
|
|
1852
|
+
} catch (v) {
|
|
1853
|
+
return console.warn("Failed to load table state from localStorage:", v), null;
|
|
1690
1854
|
}
|
|
1691
1855
|
}, k = () => {
|
|
1692
1856
|
try {
|
|
1693
1857
|
localStorage.removeItem(u);
|
|
1694
|
-
} catch (
|
|
1695
|
-
console.warn("Failed to clear table state from localStorage:",
|
|
1858
|
+
} catch (v) {
|
|
1859
|
+
console.warn("Failed to clear table state from localStorage:", v);
|
|
1696
1860
|
}
|
|
1697
1861
|
}, h = () => {
|
|
1698
|
-
if (!
|
|
1699
|
-
const
|
|
1862
|
+
if (!a) return;
|
|
1863
|
+
const v = { ...o.query };
|
|
1700
1864
|
if (n) {
|
|
1701
|
-
Object.keys(
|
|
1702
|
-
|
|
1865
|
+
Object.keys(v).forEach((M) => {
|
|
1866
|
+
x(M) && delete v[M];
|
|
1703
1867
|
});
|
|
1704
|
-
const
|
|
1705
|
-
Object.assign(
|
|
1868
|
+
const $ = d(e.params);
|
|
1869
|
+
Object.assign(v, $);
|
|
1706
1870
|
} else {
|
|
1707
|
-
Object.keys(
|
|
1708
|
-
(
|
|
1871
|
+
Object.keys(v).forEach((M) => {
|
|
1872
|
+
(M.startsWith(`${l}[`) || M === l) && delete v[M];
|
|
1709
1873
|
});
|
|
1710
|
-
const
|
|
1711
|
-
Object.assign(
|
|
1874
|
+
const $ = d(e.params, l);
|
|
1875
|
+
Object.assign(v, $);
|
|
1712
1876
|
}
|
|
1713
|
-
t.replace({ query:
|
|
1714
|
-
},
|
|
1715
|
-
if (["page", "limit"].includes(
|
|
1716
|
-
const
|
|
1717
|
-
return isNaN(
|
|
1877
|
+
t.replace({ query: v });
|
|
1878
|
+
}, x = (v) => !!(["page", "limit", "search", "orderBy", "sortedBy"].includes(v) || v.includes("[")), P = (v, $) => {
|
|
1879
|
+
if (["page", "limit"].includes(v) && $ !== null && $ !== void 0) {
|
|
1880
|
+
const D = parseInt($, 10);
|
|
1881
|
+
return isNaN(D) ? $ : D;
|
|
1718
1882
|
}
|
|
1719
|
-
return
|
|
1720
|
-
},
|
|
1883
|
+
return $;
|
|
1884
|
+
}, _ = () => {
|
|
1721
1885
|
if (n)
|
|
1722
|
-
Object.keys(
|
|
1723
|
-
|
|
1886
|
+
Object.keys(o.query).forEach((v) => {
|
|
1887
|
+
x(v) && (e.params[v] = P(v, o.query[v]));
|
|
1724
1888
|
});
|
|
1725
1889
|
else {
|
|
1726
|
-
const
|
|
1727
|
-
Object.keys(
|
|
1728
|
-
if (
|
|
1729
|
-
const
|
|
1730
|
-
e.params[
|
|
1890
|
+
const v = `${l}[`;
|
|
1891
|
+
Object.keys(o.query).forEach(($) => {
|
|
1892
|
+
if ($.startsWith(v)) {
|
|
1893
|
+
const M = $.slice(v.length, -1);
|
|
1894
|
+
e.params[M] = P(M, o.query[$]);
|
|
1731
1895
|
}
|
|
1732
1896
|
});
|
|
1733
1897
|
}
|
|
1734
1898
|
};
|
|
1735
|
-
return
|
|
1899
|
+
return N(
|
|
1736
1900
|
() => e.params,
|
|
1737
1901
|
() => {
|
|
1738
|
-
|
|
1902
|
+
a && h(), c && p();
|
|
1739
1903
|
},
|
|
1740
1904
|
{ deep: !0 }
|
|
1741
|
-
), r &&
|
|
1742
|
-
let
|
|
1743
|
-
if (
|
|
1744
|
-
let
|
|
1905
|
+
), r && be(() => {
|
|
1906
|
+
let v = !1;
|
|
1907
|
+
if (a) {
|
|
1908
|
+
let $ = !1;
|
|
1745
1909
|
if (n)
|
|
1746
|
-
|
|
1910
|
+
$ = Object.keys(o.query).some((M) => x(M));
|
|
1747
1911
|
else {
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1750
|
-
(
|
|
1912
|
+
const M = `${l}[`;
|
|
1913
|
+
$ = Object.keys(o.query).some(
|
|
1914
|
+
(D) => D.startsWith(M)
|
|
1751
1915
|
);
|
|
1752
1916
|
}
|
|
1753
|
-
|
|
1917
|
+
$ && (v = !0, _());
|
|
1754
1918
|
}
|
|
1755
|
-
if (!
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}), Object.assign(e.params,
|
|
1919
|
+
if (!v && c) {
|
|
1920
|
+
const $ = y();
|
|
1921
|
+
$ && Object.keys($).length > 0 && (Object.keys($).forEach((M) => {
|
|
1922
|
+
$[M] = P(M, $[M]);
|
|
1923
|
+
}), Object.assign(e.params, $));
|
|
1760
1924
|
}
|
|
1761
1925
|
}), {
|
|
1762
1926
|
syncToRoute: h,
|
|
1763
|
-
restoreFromRoute:
|
|
1764
|
-
saveToStorage:
|
|
1927
|
+
restoreFromRoute: _,
|
|
1928
|
+
saveToStorage: p,
|
|
1765
1929
|
loadFromStorage: y,
|
|
1766
1930
|
clearStorage: k
|
|
1767
1931
|
};
|
|
1768
|
-
},
|
|
1932
|
+
}, Mo = { class: "flex items-center gap-4 py-3" }, Ho = { class: "shrink-0" }, Vo = { class: "text-sm text-gray-700" }, Ro = { class: "font-medium" }, Bo = { class: "font-medium" }, Eo = { class: "font-medium" }, Ao = {
|
|
1769
1933
|
__name: "SparkTablePaginationDetails",
|
|
1770
1934
|
props: {
|
|
1771
1935
|
sparkTable: {
|
|
@@ -1775,29 +1939,29 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1775
1939
|
},
|
|
1776
1940
|
setup(e) {
|
|
1777
1941
|
const s = e;
|
|
1778
|
-
return (t,
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1942
|
+
return (t, o) => (m(), g("div", null, [
|
|
1943
|
+
f("div", Mo, [
|
|
1944
|
+
f("div", Ho, [
|
|
1945
|
+
f("div", Vo, [
|
|
1946
|
+
o[0] || (o[0] = B(" Showing ", -1)),
|
|
1947
|
+
f("span", Ro, L(s.sparkTable.response.meta.from), 1),
|
|
1948
|
+
o[1] || (o[1] = B(" to ", -1)),
|
|
1949
|
+
f("span", Bo, L(s.sparkTable.response.meta.to), 1),
|
|
1950
|
+
o[2] || (o[2] = B(" of ", -1)),
|
|
1951
|
+
f("span", Eo, L(s.sparkTable.response.meta.total), 1),
|
|
1952
|
+
o[3] || (o[3] = B(" results ", -1))
|
|
1789
1953
|
])
|
|
1790
1954
|
])
|
|
1791
1955
|
])
|
|
1792
1956
|
]));
|
|
1793
1957
|
}
|
|
1794
|
-
},
|
|
1958
|
+
}, Fo = { class: "flex items-center gap-4 px-4 py-3" }, Oo = {
|
|
1795
1959
|
key: 0,
|
|
1796
1960
|
class: "shrink-0 ml-auto"
|
|
1797
|
-
},
|
|
1961
|
+
}, zo = {
|
|
1798
1962
|
class: "isolate inline-flex -space-x-px rounded-md shadow-xs bg-white",
|
|
1799
1963
|
"aria-label": "Pagination"
|
|
1800
|
-
},
|
|
1964
|
+
}, Do = ["onClick"], jo = {
|
|
1801
1965
|
__name: "SparkTablePaginationPaging",
|
|
1802
1966
|
props: {
|
|
1803
1967
|
sparkTable: {
|
|
@@ -1807,67 +1971,67 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1807
1971
|
},
|
|
1808
1972
|
emits: ["paginate"],
|
|
1809
1973
|
setup(e, { emit: s }) {
|
|
1810
|
-
const t = e,
|
|
1974
|
+
const t = e, o = s, l = (u) => {
|
|
1811
1975
|
n(t.sparkTable.params.page + u);
|
|
1812
1976
|
}, n = (u) => {
|
|
1813
|
-
u < 1 || u > t.sparkTable.response.meta.last_page ||
|
|
1977
|
+
u < 1 || u > t.sparkTable.response.meta.last_page || o("paginate", {
|
|
1814
1978
|
page: u
|
|
1815
1979
|
});
|
|
1816
|
-
},
|
|
1817
|
-
Math.floor((
|
|
1818
|
-
|
|
1980
|
+
}, a = S(() => t.sparkTable.params.page ? Math.ceil(t.sparkTable.params.page / 10) * 10 : 1), c = S(() => t.sparkTable.computed.ready ? Ot(
|
|
1981
|
+
Math.floor((a.value - 1) / 10) * 10 + 1,
|
|
1982
|
+
a.value > t.sparkTable.response.meta.last_page ? t.sparkTable.response.meta.last_page + 1 : a.value + 1
|
|
1819
1983
|
) : []), r = S(
|
|
1820
|
-
() => t.sparkTable.params.page <
|
|
1984
|
+
() => t.sparkTable.params.page < Y(t.sparkTable.response.meta, "last_page", 1)
|
|
1821
1985
|
), i = S(() => t.sparkTable.params.page > 1);
|
|
1822
|
-
return (u,
|
|
1823
|
-
const
|
|
1986
|
+
return (u, d) => {
|
|
1987
|
+
const p = A("font-awesome-icon");
|
|
1824
1988
|
return m(), g("div", null, [
|
|
1825
|
-
|
|
1826
|
-
c.value.length > 1 ? (m(), g("div",
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
class:
|
|
1989
|
+
f("div", Fo, [
|
|
1990
|
+
c.value.length > 1 ? (m(), g("div", Oo, [
|
|
1991
|
+
f("div", null, [
|
|
1992
|
+
f("nav", zo, [
|
|
1993
|
+
f("a", {
|
|
1994
|
+
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
1995
|
href: "#",
|
|
1832
|
-
onClick:
|
|
1996
|
+
onClick: d[0] || (d[0] = Q((y) => l(-1), ["prevent"]))
|
|
1833
1997
|
}, [
|
|
1834
|
-
|
|
1835
|
-
icon:
|
|
1998
|
+
b(p, {
|
|
1999
|
+
icon: w(F).farChevronLeft,
|
|
1836
2000
|
class: "size-5"
|
|
1837
2001
|
}, null, 8, ["icon"])
|
|
1838
2002
|
], 2),
|
|
1839
2003
|
(m(!0), g(R, null, z(c.value, (y) => (m(), g("a", {
|
|
1840
2004
|
key: `page-${y}`,
|
|
1841
2005
|
href: "#",
|
|
1842
|
-
class:
|
|
2006
|
+
class: H([
|
|
1843
2007
|
"relative inline-flex items-center px-4 py-[9px] text-sm font-semibold ring-1 ring-inset",
|
|
1844
2008
|
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
2009
|
]),
|
|
1846
2010
|
onClick: (k) => n(y)
|
|
1847
|
-
}, L(y), 11,
|
|
1848
|
-
|
|
1849
|
-
class:
|
|
1850
|
-
onClick:
|
|
2011
|
+
}, L(y), 11, Do))), 128)),
|
|
2012
|
+
f("a", {
|
|
2013
|
+
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"]),
|
|
2014
|
+
onClick: d[1] || (d[1] = Q((y) => l(1), ["prevent"])),
|
|
1851
2015
|
href: "#"
|
|
1852
2016
|
}, [
|
|
1853
|
-
|
|
1854
|
-
icon:
|
|
2017
|
+
b(p, {
|
|
2018
|
+
icon: w(F).farChevronRight,
|
|
1855
2019
|
class: "size-5"
|
|
1856
2020
|
}, null, 8, ["icon"])
|
|
1857
2021
|
], 2)
|
|
1858
2022
|
])
|
|
1859
2023
|
])
|
|
1860
|
-
])) :
|
|
2024
|
+
])) : T("", !0)
|
|
1861
2025
|
])
|
|
1862
2026
|
]);
|
|
1863
2027
|
};
|
|
1864
2028
|
}
|
|
1865
|
-
},
|
|
2029
|
+
}, ee = (e, s) => {
|
|
1866
2030
|
const t = e.__vccOpts || e;
|
|
1867
|
-
for (const [
|
|
1868
|
-
t[
|
|
2031
|
+
for (const [o, l] of s)
|
|
2032
|
+
t[o] = l;
|
|
1869
2033
|
return t;
|
|
1870
|
-
},
|
|
2034
|
+
}, No = { class: "spark-table-pagination-per-page" }, Io = {
|
|
1871
2035
|
__name: "SparkTablePaginationPerPage",
|
|
1872
2036
|
props: {
|
|
1873
2037
|
sparkTable: {
|
|
@@ -1877,19 +2041,19 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1877
2041
|
},
|
|
1878
2042
|
emits: ["paginate"],
|
|
1879
2043
|
setup(e, { emit: s }) {
|
|
1880
|
-
const t = e,
|
|
1881
|
-
label: String(
|
|
1882
|
-
value:
|
|
1883
|
-
}))), n = (
|
|
1884
|
-
|
|
2044
|
+
const t = e, o = s, l = S(() => t.sparkTable.options.perPages.map((a) => ({
|
|
2045
|
+
label: String(a),
|
|
2046
|
+
value: a
|
|
2047
|
+
}))), n = (a) => {
|
|
2048
|
+
o("paginate", {
|
|
1885
2049
|
page: 1,
|
|
1886
|
-
limit: parseInt(
|
|
2050
|
+
limit: parseInt(a)
|
|
1887
2051
|
});
|
|
1888
2052
|
};
|
|
1889
|
-
return (
|
|
2053
|
+
return (a, c) => {
|
|
1890
2054
|
const r = A("FormKit");
|
|
1891
|
-
return m(), g("div",
|
|
1892
|
-
|
|
2055
|
+
return m(), g("div", No, [
|
|
2056
|
+
b(r, {
|
|
1893
2057
|
"model-value": e.sparkTable.params.limit,
|
|
1894
2058
|
type: "select",
|
|
1895
2059
|
options: l.value,
|
|
@@ -1901,7 +2065,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1901
2065
|
]);
|
|
1902
2066
|
};
|
|
1903
2067
|
}
|
|
1904
|
-
},
|
|
2068
|
+
}, Zo = /* @__PURE__ */ ee(Io, [["__scopeId", "data-v-9ef8544b"]]), Pe = {
|
|
1905
2069
|
__name: "SparkTableToolbar",
|
|
1906
2070
|
props: {
|
|
1907
2071
|
position: {
|
|
@@ -1911,18 +2075,18 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1911
2075
|
}
|
|
1912
2076
|
},
|
|
1913
2077
|
setup(e) {
|
|
1914
|
-
const s = e, t =
|
|
2078
|
+
const s = e, t = Be(), o = S(() => !!t.default), l = S(() => {
|
|
1915
2079
|
const n = "spark-table-toolbar flex flex-wrap items-center gap-x-5 w-full";
|
|
1916
2080
|
return s.position === "footer" ? `${n} spark-table-toolbar-footer justify-between` : `${n} spark-table-toolbar-header gap-y-5 py-5`;
|
|
1917
2081
|
});
|
|
1918
|
-
return (n,
|
|
2082
|
+
return (n, a) => o.value ? (m(), g("div", {
|
|
1919
2083
|
key: 0,
|
|
1920
|
-
class:
|
|
2084
|
+
class: H(l.value)
|
|
1921
2085
|
}, [
|
|
1922
2086
|
O(n.$slots, "default")
|
|
1923
|
-
], 2)) :
|
|
2087
|
+
], 2)) : T("", !0);
|
|
1924
2088
|
}
|
|
1925
|
-
},
|
|
2089
|
+
}, qo = { class: "spark-table-search" }, Uo = {
|
|
1926
2090
|
__name: "SparkTableSearch",
|
|
1927
2091
|
props: {
|
|
1928
2092
|
/** SparkTable instance object */
|
|
@@ -1941,33 +2105,33 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1941
2105
|
}
|
|
1942
2106
|
},
|
|
1943
2107
|
setup(e) {
|
|
1944
|
-
const s = e, t = E(""),
|
|
1945
|
-
s.sparkTable.params[
|
|
1946
|
-
[
|
|
2108
|
+
const s = e, t = E(""), o = s.config.param || "search";
|
|
2109
|
+
s.sparkTable.params[o] ? t.value = s.sparkTable.params[o] : s.config.initialValue && (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2110
|
+
[o]: s.config.initialValue
|
|
1947
2111
|
}));
|
|
1948
|
-
const l =
|
|
1949
|
-
|
|
2112
|
+
const l = ze((a) => {
|
|
2113
|
+
a ? s.sparkTable.methods.applyParams({
|
|
1950
2114
|
page: 1,
|
|
1951
|
-
[
|
|
1952
|
-
}) : s.sparkTable.methods.removeParam(
|
|
2115
|
+
[o]: a
|
|
2116
|
+
}) : s.sparkTable.methods.removeParam(o);
|
|
1953
2117
|
}, s.config.debounce || 300);
|
|
1954
|
-
|
|
1955
|
-
l(
|
|
2118
|
+
N(t, (a) => {
|
|
2119
|
+
l(a);
|
|
1956
2120
|
});
|
|
1957
2121
|
const n = s.config.placeholder || "Search...";
|
|
1958
|
-
return
|
|
1959
|
-
() => s.sparkTable.params[
|
|
1960
|
-
(
|
|
1961
|
-
|
|
2122
|
+
return N(
|
|
2123
|
+
() => s.sparkTable.params[o],
|
|
2124
|
+
(a) => {
|
|
2125
|
+
a && a !== t.value ? t.value = a : !a && t.value && (t.value = "");
|
|
1962
2126
|
}
|
|
1963
|
-
), (
|
|
2127
|
+
), (a, c) => {
|
|
1964
2128
|
const r = A("FormKit");
|
|
1965
|
-
return m(), g("div",
|
|
1966
|
-
|
|
2129
|
+
return m(), g("div", qo, [
|
|
2130
|
+
b(r, Z({
|
|
1967
2131
|
modelValue: t.value,
|
|
1968
2132
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
1969
2133
|
type: "text",
|
|
1970
|
-
placeholder:
|
|
2134
|
+
placeholder: w(n),
|
|
1971
2135
|
suffixIcon: "search",
|
|
1972
2136
|
"outer-class": "!mb-0",
|
|
1973
2137
|
"wrapper-class": "!mb-0",
|
|
@@ -1976,7 +2140,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1976
2140
|
]);
|
|
1977
2141
|
};
|
|
1978
2142
|
}
|
|
1979
|
-
},
|
|
2143
|
+
}, Ko = /* @__PURE__ */ ee(Uo, [["__scopeId", "data-v-976170dc"]]), Go = { class: "spark-table-filter-select" }, Wo = {
|
|
1980
2144
|
__name: "SparkTableFilterSelect",
|
|
1981
2145
|
props: {
|
|
1982
2146
|
/** SparkTable instance object */
|
|
@@ -1992,32 +2156,32 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
1992
2156
|
}
|
|
1993
2157
|
},
|
|
1994
2158
|
setup(e) {
|
|
1995
|
-
const s = e, t = E(""),
|
|
1996
|
-
s.sparkTable.params[
|
|
1997
|
-
[
|
|
2159
|
+
const s = e, t = E(""), o = s.config.param || `filter[${s.config.key}]`;
|
|
2160
|
+
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({
|
|
2161
|
+
[o]: s.config.initialValue
|
|
1998
2162
|
}));
|
|
1999
2163
|
const l = s.config.label || null, n = S(() => [
|
|
2000
2164
|
{ label: s.config.placeholder || "All", value: "" },
|
|
2001
2165
|
...s.config.options
|
|
2002
2166
|
]);
|
|
2003
|
-
return
|
|
2004
|
-
|
|
2167
|
+
return N(t, (a) => {
|
|
2168
|
+
a ? s.sparkTable.methods.applyParams({
|
|
2005
2169
|
page: 1,
|
|
2006
|
-
[
|
|
2007
|
-
}) : s.sparkTable.methods.removeParam(
|
|
2008
|
-
}),
|
|
2009
|
-
() => s.sparkTable.params[
|
|
2010
|
-
(
|
|
2011
|
-
|
|
2170
|
+
[o]: a
|
|
2171
|
+
}) : s.sparkTable.methods.removeParam(o);
|
|
2172
|
+
}), N(
|
|
2173
|
+
() => s.sparkTable.params[o],
|
|
2174
|
+
(a) => {
|
|
2175
|
+
a != null && a !== "" ? t.value !== a && (t.value = a) : t.value && (t.value = "");
|
|
2012
2176
|
}
|
|
2013
|
-
), (
|
|
2177
|
+
), (a, c) => {
|
|
2014
2178
|
const r = A("FormKit");
|
|
2015
|
-
return m(), g("div",
|
|
2016
|
-
|
|
2179
|
+
return m(), g("div", Go, [
|
|
2180
|
+
b(r, Z({
|
|
2017
2181
|
modelValue: t.value,
|
|
2018
2182
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
2019
2183
|
type: "select",
|
|
2020
|
-
label:
|
|
2184
|
+
label: w(l),
|
|
2021
2185
|
options: n.value,
|
|
2022
2186
|
placeholder: e.config.placeholder || "All",
|
|
2023
2187
|
"outer-class": "!mb-0",
|
|
@@ -2026,10 +2190,10 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2026
2190
|
]);
|
|
2027
2191
|
};
|
|
2028
2192
|
}
|
|
2029
|
-
},
|
|
2193
|
+
}, Yo = /* @__PURE__ */ ee(Wo, [["__scopeId", "data-v-642dbc69"]]), Xo = { class: "spark-table-filter-buttons" }, Jo = {
|
|
2030
2194
|
key: 0,
|
|
2031
2195
|
class: "spark-table-filter-buttons-label"
|
|
2032
|
-
},
|
|
2196
|
+
}, Qo = {
|
|
2033
2197
|
__name: "SparkTableFilterButtons",
|
|
2034
2198
|
props: {
|
|
2035
2199
|
/** SparkTable instance object */
|
|
@@ -2045,30 +2209,30 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2045
2209
|
}
|
|
2046
2210
|
},
|
|
2047
2211
|
setup(e) {
|
|
2048
|
-
const s = e, t = E(null),
|
|
2212
|
+
const s = e, t = E(null), o = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`;
|
|
2049
2213
|
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
2214
|
[l]: s.config.initialValue
|
|
2051
2215
|
}));
|
|
2052
|
-
const n = (c) => c == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === c,
|
|
2216
|
+
const n = (c) => c == null ? t.value === null || t.value === void 0 || t.value === "" : t.value === c, a = (c) => {
|
|
2053
2217
|
t.value = c, c == null || c === "" ? s.sparkTable.methods.removeParam(l) : s.sparkTable.methods.applyParams({
|
|
2054
2218
|
page: 1,
|
|
2055
2219
|
[l]: c
|
|
2056
2220
|
});
|
|
2057
2221
|
};
|
|
2058
|
-
return
|
|
2222
|
+
return N(
|
|
2059
2223
|
() => s.sparkTable.params[l],
|
|
2060
2224
|
(c) => {
|
|
2061
2225
|
(c == null || c === "") && t.value ? t.value = null : c !== t.value && (t.value = c);
|
|
2062
2226
|
}
|
|
2063
|
-
), (c, r) => (m(), g("div",
|
|
2064
|
-
|
|
2065
|
-
|
|
2227
|
+
), (c, r) => (m(), g("div", Xo, [
|
|
2228
|
+
w(o) ? (m(), g("span", Jo, L(w(o)), 1)) : T("", !0),
|
|
2229
|
+
b(Is, { class: "isolate" }, {
|
|
2066
2230
|
default: C(() => [
|
|
2067
|
-
(m(!0), g(R, null, z(e.config.options, (i) => (m(),
|
|
2231
|
+
(m(!0), g(R, null, z(e.config.options, (i) => (m(), V(G, {
|
|
2068
2232
|
key: i.value,
|
|
2069
2233
|
size: "xl",
|
|
2070
2234
|
variant: n(i.value) ? "primary" : "secondary",
|
|
2071
|
-
onClick: (u) =>
|
|
2235
|
+
onClick: (u) => a(i.value)
|
|
2072
2236
|
}, {
|
|
2073
2237
|
default: C(() => [
|
|
2074
2238
|
B(L(i.label), 1)
|
|
@@ -2080,7 +2244,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2080
2244
|
})
|
|
2081
2245
|
]));
|
|
2082
2246
|
}
|
|
2083
|
-
},
|
|
2247
|
+
}, ea = /* @__PURE__ */ ee(Qo, [["__scopeId", "data-v-0fcd0cce"]]), ta = { class: "spark-table-date-picker" }, sa = {
|
|
2084
2248
|
__name: "SparkTableDatePicker",
|
|
2085
2249
|
props: {
|
|
2086
2250
|
/** SparkTable instance object */
|
|
@@ -2096,33 +2260,33 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2096
2260
|
}
|
|
2097
2261
|
},
|
|
2098
2262
|
setup(e) {
|
|
2099
|
-
const s = e, t = E(null),
|
|
2263
|
+
const s = e, t = E(null), o = s.config.label || null, l = s.config.param || `filter[${s.config.key}]`, n = E(`${l}-0`);
|
|
2100
2264
|
return s.sparkTable.params[l] ? t.value = s.sparkTable.params[l] : s.config.initialValue ? (t.value = s.config.initialValue, s.sparkTable.methods.applyParams({
|
|
2101
2265
|
[l]: s.config.initialValue
|
|
2102
|
-
})) : t.value = null,
|
|
2103
|
-
|
|
2266
|
+
})) : t.value = null, N(t, (a) => {
|
|
2267
|
+
a ? s.sparkTable.methods.applyParams({
|
|
2104
2268
|
page: 1,
|
|
2105
|
-
[l]:
|
|
2269
|
+
[l]: a
|
|
2106
2270
|
}) : s.sparkTable.methods.removeParam(l);
|
|
2107
|
-
}),
|
|
2271
|
+
}), N(
|
|
2108
2272
|
() => s.sparkTable.params[l],
|
|
2109
|
-
(
|
|
2110
|
-
if ((
|
|
2273
|
+
(a) => {
|
|
2274
|
+
if ((a == null || a === "") && t.value) {
|
|
2111
2275
|
t.value = null;
|
|
2112
2276
|
const c = parseInt(n.value.split("-").pop()) || 0;
|
|
2113
2277
|
n.value = `${l}-${c + 1}`;
|
|
2114
|
-
} else
|
|
2278
|
+
} else a && a !== t.value && (t.value = a);
|
|
2115
2279
|
}
|
|
2116
|
-
), (
|
|
2280
|
+
), (a, c) => {
|
|
2117
2281
|
const r = A("FormKit");
|
|
2118
|
-
return m(), g("div",
|
|
2119
|
-
(m(),
|
|
2282
|
+
return m(), g("div", ta, [
|
|
2283
|
+
(m(), V(r, Z({
|
|
2120
2284
|
key: n.value,
|
|
2121
2285
|
modelValue: t.value,
|
|
2122
2286
|
"onUpdate:modelValue": c[0] || (c[0] = (i) => t.value = i),
|
|
2123
2287
|
type: "datepicker",
|
|
2124
2288
|
"picker-only": "",
|
|
2125
|
-
label:
|
|
2289
|
+
label: w(o),
|
|
2126
2290
|
placeholder: e.config.placeholder || "Select date",
|
|
2127
2291
|
overlay: !0,
|
|
2128
2292
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2133,7 +2297,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2133
2297
|
]);
|
|
2134
2298
|
};
|
|
2135
2299
|
}
|
|
2136
|
-
},
|
|
2300
|
+
}, oa = /* @__PURE__ */ ee(sa, [["__scopeId", "data-v-44ef9cb8"]]), aa = { class: "spark-table-reset" }, ra = { key: 1 }, na = {
|
|
2137
2301
|
__name: "SparkTableReset",
|
|
2138
2302
|
props: {
|
|
2139
2303
|
/** SparkTable instance object */
|
|
@@ -2149,57 +2313,57 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2149
2313
|
},
|
|
2150
2314
|
setup(e) {
|
|
2151
2315
|
const s = e, t = () => {
|
|
2152
|
-
const
|
|
2153
|
-
Object.entries(
|
|
2316
|
+
const o = s.sparkTable.plugins || {}, l = [], n = {};
|
|
2317
|
+
Object.entries(o).forEach(([i, u]) => {
|
|
2154
2318
|
if (!u || u.type === "reset" || !(typeof u.enabled == "function" ? u.enabled(s.sparkTable.params) : u.enabled))
|
|
2155
2319
|
return;
|
|
2156
|
-
let
|
|
2157
|
-
u.type === "search" ?
|
|
2320
|
+
let p = null;
|
|
2321
|
+
u.type === "search" ? p = u.param || "search" : u.type === "filterSelect" || u.type === "filterButtons" ? p = u.param || `filter[${u.key}]` : u.type === "datePicker" && (p = u.param || `filter[${u.key}]`), p && (u.initialValue !== void 0 && u.initialValue !== null ? n[p] = u.initialValue : l.push(p));
|
|
2158
2322
|
});
|
|
2159
|
-
const
|
|
2323
|
+
const a = l.filter(
|
|
2160
2324
|
(i) => s.sparkTable.params[i] !== void 0 && s.sparkTable.params[i] !== null && s.sparkTable.params[i] !== ""
|
|
2161
2325
|
), c = Object.entries(n).filter(
|
|
2162
2326
|
([i, u]) => s.sparkTable.params[i] !== u
|
|
2163
2327
|
);
|
|
2164
|
-
if (
|
|
2328
|
+
if (a.length === 0 && c.length === 0)
|
|
2165
2329
|
return;
|
|
2166
|
-
|
|
2330
|
+
a.forEach((i) => {
|
|
2167
2331
|
delete s.sparkTable.params[i];
|
|
2168
2332
|
});
|
|
2169
2333
|
const r = Object.fromEntries(c);
|
|
2170
2334
|
s.sparkTable.methods.applyParams({ ...r, page: 1 });
|
|
2171
2335
|
};
|
|
2172
|
-
return (
|
|
2336
|
+
return (o, l) => {
|
|
2173
2337
|
const n = A("font-awesome-icon");
|
|
2174
|
-
return m(), g("div",
|
|
2175
|
-
|
|
2338
|
+
return m(), g("div", aa, [
|
|
2339
|
+
b(G, {
|
|
2176
2340
|
onClick: t,
|
|
2177
2341
|
variant: "secondary",
|
|
2178
2342
|
size: "xl"
|
|
2179
2343
|
}, {
|
|
2180
2344
|
default: C(() => [
|
|
2181
|
-
e.config.icon ? (m(),
|
|
2345
|
+
e.config.icon ? (m(), V(n, {
|
|
2182
2346
|
key: 0,
|
|
2183
2347
|
icon: ["far", e.config.icon],
|
|
2184
|
-
class:
|
|
2185
|
-
}, null, 8, ["icon", "class"])) :
|
|
2186
|
-
e.config.label ? (m(), g("span",
|
|
2348
|
+
class: H({ "mr-1.5": e.config.label })
|
|
2349
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2350
|
+
e.config.label ? (m(), g("span", ra, L(e.config.label), 1)) : T("", !0)
|
|
2187
2351
|
]),
|
|
2188
2352
|
_: 1
|
|
2189
2353
|
})
|
|
2190
2354
|
]);
|
|
2191
2355
|
};
|
|
2192
2356
|
}
|
|
2193
|
-
},
|
|
2357
|
+
}, la = /* @__PURE__ */ ee(na, [["__scopeId", "data-v-45343158"]]), ia = { class: "spark-table" }, ca = {
|
|
2194
2358
|
key: 1,
|
|
2195
2359
|
class: "pt-5"
|
|
2196
|
-
},
|
|
2360
|
+
}, ua = { class: "flex items-center gap-x-3" }, ve = {
|
|
2197
2361
|
perPages: [15, 30, 50, 100, 200, 500],
|
|
2198
2362
|
limit: 15
|
|
2199
|
-
},
|
|
2363
|
+
}, da = {
|
|
2200
2364
|
page: 1,
|
|
2201
|
-
limit:
|
|
2202
|
-
},
|
|
2365
|
+
limit: ve.limit
|
|
2366
|
+
}, Me = {
|
|
2203
2367
|
colHeaders: !0,
|
|
2204
2368
|
filters: !1,
|
|
2205
2369
|
stretchH: "all",
|
|
@@ -2209,7 +2373,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2209
2373
|
tableClassName: "spark-table-table",
|
|
2210
2374
|
readOnlyCellClassName: "read-only",
|
|
2211
2375
|
licenseKey: "non-commercial-and-evaluation"
|
|
2212
|
-
},
|
|
2376
|
+
}, pn = {
|
|
2213
2377
|
__name: "SparkTable",
|
|
2214
2378
|
props: {
|
|
2215
2379
|
url: {
|
|
@@ -2221,7 +2385,7 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2221
2385
|
dataTransformer: {
|
|
2222
2386
|
type: Function,
|
|
2223
2387
|
default: (e, s) => ({
|
|
2224
|
-
data:
|
|
2388
|
+
data: Y(s.settings, "nestedHeaders") ? e.data.data.map((o) => (s.settings.columnKeys || []).map((n) => o[n])) : e.data.data,
|
|
2225
2389
|
meta: {
|
|
2226
2390
|
last_page: e.data.last_page,
|
|
2227
2391
|
from: e.data.from,
|
|
@@ -2233,19 +2397,19 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2233
2397
|
params: {
|
|
2234
2398
|
type: Object,
|
|
2235
2399
|
default() {
|
|
2236
|
-
return
|
|
2400
|
+
return da;
|
|
2237
2401
|
}
|
|
2238
2402
|
},
|
|
2239
2403
|
options: {
|
|
2240
2404
|
type: Object,
|
|
2241
2405
|
default() {
|
|
2242
|
-
return
|
|
2406
|
+
return ve;
|
|
2243
2407
|
}
|
|
2244
2408
|
},
|
|
2245
2409
|
settings: {
|
|
2246
2410
|
type: Object,
|
|
2247
2411
|
default() {
|
|
2248
|
-
return
|
|
2412
|
+
return Me;
|
|
2249
2413
|
}
|
|
2250
2414
|
},
|
|
2251
2415
|
plugins: {
|
|
@@ -2273,117 +2437,134 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2273
2437
|
"page-change"
|
|
2274
2438
|
],
|
|
2275
2439
|
setup(e, { expose: s, emit: t }) {
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
const l = t, n =
|
|
2440
|
+
const o = e;
|
|
2441
|
+
Ut(), de(Nt), de(It), de(Zt), Y(o, "settings.nestedHeaders") && de(qt);
|
|
2442
|
+
const l = t, n = Ve("axios"), a = E(null), c = E(!1), r = E(null);
|
|
2279
2443
|
let i = !1;
|
|
2280
2444
|
const u = {
|
|
2281
|
-
search:
|
|
2282
|
-
filterSelect:
|
|
2283
|
-
filterButtons:
|
|
2284
|
-
datePicker:
|
|
2285
|
-
reset:
|
|
2286
|
-
},
|
|
2445
|
+
search: Ko,
|
|
2446
|
+
filterSelect: Yo,
|
|
2447
|
+
filterButtons: ea,
|
|
2448
|
+
datePicker: oa,
|
|
2449
|
+
reset: la
|
|
2450
|
+
}, d = q({
|
|
2287
2451
|
hotInstance: null,
|
|
2288
|
-
url: S(() =>
|
|
2289
|
-
plugins:
|
|
2452
|
+
url: S(() => o.url),
|
|
2453
|
+
plugins: o.plugins,
|
|
2290
2454
|
response: {},
|
|
2291
2455
|
params: {
|
|
2292
2456
|
page: 1,
|
|
2293
|
-
limit:
|
|
2457
|
+
limit: o.options.limit
|
|
2294
2458
|
},
|
|
2295
2459
|
methods: {
|
|
2296
2460
|
applyParams: (h) => {
|
|
2297
|
-
h && (
|
|
2298
|
-
...
|
|
2461
|
+
h && (d.params = {
|
|
2462
|
+
...d.params,
|
|
2299
2463
|
...h
|
|
2300
|
-
}, l("page-change",
|
|
2464
|
+
}, l("page-change", d.params));
|
|
2301
2465
|
},
|
|
2302
2466
|
removeParam: async (h) => {
|
|
2303
|
-
|
|
2467
|
+
d.params[h] && (delete d.params[h], await d.methods.loadTable());
|
|
2304
2468
|
},
|
|
2305
2469
|
loadTable: async (h) => {
|
|
2306
|
-
if (!(!
|
|
2307
|
-
c.value = !0, r.value = null, l("loading", !0),
|
|
2470
|
+
if (!(!a.value || !a.value.hotInstance)) {
|
|
2471
|
+
c.value = !0, r.value = null, l("loading", !0), me.start(), d.hotInstance = a.value.hotInstance;
|
|
2308
2472
|
try {
|
|
2309
|
-
if (
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
} else if (
|
|
2313
|
-
const
|
|
2314
|
-
params:
|
|
2473
|
+
if (o.dataProvider) {
|
|
2474
|
+
const _ = await o.dataProvider(d.computed.params);
|
|
2475
|
+
d.response = o.dataTransformer(_, o);
|
|
2476
|
+
} else if (o.url) {
|
|
2477
|
+
const _ = await n.get(o.url, {
|
|
2478
|
+
params: d.computed.params
|
|
2315
2479
|
});
|
|
2316
|
-
|
|
2480
|
+
d.response = o.dataTransformer(_, o);
|
|
2317
2481
|
} else {
|
|
2318
|
-
console.error("No data provider or URL provided"), c.value = !1, l("loading", !1),
|
|
2482
|
+
console.error("No data provider or URL provided"), c.value = !1, l("loading", !1), me.done();
|
|
2319
2483
|
return;
|
|
2320
2484
|
}
|
|
2321
2485
|
if (i) return;
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2325
|
-
|
|
2486
|
+
d.hotInstance.updateData(d.response.data), d.options.callback && typeof d.options.callback == "function" && await d.options.callback();
|
|
2487
|
+
const x = d.hotInstance.getPlugin("autoColumnSize");
|
|
2488
|
+
Y(o.settings, "columns", []).forEach((_, v) => {
|
|
2489
|
+
_.width || x.calculateColumnsWidth(v, v, !0);
|
|
2326
2490
|
}), l("load", {
|
|
2327
|
-
data:
|
|
2328
|
-
meta:
|
|
2491
|
+
data: d.response.data,
|
|
2492
|
+
meta: d.response.meta
|
|
2329
2493
|
}), h && typeof h == "function" && h();
|
|
2330
|
-
} catch (
|
|
2331
|
-
r.value =
|
|
2494
|
+
} catch (x) {
|
|
2495
|
+
r.value = x, l("error", x), console.error("Error loading table data:", x);
|
|
2332
2496
|
} finally {
|
|
2333
|
-
c.value = !1, l("loading", !1),
|
|
2497
|
+
c.value = !1, l("loading", !1), me.done();
|
|
2334
2498
|
}
|
|
2335
2499
|
}
|
|
2336
2500
|
},
|
|
2337
2501
|
// can't use sparkTable.hotInstance here because the ref isn't ready
|
|
2338
|
-
colToProp: (h) =>
|
|
2339
|
-
fireEvent: (h,
|
|
2340
|
-
l(h,
|
|
2502
|
+
colToProp: (h) => a.value.hotInstance.colToProp(h),
|
|
2503
|
+
fireEvent: (h, x) => {
|
|
2504
|
+
l(h, x);
|
|
2341
2505
|
},
|
|
2342
|
-
getSettingsForProp: (h) =>
|
|
2506
|
+
getSettingsForProp: (h) => zt(Y(d.tableSettings, "columns"), { data: h }),
|
|
2343
2507
|
// Helper methods for easier param access
|
|
2344
|
-
getParams: () =>
|
|
2345
|
-
getParam: (h) =>
|
|
2346
|
-
setParam: (h,
|
|
2347
|
-
|
|
2508
|
+
getParams: () => d.computed.params,
|
|
2509
|
+
getParam: (h) => d.computed.params[h],
|
|
2510
|
+
setParam: (h, x) => {
|
|
2511
|
+
d.methods.applyParams({ [h]: x });
|
|
2348
2512
|
},
|
|
2349
|
-
clearParam: (h) =>
|
|
2513
|
+
clearParam: (h) => d.methods.removeParam(h),
|
|
2350
2514
|
clearParams: (h) => {
|
|
2351
|
-
(Array.isArray(h) ? h : [h]).forEach((
|
|
2352
|
-
|
|
2353
|
-
}),
|
|
2515
|
+
(Array.isArray(h) ? h : [h]).forEach((P) => {
|
|
2516
|
+
d.params[P] !== void 0 && delete d.params[P];
|
|
2517
|
+
}), d.methods.applyParams({ page: 1 });
|
|
2354
2518
|
}
|
|
2355
2519
|
},
|
|
2356
2520
|
computed: {
|
|
2357
2521
|
params: S(() => ({
|
|
2358
|
-
...
|
|
2359
|
-
...
|
|
2522
|
+
...o.params,
|
|
2523
|
+
...d.params
|
|
2360
2524
|
})),
|
|
2361
|
-
ready: S(() =>
|
|
2525
|
+
ready: S(() => Dt(d, "response.meta.last_page"))
|
|
2362
2526
|
},
|
|
2363
2527
|
options: S(() => ({
|
|
2364
|
-
...
|
|
2365
|
-
...
|
|
2528
|
+
...ve,
|
|
2529
|
+
...o.options
|
|
2366
2530
|
})),
|
|
2367
2531
|
tableSettings: S(() => ({
|
|
2368
|
-
|
|
2369
|
-
nestedHeaders:
|
|
2370
|
-
...!
|
|
2371
|
-
afterGetColHeader: (h,
|
|
2532
|
+
...Me,
|
|
2533
|
+
nestedHeaders: Y(o.settings, "nestedHeaders", []),
|
|
2534
|
+
...!Y(o.settings, "nestedHeaders") && {
|
|
2535
|
+
afterGetColHeader: (h, x) => ro(h, x, d)
|
|
2372
2536
|
},
|
|
2373
|
-
afterChange: (h,
|
|
2374
|
-
afterRender: () =>
|
|
2537
|
+
afterChange: (h, x) => Lo(),
|
|
2538
|
+
afterRender: () => no(d),
|
|
2375
2539
|
/**
|
|
2376
2540
|
* Prevent columns with explicit width from being stretched
|
|
2377
2541
|
* This hook fires BEFORE stretchH is applied, allowing us to cap specific columns
|
|
2378
2542
|
* while letting others stretch normally
|
|
2379
2543
|
*/
|
|
2380
|
-
beforeStretchingColumnWidth: (h,
|
|
2381
|
-
const
|
|
2382
|
-
return
|
|
2544
|
+
beforeStretchingColumnWidth: (h, x) => {
|
|
2545
|
+
const _ = Y(o.settings, "columns", [])[x];
|
|
2546
|
+
return _ && _.width !== void 0 ? _.width : h;
|
|
2383
2547
|
},
|
|
2384
|
-
|
|
2548
|
+
/**
|
|
2549
|
+
* Copy displayed cell content instead of raw data values
|
|
2550
|
+
* This ensures custom renderers copy their visual output, not the underlying data
|
|
2551
|
+
*/
|
|
2552
|
+
beforeCopy: (h, x) => {
|
|
2553
|
+
const P = a.value?.hotInstance;
|
|
2554
|
+
P && x.forEach((_) => {
|
|
2555
|
+
for (let v = _.startRow; v <= _.endRow; v++)
|
|
2556
|
+
for (let $ = _.startCol; $ <= _.endCol; $++) {
|
|
2557
|
+
const M = P.getCell(v, $);
|
|
2558
|
+
if (M) {
|
|
2559
|
+
const D = v - x[0].startRow, W = $ - x[0].startCol;
|
|
2560
|
+
h[D][W] = M.dataset.copyValue ?? M.textContent ?? "";
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
});
|
|
2564
|
+
},
|
|
2565
|
+
...o.settings
|
|
2385
2566
|
}))
|
|
2386
|
-
}),
|
|
2567
|
+
}), p = (h) => {
|
|
2387
2568
|
if (!h) return null;
|
|
2388
2569
|
switch (h.type) {
|
|
2389
2570
|
case "search":
|
|
@@ -2395,116 +2576,116 @@ const da = /* @__PURE__ */ new Map(), Y = (e, s) => {
|
|
|
2395
2576
|
default:
|
|
2396
2577
|
return null;
|
|
2397
2578
|
}
|
|
2398
|
-
}, y = (h) => h ? typeof h.enabled == "function" ? h.enabled(
|
|
2399
|
-
if (
|
|
2400
|
-
() => ({ ...
|
|
2579
|
+
}, 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 })));
|
|
2580
|
+
if (N(
|
|
2581
|
+
() => ({ ...d.params }),
|
|
2401
2582
|
() => {
|
|
2402
2583
|
const h = [];
|
|
2403
|
-
Object.values(
|
|
2404
|
-
const
|
|
2405
|
-
if (!
|
|
2406
|
-
const
|
|
2407
|
-
!
|
|
2408
|
-
}), h.length > 0 && h.forEach((
|
|
2409
|
-
delete
|
|
2584
|
+
Object.values(o.plugins).forEach((x) => {
|
|
2585
|
+
const P = p(x);
|
|
2586
|
+
if (!P) return;
|
|
2587
|
+
const _ = y(x), v = d.params[P] !== void 0;
|
|
2588
|
+
!_ && v && h.push(P);
|
|
2589
|
+
}), h.length > 0 && h.forEach((x) => {
|
|
2590
|
+
delete d.params[x];
|
|
2410
2591
|
});
|
|
2411
2592
|
},
|
|
2412
2593
|
{ deep: !0, flush: "sync" }
|
|
2413
|
-
),
|
|
2414
|
-
const h = typeof
|
|
2415
|
-
|
|
2416
|
-
namespace: h ?
|
|
2417
|
-
syncToRoute: !!
|
|
2418
|
-
persistToStorage:
|
|
2594
|
+
), o.syncToRoute || o.persistToStorage) {
|
|
2595
|
+
const h = typeof o.syncToRoute == "string";
|
|
2596
|
+
Po(d, {
|
|
2597
|
+
namespace: h ? o.syncToRoute : null,
|
|
2598
|
+
syncToRoute: !!o.syncToRoute,
|
|
2599
|
+
persistToStorage: o.persistToStorage
|
|
2419
2600
|
});
|
|
2420
2601
|
}
|
|
2421
|
-
return
|
|
2422
|
-
() =>
|
|
2602
|
+
return we(
|
|
2603
|
+
() => o.params,
|
|
2423
2604
|
async () => {
|
|
2424
|
-
|
|
2605
|
+
d.params.page = 1, await d.methods.loadTable();
|
|
2425
2606
|
},
|
|
2426
2607
|
{ debounce: 50, maxWait: 1e3 }
|
|
2427
|
-
),
|
|
2428
|
-
() =>
|
|
2608
|
+
), we(
|
|
2609
|
+
() => d.params,
|
|
2429
2610
|
async () => {
|
|
2430
|
-
await
|
|
2611
|
+
await d.methods.loadTable();
|
|
2431
2612
|
},
|
|
2432
2613
|
{ debounce: 50, maxWait: 1e3 }
|
|
2433
|
-
),
|
|
2434
|
-
() =>
|
|
2435
|
-
async (h,
|
|
2436
|
-
h !==
|
|
2614
|
+
), N(
|
|
2615
|
+
() => o.url,
|
|
2616
|
+
async (h, x) => {
|
|
2617
|
+
h !== x && (d.params.page = 1, await d.methods.loadTable());
|
|
2437
2618
|
}
|
|
2438
|
-
),
|
|
2439
|
-
await
|
|
2440
|
-
}),
|
|
2619
|
+
), be(async () => {
|
|
2620
|
+
await d.methods.loadTable(), l("ready");
|
|
2621
|
+
}), Ye(() => {
|
|
2441
2622
|
i = !0;
|
|
2442
|
-
}),
|
|
2443
|
-
refresh: () =>
|
|
2444
|
-
getParams: () =>
|
|
2445
|
-
getParam: (h) =>
|
|
2446
|
-
setParam: (h,
|
|
2447
|
-
clearParam: (h) =>
|
|
2448
|
-
clearParams: (h) =>
|
|
2449
|
-
applyParams: (h) =>
|
|
2623
|
+
}), To(d), s({
|
|
2624
|
+
refresh: () => d.methods.loadTable(),
|
|
2625
|
+
getParams: () => d.methods.getParams(),
|
|
2626
|
+
getParam: (h) => d.methods.getParam(h),
|
|
2627
|
+
setParam: (h, x) => d.methods.setParam(h, x),
|
|
2628
|
+
clearParam: (h) => d.methods.clearParam(h),
|
|
2629
|
+
clearParams: (h) => d.methods.clearParams(h),
|
|
2630
|
+
applyParams: (h) => d.methods.applyParams(h),
|
|
2450
2631
|
loading: c,
|
|
2451
2632
|
error: r,
|
|
2452
|
-
sparkTable:
|
|
2453
|
-
table:
|
|
2454
|
-
}), (h,
|
|
2455
|
-
|
|
2633
|
+
sparkTable: d,
|
|
2634
|
+
table: a
|
|
2635
|
+
}), (h, x) => (m(), g("div", ia, [
|
|
2636
|
+
d.computed.ready && k.value && k.value.length ? (m(), V(Pe, {
|
|
2456
2637
|
key: 0,
|
|
2457
2638
|
position: "header"
|
|
2458
2639
|
}, {
|
|
2459
2640
|
default: C(() => [
|
|
2460
|
-
(m(!0), g(R, null, z(k.value, (
|
|
2461
|
-
key:
|
|
2462
|
-
class: P
|
|
2463
|
-
"spark-table":
|
|
2464
|
-
config:
|
|
2641
|
+
(m(!0), g(R, null, z(k.value, (P) => (m(), V(I(u[P.config.type]), {
|
|
2642
|
+
key: P.name,
|
|
2643
|
+
class: H(P.config.align ? `self-${P.config.align}` : ""),
|
|
2644
|
+
"spark-table": d,
|
|
2645
|
+
config: P.config
|
|
2465
2646
|
}, null, 8, ["class", "spark-table", "config"]))), 128)),
|
|
2466
2647
|
O(h.$slots, "header", {
|
|
2467
|
-
sparkTable:
|
|
2648
|
+
sparkTable: d,
|
|
2468
2649
|
loading: c.value,
|
|
2469
2650
|
error: r.value
|
|
2470
2651
|
})
|
|
2471
2652
|
]),
|
|
2472
2653
|
_: 3
|
|
2473
|
-
})) : (m(), g("div",
|
|
2474
|
-
|
|
2654
|
+
})) : (m(), g("div", ca)),
|
|
2655
|
+
b(w(jt), {
|
|
2475
2656
|
"theme-name": "ht-theme-classic",
|
|
2476
2657
|
ref_key: "table",
|
|
2477
|
-
ref:
|
|
2478
|
-
settings:
|
|
2658
|
+
ref: a,
|
|
2659
|
+
settings: d.tableSettings
|
|
2479
2660
|
}, null, 8, ["settings"]),
|
|
2480
|
-
|
|
2661
|
+
d.computed.ready ? (m(), V(Pe, {
|
|
2481
2662
|
key: 2,
|
|
2482
2663
|
position: "footer"
|
|
2483
2664
|
}, {
|
|
2484
2665
|
default: C(() => [
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
"spark-table":
|
|
2489
|
-
onPaginate:
|
|
2666
|
+
b(Ao, { "spark-table": d }, null, 8, ["spark-table"]),
|
|
2667
|
+
f("div", ua, [
|
|
2668
|
+
b(jo, {
|
|
2669
|
+
"spark-table": d,
|
|
2670
|
+
onPaginate: d.methods.applyParams
|
|
2490
2671
|
}, null, 8, ["spark-table", "onPaginate"]),
|
|
2491
|
-
|
|
2492
|
-
"spark-table":
|
|
2493
|
-
onPaginate:
|
|
2672
|
+
b(Zo, {
|
|
2673
|
+
"spark-table": d,
|
|
2674
|
+
onPaginate: d.methods.applyParams
|
|
2494
2675
|
}, null, 8, ["spark-table", "onPaginate"]),
|
|
2495
2676
|
O(h.$slots, "footer", {
|
|
2496
|
-
sparkTable:
|
|
2677
|
+
sparkTable: d,
|
|
2497
2678
|
loading: c.value,
|
|
2498
2679
|
error: r.value
|
|
2499
2680
|
})
|
|
2500
2681
|
])
|
|
2501
2682
|
]),
|
|
2502
2683
|
_: 3
|
|
2503
|
-
})) :
|
|
2684
|
+
})) : T("", !0)
|
|
2504
2685
|
]));
|
|
2505
2686
|
}
|
|
2506
2687
|
};
|
|
2507
|
-
function
|
|
2688
|
+
function He() {
|
|
2508
2689
|
const e = q({
|
|
2509
2690
|
isVisible: !1,
|
|
2510
2691
|
content: null,
|
|
@@ -2515,41 +2696,41 @@ function Te() {
|
|
|
2515
2696
|
e.isVisible = !e.isVisible;
|
|
2516
2697
|
}, t = () => {
|
|
2517
2698
|
e.isVisible = !1, e.content = null, e.props = {}, e.eventHandlers = {}, e.size = "md";
|
|
2518
|
-
},
|
|
2699
|
+
}, o = () => {
|
|
2519
2700
|
e.isVisible = !0;
|
|
2520
|
-
}, l = (
|
|
2521
|
-
e.content =
|
|
2701
|
+
}, l = (a, c = {}, r = {}, i = {}) => {
|
|
2702
|
+
e.content = fe(a), e.props = c, e.eventHandlers = r, e.size = i.size || "md";
|
|
2522
2703
|
};
|
|
2523
2704
|
return {
|
|
2524
2705
|
state: e,
|
|
2525
2706
|
toggle: s,
|
|
2526
2707
|
close: t,
|
|
2527
|
-
open:
|
|
2708
|
+
open: o,
|
|
2528
2709
|
setContent: l,
|
|
2529
|
-
show: (
|
|
2530
|
-
|
|
2710
|
+
show: (a, c = {}, r = {}, i = {}) => {
|
|
2711
|
+
a && l(a, c, r, i), o();
|
|
2531
2712
|
}
|
|
2532
2713
|
};
|
|
2533
2714
|
}
|
|
2534
|
-
class
|
|
2715
|
+
class pa {
|
|
2535
2716
|
constructor() {
|
|
2536
|
-
this.left =
|
|
2717
|
+
this.left = He(), this.right = He();
|
|
2537
2718
|
}
|
|
2538
|
-
showLeft = (s, t = {},
|
|
2719
|
+
showLeft = (s, t = {}, o = {}, l = {}) => {
|
|
2539
2720
|
const n = {
|
|
2540
2721
|
close: () => {
|
|
2541
|
-
|
|
2722
|
+
o.close?.(), this.closeLeft();
|
|
2542
2723
|
},
|
|
2543
|
-
...
|
|
2724
|
+
...o
|
|
2544
2725
|
};
|
|
2545
2726
|
this.left.show(s, t, n, l);
|
|
2546
2727
|
};
|
|
2547
|
-
showRight = (s, t = {},
|
|
2728
|
+
showRight = (s, t = {}, o = {}, l = {}) => {
|
|
2548
2729
|
const n = {
|
|
2549
2730
|
close: () => {
|
|
2550
|
-
|
|
2731
|
+
o.close?.(), this.closeRight();
|
|
2551
2732
|
},
|
|
2552
|
-
...
|
|
2733
|
+
...o
|
|
2553
2734
|
};
|
|
2554
2735
|
this.right.show(s, t, n, l);
|
|
2555
2736
|
};
|
|
@@ -2563,22 +2744,22 @@ class Xa {
|
|
|
2563
2744
|
this.left.close(), this.right.close();
|
|
2564
2745
|
};
|
|
2565
2746
|
}
|
|
2566
|
-
const
|
|
2747
|
+
const te = new pa(), fa = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, ma = { class: "flex flex-1 flex-col" }, ha = {
|
|
2567
2748
|
class: "flex flex-1 flex-col gap-y-7",
|
|
2568
2749
|
role: "list"
|
|
2569
|
-
},
|
|
2750
|
+
}, ga = { class: "flex flex-1 flex-col" }, ya = {
|
|
2570
2751
|
role: "list",
|
|
2571
2752
|
class: "flex flex-1 flex-col"
|
|
2572
|
-
},
|
|
2753
|
+
}, va = { class: "flex items-center pb-8" }, ba = ["href", "onClick"], xa = {
|
|
2573
2754
|
key: 2,
|
|
2574
2755
|
class: "w-full flex justify-center"
|
|
2575
|
-
},
|
|
2756
|
+
}, ka = {
|
|
2576
2757
|
key: 0,
|
|
2577
2758
|
class: "mt-[5px] flex flex-col gap-[5px]"
|
|
2578
|
-
},
|
|
2759
|
+
}, wa = ["href", "onClick"], _a = {
|
|
2579
2760
|
key: 1,
|
|
2580
2761
|
class: "text-[13px]"
|
|
2581
|
-
},
|
|
2762
|
+
}, Sa = { class: "mt-auto" }, Ca = { class: "p-[10px] flex-shrink-0" }, $a = { class: "flex flex-1 items-center gap-x-6" }, Ta = { class: "relative flex flex-1 items-center gap-4" }, La = { class: "cursor-pointer" }, Pa = ["src"], Ma = { class: "ml-auto" }, Ha = { class: "mr-[10px] pb-[10px] flex-1 flex flex-col" }, fn = {
|
|
2582
2763
|
__name: "SparkDefaultContainer",
|
|
2583
2764
|
props: {
|
|
2584
2765
|
appStore: {
|
|
@@ -2596,113 +2777,113 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2596
2777
|
},
|
|
2597
2778
|
emits: ["overlayClose"],
|
|
2598
2779
|
setup(e, { emit: s }) {
|
|
2599
|
-
const t = e,
|
|
2780
|
+
const t = e, o = s, l = Be(), n = ne(), a = Ie(), c = De(), r = S(() => c.getAppIcon(t.appStore.state.app)), i = S(() => n.meta.hideBrandSelector === !0 ? !1 : t.appStore.state.showBrandSelector), u = () => {
|
|
2600
2781
|
const k = {};
|
|
2601
|
-
l["app-selector-bottom"] ? k.bottomSlot = () =>
|
|
2782
|
+
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
2783
|
select: (h) => {
|
|
2603
|
-
|
|
2784
|
+
te.closeRight();
|
|
2604
2785
|
}
|
|
2605
2786
|
});
|
|
2606
|
-
},
|
|
2607
|
-
|
|
2608
|
-
|
|
2787
|
+
}, d = () => {
|
|
2788
|
+
te.showLeft(
|
|
2789
|
+
js,
|
|
2609
2790
|
{},
|
|
2610
2791
|
{
|
|
2611
2792
|
select: (k) => {
|
|
2612
|
-
|
|
2793
|
+
a.toggleBrand(k), te.closeLeft();
|
|
2613
2794
|
}
|
|
2614
2795
|
}
|
|
2615
2796
|
);
|
|
2616
|
-
},
|
|
2797
|
+
}, p = 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
2798
|
return (k, h) => {
|
|
2618
|
-
const
|
|
2799
|
+
const x = A("font-awesome-icon"), P = A("router-view");
|
|
2619
2800
|
return m(), g(R, null, [
|
|
2620
|
-
|
|
2621
|
-
class:
|
|
2801
|
+
f("div", {
|
|
2802
|
+
class: H([p.value, "fixed inset-y-0 flex transition-all z-100"])
|
|
2622
2803
|
}, [
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2804
|
+
f("div", fa, [
|
|
2805
|
+
f("nav", ma, [
|
|
2806
|
+
f("ul", ha, [
|
|
2807
|
+
f("li", ga, [
|
|
2808
|
+
f("ul", ya, [
|
|
2809
|
+
f("li", va, [
|
|
2810
|
+
f("a", {
|
|
2630
2811
|
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] =
|
|
2812
|
+
onClick: h[0] || (h[0] = Q((_) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"]))
|
|
2632
2813
|
}, [
|
|
2633
|
-
|
|
2634
|
-
icon:
|
|
2814
|
+
b(x, {
|
|
2815
|
+
icon: w(F)[r.value],
|
|
2635
2816
|
class: "size-5"
|
|
2636
2817
|
}, null, 8, ["icon"])
|
|
2637
2818
|
]),
|
|
2638
|
-
e.mainNavStore.state.collapsed ?
|
|
2819
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (m(), g("a", {
|
|
2639
2820
|
key: 0,
|
|
2640
|
-
onClick: h[1] || (h[1] =
|
|
2821
|
+
onClick: h[1] || (h[1] = Q((_) => e.mainNavStore.goto(e.appStore.state.homeRoute), ["prevent"])),
|
|
2641
2822
|
class: "font-medium text-gray-800 ml-[10px] cursor-pointer"
|
|
2642
2823
|
}, L(e.appStore.state.app), 1))
|
|
2643
2824
|
]),
|
|
2644
|
-
(m(!0), g(R, null, z(e.mainNavStore.state.menu, (
|
|
2645
|
-
key:
|
|
2646
|
-
class:
|
|
2647
|
-
"mt-[10px]":
|
|
2648
|
-
"mt-auto":
|
|
2825
|
+
(m(!0), g(R, null, z(e.mainNavStore.state.menu, (_) => (m(), g("li", {
|
|
2826
|
+
key: _.name,
|
|
2827
|
+
class: H({
|
|
2828
|
+
"mt-[10px]": _.children,
|
|
2829
|
+
"mt-auto": _.footerSection
|
|
2649
2830
|
})
|
|
2650
2831
|
}, [
|
|
2651
|
-
|
|
2652
|
-
class:
|
|
2653
|
-
"bg-gray-100":
|
|
2654
|
-
"hover:bg-gray-100":
|
|
2832
|
+
f("a", {
|
|
2833
|
+
class: H([{
|
|
2834
|
+
"bg-gray-100": _.current,
|
|
2835
|
+
"hover:bg-gray-100": _?.href
|
|
2655
2836
|
}, "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
|
-
href:
|
|
2657
|
-
onClick:
|
|
2837
|
+
href: _?.href,
|
|
2838
|
+
onClick: Q((v) => e.mainNavStore.goto(_.href), ["prevent"])
|
|
2658
2839
|
}, [
|
|
2659
|
-
|
|
2840
|
+
_.icon ? (m(), V(x, {
|
|
2660
2841
|
key: 0,
|
|
2661
|
-
icon:
|
|
2662
|
-
class:
|
|
2663
|
-
}, null, 8, ["icon", "class"])) :
|
|
2664
|
-
e.mainNavStore.state.collapsed ?
|
|
2665
|
-
|
|
2666
|
-
])])) :
|
|
2842
|
+
icon: w(F)[_.icon],
|
|
2843
|
+
class: H([[(_.current, "text-gray-400")], "size-4"])
|
|
2844
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2845
|
+
e.mainNavStore.state.collapsed ? _?.children ? (m(), g("div", xa, [...h[6] || (h[6] = [
|
|
2846
|
+
f("div", { class: "w-[10px] h-px bg-gray-400" }, null, -1)
|
|
2847
|
+
])])) : T("", !0) : (m(), g("span", {
|
|
2667
2848
|
key: 1,
|
|
2668
|
-
class:
|
|
2669
|
-
"text-[11px]":
|
|
2670
|
-
"text-[13px]": !
|
|
2671
|
-
"font-semibold":
|
|
2672
|
-
"text-gray-500":
|
|
2849
|
+
class: H({
|
|
2850
|
+
"text-[11px]": _?.children,
|
|
2851
|
+
"text-[13px]": !_?.children,
|
|
2852
|
+
"font-semibold": _?.children,
|
|
2853
|
+
"text-gray-500": _?.children
|
|
2673
2854
|
})
|
|
2674
|
-
}, L(
|
|
2675
|
-
], 10,
|
|
2676
|
-
|
|
2677
|
-
(m(!0), g(R, null, z(
|
|
2678
|
-
key:
|
|
2855
|
+
}, L(_.name), 3))
|
|
2856
|
+
], 10, ba),
|
|
2857
|
+
_.children ? (m(), g("ul", ka, [
|
|
2858
|
+
(m(!0), g(R, null, z(_.children, (v) => (m(), g("li", {
|
|
2859
|
+
key: v.name
|
|
2679
2860
|
}, [
|
|
2680
|
-
|
|
2681
|
-
class:
|
|
2682
|
-
href:
|
|
2683
|
-
onClick:
|
|
2861
|
+
f("a", {
|
|
2862
|
+
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"]),
|
|
2863
|
+
href: v.href,
|
|
2864
|
+
onClick: Q(($) => e.mainNavStore.goto(v.href), ["prevent"])
|
|
2684
2865
|
}, [
|
|
2685
|
-
|
|
2866
|
+
v.icon ? (m(), V(x, {
|
|
2686
2867
|
key: 0,
|
|
2687
|
-
icon:
|
|
2688
|
-
class:
|
|
2689
|
-
}, null, 8, ["icon", "class"])) :
|
|
2690
|
-
e.mainNavStore.state.collapsed ?
|
|
2691
|
-
], 10,
|
|
2868
|
+
icon: w(F)[v.icon],
|
|
2869
|
+
class: H([[(v.current, "text-gray-400")], "size-4"])
|
|
2870
|
+
}, null, 8, ["icon", "class"])) : T("", !0),
|
|
2871
|
+
e.mainNavStore.state.collapsed ? T("", !0) : (m(), g("span", _a, L(v.name), 1))
|
|
2872
|
+
], 10, wa)
|
|
2692
2873
|
]))), 128))
|
|
2693
|
-
])) :
|
|
2874
|
+
])) : T("", !0)
|
|
2694
2875
|
], 2))), 128))
|
|
2695
2876
|
])
|
|
2696
2877
|
]),
|
|
2697
|
-
|
|
2878
|
+
f("li", Sa, [
|
|
2698
2879
|
O(k.$slots, "sidebar-footer"),
|
|
2699
|
-
|
|
2880
|
+
f("a", {
|
|
2700
2881
|
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
2882
|
href: "#",
|
|
2702
|
-
onClick: h[2] || (h[2] =
|
|
2883
|
+
onClick: h[2] || (h[2] = Q((_) => e.mainNavStore.toggleCollapsed(), ["prevent"]))
|
|
2703
2884
|
}, [
|
|
2704
|
-
|
|
2705
|
-
icon:
|
|
2885
|
+
b(x, {
|
|
2886
|
+
icon: w(F)[e.mainNavStore.state.collapsed ? "farArrowRightToLine" : "farArrowLeftToLine"],
|
|
2706
2887
|
class: "class-5"
|
|
2707
2888
|
}, null, 8, ["icon"])
|
|
2708
2889
|
])
|
|
@@ -2711,18 +2892,18 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2711
2892
|
])
|
|
2712
2893
|
])
|
|
2713
2894
|
], 2),
|
|
2714
|
-
|
|
2715
|
-
class:
|
|
2895
|
+
f("div", {
|
|
2896
|
+
class: H([y.value, "h-full transition-all flex flex-col"])
|
|
2716
2897
|
}, [
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2898
|
+
f("div", Ca, [
|
|
2899
|
+
f("div", $a, [
|
|
2900
|
+
f("div", Ta, [
|
|
2720
2901
|
O(k.$slots, "header-left", {}, () => [
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
icon:
|
|
2902
|
+
f("div", La, [
|
|
2903
|
+
b(x, {
|
|
2904
|
+
icon: w(F).farBarsSort,
|
|
2724
2905
|
class: "size-5",
|
|
2725
|
-
onClick: h[3] || (h[3] = (
|
|
2906
|
+
onClick: h[3] || (h[3] = (_) => e.mainNavStore.toggleHidden())
|
|
2726
2907
|
}, null, 8, ["icon"])
|
|
2727
2908
|
])
|
|
2728
2909
|
]),
|
|
@@ -2730,17 +2911,17 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2730
2911
|
i.value ? (m(), g("div", {
|
|
2731
2912
|
key: 0,
|
|
2732
2913
|
class: "absolute left-1/2 -translate-x-1/2 cursor-pointer h-9 flex items-center",
|
|
2733
|
-
onClick:
|
|
2914
|
+
onClick: d
|
|
2734
2915
|
}, [
|
|
2735
|
-
|
|
2916
|
+
w(a).currentBrand ? (m(), g("img", {
|
|
2736
2917
|
key: 0,
|
|
2737
|
-
src:
|
|
2918
|
+
src: w(a).currentBrand.logo,
|
|
2738
2919
|
alt: "",
|
|
2739
2920
|
class: "h-[30px] w-auto"
|
|
2740
|
-
}, null, 8,
|
|
2741
|
-
])) :
|
|
2921
|
+
}, null, 8, Pa)) : T("", !0)
|
|
2922
|
+
])) : T("", !0)
|
|
2742
2923
|
]),
|
|
2743
|
-
|
|
2924
|
+
f("div", Ma, [
|
|
2744
2925
|
O(k.$slots, "header-right", {}, () => [
|
|
2745
2926
|
e.appStore.state.showAppSelector ? (m(), g("button", {
|
|
2746
2927
|
key: 0,
|
|
@@ -2748,72 +2929,72 @@ const ee = new Xa(), Ja = { class: "flex grow m-2.5 p-[10px] rounded-lg" }, Qa =
|
|
|
2748
2929
|
type: "button",
|
|
2749
2930
|
onClick: u
|
|
2750
2931
|
}, [
|
|
2751
|
-
|
|
2752
|
-
icon:
|
|
2932
|
+
b(x, {
|
|
2933
|
+
icon: w(F).farGripDotsVertical,
|
|
2753
2934
|
class: "size-4 text-gray-400"
|
|
2754
2935
|
}, null, 8, ["icon"])
|
|
2755
|
-
])) :
|
|
2936
|
+
])) : T("", !0)
|
|
2756
2937
|
])
|
|
2757
2938
|
])
|
|
2758
2939
|
])
|
|
2759
2940
|
])
|
|
2760
2941
|
]),
|
|
2761
|
-
|
|
2762
|
-
|
|
2942
|
+
f("main", Ha, [
|
|
2943
|
+
b(P)
|
|
2763
2944
|
])
|
|
2764
2945
|
], 2),
|
|
2765
|
-
|
|
2946
|
+
b(w(Se), {
|
|
2766
2947
|
position: "left",
|
|
2767
|
-
"overlay-instance":
|
|
2768
|
-
onClose: h[4] || (h[4] = (
|
|
2948
|
+
"overlay-instance": w(te).left,
|
|
2949
|
+
onClose: h[4] || (h[4] = (_) => o("overlayClose", "left"))
|
|
2769
2950
|
}, null, 8, ["overlay-instance"]),
|
|
2770
|
-
|
|
2951
|
+
b(w(Se), {
|
|
2771
2952
|
position: "right",
|
|
2772
|
-
"overlay-instance":
|
|
2773
|
-
onClose: h[5] || (h[5] = (
|
|
2953
|
+
"overlay-instance": w(te).right,
|
|
2954
|
+
onClose: h[5] || (h[5] = (_) => o("overlayClose", "right"))
|
|
2774
2955
|
}, null, 8, ["overlay-instance"]),
|
|
2775
|
-
|
|
2956
|
+
b(w(Qs))
|
|
2776
2957
|
], 64);
|
|
2777
2958
|
};
|
|
2778
2959
|
}
|
|
2779
|
-
},
|
|
2780
|
-
function
|
|
2960
|
+
}, Va = {}, Ra = { class: "h-full" };
|
|
2961
|
+
function Ba(e, s) {
|
|
2781
2962
|
const t = A("router-view");
|
|
2782
|
-
return m(), g("main",
|
|
2783
|
-
|
|
2963
|
+
return m(), g("main", Ra, [
|
|
2964
|
+
b(t)
|
|
2784
2965
|
]);
|
|
2785
2966
|
}
|
|
2786
|
-
const
|
|
2967
|
+
const mn = /* @__PURE__ */ ee(Va, [["render", Ba]]), Ea = (e) => {
|
|
2787
2968
|
const s = document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));
|
|
2788
2969
|
return s ? s[2] : null;
|
|
2789
|
-
},
|
|
2970
|
+
}, Aa = (e, s, t = {}) => {
|
|
2790
2971
|
const {
|
|
2791
|
-
maxAge:
|
|
2972
|
+
maxAge: o = 31536e3,
|
|
2792
2973
|
// 365 days in seconds
|
|
2793
|
-
domain: l =
|
|
2974
|
+
domain: l = Ze(),
|
|
2794
2975
|
secure: n = !0,
|
|
2795
|
-
sameSite:
|
|
2976
|
+
sameSite: a = "Lax",
|
|
2796
2977
|
path: c = "/"
|
|
2797
2978
|
} = t;
|
|
2798
|
-
let r = `${e}=${s}; max-age=${
|
|
2979
|
+
let r = `${e}=${s}; max-age=${o}; path=${c}; samesite=${a}`;
|
|
2799
2980
|
l && (r += `; domain=${l}`), n && (r += "; secure"), document.cookie = r;
|
|
2800
|
-
},
|
|
2801
|
-
const { domain: t =
|
|
2802
|
-
let l = `${e}=; max-age=0; path=${
|
|
2981
|
+
}, Fa = (e, s = {}) => {
|
|
2982
|
+
const { domain: t = Ze(), path: o = "/" } = s;
|
|
2983
|
+
let l = `${e}=; max-age=0; path=${o}`;
|
|
2803
2984
|
t && (l += `; domain=${t}`), document.cookie = l;
|
|
2804
|
-
},
|
|
2985
|
+
}, Ze = () => {
|
|
2805
2986
|
const e = window.location.hostname;
|
|
2806
2987
|
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
|
-
|
|
2988
|
+
}, qe = [];
|
|
2989
|
+
function Oa(e) {
|
|
2990
|
+
qe.push(e);
|
|
2810
2991
|
}
|
|
2811
|
-
function
|
|
2812
|
-
|
|
2992
|
+
function za() {
|
|
2993
|
+
qe.forEach((e) => e());
|
|
2813
2994
|
}
|
|
2814
|
-
function
|
|
2995
|
+
function hn(e) {
|
|
2815
2996
|
let s = !1;
|
|
2816
|
-
return
|
|
2997
|
+
return Oa(() => {
|
|
2817
2998
|
s = !1;
|
|
2818
2999
|
}), {
|
|
2819
3000
|
bootstrapApp: async () => {
|
|
@@ -2826,7 +3007,7 @@ function en(e) {
|
|
|
2826
3007
|
}
|
|
2827
3008
|
};
|
|
2828
3009
|
}
|
|
2829
|
-
const
|
|
3010
|
+
const ye = "bolt-next-token", K = ue("auth", () => {
|
|
2830
3011
|
const e = q({
|
|
2831
3012
|
user: null,
|
|
2832
3013
|
token: null,
|
|
@@ -2862,15 +3043,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2862
3043
|
}), s = (i = {}) => {
|
|
2863
3044
|
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
3045
|
}, t = (i) => {
|
|
2865
|
-
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2868
|
-
}, l = () =>
|
|
2869
|
-
const u = await
|
|
2870
|
-
return t(
|
|
2871
|
-
},
|
|
3046
|
+
Aa(ye, i), e.token = i;
|
|
3047
|
+
}, o = () => {
|
|
3048
|
+
Fa(ye), e.token = null;
|
|
3049
|
+
}, l = () => Ea(ye), n = async (i) => {
|
|
3050
|
+
const u = await re.post(e.endpoints.login, i), d = u.headers.authorization;
|
|
3051
|
+
return t(d), e.user = u.data, e.callbacks.onLoginSuccess && await e.callbacks.onLoginSuccess(u.data), u.data;
|
|
3052
|
+
}, a = async () => {
|
|
2872
3053
|
try {
|
|
2873
|
-
await
|
|
3054
|
+
await re.post(
|
|
2874
3055
|
e.endpoints.logout,
|
|
2875
3056
|
{},
|
|
2876
3057
|
{
|
|
@@ -2882,21 +3063,21 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2882
3063
|
} catch (i) {
|
|
2883
3064
|
throw e.callbacks.onLogoutError && await e.callbacks.onLogoutError(i), i;
|
|
2884
3065
|
} finally {
|
|
2885
|
-
|
|
3066
|
+
o(), e.user = null, za();
|
|
2886
3067
|
}
|
|
2887
3068
|
}, c = async () => {
|
|
2888
3069
|
const i = e.overrideToken || l();
|
|
2889
3070
|
if (!i)
|
|
2890
3071
|
return e.ready = !0, null;
|
|
2891
3072
|
try {
|
|
2892
|
-
const { data: u } = await
|
|
3073
|
+
const { data: u } = await re.get(e.endpoints.fetch, {
|
|
2893
3074
|
headers: {
|
|
2894
3075
|
Authorization: `Bearer ${i}`
|
|
2895
3076
|
}
|
|
2896
3077
|
});
|
|
2897
3078
|
e.user = u, e.overrideToken || (e.token = i);
|
|
2898
3079
|
} catch {
|
|
2899
|
-
e.overrideToken ||
|
|
3080
|
+
e.overrideToken || o();
|
|
2900
3081
|
} finally {
|
|
2901
3082
|
e.ready = !0;
|
|
2902
3083
|
}
|
|
@@ -2905,24 +3086,24 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2905
3086
|
state: e,
|
|
2906
3087
|
initialize: s,
|
|
2907
3088
|
login: n,
|
|
2908
|
-
logout:
|
|
3089
|
+
logout: a,
|
|
2909
3090
|
fetchUser: c,
|
|
2910
3091
|
check: r,
|
|
2911
3092
|
setTokenCookie: t,
|
|
2912
|
-
clearTokenCookie:
|
|
3093
|
+
clearTokenCookie: o,
|
|
2913
3094
|
getTokenCookie: l
|
|
2914
3095
|
};
|
|
2915
|
-
}),
|
|
3096
|
+
}), Da = { class: "h-full grid place-content-center relative" }, ja = { class: "absolute top-8 left-8" }, Na = ["src"], Ia = {
|
|
2916
3097
|
key: 1,
|
|
2917
3098
|
width: "59",
|
|
2918
3099
|
height: "23",
|
|
2919
3100
|
viewBox: "0 0 59 23",
|
|
2920
3101
|
fill: "none",
|
|
2921
3102
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2922
|
-
},
|
|
3103
|
+
}, Za = { class: "max-w-sm grid gap-y-1 -mt-8" }, qa = { class: "mb-7" }, Ua = { class: "text-gray-600" }, Ka = { class: "grid grid-flow-col justify-between mt-1 mb-4" }, Ga = {
|
|
2923
3104
|
key: 0,
|
|
2924
3105
|
class: "text-red-600 text-sm mb-2"
|
|
2925
|
-
},
|
|
3106
|
+
}, Wa = { key: 0 }, Ya = { key: 1 }, Xa = {
|
|
2926
3107
|
__name: "SparkLoginView",
|
|
2927
3108
|
props: {
|
|
2928
3109
|
logo: {
|
|
@@ -2939,8 +3120,8 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2939
3120
|
}
|
|
2940
3121
|
},
|
|
2941
3122
|
setup(e) {
|
|
2942
|
-
const s =
|
|
2943
|
-
|
|
3123
|
+
const s = J(), t = ne(), o = je(), l = K(), n = e, a = E(!1), c = E(""), r = async (i) => {
|
|
3124
|
+
a.value = !0, c.value = "";
|
|
2944
3125
|
try {
|
|
2945
3126
|
await l.login(i);
|
|
2946
3127
|
const u = t.query.redirect;
|
|
@@ -2955,69 +3136,69 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
2955
3136
|
} catch (u) {
|
|
2956
3137
|
c.value = u.response?.data?.message || u.message || "Login failed. Please try again.";
|
|
2957
3138
|
} finally {
|
|
2958
|
-
|
|
3139
|
+
a.value = !1;
|
|
2959
3140
|
}
|
|
2960
3141
|
};
|
|
2961
3142
|
return (i, u) => {
|
|
2962
|
-
const
|
|
2963
|
-
return m(), g("div",
|
|
2964
|
-
|
|
3143
|
+
const d = A("FormKit"), p = A("router-link");
|
|
3144
|
+
return m(), g("div", Da, [
|
|
3145
|
+
f("div", ja, [
|
|
2965
3146
|
n.logo ? (m(), g("img", {
|
|
2966
3147
|
key: 0,
|
|
2967
3148
|
src: n.logo,
|
|
2968
3149
|
alt: "Logo",
|
|
2969
3150
|
class: "h-[23px] w-auto"
|
|
2970
|
-
}, null, 8,
|
|
2971
|
-
|
|
3151
|
+
}, null, 8, Na)) : (m(), g("svg", Ia, [...u[0] || (u[0] = [
|
|
3152
|
+
f("path", {
|
|
2972
3153
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
2973
3154
|
fill: "#1C64F2"
|
|
2974
3155
|
}, null, -1),
|
|
2975
|
-
|
|
3156
|
+
f("path", {
|
|
2976
3157
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
2977
3158
|
fill: "#1C64F2"
|
|
2978
3159
|
}, null, -1),
|
|
2979
|
-
|
|
3160
|
+
f("path", {
|
|
2980
3161
|
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
3162
|
fill: "#1C64F2"
|
|
2982
3163
|
}, null, -1),
|
|
2983
|
-
|
|
3164
|
+
f("path", {
|
|
2984
3165
|
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
3166
|
fill: "#1C64F2"
|
|
2986
3167
|
}, null, -1)
|
|
2987
3168
|
])]))
|
|
2988
3169
|
]),
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
u[1] || (u[1] =
|
|
2992
|
-
|
|
3170
|
+
f("div", Za, [
|
|
3171
|
+
f("div", qa, [
|
|
3172
|
+
u[1] || (u[1] = f("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Log in", -1)),
|
|
3173
|
+
f("p", Ua, " Welcome back" + L(w(o).state.app ? ` to ${w(o).state.app}` : "") + "! Please enter your details. ", 1)
|
|
2993
3174
|
]),
|
|
2994
|
-
|
|
3175
|
+
b(d, {
|
|
2995
3176
|
type: "form",
|
|
2996
3177
|
onSubmit: r,
|
|
2997
3178
|
actions: !1
|
|
2998
3179
|
}, {
|
|
2999
3180
|
default: C(() => [
|
|
3000
|
-
|
|
3181
|
+
b(d, {
|
|
3001
3182
|
label: "Email",
|
|
3002
3183
|
name: "email",
|
|
3003
3184
|
placeholder: "Enter your email",
|
|
3004
3185
|
type: "email",
|
|
3005
3186
|
validation: "required|email",
|
|
3006
3187
|
"outer-class": "max-w-full",
|
|
3007
|
-
value:
|
|
3188
|
+
value: w(l).state.devCredentials.username
|
|
3008
3189
|
}, null, 8, ["value"]),
|
|
3009
|
-
|
|
3190
|
+
b(d, {
|
|
3010
3191
|
label: "Password",
|
|
3011
3192
|
name: "password",
|
|
3012
3193
|
placeholder: "••••••••",
|
|
3013
3194
|
type: "password",
|
|
3014
3195
|
validation: "required",
|
|
3015
3196
|
"outer-class": "max-w-full",
|
|
3016
|
-
value:
|
|
3197
|
+
value: w(l).state.devCredentials.password
|
|
3017
3198
|
}, null, 8, ["value"]),
|
|
3018
|
-
|
|
3019
|
-
u[3] || (u[3] =
|
|
3020
|
-
|
|
3199
|
+
f("div", Ka, [
|
|
3200
|
+
u[3] || (u[3] = f("span", null, null, -1)),
|
|
3201
|
+
b(p, {
|
|
3021
3202
|
to: n.forgotPasswordRoute,
|
|
3022
3203
|
class: "text-sm text-primary-600 font-semibold"
|
|
3023
3204
|
}, {
|
|
@@ -3027,15 +3208,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3027
3208
|
_: 1
|
|
3028
3209
|
}, 8, ["to"])
|
|
3029
3210
|
]),
|
|
3030
|
-
c.value ? (m(), g("div",
|
|
3031
|
-
|
|
3211
|
+
c.value ? (m(), g("div", Ga, L(c.value), 1)) : T("", !0),
|
|
3212
|
+
b(w(G), {
|
|
3032
3213
|
type: "submit",
|
|
3033
3214
|
size: "xl",
|
|
3034
|
-
disabled:
|
|
3215
|
+
disabled: a.value,
|
|
3035
3216
|
"button-class": "w-full mb-2"
|
|
3036
3217
|
}, {
|
|
3037
3218
|
default: C(() => [
|
|
3038
|
-
|
|
3219
|
+
a.value ? (m(), g("span", Ya, "Signing in...")) : (m(), g("span", Wa, "Sign in"))
|
|
3039
3220
|
]),
|
|
3040
3221
|
_: 1
|
|
3041
3222
|
}, 8, ["disabled"])
|
|
@@ -3046,7 +3227,7 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3046
3227
|
]);
|
|
3047
3228
|
};
|
|
3048
3229
|
}
|
|
3049
|
-
},
|
|
3230
|
+
}, Ja = {
|
|
3050
3231
|
__name: "SparkLogoutView",
|
|
3051
3232
|
props: {
|
|
3052
3233
|
defaultRedirect: {
|
|
@@ -3055,27 +3236,27 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3055
3236
|
}
|
|
3056
3237
|
},
|
|
3057
3238
|
setup(e) {
|
|
3058
|
-
const s =
|
|
3059
|
-
return
|
|
3060
|
-
await
|
|
3239
|
+
const s = J(), t = ne(), o = K(), l = e;
|
|
3240
|
+
return be(async () => {
|
|
3241
|
+
await o.logout();
|
|
3061
3242
|
const n = t.query.redirect;
|
|
3062
3243
|
n && n.startsWith("http") ? window.location.href = n : await s.push(n || l.defaultRedirect);
|
|
3063
|
-
}), (n,
|
|
3244
|
+
}), (n, a) => null;
|
|
3064
3245
|
}
|
|
3065
|
-
},
|
|
3246
|
+
}, Qa = { class: "h-full grid place-content-center relative" }, er = { class: "absolute top-8 left-8" }, tr = ["src"], sr = {
|
|
3066
3247
|
key: 1,
|
|
3067
3248
|
width: "59",
|
|
3068
3249
|
height: "23",
|
|
3069
3250
|
viewBox: "0 0 59 23",
|
|
3070
3251
|
fill: "none",
|
|
3071
3252
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3072
|
-
},
|
|
3253
|
+
}, or = { class: "max-w-sm grid gap-y-1 -mt-8" }, ar = {
|
|
3073
3254
|
key: 0,
|
|
3074
3255
|
class: "text-red-600 text-sm mb-2"
|
|
3075
|
-
},
|
|
3256
|
+
}, rr = {
|
|
3076
3257
|
key: 1,
|
|
3077
3258
|
class: "text-green-600 text-sm mb-2"
|
|
3078
|
-
},
|
|
3259
|
+
}, nr = { key: 0 }, lr = { key: 1 }, ir = {
|
|
3079
3260
|
__name: "SparkForgotPasswordView",
|
|
3080
3261
|
props: {
|
|
3081
3262
|
logo: {
|
|
@@ -3088,56 +3269,56 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3088
3269
|
}
|
|
3089
3270
|
},
|
|
3090
3271
|
setup(e) {
|
|
3091
|
-
const s =
|
|
3092
|
-
|
|
3272
|
+
const s = K(), t = e, o = E(!1), l = E(""), n = E(""), a = async ({ email: c }) => {
|
|
3273
|
+
o.value = !0, l.value = "", n.value = "";
|
|
3093
3274
|
try {
|
|
3094
|
-
await
|
|
3275
|
+
await re.post(s.state.endpoints.passwordEmail, { email: c }), n.value = "Password reset link sent! Check your email.";
|
|
3095
3276
|
} catch (r) {
|
|
3096
3277
|
l.value = r.response?.data?.message || "Failed to send reset link.";
|
|
3097
3278
|
} finally {
|
|
3098
|
-
|
|
3279
|
+
o.value = !1;
|
|
3099
3280
|
}
|
|
3100
3281
|
};
|
|
3101
3282
|
return (c, r) => {
|
|
3102
3283
|
const i = A("FormKit"), u = A("router-link");
|
|
3103
|
-
return m(), g("div",
|
|
3104
|
-
|
|
3284
|
+
return m(), g("div", Qa, [
|
|
3285
|
+
f("div", er, [
|
|
3105
3286
|
t.logo ? (m(), g("img", {
|
|
3106
3287
|
key: 0,
|
|
3107
3288
|
src: t.logo,
|
|
3108
3289
|
alt: "Logo",
|
|
3109
3290
|
class: "h-[23px] w-auto"
|
|
3110
|
-
}, null, 8,
|
|
3111
|
-
|
|
3291
|
+
}, null, 8, tr)) : (m(), g("svg", sr, [...r[0] || (r[0] = [
|
|
3292
|
+
f("path", {
|
|
3112
3293
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3113
3294
|
fill: "#1C64F2"
|
|
3114
3295
|
}, null, -1),
|
|
3115
|
-
|
|
3296
|
+
f("path", {
|
|
3116
3297
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3117
3298
|
fill: "#1C64F2"
|
|
3118
3299
|
}, null, -1),
|
|
3119
|
-
|
|
3300
|
+
f("path", {
|
|
3120
3301
|
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
3302
|
fill: "#1C64F2"
|
|
3122
3303
|
}, null, -1),
|
|
3123
|
-
|
|
3304
|
+
f("path", {
|
|
3124
3305
|
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
3306
|
fill: "#1C64F2"
|
|
3126
3307
|
}, null, -1)
|
|
3127
3308
|
])]))
|
|
3128
3309
|
]),
|
|
3129
|
-
|
|
3130
|
-
r[2] || (r[2] =
|
|
3131
|
-
|
|
3132
|
-
|
|
3310
|
+
f("div", or, [
|
|
3311
|
+
r[2] || (r[2] = f("div", { class: "mb-7" }, [
|
|
3312
|
+
f("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Reset password"),
|
|
3313
|
+
f("p", { class: "text-gray-600" }, " Enter your email and we'll send you a link to reset your password. ")
|
|
3133
3314
|
], -1)),
|
|
3134
|
-
|
|
3315
|
+
b(i, {
|
|
3135
3316
|
type: "form",
|
|
3136
|
-
onSubmit:
|
|
3317
|
+
onSubmit: a,
|
|
3137
3318
|
actions: !1
|
|
3138
3319
|
}, {
|
|
3139
3320
|
default: C(() => [
|
|
3140
|
-
|
|
3321
|
+
b(i, {
|
|
3141
3322
|
label: "Email",
|
|
3142
3323
|
name: "email",
|
|
3143
3324
|
placeholder: "Enter your email",
|
|
@@ -3145,20 +3326,20 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3145
3326
|
validation: "required|email",
|
|
3146
3327
|
"outer-class": "max-w-full"
|
|
3147
3328
|
}),
|
|
3148
|
-
l.value ? (m(), g("div",
|
|
3149
|
-
n.value ? (m(), g("div",
|
|
3150
|
-
|
|
3329
|
+
l.value ? (m(), g("div", ar, L(l.value), 1)) : T("", !0),
|
|
3330
|
+
n.value ? (m(), g("div", rr, L(n.value), 1)) : T("", !0),
|
|
3331
|
+
b(w(G), {
|
|
3151
3332
|
type: "submit",
|
|
3152
3333
|
size: "xl",
|
|
3153
|
-
disabled:
|
|
3334
|
+
disabled: o.value,
|
|
3154
3335
|
"button-class": "w-full mb-2"
|
|
3155
3336
|
}, {
|
|
3156
3337
|
default: C(() => [
|
|
3157
|
-
|
|
3338
|
+
o.value ? (m(), g("span", lr, "Sending...")) : (m(), g("span", nr, "Send reset link"))
|
|
3158
3339
|
]),
|
|
3159
3340
|
_: 1
|
|
3160
3341
|
}, 8, ["disabled"]),
|
|
3161
|
-
|
|
3342
|
+
b(u, {
|
|
3162
3343
|
to: t.loginRoute,
|
|
3163
3344
|
class: "text-sm text-center text-primary-600 font-semibold block"
|
|
3164
3345
|
}, {
|
|
@@ -3174,17 +3355,17 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3174
3355
|
]);
|
|
3175
3356
|
};
|
|
3176
3357
|
}
|
|
3177
|
-
},
|
|
3358
|
+
}, cr = { class: "h-full grid place-content-center relative" }, ur = { class: "absolute top-8 left-8" }, dr = ["src"], pr = {
|
|
3178
3359
|
key: 1,
|
|
3179
3360
|
width: "59",
|
|
3180
3361
|
height: "23",
|
|
3181
3362
|
viewBox: "0 0 59 23",
|
|
3182
3363
|
fill: "none",
|
|
3183
3364
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3184
|
-
},
|
|
3365
|
+
}, fr = { class: "max-w-sm grid gap-y-1 -mt-8" }, mr = {
|
|
3185
3366
|
key: 0,
|
|
3186
3367
|
class: "text-red-600 text-sm mb-2"
|
|
3187
|
-
},
|
|
3368
|
+
}, hr = { key: 0 }, gr = { key: 1 }, yr = {
|
|
3188
3369
|
__name: "SparkResetPasswordView",
|
|
3189
3370
|
props: {
|
|
3190
3371
|
logo: {
|
|
@@ -3197,61 +3378,61 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3197
3378
|
}
|
|
3198
3379
|
},
|
|
3199
3380
|
setup(e) {
|
|
3200
|
-
const s =
|
|
3201
|
-
n.value = !0,
|
|
3381
|
+
const s = J(), t = ne(), o = K(), l = e, n = E(!1), a = E(""), c = async ({ password: r, password_confirmation: i }) => {
|
|
3382
|
+
n.value = !0, a.value = "";
|
|
3202
3383
|
try {
|
|
3203
|
-
await
|
|
3384
|
+
await re.post(o.state.endpoints.passwordReset, {
|
|
3204
3385
|
email: t.query.email,
|
|
3205
3386
|
token: t.query.token,
|
|
3206
3387
|
password: r,
|
|
3207
3388
|
password_confirmation: i
|
|
3208
3389
|
}), await s.push(l.loginRoute);
|
|
3209
3390
|
} catch (u) {
|
|
3210
|
-
|
|
3391
|
+
a.value = u.response?.data?.message || "Failed to reset password.";
|
|
3211
3392
|
} finally {
|
|
3212
3393
|
n.value = !1;
|
|
3213
3394
|
}
|
|
3214
3395
|
};
|
|
3215
3396
|
return (r, i) => {
|
|
3216
3397
|
const u = A("FormKit");
|
|
3217
|
-
return m(), g("div",
|
|
3218
|
-
|
|
3398
|
+
return m(), g("div", cr, [
|
|
3399
|
+
f("div", ur, [
|
|
3219
3400
|
l.logo ? (m(), g("img", {
|
|
3220
3401
|
key: 0,
|
|
3221
3402
|
src: l.logo,
|
|
3222
3403
|
alt: "Logo",
|
|
3223
3404
|
class: "h-[23px] w-auto"
|
|
3224
|
-
}, null, 8,
|
|
3225
|
-
|
|
3405
|
+
}, null, 8, dr)) : (m(), g("svg", pr, [...i[0] || (i[0] = [
|
|
3406
|
+
f("path", {
|
|
3226
3407
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3227
3408
|
fill: "#1C64F2"
|
|
3228
3409
|
}, null, -1),
|
|
3229
|
-
|
|
3410
|
+
f("path", {
|
|
3230
3411
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3231
3412
|
fill: "#1C64F2"
|
|
3232
3413
|
}, null, -1),
|
|
3233
|
-
|
|
3414
|
+
f("path", {
|
|
3234
3415
|
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
3416
|
fill: "#1C64F2"
|
|
3236
3417
|
}, null, -1),
|
|
3237
|
-
|
|
3418
|
+
f("path", {
|
|
3238
3419
|
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
3420
|
fill: "#1C64F2"
|
|
3240
3421
|
}, null, -1)
|
|
3241
3422
|
])]))
|
|
3242
3423
|
]),
|
|
3243
|
-
|
|
3244
|
-
i[1] || (i[1] =
|
|
3245
|
-
|
|
3246
|
-
|
|
3424
|
+
f("div", fr, [
|
|
3425
|
+
i[1] || (i[1] = f("div", { class: "mb-7" }, [
|
|
3426
|
+
f("h1", { class: "text-4xl text-gray-900 semibold tracking-tight mb-3" }, "Set new password"),
|
|
3427
|
+
f("p", { class: "text-gray-600" }, " Enter your new password below. ")
|
|
3247
3428
|
], -1)),
|
|
3248
|
-
|
|
3429
|
+
b(u, {
|
|
3249
3430
|
type: "form",
|
|
3250
3431
|
onSubmit: c,
|
|
3251
3432
|
actions: !1
|
|
3252
3433
|
}, {
|
|
3253
3434
|
default: C(() => [
|
|
3254
|
-
|
|
3435
|
+
b(u, {
|
|
3255
3436
|
label: "New Password",
|
|
3256
3437
|
name: "password",
|
|
3257
3438
|
placeholder: "••••••••",
|
|
@@ -3259,7 +3440,7 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3259
3440
|
validation: "required|length:8",
|
|
3260
3441
|
"outer-class": "max-w-full"
|
|
3261
3442
|
}),
|
|
3262
|
-
|
|
3443
|
+
b(u, {
|
|
3263
3444
|
label: "Confirm Password",
|
|
3264
3445
|
name: "password_confirmation",
|
|
3265
3446
|
placeholder: "••••••••",
|
|
@@ -3267,15 +3448,15 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3267
3448
|
validation: "required|confirm:password",
|
|
3268
3449
|
"outer-class": "max-w-full"
|
|
3269
3450
|
}),
|
|
3270
|
-
|
|
3271
|
-
|
|
3451
|
+
a.value ? (m(), g("div", mr, L(a.value), 1)) : T("", !0),
|
|
3452
|
+
b(w(G), {
|
|
3272
3453
|
type: "submit",
|
|
3273
3454
|
size: "xl",
|
|
3274
3455
|
disabled: n.value,
|
|
3275
3456
|
"button-class": "w-full mb-2"
|
|
3276
3457
|
}, {
|
|
3277
3458
|
default: C(() => [
|
|
3278
|
-
n.value ? (m(), g("span",
|
|
3459
|
+
n.value ? (m(), g("span", gr, "Resetting...")) : (m(), g("span", hr, "Reset password"))
|
|
3279
3460
|
]),
|
|
3280
3461
|
_: 1
|
|
3281
3462
|
}, 8, ["disabled"])
|
|
@@ -3286,14 +3467,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3286
3467
|
]);
|
|
3287
3468
|
};
|
|
3288
3469
|
}
|
|
3289
|
-
},
|
|
3470
|
+
}, vr = { class: "h-full grid place-content-center relative" }, br = { class: "absolute top-8 left-8" }, xr = ["src"], kr = {
|
|
3290
3471
|
key: 1,
|
|
3291
3472
|
width: "59",
|
|
3292
3473
|
height: "23",
|
|
3293
3474
|
viewBox: "0 0 59 23",
|
|
3294
3475
|
fill: "none",
|
|
3295
3476
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3296
|
-
},
|
|
3477
|
+
}, wr = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, _r = { class: "flex gap-4 justify-center" }, Sr = {
|
|
3297
3478
|
__name: "SparkError403View",
|
|
3298
3479
|
props: {
|
|
3299
3480
|
logo: {
|
|
@@ -3306,48 +3487,48 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3306
3487
|
}
|
|
3307
3488
|
},
|
|
3308
3489
|
setup(e) {
|
|
3309
|
-
const s =
|
|
3490
|
+
const s = J(), t = e, o = () => {
|
|
3310
3491
|
s.push(t.homeRoute);
|
|
3311
3492
|
};
|
|
3312
|
-
return (l, n) => (m(), g("div",
|
|
3313
|
-
|
|
3493
|
+
return (l, n) => (m(), g("div", vr, [
|
|
3494
|
+
f("div", br, [
|
|
3314
3495
|
t.logo ? (m(), g("img", {
|
|
3315
3496
|
key: 0,
|
|
3316
3497
|
src: t.logo,
|
|
3317
3498
|
alt: "Logo",
|
|
3318
3499
|
class: "h-[23px] w-auto"
|
|
3319
|
-
}, null, 8,
|
|
3320
|
-
|
|
3500
|
+
}, null, 8, xr)) : (m(), g("svg", kr, [...n[0] || (n[0] = [
|
|
3501
|
+
f("path", {
|
|
3321
3502
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3322
3503
|
fill: "#1C64F2"
|
|
3323
3504
|
}, null, -1),
|
|
3324
|
-
|
|
3505
|
+
f("path", {
|
|
3325
3506
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3326
3507
|
fill: "#1C64F2"
|
|
3327
3508
|
}, null, -1),
|
|
3328
|
-
|
|
3509
|
+
f("path", {
|
|
3329
3510
|
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
3511
|
fill: "#1C64F2"
|
|
3331
3512
|
}, null, -1),
|
|
3332
|
-
|
|
3513
|
+
f("path", {
|
|
3333
3514
|
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
3515
|
fill: "#1C64F2"
|
|
3335
3516
|
}, null, -1)
|
|
3336
3517
|
])]))
|
|
3337
3518
|
]),
|
|
3338
|
-
|
|
3339
|
-
n[2] || (n[2] =
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3519
|
+
f("div", wr, [
|
|
3520
|
+
n[2] || (n[2] = f("div", null, [
|
|
3521
|
+
f("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "403"),
|
|
3522
|
+
f("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Access Forbidden "),
|
|
3523
|
+
f("p", { class: "text-gray-600" }, [
|
|
3343
3524
|
B(" You don't have permission to access this resource."),
|
|
3344
|
-
|
|
3525
|
+
f("br"),
|
|
3345
3526
|
B(" If you believe this is an error, please contact your administrator. ")
|
|
3346
3527
|
])
|
|
3347
3528
|
], -1)),
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
onClick:
|
|
3529
|
+
f("div", _r, [
|
|
3530
|
+
b(w(G), {
|
|
3531
|
+
onClick: o,
|
|
3351
3532
|
size: "lg"
|
|
3352
3533
|
}, {
|
|
3353
3534
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3359,14 +3540,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3359
3540
|
])
|
|
3360
3541
|
]));
|
|
3361
3542
|
}
|
|
3362
|
-
},
|
|
3543
|
+
}, Cr = { class: "h-full grid place-content-center relative" }, $r = { class: "absolute top-8 left-8" }, Tr = ["src"], Lr = {
|
|
3363
3544
|
key: 1,
|
|
3364
3545
|
width: "59",
|
|
3365
3546
|
height: "23",
|
|
3366
3547
|
viewBox: "0 0 59 23",
|
|
3367
3548
|
fill: "none",
|
|
3368
3549
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3369
|
-
},
|
|
3550
|
+
}, Pr = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, Mr = { class: "flex gap-4 justify-center" }, Hr = {
|
|
3370
3551
|
__name: "SparkError404View",
|
|
3371
3552
|
props: {
|
|
3372
3553
|
logo: {
|
|
@@ -3379,44 +3560,44 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3379
3560
|
}
|
|
3380
3561
|
},
|
|
3381
3562
|
setup(e) {
|
|
3382
|
-
const s =
|
|
3563
|
+
const s = J(), t = e, o = () => {
|
|
3383
3564
|
s.push(t.homeRoute);
|
|
3384
3565
|
};
|
|
3385
|
-
return (l, n) => (m(), g("div",
|
|
3386
|
-
|
|
3566
|
+
return (l, n) => (m(), g("div", Cr, [
|
|
3567
|
+
f("div", $r, [
|
|
3387
3568
|
t.logo ? (m(), g("img", {
|
|
3388
3569
|
key: 0,
|
|
3389
3570
|
src: t.logo,
|
|
3390
3571
|
alt: "Logo",
|
|
3391
3572
|
class: "h-[23px] w-auto"
|
|
3392
|
-
}, null, 8,
|
|
3393
|
-
|
|
3573
|
+
}, null, 8, Tr)) : (m(), g("svg", Lr, [...n[0] || (n[0] = [
|
|
3574
|
+
f("path", {
|
|
3394
3575
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3395
3576
|
fill: "#1C64F2"
|
|
3396
3577
|
}, null, -1),
|
|
3397
|
-
|
|
3578
|
+
f("path", {
|
|
3398
3579
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3399
3580
|
fill: "#1C64F2"
|
|
3400
3581
|
}, null, -1),
|
|
3401
|
-
|
|
3582
|
+
f("path", {
|
|
3402
3583
|
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
3584
|
fill: "#1C64F2"
|
|
3404
3585
|
}, null, -1),
|
|
3405
|
-
|
|
3586
|
+
f("path", {
|
|
3406
3587
|
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
3588
|
fill: "#1C64F2"
|
|
3408
3589
|
}, null, -1)
|
|
3409
3590
|
])]))
|
|
3410
3591
|
]),
|
|
3411
|
-
|
|
3412
|
-
n[2] || (n[2] =
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3592
|
+
f("div", Pr, [
|
|
3593
|
+
n[2] || (n[2] = f("div", null, [
|
|
3594
|
+
f("div", { class: "text-primary-600 text-7xl font-bold mb-4" }, "404"),
|
|
3595
|
+
f("h1", { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, " Page Not Found "),
|
|
3596
|
+
f("p", { class: "text-gray-600" }, " The page you're looking for doesn't exist or has been moved. ")
|
|
3416
3597
|
], -1)),
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
onClick:
|
|
3598
|
+
f("div", Mr, [
|
|
3599
|
+
b(w(G), {
|
|
3600
|
+
onClick: o,
|
|
3420
3601
|
size: "lg"
|
|
3421
3602
|
}, {
|
|
3422
3603
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3428,14 +3609,14 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3428
3609
|
])
|
|
3429
3610
|
]));
|
|
3430
3611
|
}
|
|
3431
|
-
},
|
|
3612
|
+
}, Vr = { class: "h-full grid place-content-center relative" }, Rr = { class: "absolute top-8 left-8" }, Br = ["src"], Er = {
|
|
3432
3613
|
key: 1,
|
|
3433
3614
|
width: "59",
|
|
3434
3615
|
height: "23",
|
|
3435
3616
|
viewBox: "0 0 59 23",
|
|
3436
3617
|
fill: "none",
|
|
3437
3618
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3438
|
-
},
|
|
3619
|
+
}, Ar = { class: "max-w-lg grid gap-y-6 text-center -mt-8" }, Fr = { class: "text-primary-600 text-7xl font-bold mb-4" }, Or = { class: "text-3xl text-gray-900 font-semibold tracking-tight mb-3" }, zr = { class: "text-gray-600" }, Dr = { class: "flex gap-4 justify-center" }, gn = {
|
|
3439
3620
|
__name: "SparkErrorGeneralView",
|
|
3440
3621
|
props: {
|
|
3441
3622
|
logo: {
|
|
@@ -3460,44 +3641,44 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3460
3641
|
}
|
|
3461
3642
|
},
|
|
3462
3643
|
setup(e) {
|
|
3463
|
-
const s =
|
|
3644
|
+
const s = J(), t = e, o = () => {
|
|
3464
3645
|
s.push(t.homeRoute);
|
|
3465
3646
|
};
|
|
3466
|
-
return (l, n) => (m(), g("div",
|
|
3467
|
-
|
|
3647
|
+
return (l, n) => (m(), g("div", Vr, [
|
|
3648
|
+
f("div", Rr, [
|
|
3468
3649
|
t.logo ? (m(), g("img", {
|
|
3469
3650
|
key: 0,
|
|
3470
3651
|
src: t.logo,
|
|
3471
3652
|
alt: "Logo",
|
|
3472
3653
|
class: "h-[23px] w-auto"
|
|
3473
|
-
}, null, 8,
|
|
3474
|
-
|
|
3654
|
+
}, null, 8, Br)) : (m(), g("svg", Er, [...n[0] || (n[0] = [
|
|
3655
|
+
f("path", {
|
|
3475
3656
|
d: "M49.2029 17.1264V8.03835H44.0829V5.22235H58.0989V8.03835H52.9629V17.1264H49.2029Z",
|
|
3476
3657
|
fill: "#1C64F2"
|
|
3477
3658
|
}, null, -1),
|
|
3478
|
-
|
|
3659
|
+
f("path", {
|
|
3479
3660
|
d: "M34.5 5.22235H38.228V14.1664H46.5V17.1264H34.5V5.22235Z",
|
|
3480
3661
|
fill: "#1C64F2"
|
|
3481
3662
|
}, null, -1),
|
|
3482
|
-
|
|
3663
|
+
f("path", {
|
|
3483
3664
|
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
3665
|
fill: "#1C64F2"
|
|
3485
3666
|
}, null, -1),
|
|
3486
|
-
|
|
3667
|
+
f("path", {
|
|
3487
3668
|
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
3669
|
fill: "#1C64F2"
|
|
3489
3670
|
}, null, -1)
|
|
3490
3671
|
])]))
|
|
3491
3672
|
]),
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3673
|
+
f("div", Ar, [
|
|
3674
|
+
f("div", null, [
|
|
3675
|
+
f("div", Fr, L(t.errorCode || "Error"), 1),
|
|
3676
|
+
f("h1", Or, L(t.title || "Something went wrong"), 1),
|
|
3677
|
+
f("p", zr, L(t.message || "An unexpected error occurred. Please try again later."), 1)
|
|
3497
3678
|
]),
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
onClick:
|
|
3679
|
+
f("div", Dr, [
|
|
3680
|
+
b(w(G), {
|
|
3681
|
+
onClick: o,
|
|
3501
3682
|
size: "lg"
|
|
3502
3683
|
}, {
|
|
3503
3684
|
default: C(() => [...n[1] || (n[1] = [
|
|
@@ -3510,57 +3691,57 @@ const me = "bolt-next-token", Z = ie("auth", () => {
|
|
|
3510
3691
|
]));
|
|
3511
3692
|
}
|
|
3512
3693
|
};
|
|
3513
|
-
function
|
|
3694
|
+
function yn(e = {}) {
|
|
3514
3695
|
const {
|
|
3515
3696
|
loginPath: s = "/login",
|
|
3516
3697
|
logoutPath: t = "/logout",
|
|
3517
|
-
forgotPasswordPath:
|
|
3698
|
+
forgotPasswordPath: o = "/forgot-password",
|
|
3518
3699
|
resetPasswordPath: l = "/password/reset",
|
|
3519
3700
|
logo: n = "",
|
|
3520
|
-
defaultRedirect:
|
|
3701
|
+
defaultRedirect: a = "/dashboard"
|
|
3521
3702
|
} = e;
|
|
3522
3703
|
return [
|
|
3523
3704
|
{
|
|
3524
3705
|
path: s,
|
|
3525
3706
|
name: "login",
|
|
3526
|
-
component:
|
|
3527
|
-
props: { logo: n, defaultRedirect:
|
|
3707
|
+
component: Xa,
|
|
3708
|
+
props: { logo: n, defaultRedirect: a },
|
|
3528
3709
|
meta: { auth: !1 }
|
|
3529
3710
|
},
|
|
3530
3711
|
{
|
|
3531
3712
|
path: t,
|
|
3532
3713
|
name: "logout",
|
|
3533
|
-
component:
|
|
3714
|
+
component: Ja,
|
|
3534
3715
|
props: { defaultRedirect: s },
|
|
3535
3716
|
meta: { auth: !1 }
|
|
3536
3717
|
},
|
|
3537
3718
|
{
|
|
3538
|
-
path:
|
|
3719
|
+
path: o,
|
|
3539
3720
|
name: "forgot-password",
|
|
3540
|
-
component:
|
|
3721
|
+
component: ir,
|
|
3541
3722
|
props: { logo: n, loginRoute: s },
|
|
3542
3723
|
meta: { auth: !1 }
|
|
3543
3724
|
},
|
|
3544
3725
|
{
|
|
3545
3726
|
path: l,
|
|
3546
3727
|
name: "password-reset",
|
|
3547
|
-
component:
|
|
3728
|
+
component: yr,
|
|
3548
3729
|
props: { logo: n, loginRoute: s },
|
|
3549
3730
|
meta: { auth: !1 }
|
|
3550
3731
|
}
|
|
3551
3732
|
];
|
|
3552
3733
|
}
|
|
3553
|
-
function
|
|
3734
|
+
function vn(e, s = {}) {
|
|
3554
3735
|
const { defaultAuthenticatedRoute: t = "/dashboard" } = s;
|
|
3555
|
-
e.beforeEach(async (
|
|
3556
|
-
const
|
|
3557
|
-
|
|
3736
|
+
e.beforeEach(async (o, l, n) => {
|
|
3737
|
+
const a = K();
|
|
3738
|
+
a.state.ready || await a.fetchUser(), jr(o, n, a, t);
|
|
3558
3739
|
});
|
|
3559
3740
|
}
|
|
3560
|
-
function
|
|
3741
|
+
function jr(e, s, t, o) {
|
|
3561
3742
|
const l = e.meta.auth !== !1, n = t.check;
|
|
3562
3743
|
if (t.state.overrideToken && e.path === "/logout") {
|
|
3563
|
-
s({ path:
|
|
3744
|
+
s({ path: o });
|
|
3564
3745
|
return;
|
|
3565
3746
|
}
|
|
3566
3747
|
if (!n) {
|
|
@@ -3572,44 +3753,44 @@ function Tr(e, s, t, a) {
|
|
|
3572
3753
|
s();
|
|
3573
3754
|
return;
|
|
3574
3755
|
}
|
|
3575
|
-
let
|
|
3576
|
-
if (
|
|
3756
|
+
let a = e.fullPath;
|
|
3757
|
+
if (a === "/" || a === "" || a === o) {
|
|
3577
3758
|
s({ path: t.state.routes.auth });
|
|
3578
3759
|
return;
|
|
3579
3760
|
}
|
|
3580
|
-
|
|
3761
|
+
a.includes("%") && (a = decodeURIComponent(a)), s({
|
|
3581
3762
|
path: t.state.routes.auth,
|
|
3582
|
-
query: { redirect:
|
|
3763
|
+
query: { redirect: a }
|
|
3583
3764
|
});
|
|
3584
3765
|
return;
|
|
3585
3766
|
}
|
|
3586
3767
|
if (n) {
|
|
3587
3768
|
if (!l && e.path === t.state.routes.auth) {
|
|
3588
|
-
s({ path:
|
|
3769
|
+
s({ path: o });
|
|
3589
3770
|
return;
|
|
3590
3771
|
}
|
|
3591
3772
|
if (e.path === "/") {
|
|
3592
|
-
s({ path:
|
|
3773
|
+
s({ path: o });
|
|
3593
3774
|
return;
|
|
3594
3775
|
}
|
|
3595
3776
|
s();
|
|
3596
3777
|
}
|
|
3597
3778
|
}
|
|
3598
|
-
function
|
|
3779
|
+
function bn(e = {}) {
|
|
3599
3780
|
const {
|
|
3600
3781
|
forbiddenPath: s = "/error/403",
|
|
3601
3782
|
logo: t = "",
|
|
3602
|
-
homeRoute:
|
|
3783
|
+
homeRoute: o = "/dashboard"
|
|
3603
3784
|
} = e;
|
|
3604
3785
|
return {
|
|
3605
3786
|
path: s,
|
|
3606
3787
|
name: "error-403",
|
|
3607
|
-
component:
|
|
3608
|
-
props: { logo: t, homeRoute:
|
|
3788
|
+
component: Sr,
|
|
3789
|
+
props: { logo: t, homeRoute: o },
|
|
3609
3790
|
meta: { auth: !1 }
|
|
3610
3791
|
};
|
|
3611
3792
|
}
|
|
3612
|
-
function
|
|
3793
|
+
function xn(e = {}) {
|
|
3613
3794
|
const {
|
|
3614
3795
|
logo: s = "",
|
|
3615
3796
|
homeRoute: t = "/dashboard"
|
|
@@ -3617,21 +3798,21 @@ function rn(e = {}) {
|
|
|
3617
3798
|
return {
|
|
3618
3799
|
path: "/:pathMatch(.*)*",
|
|
3619
3800
|
name: "error-404",
|
|
3620
|
-
component:
|
|
3801
|
+
component: Hr,
|
|
3621
3802
|
props: { logo: s, homeRoute: t },
|
|
3622
3803
|
meta: { auth: !1 }
|
|
3623
3804
|
};
|
|
3624
3805
|
}
|
|
3625
|
-
function
|
|
3806
|
+
function kn(e, s) {
|
|
3626
3807
|
e.beforeResolve(async (t) => {
|
|
3627
3808
|
if (t.meta.auth !== !1) {
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3809
|
+
const o = K();
|
|
3810
|
+
o.state.ready && o.check && await s();
|
|
3630
3811
|
}
|
|
3631
3812
|
});
|
|
3632
3813
|
}
|
|
3633
|
-
function
|
|
3634
|
-
const s =
|
|
3814
|
+
function Nr(e = {}) {
|
|
3815
|
+
const s = re.create({
|
|
3635
3816
|
baseURL: e.baseURL || "",
|
|
3636
3817
|
timeout: e.timeout || 3e4,
|
|
3637
3818
|
headers: {
|
|
@@ -3642,8 +3823,8 @@ function Lr(e = {}) {
|
|
|
3642
3823
|
return s.interceptors.request.use(
|
|
3643
3824
|
(t) => {
|
|
3644
3825
|
try {
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3826
|
+
const o = K();
|
|
3827
|
+
o.state.overrideToken ? t.headers.Authorization = `Bearer ${o.state.overrideToken}` : o.state.token && (t.headers.Authorization = `Bearer ${o.state.token}`);
|
|
3647
3828
|
} catch {
|
|
3648
3829
|
}
|
|
3649
3830
|
return t;
|
|
@@ -3654,44 +3835,44 @@ function Lr(e = {}) {
|
|
|
3654
3835
|
async (t) => {
|
|
3655
3836
|
if (t.response?.status === 401)
|
|
3656
3837
|
try {
|
|
3657
|
-
const
|
|
3658
|
-
await
|
|
3659
|
-
} catch (
|
|
3660
|
-
console.error("Error during auto-logout:",
|
|
3838
|
+
const o = K();
|
|
3839
|
+
await o.logout(), window.location.href = o.state.routes.auth;
|
|
3840
|
+
} catch (o) {
|
|
3841
|
+
console.error("Error during auto-logout:", o), window.location.href = "/login";
|
|
3661
3842
|
}
|
|
3662
3843
|
if (t.response?.status === 403)
|
|
3663
3844
|
try {
|
|
3664
|
-
const
|
|
3665
|
-
window.location.href =
|
|
3666
|
-
} catch (
|
|
3667
|
-
console.error("Error during 403 redirect:",
|
|
3845
|
+
const o = K();
|
|
3846
|
+
window.location.href = o.state.routes.forbidden;
|
|
3847
|
+
} catch (o) {
|
|
3848
|
+
console.error("Error during 403 redirect:", o), window.location.href = "/error/403";
|
|
3668
3849
|
}
|
|
3669
3850
|
return Promise.reject(t);
|
|
3670
3851
|
}
|
|
3671
3852
|
), s;
|
|
3672
3853
|
}
|
|
3673
3854
|
let ae = null;
|
|
3674
|
-
function
|
|
3675
|
-
return ae =
|
|
3855
|
+
function wn(e, s = {}) {
|
|
3856
|
+
return ae = Nr(s), e.provide("axios", ae), e.config.globalProperties.$axios = ae, ae;
|
|
3676
3857
|
}
|
|
3677
|
-
function
|
|
3858
|
+
function _n() {
|
|
3678
3859
|
if (!ae)
|
|
3679
3860
|
throw new Error("Axios instance not initialized. Call setupAxios() first.");
|
|
3680
3861
|
return ae;
|
|
3681
3862
|
}
|
|
3682
|
-
const
|
|
3863
|
+
const Sn = ue("sparkNav", () => {
|
|
3683
3864
|
const e = q({
|
|
3684
3865
|
menu: [],
|
|
3685
3866
|
collapsed: !1,
|
|
3686
3867
|
hidden: !1
|
|
3687
|
-
}), s =
|
|
3868
|
+
}), s = J(), t = ne(), o = (i = []) => {
|
|
3688
3869
|
e.menu = i, r();
|
|
3689
3870
|
}, l = (i, u) => {
|
|
3690
|
-
for (const
|
|
3691
|
-
if (
|
|
3692
|
-
if (
|
|
3693
|
-
const
|
|
3694
|
-
if (
|
|
3871
|
+
for (const d of i) {
|
|
3872
|
+
if (d.href === u) return d;
|
|
3873
|
+
if (d.children) {
|
|
3874
|
+
const p = l(d.children, u);
|
|
3875
|
+
if (p) return p;
|
|
3695
3876
|
}
|
|
3696
3877
|
}
|
|
3697
3878
|
return null;
|
|
@@ -3704,22 +3885,22 @@ const un = ie("sparkNav", () => {
|
|
|
3704
3885
|
}
|
|
3705
3886
|
await s.push(i);
|
|
3706
3887
|
}
|
|
3707
|
-
},
|
|
3888
|
+
}, a = () => {
|
|
3708
3889
|
e.collapsed = !e.collapsed;
|
|
3709
3890
|
}, c = () => {
|
|
3710
3891
|
e.hidden = !e.hidden;
|
|
3711
3892
|
}, r = () => {
|
|
3712
3893
|
const i = t.name || t.path.replace("/", "");
|
|
3713
3894
|
if (i) {
|
|
3714
|
-
const u = (
|
|
3715
|
-
|
|
3716
|
-
|
|
3895
|
+
const u = (d) => {
|
|
3896
|
+
d.forEach((p) => {
|
|
3897
|
+
p.current = p.href === i, p.children && u(p.children);
|
|
3717
3898
|
});
|
|
3718
3899
|
};
|
|
3719
3900
|
u(e.menu);
|
|
3720
3901
|
}
|
|
3721
3902
|
};
|
|
3722
|
-
return
|
|
3903
|
+
return N(
|
|
3723
3904
|
() => t.path,
|
|
3724
3905
|
() => {
|
|
3725
3906
|
r();
|
|
@@ -3727,70 +3908,72 @@ const un = ie("sparkNav", () => {
|
|
|
3727
3908
|
{ immediate: !0 }
|
|
3728
3909
|
), {
|
|
3729
3910
|
state: e,
|
|
3730
|
-
initialize:
|
|
3911
|
+
initialize: o,
|
|
3731
3912
|
goto: n,
|
|
3732
|
-
toggleCollapsed:
|
|
3913
|
+
toggleCollapsed: a,
|
|
3733
3914
|
toggleHidden: c,
|
|
3734
3915
|
syncWithRoute: r
|
|
3735
3916
|
};
|
|
3736
3917
|
});
|
|
3737
3918
|
export {
|
|
3738
3919
|
F as Icons,
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
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
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3920
|
+
se as SparkAlert,
|
|
3921
|
+
vs as SparkAppSelector,
|
|
3922
|
+
js as SparkBrandSelector,
|
|
3923
|
+
G as SparkButton,
|
|
3924
|
+
Is as SparkButtonGroup,
|
|
3925
|
+
dn as SparkCard,
|
|
3926
|
+
fn as SparkDefaultContainer,
|
|
3927
|
+
Sr as SparkError403View,
|
|
3928
|
+
Hr as SparkError404View,
|
|
3929
|
+
gn as SparkErrorGeneralView,
|
|
3930
|
+
ir as SparkForgotPasswordView,
|
|
3931
|
+
Xa as SparkLoginView,
|
|
3932
|
+
Ja as SparkLogoutView,
|
|
3933
|
+
Qs as SparkModalContainer,
|
|
3934
|
+
Ws as SparkModalDialog,
|
|
3935
|
+
cn as SparkNotificationOutlet,
|
|
3936
|
+
Se as SparkOverlay,
|
|
3937
|
+
mn as SparkPublicContainer,
|
|
3938
|
+
yr as SparkResetPasswordView,
|
|
3939
|
+
pn as SparkTable,
|
|
3940
|
+
oa as SparkTableDatePicker,
|
|
3941
|
+
ea as SparkTableFilterButtons,
|
|
3942
|
+
Yo as SparkTableFilterSelect,
|
|
3943
|
+
jo as SparkTablePaginationPaging,
|
|
3944
|
+
Zo as SparkTablePaginationPerPage,
|
|
3945
|
+
la as SparkTableReset,
|
|
3946
|
+
Ko as SparkTableSearch,
|
|
3947
|
+
Pe as SparkTableToolbar,
|
|
3948
|
+
un as SparkToastContainer,
|
|
3949
|
+
nn as addIcons,
|
|
3950
|
+
bn as create403Route,
|
|
3951
|
+
xn as create404Route,
|
|
3952
|
+
yn as createAuthRoutes,
|
|
3953
|
+
Nr as createAxiosInstance,
|
|
3954
|
+
hn as createBootstrapService,
|
|
3955
|
+
ro as customiseHeader,
|
|
3956
|
+
Fa as deleteCookie,
|
|
3957
|
+
_o as formatTemporal,
|
|
3958
|
+
_n as getAxiosInstance,
|
|
3959
|
+
Ea as getCookie,
|
|
3960
|
+
Ze as getDomain,
|
|
3961
|
+
So as parseDatetime,
|
|
3962
|
+
to as renderHeaderTitle,
|
|
3963
|
+
Aa as setCookie,
|
|
3964
|
+
vn as setupAuthGuards,
|
|
3965
|
+
wn as setupAxios,
|
|
3966
|
+
kn as setupBootstrapGuard,
|
|
3967
|
+
ln as setupFontAwesome,
|
|
3968
|
+
oe as sparkModalService,
|
|
3969
|
+
X as sparkNotificationService,
|
|
3970
|
+
te as sparkOverlayService,
|
|
3971
|
+
Lo as updateRow,
|
|
3972
|
+
De as useSparkAppSelectorStore,
|
|
3973
|
+
je as useSparkAppStore,
|
|
3974
|
+
K as useSparkAuthStore,
|
|
3975
|
+
Ie as useSparkBrandFilterStore,
|
|
3976
|
+
Sn as useSparkNavStore,
|
|
3977
|
+
He as useSparkOverlay,
|
|
3978
|
+
Po as useSparkTableRouteSync
|
|
3796
3979
|
};
|