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