@iankibetsh/sh-tailwind 0.1.2 → 0.1.3
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/README.md +36 -314
- package/dist/sh-tailwind.cjs.js +1 -1
- package/dist/sh-tailwind.es.js +723 -492
- package/documentation/actions.md +26 -0
- package/documentation/forms.md +96 -0
- package/documentation/getting-started.md +62 -0
- package/documentation/inputs.md +55 -0
- package/documentation/overlays.md +42 -0
- package/documentation/table.md +98 -0
- package/documentation/tabs.md +138 -0
- package/documentation/theming.md +42 -0
- package/package.json +3 -2
- package/src/components/navigation/ShTabs.vue +246 -0
- package/src/index.js +3 -0
- package/src/theme/defaultTheme.js +20 -0
package/dist/sh-tailwind.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShCore as e, getShConfig as t, shApis as n, shRepo as r, shStorage as i, useUserStore as a } from "@iankibetsh/sh-core";
|
|
2
|
-
import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createTextVNode as h, createVNode as g, getCurrentInstance as _, inject as v, mergeProps as y, nextTick as b, normalizeClass as x, normalizeStyle as S, onBeforeUnmount as C, onMounted as w, onScopeDispose as T, openBlock as E, provide as D, reactive as
|
|
2
|
+
import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createTextVNode as h, createVNode as g, getCurrentInstance as _, inject as v, mergeProps as y, nextTick as b, normalizeClass as x, normalizeStyle as S, onBeforeUnmount as C, onMounted as w, onScopeDispose as T, openBlock as E, provide as D, reactive as O, ref as k, renderList as A, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, toDisplayString as P, unref as F, vModelCheckbox as ee, vModelDynamic as I, vModelSelect as L, vModelText as R, vShow as z, watch as B, withCtx as V, withDirectives as H, withModifiers as U } from "vue";
|
|
3
3
|
//#region src/theme/defaultTheme.js
|
|
4
|
-
var
|
|
4
|
+
var W = {
|
|
5
5
|
form: {
|
|
6
6
|
form: "space-y-4",
|
|
7
7
|
group: "space-y-1",
|
|
@@ -146,26 +146,46 @@ var U = {
|
|
|
146
146
|
multiCount: "inline-flex items-center justify-center rounded-full bg-blue-600 px-2 py-0.5 text-xs font-semibold text-white",
|
|
147
147
|
multiBtn: "inline-flex items-center justify-center gap-1 rounded-md border border-blue-200 px-3 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-50"
|
|
148
148
|
},
|
|
149
|
+
tabs: {
|
|
150
|
+
nav: "flex flex-wrap items-center gap-1 border-b border-gray-200",
|
|
151
|
+
tab: "group relative -mb-px inline-flex items-center gap-2 border-b-2 border-transparent px-3 py-2 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 disabled:pointer-events-none disabled:opacity-40",
|
|
152
|
+
tabActive: "group relative -mb-px inline-flex items-center gap-2 border-b-2 border-blue-600 px-3 py-2 text-sm font-medium text-blue-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40",
|
|
153
|
+
icon: "size-4 shrink-0",
|
|
154
|
+
count: "inline-flex min-w-5 items-center justify-center rounded-full bg-gray-100 px-1.5 py-0.5 text-xs font-semibold text-gray-600",
|
|
155
|
+
countActive: "inline-flex min-w-5 items-center justify-center rounded-full bg-blue-100 px-1.5 py-0.5 text-xs font-semibold text-blue-700",
|
|
156
|
+
panel: "pt-4 focus:outline-none",
|
|
157
|
+
empty: "rounded-md bg-amber-50 px-4 py-3 text-sm text-amber-700",
|
|
158
|
+
pills: {
|
|
159
|
+
nav: "flex flex-wrap items-center gap-1.5",
|
|
160
|
+
tab: "inline-flex items-center gap-2 rounded-full px-3.5 py-1.5 text-sm font-medium text-gray-600 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 disabled:pointer-events-none disabled:opacity-40",
|
|
161
|
+
tabActive: "inline-flex items-center gap-2 rounded-full bg-blue-600 px-3.5 py-1.5 text-sm font-medium text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40"
|
|
162
|
+
},
|
|
163
|
+
boxed: {
|
|
164
|
+
nav: "flex flex-wrap items-center gap-1 border-b border-gray-200",
|
|
165
|
+
tab: "inline-flex items-center gap-2 rounded-t-lg border border-transparent px-3.5 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/40 disabled:pointer-events-none disabled:opacity-40",
|
|
166
|
+
tabActive: "inline-flex items-center gap-2 -mb-px rounded-t-lg border border-gray-200 border-b-white bg-white px-3.5 py-2 text-sm font-medium text-blue-600 focus:outline-none"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
149
169
|
buttons: {
|
|
150
170
|
primary: "inline-flex items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:opacity-60",
|
|
151
171
|
secondary: "inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",
|
|
152
172
|
danger: "inline-flex items-center justify-center gap-2 rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500/40",
|
|
153
173
|
link: "inline-flex cursor-pointer items-center gap-1 text-sm text-blue-600 hover:underline"
|
|
154
174
|
}
|
|
155
|
-
},
|
|
156
|
-
function
|
|
157
|
-
if (!
|
|
175
|
+
}, G = Symbol("sh-tw-theme"), K = Symbol("sh-tw-components"), q = Symbol("sh-dialog-context"), J = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
176
|
+
function te(e, t) {
|
|
177
|
+
if (!J(e)) return t ?? e;
|
|
158
178
|
let n = { ...e };
|
|
159
|
-
return
|
|
160
|
-
|
|
179
|
+
return J(t) && Object.keys(t).forEach((r) => {
|
|
180
|
+
J(e[r]) && J(t[r]) ? n[r] = te(e[r], t[r]) : n[r] = t[r];
|
|
161
181
|
}), n;
|
|
162
182
|
}
|
|
163
183
|
//#endregion
|
|
164
184
|
//#region src/plugin/ShTailwind.js
|
|
165
|
-
var
|
|
185
|
+
var ne = { install(t, n = {}) {
|
|
166
186
|
e.install(t, n);
|
|
167
|
-
let r =
|
|
168
|
-
t.provide(
|
|
187
|
+
let r = te(W, n.theme ?? {});
|
|
188
|
+
t.provide(G, r), t.provide(K, n.formComponents ?? {}), t.provide("formComponents", n.formComponents ?? {}), t.provide("shFormElementClasses", {
|
|
169
189
|
formGroup: r.form.group,
|
|
170
190
|
formLabel: r.form.label,
|
|
171
191
|
formControl: r.form.input,
|
|
@@ -174,40 +194,40 @@ var re = { install(t, n = {}) {
|
|
|
174
194
|
formErrorTitle: r.form.errorTitle,
|
|
175
195
|
actionBtn: r.form.submitBtn
|
|
176
196
|
});
|
|
177
|
-
} },
|
|
197
|
+
} }, Y = (e = {}) => ({ install: (t) => ne.install(t, e) });
|
|
178
198
|
//#endregion
|
|
179
199
|
//#region src/theme/useTheme.js
|
|
180
|
-
function
|
|
181
|
-
let n = v(
|
|
182
|
-
return l(() =>
|
|
200
|
+
function X(e, t = null) {
|
|
201
|
+
let n = v(G, W);
|
|
202
|
+
return l(() => te(n[e] ?? W[e], F(t) ?? {}));
|
|
183
203
|
}
|
|
184
204
|
//#endregion
|
|
185
205
|
//#region src/composables/useScrollLock.js
|
|
186
|
-
var
|
|
187
|
-
function
|
|
188
|
-
if (++
|
|
206
|
+
var re = 0;
|
|
207
|
+
function ie() {
|
|
208
|
+
if (++re === 1) {
|
|
189
209
|
let e = window.innerWidth - document.documentElement.clientWidth;
|
|
190
210
|
e > 0 && (document.body.style.paddingRight = `${e}px`), document.body.style.overflow = "hidden";
|
|
191
211
|
}
|
|
192
212
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
213
|
+
function Z() {
|
|
214
|
+
re > 0 && --re === 0 && (document.body.style.overflow = "", document.body.style.paddingRight = "");
|
|
195
215
|
}
|
|
196
216
|
//#endregion
|
|
197
217
|
//#region src/composables/useDialog.js
|
|
198
|
-
var
|
|
199
|
-
function
|
|
200
|
-
let r =
|
|
201
|
-
t.key === "Escape" &&
|
|
218
|
+
var ae = 50, oe = [];
|
|
219
|
+
function se({ isStatic: e, onClose: t, onOpen: n } = {}) {
|
|
220
|
+
let r = k(!1), i = k(ae), a = null, o = {}, s = (t) => {
|
|
221
|
+
t.key === "Escape" && oe[oe.length - 1] === o && (e?.() || l("escape"));
|
|
202
222
|
};
|
|
203
223
|
function c() {
|
|
204
|
-
r.value || (a = document.activeElement, i.value =
|
|
224
|
+
r.value || (a = document.activeElement, i.value = ae + oe.length * 10, oe.push(o), r.value = !0, ie(), document.addEventListener("keydown", s), n?.());
|
|
205
225
|
}
|
|
206
226
|
function l(e = "api") {
|
|
207
227
|
if (!r.value) return;
|
|
208
228
|
r.value = !1;
|
|
209
|
-
let n =
|
|
210
|
-
n >= 0 &&
|
|
229
|
+
let n = oe.indexOf(o);
|
|
230
|
+
n >= 0 && oe.splice(n, 1), Z(), document.removeEventListener("keydown", s), a?.focus?.(), t?.(e);
|
|
211
231
|
}
|
|
212
232
|
function u() {
|
|
213
233
|
e?.() || l("backdrop");
|
|
@@ -224,7 +244,7 @@ function ce({ isStatic: e, onClose: t, onOpen: n } = {}) {
|
|
|
224
244
|
}
|
|
225
245
|
//#endregion
|
|
226
246
|
//#region src/utils/strings.js
|
|
227
|
-
var
|
|
247
|
+
var ce = (e) => String(e ?? "").replace(/[_-]+/g, " ").replace(/([a-z\d])([A-Z])/g, "$1 $2").trim().split(/\s+/).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "), Q = {
|
|
228
248
|
password: "password",
|
|
229
249
|
pin: "pin",
|
|
230
250
|
password_confirmation: "password",
|
|
@@ -238,22 +258,22 @@ var le = (e) => String(e ?? "").replace(/[_-]+/g, " ").replace(/([a-z\d])([A-Z])
|
|
|
238
258
|
age: "number",
|
|
239
259
|
date: "date"
|
|
240
260
|
};
|
|
241
|
-
function
|
|
261
|
+
function le(e) {
|
|
242
262
|
if (e.type) return e.type;
|
|
243
263
|
if (e.component) return "custom";
|
|
244
264
|
if (e.options) return e.multiple || e.allowCustom ? "suggest" : "select";
|
|
245
265
|
let t = e.name ?? "";
|
|
246
|
-
return
|
|
266
|
+
return Q[t] ? Q[t] : /_email$/.test(t) ? "email" : /_phone$/.test(t) ? "phone" : /(_at|_date|_on)$/.test(t) ? "date" : "text";
|
|
247
267
|
}
|
|
248
|
-
function
|
|
268
|
+
function ue(e, t = {}) {
|
|
249
269
|
return (e ?? []).map((e) => {
|
|
250
270
|
let n = typeof e == "string" ? { name: e } : { ...e };
|
|
251
|
-
return n.name = n.name ?? n.field, n.name ? (n.type =
|
|
271
|
+
return n.name = n.name ?? n.field, n.name ? (n.type = le(n), n.label !== !1 && (n.label = n.label ?? ce(n.name)), n.placeholder = n.placeholder ?? "", n.helper = n.helper ?? "", n.required = !!n.required, n.value = n.value ?? t?.[n.name] ?? null, n) : (console.warn("[sh-tailwind] form field without a name was skipped", e), null);
|
|
252
272
|
}).filter(Boolean);
|
|
253
273
|
}
|
|
254
274
|
//#endregion
|
|
255
275
|
//#region src/components/form/ShFormSteps.vue
|
|
256
|
-
var
|
|
276
|
+
var de = {
|
|
257
277
|
key: 0,
|
|
258
278
|
xmlns: "http://www.w3.org/2000/svg",
|
|
259
279
|
class: "size-4",
|
|
@@ -261,7 +281,7 @@ var fe = {
|
|
|
261
281
|
viewBox: "0 0 24 24",
|
|
262
282
|
stroke: "currentColor",
|
|
263
283
|
"stroke-width": "2.5"
|
|
264
|
-
},
|
|
284
|
+
}, fe = {
|
|
265
285
|
__name: "ShFormSteps",
|
|
266
286
|
props: {
|
|
267
287
|
steps: {
|
|
@@ -274,35 +294,35 @@ var fe = {
|
|
|
274
294
|
}
|
|
275
295
|
},
|
|
276
296
|
setup(e) {
|
|
277
|
-
let t =
|
|
278
|
-
return (n, r) => (E(), f("div", { class: x(
|
|
297
|
+
let t = X("form");
|
|
298
|
+
return (n, r) => (E(), f("div", { class: x(F(t).steps.wrapper) }, [(E(!0), f(o, null, A(e.steps, (n, i) => (E(), f("div", {
|
|
279
299
|
key: i,
|
|
280
|
-
class: x(
|
|
300
|
+
class: x(F(t).steps.step)
|
|
281
301
|
}, [
|
|
282
302
|
i > 0 ? (E(), f("div", {
|
|
283
303
|
key: 0,
|
|
284
|
-
class: x(i <= e.current ?
|
|
304
|
+
class: x(i <= e.current ? F(t).steps.connectorDone : F(t).steps.connector)
|
|
285
305
|
}, null, 2)) : d("", !0),
|
|
286
|
-
p("div", { class: x(i < e.current ?
|
|
306
|
+
p("div", { class: x(i < e.current ? F(t).steps.circleDone : i === e.current ? F(t).steps.circleActive : F(t).steps.circle) }, [i < e.current ? (E(), f("svg", de, [...r[0] ||= [p("path", {
|
|
287
307
|
"stroke-linecap": "round",
|
|
288
308
|
"stroke-linejoin": "round",
|
|
289
309
|
d: "M4.5 12.75l6 6 9-13.5"
|
|
290
|
-
}, null, -1)]])) : (E(), f(o, { key: 1 }, [h(
|
|
291
|
-
p("span", { class: x(i === e.current ?
|
|
310
|
+
}, null, -1)]])) : (E(), f(o, { key: 1 }, [h(P(i + 1), 1)], 64))], 2),
|
|
311
|
+
p("span", { class: x(i === e.current ? F(t).steps.titleActive : F(t).steps.title) }, P(n.title), 3)
|
|
292
312
|
], 2))), 128))], 2));
|
|
293
313
|
}
|
|
294
|
-
},
|
|
314
|
+
}, pe = (e, t) => {
|
|
295
315
|
let n = e.__vccOpts || e;
|
|
296
316
|
for (let [e, r] of t) n[e] = r;
|
|
297
317
|
return n;
|
|
298
|
-
},
|
|
318
|
+
}, me = {}, he = {
|
|
299
319
|
class: "animate-spin",
|
|
300
320
|
xmlns: "http://www.w3.org/2000/svg",
|
|
301
321
|
fill: "none",
|
|
302
322
|
viewBox: "0 0 24 24"
|
|
303
323
|
};
|
|
304
|
-
function
|
|
305
|
-
return E(), f("svg",
|
|
324
|
+
function ge(e, t) {
|
|
325
|
+
return E(), f("svg", he, [...t[0] ||= [p("circle", {
|
|
306
326
|
class: "opacity-25",
|
|
307
327
|
cx: "12",
|
|
308
328
|
cy: "12",
|
|
@@ -315,7 +335,7 @@ function _e(e, t) {
|
|
|
315
335
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
316
336
|
}, null, -1)]]);
|
|
317
337
|
}
|
|
318
|
-
var
|
|
338
|
+
var _e = /*#__PURE__*/ pe(me, [["render", ge]]), ve = ["placeholder", "disabled"], ye = {
|
|
319
339
|
__name: "TextInput",
|
|
320
340
|
props: {
|
|
321
341
|
modelValue: [String, Number],
|
|
@@ -329,13 +349,13 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
329
349
|
get: () => n.modelValue,
|
|
330
350
|
set: (e) => r("update:modelValue", e)
|
|
331
351
|
});
|
|
332
|
-
return (t, n) =>
|
|
352
|
+
return (t, n) => H((E(), f("input", {
|
|
333
353
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
334
354
|
type: "text",
|
|
335
355
|
placeholder: e.placeholder,
|
|
336
356
|
disabled: e.disabled,
|
|
337
357
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
338
|
-
}, null, 40,
|
|
358
|
+
}, null, 40, ve)), [[R, i.value]]);
|
|
339
359
|
}
|
|
340
360
|
}, be = [
|
|
341
361
|
"rows",
|
|
@@ -359,15 +379,15 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
359
379
|
get: () => n.modelValue,
|
|
360
380
|
set: (e) => r("update:modelValue", e)
|
|
361
381
|
});
|
|
362
|
-
return (t, n) =>
|
|
382
|
+
return (t, n) => H((E(), f("textarea", {
|
|
363
383
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
364
384
|
rows: e.rows,
|
|
365
385
|
placeholder: e.placeholder,
|
|
366
386
|
disabled: e.disabled,
|
|
367
387
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
368
|
-
}, null, 40, be)), [[
|
|
388
|
+
}, null, 40, be)), [[R, i.value]]);
|
|
369
389
|
}
|
|
370
|
-
},
|
|
390
|
+
}, Se = ["placeholder", "disabled"], Ce = {
|
|
371
391
|
__name: "EmailInput",
|
|
372
392
|
props: {
|
|
373
393
|
modelValue: String,
|
|
@@ -381,21 +401,21 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
381
401
|
get: () => n.modelValue,
|
|
382
402
|
set: (e) => r("update:modelValue", e)
|
|
383
403
|
});
|
|
384
|
-
return (t, n) =>
|
|
404
|
+
return (t, n) => H((E(), f("input", {
|
|
385
405
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
386
406
|
type: "email",
|
|
387
407
|
autocomplete: "email",
|
|
388
408
|
placeholder: e.placeholder,
|
|
389
409
|
disabled: e.disabled,
|
|
390
410
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
391
|
-
}, null, 40,
|
|
411
|
+
}, null, 40, Se)), [[R, i.value]]);
|
|
392
412
|
}
|
|
393
|
-
},
|
|
413
|
+
}, we = [
|
|
394
414
|
"type",
|
|
395
415
|
"autocomplete",
|
|
396
416
|
"placeholder",
|
|
397
417
|
"disabled"
|
|
398
|
-
],
|
|
418
|
+
], $ = {
|
|
399
419
|
key: 0,
|
|
400
420
|
xmlns: "http://www.w3.org/2000/svg",
|
|
401
421
|
class: "size-4",
|
|
@@ -403,7 +423,7 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
403
423
|
viewBox: "0 0 24 24",
|
|
404
424
|
stroke: "currentColor",
|
|
405
425
|
"stroke-width": "1.5"
|
|
406
|
-
},
|
|
426
|
+
}, Te = {
|
|
407
427
|
key: 1,
|
|
408
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
409
429
|
class: "size-4",
|
|
@@ -411,7 +431,7 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
411
431
|
viewBox: "0 0 24 24",
|
|
412
432
|
stroke: "currentColor",
|
|
413
433
|
"stroke-width": "1.5"
|
|
414
|
-
},
|
|
434
|
+
}, Ee = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
415
435
|
__name: "PasswordInput",
|
|
416
436
|
props: {
|
|
417
437
|
modelValue: String,
|
|
@@ -425,11 +445,11 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
425
445
|
},
|
|
426
446
|
emits: ["update:modelValue", "clearValidationErrors"],
|
|
427
447
|
setup(e, { emit: t }) {
|
|
428
|
-
let n = e, r = t, i =
|
|
448
|
+
let n = e, r = t, i = X("inputs"), a = k(!1), o = l({
|
|
429
449
|
get: () => n.modelValue,
|
|
430
450
|
set: (e) => r("update:modelValue", e)
|
|
431
451
|
});
|
|
432
|
-
return (t, n) => (E(), f("div", { class: x(
|
|
452
|
+
return (t, n) => (E(), f("div", { class: x(F(i).passwordWrapper) }, [H(p("input", y(t.$attrs, {
|
|
433
453
|
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
434
454
|
type: a.value ? "text" : "password",
|
|
435
455
|
autocomplete: e.autocomplete,
|
|
@@ -437,16 +457,16 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
437
457
|
disabled: e.disabled,
|
|
438
458
|
class: "pr-9",
|
|
439
459
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
440
|
-
}), null, 16,
|
|
460
|
+
}), null, 16, we), [[I, o.value]]), p("button", {
|
|
441
461
|
type: "button",
|
|
442
|
-
class: x(
|
|
462
|
+
class: x(F(i).passwordToggle),
|
|
443
463
|
tabindex: "-1",
|
|
444
464
|
onClick: n[2] ||= (e) => a.value = !a.value
|
|
445
|
-
}, [a.value ? (E(), f("svg",
|
|
465
|
+
}, [a.value ? (E(), f("svg", Te, [...n[4] ||= [p("path", {
|
|
446
466
|
"stroke-linecap": "round",
|
|
447
467
|
"stroke-linejoin": "round",
|
|
448
468
|
d: "M3.98 8.22A10.48 10.48 0 002.04 11.68a1.01 1.01 0 000 .64C3.42 16.49 7.36 19.5 12 19.5c.99 0 1.95-.14 2.86-.39M6.23 6.23A10.45 10.45 0 0112 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64a10.5 10.5 0 01-4.19 5.45M6.23 6.23L3 3m3.23 3.23l3.65 3.65m7.89 7.89L21 21m-3.23-3.23l-3.65-3.65m0 0a3 3 0 10-4.24-4.24m4.24 4.24L9.88 9.88"
|
|
449
|
-
}, null, -1)]])) : (E(), f("svg",
|
|
469
|
+
}, null, -1)]])) : (E(), f("svg", $, [...n[3] ||= [p("path", {
|
|
450
470
|
"stroke-linecap": "round",
|
|
451
471
|
"stroke-linejoin": "round",
|
|
452
472
|
d: "M2.04 12.32a1.01 1.01 0 010-.64C3.42 7.51 7.36 4.5 12 4.5c4.64 0 8.57 3.01 9.96 7.18.07.21.07.43 0 .64C20.58 16.49 16.64 19.5 12 19.5c-4.64 0-8.57-3.01-9.96-7.18z"
|
|
@@ -456,13 +476,13 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
456
476
|
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
457
477
|
}, null, -1)]]))], 2)], 2));
|
|
458
478
|
}
|
|
459
|
-
}),
|
|
479
|
+
}), De = [
|
|
460
480
|
"value",
|
|
461
481
|
"type",
|
|
462
482
|
"disabled",
|
|
463
483
|
"onInput",
|
|
464
484
|
"onKeydown"
|
|
465
|
-
],
|
|
485
|
+
], Oe = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
466
486
|
__name: "PinInput",
|
|
467
487
|
props: {
|
|
468
488
|
modelValue: [String, Number],
|
|
@@ -480,11 +500,11 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
480
500
|
"complete"
|
|
481
501
|
],
|
|
482
502
|
setup(e, { emit: t }) {
|
|
483
|
-
let n = e, r = t, i =
|
|
503
|
+
let n = e, r = t, i = X("inputs"), a = l(() => Math.max(1, parseInt(n.length) || 4)), s = k([]), c = k([]), u = (e) => {
|
|
484
504
|
let t = String(e ?? "").replace(/\D/g, "").slice(0, a.value).split("");
|
|
485
505
|
c.value = Array.from({ length: a.value }, (e, n) => t[n] ?? "");
|
|
486
506
|
};
|
|
487
|
-
u(n.modelValue),
|
|
507
|
+
u(n.modelValue), B(a, () => u(n.modelValue)), B(() => n.modelValue, (e) => {
|
|
488
508
|
e !== c.value.join("") && u(e);
|
|
489
509
|
});
|
|
490
510
|
let d = () => {
|
|
@@ -515,7 +535,7 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
515
535
|
let t = (e.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, a.value);
|
|
516
536
|
u(t), d(), p(Math.min(t.length, a.value - 1));
|
|
517
537
|
}, _ = (e) => n.isInvalid ? i.value.pin.boxInvalid : c.value[e] ? i.value.pin.boxFilled : i.value.pin.box;
|
|
518
|
-
return (t, n) => (E(), f("div", { class: x(
|
|
538
|
+
return (t, n) => (E(), f("div", { class: x(F(i).pin.wrapper) }, [(E(!0), f(o, null, A(c.value, (t, i) => (E(), f("input", {
|
|
519
539
|
key: i,
|
|
520
540
|
ref_for: !0,
|
|
521
541
|
ref: (e) => s.value[i] = e,
|
|
@@ -532,26 +552,26 @@ var ve = /*#__PURE__*/ me(he, [["render", _e]]), ye = ["placeholder", "disabled"
|
|
|
532
552
|
onFocus: n[0] ||= (e) => {
|
|
533
553
|
e.target.select(), r("clearValidationErrors");
|
|
534
554
|
}
|
|
535
|
-
}, null, 42,
|
|
555
|
+
}, null, 42, De))), 128))], 2));
|
|
536
556
|
}
|
|
537
|
-
}),
|
|
557
|
+
}), ke = {
|
|
538
558
|
"#": /[0-9]/,
|
|
539
559
|
A: /[a-zA-Z]/,
|
|
540
560
|
N: /[a-zA-Z0-9]/,
|
|
541
561
|
"*": /[a-zA-Z0-9]/
|
|
542
|
-
},
|
|
562
|
+
}, Ae = [
|
|
543
563
|
"money",
|
|
544
564
|
"integer",
|
|
545
565
|
"number",
|
|
546
566
|
"decimal"
|
|
547
567
|
];
|
|
548
|
-
function
|
|
549
|
-
return typeof e == "string" &&
|
|
568
|
+
function je(e) {
|
|
569
|
+
return typeof e == "string" && Ae.includes(e);
|
|
550
570
|
}
|
|
551
|
-
function
|
|
571
|
+
function Me(e, t, { unmask: n = !1 } = {}) {
|
|
552
572
|
let r = String(e ?? "").split(""), i = "", a = "", o = 0;
|
|
553
573
|
for (let e = 0; e < t.length; e++) {
|
|
554
|
-
let n =
|
|
574
|
+
let n = ke[t[e]];
|
|
555
575
|
if (n) {
|
|
556
576
|
for (; o < r.length && !n.test(r[o]);) o++;
|
|
557
577
|
if (o >= r.length) break;
|
|
@@ -563,7 +583,7 @@ function je(e, t, { unmask: n = !1 } = {}) {
|
|
|
563
583
|
model: n ? a : i
|
|
564
584
|
};
|
|
565
585
|
}
|
|
566
|
-
function
|
|
586
|
+
function Ne(e, { decimals: t = 2, prefix: n = "", suffix: r = "", integer: i = !1 } = {}) {
|
|
567
587
|
let a = String(e ?? "").replace(/[^0-9.]/g, ""), o = a.indexOf(".");
|
|
568
588
|
o !== -1 && (a = a.slice(0, o + 1) + a.slice(o + 1).replace(/\./g, "")), i && (a = a.split(".")[0]);
|
|
569
589
|
let [s = "", c] = a.split(".");
|
|
@@ -574,7 +594,7 @@ function Me(e, { decimals: t = 2, prefix: n = "", suffix: r = "", integer: i = !
|
|
|
574
594
|
model: f
|
|
575
595
|
};
|
|
576
596
|
}
|
|
577
|
-
function
|
|
597
|
+
function Pe(e, t) {
|
|
578
598
|
if (typeof t == "function") {
|
|
579
599
|
let n = t(e) ?? "";
|
|
580
600
|
return {
|
|
@@ -582,24 +602,24 @@ function Ne(e, t) {
|
|
|
582
602
|
model: String(n)
|
|
583
603
|
};
|
|
584
604
|
}
|
|
585
|
-
return t && typeof t == "object" ? t.pattern ?
|
|
605
|
+
return t && typeof t == "object" ? t.pattern ? Me(e, t.pattern, t) : Ne(e, t) : je(t) ? Ne(e, {
|
|
586
606
|
integer: t === "integer" || t === "number",
|
|
587
607
|
decimals: t === "integer" || t === "number" ? 0 : 2
|
|
588
|
-
}) :
|
|
608
|
+
}) : Me(e, String(t));
|
|
589
609
|
}
|
|
590
|
-
function
|
|
591
|
-
if (
|
|
610
|
+
function Fe(e) {
|
|
611
|
+
if (je(e) || e && typeof e == "object" && !e.pattern) return "decimal";
|
|
592
612
|
let t = typeof e == "string" ? e : e && e.pattern;
|
|
593
613
|
return typeof t == "string" && /^[#\s().+-]*$/.test(t) ? "numeric" : "text";
|
|
594
614
|
}
|
|
595
615
|
//#endregion
|
|
596
616
|
//#region src/components/form/inputs/MaskedInput.vue
|
|
597
|
-
var
|
|
617
|
+
var Ie = [
|
|
598
618
|
"value",
|
|
599
619
|
"inputmode",
|
|
600
620
|
"placeholder",
|
|
601
621
|
"disabled"
|
|
602
|
-
],
|
|
622
|
+
], Le = {
|
|
603
623
|
__name: "MaskedInput",
|
|
604
624
|
props: {
|
|
605
625
|
modelValue: [String, Number],
|
|
@@ -617,14 +637,14 @@ var Fe = [
|
|
|
617
637
|
},
|
|
618
638
|
emits: ["update:modelValue", "clearValidationErrors"],
|
|
619
639
|
setup(e, { emit: t }) {
|
|
620
|
-
let n = e, r = t, i =
|
|
621
|
-
let { display: t } =
|
|
640
|
+
let n = e, r = t, i = k(""), a = (e) => {
|
|
641
|
+
let { display: t } = Pe(e, n.mask);
|
|
622
642
|
t !== i.value && (i.value = t);
|
|
623
643
|
};
|
|
624
|
-
|
|
644
|
+
B(() => n.modelValue, a, { immediate: !0 }), B(() => n.mask, () => a(n.modelValue));
|
|
625
645
|
let o = (e) => {
|
|
626
646
|
r("clearValidationErrors");
|
|
627
|
-
let t = e.target, a = t.selectionStart ?? t.value.length, o = t.value.length, { display: s, model: c } =
|
|
647
|
+
let t = e.target, a = t.selectionStart ?? t.value.length, o = t.value.length, { display: s, model: c } = Pe(t.value, n.mask);
|
|
628
648
|
i.value = s, r("update:modelValue", c), b(() => {
|
|
629
649
|
if (t.type !== "text" && t.type !== "tel") return;
|
|
630
650
|
let e = a + (s.length - o);
|
|
@@ -637,20 +657,20 @@ var Fe = [
|
|
|
637
657
|
return (t, n) => (E(), f("input", {
|
|
638
658
|
value: i.value,
|
|
639
659
|
type: "text",
|
|
640
|
-
inputmode:
|
|
660
|
+
inputmode: F(Fe)(e.mask),
|
|
641
661
|
placeholder: e.placeholder,
|
|
642
662
|
disabled: e.disabled,
|
|
643
663
|
onInput: o,
|
|
644
664
|
onFocus: n[0] ||= (e) => r("clearValidationErrors")
|
|
645
|
-
}, null, 40,
|
|
665
|
+
}, null, 40, Ie));
|
|
646
666
|
}
|
|
647
|
-
},
|
|
667
|
+
}, Re = [
|
|
648
668
|
"min",
|
|
649
669
|
"max",
|
|
650
670
|
"step",
|
|
651
671
|
"placeholder",
|
|
652
672
|
"disabled"
|
|
653
|
-
],
|
|
673
|
+
], ze = {
|
|
654
674
|
__name: "NumberInput",
|
|
655
675
|
props: {
|
|
656
676
|
modelValue: [String, Number],
|
|
@@ -667,7 +687,7 @@ var Fe = [
|
|
|
667
687
|
get: () => n.modelValue,
|
|
668
688
|
set: (e) => r("update:modelValue", e)
|
|
669
689
|
});
|
|
670
|
-
return (t, n) =>
|
|
690
|
+
return (t, n) => H((E(), f("input", {
|
|
671
691
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
672
692
|
type: "number",
|
|
673
693
|
min: e.min,
|
|
@@ -676,14 +696,14 @@ var Fe = [
|
|
|
676
696
|
placeholder: e.placeholder,
|
|
677
697
|
disabled: e.disabled,
|
|
678
698
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
679
|
-
}, null, 40,
|
|
699
|
+
}, null, 40, Re)), [[R, i.value]]);
|
|
680
700
|
}
|
|
681
|
-
},
|
|
701
|
+
}, Be = [
|
|
682
702
|
"type",
|
|
683
703
|
"min",
|
|
684
704
|
"max",
|
|
685
705
|
"disabled"
|
|
686
|
-
],
|
|
706
|
+
], Ve = {
|
|
687
707
|
__name: "DateInput",
|
|
688
708
|
props: {
|
|
689
709
|
modelValue: String,
|
|
@@ -699,19 +719,19 @@ var Fe = [
|
|
|
699
719
|
get: () => n.modelValue,
|
|
700
720
|
set: (e) => r("update:modelValue", e)
|
|
701
721
|
});
|
|
702
|
-
return (t, n) =>
|
|
722
|
+
return (t, n) => H((E(), f("input", {
|
|
703
723
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
704
724
|
type: e.withTime ? "datetime-local" : "date",
|
|
705
725
|
min: e.min,
|
|
706
726
|
max: e.max,
|
|
707
727
|
disabled: e.disabled,
|
|
708
728
|
onFocus: n[1] ||= (e) => r("clearValidationErrors")
|
|
709
|
-
}, null, 40,
|
|
729
|
+
}, null, 40, Be)), [[I, i.value]]);
|
|
710
730
|
}
|
|
711
731
|
};
|
|
712
732
|
//#endregion
|
|
713
733
|
//#region src/utils/normalizeOptions.js
|
|
714
|
-
function
|
|
734
|
+
function He(e) {
|
|
715
735
|
return Array.isArray(e) ? e.map((e) => {
|
|
716
736
|
if (e == null) return null;
|
|
717
737
|
if (typeof e != "object") return {
|
|
@@ -728,10 +748,10 @@ function Ve(e) {
|
|
|
728
748
|
}
|
|
729
749
|
//#endregion
|
|
730
750
|
//#region src/components/form/inputs/SelectInput.vue
|
|
731
|
-
var
|
|
751
|
+
var Ue = ["disabled"], We = {
|
|
732
752
|
value: null,
|
|
733
753
|
disabled: ""
|
|
734
|
-
},
|
|
754
|
+
}, Ge = ["value"], Ke = {
|
|
735
755
|
__name: "SelectInput",
|
|
736
756
|
props: {
|
|
737
757
|
modelValue: [String, Number],
|
|
@@ -743,7 +763,7 @@ var He = ["disabled"], Ue = {
|
|
|
743
763
|
},
|
|
744
764
|
emits: ["update:modelValue", "clearValidationErrors"],
|
|
745
765
|
setup(e, { emit: t }) {
|
|
746
|
-
let r = e, i = t, a =
|
|
766
|
+
let r = e, i = t, a = k([]), s = k(!1), c = l(() => He(r.options ?? a.value)), u = l({
|
|
747
767
|
get: () => r.modelValue,
|
|
748
768
|
set: (e) => i("update:modelValue", e)
|
|
749
769
|
});
|
|
@@ -753,16 +773,16 @@ var He = ["disabled"], Ue = {
|
|
|
753
773
|
}).finally(() => {
|
|
754
774
|
s.value = !1;
|
|
755
775
|
}));
|
|
756
|
-
}), (t, n) =>
|
|
776
|
+
}), (t, n) => H((E(), f("select", {
|
|
757
777
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
758
778
|
disabled: e.disabled || s.value,
|
|
759
779
|
onFocus: n[1] ||= (e) => i("clearValidationErrors")
|
|
760
|
-
}, [p("option",
|
|
780
|
+
}, [p("option", We, P(s.value ? "Loading..." : e.placeholder || "Select..."), 1), (E(!0), f(o, null, A(c.value, (e) => (E(), f("option", {
|
|
761
781
|
key: e.id,
|
|
762
782
|
value: e.id
|
|
763
|
-
},
|
|
783
|
+
}, P(e.label), 9, Ge))), 128))], 40, Ue)), [[L, u.value]]);
|
|
764
784
|
}
|
|
765
|
-
},
|
|
785
|
+
}, qe = [
|
|
766
786
|
{
|
|
767
787
|
name: "Afghanistan",
|
|
768
788
|
dialCode: "+93",
|
|
@@ -2233,11 +2253,11 @@ var He = ["disabled"], Ue = {
|
|
|
2233
2253
|
isoCode: "ZW",
|
|
2234
2254
|
flag: "https://www.countryflags.io/ZW/flat/64.png"
|
|
2235
2255
|
}
|
|
2236
|
-
],
|
|
2256
|
+
], Je = ["disabled", "aria-expanded"], Ye = ["placeholder", "disabled"], Xe = [
|
|
2237
2257
|
"aria-selected",
|
|
2238
2258
|
"onPointerdown",
|
|
2239
2259
|
"onMouseenter"
|
|
2240
|
-
],
|
|
2260
|
+
], Ze = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
2241
2261
|
__name: "PhoneInput",
|
|
2242
2262
|
props: {
|
|
2243
2263
|
modelValue: String,
|
|
@@ -2255,13 +2275,13 @@ var He = ["disabled"], Ue = {
|
|
|
2255
2275
|
},
|
|
2256
2276
|
emits: ["update:modelValue", "clearValidationErrors"],
|
|
2257
2277
|
setup(e, { emit: t }) {
|
|
2258
|
-
let r = e, i = t, a =
|
|
2278
|
+
let r = e, i = t, a = X("inputs"), s = k(null), c = k(null), u = k(""), m = k(!1), h = k(""), g = k(-1), _ = k(qe.find((e) => e.isoCode === r.countryCode.toUpperCase()) ?? qe[0]), v = (e) => String(e ?? "").toUpperCase().split("").map((e) => String.fromCodePoint(127462 + e.charCodeAt(0) - 65)).join(""), y = l(() => {
|
|
2259
2279
|
let e = h.value.trim().toLowerCase();
|
|
2260
|
-
return e ?
|
|
2280
|
+
return e ? qe.filter((t) => t.name.toLowerCase().includes(e) || t.dialCode.includes(e) || t.isoCode.toLowerCase().includes(e)) : qe;
|
|
2261
2281
|
}), S = async () => {
|
|
2262
2282
|
r.disabled || (m.value = !m.value, m.value && (h.value = "", g.value = -1, await b(), c.value?.focus()));
|
|
2263
2283
|
}, T = (e) => {
|
|
2264
|
-
_.value = e, m.value = !1,
|
|
2284
|
+
_.value = e, m.value = !1, O();
|
|
2265
2285
|
}, D = (e) => {
|
|
2266
2286
|
if (e.key === "ArrowDown") e.preventDefault(), g.value = Math.min(g.value + 1, y.value.length - 1);
|
|
2267
2287
|
else if (e.key === "ArrowUp") e.preventDefault(), g.value = Math.max(g.value - 1, 0);
|
|
@@ -2270,46 +2290,46 @@ var He = ["disabled"], Ue = {
|
|
|
2270
2290
|
let t = y.value[Math.max(g.value, 0)];
|
|
2271
2291
|
t && T(t);
|
|
2272
2292
|
} else e.key === "Escape" && (m.value = !1);
|
|
2273
|
-
},
|
|
2293
|
+
}, O = () => {
|
|
2274
2294
|
let e = (u.value || "").replace(/^0/, "");
|
|
2275
2295
|
i("update:modelValue", e ? _.value.dialCode + e : "");
|
|
2276
|
-
},
|
|
2296
|
+
}, j = (e) => {
|
|
2277
2297
|
if (!e) {
|
|
2278
2298
|
u.value = "";
|
|
2279
2299
|
return;
|
|
2280
2300
|
}
|
|
2281
|
-
let t =
|
|
2301
|
+
let t = qe.find((t) => e.startsWith(t.dialCode));
|
|
2282
2302
|
t ? (_.value = t, u.value = e.replace(t.dialCode, "")) : u.value = e;
|
|
2283
2303
|
};
|
|
2284
|
-
|
|
2285
|
-
let
|
|
2304
|
+
B(() => r.modelValue, j);
|
|
2305
|
+
let M = (e) => {
|
|
2286
2306
|
s.value && !s.value.contains(e.target) && (m.value = !1);
|
|
2287
2307
|
};
|
|
2288
2308
|
return w(() => {
|
|
2289
|
-
document.addEventListener("pointerdown",
|
|
2290
|
-
let t = e.data?.countryCode, n = t &&
|
|
2309
|
+
document.addEventListener("pointerdown", M), j(r.modelValue), r.detectCountry && !r.modelValue && n.doGet("sh-country-code").then((e) => {
|
|
2310
|
+
let t = e.data?.countryCode, n = t && qe.find((e) => e.isoCode === t.toUpperCase());
|
|
2291
2311
|
n && (_.value = n);
|
|
2292
2312
|
}).catch(() => {});
|
|
2293
2313
|
}), C(() => {
|
|
2294
|
-
document.removeEventListener("pointerdown",
|
|
2314
|
+
document.removeEventListener("pointerdown", M);
|
|
2295
2315
|
}), (t, n) => (E(), f("div", {
|
|
2296
2316
|
ref_key: "root",
|
|
2297
2317
|
ref: s,
|
|
2298
|
-
class: x([
|
|
2318
|
+
class: x([F(a).phone.wrapper, e.isInvalid ? "border-red-500 focus-within:ring-red-500/30" : ""])
|
|
2299
2319
|
}, [
|
|
2300
2320
|
p("button", {
|
|
2301
2321
|
type: "button",
|
|
2302
|
-
class: x(
|
|
2322
|
+
class: x(F(a).phone.trigger),
|
|
2303
2323
|
disabled: e.disabled,
|
|
2304
2324
|
"aria-haspopup": "listbox",
|
|
2305
2325
|
"aria-expanded": m.value,
|
|
2306
2326
|
onClick: S
|
|
2307
2327
|
}, [
|
|
2308
|
-
p("span", { class: x(
|
|
2309
|
-
p("span", { class: x(
|
|
2328
|
+
p("span", { class: x(F(a).phone.flag) }, P(v(_.value.isoCode)), 3),
|
|
2329
|
+
p("span", { class: x(F(a).phone.dial) }, P(_.value.dialCode), 3),
|
|
2310
2330
|
(E(), f("svg", {
|
|
2311
2331
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2312
|
-
class: x(
|
|
2332
|
+
class: x(F(a).phone.chevron),
|
|
2313
2333
|
fill: "none",
|
|
2314
2334
|
viewBox: "0 0 24 24",
|
|
2315
2335
|
stroke: "currentColor",
|
|
@@ -2319,50 +2339,50 @@ var He = ["disabled"], Ue = {
|
|
|
2319
2339
|
"stroke-linejoin": "round",
|
|
2320
2340
|
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
2321
2341
|
}, null, -1)]], 2))
|
|
2322
|
-
], 10,
|
|
2323
|
-
|
|
2342
|
+
], 10, Je),
|
|
2343
|
+
H(p("input", {
|
|
2324
2344
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
2325
2345
|
type: "tel",
|
|
2326
|
-
class: x(
|
|
2346
|
+
class: x(F(a).phone.input),
|
|
2327
2347
|
placeholder: e.placeholder,
|
|
2328
2348
|
disabled: e.disabled,
|
|
2329
|
-
onInput:
|
|
2349
|
+
onInput: O,
|
|
2330
2350
|
onFocus: n[1] ||= (e) => i("clearValidationErrors")
|
|
2331
|
-
}, null, 42,
|
|
2351
|
+
}, null, 42, Ye), [[R, u.value]]),
|
|
2332
2352
|
m.value ? (E(), f("div", {
|
|
2333
2353
|
key: 0,
|
|
2334
|
-
class: x(
|
|
2335
|
-
}, [
|
|
2354
|
+
class: x(F(a).phone.dropdown)
|
|
2355
|
+
}, [H(p("input", {
|
|
2336
2356
|
ref_key: "searchEl",
|
|
2337
2357
|
ref: c,
|
|
2338
2358
|
"onUpdate:modelValue": n[2] ||= (e) => h.value = e,
|
|
2339
2359
|
type: "text",
|
|
2340
|
-
class: x(
|
|
2360
|
+
class: x(F(a).phone.search),
|
|
2341
2361
|
placeholder: "Search country or code...",
|
|
2342
2362
|
onKeydown: D,
|
|
2343
2363
|
onInput: n[3] ||= (e) => g.value = 0
|
|
2344
|
-
}, null, 34), [[
|
|
2345
|
-
class: x(
|
|
2364
|
+
}, null, 34), [[R, h.value]]), p("div", {
|
|
2365
|
+
class: x(F(a).phone.list),
|
|
2346
2366
|
role: "listbox"
|
|
2347
|
-
}, [(E(!0), f(o, null,
|
|
2367
|
+
}, [(E(!0), f(o, null, A(y.value, (e, t) => (E(), f("button", {
|
|
2348
2368
|
key: e.isoCode,
|
|
2349
2369
|
type: "button",
|
|
2350
2370
|
role: "option",
|
|
2351
2371
|
"aria-selected": e.isoCode === _.value.isoCode,
|
|
2352
|
-
class: x(t === g.value ?
|
|
2353
|
-
onPointerdown:
|
|
2372
|
+
class: x(t === g.value ? F(a).phone.optionActive : F(a).phone.option),
|
|
2373
|
+
onPointerdown: U((t) => T(e), ["prevent"]),
|
|
2354
2374
|
onMouseenter: (e) => g.value = t
|
|
2355
2375
|
}, [
|
|
2356
|
-
p("span", { class: x(
|
|
2357
|
-
p("span", { class: x(
|
|
2358
|
-
p("span", { class: x(
|
|
2359
|
-
], 42,
|
|
2376
|
+
p("span", { class: x(F(a).phone.flag) }, P(v(e.isoCode)), 3),
|
|
2377
|
+
p("span", { class: x(F(a).phone.optionName) }, P(e.name), 3),
|
|
2378
|
+
p("span", { class: x(F(a).phone.optionDial) }, P(e.dialCode), 3)
|
|
2379
|
+
], 42, Xe))), 128)), y.value.length ? d("", !0) : (E(), f("p", {
|
|
2360
2380
|
key: 0,
|
|
2361
|
-
class: x(
|
|
2362
|
-
}, "No country matches \"" +
|
|
2381
|
+
class: x(F(a).phone.empty)
|
|
2382
|
+
}, "No country matches \"" + P(h.value) + "\"", 3))], 2)], 2)) : d("", !0)
|
|
2363
2383
|
], 2));
|
|
2364
2384
|
}
|
|
2365
|
-
}),
|
|
2385
|
+
}), Qe = ["onClick"], $e = ["placeholder", "disabled"], et = ["onPointerdown", "onMouseenter"], tt = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
2366
2386
|
__name: "ShSuggest",
|
|
2367
2387
|
props: {
|
|
2368
2388
|
modelValue: [
|
|
@@ -2384,8 +2404,8 @@ var He = ["disabled"], Ue = {
|
|
|
2384
2404
|
},
|
|
2385
2405
|
emits: ["update:modelValue", "clearValidationErrors"],
|
|
2386
2406
|
setup(e, { emit: t }) {
|
|
2387
|
-
let r = e, i = t, a =
|
|
2388
|
-
let e =
|
|
2407
|
+
let r = e, i = t, a = X("inputs"), s = k(null), c = k(""), m = k(!1), g = k(!1), _ = k(-1), v = k([]), b = k([]), S = l(() => {
|
|
2408
|
+
let e = He(r.options ?? v.value), t = new Set(b.value.map((e) => e.id)), n = e.filter((e) => !t.has(e.id));
|
|
2389
2409
|
if (r.options && c.value) {
|
|
2390
2410
|
let e = c.value.toLowerCase();
|
|
2391
2411
|
n = n.filter((t) => t.label.toLowerCase().includes(e));
|
|
@@ -2402,88 +2422,88 @@ var He = ["disabled"], Ue = {
|
|
|
2402
2422
|
g.value = !1;
|
|
2403
2423
|
});
|
|
2404
2424
|
}, 300));
|
|
2405
|
-
},
|
|
2425
|
+
}, O = () => {
|
|
2406
2426
|
r.multiple ? i("update:modelValue", b.value.map((e) => e.id)) : i("update:modelValue", b.value[0]?.id ?? null);
|
|
2407
|
-
},
|
|
2408
|
-
r.multiple ? b.value.push(e) : (b.value = [e], m.value = !1), c.value = "", _.value = -1,
|
|
2409
|
-
},
|
|
2410
|
-
b.value = b.value.filter((t) => t.id !== e.id),
|
|
2411
|
-
},
|
|
2412
|
-
!r.allowCustom || !c.value ||
|
|
2427
|
+
}, j = (e) => {
|
|
2428
|
+
r.multiple ? b.value.push(e) : (b.value = [e], m.value = !1), c.value = "", _.value = -1, O();
|
|
2429
|
+
}, M = (e) => {
|
|
2430
|
+
b.value = b.value.filter((t) => t.id !== e.id), O();
|
|
2431
|
+
}, ee = () => {
|
|
2432
|
+
!r.allowCustom || !c.value || j({
|
|
2413
2433
|
id: c.value,
|
|
2414
2434
|
label: c.value
|
|
2415
2435
|
});
|
|
2416
2436
|
}, I = () => {
|
|
2417
2437
|
m.value = !0, i("clearValidationErrors"), r.url && D();
|
|
2418
|
-
},
|
|
2419
|
-
e.key === "ArrowDown" ? (e.preventDefault(), m.value = !0, _.value = Math.min(_.value + 1, S.value.length - 1)) : e.key === "ArrowUp" ? (e.preventDefault(), _.value = Math.max(_.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), _.value >= 0 && S.value[_.value] ?
|
|
2420
|
-
},
|
|
2438
|
+
}, L = (e) => {
|
|
2439
|
+
e.key === "ArrowDown" ? (e.preventDefault(), m.value = !0, _.value = Math.min(_.value + 1, S.value.length - 1)) : e.key === "ArrowUp" ? (e.preventDefault(), _.value = Math.max(_.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), _.value >= 0 && S.value[_.value] ? j(S.value[_.value]) : ee()) : e.key === "Escape" ? m.value = !1 : e.key === "Backspace" && !c.value && b.value.length && M(b.value[b.value.length - 1]);
|
|
2440
|
+
}, z = () => {
|
|
2421
2441
|
let e = r.modelValue;
|
|
2422
2442
|
if (e == null || e === "") return;
|
|
2423
|
-
let t = Array.isArray(e) ? e : [e], n =
|
|
2443
|
+
let t = Array.isArray(e) ? e : [e], n = He(r.options ?? v.value);
|
|
2424
2444
|
b.value = t.map((e) => n.find((t) => t.id === e) ?? {
|
|
2425
2445
|
id: e,
|
|
2426
2446
|
label: String(e)
|
|
2427
2447
|
});
|
|
2428
|
-
},
|
|
2448
|
+
}, V = (e) => {
|
|
2429
2449
|
s.value && !s.value.contains(e.target) && (m.value = !1);
|
|
2430
2450
|
};
|
|
2431
|
-
return
|
|
2432
|
-
document.addEventListener("pointerdown",
|
|
2451
|
+
return B(() => r.options, z), w(() => {
|
|
2452
|
+
document.addEventListener("pointerdown", V), z(), r.url && !r.options && D();
|
|
2433
2453
|
}), C(() => {
|
|
2434
|
-
document.removeEventListener("pointerdown",
|
|
2454
|
+
document.removeEventListener("pointerdown", V), clearTimeout(T);
|
|
2435
2455
|
}), (t, n) => (E(), f("div", {
|
|
2436
2456
|
ref_key: "root",
|
|
2437
2457
|
ref: s,
|
|
2438
|
-
class: x(
|
|
2458
|
+
class: x(F(a).suggest.wrapper)
|
|
2439
2459
|
}, [
|
|
2440
2460
|
e.multiple && b.value.length ? (E(), f("div", {
|
|
2441
2461
|
key: 0,
|
|
2442
|
-
class: x(
|
|
2443
|
-
}, [(E(!0), f(o, null,
|
|
2462
|
+
class: x(F(a).suggest.badges)
|
|
2463
|
+
}, [(E(!0), f(o, null, A(b.value, (e) => (E(), f("span", {
|
|
2444
2464
|
key: e.id,
|
|
2445
|
-
class: x(
|
|
2446
|
-
}, [h(
|
|
2447
|
-
class: x(
|
|
2448
|
-
onClick: (t) =>
|
|
2449
|
-
}, "×", 10,
|
|
2450
|
-
|
|
2465
|
+
class: x(F(a).suggest.badge)
|
|
2466
|
+
}, [h(P(e.label) + " ", 1), p("span", {
|
|
2467
|
+
class: x(F(a).suggest.badgeRemove),
|
|
2468
|
+
onClick: (t) => M(e)
|
|
2469
|
+
}, "×", 10, Qe)], 2))), 128))], 2)) : d("", !0),
|
|
2470
|
+
H(p("input", y(t.$attrs, {
|
|
2451
2471
|
"onUpdate:modelValue": n[0] ||= (e) => c.value = e,
|
|
2452
2472
|
type: "text",
|
|
2453
2473
|
placeholder: !e.multiple && b.value.length ? b.value[0].label : e.placeholder,
|
|
2454
2474
|
disabled: e.disabled,
|
|
2455
2475
|
autocomplete: "off",
|
|
2456
2476
|
onInput: I,
|
|
2457
|
-
onKeydown:
|
|
2477
|
+
onKeydown: L,
|
|
2458
2478
|
onFocus: n[1] ||= (e) => {
|
|
2459
2479
|
m.value = !0, i("clearValidationErrors");
|
|
2460
2480
|
}
|
|
2461
|
-
}), null, 16,
|
|
2481
|
+
}), null, 16, $e), [[R, c.value]]),
|
|
2462
2482
|
m.value && !e.disabled ? (E(), f("div", {
|
|
2463
2483
|
key: 1,
|
|
2464
|
-
class: x(
|
|
2484
|
+
class: x(F(a).suggest.dropdown)
|
|
2465
2485
|
}, [g.value ? (E(), f("div", {
|
|
2466
2486
|
key: 0,
|
|
2467
|
-
class: x(
|
|
2468
|
-
}, "Searching...", 2)) : S.value.length ? (E(!0), f(o, { key: 1 },
|
|
2487
|
+
class: x(F(a).suggest.empty)
|
|
2488
|
+
}, "Searching...", 2)) : S.value.length ? (E(!0), f(o, { key: 1 }, A(S.value, (t, n) => (E(), f("div", {
|
|
2469
2489
|
key: t.id,
|
|
2470
|
-
class: x(n === _.value ?
|
|
2471
|
-
onPointerdown:
|
|
2490
|
+
class: x(n === _.value ? F(a).suggest.optionActive : F(a).suggest.option),
|
|
2491
|
+
onPointerdown: U((e) => j(t), ["prevent"]),
|
|
2472
2492
|
onMouseenter: (e) => _.value = n
|
|
2473
|
-
}, [e.optionTemplate ? (E(), u(
|
|
2493
|
+
}, [e.optionTemplate ? (E(), u(N(e.optionTemplate), {
|
|
2474
2494
|
key: 0,
|
|
2475
2495
|
option: t.raw ?? t
|
|
2476
|
-
}, null, 8, ["option"])) : (E(), f(o, { key: 1 }, [h(
|
|
2496
|
+
}, null, 8, ["option"])) : (E(), f(o, { key: 1 }, [h(P(t.label), 1)], 64))], 42, et))), 128)) : e.allowCustom && c.value ? (E(), f("div", {
|
|
2477
2497
|
key: 2,
|
|
2478
|
-
class: x(
|
|
2479
|
-
onPointerdown:
|
|
2480
|
-
}, " Use \"" +
|
|
2498
|
+
class: x(F(a).suggest.option),
|
|
2499
|
+
onPointerdown: U(ee, ["prevent"])
|
|
2500
|
+
}, " Use \"" + P(c.value) + "\" ", 35)) : (E(), f("div", {
|
|
2481
2501
|
key: 3,
|
|
2482
|
-
class: x(
|
|
2502
|
+
class: x(F(a).suggest.empty)
|
|
2483
2503
|
}, "No matches", 2))], 2)) : d("", !0)
|
|
2484
2504
|
], 2));
|
|
2485
2505
|
}
|
|
2486
|
-
}),
|
|
2506
|
+
}), nt = ["onUpdate:modelValue"], rt = ["innerHTML"], it = ["disabled"], at = {
|
|
2487
2507
|
__name: "ShForm",
|
|
2488
2508
|
props: {
|
|
2489
2509
|
action: {
|
|
@@ -2523,35 +2543,35 @@ var He = ["disabled"], Ue = {
|
|
|
2523
2543
|
"formError"
|
|
2524
2544
|
],
|
|
2525
2545
|
setup(e, { emit: t }) {
|
|
2526
|
-
let i = e, a = t, s =
|
|
2527
|
-
text:
|
|
2546
|
+
let i = e, a = t, s = X("form", l(() => i.classes)), c = X("inputs"), m = v(K, {}), g = v(q, null), _ = {
|
|
2547
|
+
text: ye,
|
|
2528
2548
|
textarea: xe,
|
|
2529
|
-
email:
|
|
2530
|
-
password:
|
|
2531
|
-
pin:
|
|
2532
|
-
number:
|
|
2533
|
-
date:
|
|
2534
|
-
select:
|
|
2535
|
-
phone:
|
|
2536
|
-
suggest:
|
|
2537
|
-
}, b =
|
|
2538
|
-
let e =
|
|
2549
|
+
email: Ce,
|
|
2550
|
+
password: Ee,
|
|
2551
|
+
pin: Oe,
|
|
2552
|
+
number: ze,
|
|
2553
|
+
date: Ve,
|
|
2554
|
+
select: Ke,
|
|
2555
|
+
phone: Ze,
|
|
2556
|
+
suggest: tt
|
|
2557
|
+
}, b = k([]), S = O({}), C = k(!1), w = k(0), T = k(!1), D = () => {
|
|
2558
|
+
let e = ue(i.fields, i.currentData);
|
|
2539
2559
|
i.hiddenId && i.currentData?.id && !e.some((e) => e.name === "id") && e.push({
|
|
2540
2560
|
name: "id",
|
|
2541
2561
|
type: "hidden",
|
|
2542
2562
|
value: i.currentData.id
|
|
2543
2563
|
}), b.value = e;
|
|
2544
2564
|
};
|
|
2545
|
-
D(),
|
|
2565
|
+
D(), B(() => i.currentData, () => {
|
|
2546
2566
|
T.value || D();
|
|
2547
|
-
}, { deep: !0 }),
|
|
2548
|
-
let
|
|
2567
|
+
}, { deep: !0 }), B(() => i.fields, D);
|
|
2568
|
+
let M = l(() => i.steps?.length ? i.steps.map((e) => ({
|
|
2549
2569
|
title: e.title ?? "",
|
|
2550
2570
|
fields: b.value.filter((t) => (e.fields ?? []).includes(t.name) || t.type === "hidden")
|
|
2551
2571
|
})) : [{
|
|
2552
2572
|
title: "",
|
|
2553
2573
|
fields: b.value
|
|
2554
|
-
}]),
|
|
2574
|
+
}]), ee = l(() => w.value >= M.value.length - 1), I = (e) => e.mask && e.type !== "pin" ? Le : e.component ?? m[e.type] ?? _[e.type] ?? _.text, L = (e) => S[e.name] ? s.value.inputInvalid : e.type === "select" ? c.value.select : s.value.input, V = (e) => ({
|
|
2555
2575
|
placeholder: e.placeholder || void 0,
|
|
2556
2576
|
disabled: i.disabled || e.disabled,
|
|
2557
2577
|
...e.type === "select" || e.type === "suggest" ? {
|
|
@@ -2591,17 +2611,17 @@ var He = ["disabled"], Ue = {
|
|
|
2591
2611
|
return b.value.forEach((t) => {
|
|
2592
2612
|
t.value !== null && t.value !== void 0 && (e[t.name] = t.value);
|
|
2593
2613
|
}), e;
|
|
2594
|
-
},
|
|
2614
|
+
}, J = () => {
|
|
2595
2615
|
b.value.forEach((e) => {
|
|
2596
2616
|
e.type !== "hidden" && (e.value = null);
|
|
2597
2617
|
}), T.value = !1;
|
|
2598
|
-
},
|
|
2618
|
+
}, te = () => {
|
|
2599
2619
|
let e = Object.keys(S);
|
|
2600
2620
|
if (!e.length || !i.steps?.length) return;
|
|
2601
|
-
let t =
|
|
2621
|
+
let t = M.value.findIndex((t) => t.fields.some((t) => e.includes(t.name)));
|
|
2602
2622
|
t >= 0 && (w.value = t);
|
|
2603
|
-
},
|
|
2604
|
-
if (!
|
|
2623
|
+
}, ne = async () => {
|
|
2624
|
+
if (!ee.value) {
|
|
2605
2625
|
w.value++;
|
|
2606
2626
|
return;
|
|
2607
2627
|
}
|
|
@@ -2622,14 +2642,14 @@ var He = ["disabled"], Ue = {
|
|
|
2622
2642
|
C.value = !0;
|
|
2623
2643
|
try {
|
|
2624
2644
|
let n = await t(i.action, e);
|
|
2625
|
-
i.successMessage && r.showToast(i.successMessage), a("success", n.data), a("formSubmitted", n.data), i.retainData || (
|
|
2645
|
+
i.successMessage && r.showToast(i.successMessage), a("success", n.data), a("formSubmitted", n.data), i.retainData || (J(), w.value = 0), g?.requestClose?.("success");
|
|
2626
2646
|
} catch (e) {
|
|
2627
2647
|
if (e.response?.status === 422) {
|
|
2628
2648
|
let t = e.response.data?.errors ?? {};
|
|
2629
2649
|
Object.keys(t).forEach((e) => {
|
|
2630
2650
|
let n = t[e];
|
|
2631
2651
|
S[e] = Array.isArray(n) ? n[0] : n;
|
|
2632
|
-
}),
|
|
2652
|
+
}), te();
|
|
2633
2653
|
} else r.showToast(e.response?.data?.message ?? e.message ?? "Request failed", "error");
|
|
2634
2654
|
a("error", e), a("formError", e);
|
|
2635
2655
|
} finally {
|
|
@@ -2637,38 +2657,38 @@ var He = ["disabled"], Ue = {
|
|
|
2637
2657
|
}
|
|
2638
2658
|
};
|
|
2639
2659
|
return (t, n) => (E(), f("form", {
|
|
2640
|
-
class: x(
|
|
2641
|
-
onSubmit:
|
|
2660
|
+
class: x(F(s).form),
|
|
2661
|
+
onSubmit: U(ne, ["prevent"])
|
|
2642
2662
|
}, [
|
|
2643
|
-
|
|
2663
|
+
M.value.length > 1 ? (E(), u(fe, {
|
|
2644
2664
|
key: 0,
|
|
2645
|
-
steps:
|
|
2665
|
+
steps: M.value,
|
|
2646
2666
|
current: w.value
|
|
2647
2667
|
}, null, 8, ["steps", "current"])) : d("", !0),
|
|
2648
|
-
(E(!0), f(o, null,
|
|
2668
|
+
(E(!0), f(o, null, A(M.value, (e, t) => H((E(), f("div", {
|
|
2649
2669
|
key: t,
|
|
2650
2670
|
class: "space-y-4"
|
|
2651
|
-
}, [(E(!0), f(o, null,
|
|
2671
|
+
}, [(E(!0), f(o, null, A(e.fields, (e) => (E(), f("div", {
|
|
2652
2672
|
key: e.name,
|
|
2653
|
-
class: x(e.type === "hidden" ? "" :
|
|
2654
|
-
}, [e.type === "hidden" ?
|
|
2673
|
+
class: x(e.type === "hidden" ? "" : F(s).group)
|
|
2674
|
+
}, [e.type === "hidden" ? H((E(), f("input", {
|
|
2655
2675
|
key: 0,
|
|
2656
2676
|
"onUpdate:modelValue": (t) => e.value = t,
|
|
2657
2677
|
type: "hidden"
|
|
2658
|
-
}, null, 8,
|
|
2678
|
+
}, null, 8, nt)), [[R, e.value]]) : (E(), f(o, { key: 1 }, [
|
|
2659
2679
|
e.label ? (E(), f("label", {
|
|
2660
2680
|
key: 0,
|
|
2661
|
-
class: x(
|
|
2662
|
-
}, [h(
|
|
2681
|
+
class: x(F(s).label)
|
|
2682
|
+
}, [h(P(e.label) + " ", 1), e.required ? (E(), f("span", {
|
|
2663
2683
|
key: 0,
|
|
2664
|
-
class: x(
|
|
2684
|
+
class: x(F(s).required)
|
|
2665
2685
|
}, "*", 2)) : d("", !0)], 2)) : d("", !0),
|
|
2666
|
-
(E(), u(
|
|
2686
|
+
(E(), u(N(I(e)), y({
|
|
2667
2687
|
modelValue: e.value,
|
|
2668
2688
|
"onUpdate:modelValue": (t) => e.value = t
|
|
2669
|
-
}, { ref_for: !0 },
|
|
2689
|
+
}, { ref_for: !0 }, V(e), {
|
|
2670
2690
|
"is-invalid": !!S[e.name],
|
|
2671
|
-
class: [
|
|
2691
|
+
class: [L(e), e.class],
|
|
2672
2692
|
"onUpdate:modelValue": (t) => W(e, t),
|
|
2673
2693
|
onClearValidationErrors: (t) => delete S[e.name]
|
|
2674
2694
|
}), null, 16, [
|
|
@@ -2680,31 +2700,31 @@ var He = ["disabled"], Ue = {
|
|
|
2680
2700
|
])),
|
|
2681
2701
|
e.helper ? (E(), f("p", {
|
|
2682
2702
|
key: 1,
|
|
2683
|
-
class: x(
|
|
2703
|
+
class: x(F(s).helper),
|
|
2684
2704
|
innerHTML: e.helper
|
|
2685
|
-
}, null, 10,
|
|
2705
|
+
}, null, 10, rt)) : d("", !0),
|
|
2686
2706
|
S[e.name] ? (E(), f("p", {
|
|
2687
2707
|
key: 2,
|
|
2688
|
-
class: x(
|
|
2689
|
-
},
|
|
2690
|
-
], 64))], 2))), 128))], 512)), [[
|
|
2691
|
-
|
|
2692
|
-
p("div", { class: x(
|
|
2708
|
+
class: x(F(s).error)
|
|
2709
|
+
}, P(S[e.name]), 3)) : d("", !0)
|
|
2710
|
+
], 64))], 2))), 128))], 512)), [[z, w.value === t]])), 128)),
|
|
2711
|
+
j(t.$slots, "default"),
|
|
2712
|
+
p("div", { class: x(F(s).nav) }, [w.value > 0 ? (E(), f("button", {
|
|
2693
2713
|
key: 0,
|
|
2694
2714
|
type: "button",
|
|
2695
|
-
class: x(
|
|
2715
|
+
class: x(F(s).prevBtn),
|
|
2696
2716
|
onClick: n[0] ||= (e) => w.value--
|
|
2697
2717
|
}, " Back ", 2)) : d("", !0), p("button", {
|
|
2698
2718
|
type: "submit",
|
|
2699
|
-
class: x(
|
|
2719
|
+
class: x(ee.value ? F(s).submitBtn : F(s).nextBtn),
|
|
2700
2720
|
disabled: C.value || e.disabled
|
|
2701
|
-
}, [C.value ? (E(), u(
|
|
2721
|
+
}, [C.value ? (E(), u(_e, {
|
|
2702
2722
|
key: 0,
|
|
2703
2723
|
class: "size-4"
|
|
2704
|
-
})) : d("", !0), h(" " +
|
|
2724
|
+
})) : d("", !0), h(" " + P(ee.value ? e.submitLabel : "Next"), 1)], 10, it)], 2)
|
|
2705
2725
|
], 34));
|
|
2706
2726
|
}
|
|
2707
|
-
},
|
|
2727
|
+
}, ot = {
|
|
2708
2728
|
__name: "ShDialog",
|
|
2709
2729
|
props: {
|
|
2710
2730
|
open: Boolean,
|
|
@@ -2724,7 +2744,7 @@ var He = ["disabled"], Ue = {
|
|
|
2724
2744
|
"closed"
|
|
2725
2745
|
],
|
|
2726
2746
|
setup(e, { expose: t, emit: n }) {
|
|
2727
|
-
let r = e, i = n, a =
|
|
2747
|
+
let r = e, i = n, a = X("dialog", l(() => r.classes)), o = k(null), m = k(!1), h = k(!1), _ = k(!1), v = se({
|
|
2728
2748
|
isStatic: () => r.static,
|
|
2729
2749
|
onClose: () => i("update:open", !1)
|
|
2730
2750
|
}), y = () => {
|
|
@@ -2742,11 +2762,11 @@ var He = ["disabled"], Ue = {
|
|
|
2742
2762
|
}
|
|
2743
2763
|
b("backdrop");
|
|
2744
2764
|
};
|
|
2745
|
-
return
|
|
2765
|
+
return B(() => r.open, (e) => {
|
|
2746
2766
|
e ? y() : h.value && b("prop");
|
|
2747
|
-
}, { immediate: !0 }),
|
|
2767
|
+
}, { immediate: !0 }), B(v.isOpen, (e) => {
|
|
2748
2768
|
!e && h.value && (h.value = !1);
|
|
2749
|
-
}), D(
|
|
2769
|
+
}), D(q, {
|
|
2750
2770
|
close: () => b("context"),
|
|
2751
2771
|
requestClose: (e) => {
|
|
2752
2772
|
if (e === "success") {
|
|
@@ -2762,7 +2782,7 @@ var He = ["disabled"], Ue = {
|
|
|
2762
2782
|
}), (t, n) => (E(), u(s, { to: "body" }, [m.value ? (E(), f("div", {
|
|
2763
2783
|
key: 0,
|
|
2764
2784
|
class: "fixed inset-0",
|
|
2765
|
-
style: S({ zIndex:
|
|
2785
|
+
style: S({ zIndex: F(v).zIndex.value })
|
|
2766
2786
|
}, [g(c, {
|
|
2767
2787
|
"enter-active-class": "transition-opacity duration-200 ease-out",
|
|
2768
2788
|
"enter-from-class": "opacity-0",
|
|
@@ -2771,10 +2791,10 @@ var He = ["disabled"], Ue = {
|
|
|
2771
2791
|
"leave-from-class": "opacity-100",
|
|
2772
2792
|
"leave-to-class": "opacity-0"
|
|
2773
2793
|
}, {
|
|
2774
|
-
default:
|
|
2775
|
-
class: x(
|
|
2794
|
+
default: V(() => [H(p("div", {
|
|
2795
|
+
class: x(F(a).backdrop),
|
|
2776
2796
|
onClick: C
|
|
2777
|
-
}, null, 2), [[
|
|
2797
|
+
}, null, 2), [[z, h.value]])]),
|
|
2778
2798
|
_: 1
|
|
2779
2799
|
}), g(c, {
|
|
2780
2800
|
"enter-active-class": "transition duration-200 ease-out",
|
|
@@ -2790,9 +2810,9 @@ var He = ["disabled"], Ue = {
|
|
|
2790
2810
|
m.value = !1, i("closed");
|
|
2791
2811
|
}
|
|
2792
2812
|
}, {
|
|
2793
|
-
default:
|
|
2794
|
-
class: x(
|
|
2795
|
-
onClick:
|
|
2813
|
+
default: V(() => [H(p("div", {
|
|
2814
|
+
class: x(F(a).wrapper),
|
|
2815
|
+
onClick: U(C, ["self"])
|
|
2796
2816
|
}, [p("div", {
|
|
2797
2817
|
ref_key: "panel",
|
|
2798
2818
|
ref: o,
|
|
@@ -2800,18 +2820,18 @@ var He = ["disabled"], Ue = {
|
|
|
2800
2820
|
role: "dialog",
|
|
2801
2821
|
"aria-modal": "true",
|
|
2802
2822
|
class: x([
|
|
2803
|
-
|
|
2804
|
-
|
|
2823
|
+
F(a).panel,
|
|
2824
|
+
F(a).sizes[e.size] ?? F(a).sizes.md,
|
|
2805
2825
|
_.value ? "scale-[1.02] transition-transform duration-150" : ""
|
|
2806
2826
|
])
|
|
2807
2827
|
}, [
|
|
2808
2828
|
e.title || t.$slots.title || !e.hideClose ? (E(), f("header", {
|
|
2809
2829
|
key: 0,
|
|
2810
|
-
class: x(
|
|
2811
|
-
}, [
|
|
2830
|
+
class: x(F(a).header)
|
|
2831
|
+
}, [j(t.$slots, "title", {}, () => [p("h3", { class: x(F(a).title) }, P(e.title), 3)]), e.hideClose ? d("", !0) : (E(), f("button", {
|
|
2812
2832
|
key: 0,
|
|
2813
2833
|
type: "button",
|
|
2814
|
-
class: x(
|
|
2834
|
+
class: x(F(a).closeBtn),
|
|
2815
2835
|
"aria-label": "Close",
|
|
2816
2836
|
onClick: n[0] ||= (e) => b("button")
|
|
2817
2837
|
}, [...n[3] ||= [p("svg", {
|
|
@@ -2826,16 +2846,16 @@ var He = ["disabled"], Ue = {
|
|
|
2826
2846
|
"stroke-linejoin": "round",
|
|
2827
2847
|
d: "M6 18L18 6M6 6l12 12"
|
|
2828
2848
|
})], -1)]], 2))], 2)) : d("", !0),
|
|
2829
|
-
p("div", { class: x(
|
|
2849
|
+
p("div", { class: x(F(a).body) }, [j(t.$slots, "default", { close: b })], 2),
|
|
2830
2850
|
t.$slots.footer ? (E(), f("footer", {
|
|
2831
2851
|
key: 1,
|
|
2832
|
-
class: x(
|
|
2833
|
-
}, [
|
|
2834
|
-
], 2)], 2), [[
|
|
2852
|
+
class: x(F(a).footer)
|
|
2853
|
+
}, [j(t.$slots, "footer", { close: b })], 2)) : d("", !0)
|
|
2854
|
+
], 2)], 2), [[z, h.value]])]),
|
|
2835
2855
|
_: 3
|
|
2836
2856
|
})], 4)) : d("", !0)]));
|
|
2837
2857
|
}
|
|
2838
|
-
},
|
|
2858
|
+
}, st = {
|
|
2839
2859
|
__name: "ShDrawer",
|
|
2840
2860
|
props: {
|
|
2841
2861
|
open: Boolean,
|
|
@@ -2858,7 +2878,7 @@ var He = ["disabled"], Ue = {
|
|
|
2858
2878
|
"closed"
|
|
2859
2879
|
],
|
|
2860
2880
|
setup(e, { expose: t, emit: n }) {
|
|
2861
|
-
let r = e, i = n, a =
|
|
2881
|
+
let r = e, i = n, a = X("drawer", l(() => r.classes)), o = k(null), m = k(!1), h = k(!1), _ = {
|
|
2862
2882
|
start: {
|
|
2863
2883
|
panel: "inset-y-0 left-0 h-full w-full",
|
|
2864
2884
|
hidden: "-translate-x-full"
|
|
@@ -2875,7 +2895,7 @@ var He = ["disabled"], Ue = {
|
|
|
2875
2895
|
panel: "inset-x-0 bottom-0 w-full",
|
|
2876
2896
|
hidden: "translate-y-full"
|
|
2877
2897
|
}
|
|
2878
|
-
}, v = l(() => _[r.position] ?? _.end), y = l(() => ["top", "bottom"].includes(r.position)), b = l(() => y.value ? a.value.sizesVertical[r.size] ?? a.value.sizesVertical.md : a.value.sizes[r.size] ?? a.value.sizes.md), C =
|
|
2898
|
+
}, v = l(() => _[r.position] ?? _.end), y = l(() => ["top", "bottom"].includes(r.position)), b = l(() => y.value ? a.value.sizesVertical[r.size] ?? a.value.sizesVertical.md : a.value.sizes[r.size] ?? a.value.sizes.md), C = se({
|
|
2879
2899
|
isStatic: () => r.static,
|
|
2880
2900
|
onClose: () => i("update:open", !1)
|
|
2881
2901
|
}), w = () => {
|
|
@@ -2885,11 +2905,11 @@ var He = ["disabled"], Ue = {
|
|
|
2885
2905
|
}, T = (e) => {
|
|
2886
2906
|
h.value = !1, C.close(e);
|
|
2887
2907
|
};
|
|
2888
|
-
return
|
|
2908
|
+
return B(() => r.open, (e) => {
|
|
2889
2909
|
e ? w() : h.value && T("prop");
|
|
2890
|
-
}, { immediate: !0 }),
|
|
2910
|
+
}, { immediate: !0 }), B(C.isOpen, (e) => {
|
|
2891
2911
|
!e && h.value && (h.value = !1);
|
|
2892
|
-
}), D(
|
|
2912
|
+
}), D(q, {
|
|
2893
2913
|
close: () => T("context"),
|
|
2894
2914
|
requestClose: (e) => T(e)
|
|
2895
2915
|
}), t({
|
|
@@ -2898,7 +2918,7 @@ var He = ["disabled"], Ue = {
|
|
|
2898
2918
|
}), (t, n) => (E(), u(s, { to: "body" }, [m.value ? (E(), f("div", {
|
|
2899
2919
|
key: 0,
|
|
2900
2920
|
class: "fixed inset-0",
|
|
2901
|
-
style: S({ zIndex:
|
|
2921
|
+
style: S({ zIndex: F(C).zIndex.value })
|
|
2902
2922
|
}, [g(c, {
|
|
2903
2923
|
"enter-active-class": "transition-opacity duration-200 ease-out",
|
|
2904
2924
|
"enter-from-class": "opacity-0",
|
|
@@ -2907,10 +2927,10 @@ var He = ["disabled"], Ue = {
|
|
|
2907
2927
|
"leave-from-class": "opacity-100",
|
|
2908
2928
|
"leave-to-class": "opacity-0"
|
|
2909
2929
|
}, {
|
|
2910
|
-
default:
|
|
2911
|
-
class: x(
|
|
2912
|
-
onClick: n[0] ||= (...e) =>
|
|
2913
|
-
}, null, 2), [[
|
|
2930
|
+
default: V(() => [H(p("div", {
|
|
2931
|
+
class: x(F(a).backdrop),
|
|
2932
|
+
onClick: n[0] ||= (...e) => F(C).onBackdrop && F(C).onBackdrop(...e)
|
|
2933
|
+
}, null, 2), [[z, h.value]])]),
|
|
2914
2934
|
_: 1
|
|
2915
2935
|
}), g(c, {
|
|
2916
2936
|
"enter-active-class": "transition-transform duration-250 ease-out",
|
|
@@ -2926,24 +2946,24 @@ var He = ["disabled"], Ue = {
|
|
|
2926
2946
|
m.value = !1, i("closed");
|
|
2927
2947
|
}
|
|
2928
2948
|
}, {
|
|
2929
|
-
default:
|
|
2949
|
+
default: V(() => [H(p("div", {
|
|
2930
2950
|
ref_key: "panel",
|
|
2931
2951
|
ref: o,
|
|
2932
2952
|
tabindex: "-1",
|
|
2933
2953
|
role: "dialog",
|
|
2934
2954
|
"aria-modal": "true",
|
|
2935
2955
|
class: x([
|
|
2936
|
-
|
|
2956
|
+
F(a).panel,
|
|
2937
2957
|
v.value.panel,
|
|
2938
2958
|
b.value
|
|
2939
2959
|
])
|
|
2940
2960
|
}, [e.title || t.$slots.title || !e.hideClose ? (E(), f("header", {
|
|
2941
2961
|
key: 0,
|
|
2942
|
-
class: x(
|
|
2943
|
-
}, [
|
|
2962
|
+
class: x(F(a).header)
|
|
2963
|
+
}, [j(t.$slots, "title", {}, () => [p("h3", { class: x(F(a).title) }, P(e.title), 3)]), e.hideClose ? d("", !0) : (E(), f("button", {
|
|
2944
2964
|
key: 0,
|
|
2945
2965
|
type: "button",
|
|
2946
|
-
class: x(
|
|
2966
|
+
class: x(F(a).closeBtn),
|
|
2947
2967
|
"aria-label": "Close",
|
|
2948
2968
|
onClick: n[1] ||= (e) => T("button")
|
|
2949
2969
|
}, [...n[4] ||= [p("svg", {
|
|
@@ -2957,11 +2977,11 @@ var He = ["disabled"], Ue = {
|
|
|
2957
2977
|
"stroke-linecap": "round",
|
|
2958
2978
|
"stroke-linejoin": "round",
|
|
2959
2979
|
d: "M6 18L18 6M6 6l12 12"
|
|
2960
|
-
})], -1)]], 2))], 2)) : d("", !0), p("div", { class: x(
|
|
2980
|
+
})], -1)]], 2))], 2)) : d("", !0), p("div", { class: x(F(a).body) }, [j(t.$slots, "default", { close: T })], 2)], 2), [[z, h.value]])]),
|
|
2961
2981
|
_: 3
|
|
2962
2982
|
}, 8, ["enter-from-class", "leave-to-class"])], 4)) : d("", !0)]));
|
|
2963
2983
|
}
|
|
2964
|
-
},
|
|
2984
|
+
}, ct = {
|
|
2965
2985
|
__name: "ShDialogBtn",
|
|
2966
2986
|
props: {
|
|
2967
2987
|
title: String,
|
|
@@ -2976,12 +2996,12 @@ var He = ["disabled"], Ue = {
|
|
|
2976
2996
|
},
|
|
2977
2997
|
emits: ["opened", "closed"],
|
|
2978
2998
|
setup(e) {
|
|
2979
|
-
let t =
|
|
2999
|
+
let t = X("buttons"), n = k(!1);
|
|
2980
3000
|
return (r, i) => (E(), f(o, null, [p("button", {
|
|
2981
3001
|
type: "button",
|
|
2982
|
-
class: x(e.btnClass ??
|
|
3002
|
+
class: x(e.btnClass ?? F(t).secondary),
|
|
2983
3003
|
onClick: i[0] ||= (e) => n.value = !0
|
|
2984
|
-
}, [
|
|
3004
|
+
}, [j(r.$slots, "trigger", {}, () => [i[4] ||= h("Open", -1)])], 2), g(ot, {
|
|
2985
3005
|
open: n.value,
|
|
2986
3006
|
"onUpdate:open": i[1] ||= (e) => n.value = e,
|
|
2987
3007
|
title: e.title,
|
|
@@ -2992,11 +3012,11 @@ var He = ["disabled"], Ue = {
|
|
|
2992
3012
|
onOpened: i[2] ||= (e) => r.$emit("opened"),
|
|
2993
3013
|
onClosed: i[3] ||= (e) => r.$emit("closed")
|
|
2994
3014
|
}, m({
|
|
2995
|
-
default:
|
|
3015
|
+
default: V(({ close: e }) => [j(r.$slots, "default", { close: e })]),
|
|
2996
3016
|
_: 2
|
|
2997
3017
|
}, [r.$slots.footer ? {
|
|
2998
3018
|
name: "footer",
|
|
2999
|
-
fn:
|
|
3019
|
+
fn: V(({ close: e }) => [j(r.$slots, "footer", { close: e })]),
|
|
3000
3020
|
key: "0"
|
|
3001
3021
|
} : void 0]), 1032, [
|
|
3002
3022
|
"open",
|
|
@@ -3007,7 +3027,7 @@ var He = ["disabled"], Ue = {
|
|
|
3007
3027
|
"classes"
|
|
3008
3028
|
])], 64));
|
|
3009
3029
|
}
|
|
3010
|
-
},
|
|
3030
|
+
}, lt = {
|
|
3011
3031
|
__name: "ShDrawerBtn",
|
|
3012
3032
|
props: {
|
|
3013
3033
|
title: String,
|
|
@@ -3026,12 +3046,12 @@ var He = ["disabled"], Ue = {
|
|
|
3026
3046
|
},
|
|
3027
3047
|
emits: ["opened", "closed"],
|
|
3028
3048
|
setup(e) {
|
|
3029
|
-
let t =
|
|
3049
|
+
let t = X("buttons"), n = k(!1);
|
|
3030
3050
|
return (r, i) => (E(), f(o, null, [p("button", {
|
|
3031
3051
|
type: "button",
|
|
3032
|
-
class: x(e.btnClass ??
|
|
3052
|
+
class: x(e.btnClass ?? F(t).secondary),
|
|
3033
3053
|
onClick: i[0] ||= (e) => n.value = !0
|
|
3034
|
-
}, [
|
|
3054
|
+
}, [j(r.$slots, "trigger", {}, () => [i[4] ||= h("Open", -1)])], 2), g(st, {
|
|
3035
3055
|
open: n.value,
|
|
3036
3056
|
"onUpdate:open": i[1] ||= (e) => n.value = e,
|
|
3037
3057
|
title: e.title,
|
|
@@ -3043,7 +3063,7 @@ var He = ["disabled"], Ue = {
|
|
|
3043
3063
|
onOpened: i[2] ||= (e) => r.$emit("opened"),
|
|
3044
3064
|
onClosed: i[3] ||= (e) => r.$emit("closed")
|
|
3045
3065
|
}, {
|
|
3046
|
-
default:
|
|
3066
|
+
default: V(({ close: e }) => [j(r.$slots, "default", { close: e })]),
|
|
3047
3067
|
_: 3
|
|
3048
3068
|
}, 8, [
|
|
3049
3069
|
"open",
|
|
@@ -3055,7 +3075,7 @@ var He = ["disabled"], Ue = {
|
|
|
3055
3075
|
"classes"
|
|
3056
3076
|
])], 64));
|
|
3057
3077
|
}
|
|
3058
|
-
},
|
|
3078
|
+
}, ut = {
|
|
3059
3079
|
__name: "ShDialogForm",
|
|
3060
3080
|
props: {
|
|
3061
3081
|
title: String,
|
|
@@ -3102,7 +3122,7 @@ var He = ["disabled"], Ue = {
|
|
|
3102
3122
|
"closed"
|
|
3103
3123
|
],
|
|
3104
3124
|
setup(e, { expose: t, emit: n }) {
|
|
3105
|
-
let r = e, i = n, a =
|
|
3125
|
+
let r = e, i = n, a = X("buttons"), s = k(!1), c = l(() => JSON.stringify(r.currentData ?? {})), d = (e) => {
|
|
3106
3126
|
i("success", e);
|
|
3107
3127
|
};
|
|
3108
3128
|
return t({
|
|
@@ -3114,9 +3134,9 @@ var He = ["disabled"], Ue = {
|
|
|
3114
3134
|
}
|
|
3115
3135
|
}), (t, n) => (E(), f(o, null, [p("button", {
|
|
3116
3136
|
type: "button",
|
|
3117
|
-
class: x(e.btnClass ??
|
|
3137
|
+
class: x(e.btnClass ?? F(a).primary),
|
|
3118
3138
|
onClick: n[0] ||= (e) => s.value = !0
|
|
3119
|
-
}, [
|
|
3139
|
+
}, [j(t.$slots, "trigger", {}, () => [h(P(e.title ?? "Open form"), 1)])], 2), g(ot, {
|
|
3120
3140
|
open: s.value,
|
|
3121
3141
|
"onUpdate:open": n[3] ||= (e) => s.value = e,
|
|
3122
3142
|
title: e.title,
|
|
@@ -3127,7 +3147,7 @@ var He = ["disabled"], Ue = {
|
|
|
3127
3147
|
onOpened: n[4] ||= (e) => t.$emit("opened"),
|
|
3128
3148
|
onClosed: n[5] ||= (e) => t.$emit("closed")
|
|
3129
3149
|
}, {
|
|
3130
|
-
default:
|
|
3150
|
+
default: V(() => [(E(), u(at, {
|
|
3131
3151
|
key: c.value,
|
|
3132
3152
|
action: e.action,
|
|
3133
3153
|
method: e.method,
|
|
@@ -3144,7 +3164,7 @@ var He = ["disabled"], Ue = {
|
|
|
3144
3164
|
onError: n[1] ||= (e) => t.$emit("error", e),
|
|
3145
3165
|
onFieldChanged: n[2] ||= (e, n, r) => t.$emit("fieldChanged", e, n, r)
|
|
3146
3166
|
}, {
|
|
3147
|
-
default:
|
|
3167
|
+
default: V(() => [j(t.$slots, "default")]),
|
|
3148
3168
|
_: 3
|
|
3149
3169
|
}, 8, [
|
|
3150
3170
|
"action",
|
|
@@ -3169,17 +3189,17 @@ var He = ["disabled"], Ue = {
|
|
|
3169
3189
|
"classes"
|
|
3170
3190
|
])], 64));
|
|
3171
3191
|
}
|
|
3172
|
-
},
|
|
3173
|
-
function
|
|
3174
|
-
return
|
|
3175
|
-
let n = indexedDB.open(
|
|
3192
|
+
}, dt = "sh_tw_table_cache", ft = "pages", pt = "rows", mt = 1, ht = 3e3, gt = null;
|
|
3193
|
+
function _t() {
|
|
3194
|
+
return gt || (gt = new Promise((e, t) => {
|
|
3195
|
+
let n = indexedDB.open(dt, mt);
|
|
3176
3196
|
n.onupgradeneeded = (e) => {
|
|
3177
3197
|
let t = e.target.result;
|
|
3178
|
-
t.objectStoreNames.contains(
|
|
3198
|
+
t.objectStoreNames.contains(ft) || t.createObjectStore(ft), t.objectStoreNames.contains(pt) || t.createObjectStore(pt);
|
|
3179
3199
|
}, n.onsuccess = (t) => e(t.target.result), n.onerror = (e) => t(e.target.error);
|
|
3180
|
-
}),
|
|
3200
|
+
}), gt);
|
|
3181
3201
|
}
|
|
3182
|
-
function
|
|
3202
|
+
function vt() {
|
|
3183
3203
|
try {
|
|
3184
3204
|
let e = i.getItem("user");
|
|
3185
3205
|
return e?.id ? `u${e.id}_` : "";
|
|
@@ -3187,71 +3207,71 @@ function _t() {
|
|
|
3187
3207
|
return "";
|
|
3188
3208
|
}
|
|
3189
3209
|
}
|
|
3190
|
-
function
|
|
3191
|
-
return
|
|
3210
|
+
function yt(e, t, n) {
|
|
3211
|
+
return _t().then((r) => new Promise((i, a) => {
|
|
3192
3212
|
let o = n(r.transaction(e, t).objectStore(e));
|
|
3193
3213
|
o.onsuccess = () => i(o.result), o.onerror = () => a(o.error);
|
|
3194
3214
|
})).catch((e) => {
|
|
3195
3215
|
console.error("[sh-tailwind] table cache error", e);
|
|
3196
3216
|
});
|
|
3197
3217
|
}
|
|
3198
|
-
async function
|
|
3199
|
-
return (await
|
|
3218
|
+
async function bt(e) {
|
|
3219
|
+
return (await yt(ft, "readonly", (t) => t.get(vt() + e)))?.response ?? null;
|
|
3200
3220
|
}
|
|
3201
|
-
function
|
|
3202
|
-
return
|
|
3221
|
+
function xt(e, t) {
|
|
3222
|
+
return yt(ft, "readwrite", (n) => n.put({
|
|
3203
3223
|
response: t,
|
|
3204
3224
|
timestamp: Date.now()
|
|
3205
|
-
},
|
|
3225
|
+
}, vt() + e));
|
|
3206
3226
|
}
|
|
3207
|
-
async function
|
|
3208
|
-
return (await
|
|
3227
|
+
async function St(e) {
|
|
3228
|
+
return (await yt(pt, "readonly", (t) => t.get(vt() + e)))?.rows ?? [];
|
|
3209
3229
|
}
|
|
3210
|
-
async function
|
|
3230
|
+
async function Ct(e, t) {
|
|
3211
3231
|
if (!Array.isArray(t) || !t.length) return;
|
|
3212
|
-
let n = await
|
|
3232
|
+
let n = await St(e), r = /* @__PURE__ */ new Map();
|
|
3213
3233
|
n.forEach((e) => {
|
|
3214
3234
|
e && e.id !== void 0 && r.set(e.id, e);
|
|
3215
3235
|
}), t.forEach((e) => {
|
|
3216
3236
|
e && e.id !== void 0 && r.set(e.id, e);
|
|
3217
3237
|
});
|
|
3218
3238
|
let i = [...r.values()];
|
|
3219
|
-
return i.length >
|
|
3239
|
+
return i.length > ht && (i = i.slice(i.length - ht)), yt(pt, "readwrite", (t) => t.put({
|
|
3220
3240
|
rows: i,
|
|
3221
3241
|
timestamp: Date.now()
|
|
3222
|
-
},
|
|
3242
|
+
}, vt() + e));
|
|
3223
3243
|
}
|
|
3224
|
-
async function
|
|
3225
|
-
await
|
|
3244
|
+
async function wt() {
|
|
3245
|
+
await yt(ft, "readwrite", (e) => e.clear()), await yt(pt, "readwrite", (e) => e.clear());
|
|
3226
3246
|
}
|
|
3227
|
-
var
|
|
3228
|
-
getPage:
|
|
3229
|
-
setPage:
|
|
3230
|
-
getRows:
|
|
3231
|
-
mergeRows:
|
|
3232
|
-
clear:
|
|
3247
|
+
var Tt = {
|
|
3248
|
+
getPage: bt,
|
|
3249
|
+
setPage: xt,
|
|
3250
|
+
getRows: St,
|
|
3251
|
+
mergeRows: Ct,
|
|
3252
|
+
clear: wt
|
|
3233
3253
|
};
|
|
3234
3254
|
//#endregion
|
|
3235
3255
|
//#region src/table/localQuery.js
|
|
3236
|
-
function
|
|
3256
|
+
function Et(e, t) {
|
|
3237
3257
|
return !e || !t || typeof t != "string" ? "" : t.split(".").reduce((e, t) => e ? e[t] : "", e);
|
|
3238
3258
|
}
|
|
3239
|
-
function
|
|
3259
|
+
function Dt(e, t, n, r = 0) {
|
|
3240
3260
|
if (e == null) return !1;
|
|
3241
|
-
if (typeof e == "object") return r > 2 ? !1 : Object.values(e).some((e) =>
|
|
3261
|
+
if (typeof e == "object") return r > 2 ? !1 : Object.values(e).some((e) => Dt(e, t, n, r + 1));
|
|
3242
3262
|
let i = String(e).toLowerCase();
|
|
3243
3263
|
return n ? i === t : i.includes(t);
|
|
3244
3264
|
}
|
|
3245
|
-
function
|
|
3265
|
+
function Ot(e, { search: t, exact: n, orderBy: r, orderMethod: i, page: a, perPage: o } = {}) {
|
|
3246
3266
|
let s = e;
|
|
3247
3267
|
if (t) {
|
|
3248
3268
|
let r = String(t).toLowerCase();
|
|
3249
|
-
s = e.filter((e) =>
|
|
3269
|
+
s = e.filter((e) => Dt(e, r, !!n));
|
|
3250
3270
|
}
|
|
3251
3271
|
if (r) {
|
|
3252
3272
|
let e = i === "asc" ? 1 : -1;
|
|
3253
3273
|
s = [...s].sort((t, n) => {
|
|
3254
|
-
let i =
|
|
3274
|
+
let i = Et(t, r), a = Et(n, r);
|
|
3255
3275
|
return typeof i == "number" && typeof a == "number" ? (i - a) * e : String(i ?? "").localeCompare(String(a ?? ""), void 0, { numeric: !0 }) * e;
|
|
3256
3276
|
});
|
|
3257
3277
|
}
|
|
@@ -3267,8 +3287,8 @@ function Dt(e, { search: t, exact: n, orderBy: r, orderMethod: i, page: a, perPa
|
|
|
3267
3287
|
}
|
|
3268
3288
|
//#endregion
|
|
3269
3289
|
//#region src/table/useTableData.js
|
|
3270
|
-
function
|
|
3271
|
-
let i =
|
|
3290
|
+
function kt({ query: e, cacheEnabled: t = () => !1, networkTimeout: r = () => 1e4 }) {
|
|
3291
|
+
let i = k([]), a = k(null), o = k("loading"), s = k(""), c = k(!1), l = k(!1), u = 0, d = (e, t) => e + "|" + JSON.stringify(t), f = (e, { append: t = !1 } = {}) => {
|
|
3272
3292
|
t ? i.value.push(...e.data ?? []) : i.value = e.data ?? [], a.value = {
|
|
3273
3293
|
total: e.total ?? i.value.length,
|
|
3274
3294
|
per_page: e.per_page,
|
|
@@ -3287,14 +3307,14 @@ function Ot({ query: e, cacheEnabled: t = () => !1, networkTimeout: r = () => 1e
|
|
|
3287
3307
|
load: async ({ append: a = !1 } = {}) => {
|
|
3288
3308
|
let p = ++u, { endpoint: m, params: h } = e(), g = d(m, h), _ = !!t(), v = !1;
|
|
3289
3309
|
if (i.value.length || (o.value = "loading"), _ && !a) {
|
|
3290
|
-
let e = await
|
|
3310
|
+
let e = await Tt.getPage(g);
|
|
3291
3311
|
e && p === u && (f(e), l.value = !0, v = !0);
|
|
3292
3312
|
}
|
|
3293
3313
|
try {
|
|
3294
3314
|
let e = await n.doGet(m, h, { timeout: r() });
|
|
3295
3315
|
if (p !== u) return;
|
|
3296
3316
|
let t = e.data?.data ?? e.data;
|
|
3297
|
-
return f(t, { append: a }), c.value = !1, l.value = !1, s.value = "", _ && (
|
|
3317
|
+
return f(t, { append: a }), c.value = !1, l.value = !1, s.value = "", _ && (Tt.setPage(g, t), Tt.mergeRows(m, t.data)), t;
|
|
3298
3318
|
} catch (e) {
|
|
3299
3319
|
if (p !== u) return;
|
|
3300
3320
|
if (e.response) {
|
|
@@ -3303,10 +3323,10 @@ function Ot({ query: e, cacheEnabled: t = () => !1, networkTimeout: r = () => 1e
|
|
|
3303
3323
|
}
|
|
3304
3324
|
if (c.value = !0, v) return;
|
|
3305
3325
|
if (_) {
|
|
3306
|
-
let e = await
|
|
3326
|
+
let e = await Tt.getRows(m);
|
|
3307
3327
|
if (p !== u) return;
|
|
3308
3328
|
if (e.length) {
|
|
3309
|
-
f(
|
|
3329
|
+
f(Ot(e, {
|
|
3310
3330
|
search: h.filter_value,
|
|
3311
3331
|
exact: h.exact,
|
|
3312
3332
|
orderBy: h.order_by,
|
|
@@ -3324,7 +3344,7 @@ function Ot({ query: e, cacheEnabled: t = () => !1, networkTimeout: r = () => 1e
|
|
|
3324
3344
|
}
|
|
3325
3345
|
//#endregion
|
|
3326
3346
|
//#region src/components/table/ShTablePagination.vue
|
|
3327
|
-
var
|
|
3347
|
+
var At = ["value"], jt = ["value"], Mt = ["disabled"], Nt = ["disabled"], Pt = ["onClick"], Ft = ["disabled"], It = {
|
|
3328
3348
|
__name: "ShTablePagination",
|
|
3329
3349
|
props: {
|
|
3330
3350
|
meta: {
|
|
@@ -3356,11 +3376,11 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3356
3376
|
for (let n = Math.max(2, t - 1); n <= Math.min(e - 1, t + 1); n++) r.push(n);
|
|
3357
3377
|
return t < e - 2 && r.push("..."), r.push(e), r;
|
|
3358
3378
|
});
|
|
3359
|
-
return (t, n) => (E(), f("div", { class: x(e.theme.wrapper) }, [p("div", { class: x(e.theme.info) }, [h(" Showing " +
|
|
3379
|
+
return (t, n) => (E(), f("div", { class: x(e.theme.wrapper) }, [p("div", { class: x(e.theme.info) }, [h(" Showing " + P(i.value) + " of " + P(e.meta.total) + " ", 1), p("select", {
|
|
3360
3380
|
value: e.perPage,
|
|
3361
3381
|
class: x([e.theme.perPage, "ml-2"]),
|
|
3362
3382
|
onChange: n[0] ||= (e) => r("perPage", Number(e.target.value))
|
|
3363
|
-
}, [(E(), f(o, null,
|
|
3383
|
+
}, [(E(), f(o, null, A([
|
|
3364
3384
|
10,
|
|
3365
3385
|
20,
|
|
3366
3386
|
30,
|
|
@@ -3369,13 +3389,13 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3369
3389
|
], (e) => p("option", {
|
|
3370
3390
|
key: e,
|
|
3371
3391
|
value: e
|
|
3372
|
-
},
|
|
3392
|
+
}, P(e) + " / page", 9, jt)), 64))], 42, At)], 2), e.mode === "loadMore" ? (E(), f("button", {
|
|
3373
3393
|
key: 0,
|
|
3374
3394
|
type: "button",
|
|
3375
3395
|
class: x(e.theme.loadMore),
|
|
3376
3396
|
disabled: e.loading || e.meta.current_page >= e.meta.last_page,
|
|
3377
3397
|
onClick: n[1] ||= (e) => r("loadMore")
|
|
3378
|
-
},
|
|
3398
|
+
}, P(e.meta.current_page >= e.meta.last_page ? "All loaded" : "Load more"), 11, Mt)) : (E(), f("div", {
|
|
3379
3399
|
key: 1,
|
|
3380
3400
|
class: x(e.theme.pages)
|
|
3381
3401
|
}, [
|
|
@@ -3385,8 +3405,8 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3385
3405
|
disabled: e.meta.current_page <= 1,
|
|
3386
3406
|
"aria-label": "Previous page",
|
|
3387
3407
|
onClick: n[2] ||= (t) => r("page", e.meta.current_page - 1)
|
|
3388
|
-
}, " ‹ ", 10,
|
|
3389
|
-
(E(!0), f(o, null,
|
|
3408
|
+
}, " ‹ ", 10, Nt),
|
|
3409
|
+
(E(!0), f(o, null, A(a.value, (t, n) => (E(), f(o, { key: n }, [t === "..." ? (E(), f("span", {
|
|
3390
3410
|
key: 0,
|
|
3391
3411
|
class: x(e.theme.ellipsis)
|
|
3392
3412
|
}, "…", 2)) : (E(), f("button", {
|
|
@@ -3394,20 +3414,20 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3394
3414
|
type: "button",
|
|
3395
3415
|
class: x(t === e.meta.current_page ? e.theme.pageBtnActive : e.theme.pageBtn),
|
|
3396
3416
|
onClick: (e) => r("page", t)
|
|
3397
|
-
},
|
|
3417
|
+
}, P(t), 11, Pt))], 64))), 128)),
|
|
3398
3418
|
p("button", {
|
|
3399
3419
|
type: "button",
|
|
3400
3420
|
class: x(e.theme.pageBtn),
|
|
3401
3421
|
disabled: e.meta.current_page >= e.meta.last_page,
|
|
3402
3422
|
"aria-label": "Next page",
|
|
3403
3423
|
onClick: n[3] ||= (t) => r("page", e.meta.current_page + 1)
|
|
3404
|
-
}, " › ", 10,
|
|
3424
|
+
}, " › ", 10, Ft)
|
|
3405
3425
|
], 2))], 2));
|
|
3406
3426
|
}
|
|
3407
|
-
},
|
|
3427
|
+
}, Lt = {
|
|
3408
3428
|
key: 0,
|
|
3409
3429
|
class: "flex w-full items-center gap-3 md:w-auto"
|
|
3410
|
-
},
|
|
3430
|
+
}, Rt = ["placeholder"], zt = ["checked"], Bt = ["onClick"], Vt = { key: 0 }, Ht = { key: 0 }, Ut = ["colspan"], Wt = ["onClick"], Gt = ["checked", "onChange"], Kt = ["innerHTML"], qt = ["onClick"], Jt = ["onClick"], Yt = ["checked", "onChange"], Xt = ["innerHTML"], Zt = ["onClick"], Qt = { class: "text-sm text-gray-700" }, $t = { class: "flex items-center gap-2" }, en = ["onClick"], tn = {
|
|
3411
3431
|
__name: "ShTable",
|
|
3412
3432
|
props: {
|
|
3413
3433
|
endpoint: {
|
|
@@ -3468,26 +3488,26 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3468
3488
|
"action"
|
|
3469
3489
|
],
|
|
3470
3490
|
setup(e, { expose: s, emit: c }) {
|
|
3471
|
-
let m = e, v = c, y =
|
|
3491
|
+
let m = e, v = c, y = X("table", l(() => m.classes)), b = a(), S = _()?.appContext.config.globalProperties.$router ?? null, w = (e) => {
|
|
3472
3492
|
S ? S.push(e) : window.location.href = e;
|
|
3473
3493
|
}, T = l(() => m.columns.map((e) => {
|
|
3474
3494
|
let t = typeof e == "string" ? { name: e } : { ...e };
|
|
3475
|
-
return t.label = t.label ??
|
|
3476
|
-
}).filter((e) => e.show ? e.show() : !0)), D = () => `sh_table_per_page_${typeof window < "u" ? window.location.pathname : "server"}_${m.endpoint}`.replace(/[^a-z0-9]+/gi, "_").toLowerCase(),
|
|
3495
|
+
return t.label = t.label ?? ce(t.name.split(".").pop()), t.sortable = t.sortable ?? !t.component, t;
|
|
3496
|
+
}).filter((e) => e.show ? e.show() : !0)), D = () => `sh_table_per_page_${typeof window < "u" ? window.location.pathname : "server"}_${m.endpoint}`.replace(/[^a-z0-9]+/gi, "_").toLowerCase(), O = () => {
|
|
3477
3497
|
let e = Number(i.getItem(D()));
|
|
3478
3498
|
return e > 0 ? e : Number(m.perPage ?? t("tablePerPage", 10));
|
|
3479
|
-
},
|
|
3499
|
+
}, M = k(1), I = k(O()), L = k(""), z = k(!1), V = k(m.sortBy), W = k(m.sortMethod), G = k(null), K = k(null), q = k(""), J = k(""), te = l(() => m.paginationStyle ?? t("tablePaginationStyle", "pages")), ne = l(() => m.cache === null ? !!t("enableTableCache", !1) : m.cache), { records: Y, meta: re, status: ie, error: Z, offline: ae, fromCache: oe, load: se } = kt({
|
|
3480
3500
|
query: () => {
|
|
3481
3501
|
let e = {
|
|
3482
|
-
order_by:
|
|
3502
|
+
order_by: V.value,
|
|
3483
3503
|
order_method: W.value,
|
|
3484
3504
|
per_page: I.value,
|
|
3485
|
-
page:
|
|
3486
|
-
filter_value:
|
|
3505
|
+
page: M.value,
|
|
3506
|
+
filter_value: L.value,
|
|
3487
3507
|
paginated: !0,
|
|
3488
|
-
from:
|
|
3489
|
-
to:
|
|
3490
|
-
exact:
|
|
3508
|
+
from: G.value,
|
|
3509
|
+
to: K.value,
|
|
3510
|
+
exact: z.value || null
|
|
3491
3511
|
};
|
|
3492
3512
|
return Object.keys(e).forEach((t) => {
|
|
3493
3513
|
(e[t] === null || e[t] === "" || e[t] === void 0) && delete e[t];
|
|
@@ -3496,39 +3516,39 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3496
3516
|
params: e
|
|
3497
3517
|
};
|
|
3498
3518
|
},
|
|
3499
|
-
cacheEnabled: () =>
|
|
3519
|
+
cacheEnabled: () => ne.value,
|
|
3500
3520
|
networkTimeout: () => m.networkTimeout
|
|
3501
|
-
}),
|
|
3502
|
-
let t = await
|
|
3521
|
+
}), Q = async ({ append: e = !1 } = {}) => {
|
|
3522
|
+
let t = await se({ append: e });
|
|
3503
3523
|
t && v("loaded", t);
|
|
3504
3524
|
};
|
|
3505
|
-
|
|
3506
|
-
let
|
|
3507
|
-
clearTimeout(
|
|
3508
|
-
|
|
3525
|
+
Q();
|
|
3526
|
+
let le = null, ue = () => {
|
|
3527
|
+
clearTimeout(le), le = setTimeout(() => {
|
|
3528
|
+
M.value = 1, Q();
|
|
3509
3529
|
}, 500);
|
|
3510
3530
|
};
|
|
3511
|
-
C(() => clearTimeout(
|
|
3512
|
-
let
|
|
3531
|
+
C(() => clearTimeout(le));
|
|
3532
|
+
let de = (e) => {
|
|
3513
3533
|
if (!e) return null;
|
|
3514
3534
|
let [t, n, r] = e.split("-");
|
|
3515
3535
|
return `${n}/${r}/${t}`;
|
|
3516
|
-
},
|
|
3517
|
-
|
|
3536
|
+
}, fe = () => {
|
|
3537
|
+
G.value = de(q.value), K.value = de(J.value), M.value = 1, Q();
|
|
3538
|
+
}, pe = (e) => {
|
|
3539
|
+
e.sortable && (V.value === e.name ? W.value = W.value === "desc" ? "asc" : "desc" : (V.value = e.name, W.value = "desc"), Q());
|
|
3540
|
+
}, me = (e) => {
|
|
3541
|
+
M.value = e, Q();
|
|
3518
3542
|
}, he = (e) => {
|
|
3519
|
-
|
|
3520
|
-
}, ge = (
|
|
3521
|
-
|
|
3522
|
-
}, _e = (e) => {
|
|
3523
|
-
I.value = e, F.value = 1, i.setItem(D(), e), X();
|
|
3524
|
-
}, ye = () => {
|
|
3525
|
-
F.value++, X({ append: !0 });
|
|
3543
|
+
I.value = e, M.value = 1, i.setItem(D(), e), Q();
|
|
3544
|
+
}, ge = () => {
|
|
3545
|
+
M.value++, Q({ append: !0 });
|
|
3526
3546
|
};
|
|
3527
|
-
|
|
3528
|
-
|
|
3547
|
+
B(() => m.reload, () => Q()), B(() => m.endpoint, () => {
|
|
3548
|
+
M.value = 1, I.value = O(), Q();
|
|
3529
3549
|
});
|
|
3530
|
-
let
|
|
3531
|
-
let n =
|
|
3550
|
+
let ve = (e, t) => {
|
|
3551
|
+
let n = Et(e, t.name);
|
|
3532
3552
|
if (n == null || n === "") return "";
|
|
3533
3553
|
switch (t.format) {
|
|
3534
3554
|
case "date": return r.formatDate(n, "ll");
|
|
@@ -3537,7 +3557,7 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3537
3557
|
case "money": return r.formatNumber(n, 2);
|
|
3538
3558
|
default: return n;
|
|
3539
3559
|
}
|
|
3540
|
-
},
|
|
3560
|
+
}, ye = (e) => !e.permission || b.isAllowedTo(e.permission), be = (e) => m.actions.filter((t) => ye(t) && (t.show ? t.show(e) : !0)), xe = l(() => m.multiActions.filter(ye)), Se = (e, t) => String(e).replace(/\{(.*?)\}/g, (e, n) => Et(t, n)), Ce = async (e, t) => {
|
|
3541
3561
|
if (e.handler) return e.handler(t);
|
|
3542
3562
|
if (e.emit) {
|
|
3543
3563
|
v("action", e.emit, t), v(e.emit, t);
|
|
@@ -3548,69 +3568,69 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3548
3568
|
let i = Se(e.url, t);
|
|
3549
3569
|
if (e.confirm) {
|
|
3550
3570
|
let t = await r.runPlainRequest(i, e.confirm, e.label, e.data);
|
|
3551
|
-
t.isConfirmed && t.value?.success ? (r.showToast(t.value.response?.message ?? "Action successful"),
|
|
3571
|
+
t.isConfirmed && t.value?.success ? (r.showToast(t.value.response?.message ?? "Action successful"), Q()) : t.isConfirmed && r.showToast(e.failMessage ?? "Action failed", "error");
|
|
3552
3572
|
return;
|
|
3553
3573
|
}
|
|
3554
3574
|
try {
|
|
3555
3575
|
let t = await n.doPost(i, e.data);
|
|
3556
|
-
r.showToast(t.data?.message ?? "Action successful"),
|
|
3576
|
+
r.showToast(t.data?.message ?? "Action successful"), Q();
|
|
3557
3577
|
} catch (e) {
|
|
3558
3578
|
r.showToast(e.response?.data?.message ?? "Action failed", "error");
|
|
3559
3579
|
}
|
|
3560
3580
|
}
|
|
3561
3581
|
}, we = (e) => {
|
|
3562
3582
|
v("rowClick", e), m.rowLink && w(Se(m.rowLink, e));
|
|
3563
|
-
}, $ =
|
|
3564
|
-
$.value = Te.value ? [] :
|
|
3583
|
+
}, $ = k([]), Te = l(() => Y.value.length > 0 && $.value.length === Y.value.length), Ee = () => {
|
|
3584
|
+
$.value = Te.value ? [] : Y.value.map((e) => e.id);
|
|
3565
3585
|
}, De = (e) => {
|
|
3566
3586
|
let t = $.value.indexOf(e);
|
|
3567
3587
|
t > -1 ? $.value.splice(t, 1) : $.value.push(e);
|
|
3568
3588
|
}, Oe = (e) => {
|
|
3569
|
-
let t =
|
|
3589
|
+
let t = Y.value.filter((e) => $.value.includes(e.id));
|
|
3570
3590
|
e.handler?.(t), $.value = [];
|
|
3571
|
-
}, ke = l(() => T.value.length + +!!
|
|
3591
|
+
}, ke = l(() => T.value.length + +!!xe.value.length + +!!m.actions.length);
|
|
3572
3592
|
return s({
|
|
3573
|
-
reload: () =>
|
|
3574
|
-
records:
|
|
3575
|
-
}), (t, n) => (E(), f("div", { class: x(
|
|
3593
|
+
reload: () => Q(),
|
|
3594
|
+
records: Y
|
|
3595
|
+
}), (t, n) => (E(), f("div", { class: x(F(y).wrapper) }, [
|
|
3576
3596
|
e.searchable || e.hasRange ? (E(), f("div", {
|
|
3577
3597
|
key: 0,
|
|
3578
|
-
class: x(
|
|
3579
|
-
}, [e.searchable ? (E(), f("div",
|
|
3580
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
3598
|
+
class: x(F(y).toolbar)
|
|
3599
|
+
}, [e.searchable ? (E(), f("div", Lt, [H(p("input", {
|
|
3600
|
+
"onUpdate:modelValue": n[0] ||= (e) => L.value = e,
|
|
3581
3601
|
type: "search",
|
|
3582
3602
|
placeholder: e.searchPlaceholder,
|
|
3583
|
-
class: x(
|
|
3584
|
-
onInput:
|
|
3585
|
-
}, null, 42,
|
|
3603
|
+
class: x(F(y).search),
|
|
3604
|
+
onInput: ue
|
|
3605
|
+
}, null, 42, Rt), [[R, L.value]]), L.value.length > 1 ? (E(), f("label", {
|
|
3586
3606
|
key: 0,
|
|
3587
|
-
class: x(
|
|
3588
|
-
}, [
|
|
3589
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
3607
|
+
class: x(F(y).exactLabel)
|
|
3608
|
+
}, [H(p("input", {
|
|
3609
|
+
"onUpdate:modelValue": n[1] ||= (e) => z.value = e,
|
|
3590
3610
|
type: "checkbox",
|
|
3591
|
-
class: x(
|
|
3592
|
-
onChange: n[2] ||= (e) =>
|
|
3593
|
-
}, null, 34), [[
|
|
3611
|
+
class: x(F(y).checkbox),
|
|
3612
|
+
onChange: n[2] ||= (e) => Q()
|
|
3613
|
+
}, null, 34), [[ee, z.value]]), n[10] ||= h(" Exact ", -1)], 2)) : d("", !0)])) : d("", !0), e.hasRange ? (E(), f("div", {
|
|
3594
3614
|
key: 1,
|
|
3595
|
-
class: x(
|
|
3615
|
+
class: x(F(y).rangeWrapper)
|
|
3596
3616
|
}, [
|
|
3597
|
-
|
|
3598
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
3617
|
+
H(p("input", {
|
|
3618
|
+
"onUpdate:modelValue": n[3] ||= (e) => q.value = e,
|
|
3599
3619
|
type: "date",
|
|
3600
|
-
class: x(
|
|
3601
|
-
onChange:
|
|
3602
|
-
}, null, 34), [[
|
|
3620
|
+
class: x(F(y).rangeInput),
|
|
3621
|
+
onChange: fe
|
|
3622
|
+
}, null, 34), [[R, q.value]]),
|
|
3603
3623
|
n[11] ||= p("span", { class: "text-xs text-gray-400" }, "to", -1),
|
|
3604
|
-
|
|
3605
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
3624
|
+
H(p("input", {
|
|
3625
|
+
"onUpdate:modelValue": n[4] ||= (e) => J.value = e,
|
|
3606
3626
|
type: "date",
|
|
3607
|
-
class: x(
|
|
3608
|
-
onChange:
|
|
3609
|
-
}, null, 34), [[
|
|
3627
|
+
class: x(F(y).rangeInput),
|
|
3628
|
+
onChange: fe
|
|
3629
|
+
}, null, 34), [[R, J.value]])
|
|
3610
3630
|
], 2)) : d("", !0)], 2)) : d("", !0),
|
|
3611
|
-
|
|
3631
|
+
F(ae) ? (E(), f("div", {
|
|
3612
3632
|
key: 1,
|
|
3613
|
-
class: x(
|
|
3633
|
+
class: x(F(y).offline)
|
|
3614
3634
|
}, [...n[12] ||= [p("svg", {
|
|
3615
3635
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3616
3636
|
class: "size-4",
|
|
@@ -3623,134 +3643,134 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3623
3643
|
"stroke-linejoin": "round",
|
|
3624
3644
|
d: "M12 9v3.75m0 3.75h.008v.008H12v-.008zM3.34 17.25h17.32c1.16 0 1.88-1.25 1.3-2.25L13.3 4.5c-.58-1-2.02-1-2.6 0L2.04 15c-.58 1 .14 2.25 1.3 2.25z"
|
|
3625
3645
|
})], -1), p("span", null, "You appear to be offline — showing cached results. Search and pagination run on cached data.", -1)]], 2)) : d("", !0),
|
|
3626
|
-
|
|
3646
|
+
F(ie) === "error" && !F(Y).length ? (E(), f("div", {
|
|
3627
3647
|
key: 2,
|
|
3628
|
-
class: x(
|
|
3629
|
-
},
|
|
3648
|
+
class: x(F(y).error)
|
|
3649
|
+
}, P(F(Z)), 3)) : F(ie) === "loading" && !F(Y).length ? (E(), f("div", {
|
|
3630
3650
|
key: 3,
|
|
3631
|
-
class: x(
|
|
3632
|
-
}, [g(
|
|
3633
|
-
p("div", { class: x(
|
|
3634
|
-
|
|
3651
|
+
class: x(F(y).loading)
|
|
3652
|
+
}, [g(_e, { class: "size-6" })], 2)) : (E(), f(o, { key: 4 }, [
|
|
3653
|
+
p("div", { class: x(F(y).container) }, [p("table", { class: x(F(y).table) }, [p("thead", { class: x(F(y).thead) }, [p("tr", null, [
|
|
3654
|
+
xe.value.length ? (E(), f("th", {
|
|
3635
3655
|
key: 0,
|
|
3636
|
-
class: x([
|
|
3656
|
+
class: x([F(y).th, "w-10"])
|
|
3637
3657
|
}, [p("input", {
|
|
3638
3658
|
type: "checkbox",
|
|
3639
|
-
class: x(
|
|
3659
|
+
class: x(F(y).checkbox),
|
|
3640
3660
|
checked: Te.value,
|
|
3641
3661
|
onChange: Ee
|
|
3642
|
-
}, null, 42,
|
|
3643
|
-
(E(!0), f(o, null,
|
|
3662
|
+
}, null, 42, zt)], 2)) : d("", !0),
|
|
3663
|
+
(E(!0), f(o, null, A(T.value, (e) => (E(), f("th", {
|
|
3644
3664
|
key: e.name,
|
|
3645
|
-
class: x(
|
|
3665
|
+
class: x(F(y).th)
|
|
3646
3666
|
}, [e.sortable ? (E(), f("a", {
|
|
3647
3667
|
key: 0,
|
|
3648
|
-
class: x(
|
|
3649
|
-
onClick: (t) =>
|
|
3650
|
-
}, [h(
|
|
3668
|
+
class: x(F(y).sortBtn),
|
|
3669
|
+
onClick: (t) => pe(e)
|
|
3670
|
+
}, [h(P(e.label) + " ", 1), V.value === e.name ? (E(), f("span", Vt, P(W.value === "desc" ? "↓" : "↑"), 1)) : d("", !0)], 10, Bt)) : (E(), f(o, { key: 1 }, [h(P(e.label), 1)], 64))], 2))), 128)),
|
|
3651
3671
|
e.actions.length ? (E(), f("th", {
|
|
3652
3672
|
key: 1,
|
|
3653
|
-
class: x([
|
|
3673
|
+
class: x([F(y).th, "text-right"])
|
|
3654
3674
|
}, "Actions", 2)) : d("", !0)
|
|
3655
|
-
])], 2), p("tbody", { class: x(
|
|
3675
|
+
])], 2), p("tbody", { class: x(F(y).tbody) }, [F(Y).length ? d("", !0) : (E(), f("tr", Ht, [p("td", {
|
|
3656
3676
|
colspan: ke.value,
|
|
3657
|
-
class: x(
|
|
3658
|
-
}, [
|
|
3677
|
+
class: x(F(y).empty)
|
|
3678
|
+
}, [j(t.$slots, "empty", {}, () => [h(P(e.emptyMessage), 1)])], 10, Ut)])), (E(!0), f(o, null, A(F(Y), (r, i) => (E(), f("tr", {
|
|
3659
3679
|
key: r.id ?? i,
|
|
3660
|
-
class: x([
|
|
3680
|
+
class: x([F(y).tr, e.rowLink ? F(y).trClickable : ""]),
|
|
3661
3681
|
onClick: (e) => we(r)
|
|
3662
3682
|
}, [
|
|
3663
|
-
|
|
3683
|
+
xe.value.length ? (E(), f("td", {
|
|
3664
3684
|
key: 0,
|
|
3665
|
-
class: x(
|
|
3666
|
-
onClick: n[5] ||=
|
|
3685
|
+
class: x(F(y).td),
|
|
3686
|
+
onClick: n[5] ||= U(() => {}, ["stop"])
|
|
3667
3687
|
}, [p("input", {
|
|
3668
3688
|
type: "checkbox",
|
|
3669
|
-
class: x(
|
|
3689
|
+
class: x(F(y).checkbox),
|
|
3670
3690
|
checked: $.value.includes(r.id),
|
|
3671
3691
|
onChange: (e) => De(r.id)
|
|
3672
|
-
}, null, 42,
|
|
3673
|
-
(E(!0), f(o, null,
|
|
3692
|
+
}, null, 42, Gt)], 2)) : d("", !0),
|
|
3693
|
+
(E(!0), f(o, null, A(T.value, (e) => (E(), f("td", {
|
|
3674
3694
|
key: e.name,
|
|
3675
|
-
class: x([
|
|
3676
|
-
}, [
|
|
3695
|
+
class: x([F(y).td, e.class])
|
|
3696
|
+
}, [j(t.$slots, `cell-${e.name}`, {
|
|
3677
3697
|
row: r,
|
|
3678
|
-
value:
|
|
3698
|
+
value: ve(r, e),
|
|
3679
3699
|
index: i
|
|
3680
|
-
}, () => [e.component ? (E(), u(
|
|
3700
|
+
}, () => [e.component ? (E(), u(N(e.component), {
|
|
3681
3701
|
key: 0,
|
|
3682
3702
|
row: r,
|
|
3683
|
-
value:
|
|
3703
|
+
value: F(Et)(r, e.name)
|
|
3684
3704
|
}, null, 8, ["row", "value"])) : e.format === "money" ? (E(), f("span", {
|
|
3685
3705
|
key: 1,
|
|
3686
|
-
class: x(
|
|
3687
|
-
},
|
|
3706
|
+
class: x(F(y).money)
|
|
3707
|
+
}, P(ve(r, e)), 3)) : (E(), f("span", {
|
|
3688
3708
|
key: 2,
|
|
3689
|
-
innerHTML:
|
|
3690
|
-
}, null, 8,
|
|
3709
|
+
innerHTML: ve(r, e)
|
|
3710
|
+
}, null, 8, Kt))])], 2))), 128)),
|
|
3691
3711
|
e.actions.length ? (E(), f("td", {
|
|
3692
3712
|
key: 1,
|
|
3693
|
-
class: x(
|
|
3694
|
-
onClick: n[6] ||=
|
|
3695
|
-
}, [
|
|
3713
|
+
class: x(F(y).actionsCell),
|
|
3714
|
+
onClick: n[6] ||= U(() => {}, ["stop"])
|
|
3715
|
+
}, [j(t.$slots, "actions", { row: r }, () => [(E(!0), f(o, null, A(be(r), (e) => (E(), f("a", {
|
|
3696
3716
|
key: e.label,
|
|
3697
|
-
class: x([
|
|
3717
|
+
class: x([F(y).actionBtn, e.class]),
|
|
3698
3718
|
onClick: (t) => Ce(e, r)
|
|
3699
|
-
},
|
|
3700
|
-
], 10,
|
|
3701
|
-
p("div", { class: x(
|
|
3719
|
+
}, P(e.label), 11, qt))), 128))])], 2)) : d("", !0)
|
|
3720
|
+
], 10, Wt))), 128))], 2)], 2)], 2),
|
|
3721
|
+
p("div", { class: x(F(y).cards) }, [F(Y).length ? d("", !0) : (E(), f("p", {
|
|
3702
3722
|
key: 0,
|
|
3703
|
-
class: x(
|
|
3704
|
-
}, [
|
|
3723
|
+
class: x(F(y).empty)
|
|
3724
|
+
}, [j(t.$slots, "empty", {}, () => [h(P(e.emptyMessage), 1)])], 2)), (E(!0), f(o, null, A(F(Y), (r, i) => (E(), f("div", {
|
|
3705
3725
|
key: r.id ?? i,
|
|
3706
|
-
class: x([
|
|
3726
|
+
class: x([F(y).card, e.rowLink ? F(y).trClickable : ""]),
|
|
3707
3727
|
onClick: (e) => we(r)
|
|
3708
3728
|
}, [
|
|
3709
|
-
|
|
3729
|
+
xe.value.length ? (E(), f("label", {
|
|
3710
3730
|
key: 0,
|
|
3711
|
-
class: x([
|
|
3712
|
-
onClick: n[7] ||=
|
|
3731
|
+
class: x([F(y).exactLabel, "mb-2"]),
|
|
3732
|
+
onClick: n[7] ||= U(() => {}, ["stop"])
|
|
3713
3733
|
}, [p("input", {
|
|
3714
3734
|
type: "checkbox",
|
|
3715
|
-
class: x(
|
|
3735
|
+
class: x(F(y).checkbox),
|
|
3716
3736
|
checked: $.value.includes(r.id),
|
|
3717
3737
|
onChange: (e) => De(r.id)
|
|
3718
|
-
}, null, 42,
|
|
3719
|
-
(E(!0), f(o, null,
|
|
3738
|
+
}, null, 42, Yt), n[13] ||= h(" Select ", -1)], 2)) : d("", !0),
|
|
3739
|
+
(E(!0), f(o, null, A(T.value, (e) => (E(), f(o, { key: e.name }, [p("p", { class: x(F(y).cardLabel) }, P(e.label), 3), p("div", { class: x(F(y).cardValue) }, [j(t.$slots, `cell-${e.name}`, {
|
|
3720
3740
|
row: r,
|
|
3721
|
-
value:
|
|
3741
|
+
value: ve(r, e),
|
|
3722
3742
|
index: i
|
|
3723
|
-
}, () => [e.component ? (E(), u(
|
|
3743
|
+
}, () => [e.component ? (E(), u(N(e.component), {
|
|
3724
3744
|
key: 0,
|
|
3725
3745
|
row: r,
|
|
3726
|
-
value:
|
|
3746
|
+
value: F(Et)(r, e.name)
|
|
3727
3747
|
}, null, 8, ["row", "value"])) : e.format === "money" ? (E(), f("span", {
|
|
3728
3748
|
key: 1,
|
|
3729
|
-
class: x(
|
|
3730
|
-
},
|
|
3749
|
+
class: x(F(y).money)
|
|
3750
|
+
}, P(ve(r, e)), 3)) : (E(), f("span", {
|
|
3731
3751
|
key: 2,
|
|
3732
|
-
innerHTML:
|
|
3733
|
-
}, null, 8,
|
|
3752
|
+
innerHTML: ve(r, e)
|
|
3753
|
+
}, null, 8, Xt))])], 2)], 64))), 128)),
|
|
3734
3754
|
e.actions.length ? (E(), f("div", {
|
|
3735
3755
|
key: 1,
|
|
3736
3756
|
class: "mt-2",
|
|
3737
|
-
onClick: n[8] ||=
|
|
3738
|
-
}, [
|
|
3757
|
+
onClick: n[8] ||= U(() => {}, ["stop"])
|
|
3758
|
+
}, [j(t.$slots, "actions", { row: r }, () => [(E(!0), f(o, null, A(be(r), (e) => (E(), f("a", {
|
|
3739
3759
|
key: e.label,
|
|
3740
|
-
class: x([
|
|
3760
|
+
class: x([F(y).actionBtn, e.class]),
|
|
3741
3761
|
onClick: (t) => Ce(e, r)
|
|
3742
|
-
},
|
|
3743
|
-
], 10,
|
|
3744
|
-
|
|
3762
|
+
}, P(e.label), 11, Zt))), 128))])])) : d("", !0)
|
|
3763
|
+
], 10, Jt))), 128))], 2),
|
|
3764
|
+
F(re) && F(Y).length ? (E(), u(It, {
|
|
3745
3765
|
key: 0,
|
|
3746
|
-
meta:
|
|
3766
|
+
meta: F(re),
|
|
3747
3767
|
"per-page": I.value,
|
|
3748
|
-
mode:
|
|
3749
|
-
loading:
|
|
3750
|
-
theme:
|
|
3751
|
-
onPage:
|
|
3752
|
-
onPerPage:
|
|
3753
|
-
onLoadMore:
|
|
3768
|
+
mode: te.value,
|
|
3769
|
+
loading: F(ie) === "loading",
|
|
3770
|
+
theme: F(y).pagination,
|
|
3771
|
+
onPage: me,
|
|
3772
|
+
onPerPage: he,
|
|
3773
|
+
onLoadMore: ge
|
|
3754
3774
|
}, null, 8, [
|
|
3755
3775
|
"meta",
|
|
3756
3776
|
"per-page",
|
|
@@ -3759,22 +3779,233 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3759
3779
|
"theme"
|
|
3760
3780
|
])) : d("", !0)
|
|
3761
3781
|
], 64)),
|
|
3762
|
-
$.value.length &&
|
|
3782
|
+
$.value.length && xe.value.length ? (E(), f("div", {
|
|
3763
3783
|
key: 5,
|
|
3764
|
-
class: x(
|
|
3765
|
-
}, [p("div",
|
|
3784
|
+
class: x(F(y).multiBar)
|
|
3785
|
+
}, [p("div", Qt, [p("span", { class: x(F(y).multiCount) }, P($.value.length), 3), n[14] ||= h(" selected ", -1)]), p("div", $t, [(E(!0), f(o, null, A(xe.value, (e) => (E(), f("button", {
|
|
3766
3786
|
key: e.label,
|
|
3767
3787
|
type: "button",
|
|
3768
|
-
class: x([
|
|
3788
|
+
class: x([F(y).multiBtn, e.class]),
|
|
3769
3789
|
onClick: (t) => Oe(e)
|
|
3770
|
-
},
|
|
3790
|
+
}, P(e.label), 11, en))), 128)), p("button", {
|
|
3771
3791
|
type: "button",
|
|
3772
|
-
class: x(
|
|
3792
|
+
class: x(F(y).multiBtn),
|
|
3773
3793
|
onClick: n[9] ||= (e) => $.value = []
|
|
3774
3794
|
}, "Cancel", 2)])], 2)) : d("", !0)
|
|
3775
3795
|
], 2));
|
|
3776
3796
|
}
|
|
3777
|
-
},
|
|
3797
|
+
}, nn = { key: 2 }, rn = [
|
|
3798
|
+
"aria-selected",
|
|
3799
|
+
"tabindex",
|
|
3800
|
+
"disabled",
|
|
3801
|
+
"onClick",
|
|
3802
|
+
"onKeydown"
|
|
3803
|
+
], an = { key: 0 }, on = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
|
|
3804
|
+
__name: "ShTabs",
|
|
3805
|
+
props: {
|
|
3806
|
+
tabs: {
|
|
3807
|
+
type: Array,
|
|
3808
|
+
required: !0
|
|
3809
|
+
},
|
|
3810
|
+
modelValue: {
|
|
3811
|
+
type: String,
|
|
3812
|
+
default: null
|
|
3813
|
+
},
|
|
3814
|
+
data: {
|
|
3815
|
+
type: Object,
|
|
3816
|
+
default: () => ({})
|
|
3817
|
+
},
|
|
3818
|
+
counts: {
|
|
3819
|
+
type: [Object, String],
|
|
3820
|
+
default: null
|
|
3821
|
+
},
|
|
3822
|
+
variant: {
|
|
3823
|
+
type: String,
|
|
3824
|
+
default: "underline"
|
|
3825
|
+
},
|
|
3826
|
+
sync: {
|
|
3827
|
+
type: String,
|
|
3828
|
+
default: "none"
|
|
3829
|
+
},
|
|
3830
|
+
queryKey: {
|
|
3831
|
+
type: String,
|
|
3832
|
+
default: "tab"
|
|
3833
|
+
},
|
|
3834
|
+
router: {
|
|
3835
|
+
type: Boolean,
|
|
3836
|
+
default: !1
|
|
3837
|
+
},
|
|
3838
|
+
baseUrl: {
|
|
3839
|
+
type: String,
|
|
3840
|
+
default: null
|
|
3841
|
+
},
|
|
3842
|
+
lazy: {
|
|
3843
|
+
type: Boolean,
|
|
3844
|
+
default: !1
|
|
3845
|
+
},
|
|
3846
|
+
emptyMessage: {
|
|
3847
|
+
type: String,
|
|
3848
|
+
default: "No tabs available"
|
|
3849
|
+
},
|
|
3850
|
+
forbiddenMessage: {
|
|
3851
|
+
type: String,
|
|
3852
|
+
default: "403 — not allowed"
|
|
3853
|
+
},
|
|
3854
|
+
classes: {
|
|
3855
|
+
type: Object,
|
|
3856
|
+
default: null
|
|
3857
|
+
}
|
|
3858
|
+
},
|
|
3859
|
+
emits: ["update:modelValue", "change"],
|
|
3860
|
+
setup(e, { expose: t, emit: r }) {
|
|
3861
|
+
let i = e, s = r, c = X("tabs", l(() => i.classes)), m = l(() => {
|
|
3862
|
+
let e = c.value[i.variant];
|
|
3863
|
+
return e ? {
|
|
3864
|
+
...c.value,
|
|
3865
|
+
...e
|
|
3866
|
+
} : c.value;
|
|
3867
|
+
}), g = a(), v = _()?.appContext.config.globalProperties.$router ?? null, b = l(() => !!(i.router || i.baseUrl) && !!v), S = l(() => v?.currentRoute.value ?? null), C = v ? M("RouterLink") : null, T = v ? M("RouterView") : null, D = (e) => String(e).trim().replace(/\s+/g, "_").toLowerCase(), O = l(() => (i.tabs ?? []).map((e) => {
|
|
3868
|
+
let t = typeof e == "string" ? { key: e } : typeof e == "function" ? { ...e(i.data) } : { ...e };
|
|
3869
|
+
return t.key = t.key ?? t.name ?? (t.label ? D(t.label) : ""), t.label = t.label ?? ce(t.key), t;
|
|
3870
|
+
}).filter((e) => !(e.validator && !e.validator(i.data) || e.permission && !g.isAllowedTo(e.permission)))), ee = l(() => i.tabs.length > 0 && O.value.length === 0), I = k({}), L = (e) => {
|
|
3871
|
+
let t = I.value[e.key] ?? (i.counts && typeof i.counts == "object" ? i.counts[e.key] : void 0) ?? e.count ?? e.counts ?? e.badge;
|
|
3872
|
+
return t === 0 || t ? t : null;
|
|
3873
|
+
}, R = k(null);
|
|
3874
|
+
l(() => O.value.find((e) => e.key === R.value) ?? null);
|
|
3875
|
+
let U = k([]), W = (e) => !i.lazy || U.value.includes(e.key), G = (e) => {
|
|
3876
|
+
e && !U.value.includes(e) && U.value.push(e);
|
|
3877
|
+
}, K = (e) => {
|
|
3878
|
+
!e || e.disabled || e.key === R.value || (R.value = e.key, G(e.key), s("update:modelValue", e.key), s("change", e.key, e), i.sync === "query" && v && S.value && v.replace({ query: {
|
|
3879
|
+
...S.value.query,
|
|
3880
|
+
[i.queryKey]: e.key
|
|
3881
|
+
} }));
|
|
3882
|
+
};
|
|
3883
|
+
B(() => i.modelValue, (e) => {
|
|
3884
|
+
e != null && e !== R.value && O.value.some((t) => t.key === e) && (R.value = e, G(e));
|
|
3885
|
+
});
|
|
3886
|
+
let q = l(() => (i.baseUrl ?? S.value?.path ?? "").replace(/\/tab\/[^/]+\/?$/, "")), J = (e) => `${q.value}/tab/${e.key}`, te = l(() => {
|
|
3887
|
+
let e = S.value?.path ?? "";
|
|
3888
|
+
return O.value.find((t) => e.includes(`/tab/${t.key}`))?.key ?? null;
|
|
3889
|
+
});
|
|
3890
|
+
w(() => {
|
|
3891
|
+
if (typeof i.counts == "string" && n.doGet(i.counts).then((e) => {
|
|
3892
|
+
I.value = { ...e.data };
|
|
3893
|
+
}).catch(() => {}), O.value.length === 0) return;
|
|
3894
|
+
if (b.value) {
|
|
3895
|
+
te.value || v.replace(J(O.value[0]));
|
|
3896
|
+
return;
|
|
3897
|
+
}
|
|
3898
|
+
let e = i.modelValue;
|
|
3899
|
+
!e && i.sync === "query" && (e = S.value?.query[i.queryKey]), O.value.some((t) => t.key === e) || (e = O.value[0].key), R.value = e, G(e), i.modelValue ?? s("update:modelValue", e), i.sync === "query" && v && S.value?.query[i.queryKey] !== e && v.replace({ query: {
|
|
3900
|
+
...S.value.query,
|
|
3901
|
+
[i.queryKey]: e
|
|
3902
|
+
} });
|
|
3903
|
+
});
|
|
3904
|
+
let ne = k([]), Y = (e) => ne.value[e]?.focus(), re = (e, t) => {
|
|
3905
|
+
let n = O.value.length;
|
|
3906
|
+
for (let r = 1; r <= n; r++) {
|
|
3907
|
+
let i = (e + t * r % n + n) % n;
|
|
3908
|
+
if (!O.value[i].disabled) return i;
|
|
3909
|
+
}
|
|
3910
|
+
return e;
|
|
3911
|
+
}, ie = (e, t) => {
|
|
3912
|
+
let n = {
|
|
3913
|
+
ArrowRight: 1,
|
|
3914
|
+
ArrowDown: 1,
|
|
3915
|
+
ArrowLeft: -1,
|
|
3916
|
+
ArrowUp: -1
|
|
3917
|
+
}, r;
|
|
3918
|
+
if (e.key in n) r = re(t, n[e.key]);
|
|
3919
|
+
else if (e.key === "Home") r = O.value.findIndex((e) => !e.disabled);
|
|
3920
|
+
else if (e.key === "End") r = O.value.length - 1 - [...O.value].reverse().findIndex((e) => !e.disabled);
|
|
3921
|
+
else return;
|
|
3922
|
+
e.preventDefault(), K(O.value[r]), Y(r);
|
|
3923
|
+
}, Z = (e) => (b.value ? te.value : R.value) === e.key;
|
|
3924
|
+
return t({
|
|
3925
|
+
active: R,
|
|
3926
|
+
select: K
|
|
3927
|
+
}), (t, n) => ee.value ? (E(), f("div", {
|
|
3928
|
+
key: 0,
|
|
3929
|
+
class: x(m.value.empty)
|
|
3930
|
+
}, P(e.forbiddenMessage), 3)) : O.value.length ? (E(), f("div", nn, [p("div", {
|
|
3931
|
+
class: x(m.value.nav),
|
|
3932
|
+
role: "tablist"
|
|
3933
|
+
}, [(E(!0), f(o, null, A(O.value, (e, t) => (E(), f(o, { key: e.key }, [b.value ? (E(), u(N(F(C)), {
|
|
3934
|
+
key: 0,
|
|
3935
|
+
ref_for: !0,
|
|
3936
|
+
ref: (e) => ne.value[t] = e?.$el ?? e,
|
|
3937
|
+
to: J(e),
|
|
3938
|
+
role: "tab",
|
|
3939
|
+
"aria-selected": Z(e),
|
|
3940
|
+
tabindex: Z(e) ? 0 : -1,
|
|
3941
|
+
class: x([Z(e) ? m.value.tabActive : m.value.tab, e.class]),
|
|
3942
|
+
onKeydown: (e) => ie(e, t)
|
|
3943
|
+
}, {
|
|
3944
|
+
default: V(() => [
|
|
3945
|
+
e.icon ? (E(), u(N(e.icon), {
|
|
3946
|
+
key: 0,
|
|
3947
|
+
class: x(m.value.icon)
|
|
3948
|
+
}, null, 8, ["class"])) : d("", !0),
|
|
3949
|
+
h(" " + P(e.label) + " ", 1),
|
|
3950
|
+
L(e) == null ? d("", !0) : (E(), f("span", {
|
|
3951
|
+
key: 1,
|
|
3952
|
+
class: x(Z(e) ? m.value.countActive : m.value.count)
|
|
3953
|
+
}, P(L(e)), 3))
|
|
3954
|
+
]),
|
|
3955
|
+
_: 2
|
|
3956
|
+
}, 1064, [
|
|
3957
|
+
"to",
|
|
3958
|
+
"aria-selected",
|
|
3959
|
+
"tabindex",
|
|
3960
|
+
"class",
|
|
3961
|
+
"onKeydown"
|
|
3962
|
+
])) : (E(), f("button", {
|
|
3963
|
+
key: 1,
|
|
3964
|
+
ref_for: !0,
|
|
3965
|
+
ref: (e) => ne.value[t] = e,
|
|
3966
|
+
type: "button",
|
|
3967
|
+
role: "tab",
|
|
3968
|
+
"aria-selected": Z(e),
|
|
3969
|
+
tabindex: Z(e) ? 0 : -1,
|
|
3970
|
+
disabled: e.disabled,
|
|
3971
|
+
class: x([Z(e) ? m.value.tabActive : m.value.tab, e.class]),
|
|
3972
|
+
onClick: (t) => K(e),
|
|
3973
|
+
onKeydown: (e) => ie(e, t)
|
|
3974
|
+
}, [
|
|
3975
|
+
e.icon ? (E(), u(N(e.icon), {
|
|
3976
|
+
key: 0,
|
|
3977
|
+
class: x(m.value.icon)
|
|
3978
|
+
}, null, 8, ["class"])) : d("", !0),
|
|
3979
|
+
h(" " + P(e.label) + " ", 1),
|
|
3980
|
+
L(e) == null ? d("", !0) : (E(), f("span", {
|
|
3981
|
+
key: 1,
|
|
3982
|
+
class: x(Z(e) ? m.value.countActive : m.value.count)
|
|
3983
|
+
}, P(L(e)), 3))
|
|
3984
|
+
], 42, rn))], 64))), 128))], 2), b.value ? (E(), f("div", {
|
|
3985
|
+
key: 0,
|
|
3986
|
+
class: x(m.value.panel),
|
|
3987
|
+
role: "tabpanel"
|
|
3988
|
+
}, [(E(), u(N(F(T)), y(t.$attrs, { data: e.data }), null, 16, ["data"]))], 2)) : (E(), f("div", {
|
|
3989
|
+
key: 1,
|
|
3990
|
+
class: x(m.value.panel),
|
|
3991
|
+
role: "tabpanel",
|
|
3992
|
+
tabindex: "0"
|
|
3993
|
+
}, [(E(!0), f(o, null, A(O.value, (n) => (E(), f(o, { key: n.key }, [W(n) ? H((E(), f("div", an, [n.component ? (E(), u(N(n.component), y({
|
|
3994
|
+
key: 0,
|
|
3995
|
+
ref_for: !0
|
|
3996
|
+
}, t.$attrs, { data: e.data }), null, 16, ["data"])) : j(t.$slots, `tab-${n.key}`, {
|
|
3997
|
+
key: 1,
|
|
3998
|
+
tab: n,
|
|
3999
|
+
active: n.key === R.value
|
|
4000
|
+
}, () => [j(t.$slots, "default", {
|
|
4001
|
+
tab: n,
|
|
4002
|
+
active: n.key === R.value
|
|
4003
|
+
})])], 512)), [[z, n.key === R.value]]) : d("", !0)], 64))), 128))], 2))])) : (E(), f("div", {
|
|
4004
|
+
key: 1,
|
|
4005
|
+
class: x(m.value.empty)
|
|
4006
|
+
}, P(e.emptyMessage), 3));
|
|
4007
|
+
}
|
|
4008
|
+
}), sn = {
|
|
3778
4009
|
__name: "ShConfirmAction",
|
|
3779
4010
|
props: {
|
|
3780
4011
|
url: {
|
|
@@ -3811,7 +4042,7 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3811
4042
|
"actionCanceled"
|
|
3812
4043
|
],
|
|
3813
4044
|
setup(e, { emit: t }) {
|
|
3814
|
-
let n = e, i = t, a =
|
|
4045
|
+
let n = e, i = t, a = X("buttons"), s = k(!1), c = (e) => {
|
|
3815
4046
|
s.value = !1, i("actionSuccessful", e), i("success", e), (n.successMessage || e?.message) && r.showToast(e?.message ?? n.successMessage);
|
|
3816
4047
|
}, l = (e) => {
|
|
3817
4048
|
s.value = !1, i("actionFailed", e), i("failed", e), (n.failMessage || e?.value?.message) && r.showToast(e?.value?.message ?? n.failMessage, "error");
|
|
@@ -3823,15 +4054,15 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3823
4054
|
l(e);
|
|
3824
4055
|
});
|
|
3825
4056
|
}
|
|
3826
|
-
return (t, n) => (E(), u(
|
|
3827
|
-
class: x([e.btnClass ??
|
|
4057
|
+
return (t, n) => (E(), u(N(e.tag), {
|
|
4058
|
+
class: x([e.btnClass ?? F(a).link, s.value ? "pointer-events-none opacity-60" : ""]),
|
|
3828
4059
|
onClick: d
|
|
3829
4060
|
}, {
|
|
3830
|
-
default:
|
|
4061
|
+
default: V(() => [s.value ? (E(), f(o, { key: 0 }, [g(_e, { class: "size-4" }), p("span", null, P(e.loadingMessage), 1)], 64)) : j(t.$slots, "default", { key: 1 })]),
|
|
3831
4062
|
_: 3
|
|
3832
4063
|
}, 8, ["class"]));
|
|
3833
4064
|
}
|
|
3834
|
-
},
|
|
4065
|
+
}, cn = {
|
|
3835
4066
|
__name: "ShSilentAction",
|
|
3836
4067
|
props: {
|
|
3837
4068
|
url: {
|
|
@@ -3869,7 +4100,7 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3869
4100
|
"actionFailed"
|
|
3870
4101
|
],
|
|
3871
4102
|
setup(e, { emit: t }) {
|
|
3872
|
-
let i = e, a = t, s =
|
|
4103
|
+
let i = e, a = t, s = X("buttons"), c = k(!1), l = {
|
|
3873
4104
|
GET: n.doGet,
|
|
3874
4105
|
POST: n.doPost,
|
|
3875
4106
|
PUT: n.doPut,
|
|
@@ -3882,14 +4113,14 @@ var kt = ["value"], At = ["value"], jt = ["disabled"], Mt = ["disabled"], Nt = [
|
|
|
3882
4113
|
c.value = !1, a("actionFailed", e), a("failed", e), r.showToast(e?.message ?? i.failMessage, "error");
|
|
3883
4114
|
});
|
|
3884
4115
|
}
|
|
3885
|
-
return (t, n) => (E(), u(
|
|
3886
|
-
class: x([e.btnClass ??
|
|
4116
|
+
return (t, n) => (E(), u(N(e.tag), {
|
|
4117
|
+
class: x([e.btnClass ?? F(s).link, c.value ? "pointer-events-none opacity-60" : ""]),
|
|
3887
4118
|
onClick: d
|
|
3888
4119
|
}, {
|
|
3889
|
-
default:
|
|
4120
|
+
default: V(() => [c.value ? (E(), f(o, { key: 0 }, [g(_e, { class: "size-4" }), p("span", null, P(e.loadingMessage), 1)], 64)) : j(t.$slots, "default", { key: 1 })]),
|
|
3890
4121
|
_: 3
|
|
3891
4122
|
}, 8, ["class"]));
|
|
3892
4123
|
}
|
|
3893
4124
|
};
|
|
3894
4125
|
//#endregion
|
|
3895
|
-
export {
|
|
4126
|
+
export { Ve as DateInput, Ce as EmailInput, Le as MaskedInput, ze as NumberInput, Ee as PasswordInput, Ze as PhoneInput, Oe as PinInput, q as SH_DIALOG_CONTEXT, K as SH_TW_COMPONENTS, G as SH_TW_THEME, Ke as SelectInput, sn as ShConfirmAction, ot as ShDialog, ct as ShDialogBtn, ut as ShDialogForm, st as ShDrawer, lt as ShDrawerBtn, at as ShForm, fe as ShFormSteps, cn as ShSilentAction, _e as ShSpinner, tt as ShSuggest, tn as ShTable, It as ShTablePagination, on as ShTabs, ne as ShTailwind, xe as TextAreaInput, ye as TextInput, Pe as applyMask, wt as clearTableCache, qe as countries, Y as createShTailwind, W as defaultTheme, Ot as localQuery, Ne as maskMoney, Me as maskPattern, Tt as shTableCache, se as useDialog, kt as useTableData, X as useTheme };
|