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