@stachelock/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +304 -0
- package/dist/CheckboxInput-rWkcde69.js +5 -0
- package/dist/CheckboxInput-rWkcde69.js.map +1 -0
- package/dist/ComboboxInput-B98P_8CZ.js +5 -0
- package/dist/ComboboxInput-B98P_8CZ.js.map +1 -0
- package/dist/SelectInput-B5liNv7H.js +5 -0
- package/dist/SelectInput-B5liNv7H.js.map +1 -0
- package/dist/SwitchInput-D1k9O8gn.js +5 -0
- package/dist/SwitchInput-D1k9O8gn.js.map +1 -0
- package/dist/TextAreaInput-Di6Kstic.js +5 -0
- package/dist/TextAreaInput-Di6Kstic.js.map +1 -0
- package/dist/UiLoading-BuzCrLqO.js +5 -0
- package/dist/UiLoading-BuzCrLqO.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4763 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +11 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/src/components/UiAvatar.d.ts +57 -0
- package/dist/src/components/UiAvatar.d.ts.map +1 -0
- package/dist/src/components/UiBadge.d.ts +44 -0
- package/dist/src/components/UiBadge.d.ts.map +1 -0
- package/dist/src/components/UiBreadcrumb.d.ts +3 -0
- package/dist/src/components/UiBreadcrumb.d.ts.map +1 -0
- package/dist/src/components/UiButton.d.ts +119 -0
- package/dist/src/components/UiButton.d.ts.map +1 -0
- package/dist/src/components/UiLoading.d.ts +36 -0
- package/dist/src/components/UiLoading.d.ts.map +1 -0
- package/dist/src/components/UiLoadingDots.d.ts +53 -0
- package/dist/src/components/UiLoadingDots.d.ts.map +1 -0
- package/dist/src/components/UiModal.d.ts +102 -0
- package/dist/src/components/UiModal.d.ts.map +1 -0
- package/dist/src/components/UiNavLink.d.ts +73 -0
- package/dist/src/components/UiNavLink.d.ts.map +1 -0
- package/dist/src/components/UiProgressBar.d.ts +35 -0
- package/dist/src/components/UiProgressBar.d.ts.map +1 -0
- package/dist/src/components/UiRadialProgressBar.d.ts +43 -0
- package/dist/src/components/UiRadialProgressBar.d.ts.map +1 -0
- package/dist/src/components/UiTable.d.ts +94 -0
- package/dist/src/components/UiTable.d.ts.map +1 -0
- package/dist/src/components/UiTextInput.d.ts +108 -0
- package/dist/src/components/UiTextInput.d.ts.map +1 -0
- package/dist/src/components/UiTransition.d.ts +41 -0
- package/dist/src/components/UiTransition.d.ts.map +1 -0
- package/dist/src/components/calendars/CalendarDashboard.d.ts +32 -0
- package/dist/src/components/calendars/CalendarDashboard.d.ts.map +1 -0
- package/dist/src/components/calendars/CalendarHeader.d.ts +26 -0
- package/dist/src/components/calendars/CalendarHeader.d.ts.map +1 -0
- package/dist/src/components/calendars/DayCalendar.d.ts +24 -0
- package/dist/src/components/calendars/DayCalendar.d.ts.map +1 -0
- package/dist/src/components/calendars/EventCard.d.ts +19 -0
- package/dist/src/components/calendars/EventCard.d.ts.map +1 -0
- package/dist/src/components/calendars/EventsList.d.ts +24 -0
- package/dist/src/components/calendars/EventsList.d.ts.map +1 -0
- package/dist/src/components/calendars/MonthCalendar.d.ts +36 -0
- package/dist/src/components/calendars/MonthCalendar.d.ts.map +1 -0
- package/dist/src/components/calendars/WeekCalendar.d.ts +24 -0
- package/dist/src/components/calendars/WeekCalendar.d.ts.map +1 -0
- package/dist/src/components/calendars/YearCalendar.d.ts +18 -0
- package/dist/src/components/calendars/YearCalendar.d.ts.map +1 -0
- package/dist/src/components/calendars/index.d.ts +9 -0
- package/dist/src/components/calendars/index.d.ts.map +1 -0
- package/dist/src/components/forms/DynamicForm.d.ts +70 -0
- package/dist/src/components/forms/DynamicForm.d.ts.map +1 -0
- package/dist/src/components/forms/DynamicFormField.d.ts +25 -0
- package/dist/src/components/forms/DynamicFormField.d.ts.map +1 -0
- package/dist/src/components/forms/FormFieldWrapper.d.ts +108 -0
- package/dist/src/components/forms/FormFieldWrapper.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +4 -0
- package/dist/src/components/forms/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +18 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/inputs/CheckboxInput.d.ts +68 -0
- package/dist/src/components/inputs/CheckboxInput.d.ts.map +1 -0
- package/dist/src/components/inputs/ComboboxInput.d.ts +76 -0
- package/dist/src/components/inputs/ComboboxInput.d.ts.map +1 -0
- package/dist/src/components/inputs/InputsShowcase.d.ts +3 -0
- package/dist/src/components/inputs/InputsShowcase.d.ts.map +1 -0
- package/dist/src/components/inputs/SelectInput.d.ts +67 -0
- package/dist/src/components/inputs/SelectInput.d.ts.map +1 -0
- package/dist/src/components/inputs/SwitchInput.d.ts +80 -0
- package/dist/src/components/inputs/SwitchInput.d.ts.map +1 -0
- package/dist/src/components/inputs/TagifyInput.d.ts +183 -0
- package/dist/src/components/inputs/TagifyInput.d.ts.map +1 -0
- package/dist/src/components/inputs/TextAreaInput.d.ts +68 -0
- package/dist/src/components/inputs/TextAreaInput.d.ts.map +1 -0
- package/dist/src/components/inputs/index.d.ts +8 -0
- package/dist/src/components/inputs/index.d.ts.map +1 -0
- package/dist/src/components/layouts/DashboardLayout.d.ts +33 -0
- package/dist/src/components/layouts/DashboardLayout.d.ts.map +1 -0
- package/dist/src/components/layouts/DefaultLayout.d.ts +58 -0
- package/dist/src/components/layouts/DefaultLayout.d.ts.map +1 -0
- package/dist/src/components/layouts/HeaderLayout.d.ts +15 -0
- package/dist/src/components/layouts/HeaderLayout.d.ts.map +1 -0
- package/dist/src/components/layouts/NavigationGroup.d.ts +25 -0
- package/dist/src/components/layouts/NavigationGroup.d.ts.map +1 -0
- package/dist/src/components/layouts/NavigationItem.d.ts +30 -0
- package/dist/src/components/layouts/NavigationItem.d.ts.map +1 -0
- package/dist/src/components/layouts/SidebarLayout.d.ts +27 -0
- package/dist/src/components/layouts/SidebarLayout.d.ts.map +1 -0
- package/dist/src/components/layouts/index.d.ts +7 -0
- package/dist/src/components/layouts/index.d.ts.map +1 -0
- package/dist/src/composables/index.d.ts +4 -0
- package/dist/src/composables/index.d.ts.map +1 -0
- package/dist/src/composables/useCalendar.d.ts +146 -0
- package/dist/src/composables/useCalendar.d.ts.map +1 -0
- package/dist/src/composables/useFormValidation.d.ts +52 -0
- package/dist/src/composables/useFormValidation.d.ts.map +1 -0
- package/dist/src/composables/useModal.d.ts +36 -0
- package/dist/src/composables/useModal.d.ts.map +1 -0
- package/dist/src/dev.d.ts +2 -0
- package/dist/src/dev.d.ts.map +1 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/plugin.d.ts +21 -0
- package/dist/src/plugin.d.ts.map +1 -0
- package/dist/src/types/avatars.d.ts +10 -0
- package/dist/src/types/avatars.d.ts.map +1 -0
- package/dist/src/types/badges.d.ts +10 -0
- package/dist/src/types/badges.d.ts.map +1 -0
- package/dist/src/types/calendars.d.ts +28 -0
- package/dist/src/types/calendars.d.ts.map +1 -0
- package/dist/src/types/form.d.ts +86 -0
- package/dist/src/types/form.d.ts.map +1 -0
- package/dist/src/types/forms.d.ts +17 -0
- package/dist/src/types/forms.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +13 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/inputs.d.ts +22 -0
- package/dist/src/types/inputs.d.ts.map +1 -0
- package/dist/src/types/layouts.d.ts +41 -0
- package/dist/src/types/layouts.d.ts.map +1 -0
- package/dist/src/types/loading.d.ts +11 -0
- package/dist/src/types/loading.d.ts.map +1 -0
- package/dist/src/types/navigation.d.ts +18 -0
- package/dist/src/types/navigation.d.ts.map +1 -0
- package/dist/src/types/tables.d.ts +24 -0
- package/dist/src/types/tables.d.ts.map +1 -0
- package/dist/src/types/transitions.d.ts +16 -0
- package/dist/src/types/transitions.d.ts.map +1 -0
- package/dist/src/types/ui.d.ts +353 -0
- package/dist/src/types/ui.d.ts.map +1 -0
- package/dist/src/utils/calendar.d.ts +50 -0
- package/dist/src/utils/calendar.d.ts.map +1 -0
- package/dist/src/utils/component-registry.d.ts +48 -0
- package/dist/src/utils/component-registry.d.ts.map +1 -0
- package/dist/src/utils/id.d.ts +13 -0
- package/dist/src/utils/id.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +143 -0
- package/tailwind.config.js +110 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4763 @@
|
|
|
1
|
+
import { defineComponent as z, useSlots as _s, computed as B, createElementBlock as r, openBlock as o, normalizeClass as V, createElementVNode as e, createVNode as _, createCommentVNode as b, createTextVNode as Q, toDisplayString as w, Fragment as E, renderSlot as S, unref as f, Transition as xe, withCtx as L, ref as P, toRef as De, watch as q, nextTick as de, mergeProps as he, defineAsyncComponent as we, inject as ue, getCurrentInstance as Cs, watchEffect as We, onMounted as ne, toRefs as Ss, createBlock as K, renderList as j, normalizeStyle as le, createStaticVNode as Ms, resolveDynamicComponent as ce, withModifiers as Y, onUnmounted as Ts, toHandlers as Bs, reactive as qe, withDirectives as me, vModelCheckbox as Vs, isRef as As, vModelText as be, withKeys as fe } from "vue";
|
|
2
|
+
import { useField as te, useForm as Ls } from "vee-validate";
|
|
3
|
+
import { debounce as Is } from "lodash-es";
|
|
4
|
+
import { ExclamationCircleIcon as Ds, CheckCircleIcon as Es, ChevronRightIcon as Ps, ChevronUpDownIcon as Qe, CheckIcon as Ge, CalendarIcon as zs, XMarkIcon as Os } from "@heroicons/vue/20/solid";
|
|
5
|
+
import { TransitionRoot as ve, Dialog as ke, TransitionChild as se, DialogPanel as $e, DialogTitle as js, Listbox as Fs, ListboxButton as Ns, ListboxOptions as Rs, ListboxOption as Us, Combobox as Hs, ComboboxInput as Ks, ComboboxButton as Ws, ComboboxOptions as qs, ComboboxOption as ye, Switch as Qs } from "@headlessui/vue";
|
|
6
|
+
import { getCoreRowModel as Gs, useVueTable as Js, FlexRender as Ee } from "@tanstack/vue-table";
|
|
7
|
+
import { getSortedRowModel as Ys } from "@tanstack/table-core";
|
|
8
|
+
import "date-fns";
|
|
9
|
+
import { CalendarIcon as Xs, MapPinIcon as Pe, NoSymbolIcon as Zs } from "@heroicons/vue/24/solid";
|
|
10
|
+
import { NoSymbolIcon as el, MapPinIcon as sl, ExclamationTriangleIcon as ll, ExclamationCircleIcon as tl, XMarkIcon as Je, Bars3Icon as Ye } from "@heroicons/vue/24/outline";
|
|
11
|
+
function ae(t = "sl") {
|
|
12
|
+
return `${t}-${Math.random().toString(36).substr(2, 9)}-${Date.now().toString(36)}`;
|
|
13
|
+
}
|
|
14
|
+
function vi(t, l = "sl") {
|
|
15
|
+
let s = 0;
|
|
16
|
+
for (let a = 0; a < t.length; a++) {
|
|
17
|
+
const m = t.charCodeAt(a);
|
|
18
|
+
s = (s << 5) - s + m, s = s & s;
|
|
19
|
+
}
|
|
20
|
+
return `${l}-${Math.abs(s).toString(36)}`;
|
|
21
|
+
}
|
|
22
|
+
function yi(t) {
|
|
23
|
+
return t.toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
24
|
+
}
|
|
25
|
+
const al = { class: "sl-grid sl-grid-cols-3 sl-items-center" }, ol = ["for"], nl = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "sl-text-red-500 sl-ml-1"
|
|
28
|
+
}, rl = { class: "disabled-message sl-text-xs sl-text-gray-400 sl-col-start-3 sl-text-right" }, il = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "sl-text-xs sl-uppercase sl-text-gray-500 sl-truncate sl-text-right sl-font-semibold sl-justify-self-end sl-col-start-3"
|
|
31
|
+
}, dl = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "sl-text-2xs sl-uppercase sl-text-gray-500 sl-truncate sl-text-right sl-font-semibold sl-justify-self-end sl-col-start-3"
|
|
34
|
+
}, ul = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-3 sl-z-10 sl-pointer-events-none"
|
|
37
|
+
}, cl = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-3 sl-z-10 sl-pointer-events-none"
|
|
40
|
+
}, ml = { class: "sl-flex sl-select-none sl-items-center sl-pl-3 sl-text-gray-500 sm:sl-text-sm" }, fl = { class: "sl-flex-1 sl-min-w-0" }, gl = {
|
|
41
|
+
key: 3,
|
|
42
|
+
class: "sl-relative"
|
|
43
|
+
}, pl = { class: "sl-flex-1 sl-min-w-0 sl-pl-2 sl-pr-2" }, hl = { class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center" }, vl = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "error-message sl-mt-2 sl-text-sm sl-text-red-600 sl-bg-red-50 sl-ring-1 sl-ring-red-100 sl-rounded-md sl-p-2"
|
|
46
|
+
}, yl = {
|
|
47
|
+
key: 1,
|
|
48
|
+
class: "success-message sl-mt-2 sl-text-sm sl-text-green-600 sl-bg-green-50 sl-p-2 sl-rounded-md"
|
|
49
|
+
}, bl = "sl-block sl-w-full sl-border-0 sl-bg-transparent sl-py-1.5 sl-text-gray-800 sl-placeholder:text-gray-400 focus:sl-ring-0 sm:sl-text-sm sm:sl-leading-6", xl = "sl-block sl-w-full sl-rounded-md sl-border-0 sl-py-1.5 sl-text-gray-800 sl-shadow-sm sl-ring-1 sl-ring-inset sl-placeholder:text-gray-400 focus:sl-ring-2 focus:sl-ring-inset focus:sl-ring-stachelock-600 sm:sl-text-sm sm:sl-leading-6", wl = "sl-block sl-w-full sl-border-0 sl-bg-transparent sl-py-1 sl-text-gray-400 sl-placeholder:text-gray-400 focus:sl-ring-0 sm:sl-text-sm sm:sl-leading-6 sl-cursor-not-allowed", kl = /* @__PURE__ */ z({
|
|
50
|
+
__name: "FormFieldWrapper",
|
|
51
|
+
props: {
|
|
52
|
+
id: {},
|
|
53
|
+
name: {},
|
|
54
|
+
label: { default: "" },
|
|
55
|
+
tertiaryLabel: { default: "" },
|
|
56
|
+
errorMessage: { default: null },
|
|
57
|
+
successMessage: { default: "" },
|
|
58
|
+
isValid: { type: Boolean, default: !1 },
|
|
59
|
+
isTouched: { type: Boolean, default: !1 },
|
|
60
|
+
showErrors: { type: Boolean, default: !1 },
|
|
61
|
+
showValidCheck: { type: Boolean, default: !0 },
|
|
62
|
+
colorfulValidation: { type: Boolean, default: !1 },
|
|
63
|
+
disabled: { type: Boolean, default: !1 },
|
|
64
|
+
disabledMessage: { default: "" },
|
|
65
|
+
optional: { type: Boolean, default: !1 },
|
|
66
|
+
boxShadow: { type: Boolean, default: !1 },
|
|
67
|
+
formTracking: { type: Boolean, default: !1 },
|
|
68
|
+
isFocused: { type: Boolean, default: !1 },
|
|
69
|
+
isHovered: { type: Boolean, default: !1 },
|
|
70
|
+
externalErrors: { default: null }
|
|
71
|
+
},
|
|
72
|
+
setup(t) {
|
|
73
|
+
const l = t, s = _s(), a = B(() => !!s.prefix), m = B(() => [
|
|
74
|
+
l.boxShadow ? "sl-shadow sm:sl-rounded-lg sl-mt-2 sl-mb-4 sl-px-4 sl-py-5 sm:sl-p-6" : "",
|
|
75
|
+
l.formTracking && (l.isFocused || l.isHovered) ? "sl-ring-1 sl-ring-stachelock-600 sl-bg-white/80" : "",
|
|
76
|
+
l.externalErrors && l.externalErrors[l.name] ? "has-error" : ""
|
|
77
|
+
]), u = B(() => l.disabled || !l.colorfulValidation ? "sl-ring-gray-300" : l.isValid && (l.isTouched || l.showValidCheck) ? "sl-ring-green-500" : l.errorMessage && (l.isTouched || l.showErrors) ? "sl-ring-red-500" : "sl-ring-gray-300");
|
|
78
|
+
return (n, p) => (o(), r("div", {
|
|
79
|
+
class: V([[
|
|
80
|
+
{
|
|
81
|
+
"has-error": !!n.errorMessage && (n.isTouched || n.showErrors),
|
|
82
|
+
success: n.isValid && n.isTouched
|
|
83
|
+
},
|
|
84
|
+
m.value
|
|
85
|
+
], "sl-text-sm"]),
|
|
86
|
+
"data-testid": "form-field-wrapper"
|
|
87
|
+
}, [
|
|
88
|
+
e("div", al, [
|
|
89
|
+
n.label ? (o(), r("label", {
|
|
90
|
+
key: 0,
|
|
91
|
+
for: n.id,
|
|
92
|
+
class: "sl-text-sm sl-col-span-2 sl-font-medium sl-text-gray-700"
|
|
93
|
+
}, [
|
|
94
|
+
Q(w(n.label) + " ", 1),
|
|
95
|
+
n.optional ? b("", !0) : (o(), r("span", nl, "*"))
|
|
96
|
+
], 8, ol)) : b("", !0),
|
|
97
|
+
n.disabled && n.disabledMessage ? (o(), r(E, { key: 1 }, [
|
|
98
|
+
e("p", rl, w(n.disabledMessage), 1),
|
|
99
|
+
n.tertiaryLabel ? (o(), r("span", il, [
|
|
100
|
+
Q(w(n.tertiaryLabel) + " ", 1),
|
|
101
|
+
S(n.$slots, "tertiary-label-overlay", {}, void 0, !0)
|
|
102
|
+
])) : b("", !0)
|
|
103
|
+
], 64)) : (o(), r(E, { key: 2 }, [
|
|
104
|
+
n.tertiaryLabel ? (o(), r("span", dl, [
|
|
105
|
+
Q(w(n.tertiaryLabel) + " ", 1),
|
|
106
|
+
S(n.$slots, "tertiary-label-overlay", {}, void 0, !0)
|
|
107
|
+
])) : b("", !0)
|
|
108
|
+
], 64))
|
|
109
|
+
]),
|
|
110
|
+
e("div", {
|
|
111
|
+
class: V(["sl-relative", { "sl-mt-2": n.label }])
|
|
112
|
+
}, [
|
|
113
|
+
n.errorMessage && (n.isTouched || n.showErrors) ? (o(), r("div", ul, [
|
|
114
|
+
_(f(Ds), {
|
|
115
|
+
class: "sl-h-5 sl-w-5 sl-text-red-500",
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
"data-testid": "error-icon"
|
|
118
|
+
})
|
|
119
|
+
])) : n.showValidCheck && n.isValid && n.isTouched ? (o(), r("div", cl, [
|
|
120
|
+
_(f(Es), {
|
|
121
|
+
class: "sl-h-5 sl-w-5 sl-text-green-500",
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
"data-testid": "check-icon"
|
|
124
|
+
})
|
|
125
|
+
])) : b("", !0),
|
|
126
|
+
a.value ? (o(), r("div", {
|
|
127
|
+
key: 2,
|
|
128
|
+
class: V(["sl-flex sl-rounded-md sl-shadow-sm sl-ring-1 sl-ring-inset focus-within:sl-ring-2 focus-within:sl-ring-inset focus-within:sl-ring-stachelock-600", u.value])
|
|
129
|
+
}, [
|
|
130
|
+
e("div", ml, [
|
|
131
|
+
S(n.$slots, "prefix", {}, void 0, !0)
|
|
132
|
+
]),
|
|
133
|
+
e("div", fl, [
|
|
134
|
+
S(n.$slots, "default", { inputClasses: bl }, void 0, !0)
|
|
135
|
+
]),
|
|
136
|
+
S(n.$slots, "input-right", {}, void 0, !0)
|
|
137
|
+
], 2)) : (o(), r("div", gl, [
|
|
138
|
+
n.disabled ? (o(), r("div", {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: V(["sl-flex sl-rounded-md sl-shadow-sm sl-ring-1 sl-ring-inset sl-bg-gray-50", u.value])
|
|
141
|
+
}, [
|
|
142
|
+
e("div", pl, [
|
|
143
|
+
S(n.$slots, "default", { inputClasses: wl }, void 0, !0)
|
|
144
|
+
]),
|
|
145
|
+
S(n.$slots, "input-right", {}, void 0, !0)
|
|
146
|
+
], 2)) : (o(), r(E, { key: 1 }, [
|
|
147
|
+
S(n.$slots, "default", { inputClasses: xl }, void 0, !0),
|
|
148
|
+
e("div", hl, [
|
|
149
|
+
S(n.$slots, "input-right", {}, void 0, !0)
|
|
150
|
+
])
|
|
151
|
+
], 64))
|
|
152
|
+
]))
|
|
153
|
+
], 2),
|
|
154
|
+
_(xe, {
|
|
155
|
+
show: !!n.errorMessage && (n.isTouched || n.showErrors) || n.isValid && !!n.successMessage && n.isTouched,
|
|
156
|
+
appear: !0,
|
|
157
|
+
"enter-active-class": "sl-transition sl-ease-out sl-duration-300",
|
|
158
|
+
"enter-from-class": "sl-opacity-0 sl-transform sl-scale-95",
|
|
159
|
+
"enter-to-class": "sl-opacity-100 sl-transform sl-scale-100",
|
|
160
|
+
"leave-active-class": "sl-transition sl-ease-in sl-duration-200",
|
|
161
|
+
"leave-from-class": "sl-opacity-100 sl-transform sl-scale-100",
|
|
162
|
+
"leave-to-class": "sl-opacity-0 sl-transform sl-scale-95"
|
|
163
|
+
}, {
|
|
164
|
+
default: L(() => [
|
|
165
|
+
n.errorMessage && (n.isTouched || n.showErrors) ? (o(), r("p", vl, w(n.errorMessage), 1)) : n.isValid && n.successMessage && n.isTouched ? (o(), r("p", yl, [
|
|
166
|
+
S(n.$slots, "success-message", {}, () => [
|
|
167
|
+
Q(w(n.successMessage), 1)
|
|
168
|
+
], !0)
|
|
169
|
+
])) : b("", !0)
|
|
170
|
+
]),
|
|
171
|
+
_: 3
|
|
172
|
+
}, 8, ["show"])
|
|
173
|
+
], 2));
|
|
174
|
+
}
|
|
175
|
+
}), oe = (t, l) => {
|
|
176
|
+
const s = t.__vccOpts || t;
|
|
177
|
+
for (const [a, m] of l)
|
|
178
|
+
s[a] = m;
|
|
179
|
+
return s;
|
|
180
|
+
}, ee = /* @__PURE__ */ oe(kl, [["__scopeId", "data-v-23518b3b"]]), $l = { class: "sl-form" }, _l = ["name", "id", "type", "value", "placeholder", "spellcheck", "disabled"], Cl = /* @__PURE__ */ z({
|
|
181
|
+
inheritAttrs: !1,
|
|
182
|
+
__name: "UiTextInput",
|
|
183
|
+
props: {
|
|
184
|
+
boxShadow: { type: Boolean, default: !1 },
|
|
185
|
+
type: { default: "text" },
|
|
186
|
+
value: { default: "" },
|
|
187
|
+
rules: { default: () => ({}) },
|
|
188
|
+
validateOnMount: { type: Boolean, default: !0 },
|
|
189
|
+
inputClass: { default: "" },
|
|
190
|
+
inputStyle: { default: "" },
|
|
191
|
+
spellcheck: { type: Boolean, default: !0 },
|
|
192
|
+
capitalize: { type: Boolean, default: !1 },
|
|
193
|
+
lazy: { type: Boolean, default: !1 },
|
|
194
|
+
transformFunction: { type: Function, default: (t) => t },
|
|
195
|
+
showErrors: { type: Boolean, default: !1 },
|
|
196
|
+
name: {},
|
|
197
|
+
label: { default: "" },
|
|
198
|
+
placeholder: { default: "" },
|
|
199
|
+
disabled: { type: Boolean, default: !1 },
|
|
200
|
+
required: { type: Boolean },
|
|
201
|
+
className: {},
|
|
202
|
+
errorMessage: {},
|
|
203
|
+
successMessage: { default: "" },
|
|
204
|
+
isValid: { type: Boolean },
|
|
205
|
+
isTouched: { type: Boolean },
|
|
206
|
+
colorfulValidation: { type: Boolean, default: !0 },
|
|
207
|
+
showValidCheck: { type: Boolean, default: !0 },
|
|
208
|
+
tertiaryLabel: { default: "" },
|
|
209
|
+
disabledMessage: { default: "" }
|
|
210
|
+
},
|
|
211
|
+
emits: ["update:value", "focus", "blur", "error", "update:validity"],
|
|
212
|
+
setup(t, { emit: l }) {
|
|
213
|
+
const s = t, a = l, m = P(!1), u = ae(s.name || "text-input"), n = P(s.validateOnMount), { value: p, errorMessage: v, handleChange: $, meta: c, validate: d, setTouched: g } = te(De(s, "name"), De(s, "rules"), {
|
|
214
|
+
initialValue: s.value,
|
|
215
|
+
validateOnValueUpdate: !s.lazy,
|
|
216
|
+
validateOnMount: n.value
|
|
217
|
+
}), h = (i) => a("update:value", i), k = Is(h, 300);
|
|
218
|
+
function C(i) {
|
|
219
|
+
const I = i.target.value;
|
|
220
|
+
s.lazy ? k(I) : h(I), $(s.transformFunction(I));
|
|
221
|
+
}
|
|
222
|
+
async function A(i) {
|
|
223
|
+
m.value || (m.value = !0, g(!0)), s.lazy && h(p.value), await d(), a("blur", i);
|
|
224
|
+
}
|
|
225
|
+
function D(i) {
|
|
226
|
+
a("focus", i);
|
|
227
|
+
}
|
|
228
|
+
return q(() => c.valid, (i) => de(() => a("update:validity", i)), { immediate: !0 }), q(() => s.value, (i) => {
|
|
229
|
+
i !== p.value && (p.value = i);
|
|
230
|
+
}), (i, I) => (o(), r("div", $l, [
|
|
231
|
+
_(ee, {
|
|
232
|
+
id: f(u),
|
|
233
|
+
name: i.name,
|
|
234
|
+
label: i.label,
|
|
235
|
+
"tertiary-label": i.tertiaryLabel,
|
|
236
|
+
"error-message": f(v),
|
|
237
|
+
"success-message": i.successMessage,
|
|
238
|
+
"is-valid": f(c).valid,
|
|
239
|
+
"is-touched": f(c).touched,
|
|
240
|
+
"show-errors": i.showErrors,
|
|
241
|
+
"show-valid-check": i.showValidCheck,
|
|
242
|
+
"colorful-validation": i.colorfulValidation,
|
|
243
|
+
disabled: i.disabled,
|
|
244
|
+
"disabled-message": i.disabledMessage,
|
|
245
|
+
"box-shadow": i.boxShadow
|
|
246
|
+
}, {
|
|
247
|
+
prefix: L(() => [
|
|
248
|
+
S(i.$slots, "prefix", {}, void 0, !0)
|
|
249
|
+
]),
|
|
250
|
+
default: L(({ inputClasses: x }) => [
|
|
251
|
+
e("input", he(i.$attrs, {
|
|
252
|
+
name: i.name,
|
|
253
|
+
id: f(u),
|
|
254
|
+
type: i.type,
|
|
255
|
+
value: f(p),
|
|
256
|
+
placeholder: i.placeholder,
|
|
257
|
+
spellcheck: i.spellcheck,
|
|
258
|
+
disabled: i.disabled,
|
|
259
|
+
class: ["sl-block sl-w-full sl-bg-transparent placeholder:sl-text-gray-400 focus:sl-ring-0 focus:sl-outline-none sm:sl-text-sm sm:sl-leading-6", [
|
|
260
|
+
x,
|
|
261
|
+
"sl-py-1.5 sl-pl-2 sl-pr-2",
|
|
262
|
+
{ "sl-uppercase": i.capitalize },
|
|
263
|
+
{ "sl-text-gray-400": i.disabled },
|
|
264
|
+
{ "sl-pr-10": i.showValidCheck },
|
|
265
|
+
i.inputClass
|
|
266
|
+
]],
|
|
267
|
+
style: i.inputStyle,
|
|
268
|
+
onInput: C,
|
|
269
|
+
onFocus: D,
|
|
270
|
+
onBlur: A
|
|
271
|
+
}), null, 16, _l)
|
|
272
|
+
]),
|
|
273
|
+
"input-right": L(() => [
|
|
274
|
+
S(i.$slots, "input-right", {}, void 0, !0)
|
|
275
|
+
]),
|
|
276
|
+
_: 3
|
|
277
|
+
}, 8, ["id", "name", "label", "tertiary-label", "error-message", "success-message", "is-valid", "is-touched", "show-errors", "show-valid-check", "colorful-validation", "disabled", "disabled-message", "box-shadow"])
|
|
278
|
+
]));
|
|
279
|
+
}
|
|
280
|
+
}), J = /* @__PURE__ */ oe(Cl, [["__scopeId", "data-v-4e60cc4a"]]), Sl = {
|
|
281
|
+
text: {
|
|
282
|
+
component: "TextInput",
|
|
283
|
+
loader: () => Promise.resolve(J)
|
|
284
|
+
},
|
|
285
|
+
email: {
|
|
286
|
+
component: "TextInput",
|
|
287
|
+
loader: () => Promise.resolve(J)
|
|
288
|
+
},
|
|
289
|
+
password: {
|
|
290
|
+
component: "TextInput",
|
|
291
|
+
loader: () => Promise.resolve(J)
|
|
292
|
+
},
|
|
293
|
+
number: {
|
|
294
|
+
component: "TextInput",
|
|
295
|
+
loader: () => Promise.resolve(J)
|
|
296
|
+
},
|
|
297
|
+
tel: {
|
|
298
|
+
component: "TextInput",
|
|
299
|
+
loader: () => Promise.resolve(J)
|
|
300
|
+
},
|
|
301
|
+
url: {
|
|
302
|
+
component: "TextInput",
|
|
303
|
+
loader: () => Promise.resolve(J)
|
|
304
|
+
},
|
|
305
|
+
textarea: {
|
|
306
|
+
component: "TextAreaInput",
|
|
307
|
+
loader: () => import("./TextAreaInput-Di6Kstic.js")
|
|
308
|
+
},
|
|
309
|
+
select: {
|
|
310
|
+
component: "SelectInput",
|
|
311
|
+
loader: () => import("./SelectInput-B5liNv7H.js")
|
|
312
|
+
},
|
|
313
|
+
combobox: {
|
|
314
|
+
component: "ComboboxInput",
|
|
315
|
+
loader: () => import("./ComboboxInput-B98P_8CZ.js")
|
|
316
|
+
},
|
|
317
|
+
checkbox: {
|
|
318
|
+
component: "CheckboxInput",
|
|
319
|
+
loader: () => import("./CheckboxInput-rWkcde69.js")
|
|
320
|
+
},
|
|
321
|
+
switch: {
|
|
322
|
+
component: "SwitchInput",
|
|
323
|
+
loader: () => import("./SwitchInput-D1k9O8gn.js")
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
class Ml {
|
|
327
|
+
componentMap = { ...Sl };
|
|
328
|
+
loadedComponents = /* @__PURE__ */ new Map();
|
|
329
|
+
/**
|
|
330
|
+
* Register a new component type
|
|
331
|
+
*/
|
|
332
|
+
register(l, s, a) {
|
|
333
|
+
this.componentMap[l] = { component: s, loader: a }, this.loadedComponents.delete(l);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Get a component for a field type
|
|
337
|
+
*/
|
|
338
|
+
getComponent(l) {
|
|
339
|
+
const s = this.componentMap[l];
|
|
340
|
+
if (!s)
|
|
341
|
+
return console.warn(`Component type "${l}" is not registered`), null;
|
|
342
|
+
if (this.loadedComponents.has(l))
|
|
343
|
+
return this.loadedComponents.get(l);
|
|
344
|
+
const a = we({
|
|
345
|
+
loader: s.loader,
|
|
346
|
+
delay: 0
|
|
347
|
+
});
|
|
348
|
+
return this.loadedComponents.set(l, a), a;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Check if a component type is registered
|
|
352
|
+
*/
|
|
353
|
+
hasComponent(l) {
|
|
354
|
+
return l in this.componentMap;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Get all registered component types
|
|
358
|
+
*/
|
|
359
|
+
getRegisteredTypes() {
|
|
360
|
+
return Object.keys(this.componentMap);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Unregister a component type
|
|
364
|
+
*/
|
|
365
|
+
unregister(l) {
|
|
366
|
+
delete this.componentMap[l], this.loadedComponents.delete(l);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Clear all cached components
|
|
370
|
+
*/
|
|
371
|
+
clearCache() {
|
|
372
|
+
this.loadedComponents.clear();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const Xe = new Ml();
|
|
376
|
+
function bi(t, l, s) {
|
|
377
|
+
Xe.register(t, l, s);
|
|
378
|
+
}
|
|
379
|
+
function xi(t) {
|
|
380
|
+
return Xe.getComponent(t);
|
|
381
|
+
}
|
|
382
|
+
const Tl = {
|
|
383
|
+
key: 0,
|
|
384
|
+
class: "sl-h-full sl-w-full"
|
|
385
|
+
}, Bl = ["src", "alt"], Vl = /* @__PURE__ */ z({
|
|
386
|
+
__name: "UiAvatar",
|
|
387
|
+
props: {
|
|
388
|
+
data: {},
|
|
389
|
+
name: {},
|
|
390
|
+
imageUrl: {},
|
|
391
|
+
size: { default: "md" },
|
|
392
|
+
color: { default: "sl-bg-stachelock-600" },
|
|
393
|
+
ring: { default: "sl-ring-white" },
|
|
394
|
+
rounded: { default: "sl-rounded-full" },
|
|
395
|
+
fallbackInitials: { default: "?" },
|
|
396
|
+
fallbackIcon: {},
|
|
397
|
+
imagePath: { default: "image.url" },
|
|
398
|
+
namePath: { default: "name" }
|
|
399
|
+
},
|
|
400
|
+
setup(t) {
|
|
401
|
+
const l = t, s = P(!1), a = () => {
|
|
402
|
+
s.value = !0;
|
|
403
|
+
}, m = {
|
|
404
|
+
xs: "sl-h-6 sl-w-6",
|
|
405
|
+
sm: "sl-h-8 sl-w-8",
|
|
406
|
+
md: "sl-h-12 sl-w-12",
|
|
407
|
+
lg: "sl-h-16 sl-w-16",
|
|
408
|
+
xl: "sl-h-20 sl-w-20",
|
|
409
|
+
"2xl": "sl-h-24 sl-w-24"
|
|
410
|
+
}, u = B(() => typeof l.size == "number" ? `sl-h-${l.size} sl-w-${l.size}` : m[l.size] || m.md), n = (d, g) => {
|
|
411
|
+
if (!d) return;
|
|
412
|
+
const h = Array.isArray(g) ? g : g.split(".");
|
|
413
|
+
let k = d;
|
|
414
|
+
for (const C of h)
|
|
415
|
+
if (k && typeof k == "object" && C in k)
|
|
416
|
+
k = k[C];
|
|
417
|
+
else
|
|
418
|
+
return;
|
|
419
|
+
return k;
|
|
420
|
+
}, p = B(() => {
|
|
421
|
+
if (l.imageUrl) return l.imageUrl;
|
|
422
|
+
if (l.data && l.imagePath) {
|
|
423
|
+
const d = n(l.data, l.imagePath);
|
|
424
|
+
if (d) return d;
|
|
425
|
+
}
|
|
426
|
+
if (l.data) {
|
|
427
|
+
const d = [
|
|
428
|
+
"profile_image.url",
|
|
429
|
+
"image.url",
|
|
430
|
+
"avatar.url",
|
|
431
|
+
"photo.url",
|
|
432
|
+
"picture.url"
|
|
433
|
+
];
|
|
434
|
+
for (const g of d) {
|
|
435
|
+
const h = n(l.data, g);
|
|
436
|
+
if (h) return h;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return null;
|
|
440
|
+
}), v = B(() => {
|
|
441
|
+
if (l.name) return l.name;
|
|
442
|
+
if (l.data && l.namePath) {
|
|
443
|
+
const d = n(l.data, l.namePath);
|
|
444
|
+
if (d) return d;
|
|
445
|
+
}
|
|
446
|
+
if (l.data) {
|
|
447
|
+
const d = [
|
|
448
|
+
"name",
|
|
449
|
+
"display_name",
|
|
450
|
+
"full_name",
|
|
451
|
+
"username",
|
|
452
|
+
"title"
|
|
453
|
+
];
|
|
454
|
+
for (const g of d) {
|
|
455
|
+
const h = n(l.data, g);
|
|
456
|
+
if (h) return h;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return "";
|
|
460
|
+
}), $ = B(() => !!p.value), c = B(() => {
|
|
461
|
+
const d = v.value;
|
|
462
|
+
if (!d || d.trim() === "")
|
|
463
|
+
return l.fallbackInitials;
|
|
464
|
+
const g = d.split(" ").filter(Boolean);
|
|
465
|
+
return g.length === 0 ? l.fallbackInitials : g.length === 1 ? g[0][0].toUpperCase() : (g[0][0] + g[g.length - 1][0]).toUpperCase();
|
|
466
|
+
});
|
|
467
|
+
return (d, g) => (o(), r("div", {
|
|
468
|
+
class: V(["sl-relative sl-inline-block", [u.value, d.ring, d.rounded]])
|
|
469
|
+
}, [
|
|
470
|
+
$.value && !s.value ? (o(), r("div", Tl, [
|
|
471
|
+
e("img", {
|
|
472
|
+
src: p.value,
|
|
473
|
+
alt: v.value,
|
|
474
|
+
class: V(["sl-h-full sl-w-full sl-object-cover", d.rounded]),
|
|
475
|
+
onError: a
|
|
476
|
+
}, null, 42, Bl)
|
|
477
|
+
])) : b("", !0),
|
|
478
|
+
!$.value || s.value ? (o(), r("div", {
|
|
479
|
+
key: 1,
|
|
480
|
+
class: V(["sl-h-full sl-w-full sl-flex sl-items-center sl-justify-center sl-font-semibold sl-text-white", [d.color, d.rounded]])
|
|
481
|
+
}, w(c.value), 3)) : b("", !0)
|
|
482
|
+
], 2));
|
|
483
|
+
}
|
|
484
|
+
}), Al = "sl-inline-flex sl-items-center sl-font-medium sl-ring-1 sl-ring-inset sl-p-4", Ll = /* @__PURE__ */ z({
|
|
485
|
+
__name: "UiBadge",
|
|
486
|
+
props: {
|
|
487
|
+
theme: { default: "primary" },
|
|
488
|
+
shape: { default: "default" },
|
|
489
|
+
size: { default: "md" }
|
|
490
|
+
},
|
|
491
|
+
setup(t) {
|
|
492
|
+
const l = t, s = B(() => ({
|
|
493
|
+
// Use the same color scheme as in UiButton
|
|
494
|
+
primary: "sl-bg-stachelock-050 sl-text-stachelock-600 sl-ring-stachelock-600/10",
|
|
495
|
+
dark: "sl-bg-gray-50 sl-text-gray-600 sl-ring-gray-500/10",
|
|
496
|
+
secondary: "sl-bg-gray-100 sl-text-gray-800 sl-ring-gray-300",
|
|
497
|
+
light: "sl-bg-white sl-text-gray-800 sl-ring-gray-300",
|
|
498
|
+
warning: "sl-bg-yellow-50 sl-text-yellow-800 sl-ring-yellow-600/20",
|
|
499
|
+
danger: "sl-bg-red-50 sl-text-red-700 sl-ring-red-600/10",
|
|
500
|
+
success: "sl-bg-green-50 sl-text-green-700 sl-ring-green-600/20",
|
|
501
|
+
ghost: "sl-bg-white sl-text-gray-400 sl-ring-gray-400/20"
|
|
502
|
+
})[l.theme]), a = {
|
|
503
|
+
circular: "sl-rounded-full",
|
|
504
|
+
rounded: "sl-rounded-lg",
|
|
505
|
+
default: "sl-rounded-md"
|
|
506
|
+
// Default rounded class
|
|
507
|
+
}[l.shape], m = {
|
|
508
|
+
xs: "sl-px-1 sl-py-0.5 sl-text-4xs",
|
|
509
|
+
sm: "sl-px-2 sl-py-0.5 sl-text-xs",
|
|
510
|
+
md: "sl-px-3 sl-py-1 sl-text-sm",
|
|
511
|
+
lg: "sl-px-4 sl-py-1.5 sl-text-md"
|
|
512
|
+
}[l.size];
|
|
513
|
+
return (u, n) => (o(), r("span", {
|
|
514
|
+
class: V([Al, f(a), s.value, f(m)])
|
|
515
|
+
}, [
|
|
516
|
+
S(u.$slots, "default", {}, void 0, !0)
|
|
517
|
+
], 2));
|
|
518
|
+
}
|
|
519
|
+
}), Ze = /* @__PURE__ */ oe(Ll, [["__scopeId", "data-v-4f93de9f"]]);
|
|
520
|
+
/*!
|
|
521
|
+
* vue-router v4.5.1
|
|
522
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
523
|
+
* @license MIT
|
|
524
|
+
*/
|
|
525
|
+
const Il = typeof document < "u", Dl = () => {
|
|
526
|
+
}, ge = Array.isArray;
|
|
527
|
+
function ze(t) {
|
|
528
|
+
const l = Array.from(arguments).slice(1);
|
|
529
|
+
console.warn.apply(console, ["[Vue Router warn]: " + t].concat(l));
|
|
530
|
+
}
|
|
531
|
+
function Oe(t, l) {
|
|
532
|
+
return (t.aliasOf || t) === (l.aliasOf || l);
|
|
533
|
+
}
|
|
534
|
+
function El(t, l) {
|
|
535
|
+
if (Object.keys(t).length !== Object.keys(l).length)
|
|
536
|
+
return !1;
|
|
537
|
+
for (const s in t)
|
|
538
|
+
if (!Pl(t[s], l[s]))
|
|
539
|
+
return !1;
|
|
540
|
+
return !0;
|
|
541
|
+
}
|
|
542
|
+
function Pl(t, l) {
|
|
543
|
+
return ge(t) ? je(t, l) : ge(l) ? je(l, t) : t === l;
|
|
544
|
+
}
|
|
545
|
+
function je(t, l) {
|
|
546
|
+
return ge(l) ? t.length === l.length && t.every((s, a) => s === l[a]) : t.length === 1 && t[0] === l;
|
|
547
|
+
}
|
|
548
|
+
var Fe;
|
|
549
|
+
(function(t) {
|
|
550
|
+
t.pop = "pop", t.push = "push";
|
|
551
|
+
})(Fe || (Fe = {}));
|
|
552
|
+
var Ne;
|
|
553
|
+
(function(t) {
|
|
554
|
+
t.back = "back", t.forward = "forward", t.unknown = "";
|
|
555
|
+
})(Ne || (Ne = {}));
|
|
556
|
+
function Re(t) {
|
|
557
|
+
return typeof t == "string" || t && typeof t == "object";
|
|
558
|
+
}
|
|
559
|
+
Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
|
|
560
|
+
var Ue;
|
|
561
|
+
(function(t) {
|
|
562
|
+
t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
|
|
563
|
+
})(Ue || (Ue = {}));
|
|
564
|
+
Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
|
|
565
|
+
Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
|
|
566
|
+
const es = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), ss = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
|
|
567
|
+
Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
568
|
+
function zl(t) {
|
|
569
|
+
const l = ue(es), s = ue(ss);
|
|
570
|
+
let a = !1, m = null;
|
|
571
|
+
const u = B(() => {
|
|
572
|
+
const c = f(t.to);
|
|
573
|
+
return process.env.NODE_ENV !== "production" && (!a || c !== m) && (Re(c) || (a ? ze(`Invalid value for prop "to" in useLink()
|
|
574
|
+
- to:`, c, `
|
|
575
|
+
- previous to:`, m, `
|
|
576
|
+
- props:`, t) : ze(`Invalid value for prop "to" in useLink()
|
|
577
|
+
- to:`, c, `
|
|
578
|
+
- props:`, t)), m = c, a = !0), l.resolve(c);
|
|
579
|
+
}), n = B(() => {
|
|
580
|
+
const { matched: c } = u.value, { length: d } = c, g = c[d - 1], h = s.matched;
|
|
581
|
+
if (!g || !h.length)
|
|
582
|
+
return -1;
|
|
583
|
+
const k = h.findIndex(Oe.bind(null, g));
|
|
584
|
+
if (k > -1)
|
|
585
|
+
return k;
|
|
586
|
+
const C = He(c[d - 2]);
|
|
587
|
+
return (
|
|
588
|
+
// we are dealing with nested routes
|
|
589
|
+
d > 1 && // if the parent and matched route have the same path, this link is
|
|
590
|
+
// referring to the empty child. Or we currently are on a different
|
|
591
|
+
// child of the same parent
|
|
592
|
+
He(g) === C && // avoid comparing the child with its parent
|
|
593
|
+
h[h.length - 1].path !== C ? h.findIndex(Oe.bind(null, c[d - 2])) : k
|
|
594
|
+
);
|
|
595
|
+
}), p = B(() => n.value > -1 && jl(s.params, u.value.params)), v = B(() => n.value > -1 && n.value === s.matched.length - 1 && El(s.params, u.value.params));
|
|
596
|
+
function $(c = {}) {
|
|
597
|
+
if (Ol(c)) {
|
|
598
|
+
const d = l[f(t.replace) ? "replace" : "push"](
|
|
599
|
+
f(t.to)
|
|
600
|
+
// avoid uncaught errors are they are logged anyway
|
|
601
|
+
).catch(Dl);
|
|
602
|
+
return t.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => d), d;
|
|
603
|
+
}
|
|
604
|
+
return Promise.resolve();
|
|
605
|
+
}
|
|
606
|
+
if (process.env.NODE_ENV !== "production" && Il) {
|
|
607
|
+
const c = Cs();
|
|
608
|
+
if (c) {
|
|
609
|
+
const d = {
|
|
610
|
+
route: u.value,
|
|
611
|
+
isActive: p.value,
|
|
612
|
+
isExactActive: v.value,
|
|
613
|
+
error: null
|
|
614
|
+
};
|
|
615
|
+
c.__vrl_devtools = c.__vrl_devtools || [], c.__vrl_devtools.push(d), We(() => {
|
|
616
|
+
d.route = u.value, d.isActive = p.value, d.isExactActive = v.value, d.error = Re(f(t.to)) ? null : 'Invalid "to" value';
|
|
617
|
+
}, { flush: "post" });
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return {
|
|
621
|
+
route: u,
|
|
622
|
+
href: B(() => u.value.href),
|
|
623
|
+
isActive: p,
|
|
624
|
+
isExactActive: v,
|
|
625
|
+
navigate: $
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function Ol(t) {
|
|
629
|
+
if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
|
|
630
|
+
if (t.currentTarget && t.currentTarget.getAttribute) {
|
|
631
|
+
const l = t.currentTarget.getAttribute("target");
|
|
632
|
+
if (/\b_blank\b/i.test(l))
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
return t.preventDefault && t.preventDefault(), !0;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function jl(t, l) {
|
|
639
|
+
for (const s in l) {
|
|
640
|
+
const a = l[s], m = t[s];
|
|
641
|
+
if (typeof a == "string") {
|
|
642
|
+
if (a !== m)
|
|
643
|
+
return !1;
|
|
644
|
+
} else if (!ge(m) || m.length !== a.length || a.some((u, n) => u !== m[n]))
|
|
645
|
+
return !1;
|
|
646
|
+
}
|
|
647
|
+
return !0;
|
|
648
|
+
}
|
|
649
|
+
function He(t) {
|
|
650
|
+
return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
|
|
651
|
+
}
|
|
652
|
+
function ls() {
|
|
653
|
+
return ue(es);
|
|
654
|
+
}
|
|
655
|
+
function ts(t) {
|
|
656
|
+
return ue(ss);
|
|
657
|
+
}
|
|
658
|
+
const Fl = ["disabled"], Nl = { class: "sl-absolute sl-top-0 sl-right-0 sl-transform sl-translate-x-1/2 -sl-translate-y-1/2" }, Rl = {
|
|
659
|
+
key: 6,
|
|
660
|
+
class: "sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-bg-opacity-75 sl-bg-white dark:sl-bg-opacity-75 dark:sl-bg-gray-700 sl-rounded sl-z-10"
|
|
661
|
+
}, Ul = { key: 0 }, Hl = "sl-ml-auto sl-flex sl-items-center", Ke = "sl-absolute sl-right-0 sl-top-1/2 -sl-translate-y-1/2 sl-pr-0 sl-flex sl-items-center", Kl = /* @__PURE__ */ z({
|
|
662
|
+
__name: "UiButton",
|
|
663
|
+
props: {
|
|
664
|
+
replaceLeadingIconWithLoading: { type: Boolean, default: !1 },
|
|
665
|
+
centerLeadingIcon: { type: Boolean, default: !1 },
|
|
666
|
+
trailingLoading: { type: Boolean, default: !1 },
|
|
667
|
+
trailingLoadingSize: {},
|
|
668
|
+
trailingOverlay: { type: Boolean, default: !1 },
|
|
669
|
+
autoContrast: { type: Boolean, default: !1 },
|
|
670
|
+
theme: { default: "primary" },
|
|
671
|
+
size: { default: "md" },
|
|
672
|
+
label: {},
|
|
673
|
+
disabled: { type: Boolean, default: !1 },
|
|
674
|
+
expanded: { type: Boolean, default: !1 },
|
|
675
|
+
outlined: { type: Boolean, default: !1 },
|
|
676
|
+
customClass: {},
|
|
677
|
+
rounded: { default: "rounded-md" },
|
|
678
|
+
leadingIcon: { type: Boolean, default: !1 },
|
|
679
|
+
trailingIcon: { type: Boolean, default: !1 },
|
|
680
|
+
loading: { type: Boolean, default: !1 },
|
|
681
|
+
loadingSize: {},
|
|
682
|
+
showLoadingTitle: { type: Boolean, default: !1 },
|
|
683
|
+
truncateLabel: { type: Boolean, default: !1 },
|
|
684
|
+
centerLabel: { type: Boolean, default: !1 },
|
|
685
|
+
inlineFlex: { type: Boolean, default: !1 }
|
|
686
|
+
},
|
|
687
|
+
emits: ["button-click", "hover-enter", "hover-leave"],
|
|
688
|
+
setup(t, { emit: l }) {
|
|
689
|
+
const s = we(() => import("./UiLoading-BuzCrLqO.js")), a = t, m = l, u = B(() => !!a.loading), n = B(() => a.replaceLeadingIconWithLoading || !1), p = P(null), v = P(a.theme ?? "primary"), $ = (O) => {
|
|
690
|
+
for (; O && O !== document.documentElement; ) {
|
|
691
|
+
const R = window.getComputedStyle(O).backgroundColor;
|
|
692
|
+
if (R && R !== "rgba(0, 0, 0, 0)" && R !== "transparent")
|
|
693
|
+
return R;
|
|
694
|
+
O = O.parentElement;
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}, c = () => {
|
|
698
|
+
if (!a.autoContrast) return;
|
|
699
|
+
const O = p.value;
|
|
700
|
+
if (!O) return;
|
|
701
|
+
const R = $(O.parentElement);
|
|
702
|
+
if (!R) return;
|
|
703
|
+
window.getComputedStyle(O).backgroundColor === R && (v.value = v.value === "light" ? "primary" : "light");
|
|
704
|
+
};
|
|
705
|
+
ne(() => {
|
|
706
|
+
de(c);
|
|
707
|
+
}), q(
|
|
708
|
+
() => a.theme,
|
|
709
|
+
(O) => {
|
|
710
|
+
v.value = O || "primary", de(c);
|
|
711
|
+
},
|
|
712
|
+
{ immediate: !1 }
|
|
713
|
+
);
|
|
714
|
+
const d = B(() => v.value), g = B(() => a.loadingSize || a.size || "md"), h = B(() => {
|
|
715
|
+
const O = {
|
|
716
|
+
primary: "sl-text-stachelock-600 sl-border sl-border-stachelock-600 hover:sl-bg-stachelock-50 hover:sl-border-stachelock-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
717
|
+
dark: "sl-text-gray-700 sl-border sl-border-gray-700 hover:sl-bg-gray-50 hover:sl-border-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
718
|
+
secondary: "sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
719
|
+
light: "sl-text-gray-800 sl-border sl-border-gray-300 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
720
|
+
warning: "sl-text-yellow-500 sl-border sl-border-yellow-500 hover:sl-bg-yellow-50 hover:sl-border-yellow-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
721
|
+
danger: "sl-text-red-500 sl-border sl-border-red-500 hover:sl-bg-red-50 hover:sl-border-red-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
722
|
+
success: "sl-text-green-500 sl-border sl-border-green-500 hover:sl-bg-green-50 hover:sl-border-green-400 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
723
|
+
ghost: "sl-text-gray-800 sl-border sl-border-transparent sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none"
|
|
724
|
+
}, R = {
|
|
725
|
+
primary: "sl-border sl-border-transparent sl-bg-stachelock-600 sl-text-white sl-shadow-sm hover:sl-bg-stachelock-700 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-stachelock-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
726
|
+
dark: "sl-border sl-border-transparent sl-bg-gray-700 sl-text-white sl-shadow-sm hover:sl-bg-gray-800 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-500 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
727
|
+
secondary: "sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300",
|
|
728
|
+
light: "sl-text-gray-800 sl-bg-gray-200 hover:sl-bg-gray-100 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-gray-300 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50 sl-border sl-border-gray-300",
|
|
729
|
+
warning: "sl-border sl-border-transparent sl-bg-yellow-400 sl-text-white sl-shadow-sm hover:sl-bg-yellow-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-yellow-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
730
|
+
danger: "sl-border sl-border-transparent sl-bg-red-500 sl-text-white sl-shadow-sm hover:sl-bg-red-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-red-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
731
|
+
success: "sl-border sl-border-transparent sl-bg-green-500 sl-text-white sl-shadow-sm hover:sl-bg-green-600 focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-green-400 focus:sl-ring-offset-2 focus:sl-ring-offset-gray-50",
|
|
732
|
+
ghost: "sl-border sl-border-transparent sl-text-gray-800 sl-bg-transparent hover:sl-text-gray-700 focus:sl-outline-none"
|
|
733
|
+
};
|
|
734
|
+
return a.outlined ? `${O[d.value] || ""} sl-bg-transparent` : R[d.value] || "";
|
|
735
|
+
}), k = {
|
|
736
|
+
square: "",
|
|
737
|
+
rounded: "sl-rounded",
|
|
738
|
+
"rounded-md": "sl-rounded-md",
|
|
739
|
+
"rounded-lg": "sl-rounded-lg",
|
|
740
|
+
"rounded-full": "sl-rounded-full"
|
|
741
|
+
}, C = B(() => k[a.rounded || "rounded-md"]), A = B(() => ({
|
|
742
|
+
xs: "sl-p-0.5",
|
|
743
|
+
sm: "sl-p-1",
|
|
744
|
+
md: "sl-p-2",
|
|
745
|
+
lg: "sl-p-3",
|
|
746
|
+
xl: "sl-p-4",
|
|
747
|
+
"2xl": "sl-p-5"
|
|
748
|
+
})[a.size || "md"]), D = B(() => ({
|
|
749
|
+
xs: "sl-text-xs sl-font-regular",
|
|
750
|
+
sm: "sl-text-sm sl-font-regular",
|
|
751
|
+
md: "sl-text-base sl-font-medium",
|
|
752
|
+
lg: "sl-text-lg sl-font-medium",
|
|
753
|
+
xl: "sl-text-xl sl-font-medium",
|
|
754
|
+
"2xl": "sl-text-2xl sl-font-medium"
|
|
755
|
+
})[a.size || "sm"]), i = B(() => a.expanded ? "sl-w-full" : ""), I = B(() => !!a.label && a.label.length > 0), x = B(() => {
|
|
756
|
+
if (a.customClass)
|
|
757
|
+
return a.customClass;
|
|
758
|
+
const R = [...[
|
|
759
|
+
C.value,
|
|
760
|
+
A.value,
|
|
761
|
+
D.value,
|
|
762
|
+
i.value,
|
|
763
|
+
h.value,
|
|
764
|
+
a.disabled ? "sl-cursor-not-allowed" : "sl-cursor-pointer",
|
|
765
|
+
"focus:sl-ring-0",
|
|
766
|
+
"sl-relative",
|
|
767
|
+
"sl-flex",
|
|
768
|
+
"sl-items-center",
|
|
769
|
+
"sl-justify-center"
|
|
770
|
+
]];
|
|
771
|
+
return C.value === "sl-rounded-full" ? R.push("sl-px-1", "sl-py-1") : R.push("sl-px-2.5", "sl-py-2"), a.centerLeadingIcon && !I.value ? R.push("sl-w-full", "sl-h-full") : (a.leadingIcon || a.inlineFlex || a.trailingIcon) && R.push("sl-inline-flex"), R.filter(Boolean);
|
|
772
|
+
}), F = B(() => a.trailingOverlay ? Ke : Hl), y = B(() => a.trailingOverlay ? `${Ke} sl-h-5 sl-w-5` : "sl-ml-2 sl-h-5 sl-w-5 sl-flex sl-items-center"), N = B(() => a.centerLeadingIcon && !I.value ? "sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-w-full sl-h-full" : a.centerLeadingIcon ? "sl-h-full sl-flex sl-items-center sl-justify-center" : I.value ? "-sl-ml-0.5 sl-h-5 sl-w-5 sl-flex sl-items-center sl-justify-center" : "sl-flex sl-items-center sl-justify-center"), Z = () => {
|
|
773
|
+
m("button-click");
|
|
774
|
+
}, M = () => {
|
|
775
|
+
m("hover-enter");
|
|
776
|
+
}, U = () => {
|
|
777
|
+
m("hover-leave");
|
|
778
|
+
}, H = a.showLoadingTitle || !1;
|
|
779
|
+
return (O, R) => (o(), r("button", {
|
|
780
|
+
ref_key: "buttonRef",
|
|
781
|
+
ref: p,
|
|
782
|
+
type: "button",
|
|
783
|
+
disabled: a.disabled,
|
|
784
|
+
class: V(x.value),
|
|
785
|
+
onClick: Z,
|
|
786
|
+
onMouseenter: M,
|
|
787
|
+
onMouseleave: U
|
|
788
|
+
}, [
|
|
789
|
+
a.centerLeadingIcon && !I.value ? (o(), r("div", {
|
|
790
|
+
key: 0,
|
|
791
|
+
class: V(N.value)
|
|
792
|
+
}, [
|
|
793
|
+
S(O.$slots, "leading-icon", {}, void 0, !0)
|
|
794
|
+
], 2)) : (o(), r(E, { key: 1 }, [
|
|
795
|
+
n.value && u.value ? (o(), r("div", {
|
|
796
|
+
key: 0,
|
|
797
|
+
class: V(["sl-flex sl-items-center sl-justify-center", [N.value, I.value ? "" : "sl-h-full sl-w-full"]])
|
|
798
|
+
}, [
|
|
799
|
+
_(f(s), {
|
|
800
|
+
theme: d.value,
|
|
801
|
+
size: g.value
|
|
802
|
+
}, null, 8, ["theme", "size"])
|
|
803
|
+
], 2)) : a.leadingIcon ? (o(), r("div", {
|
|
804
|
+
key: 1,
|
|
805
|
+
class: V(N.value)
|
|
806
|
+
}, [
|
|
807
|
+
S(O.$slots, "leading-icon", {}, void 0, !0)
|
|
808
|
+
], 2)) : b("", !0)
|
|
809
|
+
], 64)),
|
|
810
|
+
I.value ? (o(), r("span", {
|
|
811
|
+
key: 2,
|
|
812
|
+
class: V(["sl-flex-1 sl-text-center", [
|
|
813
|
+
{ "sl-truncate sl-max-w-[150px]": O.truncateLabel },
|
|
814
|
+
{ "sl-mx-auto": !a.leadingIcon && !a.trailingIcon }
|
|
815
|
+
]])
|
|
816
|
+
}, w(a.label), 3)) : (!n.value || !u.value) && !a.centerLeadingIcon ? (o(), r("span", {
|
|
817
|
+
key: 3,
|
|
818
|
+
class: V(["sl-flex", a.centerLabel || !a.leadingIcon && !a.trailingIcon ? "sl-justify-center sl-items-center sl-flex-1" : "sl-flex-1"])
|
|
819
|
+
}, [
|
|
820
|
+
S(O.$slots, "default", {}, void 0, !0)
|
|
821
|
+
], 2)) : b("", !0),
|
|
822
|
+
a.trailingLoading && u.value ? (o(), r("div", {
|
|
823
|
+
key: 4,
|
|
824
|
+
class: V(F.value)
|
|
825
|
+
}, [
|
|
826
|
+
_(f(s), {
|
|
827
|
+
theme: d.value,
|
|
828
|
+
size: a.trailingLoadingSize || "sm"
|
|
829
|
+
}, null, 8, ["theme", "size"])
|
|
830
|
+
], 2)) : a.trailingIcon ? (o(), r("div", {
|
|
831
|
+
key: 5,
|
|
832
|
+
class: V(y.value)
|
|
833
|
+
}, [
|
|
834
|
+
S(O.$slots, "trailing-icon", {}, void 0, !0)
|
|
835
|
+
], 2)) : b("", !0),
|
|
836
|
+
e("div", Nl, [
|
|
837
|
+
S(O.$slots, "badge", {}, void 0, !0)
|
|
838
|
+
]),
|
|
839
|
+
u.value && !n.value && !a.trailingLoading ? (o(), r("div", Rl, [
|
|
840
|
+
_(f(s), {
|
|
841
|
+
theme: d.value,
|
|
842
|
+
size: g.value
|
|
843
|
+
}, null, 8, ["theme", "size"]),
|
|
844
|
+
f(H) ? (o(), r("p", Ul, "Loading...")) : b("", !0)
|
|
845
|
+
])) : b("", !0)
|
|
846
|
+
], 42, Fl));
|
|
847
|
+
}
|
|
848
|
+
}), X = /* @__PURE__ */ oe(Kl, [["__scopeId", "data-v-43795fb6"]]), Wl = { class: "sl-flex sl-items-center sl-w-full" }, ql = { class: "sl-flex sl-items-center sl-space-x-2 sl-flex-1" }, Ql = {
|
|
849
|
+
key: 0,
|
|
850
|
+
class: "sl-flex sl-items-center sl-ml-auto"
|
|
851
|
+
}, as = /* @__PURE__ */ z({
|
|
852
|
+
__name: "UiNavLink",
|
|
853
|
+
props: {
|
|
854
|
+
to: {},
|
|
855
|
+
inactiveClass: { default: "" },
|
|
856
|
+
activeClass: { default: "" },
|
|
857
|
+
ariaCurrent: { default: void 0 },
|
|
858
|
+
current: { type: Boolean, default: !1 },
|
|
859
|
+
disabled: { type: Boolean, default: !1 },
|
|
860
|
+
customDisabled: { type: Boolean, default: !1 },
|
|
861
|
+
useCustomActiveState: { type: Boolean, default: !1 }
|
|
862
|
+
},
|
|
863
|
+
emits: ["click"],
|
|
864
|
+
setup(t, { emit: l }) {
|
|
865
|
+
const s = t, a = l, { to: m, inactiveClass: u, activeClass: n, ariaCurrent: p, current: v, disabled: $, customDisabled: c, useCustomActiveState: d } = Ss(s), { navigate: g, isExactActive: h, isActive: k } = zl({ to: m }), C = ls(), A = ts(), D = P(A.name);
|
|
866
|
+
q(A, (y, N) => {
|
|
867
|
+
D.value = N.name;
|
|
868
|
+
});
|
|
869
|
+
const i = B(() => {
|
|
870
|
+
const y = C.resolve(m.value);
|
|
871
|
+
return y && y.matched.length > 0 && !y.matched.some((N) => N.meta?.isErrorPage);
|
|
872
|
+
}), I = B(() => {
|
|
873
|
+
const N = [
|
|
874
|
+
(d.value ? v.value : k.value) ? n.value : u.value,
|
|
875
|
+
"sl-w-full",
|
|
876
|
+
"sl-flex",
|
|
877
|
+
// Make the button container a flexbox.
|
|
878
|
+
"sl-items-center",
|
|
879
|
+
// Vertically align items.
|
|
880
|
+
"sl-relative",
|
|
881
|
+
// Essential for loading overlay positioning
|
|
882
|
+
"sl-justify-between"
|
|
883
|
+
// Space between content and trailing loading
|
|
884
|
+
];
|
|
885
|
+
return c.value ? N.push("sl-cursor-not-allowed", "sl-text-gray-500") : !i.value || $.value ? N.push("sl-cursor-not-allowed") : N.push("sl-cursor-pointer"), N.join(" ");
|
|
886
|
+
}), x = P(!1), F = async (y) => {
|
|
887
|
+
if (a("click", y), !y.defaultPrevented && !c.value && !$.value)
|
|
888
|
+
try {
|
|
889
|
+
x.value = !0, await g();
|
|
890
|
+
} catch (N) {
|
|
891
|
+
console.error("[UiNavLink] Navigation failed:", N);
|
|
892
|
+
} finally {
|
|
893
|
+
x.value = !1;
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
return (y, N) => (o(), K(X, he({ "center-label": "" }, y.$attrs, {
|
|
897
|
+
disabled: f($),
|
|
898
|
+
loading: x.value,
|
|
899
|
+
"trailing-loading": !0,
|
|
900
|
+
"trailing-loading-size": "xs",
|
|
901
|
+
"custom-class": I.value,
|
|
902
|
+
"aria-current": f(p),
|
|
903
|
+
onClick: F
|
|
904
|
+
}), {
|
|
905
|
+
default: L(() => [
|
|
906
|
+
e("div", Wl, [
|
|
907
|
+
e("div", ql, [
|
|
908
|
+
S(y.$slots, "icon", {
|
|
909
|
+
isExactActive: f(h),
|
|
910
|
+
isActive: f(k)
|
|
911
|
+
}),
|
|
912
|
+
S(y.$slots, "default")
|
|
913
|
+
]),
|
|
914
|
+
y.$slots.secondaryText || y.$slots.badge ? (o(), r("div", Ql, [
|
|
915
|
+
S(y.$slots, "secondaryText"),
|
|
916
|
+
S(y.$slots, "badge")
|
|
917
|
+
])) : b("", !0)
|
|
918
|
+
])
|
|
919
|
+
]),
|
|
920
|
+
_: 3
|
|
921
|
+
}, 16, ["disabled", "loading", "custom-class", "aria-current"]));
|
|
922
|
+
}
|
|
923
|
+
}), Gl = {
|
|
924
|
+
class: "sl-hidden sm:sl-flex",
|
|
925
|
+
"aria-label": "Breadcrumb"
|
|
926
|
+
}, Jl = {
|
|
927
|
+
role: "list",
|
|
928
|
+
class: "sl-flex sl-items-center sl-space-x-4"
|
|
929
|
+
}, Yl = { class: "sl-flex sl-items-center" }, Xl = /* @__PURE__ */ z({
|
|
930
|
+
__name: "UiBreadcrumb",
|
|
931
|
+
setup(t) {
|
|
932
|
+
const l = P([]), s = ts(), a = ls(), m = P(""), u = B(() => l.value.map((v) => {
|
|
933
|
+
const $ = v.name.trim();
|
|
934
|
+
return {
|
|
935
|
+
...v,
|
|
936
|
+
name: $.length > 12 ? $.slice(0, 12) + "..." : $
|
|
937
|
+
};
|
|
938
|
+
})), n = async () => {
|
|
939
|
+
const v = s.path;
|
|
940
|
+
m.value = v;
|
|
941
|
+
const $ = v.split("/").filter(Boolean), c = [];
|
|
942
|
+
for (const [d, g] of $.entries()) {
|
|
943
|
+
let h;
|
|
944
|
+
h = g.charAt(0).toUpperCase() + g.slice(1).toLowerCase(), c.push({
|
|
945
|
+
name: h,
|
|
946
|
+
fullPath: "/" + $.slice(0, d + 1).join("/")
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
l.value = c;
|
|
950
|
+
}, p = (v, $) => {
|
|
951
|
+
const c = a.resolve(v.fullPath), d = c.matched.some((g) => g.meta?.isErrorPage);
|
|
952
|
+
(!c || c.matched.length === 0 || d) && ($.preventDefault(), $.stopPropagation(), console.warn("Breadcrumb route not found or is an error page:", v.fullPath));
|
|
953
|
+
};
|
|
954
|
+
return We(() => {
|
|
955
|
+
n();
|
|
956
|
+
}), (v, $) => (o(), r("nav", Gl, [
|
|
957
|
+
e("ol", Jl, [
|
|
958
|
+
(o(!0), r(E, null, j(u.value, (c, d) => (o(), r("li", {
|
|
959
|
+
key: c.fullPath
|
|
960
|
+
}, [
|
|
961
|
+
e("div", Yl, [
|
|
962
|
+
d !== 0 ? (o(), K(f(Ps), {
|
|
963
|
+
key: 0,
|
|
964
|
+
class: "sl-h-5 sl-w-5 sl-flex-shrink-0 sl-text-gray-400 sl-mr-3",
|
|
965
|
+
"aria-hidden": "true"
|
|
966
|
+
})) : b("", !0),
|
|
967
|
+
_(as, {
|
|
968
|
+
to: c.fullPath,
|
|
969
|
+
onClick: (g) => p(c, g),
|
|
970
|
+
"aria-current": c.fullPath === m.value ? "page" : void 0,
|
|
971
|
+
class: "sl-text-sm sl-font-medium sl-text-gray-500 hover:sl-text-gray-700 sl-truncate sl-overflow-ellipsis"
|
|
972
|
+
}, {
|
|
973
|
+
default: L(() => [
|
|
974
|
+
Q(w(c.name), 1)
|
|
975
|
+
]),
|
|
976
|
+
_: 2
|
|
977
|
+
}, 1032, ["to", "onClick", "aria-current"])
|
|
978
|
+
])
|
|
979
|
+
]))), 128))
|
|
980
|
+
])
|
|
981
|
+
]));
|
|
982
|
+
}
|
|
983
|
+
}), Zl = {
|
|
984
|
+
key: 0,
|
|
985
|
+
class: "sl-absolute sl-inset-0 sl-bg-white sl-bg-opacity-75 dark:sl-bg-gray-900 dark:sl-bg-opacity-75 sl-flex sl-items-center sl-justify-center sl-z-50"
|
|
986
|
+
}, et = { class: "sl-flex sl-flex-col sl-items-center" }, os = /* @__PURE__ */ z({
|
|
987
|
+
__name: "UiLoading",
|
|
988
|
+
props: {
|
|
989
|
+
theme: { default: "primary" },
|
|
990
|
+
size: { default: "md" },
|
|
991
|
+
text: {},
|
|
992
|
+
overlay: { type: Boolean, default: !1 },
|
|
993
|
+
className: {}
|
|
994
|
+
},
|
|
995
|
+
setup(t) {
|
|
996
|
+
const l = t, s = B(() => {
|
|
997
|
+
const n = ["sl-flex sl-items-center sl-justify-center"];
|
|
998
|
+
return l.overlay ? n.push("sl-relative") : n.push("sl-flex-col sl-space-y-2"), l.className && n.push(l.className), n;
|
|
999
|
+
}), a = B(() => {
|
|
1000
|
+
const u = {
|
|
1001
|
+
xs: "sl-h-3 sl-w-3",
|
|
1002
|
+
sm: "sl-h-4 sl-w-4",
|
|
1003
|
+
md: "sl-h-6 sl-w-6",
|
|
1004
|
+
lg: "sl-h-8 sl-w-8",
|
|
1005
|
+
xl: "sl-h-10 sl-w-10",
|
|
1006
|
+
"2xl": "sl-h-12 sl-w-12"
|
|
1007
|
+
}, n = {
|
|
1008
|
+
primary: "sl-text-stachelock-600",
|
|
1009
|
+
secondary: "sl-text-gray-600",
|
|
1010
|
+
dark: "sl-text-gray-700",
|
|
1011
|
+
light: "sl-text-gray-400",
|
|
1012
|
+
success: "sl-text-green-600",
|
|
1013
|
+
warning: "sl-text-yellow-600",
|
|
1014
|
+
danger: "sl-text-red-600",
|
|
1015
|
+
ghost: "sl-text-gray-600"
|
|
1016
|
+
};
|
|
1017
|
+
return [
|
|
1018
|
+
u[l.size || "md"],
|
|
1019
|
+
n[l.theme || "primary"]
|
|
1020
|
+
];
|
|
1021
|
+
}), m = B(() => {
|
|
1022
|
+
const u = {
|
|
1023
|
+
xs: "sl-text-xs",
|
|
1024
|
+
sm: "sl-text-sm",
|
|
1025
|
+
md: "sl-text-base",
|
|
1026
|
+
lg: "sl-text-lg",
|
|
1027
|
+
xl: "sl-text-xl",
|
|
1028
|
+
"2xl": "sl-text-2xl"
|
|
1029
|
+
}, n = {
|
|
1030
|
+
primary: "sl-text-stachelock-700",
|
|
1031
|
+
secondary: "sl-text-gray-700",
|
|
1032
|
+
dark: "sl-text-gray-800",
|
|
1033
|
+
light: "sl-text-gray-500",
|
|
1034
|
+
success: "sl-text-green-700",
|
|
1035
|
+
warning: "sl-text-yellow-700",
|
|
1036
|
+
danger: "sl-text-red-700",
|
|
1037
|
+
ghost: "sl-text-gray-700"
|
|
1038
|
+
};
|
|
1039
|
+
return [
|
|
1040
|
+
u[l.size || "md"],
|
|
1041
|
+
n[l.theme || "primary"],
|
|
1042
|
+
"sl-font-medium"
|
|
1043
|
+
];
|
|
1044
|
+
});
|
|
1045
|
+
return (u, n) => (o(), r("div", {
|
|
1046
|
+
class: V(s.value)
|
|
1047
|
+
}, [
|
|
1048
|
+
u.overlay ? (o(), r("div", Zl, [
|
|
1049
|
+
e("div", et, [
|
|
1050
|
+
e("div", {
|
|
1051
|
+
class: V(a.value)
|
|
1052
|
+
}, n[0] || (n[0] = [
|
|
1053
|
+
e("svg", {
|
|
1054
|
+
class: "sl-animate-spin",
|
|
1055
|
+
fill: "none",
|
|
1056
|
+
viewBox: "0 0 24 24"
|
|
1057
|
+
}, [
|
|
1058
|
+
e("circle", {
|
|
1059
|
+
class: "sl-opacity-25",
|
|
1060
|
+
cx: "12",
|
|
1061
|
+
cy: "12",
|
|
1062
|
+
r: "10",
|
|
1063
|
+
stroke: "currentColor",
|
|
1064
|
+
"stroke-width": "4"
|
|
1065
|
+
}),
|
|
1066
|
+
e("path", {
|
|
1067
|
+
class: "sl-opacity-75",
|
|
1068
|
+
fill: "currentColor",
|
|
1069
|
+
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"
|
|
1070
|
+
})
|
|
1071
|
+
], -1)
|
|
1072
|
+
]), 2),
|
|
1073
|
+
u.text ? (o(), r("p", {
|
|
1074
|
+
key: 0,
|
|
1075
|
+
class: V(m.value)
|
|
1076
|
+
}, w(u.text), 3)) : b("", !0)
|
|
1077
|
+
])
|
|
1078
|
+
])) : (o(), r("div", {
|
|
1079
|
+
key: 1,
|
|
1080
|
+
class: V(a.value)
|
|
1081
|
+
}, n[1] || (n[1] = [
|
|
1082
|
+
e("svg", {
|
|
1083
|
+
class: "sl-animate-spin",
|
|
1084
|
+
fill: "none",
|
|
1085
|
+
viewBox: "0 0 24 24"
|
|
1086
|
+
}, [
|
|
1087
|
+
e("circle", {
|
|
1088
|
+
class: "sl-opacity-25",
|
|
1089
|
+
cx: "12",
|
|
1090
|
+
cy: "12",
|
|
1091
|
+
r: "10",
|
|
1092
|
+
stroke: "currentColor",
|
|
1093
|
+
"stroke-width": "4"
|
|
1094
|
+
}),
|
|
1095
|
+
e("path", {
|
|
1096
|
+
class: "sl-opacity-75",
|
|
1097
|
+
fill: "currentColor",
|
|
1098
|
+
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"
|
|
1099
|
+
})
|
|
1100
|
+
], -1)
|
|
1101
|
+
]), 2)),
|
|
1102
|
+
u.text && !u.overlay ? (o(), r("p", {
|
|
1103
|
+
key: 2,
|
|
1104
|
+
class: V(m.value)
|
|
1105
|
+
}, w(u.text), 3)) : b("", !0)
|
|
1106
|
+
], 2));
|
|
1107
|
+
}
|
|
1108
|
+
}), st = {
|
|
1109
|
+
key: 0,
|
|
1110
|
+
class: "sl-bg-white sl-px-6 sl-py-24 sm:sl-py-32 lg:sl-px-8"
|
|
1111
|
+
}, lt = { class: "sl-mx-auto sl-max-w-2xl sl-text-center" }, tt = { class: "sl-text-base sl-font-semibold sl-leading-7 sl-text-stachelock-600" }, at = { class: "sl-mt-2 sl-text-4xl sl-font-bold sl-tracking-tight sl-text-gray-900 sm:sl-text-6xl" }, ot = { class: "sl-flex sl-justify-center sl-mt-6" }, nt = { class: "sl-mt-6 sl-text-lg sl-leading-8 sl-text-gray-600" }, rt = {
|
|
1112
|
+
key: 1,
|
|
1113
|
+
class: "sl-flex sl-justify-center sl-mt-6"
|
|
1114
|
+
}, it = /* @__PURE__ */ z({
|
|
1115
|
+
__name: "UiLoadingDots",
|
|
1116
|
+
props: {
|
|
1117
|
+
backgroundColor: {
|
|
1118
|
+
type: String,
|
|
1119
|
+
default: "#3e4b9a"
|
|
1120
|
+
},
|
|
1121
|
+
size: {
|
|
1122
|
+
type: String,
|
|
1123
|
+
default: "md",
|
|
1124
|
+
validator: (t) => ["sm", "md", "lg", "xl"].includes(t)
|
|
1125
|
+
},
|
|
1126
|
+
caption: {
|
|
1127
|
+
type: String,
|
|
1128
|
+
default: "LOADING"
|
|
1129
|
+
},
|
|
1130
|
+
title: {
|
|
1131
|
+
type: String,
|
|
1132
|
+
default: "Please wait"
|
|
1133
|
+
},
|
|
1134
|
+
subtitle: {
|
|
1135
|
+
type: String,
|
|
1136
|
+
default: ""
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
setup(t) {
|
|
1140
|
+
const l = t, s = B(() => `dots-${l.size}`);
|
|
1141
|
+
return (a, m) => t.title && t.subtitle && t.caption ? (o(), r("div", st, [
|
|
1142
|
+
e("div", lt, [
|
|
1143
|
+
e("p", tt, w(t.caption), 1),
|
|
1144
|
+
e("h2", at, w(t.title), 1),
|
|
1145
|
+
e("div", ot, [
|
|
1146
|
+
e("div", {
|
|
1147
|
+
class: V(["loader-dots", s.value])
|
|
1148
|
+
}, [
|
|
1149
|
+
(o(), r(E, null, j(4, (u) => e("div", {
|
|
1150
|
+
key: u,
|
|
1151
|
+
class: "dots-div",
|
|
1152
|
+
style: le({ backgroundColor: t.backgroundColor })
|
|
1153
|
+
}, null, 4)), 64))
|
|
1154
|
+
], 2)
|
|
1155
|
+
]),
|
|
1156
|
+
e("p", nt, w(t.subtitle), 1)
|
|
1157
|
+
])
|
|
1158
|
+
])) : (o(), r("div", rt, [
|
|
1159
|
+
e("div", {
|
|
1160
|
+
class: V(["loader-dots", s.value])
|
|
1161
|
+
}, [
|
|
1162
|
+
(o(), r(E, null, j(4, (u) => e("div", {
|
|
1163
|
+
key: u,
|
|
1164
|
+
class: "dots-div",
|
|
1165
|
+
style: le({ backgroundColor: t.backgroundColor })
|
|
1166
|
+
}, null, 4)), 64))
|
|
1167
|
+
], 2)
|
|
1168
|
+
]));
|
|
1169
|
+
}
|
|
1170
|
+
}), dt = /* @__PURE__ */ oe(it, [["__scopeId", "data-v-8f791736"]]), ut = { class: "sl-fixed sl-inset-0 sl-z-10 sl-w-screen sl-overflow-y-auto" }, ct = { class: "sl-bg-white" }, mt = { class: "sl-px-4 sl-pt-5 sl-pb-4 sm:sl-p-6 sm:sl-pb-4" }, ft = { class: "sm:sl-flex sm:sl-items-start" }, gt = { class: "sl-mx-auto sl-flex sl-h-12 sl-w-12 sl-flex-shrink-0 sl-items-center sl-justify-center sl-rounded-full sl-bg-gray-100 sm:sl-mx-0 sm:sl-h-10 sm:sl-w-10" }, pt = { class: "sl-mt-3 sl-text-center sm:sl-ml-4 sm:sl-mt-0 sm:sl-text-left sl-w-full" }, ht = { class: "sl-mt-2" }, vt = { class: "sl-px-4 sl-py-3 sm:sl-flex sm:sl-flex-row-reverse sm:sl-px-6" }, yt = { class: "sl-flex sl-w-full sl-justify-end sl-gap-3" }, bt = /* @__PURE__ */ z({
|
|
1171
|
+
__name: "UiModal",
|
|
1172
|
+
props: {
|
|
1173
|
+
modelValue: { type: Boolean, required: !0 },
|
|
1174
|
+
size: {
|
|
1175
|
+
type: String,
|
|
1176
|
+
default: "sm:max-w-lg",
|
|
1177
|
+
validator: (t) => [
|
|
1178
|
+
"sm:max-w-sm",
|
|
1179
|
+
"sm:max-w-md",
|
|
1180
|
+
"sm:max-w-lg",
|
|
1181
|
+
"sm:max-w-xl",
|
|
1182
|
+
"sm:max-w-2xl",
|
|
1183
|
+
"sm:max-w-3xl",
|
|
1184
|
+
"sm:max-w-4xl",
|
|
1185
|
+
"sm:max-w-5xl",
|
|
1186
|
+
"sm:max-w-6xl",
|
|
1187
|
+
"sm:max-w-7xl"
|
|
1188
|
+
].includes(t)
|
|
1189
|
+
},
|
|
1190
|
+
position: { type: String, default: "center", validator: (t) => ["center", "top"].includes(t) },
|
|
1191
|
+
showCancel: { type: Boolean, default: !0 },
|
|
1192
|
+
showConfirm: { type: Boolean, default: !0 },
|
|
1193
|
+
cancelText: { type: String, default: "Cancel" },
|
|
1194
|
+
confirmText: { type: String, default: "Confirm" },
|
|
1195
|
+
confirmTheme: { type: String, default: "primary" }
|
|
1196
|
+
},
|
|
1197
|
+
emits: ["update:modelValue", "cancel", "confirm"],
|
|
1198
|
+
setup(t, { emit: l }) {
|
|
1199
|
+
const s = l, a = P(null), m = B(() => a.value), u = () => {
|
|
1200
|
+
s("update:modelValue", !1), s("cancel");
|
|
1201
|
+
}, n = () => {
|
|
1202
|
+
s("confirm"), s("update:modelValue", !1);
|
|
1203
|
+
};
|
|
1204
|
+
return (p, v) => (o(), K(f(ve), {
|
|
1205
|
+
as: "template",
|
|
1206
|
+
show: t.modelValue
|
|
1207
|
+
}, {
|
|
1208
|
+
default: L(() => [
|
|
1209
|
+
_(f(ke), {
|
|
1210
|
+
as: "div",
|
|
1211
|
+
class: "sl-relative sl-z-50",
|
|
1212
|
+
onClose: u,
|
|
1213
|
+
"initial-focus": m.value
|
|
1214
|
+
}, {
|
|
1215
|
+
default: L(() => [
|
|
1216
|
+
_(f(se), {
|
|
1217
|
+
as: "template",
|
|
1218
|
+
enter: "ease-out duration-300",
|
|
1219
|
+
"enter-from": "opacity-0",
|
|
1220
|
+
"enter-to": "opacity-100",
|
|
1221
|
+
leave: "ease-in duration-200",
|
|
1222
|
+
"leave-from": "opacity-100",
|
|
1223
|
+
"leave-to": "opacity-0"
|
|
1224
|
+
}, {
|
|
1225
|
+
default: L(() => v[0] || (v[0] = [
|
|
1226
|
+
e("div", { class: "sl-fixed sl-inset-0 sl-bg-gray-500/75 sl-transition-opacity" }, null, -1)
|
|
1227
|
+
])),
|
|
1228
|
+
_: 1,
|
|
1229
|
+
__: [0]
|
|
1230
|
+
}),
|
|
1231
|
+
e("div", ut, [
|
|
1232
|
+
e("div", {
|
|
1233
|
+
class: V(["sl-flex sl-min-h-full sl-items-center sl-justify-center sl-p-4 sl-text-center", [t.position === "top" ? "sm:sl-items-start sm:sl-pt-16" : "sm:sl-items-center"]])
|
|
1234
|
+
}, [
|
|
1235
|
+
_(f(se), {
|
|
1236
|
+
as: "template",
|
|
1237
|
+
enter: "ease-out duration-300",
|
|
1238
|
+
"enter-from": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1239
|
+
"enter-to": "opacity-100 translate-y-0 sm:scale-100",
|
|
1240
|
+
leave: "ease-in duration-200",
|
|
1241
|
+
"leave-from": "opacity-100 translate-y-0 sm:scale-100",
|
|
1242
|
+
"leave-to": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
1243
|
+
}, {
|
|
1244
|
+
default: L(() => [
|
|
1245
|
+
_(f($e), {
|
|
1246
|
+
class: V(["sl-relative sl-transform sl-overflow-hidden sl-rounded-lg sl-bg-white sl-text-left sl-shadow-xl sl-transition-all sl-w-full", t.size])
|
|
1247
|
+
}, {
|
|
1248
|
+
default: L(() => [
|
|
1249
|
+
e("div", ct, [
|
|
1250
|
+
e("div", mt, [
|
|
1251
|
+
e("div", ft, [
|
|
1252
|
+
e("div", gt, [
|
|
1253
|
+
S(p.$slots, "icon")
|
|
1254
|
+
]),
|
|
1255
|
+
e("div", pt, [
|
|
1256
|
+
_(f(js), {
|
|
1257
|
+
as: "h3",
|
|
1258
|
+
class: "sl-text-base sl-font-semibold sl-leading-6 sl-text-gray-900"
|
|
1259
|
+
}, {
|
|
1260
|
+
default: L(() => [
|
|
1261
|
+
S(p.$slots, "header")
|
|
1262
|
+
]),
|
|
1263
|
+
_: 3
|
|
1264
|
+
}),
|
|
1265
|
+
e("div", ht, [
|
|
1266
|
+
S(p.$slots, "body", {}, () => [
|
|
1267
|
+
S(p.$slots, "default")
|
|
1268
|
+
])
|
|
1269
|
+
])
|
|
1270
|
+
])
|
|
1271
|
+
])
|
|
1272
|
+
]),
|
|
1273
|
+
e("div", vt, [
|
|
1274
|
+
S(p.$slots, "footer", {}, () => [
|
|
1275
|
+
e("div", yt, [
|
|
1276
|
+
t.showCancel ? (o(), K(X, {
|
|
1277
|
+
key: 0,
|
|
1278
|
+
"center-label": "",
|
|
1279
|
+
theme: "light",
|
|
1280
|
+
outlined: !0,
|
|
1281
|
+
onButtonClick: u
|
|
1282
|
+
}, {
|
|
1283
|
+
default: L(() => [
|
|
1284
|
+
Q(w(t.cancelText), 1)
|
|
1285
|
+
]),
|
|
1286
|
+
_: 1
|
|
1287
|
+
})) : b("", !0),
|
|
1288
|
+
t.showConfirm ? (o(), K(X, {
|
|
1289
|
+
key: 1,
|
|
1290
|
+
"center-label": "",
|
|
1291
|
+
theme: t.confirmTheme,
|
|
1292
|
+
outlined: !1,
|
|
1293
|
+
onButtonClick: n
|
|
1294
|
+
}, {
|
|
1295
|
+
default: L(() => [
|
|
1296
|
+
Q(w(t.confirmText), 1)
|
|
1297
|
+
]),
|
|
1298
|
+
_: 1
|
|
1299
|
+
}, 8, ["theme"])) : b("", !0)
|
|
1300
|
+
])
|
|
1301
|
+
])
|
|
1302
|
+
])
|
|
1303
|
+
]),
|
|
1304
|
+
e("button", {
|
|
1305
|
+
ref_key: "fallbackFocusRef",
|
|
1306
|
+
ref: a,
|
|
1307
|
+
class: "sl-sr-only"
|
|
1308
|
+
}, "Close", 512)
|
|
1309
|
+
]),
|
|
1310
|
+
_: 3
|
|
1311
|
+
}, 8, ["class"])
|
|
1312
|
+
]),
|
|
1313
|
+
_: 3
|
|
1314
|
+
})
|
|
1315
|
+
], 2)
|
|
1316
|
+
])
|
|
1317
|
+
]),
|
|
1318
|
+
_: 3
|
|
1319
|
+
}, 8, ["initial-focus"])
|
|
1320
|
+
]),
|
|
1321
|
+
_: 3
|
|
1322
|
+
}, 8, ["show"]));
|
|
1323
|
+
}
|
|
1324
|
+
}), xt = { class: "sl-flex sl-justify-between sl-mb-1" }, wt = {
|
|
1325
|
+
key: 0,
|
|
1326
|
+
class: "sl-text-base sl-font-medium sl-text-stachelock-700"
|
|
1327
|
+
}, kt = {
|
|
1328
|
+
key: 1,
|
|
1329
|
+
class: "sl-text-sm sl-font-medium sl-text-stachelock-700"
|
|
1330
|
+
}, $t = { class: "sl-w-full sl-bg-gray-200 sl-rounded-full sl-h-2.5" }, _t = /* @__PURE__ */ z({
|
|
1331
|
+
__name: "UiProgressBar",
|
|
1332
|
+
props: {
|
|
1333
|
+
progress: {
|
|
1334
|
+
type: Number,
|
|
1335
|
+
default: 0,
|
|
1336
|
+
required: !0
|
|
1337
|
+
},
|
|
1338
|
+
label: {
|
|
1339
|
+
type: String,
|
|
1340
|
+
default: ""
|
|
1341
|
+
},
|
|
1342
|
+
showProgressLabel: {
|
|
1343
|
+
type: Boolean,
|
|
1344
|
+
default: !1
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
setup(t) {
|
|
1348
|
+
const l = t, s = P(l.progress);
|
|
1349
|
+
return q(() => l.progress, (a) => {
|
|
1350
|
+
s.value = a;
|
|
1351
|
+
}), (a, m) => (o(), r("div", null, [
|
|
1352
|
+
e("div", xt, [
|
|
1353
|
+
t.label && t.label.length > 0 ? (o(), r("span", wt, w(t.label), 1)) : b("", !0),
|
|
1354
|
+
t.showProgressLabel ? (o(), r("span", kt, w(s.value) + "%", 1)) : b("", !0)
|
|
1355
|
+
]),
|
|
1356
|
+
e("div", $t, [
|
|
1357
|
+
e("div", {
|
|
1358
|
+
class: "sl-bg-stachelock-600 sl-h-2.5 sl-rounded-full sl-transition-all sl-duration-500 sl-ease-out",
|
|
1359
|
+
style: le({ width: `${s.value}%` })
|
|
1360
|
+
}, null, 4)
|
|
1361
|
+
])
|
|
1362
|
+
]));
|
|
1363
|
+
}
|
|
1364
|
+
}), Ct = {
|
|
1365
|
+
viewBox: "0 0 36 36",
|
|
1366
|
+
class: "sl-transform -sl-rotate-90 sl-w-full sl-h-full"
|
|
1367
|
+
}, St = ["stroke-dasharray"], Mt = {
|
|
1368
|
+
key: 0,
|
|
1369
|
+
class: "sl-absolute sl-top-1/2 sl-left-1/2 sl-transform -sl-translate-x-1/2 -sl-translate-y-1/2 sl-text-center"
|
|
1370
|
+
}, Tt = {
|
|
1371
|
+
key: 1,
|
|
1372
|
+
class: "sl-absolute sl-top-1/2 sl-left-1/2 sl-transform -sl-translate-x-1/2 -sl-translate-y-1/2 sl-text-center sl-text-xs"
|
|
1373
|
+
}, Bt = /* @__PURE__ */ z({
|
|
1374
|
+
__name: "UiRadialProgressBar",
|
|
1375
|
+
props: {
|
|
1376
|
+
progress: {
|
|
1377
|
+
type: Number,
|
|
1378
|
+
default: 0
|
|
1379
|
+
},
|
|
1380
|
+
label: {
|
|
1381
|
+
type: String,
|
|
1382
|
+
default: ""
|
|
1383
|
+
},
|
|
1384
|
+
showProgressLabel: {
|
|
1385
|
+
type: Boolean,
|
|
1386
|
+
default: !1
|
|
1387
|
+
},
|
|
1388
|
+
size: {
|
|
1389
|
+
type: String,
|
|
1390
|
+
default: "md"
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
setup(t) {
|
|
1394
|
+
const l = t, s = B(() => {
|
|
1395
|
+
switch (l.size) {
|
|
1396
|
+
case "xs":
|
|
1397
|
+
return "sl-h-4 sl-w-4";
|
|
1398
|
+
case "sm":
|
|
1399
|
+
return "sl-h-8 sl-w-8";
|
|
1400
|
+
case "md":
|
|
1401
|
+
return "sl-h-12 sl-w-12";
|
|
1402
|
+
case "lg":
|
|
1403
|
+
return "sl-h-16 sl-w-16";
|
|
1404
|
+
default:
|
|
1405
|
+
return "sl-h-8 sl-w-8";
|
|
1406
|
+
}
|
|
1407
|
+
}), a = P(l.progress);
|
|
1408
|
+
return q(() => l.progress, (m) => {
|
|
1409
|
+
a.value = m;
|
|
1410
|
+
}), (m, u) => (o(), r("div", {
|
|
1411
|
+
class: V(["sl-relative", s.value])
|
|
1412
|
+
}, [
|
|
1413
|
+
(o(), r("svg", Ct, [
|
|
1414
|
+
u[0] || (u[0] = e("path", {
|
|
1415
|
+
class: "sl-fill-none sl-stroke-gray-300",
|
|
1416
|
+
"stroke-width": "3.8",
|
|
1417
|
+
d: "M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"
|
|
1418
|
+
}, null, -1)),
|
|
1419
|
+
e("path", {
|
|
1420
|
+
class: "sl-fill-none sl-stroke-stachelock-600 sl-stroke-linecap-round sl-transition-[stroke-dasharray] sl-duration-500 sl-ease-out",
|
|
1421
|
+
"stroke-dasharray": a.value + ", 100",
|
|
1422
|
+
"stroke-width": "3.8",
|
|
1423
|
+
d: "M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"
|
|
1424
|
+
}, null, 8, St)
|
|
1425
|
+
])),
|
|
1426
|
+
t.label && t.label.length > 0 ? (o(), r("div", Mt, w(t.label), 1)) : b("", !0),
|
|
1427
|
+
t.showProgressLabel ? (o(), r("div", Tt, w(a.value) + "% ", 1)) : b("", !0)
|
|
1428
|
+
], 2));
|
|
1429
|
+
}
|
|
1430
|
+
}), Vt = { class: "sl-px-4 sm:sl-px-6 lg:sl-px-8" }, At = { class: "sm:sl-flex sm:sl-items-center" }, Lt = { class: "sm:sl-flex-auto" }, It = {
|
|
1431
|
+
key: 0,
|
|
1432
|
+
class: "sl-text-base sl-font-semibold sl-leading-6 sl-text-gray-800"
|
|
1433
|
+
}, Dt = {
|
|
1434
|
+
key: 1,
|
|
1435
|
+
class: "sl-mt-2 sl-text-sm sl-text-gray-700"
|
|
1436
|
+
}, Et = {
|
|
1437
|
+
key: 0,
|
|
1438
|
+
class: "sl-mt-4 sm:sl-ml-16 sm:sl-mt-0 sm:sl-flex-none"
|
|
1439
|
+
}, Pt = {
|
|
1440
|
+
key: 0,
|
|
1441
|
+
class: "md:sl-hidden"
|
|
1442
|
+
}, zt = { class: "sl-mt-6 sl-space-y-4" }, Ot = { class: "sl-flex sl-items-start sl-justify-between" }, jt = { class: "sl-text-sm sl-font-medium sl-text-gray-900" }, Ft = { class: "sl-ml-4 sl-shrink-0" }, Nt = { class: "sl-mt-3 sl-grid sl-grid-cols-1 sl-gap-2" }, Rt = { class: "sl-font-medium sl-text-gray-900" }, Ut = { class: "sl-ml-1" }, Ht = {
|
|
1443
|
+
key: 0,
|
|
1444
|
+
class: "sl-mt-3"
|
|
1445
|
+
}, Kt = { class: "sl-group" }, Wt = { class: "sl-mt-2" }, qt = { class: "sl-divide-y sl-divide-gray-100" }, Qt = { class: "sl-text-sm sl-font-medium sl-text-gray-900 sl-col-span-1" }, Gt = { class: "sl-mt-1 sl-text-sm sl-text-gray-700 sl-col-span-2" }, Jt = {
|
|
1446
|
+
key: 1,
|
|
1447
|
+
class: "md:sl-hidden sl-mt-6"
|
|
1448
|
+
}, Yt = { class: "sl-space-y-4" }, Xt = { class: "sl-hidden md:sl-block" }, Zt = { class: "sl-mt-8 sl-flow-root" }, ea = { class: "sl--my-2 sl--mx-4 sl-overflow-x-auto sm:sl--mx-6 lg:sl--mx-8" }, sa = { class: "sl-inline-block sl-min-w-full sl-py-2 sl-align-middle md:sl-px-6 lg:sl-px-8" }, la = { class: "sl-overflow-hidden sl-shadow sl-ring-1 sl-ring-black sl-ring-opacity-5 md:sl-rounded-lg" }, ta = { class: "sl-min-w-full sl-divide-y sl-divide-gray-300" }, aa = { class: "sl-bg-gray-50" }, oa = {
|
|
1449
|
+
key: 0,
|
|
1450
|
+
class: "sl-px-3 sl-py-3.5"
|
|
1451
|
+
}, na = { class: "sl-divide-y sl-divide-gray-200 sl-bg-white" }, ra = {
|
|
1452
|
+
key: 0,
|
|
1453
|
+
class: "sl-whitespace-nowrap sl-px-3 sl-py-4 sl-text-sm sl-text-right"
|
|
1454
|
+
}, ia = /* @__PURE__ */ z({
|
|
1455
|
+
__name: "UiTable",
|
|
1456
|
+
props: {
|
|
1457
|
+
data: { type: Array, required: !0 },
|
|
1458
|
+
columns: { type: Array, required: !0 },
|
|
1459
|
+
truncate: { type: Array, default: () => [] },
|
|
1460
|
+
isLoading: { type: Boolean, default: !1 },
|
|
1461
|
+
mobileConfig: {
|
|
1462
|
+
type: Object,
|
|
1463
|
+
default: () => ({})
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
setup(t) {
|
|
1467
|
+
const l = t, s = P([]), a = B(() => l.columns.map((d) => {
|
|
1468
|
+
const g = l.truncate.find((h) => h.column === d.accessorKey);
|
|
1469
|
+
return g ? {
|
|
1470
|
+
...d,
|
|
1471
|
+
cell: (h) => {
|
|
1472
|
+
const k = h.getValue();
|
|
1473
|
+
return k && k.length > g.length ? `${k.substring(0, g.length)}...` : k;
|
|
1474
|
+
}
|
|
1475
|
+
} : d;
|
|
1476
|
+
})), m = {
|
|
1477
|
+
get data() {
|
|
1478
|
+
return l.data;
|
|
1479
|
+
},
|
|
1480
|
+
get columns() {
|
|
1481
|
+
return a.value;
|
|
1482
|
+
},
|
|
1483
|
+
getCoreRowModel: Gs(),
|
|
1484
|
+
enableColumnResizing: !0,
|
|
1485
|
+
columnResizeMode: "onChange",
|
|
1486
|
+
getSortedRowModel: Ys(),
|
|
1487
|
+
state: {
|
|
1488
|
+
get sorting() {
|
|
1489
|
+
return s.value;
|
|
1490
|
+
}
|
|
1491
|
+
},
|
|
1492
|
+
onSortingChange: (d) => {
|
|
1493
|
+
s.value = typeof d == "function" ? d(s.value) : d;
|
|
1494
|
+
},
|
|
1495
|
+
defaultColumn: { enableSorting: !0 }
|
|
1496
|
+
}, u = Js(m), n = (d) => {
|
|
1497
|
+
if (!d) return null;
|
|
1498
|
+
const g = d.getVisibleCells() || [], h = l.mobileConfig || {};
|
|
1499
|
+
if (h.titleColumn)
|
|
1500
|
+
return g.find((C) => C.column.id === h.titleColumn) || null;
|
|
1501
|
+
const k = ["name", "title", "embedCode"];
|
|
1502
|
+
for (const C of k) {
|
|
1503
|
+
const A = g.find((D) => D.column.id.toLowerCase().includes(C.toLowerCase()));
|
|
1504
|
+
if (A) return A;
|
|
1505
|
+
}
|
|
1506
|
+
return g[0] || null;
|
|
1507
|
+
}, p = (d) => {
|
|
1508
|
+
if (!d) return "";
|
|
1509
|
+
const g = d.column.columnDef.header;
|
|
1510
|
+
return typeof g == "string" ? g : d.column.id;
|
|
1511
|
+
}, v = (d) => {
|
|
1512
|
+
if (!d) return "";
|
|
1513
|
+
const g = d.getValue?.();
|
|
1514
|
+
return typeof g == "object" ? JSON.stringify(g) : g;
|
|
1515
|
+
}, $ = (d) => {
|
|
1516
|
+
const g = d.getVisibleCells() || [], k = (l.mobileConfig || {}).primaryColumns || [];
|
|
1517
|
+
return k.length ? g.filter((C) => k.includes(C.column.id)) : g.slice(0, Math.min(3, g.length));
|
|
1518
|
+
}, c = (d) => {
|
|
1519
|
+
const g = d.getVisibleCells() || [], k = (l.mobileConfig || {}).secondaryColumns || [];
|
|
1520
|
+
return k.length ? g.filter((C) => k.includes(C.column.id)) : g.slice(3);
|
|
1521
|
+
};
|
|
1522
|
+
return (d, g) => (o(), r("div", Vt, [
|
|
1523
|
+
e("div", At, [
|
|
1524
|
+
e("div", Lt, [
|
|
1525
|
+
d.$slots.title ? (o(), r("h1", It, [
|
|
1526
|
+
S(d.$slots, "title")
|
|
1527
|
+
])) : b("", !0),
|
|
1528
|
+
d.$slots.description ? (o(), r("p", Dt, [
|
|
1529
|
+
S(d.$slots, "description")
|
|
1530
|
+
])) : b("", !0)
|
|
1531
|
+
]),
|
|
1532
|
+
d.$slots.right ? (o(), r("div", Et, [
|
|
1533
|
+
S(d.$slots, "right")
|
|
1534
|
+
])) : b("", !0)
|
|
1535
|
+
]),
|
|
1536
|
+
t.isLoading ? b("", !0) : (o(), r("div", Pt, [
|
|
1537
|
+
e("div", zt, [
|
|
1538
|
+
(o(!0), r(E, null, j(f(u).getRowModel().rows, (h) => (o(), r("div", {
|
|
1539
|
+
key: h.id,
|
|
1540
|
+
class: "sl-bg-white sl-rounded-lg sl-shadow sl-p-4"
|
|
1541
|
+
}, [
|
|
1542
|
+
e("div", Ot, [
|
|
1543
|
+
e("div", jt, w(v(n(h))), 1),
|
|
1544
|
+
e("div", Ft, [
|
|
1545
|
+
S(d.$slots, "row:actions", { row: h })
|
|
1546
|
+
])
|
|
1547
|
+
]),
|
|
1548
|
+
e("div", Nt, [
|
|
1549
|
+
(o(!0), r(E, null, j($(h), (k) => (o(), r("div", {
|
|
1550
|
+
key: k.id,
|
|
1551
|
+
class: "sl-text-sm sl-text-gray-700"
|
|
1552
|
+
}, [
|
|
1553
|
+
e("span", Rt, w(p(k)) + ":", 1),
|
|
1554
|
+
e("span", Ut, w(v(k)), 1)
|
|
1555
|
+
]))), 128))
|
|
1556
|
+
]),
|
|
1557
|
+
c(h).length ? (o(), r("div", Ht, [
|
|
1558
|
+
e("details", Kt, [
|
|
1559
|
+
g[0] || (g[0] = e("summary", { class: "sl-cursor-pointer sl-text-sm sl-text-gray-700 sl-select-none" }, "More", -1)),
|
|
1560
|
+
e("div", Wt, [
|
|
1561
|
+
e("dl", qt, [
|
|
1562
|
+
(o(!0), r(E, null, j(c(h), (k) => (o(), r("div", {
|
|
1563
|
+
key: k.id,
|
|
1564
|
+
class: "sl-py-2 sl-grid sl-grid-cols-3 sl-gap-4"
|
|
1565
|
+
}, [
|
|
1566
|
+
e("dt", Qt, w(p(k)), 1),
|
|
1567
|
+
e("dd", Gt, w(v(k)), 1)
|
|
1568
|
+
]))), 128))
|
|
1569
|
+
])
|
|
1570
|
+
])
|
|
1571
|
+
])
|
|
1572
|
+
])) : b("", !0)
|
|
1573
|
+
]))), 128))
|
|
1574
|
+
])
|
|
1575
|
+
])),
|
|
1576
|
+
t.isLoading ? (o(), r("div", Jt, [
|
|
1577
|
+
e("div", Yt, [
|
|
1578
|
+
(o(), r(E, null, j(3, (h) => e("div", {
|
|
1579
|
+
key: h,
|
|
1580
|
+
class: "sl-animate-pulse"
|
|
1581
|
+
}, g[1] || (g[1] = [
|
|
1582
|
+
Ms('<div class="sl-bg-white sl-rounded-lg sl-shadow sl-p-4"><div class="sl-flex sl-items-center sl-justify-between sl-mb-3"><div class="sl-h-4 sl-bg-gray-200 sl-rounded sl-w-1/2"></div><div class="sl-h-8 sl-bg-gray-200 sl-rounded-full sl-w-8"></div></div><div class="sl-space-y-2"><div class="sl-h-3 sl-bg-gray-200 sl-rounded sl-w-full"></div><div class="sl-h-3 sl-bg-gray-200 sl-rounded sl-w-3/4"></div></div></div>', 1)
|
|
1583
|
+
]))), 64))
|
|
1584
|
+
])
|
|
1585
|
+
])) : b("", !0),
|
|
1586
|
+
e("div", Xt, [
|
|
1587
|
+
e("div", Zt, [
|
|
1588
|
+
e("div", ea, [
|
|
1589
|
+
e("div", sa, [
|
|
1590
|
+
e("div", la, [
|
|
1591
|
+
e("table", ta, [
|
|
1592
|
+
e("thead", aa, [
|
|
1593
|
+
e("tr", null, [
|
|
1594
|
+
(o(!0), r(E, null, j(f(u).getHeaderGroups()[0].headers, (h) => (o(), r("th", {
|
|
1595
|
+
key: h.id,
|
|
1596
|
+
scope: "col",
|
|
1597
|
+
class: "sl-px-3 sl-py-3.5 sl-text-left sl-text-sm sl-font-semibold sl-text-gray-900"
|
|
1598
|
+
}, [
|
|
1599
|
+
_(f(Ee), {
|
|
1600
|
+
render: h.column.columnDef.header,
|
|
1601
|
+
props: h.getContext()
|
|
1602
|
+
}, null, 8, ["render", "props"])
|
|
1603
|
+
]))), 128)),
|
|
1604
|
+
d.$slots["row:actions"] ? (o(), r("th", oa)) : b("", !0)
|
|
1605
|
+
])
|
|
1606
|
+
]),
|
|
1607
|
+
e("tbody", na, [
|
|
1608
|
+
(o(!0), r(E, null, j(f(u).getRowModel().rows, (h) => (o(), r("tr", {
|
|
1609
|
+
key: h.id
|
|
1610
|
+
}, [
|
|
1611
|
+
(o(!0), r(E, null, j(h.getVisibleCells(), (k) => (o(), r("td", {
|
|
1612
|
+
key: k.id,
|
|
1613
|
+
class: "sl-whitespace-nowrap sl-px-3 sl-py-4 sl-text-sm sl-text-gray-500"
|
|
1614
|
+
}, [
|
|
1615
|
+
_(f(Ee), {
|
|
1616
|
+
render: k.column.columnDef.cell,
|
|
1617
|
+
props: k.getContext()
|
|
1618
|
+
}, null, 8, ["render", "props"])
|
|
1619
|
+
]))), 128)),
|
|
1620
|
+
d.$slots["row:actions"] ? (o(), r("td", ra, [
|
|
1621
|
+
S(d.$slots, "row:actions", { row: h })
|
|
1622
|
+
])) : b("", !0)
|
|
1623
|
+
]))), 128))
|
|
1624
|
+
])
|
|
1625
|
+
])
|
|
1626
|
+
])
|
|
1627
|
+
])
|
|
1628
|
+
])
|
|
1629
|
+
])
|
|
1630
|
+
])
|
|
1631
|
+
]));
|
|
1632
|
+
}
|
|
1633
|
+
}), da = /* @__PURE__ */ z({
|
|
1634
|
+
__name: "UiTransition",
|
|
1635
|
+
props: {
|
|
1636
|
+
show: { type: Boolean },
|
|
1637
|
+
type: { default: "fade" },
|
|
1638
|
+
duration: { default: "normal" }
|
|
1639
|
+
},
|
|
1640
|
+
setup(t) {
|
|
1641
|
+
const l = t, s = {
|
|
1642
|
+
fast: "sl-duration-150",
|
|
1643
|
+
normal: "sl-duration-300",
|
|
1644
|
+
slow: "sl-duration-500"
|
|
1645
|
+
}, m = {
|
|
1646
|
+
fade: {
|
|
1647
|
+
enterActive: `sl-transition-opacity sl-ease-out ${s[l.duration]}`,
|
|
1648
|
+
enterFrom: "sl-opacity-0",
|
|
1649
|
+
enterTo: "sl-opacity-100",
|
|
1650
|
+
leaveActive: `sl-transition-opacity sl-ease-in ${s[l.duration]}`,
|
|
1651
|
+
leaveFrom: "sl-opacity-100",
|
|
1652
|
+
leaveTo: "sl-opacity-0"
|
|
1653
|
+
},
|
|
1654
|
+
scale: {
|
|
1655
|
+
enterActive: `sl-transition-all sl-ease-out ${s[l.duration]}`,
|
|
1656
|
+
enterFrom: "sl-opacity-0 sl-transform sl-scale-95",
|
|
1657
|
+
enterTo: "sl-opacity-100 sl-transform sl-scale-100",
|
|
1658
|
+
leaveActive: `sl-transition-all sl-ease-in ${s[l.duration]}`,
|
|
1659
|
+
leaveFrom: "sl-opacity-100 sl-transform sl-scale-100",
|
|
1660
|
+
leaveTo: "sl-opacity-0 sl-transform sl-scale-95"
|
|
1661
|
+
},
|
|
1662
|
+
"slide-up": {
|
|
1663
|
+
enterActive: `sl-transition-all sl-ease-out ${s[l.duration]}`,
|
|
1664
|
+
enterFrom: "sl-opacity-0 sl-transform sl-translate-y-4",
|
|
1665
|
+
enterTo: "sl-opacity-100 sl-transform sl-translate-y-0",
|
|
1666
|
+
leaveActive: `sl-transition-all sl-ease-in ${s[l.duration]}`,
|
|
1667
|
+
leaveFrom: "sl-opacity-100 sl-transform sl-translate-y-0",
|
|
1668
|
+
leaveTo: "sl-opacity-0 sl-transform -sl-translate-y-4"
|
|
1669
|
+
},
|
|
1670
|
+
"slide-down": {
|
|
1671
|
+
enterActive: `sl-transition-all sl-ease-out ${s[l.duration]}`,
|
|
1672
|
+
enterFrom: "sl-opacity-0 sl-transform -sl-translate-y-4",
|
|
1673
|
+
enterTo: "sl-opacity-100 sl-transform sl-translate-y-0",
|
|
1674
|
+
leaveActive: `sl-transition-all sl-ease-in ${s[l.duration]}`,
|
|
1675
|
+
leaveFrom: "sl-opacity-100 sl-transform sl-translate-y-0",
|
|
1676
|
+
leaveTo: "sl-opacity-0 sl-transform sl-translate-y-4"
|
|
1677
|
+
}
|
|
1678
|
+
}[l.type], u = m.enterActive, n = m.enterFrom, p = m.enterTo, v = m.leaveActive, $ = m.leaveFrom, c = m.leaveTo;
|
|
1679
|
+
return (d, g) => (o(), K(xe, {
|
|
1680
|
+
"enter-active-class": f(u),
|
|
1681
|
+
"enter-from-class": f(n),
|
|
1682
|
+
"enter-to-class": f(p),
|
|
1683
|
+
"leave-active-class": f(v),
|
|
1684
|
+
"leave-from-class": f($),
|
|
1685
|
+
"leave-to-class": f(c)
|
|
1686
|
+
}, {
|
|
1687
|
+
default: L(() => [
|
|
1688
|
+
d.show ? S(d.$slots, "default", { key: 0 }) : b("", !0)
|
|
1689
|
+
]),
|
|
1690
|
+
_: 3
|
|
1691
|
+
}, 8, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"]));
|
|
1692
|
+
}
|
|
1693
|
+
}), ua = { class: "sl-w-full" }, ca = { class: "sl-relative" }, ma = { class: "sl-flex sl-items-center sl-gap-2" }, fa = {
|
|
1694
|
+
key: 1,
|
|
1695
|
+
class: "sl-block sl-truncate sl-text-left"
|
|
1696
|
+
}, ga = {
|
|
1697
|
+
key: 2,
|
|
1698
|
+
class: "sl-block sl-truncate sl-text-left sl-text-gray-500"
|
|
1699
|
+
}, pa = { class: "sl-pointer-events-none sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-2" }, ha = { class: "sl-block sl-truncate sl-font-medium" }, va = { class: "sl-flex sl-items-center sl-gap-2" }, ya = {
|
|
1700
|
+
key: 0,
|
|
1701
|
+
class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-4"
|
|
1702
|
+
}, ba = { key: 0 }, re = /* @__PURE__ */ z({
|
|
1703
|
+
__name: "SelectInput",
|
|
1704
|
+
props: {
|
|
1705
|
+
name: {},
|
|
1706
|
+
items: {},
|
|
1707
|
+
label: {},
|
|
1708
|
+
placeholder: {},
|
|
1709
|
+
disabled: { type: Boolean },
|
|
1710
|
+
rules: {},
|
|
1711
|
+
validateOnMount: { type: Boolean },
|
|
1712
|
+
successMessage: {},
|
|
1713
|
+
tertiaryLabel: {},
|
|
1714
|
+
buttonClass: {},
|
|
1715
|
+
multiple: { type: Boolean, default: !1 },
|
|
1716
|
+
showAll: { type: Boolean, default: !1 },
|
|
1717
|
+
itemKey: { default: "id" },
|
|
1718
|
+
itemText: { default: "name" },
|
|
1719
|
+
modelValue: {},
|
|
1720
|
+
boxShadow: { type: Boolean, default: !1 }
|
|
1721
|
+
},
|
|
1722
|
+
emits: ["update:modelValue"],
|
|
1723
|
+
setup(t, { emit: l }) {
|
|
1724
|
+
const s = t, a = l, m = ae(s.name), { value: u, errorMessage: n, handleChange: p, meta: v, setTouched: $ } = te(
|
|
1725
|
+
() => s.name,
|
|
1726
|
+
s.rules,
|
|
1727
|
+
{
|
|
1728
|
+
validateOnMount: s.validateOnMount,
|
|
1729
|
+
initialValue: s.modelValue
|
|
1730
|
+
}
|
|
1731
|
+
), c = P(
|
|
1732
|
+
s.multiple ? Array.isArray(s.modelValue) ? s.modelValue : [] : s.modelValue
|
|
1733
|
+
);
|
|
1734
|
+
q(
|
|
1735
|
+
() => s.modelValue,
|
|
1736
|
+
(x) => {
|
|
1737
|
+
if (s.multiple) {
|
|
1738
|
+
const F = Array.isArray(x) ? x : [];
|
|
1739
|
+
F !== c.value && (c.value = F, u.value = F);
|
|
1740
|
+
} else
|
|
1741
|
+
x !== c.value && (c.value = x, u.value = x);
|
|
1742
|
+
},
|
|
1743
|
+
{ immediate: !0 }
|
|
1744
|
+
), q(
|
|
1745
|
+
c,
|
|
1746
|
+
(x) => {
|
|
1747
|
+
a("update:modelValue", x);
|
|
1748
|
+
}
|
|
1749
|
+
);
|
|
1750
|
+
const d = B(() => {
|
|
1751
|
+
const x = [
|
|
1752
|
+
"sl-relative",
|
|
1753
|
+
"sl-w-full",
|
|
1754
|
+
"sl-cursor-default",
|
|
1755
|
+
"sl-rounded-md",
|
|
1756
|
+
"sl-bg-white",
|
|
1757
|
+
"sl-py-2",
|
|
1758
|
+
"sl-pl-3",
|
|
1759
|
+
"sl-pr-10",
|
|
1760
|
+
"sl-text-left",
|
|
1761
|
+
"sl-border",
|
|
1762
|
+
"sl-text-sm",
|
|
1763
|
+
"focus:sl-outline-none",
|
|
1764
|
+
"focus:sl-ring-2",
|
|
1765
|
+
"focus:sl-ring-stachelock-500",
|
|
1766
|
+
"focus:sl-border-stachelock-500",
|
|
1767
|
+
"sl-transition-all",
|
|
1768
|
+
"sl-duration-200"
|
|
1769
|
+
];
|
|
1770
|
+
return s.disabled ? x.push(
|
|
1771
|
+
"sl-bg-gray-50",
|
|
1772
|
+
"sl-text-gray-500",
|
|
1773
|
+
"sl-cursor-not-allowed",
|
|
1774
|
+
"sl-border-gray-200"
|
|
1775
|
+
) : n.value ? x.push(
|
|
1776
|
+
"sl-border-red-300",
|
|
1777
|
+
"focus:sl-ring-red-500",
|
|
1778
|
+
"focus:sl-border-red-500"
|
|
1779
|
+
) : v.valid && v.touched ? x.push(
|
|
1780
|
+
"sl-border-green-300",
|
|
1781
|
+
"focus:sl-ring-green-500",
|
|
1782
|
+
"focus:sl-border-green-500"
|
|
1783
|
+
) : x.push(
|
|
1784
|
+
"sl-border-gray-300",
|
|
1785
|
+
"hover:sl-border-gray-400"
|
|
1786
|
+
), x.join(" ");
|
|
1787
|
+
}), g = (x) => x[s.itemKey], h = (x) => x[s.itemText] || x.toString(), k = B(() => c.value ? s.multiple && Array.isArray(c.value) ? c.value.length === 0 ? "" : c.value.length === 1 ? h(c.value[0]) : `${c.value.length} items selected` : h(c.value) : ""), C = B(() => c.value ? s.multiple && Array.isArray(c.value) ? c.value.length === 1 ? c.value[0].icon : null : c.value.icon : null), A = B(() => s.items.filter((x) => !x.disabled)), D = (x) => {
|
|
1788
|
+
c.value = x, $(!0), p(x);
|
|
1789
|
+
}, i = B(() => {
|
|
1790
|
+
if (!s.multiple || !Array.isArray(c.value)) return !1;
|
|
1791
|
+
const x = A.value;
|
|
1792
|
+
return x.length === 0 ? !1 : x.every((F) => c.value.includes(F));
|
|
1793
|
+
}), I = () => {
|
|
1794
|
+
s.multiple && (i.value ? c.value = [] : c.value = [...A.value], p(c.value));
|
|
1795
|
+
};
|
|
1796
|
+
return (x, F) => (o(), r("div", ua, [
|
|
1797
|
+
_(ee, {
|
|
1798
|
+
id: f(m),
|
|
1799
|
+
name: x.name,
|
|
1800
|
+
label: x.label,
|
|
1801
|
+
disabled: x.disabled,
|
|
1802
|
+
optional: !x.rules,
|
|
1803
|
+
"tertiary-label": x.tertiaryLabel,
|
|
1804
|
+
"box-shadow": x.boxShadow,
|
|
1805
|
+
"error-message": f(n),
|
|
1806
|
+
"success-message": x.successMessage,
|
|
1807
|
+
"is-valid": f(v).valid,
|
|
1808
|
+
"is-touched": f(v).touched
|
|
1809
|
+
}, {
|
|
1810
|
+
"success-message": L(() => [
|
|
1811
|
+
x.successMessage ? (o(), r("span", ba, w(x.successMessage), 1)) : b("", !0)
|
|
1812
|
+
]),
|
|
1813
|
+
default: L(() => [
|
|
1814
|
+
_(f(Fs), {
|
|
1815
|
+
modelValue: c.value,
|
|
1816
|
+
"onUpdate:modelValue": [
|
|
1817
|
+
F[1] || (F[1] = (y) => c.value = y),
|
|
1818
|
+
D
|
|
1819
|
+
],
|
|
1820
|
+
disabled: x.disabled,
|
|
1821
|
+
multiple: x.multiple
|
|
1822
|
+
}, {
|
|
1823
|
+
default: L(() => [
|
|
1824
|
+
e("div", ca, [
|
|
1825
|
+
_(f(Ns), {
|
|
1826
|
+
id: f(m),
|
|
1827
|
+
class: V([
|
|
1828
|
+
d.value,
|
|
1829
|
+
x.buttonClass
|
|
1830
|
+
])
|
|
1831
|
+
}, {
|
|
1832
|
+
default: L(() => [
|
|
1833
|
+
e("span", ma, [
|
|
1834
|
+
C.value ? (o(), K(ce(C.value), {
|
|
1835
|
+
key: 0,
|
|
1836
|
+
class: "sl-h-4 sl-w-4 sl-flex-shrink-0",
|
|
1837
|
+
"aria-hidden": "true"
|
|
1838
|
+
})) : b("", !0),
|
|
1839
|
+
k.value ? (o(), r("span", fa, w(k.value), 1)) : (o(), r("span", ga, w(x.placeholder || "Select an option"), 1))
|
|
1840
|
+
]),
|
|
1841
|
+
e("span", pa, [
|
|
1842
|
+
_(f(Qe), {
|
|
1843
|
+
class: "sl-h-5 sl-w-5 sl-text-gray-400",
|
|
1844
|
+
"aria-hidden": "true"
|
|
1845
|
+
})
|
|
1846
|
+
])
|
|
1847
|
+
]),
|
|
1848
|
+
_: 1
|
|
1849
|
+
}, 8, ["id", "class"]),
|
|
1850
|
+
_(xe, {
|
|
1851
|
+
"leave-active-class": "sl-transition sl-duration-100 sl-ease-in",
|
|
1852
|
+
"leave-from-class": "sl-opacity-100",
|
|
1853
|
+
"leave-to-class": "sl-opacity-0"
|
|
1854
|
+
}, {
|
|
1855
|
+
default: L(() => [
|
|
1856
|
+
_(f(Rs), { class: "sl-absolute sl-z-10 sl-mt-1 sl-max-h-56 sl-w-full sl-overflow-auto sl-rounded-md sl-bg-white sl-py-1 sl-text-base sl-shadow-lg sl-ring-1 sl-ring-black sl-ring-opacity-5 focus:sl-outline-none sm:sl-text-sm" }, {
|
|
1857
|
+
default: L(() => [
|
|
1858
|
+
x.multiple && x.showAll ? (o(), r("li", {
|
|
1859
|
+
key: 0,
|
|
1860
|
+
role: "button",
|
|
1861
|
+
tabindex: "0",
|
|
1862
|
+
onMousedown: F[0] || (F[0] = Y(() => {
|
|
1863
|
+
}, ["prevent"])),
|
|
1864
|
+
onClick: Y(I, ["prevent", "stop"]),
|
|
1865
|
+
class: V([
|
|
1866
|
+
"sl-relative sl-cursor-pointer sl-select-none sl-py-2 sl-pl-3 sl-pr-9",
|
|
1867
|
+
"hover:sl-bg-stachelock-600 hover:sl-text-white"
|
|
1868
|
+
])
|
|
1869
|
+
}, [
|
|
1870
|
+
e("span", ha, w(i.value ? "Unselect All" : "Select All"), 1)
|
|
1871
|
+
], 32)) : b("", !0),
|
|
1872
|
+
(o(!0), r(E, null, j(x.items, (y) => (o(), K(f(Us), {
|
|
1873
|
+
key: g(y),
|
|
1874
|
+
value: y,
|
|
1875
|
+
as: "template",
|
|
1876
|
+
disabled: y.disabled
|
|
1877
|
+
}, {
|
|
1878
|
+
default: L(({ active: N, selected: Z }) => [
|
|
1879
|
+
e("li", {
|
|
1880
|
+
class: V([
|
|
1881
|
+
"sl-relative sl-cursor-default sl-select-none sl-py-2 sl-pl-3 sl-pr-9",
|
|
1882
|
+
N ? "sl-bg-stachelock-600 sl-text-white" : "sl-text-gray-900",
|
|
1883
|
+
y.disabled ? "sl-opacity-50 sl-cursor-not-allowed" : ""
|
|
1884
|
+
])
|
|
1885
|
+
}, [
|
|
1886
|
+
e("div", va, [
|
|
1887
|
+
y.icon ? (o(), K(ce(y.icon), {
|
|
1888
|
+
key: 0,
|
|
1889
|
+
class: V(["sl-h-4 sl-w-4 sl-flex-shrink-0", N ? "sl-text-white" : "sl-text-gray-400"]),
|
|
1890
|
+
"aria-hidden": "true"
|
|
1891
|
+
}, null, 8, ["class"])) : b("", !0),
|
|
1892
|
+
e("span", {
|
|
1893
|
+
class: V([
|
|
1894
|
+
"sl-block sl-truncate",
|
|
1895
|
+
Z ? "sl-font-medium" : "sl-font-normal"
|
|
1896
|
+
])
|
|
1897
|
+
}, w(h(y)), 3)
|
|
1898
|
+
]),
|
|
1899
|
+
Z ? (o(), r("span", ya, [
|
|
1900
|
+
_(f(Ge), {
|
|
1901
|
+
class: "sl-h-5 sl-w-5",
|
|
1902
|
+
"aria-hidden": "true"
|
|
1903
|
+
})
|
|
1904
|
+
])) : b("", !0)
|
|
1905
|
+
], 2)
|
|
1906
|
+
]),
|
|
1907
|
+
_: 2
|
|
1908
|
+
}, 1032, ["value", "disabled"]))), 128))
|
|
1909
|
+
]),
|
|
1910
|
+
_: 1
|
|
1911
|
+
})
|
|
1912
|
+
]),
|
|
1913
|
+
_: 1
|
|
1914
|
+
})
|
|
1915
|
+
])
|
|
1916
|
+
]),
|
|
1917
|
+
_: 1
|
|
1918
|
+
}, 8, ["modelValue", "disabled", "multiple"])
|
|
1919
|
+
]),
|
|
1920
|
+
_: 1
|
|
1921
|
+
}, 8, ["id", "name", "label", "disabled", "optional", "tertiary-label", "box-shadow", "error-message", "success-message", "is-valid", "is-touched"])
|
|
1922
|
+
]));
|
|
1923
|
+
}
|
|
1924
|
+
}), xa = { class: "sl-flex sl-items-center sl-gap-4" }, wa = { class: "sl-flex sl-items-center sl-gap-2" }, ka = { class: "sl-w-32" }, _e = /* @__PURE__ */ z({
|
|
1925
|
+
__name: "CalendarHeader",
|
|
1926
|
+
props: {
|
|
1927
|
+
view: {},
|
|
1928
|
+
selectedRange: {}
|
|
1929
|
+
},
|
|
1930
|
+
emits: ["changeRange", "changeView"],
|
|
1931
|
+
setup(t, { emit: l }) {
|
|
1932
|
+
const s = t, a = l, m = [
|
|
1933
|
+
{ id: "day", name: "Day" },
|
|
1934
|
+
{ id: "week", name: "Week" },
|
|
1935
|
+
{ id: "month", name: "Month" },
|
|
1936
|
+
{ id: "year", name: "Year" }
|
|
1937
|
+
], u = P(m.find((v) => v.id === s.view) || m[2]);
|
|
1938
|
+
q(() => s.view, (v) => {
|
|
1939
|
+
const $ = m.find((c) => c.id === v);
|
|
1940
|
+
$ && (u.value = $);
|
|
1941
|
+
}), q(u, (v) => {
|
|
1942
|
+
v && a("changeView", v.id);
|
|
1943
|
+
});
|
|
1944
|
+
const n = () => a("changeRange", "prev"), p = () => a("changeRange", "next");
|
|
1945
|
+
return (v, $) => (o(), r("div", xa, [
|
|
1946
|
+
e("div", wa, [
|
|
1947
|
+
_(X, {
|
|
1948
|
+
size: "sm",
|
|
1949
|
+
theme: "light",
|
|
1950
|
+
outlined: !0,
|
|
1951
|
+
"center-label": "",
|
|
1952
|
+
onButtonClick: n
|
|
1953
|
+
}, {
|
|
1954
|
+
default: L(() => $[1] || ($[1] = [
|
|
1955
|
+
Q("Prev", -1)
|
|
1956
|
+
])),
|
|
1957
|
+
_: 1,
|
|
1958
|
+
__: [1]
|
|
1959
|
+
}),
|
|
1960
|
+
_(X, {
|
|
1961
|
+
size: "sm",
|
|
1962
|
+
theme: "light",
|
|
1963
|
+
outlined: !0,
|
|
1964
|
+
"center-label": "",
|
|
1965
|
+
onButtonClick: p
|
|
1966
|
+
}, {
|
|
1967
|
+
default: L(() => $[2] || ($[2] = [
|
|
1968
|
+
Q("Next", -1)
|
|
1969
|
+
])),
|
|
1970
|
+
_: 1,
|
|
1971
|
+
__: [2]
|
|
1972
|
+
})
|
|
1973
|
+
]),
|
|
1974
|
+
e("div", ka, [
|
|
1975
|
+
_(re, {
|
|
1976
|
+
name: "calendarView",
|
|
1977
|
+
items: m,
|
|
1978
|
+
modelValue: u.value,
|
|
1979
|
+
"onUpdate:modelValue": $[0] || ($[0] = (c) => u.value = c),
|
|
1980
|
+
placeholder: "Select view",
|
|
1981
|
+
"box-shadow": !1
|
|
1982
|
+
}, null, 8, ["modelValue"])
|
|
1983
|
+
])
|
|
1984
|
+
]));
|
|
1985
|
+
}
|
|
1986
|
+
}), $a = { class: "sl-text-center" }, _a = { class: "sl-isolate sl-mt-2 sl-grid sl-grid-cols-7 sl-gap-px sl-rounded-lg sl-bg-gray-200 sl-text-sm sl-shadow sl-ring-1 sl-ring-gray-200" }, Ca = ["onClick", "onDblclick"], Sa = ["datetime"], Ma = {
|
|
1987
|
+
key: 0,
|
|
1988
|
+
class: "sl-absolute sl-top-1 sl-right-1 sl-h-2 sl-w-2 sl-rounded-full sl-bg-stachelock-600"
|
|
1989
|
+
}, Ce = /* @__PURE__ */ z({
|
|
1990
|
+
__name: "MonthCalendar",
|
|
1991
|
+
props: {
|
|
1992
|
+
days: {},
|
|
1993
|
+
events: {}
|
|
1994
|
+
},
|
|
1995
|
+
emits: ["selectDay", "select:event", "doubleSelectDay"],
|
|
1996
|
+
setup(t, { emit: l }) {
|
|
1997
|
+
const s = t, a = l, m = (v) => s.events ? s.events.some(($) => new Date($.datetime || $.start_time || "").toISOString().split("T")[0] === v.date) : !1, u = B(
|
|
1998
|
+
() => s.days.map((v) => ({
|
|
1999
|
+
...v,
|
|
2000
|
+
id: v.id || v.date,
|
|
2001
|
+
hasEvent: m(v)
|
|
2002
|
+
}))
|
|
2003
|
+
), n = (v) => a("selectDay", v), p = (v) => a("doubleSelectDay", v);
|
|
2004
|
+
return (v, $) => (o(), r("div", $a, [
|
|
2005
|
+
$[0] || ($[0] = e("div", { class: "sl-mt-6 sl-grid sl-grid-cols-7 sl-text-xs sl-leading-6 sl-text-gray-500" }, [
|
|
2006
|
+
e("div", null, "S"),
|
|
2007
|
+
e("div", null, "M"),
|
|
2008
|
+
e("div", null, "T"),
|
|
2009
|
+
e("div", null, "W"),
|
|
2010
|
+
e("div", null, "T"),
|
|
2011
|
+
e("div", null, "F"),
|
|
2012
|
+
e("div", null, "S")
|
|
2013
|
+
], -1)),
|
|
2014
|
+
e("div", _a, [
|
|
2015
|
+
(o(!0), r(E, null, j(u.value, (c, d) => (o(), r("button", {
|
|
2016
|
+
key: c.id,
|
|
2017
|
+
type: "button",
|
|
2018
|
+
class: V([
|
|
2019
|
+
"sl-relative sl-py-1.5 hover:sl-bg-gray-100 focus:sl-z-10",
|
|
2020
|
+
c.isCurrentMonth ? "sl-bg-white" : "sl-bg-gray-50",
|
|
2021
|
+
(c.isSelected || c.isToday) && "sl-font-semibold",
|
|
2022
|
+
c.isSelected && "sl-text-white",
|
|
2023
|
+
!c.isSelected && c.isCurrentMonth && !c.isToday && "sl-text-gray-800",
|
|
2024
|
+
!c.isSelected && !c.isCurrentMonth && !c.isToday && "sl-text-gray-400",
|
|
2025
|
+
c.isToday && !c.isSelected && "sl-text-stachelock-600",
|
|
2026
|
+
d === 0 && "sl-rounded-tl-lg",
|
|
2027
|
+
d === 6 && "sl-rounded-tr-lg",
|
|
2028
|
+
d === v.days.length - 7 && "sl-rounded-bl-lg",
|
|
2029
|
+
d === v.days.length - 1 && "sl-rounded-br-lg"
|
|
2030
|
+
]),
|
|
2031
|
+
onClick: (g) => n(c),
|
|
2032
|
+
onDblclick: (g) => p(c)
|
|
2033
|
+
}, [
|
|
2034
|
+
e("time", {
|
|
2035
|
+
datetime: c.date,
|
|
2036
|
+
class: V([
|
|
2037
|
+
"sl-mx-auto sl-flex sl-h-7 sl-w-7 sl-items-center sl-justify-center sl-rounded-full",
|
|
2038
|
+
c.isToday ? "sl-bg-stachelock-600 sl-text-white" : c.isSelected ? "sl-bg-gray-900 sl-text-white" : ""
|
|
2039
|
+
])
|
|
2040
|
+
}, w(((c?.date || "").split("-").pop() || "").replace(/^0/, "")), 11, Sa),
|
|
2041
|
+
c.hasEvent ? (o(), r("span", Ma)) : b("", !0)
|
|
2042
|
+
], 42, Ca))), 128))
|
|
2043
|
+
])
|
|
2044
|
+
]));
|
|
2045
|
+
}
|
|
2046
|
+
}), Ta = ["src"], Ba = {
|
|
2047
|
+
key: 1,
|
|
2048
|
+
class: "sl-h-14 sl-w-14 sl-flex-none sl-rounded-md sl-bg-gray-100 sl-flex sl-items-center sl-justify-center"
|
|
2049
|
+
}, Va = { class: "sl-relative sl-h-8 sl-w-8" }, Aa = { class: "sl-flex-auto" }, La = { class: "sl-font-semibold sl-text-gray-800" }, Ia = { class: "sl-mt-2 sl-flex sl-flex-col xl:sl-flex-row" }, Da = { class: "sl-flex sl-items-start sl-space-x-3" }, Ea = ["datetime"], Pa = { class: "sl-flex sl-items-start sl-space-x-3 sl-mt-2 xl:sl-ml-3.5 xl:sl-mt-0 xl:sl-border-l xl:sl-border-gray-400 xl:sl-border-opacity-50 xl:sl-pl-3.5" }, za = {
|
|
2050
|
+
key: 1,
|
|
2051
|
+
class: "sl-relative sl-h-5 sl-w-5"
|
|
2052
|
+
}, pe = /* @__PURE__ */ z({
|
|
2053
|
+
__name: "EventCard",
|
|
2054
|
+
props: {
|
|
2055
|
+
event: {
|
|
2056
|
+
type: Object,
|
|
2057
|
+
required: !0
|
|
2058
|
+
}
|
|
2059
|
+
},
|
|
2060
|
+
emits: ["navigate-to-event"],
|
|
2061
|
+
setup(t, { emit: l }) {
|
|
2062
|
+
const s = t, a = l, m = () => {
|
|
2063
|
+
a("navigate-to-event", s.event.id);
|
|
2064
|
+
}, u = (n) => new Date(n).toLocaleDateString("en-US", {
|
|
2065
|
+
month: "short",
|
|
2066
|
+
day: "2-digit",
|
|
2067
|
+
year: "numeric"
|
|
2068
|
+
});
|
|
2069
|
+
return (n, p) => (o(), r("li", {
|
|
2070
|
+
class: "sl-relative sl-flex sl-space-x-6 sl-py-6 sl-cursor-pointer",
|
|
2071
|
+
onClick: m
|
|
2072
|
+
}, [
|
|
2073
|
+
t.event.geocodeResult?.thumbnailUrl ? (o(), r("img", {
|
|
2074
|
+
key: 0,
|
|
2075
|
+
src: t.event.geocodeResult.thumbnailUrl,
|
|
2076
|
+
alt: "",
|
|
2077
|
+
class: "sl-h-14 sl-w-14 sl-flex-none sl-rounded-md"
|
|
2078
|
+
}, null, 8, Ta)) : (o(), r("div", Ba, [
|
|
2079
|
+
e("div", Va, [
|
|
2080
|
+
_(f(el), { class: "sl-absolute sl-h-full sl-w-full sl-text-gray-400" }),
|
|
2081
|
+
_(f(sl), { class: "sl-absolute sl-top-1/2 sl-left-1/2 sl-h-5 sl-w-5 -sl-translate-x-1/2 -sl-translate-y-1/2 sl-text-gray-400" })
|
|
2082
|
+
])
|
|
2083
|
+
])),
|
|
2084
|
+
e("div", Aa, [
|
|
2085
|
+
e("h3", La, w(t.event.name), 1),
|
|
2086
|
+
e("dl", Ia, [
|
|
2087
|
+
e("div", Da, [
|
|
2088
|
+
_(f(Xs), {
|
|
2089
|
+
class: "sl-h-5 sl-w-5 sl-text-gray-400",
|
|
2090
|
+
"aria-hidden": "true"
|
|
2091
|
+
}),
|
|
2092
|
+
e("dd", null, [
|
|
2093
|
+
e("time", {
|
|
2094
|
+
datetime: t.event.datetime
|
|
2095
|
+
}, w(u(t.event.date)) + " at " + w(t.event.time), 9, Ea)
|
|
2096
|
+
])
|
|
2097
|
+
]),
|
|
2098
|
+
e("div", Pa, [
|
|
2099
|
+
t.event.geocodeResult ? (o(), K(f(Pe), {
|
|
2100
|
+
key: 0,
|
|
2101
|
+
class: "sl-h-5 sl-w-5 sl-text-gray-400",
|
|
2102
|
+
"aria-hidden": "true"
|
|
2103
|
+
})) : (o(), r("div", za, [
|
|
2104
|
+
_(f(Zs), { class: "sl-absolute sl-h-full sl-w-full sl-text-gray-400" }),
|
|
2105
|
+
_(f(Pe), { class: "sl-absolute sl-top-1/2 sl-left-1/2 sl-h-3 sl-w-3 -sl-translate-x-1/2 -sl-translate-y-1/2 sl-text-gray-400" })
|
|
2106
|
+
])),
|
|
2107
|
+
e("dd", null, w(t.event.location), 1)
|
|
2108
|
+
])
|
|
2109
|
+
])
|
|
2110
|
+
])
|
|
2111
|
+
]));
|
|
2112
|
+
}
|
|
2113
|
+
}), Oa = { class: "sl-relative" }, ja = { class: "sl-flex sl-justify-between sl-items-center sl-mb-4" }, Fa = { class: "sl-text-lg sl-font-bold" }, Na = { key: 0 }, Ra = { class: "sl-divide-y sl-divide-gray-100 sl-text-sm sl-leading-6 sl-mb-8" }, Ua = { key: 1 }, Ha = { class: "sl-text-lg sl-font-bold sl-mb-2" }, Ka = { class: "sl-divide-y sl-divide-gray-100 sl-text-sm sl-leading-6" }, Wa = {
|
|
2114
|
+
key: 2,
|
|
2115
|
+
class: "sl-px-6 sl-py-14 sl-text-center sl-text-sm sm:sl-px-14"
|
|
2116
|
+
}, Se = /* @__PURE__ */ z({
|
|
2117
|
+
__name: "EventsList",
|
|
2118
|
+
props: {
|
|
2119
|
+
events: {},
|
|
2120
|
+
showAllButton: { type: Boolean }
|
|
2121
|
+
},
|
|
2122
|
+
emits: ["show:all"],
|
|
2123
|
+
setup(t, { emit: l }) {
|
|
2124
|
+
const s = t, a = l, m = /* @__PURE__ */ new Date(), u = /* @__PURE__ */ new Date();
|
|
2125
|
+
u.setMonth(m.getMonth() + 3);
|
|
2126
|
+
const n = B(() => !s.events || !Array.isArray(s.events) ? [] : s.events.filter((c) => {
|
|
2127
|
+
const d = new Date(c.datetime);
|
|
2128
|
+
return d >= m && d <= u;
|
|
2129
|
+
}).sort((c, d) => new Date(c.datetime).getTime() - new Date(d.datetime).getTime())), p = B(() => !s.events || !Array.isArray(s.events) ? [] : s.events.filter((c) => new Date(c.datetime) < m).sort((c, d) => new Date(d.datetime).getTime() - new Date(c.datetime).getTime())), v = B(() => {
|
|
2130
|
+
const c = {};
|
|
2131
|
+
return p.value.forEach((d) => {
|
|
2132
|
+
const g = new Date(d.datetime).getFullYear().toString();
|
|
2133
|
+
c[g] || (c[g] = []), c[g].push(d);
|
|
2134
|
+
}), Object.entries(c).sort(([d], [g]) => Number(g) - Number(d)).map(([d, g]) => ({ year: d, events: g }));
|
|
2135
|
+
}), $ = () => a("show:all");
|
|
2136
|
+
return (c, d) => (o(), r("div", Oa, [
|
|
2137
|
+
e("div", ja, [
|
|
2138
|
+
e("h2", Fa, [
|
|
2139
|
+
n.value.length ? (o(), r(E, { key: 0 }, [
|
|
2140
|
+
Q("Upcoming Events")
|
|
2141
|
+
], 64)) : v.value.length ? (o(), r(E, { key: 1 }, [
|
|
2142
|
+
Q("Past Events")
|
|
2143
|
+
], 64)) : (o(), r(E, { key: 2 }, [
|
|
2144
|
+
Q("Events")
|
|
2145
|
+
], 64))
|
|
2146
|
+
]),
|
|
2147
|
+
c.showAllButton ? (o(), K(X, {
|
|
2148
|
+
key: 0,
|
|
2149
|
+
"center-label": "",
|
|
2150
|
+
size: "xs",
|
|
2151
|
+
onButtonClick: $
|
|
2152
|
+
}, {
|
|
2153
|
+
default: L(() => d[0] || (d[0] = [
|
|
2154
|
+
Q(" Show all ", -1)
|
|
2155
|
+
])),
|
|
2156
|
+
_: 1,
|
|
2157
|
+
__: [0]
|
|
2158
|
+
})) : b("", !0)
|
|
2159
|
+
]),
|
|
2160
|
+
n.value.length ? (o(), r("div", Na, [
|
|
2161
|
+
e("ol", Ra, [
|
|
2162
|
+
(o(!0), r(E, null, j(n.value, (g) => (o(), K(pe, {
|
|
2163
|
+
key: g.id,
|
|
2164
|
+
event: g
|
|
2165
|
+
}, null, 8, ["event"]))), 128))
|
|
2166
|
+
])
|
|
2167
|
+
])) : b("", !0),
|
|
2168
|
+
v.value.length ? (o(), r("div", Ua, [
|
|
2169
|
+
(o(!0), r(E, null, j(v.value, (g) => (o(), r("div", {
|
|
2170
|
+
key: g.year,
|
|
2171
|
+
class: "sl-mb-8"
|
|
2172
|
+
}, [
|
|
2173
|
+
e("h2", Ha, w(g.year), 1),
|
|
2174
|
+
d[1] || (d[1] = e("hr", { class: "sl-border-gray-200 sl-mb-4" }, null, -1)),
|
|
2175
|
+
e("ol", Ka, [
|
|
2176
|
+
(o(!0), r(E, null, j(g.events, (h) => (o(), K(pe, {
|
|
2177
|
+
key: h.id,
|
|
2178
|
+
event: h
|
|
2179
|
+
}, null, 8, ["event"]))), 128))
|
|
2180
|
+
])
|
|
2181
|
+
]))), 128))
|
|
2182
|
+
])) : b("", !0),
|
|
2183
|
+
!n.value.length && !v.value.length ? (o(), r("div", Wa, [
|
|
2184
|
+
_(f(zs), {
|
|
2185
|
+
class: "sl-mx-auto sl-h-6 sl-w-6 sl-text-gray-400",
|
|
2186
|
+
"aria-hidden": "true"
|
|
2187
|
+
}),
|
|
2188
|
+
d[2] || (d[2] = e("p", { class: "sl-mt-4 sl-font-semibold sl-text-gray-800" }, "No events", -1)),
|
|
2189
|
+
d[3] || (d[3] = e("p", { class: "sl-mt-2 sl-text-gray-500" }, "Add events to get started!", -1))
|
|
2190
|
+
])) : b("", !0)
|
|
2191
|
+
]));
|
|
2192
|
+
}
|
|
2193
|
+
}), qa = { class: "lg:sl-grid lg:sl-grid-cols-12 lg:sl-gap-x-8" }, Qa = { class: "sl-mt-10 sl-text-center lg:sl-col-start-8 lg:sl-col-end-13 lg:sl-row-start-1 lg:sl-mt-9 xl:sl-col-start-9 xl:sl-col-end-13 sl-h-auto lg:sl-border-l lg:sl-border-gray-100 lg:sl-pl-8 lg:sl-h-full" }, Ga = { class: "sl-mt-4" }, Ja = /* @__PURE__ */ z({
|
|
2194
|
+
__name: "CalendarDashboard",
|
|
2195
|
+
props: {
|
|
2196
|
+
days: {},
|
|
2197
|
+
events: {}
|
|
2198
|
+
},
|
|
2199
|
+
emits: ["selectDay", "doubleSelectDay", "newEvent", "monthChange", "showAll"],
|
|
2200
|
+
setup(t, { emit: l }) {
|
|
2201
|
+
const s = t, a = l, m = P(null), u = B(
|
|
2202
|
+
() => s.events.length !== n.value.length
|
|
2203
|
+
), n = B(() => m.value ? s.events.filter((h) => new Date(h.datetime).toISOString().split("T")[0] === m.value?.date) : s.events), p = (h) => {
|
|
2204
|
+
m.value = h, a("selectDay", h);
|
|
2205
|
+
}, v = (h) => {
|
|
2206
|
+
a("doubleSelectDay", h);
|
|
2207
|
+
}, $ = (h) => {
|
|
2208
|
+
console.log("View changed to:", h);
|
|
2209
|
+
}, c = (h) => {
|
|
2210
|
+
h === "prev" ? a("monthChange", "prev") : h === "next" && a("monthChange", "next");
|
|
2211
|
+
}, d = () => {
|
|
2212
|
+
a("newEvent");
|
|
2213
|
+
}, g = () => {
|
|
2214
|
+
m.value = null, a("showAll");
|
|
2215
|
+
};
|
|
2216
|
+
return (h, k) => (o(), r("div", qa, [
|
|
2217
|
+
e("div", Qa, [
|
|
2218
|
+
_(_e, {
|
|
2219
|
+
view: "month",
|
|
2220
|
+
selectedRange: h.days,
|
|
2221
|
+
onChangeView: $,
|
|
2222
|
+
onChangeRange: c
|
|
2223
|
+
}, null, 8, ["selectedRange"]),
|
|
2224
|
+
_(Ce, {
|
|
2225
|
+
days: h.days,
|
|
2226
|
+
events: h.events,
|
|
2227
|
+
onSelectDay: p,
|
|
2228
|
+
onDoubleSelectDay: v
|
|
2229
|
+
}, null, 8, ["days", "events"]),
|
|
2230
|
+
e("div", Ga, [
|
|
2231
|
+
_(X, {
|
|
2232
|
+
"center-label": "",
|
|
2233
|
+
type: "button",
|
|
2234
|
+
onClick: d,
|
|
2235
|
+
size: "sm",
|
|
2236
|
+
expanded: ""
|
|
2237
|
+
}, {
|
|
2238
|
+
default: L(() => k[0] || (k[0] = [
|
|
2239
|
+
Q(" Add event ", -1)
|
|
2240
|
+
])),
|
|
2241
|
+
_: 1,
|
|
2242
|
+
__: [0]
|
|
2243
|
+
})
|
|
2244
|
+
])
|
|
2245
|
+
]),
|
|
2246
|
+
_(Se, {
|
|
2247
|
+
class: "lg:sl-col-span-7 xl:sl-col-span-8 sl-py-6",
|
|
2248
|
+
events: n.value,
|
|
2249
|
+
"show-all-button": u.value,
|
|
2250
|
+
"onShow:all": g
|
|
2251
|
+
}, null, 8, ["events", "show-all-button"])
|
|
2252
|
+
]));
|
|
2253
|
+
}
|
|
2254
|
+
}), ns = /* @__PURE__ */ oe(Ja, [["__scopeId", "data-v-d92b7279"]]);
|
|
2255
|
+
function rs(t) {
|
|
2256
|
+
const l = new Date(t), s = l.getHours(), a = l.getMinutes(), m = s * 60 + a;
|
|
2257
|
+
return Math.round(m / 5 + 2);
|
|
2258
|
+
}
|
|
2259
|
+
const is = (t, l) => {
|
|
2260
|
+
if (!t || !l) return 1;
|
|
2261
|
+
const s = new Date(t), m = (new Date(l).getTime() - s.getTime()) / (1e3 * 60), u = 1 / 5;
|
|
2262
|
+
return Math.round(m * u);
|
|
2263
|
+
}, ds = (t) => {
|
|
2264
|
+
const l = new Date(t), s = l.getHours(), a = l.getMinutes(), m = s >= 12 ? "PM" : "AM", u = s % 12 || 12, n = a < 10 ? `0${a}` : a;
|
|
2265
|
+
return `${u}:${n} ${m}`;
|
|
2266
|
+
}, Ya = (t, l = "month") => {
|
|
2267
|
+
let s;
|
|
2268
|
+
if (l === "month")
|
|
2269
|
+
switch (t) {
|
|
2270
|
+
case "Monday":
|
|
2271
|
+
s = 1;
|
|
2272
|
+
break;
|
|
2273
|
+
case "Tuesday":
|
|
2274
|
+
s = 2;
|
|
2275
|
+
break;
|
|
2276
|
+
case "Wednesday":
|
|
2277
|
+
s = 3;
|
|
2278
|
+
break;
|
|
2279
|
+
case "Thursday":
|
|
2280
|
+
s = 4;
|
|
2281
|
+
break;
|
|
2282
|
+
case "Friday":
|
|
2283
|
+
s = 5;
|
|
2284
|
+
break;
|
|
2285
|
+
case "Saturday":
|
|
2286
|
+
s = 6;
|
|
2287
|
+
break;
|
|
2288
|
+
case "Sunday":
|
|
2289
|
+
s = 7;
|
|
2290
|
+
break;
|
|
2291
|
+
default:
|
|
2292
|
+
s = 1;
|
|
2293
|
+
}
|
|
2294
|
+
else if (l === "week")
|
|
2295
|
+
switch (t) {
|
|
2296
|
+
case "Sunday":
|
|
2297
|
+
s = 1;
|
|
2298
|
+
break;
|
|
2299
|
+
case "Monday":
|
|
2300
|
+
s = 2;
|
|
2301
|
+
break;
|
|
2302
|
+
case "Tuesday":
|
|
2303
|
+
s = 3;
|
|
2304
|
+
break;
|
|
2305
|
+
case "Wednesday":
|
|
2306
|
+
s = 4;
|
|
2307
|
+
break;
|
|
2308
|
+
case "Thursday":
|
|
2309
|
+
s = 5;
|
|
2310
|
+
break;
|
|
2311
|
+
case "Friday":
|
|
2312
|
+
s = 6;
|
|
2313
|
+
break;
|
|
2314
|
+
case "Saturday":
|
|
2315
|
+
s = 7;
|
|
2316
|
+
break;
|
|
2317
|
+
default:
|
|
2318
|
+
s = 1;
|
|
2319
|
+
}
|
|
2320
|
+
else
|
|
2321
|
+
s = 1;
|
|
2322
|
+
return s;
|
|
2323
|
+
}, Xa = { class: "sl-isolate sl-flex sl-flex-auto sl-overflow-hidden sl-bg-white" }, Za = { class: "sl-grid sl-grid-cols-7 sl-text-sm sl-leading-6 sl-text-gray-500 xl:sl-hidden" }, eo = ["onClick"], so = { class: "sl-flex sl-flex-auto" }, lo = { class: "sl-grid sl-flex-auto sl-grid-cols-1 sl-grid-rows-1" }, to = {
|
|
2324
|
+
class: "sl-col-start-1 sl-col-end-2 sl-row-start-1 sl-grid sl-divide-y sl-divide-gray-100",
|
|
2325
|
+
style: { "grid-template-rows": "repeat(48, minmax(3.5rem, 1fr))" }
|
|
2326
|
+
}, ao = { class: "sl-relative" }, oo = { class: "sl-sticky sl-left-0 sl-z-20 -sl-ml-14 -sl-mt-2.5 sl-w-14 sl-pr-2 sl-text-right sl-text-xs sl-leading-5 sl-text-gray-400" }, no = {
|
|
2327
|
+
class: "sl-col-end-2 sl-row-start-1 sl-grid sl-grid-cols-1",
|
|
2328
|
+
style: { "grid-template-rows": "1.75rem repeat(288, minmax(0, 1fr)) auto" }
|
|
2329
|
+
}, ro = ["onClick"], io = { class: "sl-order-1 sl-font-semibold sl-text-blue-700" }, uo = { class: "sl-text-blue-500 group-hover:sl-text-blue-700" }, co = ["datetime"], us = /* @__PURE__ */ z({
|
|
2330
|
+
__name: "DayCalendar",
|
|
2331
|
+
props: {
|
|
2332
|
+
days: {}
|
|
2333
|
+
},
|
|
2334
|
+
emits: ["selectDay", "select:event"],
|
|
2335
|
+
setup(t, { emit: l }) {
|
|
2336
|
+
const s = t, a = l, m = P(null), u = P(null), n = P(null), p = P(null), v = [
|
|
2337
|
+
"12AM",
|
|
2338
|
+
"1AM",
|
|
2339
|
+
"2AM",
|
|
2340
|
+
"3AM",
|
|
2341
|
+
"4AM",
|
|
2342
|
+
"5AM",
|
|
2343
|
+
"6AM",
|
|
2344
|
+
"7AM",
|
|
2345
|
+
"8AM",
|
|
2346
|
+
"9AM",
|
|
2347
|
+
"10AM",
|
|
2348
|
+
"11AM",
|
|
2349
|
+
"12PM",
|
|
2350
|
+
"1PM",
|
|
2351
|
+
"2PM",
|
|
2352
|
+
"3PM",
|
|
2353
|
+
"4PM",
|
|
2354
|
+
"5PM",
|
|
2355
|
+
"6PM",
|
|
2356
|
+
"7PM",
|
|
2357
|
+
"8PM",
|
|
2358
|
+
"9PM",
|
|
2359
|
+
"10PM",
|
|
2360
|
+
"11PM"
|
|
2361
|
+
], $ = (h) => p.value === h, c = (h) => {
|
|
2362
|
+
p.value = h, a("selectDay", h);
|
|
2363
|
+
}, d = (h) => a("select:event", h), g = B(() => p.value ? [p.value] : s.days);
|
|
2364
|
+
return ne(() => {
|
|
2365
|
+
const h = (/* @__PURE__ */ new Date()).getHours() * 60, k = m.value, C = u.value, A = n.value;
|
|
2366
|
+
k && C && A && (k.scrollTop = (k.scrollHeight - C.offsetHeight - A.offsetHeight) * h / 1440);
|
|
2367
|
+
}), (h, k) => (o(), r(E, null, [
|
|
2368
|
+
e("div", Xa, [
|
|
2369
|
+
e("div", {
|
|
2370
|
+
ref_key: "container",
|
|
2371
|
+
ref: m,
|
|
2372
|
+
class: "sl-flex sl-flex-auto sl-flex-col sl-overflow-auto"
|
|
2373
|
+
}, [
|
|
2374
|
+
e("div", {
|
|
2375
|
+
ref_key: "containerNav",
|
|
2376
|
+
ref: u,
|
|
2377
|
+
class: "sl-sticky sl-top-0 sl-z-10 sl-bg-white sl-text-xs sl-text-gray-500 sl-shadow sl-ring-1 sl-ring-black sl-ring-opacity-5 md:sl-hidden"
|
|
2378
|
+
}, [
|
|
2379
|
+
e("div", Za, [
|
|
2380
|
+
(o(!0), r(E, null, j(h.days, (C) => (o(), r("button", {
|
|
2381
|
+
key: C.date,
|
|
2382
|
+
type: "button",
|
|
2383
|
+
class: "sl-flex sl-flex-col sl-items-center sl-pb-3 sl-pt-2",
|
|
2384
|
+
onClick: (A) => c(C)
|
|
2385
|
+
}, [
|
|
2386
|
+
Q(w(C.shortDay) + " ", 1),
|
|
2387
|
+
e("span", {
|
|
2388
|
+
class: V(["sl-mt-1 sl-flex sl-h-8 sl-w-8 sl-items-center sl-justify-center sl-font-semibold sl-text-gray-800", $(C) ? "sl-rounded-full sl-bg-stachelock-600 sl-font-semibold sl-text-white" : ""])
|
|
2389
|
+
}, w(C.day), 3)
|
|
2390
|
+
], 8, eo))), 128))
|
|
2391
|
+
])
|
|
2392
|
+
], 512),
|
|
2393
|
+
e("div", so, [
|
|
2394
|
+
k[1] || (k[1] = e("div", { class: "sl-w-14 sl-flex-none sl-bg-white sl-ring-1 sl-ring-gray-100" }, null, -1)),
|
|
2395
|
+
e("div", lo, [
|
|
2396
|
+
e("div", to, [
|
|
2397
|
+
e("div", {
|
|
2398
|
+
ref_key: "containerOffset",
|
|
2399
|
+
ref: n,
|
|
2400
|
+
class: "sl-row-end-1 sl-h-7"
|
|
2401
|
+
}, null, 512),
|
|
2402
|
+
(o(), r(E, null, j(v, (C) => (o(), r(E, { key: C }, [
|
|
2403
|
+
e("div", ao, [
|
|
2404
|
+
e("div", oo, w(C), 1)
|
|
2405
|
+
]),
|
|
2406
|
+
k[0] || (k[0] = e("div", null, null, -1))
|
|
2407
|
+
], 64))), 64))
|
|
2408
|
+
]),
|
|
2409
|
+
e("ol", no, [
|
|
2410
|
+
(o(!0), r(E, null, j(g.value, (C) => (o(), r(E, {
|
|
2411
|
+
key: C.date
|
|
2412
|
+
}, [
|
|
2413
|
+
C.events && C.events.length ? (o(!0), r(E, { key: 0 }, j(C.events, (A) => (o(), r("li", {
|
|
2414
|
+
key: A.id,
|
|
2415
|
+
class: "sl-relative sl-mt-px sl-flex",
|
|
2416
|
+
style: le(`grid-row: ${f(rs)(A.datetime)} / span ${f(is)(A.startTime?.dateTime, A.endTime?.dateTime)}`)
|
|
2417
|
+
}, [
|
|
2418
|
+
e("button", {
|
|
2419
|
+
onClick: (D) => d(A.id),
|
|
2420
|
+
class: "sl-justify-start sl-group sl-absolute sl-inset-1 sl-flex sl-flex-col sl-overflow-y-auto sl-rounded-lg sl-bg-blue-50 sl-p-2 sl-text-xs sl-leading-5 hover:sl-bg-blue-100"
|
|
2421
|
+
}, [
|
|
2422
|
+
e("p", io, w(A.name), 1),
|
|
2423
|
+
e("p", uo, [
|
|
2424
|
+
e("time", {
|
|
2425
|
+
datetime: A.datetime
|
|
2426
|
+
}, w(f(ds)(A.datetime)) + " " + w(A.startTime?.shortTimeZone), 9, co)
|
|
2427
|
+
])
|
|
2428
|
+
], 8, ro)
|
|
2429
|
+
], 4))), 128)) : b("", !0)
|
|
2430
|
+
], 64))), 128))
|
|
2431
|
+
])
|
|
2432
|
+
])
|
|
2433
|
+
])
|
|
2434
|
+
], 512)
|
|
2435
|
+
]),
|
|
2436
|
+
k[2] || (k[2] = e("div", { class: "md:sl-block sl-hidden sl-w-1/2 sl-max-w-md sl-flex-none sl-border-l sl-border-gray-100 sl-px-8 sl-py-10" }, null, -1))
|
|
2437
|
+
], 64));
|
|
2438
|
+
}
|
|
2439
|
+
}), mo = {
|
|
2440
|
+
style: { width: "165%" },
|
|
2441
|
+
class: "sl-flex sl-max-w-full sl-flex-none sl-flex-col sm:sl-max-w-none md:sl-max-w-full"
|
|
2442
|
+
}, fo = { class: "sl-grid sl-grid-cols-7 sl-text-sm sl-leading-6 sl-text-gray-500 xl:sl-hidden" }, go = ["onClick"], po = { class: "sl--mr-px sl-hidden sl-grid-cols-7 sl-divide-x sl-divide-gray-100 sl-border-r sl-border-gray-100 sl-text-sm sl-leading-6 sl-text-gray-500 xl:sl-grid" }, ho = { class: "sl-items-center sl-justify-center sl-font-semibold sl-text-gray-800" }, vo = { class: "sl-flex sl-flex-auto" }, yo = { class: "sl-grid sl-flex-auto sl-grid-cols-1 sl-grid-rows-1" }, bo = {
|
|
2443
|
+
class: "sl-col-start-1 sl-col-end-2 sl-row-start-1 sl-grid sl-divide-y sl-divide-gray-100",
|
|
2444
|
+
style: { "grid-template-rows": "repeat(48, minmax(3.5rem, 1fr))" }
|
|
2445
|
+
}, xo = { class: "sl-relative" }, wo = { class: "sl-sticky sl-left-0 sl-z-20 -sl-ml-14 -sl-mt-2.5 sl-w-14 sl-pr-2 sl-text-right sl-text-xs sl-leading-5 sl-text-gray-400" }, ko = { class: "sl-col-start-1 sl-col-end-2 sl-row-start-1 sl-hidden sl-grid-cols-7 sl-grid-rows-1 sl-divide-x sl-divide-gray-100 sm:sl-grid sm:sl-grid-cols-7" }, $o = {
|
|
2446
|
+
class: "sl-col-end-2 sl-row-start-1 sl-grid sl-grid-cols-1 sm:sl-grid-cols-7 sm:sl-pr-8",
|
|
2447
|
+
style: { "grid-template-rows": "1.75rem repeat(288, minmax(0, 1fr)) auto" }
|
|
2448
|
+
}, _o = ["onClick"], Co = { class: "sl-order-1 sl-font-semibold sl-text-blue-700" }, So = { class: "sl-text-blue-500 group-hover:sl-text-blue-700" }, Mo = ["datetime"], cs = /* @__PURE__ */ z({
|
|
2449
|
+
__name: "WeekCalendar",
|
|
2450
|
+
props: {
|
|
2451
|
+
days: {}
|
|
2452
|
+
},
|
|
2453
|
+
emits: ["selectDay", "select:event"],
|
|
2454
|
+
setup(t, { emit: l }) {
|
|
2455
|
+
const s = t, a = l, m = P(null), u = P(null), n = P(null), p = P(null), v = (C) => a("select:event", C), $ = (C) => {
|
|
2456
|
+
p.value = C;
|
|
2457
|
+
}, c = (C) => p.value === C, d = [
|
|
2458
|
+
"12AM",
|
|
2459
|
+
"1AM",
|
|
2460
|
+
"2AM",
|
|
2461
|
+
"3AM",
|
|
2462
|
+
"4AM",
|
|
2463
|
+
"5AM",
|
|
2464
|
+
"6AM",
|
|
2465
|
+
"7AM",
|
|
2466
|
+
"8AM",
|
|
2467
|
+
"9AM",
|
|
2468
|
+
"10AM",
|
|
2469
|
+
"11AM",
|
|
2470
|
+
"12PM",
|
|
2471
|
+
"1PM",
|
|
2472
|
+
"2PM",
|
|
2473
|
+
"3PM",
|
|
2474
|
+
"4PM",
|
|
2475
|
+
"5PM",
|
|
2476
|
+
"6PM",
|
|
2477
|
+
"7PM",
|
|
2478
|
+
"8PM",
|
|
2479
|
+
"9PM",
|
|
2480
|
+
"10PM",
|
|
2481
|
+
"11PM"
|
|
2482
|
+
];
|
|
2483
|
+
ne(() => {
|
|
2484
|
+
const C = (/* @__PURE__ */ new Date()).getHours() * 60, A = m.value, D = u.value, i = n.value;
|
|
2485
|
+
A && D && i && (A.scrollTop = (A.scrollHeight - D.offsetHeight - i.offsetHeight) * C / 1440);
|
|
2486
|
+
});
|
|
2487
|
+
const g = P(window.innerWidth < 768), h = () => {
|
|
2488
|
+
g.value = window.innerWidth < 768;
|
|
2489
|
+
};
|
|
2490
|
+
ne(() => {
|
|
2491
|
+
window.addEventListener("resize", h), q(g, (C) => {
|
|
2492
|
+
if (!C) {
|
|
2493
|
+
const A = k.value.find((D) => (D.events?.length || 0) > 0);
|
|
2494
|
+
A && $(A);
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
}), Ts(() => window.removeEventListener("resize", h));
|
|
2498
|
+
const k = B(() => g.value && p.value ? [p.value] : s.days || []);
|
|
2499
|
+
return (C, A) => (o(), r("div", {
|
|
2500
|
+
ref_key: "container",
|
|
2501
|
+
ref: m,
|
|
2502
|
+
class: "sl-isolate sl-flex sl-flex-auto sl-flex-col sl-overflow-auto sl-bg-white"
|
|
2503
|
+
}, [
|
|
2504
|
+
e("div", mo, [
|
|
2505
|
+
e("div", {
|
|
2506
|
+
ref_key: "containerNav",
|
|
2507
|
+
ref: u,
|
|
2508
|
+
class: "sl-sticky sl-top-0 sl-z-30 sl-flex-none sl-bg-white sl-shadow sl-ring-1 sl-ring-black sl-ring-opacity-5 sm:sl-pr-8"
|
|
2509
|
+
}, [
|
|
2510
|
+
e("div", fo, [
|
|
2511
|
+
(o(!0), r(E, null, j(C.days, (D) => (o(), r("button", {
|
|
2512
|
+
key: D.date,
|
|
2513
|
+
type: "button",
|
|
2514
|
+
class: "sl-flex sl-flex-col sl-items-center sl-pb-3 sl-pt-2",
|
|
2515
|
+
onClick: (i) => $(D)
|
|
2516
|
+
}, [
|
|
2517
|
+
Q(w(D.shortDay) + " ", 1),
|
|
2518
|
+
e("span", {
|
|
2519
|
+
class: V(["sl-mt-1 sl-flex sl-h-8 sl-w-8 sl-items-center sl-justify-center sl-font-semibold sl-text-gray-800", c(D) ? "sl-rounded-full sl-bg-stachelock-600 sl-font-semibold sl-text-white" : ""])
|
|
2520
|
+
}, w(D.day), 3)
|
|
2521
|
+
], 8, go))), 128))
|
|
2522
|
+
]),
|
|
2523
|
+
e("div", po, [
|
|
2524
|
+
A[0] || (A[0] = e("div", { class: "sl-col-end-1 sl-w-14" }, null, -1)),
|
|
2525
|
+
(o(!0), r(E, null, j(C.days, (D) => (o(), r("div", {
|
|
2526
|
+
key: D.date,
|
|
2527
|
+
class: "sl-flex sl-items-center sl-justify-center sl-py-3"
|
|
2528
|
+
}, [
|
|
2529
|
+
e("span", null, [
|
|
2530
|
+
Q(w(D.longDay) + " ", 1),
|
|
2531
|
+
e("span", ho, w(D.day), 1)
|
|
2532
|
+
])
|
|
2533
|
+
]))), 128))
|
|
2534
|
+
])
|
|
2535
|
+
], 512),
|
|
2536
|
+
e("div", vo, [
|
|
2537
|
+
A[2] || (A[2] = e("div", { class: "sl-sticky sl-left-0 sl-z-10 sl-w-14 sl-flex-none sl-bg-white sl-ring-1 sl-ring-gray-100" }, null, -1)),
|
|
2538
|
+
e("div", yo, [
|
|
2539
|
+
e("div", bo, [
|
|
2540
|
+
e("div", {
|
|
2541
|
+
ref_key: "containerOffset",
|
|
2542
|
+
ref: n,
|
|
2543
|
+
class: "sl-row-end-1 sl-h-7"
|
|
2544
|
+
}, null, 512),
|
|
2545
|
+
(o(), r(E, null, j(d, (D) => (o(), r(E, { key: D }, [
|
|
2546
|
+
e("div", xo, [
|
|
2547
|
+
e("div", wo, w(D), 1)
|
|
2548
|
+
]),
|
|
2549
|
+
A[1] || (A[1] = e("div", null, null, -1))
|
|
2550
|
+
], 64))), 64))
|
|
2551
|
+
]),
|
|
2552
|
+
e("div", ko, [
|
|
2553
|
+
(o(!0), r(E, null, j(C.days, (D) => (o(), r("div", {
|
|
2554
|
+
key: D.date,
|
|
2555
|
+
class: "sl-col-start-1 sl-row-span-full"
|
|
2556
|
+
}))), 128))
|
|
2557
|
+
]),
|
|
2558
|
+
e("ol", $o, [
|
|
2559
|
+
(o(!0), r(E, null, j(k.value, (D) => (o(), r(E, {
|
|
2560
|
+
key: D.date
|
|
2561
|
+
}, [
|
|
2562
|
+
D.events && D.events.length && D.longDay ? (o(!0), r(E, { key: 0 }, j(D.events, (i) => (o(), r("li", {
|
|
2563
|
+
key: i.id,
|
|
2564
|
+
class: V(["sl-relative sl-mt-px sl-flex", `sl-col-start-${f(Ya)(D.longDay, "week")}`]),
|
|
2565
|
+
style: le(`grid-row: ${f(rs)(i.datetime)} / span ${f(is)(i.startTime?.dateTime, i.endTime?.dateTime)}`)
|
|
2566
|
+
}, [
|
|
2567
|
+
e("button", {
|
|
2568
|
+
onClick: (I) => v(i.id),
|
|
2569
|
+
class: "sl-group sl-absolute sl-inset-1 sl-flex sl-flex-col sl-overflow-y-auto sl-rounded-lg sl-bg-blue-50 sl-p-2 sl-text-xs sl-leading-5 hover:sl-bg-blue-100"
|
|
2570
|
+
}, [
|
|
2571
|
+
e("p", Co, w(i.name), 1),
|
|
2572
|
+
e("p", So, [
|
|
2573
|
+
e("time", {
|
|
2574
|
+
datetime: i.datetime
|
|
2575
|
+
}, w(f(ds)(i.datetime)) + " " + w(i.startTime?.shortTimeZone), 9, Mo)
|
|
2576
|
+
])
|
|
2577
|
+
], 8, _o)
|
|
2578
|
+
], 6))), 128)) : b("", !0)
|
|
2579
|
+
], 64))), 128))
|
|
2580
|
+
])
|
|
2581
|
+
])
|
|
2582
|
+
])
|
|
2583
|
+
])
|
|
2584
|
+
], 512));
|
|
2585
|
+
}
|
|
2586
|
+
}), To = { class: "sl-grid sl-grid-cols-1 md:sl-grid-cols-2 lg:sl-grid-cols-3 sl-gap-6" }, Bo = { class: "sl-text-sm sl-font-medium sl-mb-2" }, Vo = { class: "sl-grid sl-grid-cols-7 sl-gap-px sl-bg-gray-200 sl-rounded sl-overflow-hidden" }, Ao = { class: "sl-text-[10px] sl-text-gray-500" }, ms = /* @__PURE__ */ z({
|
|
2587
|
+
__name: "YearCalendar",
|
|
2588
|
+
props: {
|
|
2589
|
+
months: {}
|
|
2590
|
+
},
|
|
2591
|
+
setup(t) {
|
|
2592
|
+
return (l, s) => (o(), r("div", To, [
|
|
2593
|
+
(o(!0), r(E, null, j(l.months, (a) => (o(), r("div", {
|
|
2594
|
+
key: a.name,
|
|
2595
|
+
class: "sl-bg-white sl-rounded sl-shadow sl-p-3"
|
|
2596
|
+
}, [
|
|
2597
|
+
e("div", Bo, w(a.name), 1),
|
|
2598
|
+
e("div", Vo, [
|
|
2599
|
+
(o(!0), r(E, null, j(a.days, (m) => (o(), r("div", {
|
|
2600
|
+
key: m.date,
|
|
2601
|
+
class: "sl-bg-white sl-p-1 sl-h-10"
|
|
2602
|
+
}, [
|
|
2603
|
+
e("div", Ao, w(m.day), 1)
|
|
2604
|
+
]))), 128))
|
|
2605
|
+
])
|
|
2606
|
+
]))), 128))
|
|
2607
|
+
]));
|
|
2608
|
+
}
|
|
2609
|
+
}), Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2610
|
+
__proto__: null,
|
|
2611
|
+
CalendarDashboard: ns,
|
|
2612
|
+
CalendarHeader: _e,
|
|
2613
|
+
DayCalendar: us,
|
|
2614
|
+
EventCard: pe,
|
|
2615
|
+
EventsList: Se,
|
|
2616
|
+
MonthCalendar: Ce,
|
|
2617
|
+
WeekCalendar: cs,
|
|
2618
|
+
YearCalendar: ms
|
|
2619
|
+
}, Symbol.toStringTag, { value: "Module" })), Io = {
|
|
2620
|
+
key: 1,
|
|
2621
|
+
class: "sl-p-4 sl-bg-yellow-50 sl-border sl-border-yellow-200 sl-rounded-md"
|
|
2622
|
+
}, Do = { class: "sl-flex" }, Eo = { class: "sl-ml-3" }, Po = { class: "sl-mt-2 sl-text-sm sl-text-yellow-700" }, Me = /* @__PURE__ */ z({
|
|
2623
|
+
__name: "DynamicFormField",
|
|
2624
|
+
props: {
|
|
2625
|
+
field: {},
|
|
2626
|
+
modelValue: {},
|
|
2627
|
+
formData: {}
|
|
2628
|
+
},
|
|
2629
|
+
emits: ["update:modelValue", "field-change"],
|
|
2630
|
+
setup(t, { emit: l }) {
|
|
2631
|
+
const s = t, a = l, m = {
|
|
2632
|
+
text: () => Promise.resolve(J),
|
|
2633
|
+
email: () => Promise.resolve(J),
|
|
2634
|
+
password: () => Promise.resolve(J),
|
|
2635
|
+
number: () => Promise.resolve(J),
|
|
2636
|
+
tel: () => Promise.resolve(J),
|
|
2637
|
+
url: () => Promise.resolve(J),
|
|
2638
|
+
textarea: () => import("./TextAreaInput-Di6Kstic.js"),
|
|
2639
|
+
select: () => import("./SelectInput-B5liNv7H.js"),
|
|
2640
|
+
combobox: () => import("./ComboboxInput-B98P_8CZ.js"),
|
|
2641
|
+
checkbox: () => import("./CheckboxInput-rWkcde69.js"),
|
|
2642
|
+
switch: () => import("./SwitchInput-D1k9O8gn.js")
|
|
2643
|
+
}, u = B(() => {
|
|
2644
|
+
const d = m[s.field.type];
|
|
2645
|
+
return d ? we({
|
|
2646
|
+
loader: d,
|
|
2647
|
+
errorComponent: () => null,
|
|
2648
|
+
delay: 0
|
|
2649
|
+
}) : null;
|
|
2650
|
+
}), n = B({
|
|
2651
|
+
get: () => s.modelValue ?? s.field.defaultValue ?? $(),
|
|
2652
|
+
set: (d) => {
|
|
2653
|
+
a("update:modelValue", d), a("field-change", s.field, d);
|
|
2654
|
+
}
|
|
2655
|
+
}), p = B(() => {
|
|
2656
|
+
const d = {
|
|
2657
|
+
name: s.field.name,
|
|
2658
|
+
label: s.field.label,
|
|
2659
|
+
placeholder: s.field.placeholder,
|
|
2660
|
+
disabled: s.field.disabled,
|
|
2661
|
+
rules: s.field.validation,
|
|
2662
|
+
validateOnMount: s.field.validateOnMount,
|
|
2663
|
+
tertiaryLabel: s.field.tertiaryLabel,
|
|
2664
|
+
successMessage: s.field.successMessage
|
|
2665
|
+
};
|
|
2666
|
+
switch (s.field.type) {
|
|
2667
|
+
case "text":
|
|
2668
|
+
case "email":
|
|
2669
|
+
case "password":
|
|
2670
|
+
case "number":
|
|
2671
|
+
case "tel":
|
|
2672
|
+
case "url":
|
|
2673
|
+
return {
|
|
2674
|
+
...d,
|
|
2675
|
+
type: s.field.inputType || s.field.type,
|
|
2676
|
+
maxlength: s.field.maxLength,
|
|
2677
|
+
minlength: s.field.minLength,
|
|
2678
|
+
min: s.field.min,
|
|
2679
|
+
max: s.field.max,
|
|
2680
|
+
step: s.field.step,
|
|
2681
|
+
spellcheck: s.field.spellcheck,
|
|
2682
|
+
autocomplete: s.field.autocomplete
|
|
2683
|
+
};
|
|
2684
|
+
case "textarea":
|
|
2685
|
+
return {
|
|
2686
|
+
...d,
|
|
2687
|
+
rows: s.field.rows,
|
|
2688
|
+
maxlength: s.field.maxLength,
|
|
2689
|
+
spellcheck: s.field.spellcheck
|
|
2690
|
+
};
|
|
2691
|
+
case "select":
|
|
2692
|
+
return {
|
|
2693
|
+
...d,
|
|
2694
|
+
items: s.field.options || [],
|
|
2695
|
+
multiple: s.field.multiple,
|
|
2696
|
+
itemKey: s.field.optionKey || "value",
|
|
2697
|
+
itemText: s.field.optionLabel || "label",
|
|
2698
|
+
showAll: s.field.showSelectAll
|
|
2699
|
+
};
|
|
2700
|
+
case "combobox":
|
|
2701
|
+
return {
|
|
2702
|
+
...d,
|
|
2703
|
+
items: s.field.options || [],
|
|
2704
|
+
itemKey: s.field.optionKey || "value",
|
|
2705
|
+
itemText: s.field.optionLabel || "label",
|
|
2706
|
+
customQuery: s.field.customQuery,
|
|
2707
|
+
loading: s.field.loading
|
|
2708
|
+
};
|
|
2709
|
+
case "checkbox":
|
|
2710
|
+
return {
|
|
2711
|
+
...d,
|
|
2712
|
+
description: s.field.description,
|
|
2713
|
+
immediate: s.field.immediate ?? !0,
|
|
2714
|
+
isDescriptionHtml: s.field.isDescriptionHtml
|
|
2715
|
+
};
|
|
2716
|
+
case "switch":
|
|
2717
|
+
return {
|
|
2718
|
+
...d,
|
|
2719
|
+
description: s.field.description,
|
|
2720
|
+
immediate: s.field.immediate ?? !0,
|
|
2721
|
+
boxShadow: s.field.boxShadow,
|
|
2722
|
+
hideMainLabel: s.field.hideMainLabel,
|
|
2723
|
+
textTrue: s.field.textTrue,
|
|
2724
|
+
textFalse: s.field.textFalse
|
|
2725
|
+
};
|
|
2726
|
+
default:
|
|
2727
|
+
return d;
|
|
2728
|
+
}
|
|
2729
|
+
}), v = B(() => {
|
|
2730
|
+
const d = {};
|
|
2731
|
+
return s.field.onBlur && (d.blur = s.field.onBlur), s.field.onFocus && (d.focus = s.field.onFocus), s.field.onChange && (d["update:modelValue"] = (g) => {
|
|
2732
|
+
n.value = g, s.field.onChange?.(g, s.field, s.formData ?? {});
|
|
2733
|
+
}), d;
|
|
2734
|
+
}), $ = () => {
|
|
2735
|
+
switch (s.field.type) {
|
|
2736
|
+
case "checkbox":
|
|
2737
|
+
case "switch":
|
|
2738
|
+
return !1;
|
|
2739
|
+
case "select":
|
|
2740
|
+
return s.field.multiple ? [] : null;
|
|
2741
|
+
case "number":
|
|
2742
|
+
return s.field.min || 0;
|
|
2743
|
+
default:
|
|
2744
|
+
return "";
|
|
2745
|
+
}
|
|
2746
|
+
}, c = (d) => {
|
|
2747
|
+
n.value = d;
|
|
2748
|
+
};
|
|
2749
|
+
return (d, g) => u.value ? (o(), K(ce(u.value), he({ key: 0 }, p.value, Bs(v.value), {
|
|
2750
|
+
"model-value": n.value,
|
|
2751
|
+
"onUpdate:modelValue": c
|
|
2752
|
+
}), null, 16, ["model-value"])) : (o(), r("div", Io, [
|
|
2753
|
+
e("div", Do, [
|
|
2754
|
+
_(f(ll), { class: "sl-h-5 sl-w-5 sl-text-yellow-400" }),
|
|
2755
|
+
e("div", Eo, [
|
|
2756
|
+
g[0] || (g[0] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-yellow-800" }, " Unknown field type ", -1)),
|
|
2757
|
+
e("div", Po, [
|
|
2758
|
+
e("p", null, 'Field type "' + w(d.field.type) + '" is not supported.', 1)
|
|
2759
|
+
])
|
|
2760
|
+
])
|
|
2761
|
+
])
|
|
2762
|
+
]));
|
|
2763
|
+
}
|
|
2764
|
+
}), zo = {
|
|
2765
|
+
key: 0,
|
|
2766
|
+
class: "sl-mb-6"
|
|
2767
|
+
}, Oo = {
|
|
2768
|
+
key: 0,
|
|
2769
|
+
class: "sl-text-lg sl-font-semibold sl-text-gray-900 sl-mb-2"
|
|
2770
|
+
}, jo = {
|
|
2771
|
+
key: 1,
|
|
2772
|
+
class: "sl-text-sm sl-text-gray-600"
|
|
2773
|
+
}, Fo = {
|
|
2774
|
+
key: 0,
|
|
2775
|
+
class: "sl-mb-4"
|
|
2776
|
+
}, No = {
|
|
2777
|
+
key: 0,
|
|
2778
|
+
class: "sl-text-md sl-font-medium sl-text-gray-900 sl-mb-1"
|
|
2779
|
+
}, Ro = {
|
|
2780
|
+
key: 1,
|
|
2781
|
+
class: "sl-text-sm sl-text-gray-600"
|
|
2782
|
+
}, Uo = {
|
|
2783
|
+
key: 2,
|
|
2784
|
+
class: "sl-mt-4"
|
|
2785
|
+
}, Ho = { class: "sl-bg-red-50 sl-border sl-border-red-200 sl-rounded-md sl-p-4" }, Ko = { class: "sl-flex" }, Wo = { class: "sl-ml-3" }, qo = { class: "sl-mt-2 sl-text-sm sl-text-red-700" }, fs = /* @__PURE__ */ z({
|
|
2786
|
+
__name: "DynamicForm",
|
|
2787
|
+
props: {
|
|
2788
|
+
schema: {},
|
|
2789
|
+
modelValue: {},
|
|
2790
|
+
loading: { type: Boolean },
|
|
2791
|
+
showActions: { type: Boolean, default: !0 },
|
|
2792
|
+
showCancelButton: { type: Boolean, default: !1 },
|
|
2793
|
+
submitButtonText: {},
|
|
2794
|
+
cancelButtonText: {},
|
|
2795
|
+
submitButtonVariant: { default: "primary" },
|
|
2796
|
+
actionsAlignment: { default: "right" },
|
|
2797
|
+
formError: {}
|
|
2798
|
+
},
|
|
2799
|
+
emits: ["update:modelValue", "submit", "cancel", "field-change"],
|
|
2800
|
+
setup(t, { expose: l, emit: s }) {
|
|
2801
|
+
const a = t, m = s, u = P(), n = qe({}), { handleSubmit: p, setErrors: v, meta: $ } = Ls({
|
|
2802
|
+
keepValuesOnUnmount: !0
|
|
2803
|
+
}), c = () => {
|
|
2804
|
+
const M = { ...a.modelValue };
|
|
2805
|
+
a.schema.sections.forEach((U) => {
|
|
2806
|
+
U.fields.forEach((H) => {
|
|
2807
|
+
H.name in M || (M[H.name] = H.defaultValue ?? D(H.type));
|
|
2808
|
+
});
|
|
2809
|
+
}), Object.assign(n, M);
|
|
2810
|
+
};
|
|
2811
|
+
q(
|
|
2812
|
+
() => a.modelValue,
|
|
2813
|
+
(M) => {
|
|
2814
|
+
M && Object.assign(n, M);
|
|
2815
|
+
},
|
|
2816
|
+
{ deep: !0 }
|
|
2817
|
+
), q(
|
|
2818
|
+
n,
|
|
2819
|
+
(M) => {
|
|
2820
|
+
m("update:modelValue", { ...M });
|
|
2821
|
+
},
|
|
2822
|
+
{ deep: !0 }
|
|
2823
|
+
), c();
|
|
2824
|
+
const d = B(() => a.schema.sections.filter(
|
|
2825
|
+
(M) => M.condition ? M.condition(n) : !0
|
|
2826
|
+
)), g = B(() => {
|
|
2827
|
+
const M = ["sl-space-y-6"];
|
|
2828
|
+
return a.schema.className && M.push(a.schema.className), M.join(" ");
|
|
2829
|
+
}), h = (M) => {
|
|
2830
|
+
const U = [
|
|
2831
|
+
"sl-grid",
|
|
2832
|
+
"sl-gap-4"
|
|
2833
|
+
], H = M.columns || 1;
|
|
2834
|
+
return U.push("sl-grid-cols-1"), H > 1 && U.push(`md:sl-grid-cols-${Math.min(H, 3)}`), M.className && U.push(M.className), U.join(" ");
|
|
2835
|
+
}, k = (M) => {
|
|
2836
|
+
const U = [];
|
|
2837
|
+
return M.colSpan && M.colSpan > 1 && U.push(`sl-col-span-${Math.min(M.colSpan, 3)}`), M.className && U.push(M.className), U.join(" ");
|
|
2838
|
+
}, C = (M) => M.condition ? M.condition(n, M) : !0, A = B(() => $.value.valid), D = (M) => {
|
|
2839
|
+
switch (M) {
|
|
2840
|
+
case "checkbox":
|
|
2841
|
+
case "switch":
|
|
2842
|
+
return !1;
|
|
2843
|
+
case "select":
|
|
2844
|
+
return null;
|
|
2845
|
+
case "number":
|
|
2846
|
+
return 0;
|
|
2847
|
+
default:
|
|
2848
|
+
return "";
|
|
2849
|
+
}
|
|
2850
|
+
}, i = p((M) => {
|
|
2851
|
+
m("submit", M, { setErrors: v });
|
|
2852
|
+
}), I = () => {
|
|
2853
|
+
m("cancel");
|
|
2854
|
+
}, x = (M, U) => {
|
|
2855
|
+
m("field-change", M, U, n), M.onFieldChange && M.onFieldChange(U, M, n);
|
|
2856
|
+
};
|
|
2857
|
+
return l({
|
|
2858
|
+
validate: async () => $.value.valid,
|
|
2859
|
+
reset: () => {
|
|
2860
|
+
Object.keys(n).forEach((M) => {
|
|
2861
|
+
delete n[M];
|
|
2862
|
+
}), c();
|
|
2863
|
+
},
|
|
2864
|
+
setFieldValue: (M, U) => {
|
|
2865
|
+
n[M] = U;
|
|
2866
|
+
},
|
|
2867
|
+
getFieldValue: (M) => n[M],
|
|
2868
|
+
formData: n,
|
|
2869
|
+
formRef: u
|
|
2870
|
+
}), (M, U) => (o(), r("form", {
|
|
2871
|
+
ref_key: "formRef",
|
|
2872
|
+
ref: u,
|
|
2873
|
+
class: V(g.value),
|
|
2874
|
+
onSubmit: U[0] || (U[0] = Y(
|
|
2875
|
+
//@ts-ignore
|
|
2876
|
+
(...H) => f(i) && f(i)(...H),
|
|
2877
|
+
["prevent"]
|
|
2878
|
+
))
|
|
2879
|
+
}, [
|
|
2880
|
+
M.schema.title || M.schema.description ? (o(), r("div", zo, [
|
|
2881
|
+
M.schema.title ? (o(), r("h2", Oo, w(M.schema.title), 1)) : b("", !0),
|
|
2882
|
+
M.schema.description ? (o(), r("p", jo, w(M.schema.description), 1)) : b("", !0)
|
|
2883
|
+
])) : b("", !0),
|
|
2884
|
+
(o(!0), r(E, null, j(d.value, (H, O) => (o(), r("div", {
|
|
2885
|
+
key: H.id || O
|
|
2886
|
+
}, [
|
|
2887
|
+
H.title || H.description ? (o(), r("div", Fo, [
|
|
2888
|
+
H.title ? (o(), r("h3", No, w(H.title), 1)) : b("", !0),
|
|
2889
|
+
H.description ? (o(), r("p", Ro, w(H.description), 1)) : b("", !0)
|
|
2890
|
+
])) : b("", !0),
|
|
2891
|
+
e("div", {
|
|
2892
|
+
class: V(h(H))
|
|
2893
|
+
}, [
|
|
2894
|
+
(o(!0), r(E, null, j(H.fields, (R) => (o(), r("div", {
|
|
2895
|
+
key: R.name,
|
|
2896
|
+
class: V(k(R))
|
|
2897
|
+
}, [
|
|
2898
|
+
C(R) ? (o(), K(Me, {
|
|
2899
|
+
key: 0,
|
|
2900
|
+
field: R,
|
|
2901
|
+
modelValue: n[R.name],
|
|
2902
|
+
"onUpdate:modelValue": (ie) => n[R.name] = ie,
|
|
2903
|
+
"form-data": n,
|
|
2904
|
+
onFieldChange: x
|
|
2905
|
+
}, null, 8, ["field", "modelValue", "onUpdate:modelValue", "form-data"])) : b("", !0)
|
|
2906
|
+
], 2))), 128))
|
|
2907
|
+
], 2)
|
|
2908
|
+
]))), 128)),
|
|
2909
|
+
M.showActions ? (o(), r("div", {
|
|
2910
|
+
key: 1,
|
|
2911
|
+
class: V([
|
|
2912
|
+
"sl-flex sl-gap-3",
|
|
2913
|
+
M.actionsAlignment === "center" ? "sl-justify-center" : M.actionsAlignment === "right" ? "sl-justify-end" : "sl-justify-start"
|
|
2914
|
+
])
|
|
2915
|
+
}, [
|
|
2916
|
+
M.showCancelButton ? (o(), K(X, {
|
|
2917
|
+
key: 0,
|
|
2918
|
+
variant: "outline",
|
|
2919
|
+
disabled: M.loading,
|
|
2920
|
+
type: "button",
|
|
2921
|
+
onClick: I
|
|
2922
|
+
}, {
|
|
2923
|
+
default: L(() => [
|
|
2924
|
+
Q(w(M.cancelButtonText || "Cancel"), 1)
|
|
2925
|
+
]),
|
|
2926
|
+
_: 1
|
|
2927
|
+
}, 8, ["disabled"])) : b("", !0),
|
|
2928
|
+
_(X, {
|
|
2929
|
+
variant: M.submitButtonVariant,
|
|
2930
|
+
loading: M.loading,
|
|
2931
|
+
disabled: !A.value || M.loading,
|
|
2932
|
+
type: "submit"
|
|
2933
|
+
}, {
|
|
2934
|
+
default: L(() => [
|
|
2935
|
+
Q(w(M.submitButtonText || "Submit"), 1)
|
|
2936
|
+
]),
|
|
2937
|
+
_: 1
|
|
2938
|
+
}, 8, ["variant", "loading", "disabled"])
|
|
2939
|
+
], 2)) : b("", !0),
|
|
2940
|
+
M.formError ? (o(), r("div", Uo, [
|
|
2941
|
+
e("div", Ho, [
|
|
2942
|
+
e("div", Ko, [
|
|
2943
|
+
_(f(tl), { class: "sl-h-5 sl-w-5 sl-text-red-400" }),
|
|
2944
|
+
e("div", Wo, [
|
|
2945
|
+
U[1] || (U[1] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-red-800" }, " Form Error ", -1)),
|
|
2946
|
+
e("div", qo, [
|
|
2947
|
+
e("p", null, w(M.formError), 1)
|
|
2948
|
+
])
|
|
2949
|
+
])
|
|
2950
|
+
])
|
|
2951
|
+
])
|
|
2952
|
+
])) : b("", !0)
|
|
2953
|
+
], 34));
|
|
2954
|
+
}
|
|
2955
|
+
}), Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2956
|
+
__proto__: null,
|
|
2957
|
+
DynamicForm: fs,
|
|
2958
|
+
FormField: Me,
|
|
2959
|
+
FormFieldWrapper: ee
|
|
2960
|
+
}, Symbol.toStringTag, { value: "Module" })), Go = { class: "sl-w-full" }, Jo = { class: "sl-flex sl-items-start sl-gap-3" }, Yo = { class: "sl-flex sl-h-6 sl-shrink-0 sl-items-center" }, Xo = { class: "sl-group group sl-grid sl-w-4 sl-h-4 sl-grid-cols-1" }, Zo = ["id", "aria-describedby", "name", "disabled"], en = { class: "sl-flex-1 sl-text-sm sl-leading-6" }, sn = ["for"], ln = ["id"], tn = ["innerHTML"], an = { key: 1 }, Te = /* @__PURE__ */ z({
|
|
2961
|
+
__name: "CheckboxInput",
|
|
2962
|
+
props: {
|
|
2963
|
+
name: {},
|
|
2964
|
+
label: {},
|
|
2965
|
+
description: {},
|
|
2966
|
+
disabled: { type: Boolean },
|
|
2967
|
+
rules: {},
|
|
2968
|
+
immediate: { type: Boolean, default: !0 },
|
|
2969
|
+
isDescriptionHtml: { type: Boolean, default: !1 },
|
|
2970
|
+
successMessage: {},
|
|
2971
|
+
modelValue: { type: Boolean },
|
|
2972
|
+
tertiaryLabel: {},
|
|
2973
|
+
showErrors: { type: Boolean, default: !1 },
|
|
2974
|
+
layout: { default: "stacked" },
|
|
2975
|
+
boxShadow: { type: Boolean, default: !1 }
|
|
2976
|
+
},
|
|
2977
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
2978
|
+
setup(t, { expose: l, emit: s }) {
|
|
2979
|
+
const a = t, m = s, u = P(), n = P(null), p = ae(`sl-${a.name}`), { value: v, errorMessage: $, handleChange: c, handleBlur: d, meta: g } = te(
|
|
2980
|
+
() => a.name,
|
|
2981
|
+
a.rules,
|
|
2982
|
+
{
|
|
2983
|
+
type: "checkbox",
|
|
2984
|
+
initialValue: a.modelValue || !1
|
|
2985
|
+
}
|
|
2986
|
+
), h = P(a.modelValue || !1);
|
|
2987
|
+
q(
|
|
2988
|
+
() => a.modelValue,
|
|
2989
|
+
(y) => {
|
|
2990
|
+
y !== void 0 && y !== h.value && (h.value = y, v.value = y);
|
|
2991
|
+
},
|
|
2992
|
+
{ immediate: !0 }
|
|
2993
|
+
), q(
|
|
2994
|
+
h,
|
|
2995
|
+
(y) => {
|
|
2996
|
+
m("update:modelValue", y), a.immediate && c(y);
|
|
2997
|
+
}
|
|
2998
|
+
);
|
|
2999
|
+
const k = B(() => {
|
|
3000
|
+
const y = [
|
|
3001
|
+
"sl-h-4",
|
|
3002
|
+
"sl-w-4",
|
|
3003
|
+
"sl-rounded",
|
|
3004
|
+
"sl-border-gray-300",
|
|
3005
|
+
"sl-text-stachelock-600",
|
|
3006
|
+
"focus:sl-ring-stachelock-600",
|
|
3007
|
+
"focus:sl-ring-2",
|
|
3008
|
+
"focus:sl-ring-offset-2",
|
|
3009
|
+
"sl-transition-all",
|
|
3010
|
+
"sl-duration-200"
|
|
3011
|
+
];
|
|
3012
|
+
return a.disabled ? y.push(
|
|
3013
|
+
"sl-cursor-not-allowed",
|
|
3014
|
+
"sl-opacity-50",
|
|
3015
|
+
"sl-bg-gray-50"
|
|
3016
|
+
) : y.push(
|
|
3017
|
+
"sl-cursor-pointer",
|
|
3018
|
+
"hover:sl-border-gray-400"
|
|
3019
|
+
), $.value ? y.push(
|
|
3020
|
+
"sl-border-red-300",
|
|
3021
|
+
"focus:sl-ring-red-600"
|
|
3022
|
+
) : g.valid && g.touched && y.push(
|
|
3023
|
+
"sl-border-green-300",
|
|
3024
|
+
"focus:sl-ring-green-500"
|
|
3025
|
+
), y.join(" ");
|
|
3026
|
+
}), C = (y) => {
|
|
3027
|
+
const N = y.target;
|
|
3028
|
+
h.value = N.checked, a.immediate || c(N.checked);
|
|
3029
|
+
}, A = () => {
|
|
3030
|
+
a.disabled || (h.value = !h.value);
|
|
3031
|
+
}, D = () => {
|
|
3032
|
+
u.value?.focus();
|
|
3033
|
+
}, i = () => {
|
|
3034
|
+
u.value?.blur();
|
|
3035
|
+
}, I = (y) => {
|
|
3036
|
+
a.immediate || c(h.value), d(y), m("blur", y);
|
|
3037
|
+
}, x = (y) => {
|
|
3038
|
+
m("focus", y);
|
|
3039
|
+
}, F = (y) => {
|
|
3040
|
+
a.disabled || y.target.tagName === "A" || A();
|
|
3041
|
+
};
|
|
3042
|
+
return l({
|
|
3043
|
+
focus: D,
|
|
3044
|
+
blur: i,
|
|
3045
|
+
toggle: A,
|
|
3046
|
+
checkboxRef: u
|
|
3047
|
+
}), (y, N) => (o(), r("div", Go, [
|
|
3048
|
+
_(ee, {
|
|
3049
|
+
id: f(p),
|
|
3050
|
+
name: y.name,
|
|
3051
|
+
label: y.layout === "stacked" ? y.label : "",
|
|
3052
|
+
disabled: y.disabled,
|
|
3053
|
+
optional: !y.rules,
|
|
3054
|
+
"tertiary-label": y.tertiaryLabel,
|
|
3055
|
+
"box-shadow": y.boxShadow,
|
|
3056
|
+
"error-message": f($),
|
|
3057
|
+
"success-message": y.successMessage,
|
|
3058
|
+
"is-valid": f(g).valid,
|
|
3059
|
+
"is-touched": f(g).touched,
|
|
3060
|
+
"show-errors": y.showErrors
|
|
3061
|
+
}, {
|
|
3062
|
+
default: L(() => [
|
|
3063
|
+
e("div", Jo, [
|
|
3064
|
+
e("div", Yo, [
|
|
3065
|
+
e("div", Xo, [
|
|
3066
|
+
me(e("input", {
|
|
3067
|
+
id: f(p),
|
|
3068
|
+
"aria-describedby": y.description ? `${f(p)}-description` : void 0,
|
|
3069
|
+
name: y.name,
|
|
3070
|
+
ref_key: "checkboxRef",
|
|
3071
|
+
ref: u,
|
|
3072
|
+
"onUpdate:modelValue": N[0] || (N[0] = (Z) => h.value = Z),
|
|
3073
|
+
type: "checkbox",
|
|
3074
|
+
disabled: y.disabled,
|
|
3075
|
+
class: V([
|
|
3076
|
+
"sl-col-start-1 sl-row-start-1 sl-w-full sl-h-full sl-appearance-none sl-rounded sl-border sl-border-gray-300 sl-bg-white",
|
|
3077
|
+
"checked:sl-border-stachelock-600 checked:sl-bg-stachelock-600",
|
|
3078
|
+
"indeterminate:sl-border-stachelock-600 indeterminate:sl-bg-stachelock-600",
|
|
3079
|
+
"focus-visible:sl-outline focus-visible:sl-outline-2 focus-visible:sl-outline-offset-2 focus-visible:sl-outline-stachelock-600",
|
|
3080
|
+
"disabled:sl-border-gray-300 disabled:sl-bg-gray-100 disabled:checked:sl-bg-gray-100",
|
|
3081
|
+
k.value
|
|
3082
|
+
]),
|
|
3083
|
+
onChange: C,
|
|
3084
|
+
onFocus: x,
|
|
3085
|
+
onBlur: I
|
|
3086
|
+
}, null, 42, Zo), [
|
|
3087
|
+
[Vs, h.value]
|
|
3088
|
+
]),
|
|
3089
|
+
N[1] || (N[1] = e("svg", {
|
|
3090
|
+
class: "sl-pointer-events-none sl-col-start-1 sl-row-start-1 sl-w-3.5 sl-h-3.5 sl-self-center sl-justify-self-center sl-stroke-white",
|
|
3091
|
+
viewBox: "0 0 14 14",
|
|
3092
|
+
fill: "none"
|
|
3093
|
+
}, [
|
|
3094
|
+
e("path", {
|
|
3095
|
+
class: "sl-opacity-0 group-has-[:checked]:sl-opacity-100",
|
|
3096
|
+
d: "M3 8L6 11L11 3.5",
|
|
3097
|
+
"stroke-width": "2",
|
|
3098
|
+
"stroke-linecap": "round",
|
|
3099
|
+
"stroke-linejoin": "round"
|
|
3100
|
+
}),
|
|
3101
|
+
e("path", {
|
|
3102
|
+
class: "sl-opacity-0 group-has-[:indeterminate]:sl-opacity-100",
|
|
3103
|
+
d: "M3 7H11",
|
|
3104
|
+
"stroke-width": "2",
|
|
3105
|
+
"stroke-linecap": "round",
|
|
3106
|
+
"stroke-linejoin": "round"
|
|
3107
|
+
})
|
|
3108
|
+
], -1))
|
|
3109
|
+
])
|
|
3110
|
+
]),
|
|
3111
|
+
e("div", en, [
|
|
3112
|
+
y.layout === "inline" && y.label ? (o(), r("label", {
|
|
3113
|
+
key: 0,
|
|
3114
|
+
for: f(p),
|
|
3115
|
+
class: "sl-font-medium sl-text-gray-900 sl-cursor-pointer"
|
|
3116
|
+
}, w(y.label), 9, sn)) : b("", !0),
|
|
3117
|
+
y.description ? (o(), r("div", {
|
|
3118
|
+
key: 1,
|
|
3119
|
+
id: `${f(p)}-description`,
|
|
3120
|
+
class: V(["sl-text-gray-600", [y.layout === "inline" ? "" : "sl-mt-1", { "sl-cursor-pointer": !y.disabled }]]),
|
|
3121
|
+
ref_key: "descriptionHtml",
|
|
3122
|
+
ref: n,
|
|
3123
|
+
onClick: F
|
|
3124
|
+
}, [
|
|
3125
|
+
y.isDescriptionHtml ? (o(), r("div", {
|
|
3126
|
+
key: 0,
|
|
3127
|
+
innerHTML: y.description
|
|
3128
|
+
}, null, 8, tn)) : (o(), r("span", an, w(y.description), 1))
|
|
3129
|
+
], 10, ln)) : b("", !0)
|
|
3130
|
+
])
|
|
3131
|
+
])
|
|
3132
|
+
]),
|
|
3133
|
+
_: 1
|
|
3134
|
+
}, 8, ["id", "name", "label", "disabled", "optional", "tertiary-label", "box-shadow", "error-message", "success-message", "is-valid", "is-touched", "show-errors"])
|
|
3135
|
+
]));
|
|
3136
|
+
}
|
|
3137
|
+
}), on = { class: "sl-w-full" }, nn = { class: "sl-block sl-truncate sl-font-medium" }, rn = {
|
|
3138
|
+
key: 1,
|
|
3139
|
+
class: "sl-relative sl-cursor-default sl-select-none sl-py-2 sl-px-4 sl-text-gray-700"
|
|
3140
|
+
}, dn = { class: "sl-flex sl-items-center sl-gap-2" }, un = {
|
|
3141
|
+
key: 2,
|
|
3142
|
+
class: "sl-relative sl-cursor-default sl-select-none sl-py-2 sl-px-4 sl-text-gray-700"
|
|
3143
|
+
}, cn = { class: "sl-block sl-truncate" }, mn = { key: 0 }, fn = 50, Be = /* @__PURE__ */ z({
|
|
3144
|
+
__name: "ComboboxInput",
|
|
3145
|
+
props: {
|
|
3146
|
+
name: {},
|
|
3147
|
+
items: {},
|
|
3148
|
+
label: {},
|
|
3149
|
+
placeholder: {},
|
|
3150
|
+
disabled: { type: Boolean },
|
|
3151
|
+
rules: {},
|
|
3152
|
+
validateOnMount: { type: Boolean },
|
|
3153
|
+
successMessage: {},
|
|
3154
|
+
tertiaryLabel: {},
|
|
3155
|
+
itemKey: { default: "id" },
|
|
3156
|
+
itemText: { default: "name" },
|
|
3157
|
+
customQuery: {},
|
|
3158
|
+
loading: { type: Boolean, default: !1 },
|
|
3159
|
+
multiple: { type: Boolean, default: !1 },
|
|
3160
|
+
showAll: { type: Boolean, default: !1 },
|
|
3161
|
+
modelValue: {},
|
|
3162
|
+
boxShadow: { type: Boolean, default: !1 }
|
|
3163
|
+
},
|
|
3164
|
+
emits: ["update:modelValue", "update:query", "blur", "focus"],
|
|
3165
|
+
setup(t, { emit: l }) {
|
|
3166
|
+
const s = t, a = l, m = ae(s.name), u = P(""), { value: n, errorMessage: p, handleChange: v, meta: $, setTouched: c } = te(
|
|
3167
|
+
() => s.name,
|
|
3168
|
+
s.rules,
|
|
3169
|
+
{
|
|
3170
|
+
validateOnMount: s.validateOnMount,
|
|
3171
|
+
initialValue: s.modelValue
|
|
3172
|
+
}
|
|
3173
|
+
), d = P(
|
|
3174
|
+
s.multiple ? Array.isArray(s.modelValue) ? s.modelValue : [] : s.modelValue
|
|
3175
|
+
);
|
|
3176
|
+
q(
|
|
3177
|
+
() => s.modelValue,
|
|
3178
|
+
(T) => {
|
|
3179
|
+
if (s.multiple) {
|
|
3180
|
+
const W = Array.isArray(T) ? T : [];
|
|
3181
|
+
W !== d.value && (d.value = W, n.value = W);
|
|
3182
|
+
} else
|
|
3183
|
+
T !== d.value && (d.value = T, n.value = T);
|
|
3184
|
+
},
|
|
3185
|
+
{ immediate: !0 }
|
|
3186
|
+
), q(
|
|
3187
|
+
d,
|
|
3188
|
+
(T) => {
|
|
3189
|
+
a("update:modelValue", T);
|
|
3190
|
+
}
|
|
3191
|
+
);
|
|
3192
|
+
const g = B(() => [
|
|
3193
|
+
"sl-w-full",
|
|
3194
|
+
"sl-border-none",
|
|
3195
|
+
"sl-py-2",
|
|
3196
|
+
"sl-pl-3",
|
|
3197
|
+
"sl-pr-10",
|
|
3198
|
+
"sl-text-sm",
|
|
3199
|
+
"sl-leading-5",
|
|
3200
|
+
"sl-text-gray-900",
|
|
3201
|
+
"focus:sl-outline-none",
|
|
3202
|
+
"focus:sl-ring-0",
|
|
3203
|
+
"sl-bg-transparent"
|
|
3204
|
+
].join(" ")), h = B(() => {
|
|
3205
|
+
const T = [
|
|
3206
|
+
"sl-relative",
|
|
3207
|
+
"sl-w-full",
|
|
3208
|
+
"sl-cursor-default",
|
|
3209
|
+
"sl-rounded-lg",
|
|
3210
|
+
"sl-bg-white",
|
|
3211
|
+
"sl-text-left",
|
|
3212
|
+
"sl-border",
|
|
3213
|
+
"focus-within:sl-ring-2",
|
|
3214
|
+
"focus-within:sl-ring-stachelock-500",
|
|
3215
|
+
"focus-within:sl-border-stachelock-500",
|
|
3216
|
+
"sl-transition-all",
|
|
3217
|
+
"sl-duration-200"
|
|
3218
|
+
];
|
|
3219
|
+
return s.disabled ? T.push(
|
|
3220
|
+
"sl-bg-gray-50",
|
|
3221
|
+
"sl-cursor-not-allowed",
|
|
3222
|
+
"sl-border-gray-200"
|
|
3223
|
+
) : p.value ? T.push(
|
|
3224
|
+
"sl-border-red-300",
|
|
3225
|
+
"focus-within:sl-ring-red-500",
|
|
3226
|
+
"focus-within:sl-border-red-500"
|
|
3227
|
+
) : $.valid && $.touched ? T.push(
|
|
3228
|
+
"sl-border-green-300",
|
|
3229
|
+
"focus-within:sl-ring-green-500",
|
|
3230
|
+
"focus-within:sl-border-green-500"
|
|
3231
|
+
) : T.push(
|
|
3232
|
+
"sl-border-gray-300",
|
|
3233
|
+
"hover:sl-border-gray-400"
|
|
3234
|
+
), T.join(" ");
|
|
3235
|
+
}), k = (T) => T[s.itemKey], C = (T) => T ? T[s.itemText] || T.toString() : "", A = P([]), D = P([]), i = P(1), I = () => {
|
|
3236
|
+
const T = i.value * fn;
|
|
3237
|
+
D.value = A.value.slice(0, T), i.value += 1;
|
|
3238
|
+
}, x = () => {
|
|
3239
|
+
i.value = 1, D.value = [], I();
|
|
3240
|
+
}, F = () => {
|
|
3241
|
+
if (u.value && u.value !== "")
|
|
3242
|
+
if (s.customQuery)
|
|
3243
|
+
A.value = s.customQuery(u.value, s.items);
|
|
3244
|
+
else {
|
|
3245
|
+
const T = u.value.toLowerCase();
|
|
3246
|
+
A.value = s.items.filter((W) => C(W).toLowerCase().includes(T));
|
|
3247
|
+
}
|
|
3248
|
+
else
|
|
3249
|
+
A.value = s.items;
|
|
3250
|
+
x();
|
|
3251
|
+
}, y = B(() => s.items.filter((T) => !T.disabled)), N = (T) => {
|
|
3252
|
+
const W = T.target;
|
|
3253
|
+
u.value = W.value, a("update:query", u.value), F();
|
|
3254
|
+
}, Z = (T) => {
|
|
3255
|
+
d.value = T, c(!0), v(T);
|
|
3256
|
+
}, M = B(() => {
|
|
3257
|
+
if (!s.multiple || !Array.isArray(d.value)) return !1;
|
|
3258
|
+
const T = y.value;
|
|
3259
|
+
return T.length === 0 ? !1 : T.every((W) => d.value.includes(W));
|
|
3260
|
+
}), U = () => {
|
|
3261
|
+
s.multiple && (M.value ? d.value = [] : d.value = [...y.value], v(d.value));
|
|
3262
|
+
}, H = (T) => s.multiple ? !Array.isArray(T) || T.length === 0 ? "" : T.length === 1 ? C(T[0]) : `${T.length} selected` : C(T), O = B(() => s.multiple || u.value === "" ? null : { [s.itemKey]: null, [s.itemText]: u.value }), R = () => {
|
|
3263
|
+
s.multiple || O.value && (s.customQuery ? (a("update:modelValue", u.value), v(u.value)) : (d.value = O.value, v(d.value)));
|
|
3264
|
+
}, ie = (T) => {
|
|
3265
|
+
const W = T.target;
|
|
3266
|
+
W.scrollTop + W.clientHeight >= W.scrollHeight && I();
|
|
3267
|
+
}, ks = (T) => {
|
|
3268
|
+
a("focus", T);
|
|
3269
|
+
}, $s = (T) => {
|
|
3270
|
+
!s.multiple && O.value && (d.value = O.value, v(d.value), a("update:modelValue", d.value)), a("blur", T);
|
|
3271
|
+
};
|
|
3272
|
+
return q(() => s.items, () => {
|
|
3273
|
+
F();
|
|
3274
|
+
}, { immediate: !0, deep: !0 }), (T, W) => (o(), r("div", on, [
|
|
3275
|
+
_(ee, {
|
|
3276
|
+
id: f(m),
|
|
3277
|
+
name: T.name,
|
|
3278
|
+
label: T.label,
|
|
3279
|
+
disabled: T.disabled,
|
|
3280
|
+
optional: !T.rules,
|
|
3281
|
+
"tertiary-label": T.tertiaryLabel,
|
|
3282
|
+
"box-shadow": T.boxShadow,
|
|
3283
|
+
"error-message": f(p),
|
|
3284
|
+
"success-message": T.successMessage,
|
|
3285
|
+
"is-valid": f($).valid,
|
|
3286
|
+
"is-touched": f($).touched
|
|
3287
|
+
}, {
|
|
3288
|
+
"success-message": L(() => [
|
|
3289
|
+
T.successMessage ? (o(), r("span", mn, w(T.successMessage), 1)) : b("", !0)
|
|
3290
|
+
]),
|
|
3291
|
+
default: L(() => [
|
|
3292
|
+
_(f(Hs), {
|
|
3293
|
+
modelValue: d.value,
|
|
3294
|
+
"onUpdate:modelValue": [
|
|
3295
|
+
W[2] || (W[2] = (G) => d.value = G),
|
|
3296
|
+
Z
|
|
3297
|
+
],
|
|
3298
|
+
disabled: T.disabled,
|
|
3299
|
+
multiple: T.multiple
|
|
3300
|
+
}, {
|
|
3301
|
+
default: L(() => [
|
|
3302
|
+
e("div", {
|
|
3303
|
+
class: V(h.value)
|
|
3304
|
+
}, [
|
|
3305
|
+
_(f(Ks), {
|
|
3306
|
+
id: f(m),
|
|
3307
|
+
class: V(g.value),
|
|
3308
|
+
"display-value": H,
|
|
3309
|
+
placeholder: T.placeholder || "Type to search...",
|
|
3310
|
+
modelValue: u.value,
|
|
3311
|
+
"onUpdate:modelValue": W[0] || (W[0] = (G) => u.value = G),
|
|
3312
|
+
onInput: N,
|
|
3313
|
+
onBlur: $s,
|
|
3314
|
+
onFocus: ks
|
|
3315
|
+
}, null, 8, ["id", "class", "placeholder", "modelValue"]),
|
|
3316
|
+
_(f(Ws), { class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-2" }, {
|
|
3317
|
+
default: L(() => [
|
|
3318
|
+
_(f(Qe), {
|
|
3319
|
+
class: "sl-h-5 sl-w-5 sl-text-gray-400",
|
|
3320
|
+
"aria-hidden": "true"
|
|
3321
|
+
})
|
|
3322
|
+
]),
|
|
3323
|
+
_: 1
|
|
3324
|
+
}),
|
|
3325
|
+
_(f(ve), {
|
|
3326
|
+
leave: "sl-transition sl-ease-in sl-duration-100",
|
|
3327
|
+
"leave-from": "sl-opacity-100",
|
|
3328
|
+
"leave-to": "sl-opacity-0",
|
|
3329
|
+
onAfterLeave: W[1] || (W[1] = (G) => u.value = "")
|
|
3330
|
+
}, {
|
|
3331
|
+
default: L(() => [
|
|
3332
|
+
A.value.length > 0 || u.value !== "" || T.multiple && T.showAll ? (o(), K(f(qs), {
|
|
3333
|
+
key: 0,
|
|
3334
|
+
class: "sl-absolute sl-z-10 sl-mt-1 sl-max-h-60 sl-w-full sl-overflow-auto sl-rounded-md sl-bg-white sl-py-1 sl-text-base sl-shadow-lg sl-ring-1 sl-ring-black sl-ring-opacity-5 focus:sl-outline-none sm:sl-text-sm",
|
|
3335
|
+
onScroll: ie
|
|
3336
|
+
}, {
|
|
3337
|
+
default: L(() => [
|
|
3338
|
+
T.multiple && T.showAll ? (o(), K(f(ye), {
|
|
3339
|
+
key: 0,
|
|
3340
|
+
value: null,
|
|
3341
|
+
disabled: !0,
|
|
3342
|
+
as: "template"
|
|
3343
|
+
}, {
|
|
3344
|
+
default: L(({ active: G }) => [
|
|
3345
|
+
e("li", {
|
|
3346
|
+
onClick: Y(U, ["prevent", "stop"]),
|
|
3347
|
+
class: V([
|
|
3348
|
+
"sl-relative sl-cursor-default sl-select-none sl-py-2 sl-pl-10 sl-pr-4",
|
|
3349
|
+
G ? "sl-bg-stachelock-600 sl-text-white" : "sl-text-gray-900"
|
|
3350
|
+
])
|
|
3351
|
+
}, [
|
|
3352
|
+
e("span", nn, w(M.value ? "Unselect All" : "Select All"), 1)
|
|
3353
|
+
], 2)
|
|
3354
|
+
]),
|
|
3355
|
+
_: 1
|
|
3356
|
+
})) : b("", !0),
|
|
3357
|
+
T.loading ? (o(), r("div", rn, [
|
|
3358
|
+
e("div", dn, [
|
|
3359
|
+
_(os, { size: "sm" }),
|
|
3360
|
+
W[3] || (W[3] = e("span", null, "Loading...", -1))
|
|
3361
|
+
])
|
|
3362
|
+
])) : u.value !== "" && A.value.length === 0 ? (o(), r("div", un, " Nothing found. ")) : b("", !0),
|
|
3363
|
+
(o(!0), r(E, null, j(D.value, (G) => (o(), K(f(ye), {
|
|
3364
|
+
key: k(G),
|
|
3365
|
+
value: G,
|
|
3366
|
+
as: "template",
|
|
3367
|
+
disabled: G.disabled
|
|
3368
|
+
}, {
|
|
3369
|
+
default: L(({ active: Le, selected: Ie }) => [
|
|
3370
|
+
e("li", {
|
|
3371
|
+
class: V([
|
|
3372
|
+
"sl-relative sl-cursor-default sl-select-none sl-py-2 sl-pl-10 sl-pr-4",
|
|
3373
|
+
Le ? "sl-bg-stachelock-600 sl-text-white" : "sl-text-gray-900",
|
|
3374
|
+
G.disabled ? "sl-opacity-50 sl-cursor-not-allowed" : ""
|
|
3375
|
+
])
|
|
3376
|
+
}, [
|
|
3377
|
+
e("span", {
|
|
3378
|
+
class: V([
|
|
3379
|
+
"sl-block sl-truncate",
|
|
3380
|
+
Ie ? "sl-font-medium" : "sl-font-normal"
|
|
3381
|
+
])
|
|
3382
|
+
}, w(C(G)), 3),
|
|
3383
|
+
Ie ? (o(), r("span", {
|
|
3384
|
+
key: 0,
|
|
3385
|
+
class: V(["sl-absolute sl-inset-y-0 sl-left-0 sl-flex sl-items-center sl-pl-3", Le ? "sl-text-white" : "sl-text-stachelock-600"])
|
|
3386
|
+
}, [
|
|
3387
|
+
_(f(Ge), {
|
|
3388
|
+
class: "sl-h-5 sl-w-5",
|
|
3389
|
+
"aria-hidden": "true"
|
|
3390
|
+
})
|
|
3391
|
+
], 2)) : b("", !0)
|
|
3392
|
+
], 2)
|
|
3393
|
+
]),
|
|
3394
|
+
_: 2
|
|
3395
|
+
}, 1032, ["value", "disabled"]))), 128)),
|
|
3396
|
+
!T.multiple && O.value ? (o(), K(f(ye), {
|
|
3397
|
+
key: 3,
|
|
3398
|
+
value: O.value,
|
|
3399
|
+
as: "template"
|
|
3400
|
+
}, {
|
|
3401
|
+
default: L(({ active: G }) => [
|
|
3402
|
+
e("li", {
|
|
3403
|
+
onClick: Y(R, ["prevent", "stop"]),
|
|
3404
|
+
class: V([
|
|
3405
|
+
"sl-relative sl-cursor-pointer sl-select-none sl-py-2 sl-pl-10 sl-pr-4",
|
|
3406
|
+
G ? "sl-bg-stachelock-600 sl-text-white" : "sl-text-gray-900"
|
|
3407
|
+
])
|
|
3408
|
+
}, [
|
|
3409
|
+
e("span", cn, ' Enter "' + w(u.value) + '" manually ', 1)
|
|
3410
|
+
], 2)
|
|
3411
|
+
]),
|
|
3412
|
+
_: 1
|
|
3413
|
+
}, 8, ["value"])) : b("", !0)
|
|
3414
|
+
]),
|
|
3415
|
+
_: 1
|
|
3416
|
+
})) : b("", !0)
|
|
3417
|
+
]),
|
|
3418
|
+
_: 1
|
|
3419
|
+
})
|
|
3420
|
+
], 2)
|
|
3421
|
+
]),
|
|
3422
|
+
_: 1
|
|
3423
|
+
}, 8, ["modelValue", "disabled", "multiple"])
|
|
3424
|
+
]),
|
|
3425
|
+
_: 1
|
|
3426
|
+
}, 8, ["id", "name", "label", "disabled", "optional", "tertiary-label", "box-shadow", "error-message", "success-message", "is-valid", "is-touched"])
|
|
3427
|
+
]));
|
|
3428
|
+
}
|
|
3429
|
+
}), gn = { class: "sl-w-full" }, pn = { class: "sl-relative" }, hn = ["id", "name", "disabled", "placeholder", "spellcheck", "rows", "maxlength"], vn = {
|
|
3430
|
+
key: 0,
|
|
3431
|
+
class: "sl-absolute sl-bottom-2 sl-right-2 sl-text-xs sl-text-slate-500 sl-pointer-events-none"
|
|
3432
|
+
}, yn = { key: 0 }, Ve = /* @__PURE__ */ z({
|
|
3433
|
+
__name: "TextAreaInput",
|
|
3434
|
+
props: {
|
|
3435
|
+
name: {},
|
|
3436
|
+
label: {},
|
|
3437
|
+
placeholder: {},
|
|
3438
|
+
disabled: { type: Boolean },
|
|
3439
|
+
rules: {},
|
|
3440
|
+
validateOnMount: { type: Boolean },
|
|
3441
|
+
successMessage: {},
|
|
3442
|
+
tertiaryLabel: {},
|
|
3443
|
+
spellcheck: { type: Boolean, default: !0 },
|
|
3444
|
+
rows: { default: 4 },
|
|
3445
|
+
maxlength: {},
|
|
3446
|
+
inputClass: {},
|
|
3447
|
+
inputStyle: { type: [Boolean, null, String, Object, Array] },
|
|
3448
|
+
lazy: { type: Boolean, default: !1 },
|
|
3449
|
+
modelValue: {},
|
|
3450
|
+
boxShadow: { type: Boolean, default: !1 }
|
|
3451
|
+
},
|
|
3452
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
3453
|
+
setup(t, { expose: l, emit: s }) {
|
|
3454
|
+
const a = t, m = s, u = P(), n = ae(a.name), { value: p, errorMessage: v, handleBlur: $, handleChange: c, meta: d } = te(
|
|
3455
|
+
() => a.name,
|
|
3456
|
+
a.rules,
|
|
3457
|
+
{
|
|
3458
|
+
validateOnMount: a.validateOnMount,
|
|
3459
|
+
initialValue: a.modelValue,
|
|
3460
|
+
syncVModel: !0
|
|
3461
|
+
}
|
|
3462
|
+
);
|
|
3463
|
+
q(
|
|
3464
|
+
() => a.modelValue,
|
|
3465
|
+
(i) => {
|
|
3466
|
+
i !== p.value && (p.value = i || "");
|
|
3467
|
+
}
|
|
3468
|
+
), q(
|
|
3469
|
+
p,
|
|
3470
|
+
(i) => {
|
|
3471
|
+
m("update:modelValue", i);
|
|
3472
|
+
}
|
|
3473
|
+
);
|
|
3474
|
+
const g = B(() => {
|
|
3475
|
+
const i = [
|
|
3476
|
+
"sl-w-full",
|
|
3477
|
+
"sl-px-3",
|
|
3478
|
+
"sl-py-2",
|
|
3479
|
+
"sl-text-sm",
|
|
3480
|
+
"sl-border",
|
|
3481
|
+
"sl-rounded-md",
|
|
3482
|
+
"sl-bg-white",
|
|
3483
|
+
"sl-transition-all",
|
|
3484
|
+
"sl-duration-200",
|
|
3485
|
+
"focus:sl-outline-none",
|
|
3486
|
+
"focus:sl-ring-2",
|
|
3487
|
+
"focus:sl-ring-stachelock-500",
|
|
3488
|
+
"focus:sl-border-stachelock-500",
|
|
3489
|
+
"sl-resize-y",
|
|
3490
|
+
"sl-min-h-[80px]"
|
|
3491
|
+
];
|
|
3492
|
+
return a.disabled ? i.push(
|
|
3493
|
+
"sl-bg-gray-50",
|
|
3494
|
+
"sl-text-gray-500",
|
|
3495
|
+
"sl-cursor-not-allowed",
|
|
3496
|
+
"sl-border-gray-200"
|
|
3497
|
+
) : v.value ? i.push(
|
|
3498
|
+
"sl-border-red-300",
|
|
3499
|
+
"focus:sl-ring-red-500",
|
|
3500
|
+
"focus:sl-border-red-500"
|
|
3501
|
+
) : d.valid && d.touched ? i.push(
|
|
3502
|
+
"sl-border-green-300",
|
|
3503
|
+
"focus:sl-ring-green-500",
|
|
3504
|
+
"focus:sl-border-green-500"
|
|
3505
|
+
) : i.push(
|
|
3506
|
+
"sl-border-gray-300",
|
|
3507
|
+
"hover:sl-border-gray-400"
|
|
3508
|
+
), i.join(" ");
|
|
3509
|
+
}), h = (i) => {
|
|
3510
|
+
const I = i.target;
|
|
3511
|
+
a.lazy || c(I.value);
|
|
3512
|
+
}, k = (i) => {
|
|
3513
|
+
if (a.lazy) {
|
|
3514
|
+
const I = i.target;
|
|
3515
|
+
c(I.value);
|
|
3516
|
+
}
|
|
3517
|
+
$(i), m("blur", i);
|
|
3518
|
+
}, C = (i) => {
|
|
3519
|
+
m("focus", i);
|
|
3520
|
+
};
|
|
3521
|
+
return l({
|
|
3522
|
+
focus: () => {
|
|
3523
|
+
u.value?.focus();
|
|
3524
|
+
},
|
|
3525
|
+
blur: () => {
|
|
3526
|
+
u.value?.blur();
|
|
3527
|
+
},
|
|
3528
|
+
textareaRef: u
|
|
3529
|
+
}), (i, I) => (o(), r("div", gn, [
|
|
3530
|
+
_(ee, {
|
|
3531
|
+
id: f(n),
|
|
3532
|
+
name: i.name,
|
|
3533
|
+
label: i.label,
|
|
3534
|
+
disabled: i.disabled,
|
|
3535
|
+
optional: !i.rules,
|
|
3536
|
+
"tertiary-label": i.tertiaryLabel,
|
|
3537
|
+
"box-shadow": i.boxShadow,
|
|
3538
|
+
"error-message": f(v),
|
|
3539
|
+
"success-message": i.successMessage,
|
|
3540
|
+
"is-valid": f(d).valid,
|
|
3541
|
+
"is-touched": f(d).touched
|
|
3542
|
+
}, {
|
|
3543
|
+
"success-message": L(() => [
|
|
3544
|
+
i.successMessage ? (o(), r("span", yn, w(i.successMessage), 1)) : b("", !0)
|
|
3545
|
+
]),
|
|
3546
|
+
default: L(() => [
|
|
3547
|
+
e("div", pn, [
|
|
3548
|
+
me(e("textarea", he({
|
|
3549
|
+
id: f(n),
|
|
3550
|
+
ref_key: "textareaRef",
|
|
3551
|
+
ref: u,
|
|
3552
|
+
"onUpdate:modelValue": I[0] || (I[0] = (x) => As(p) ? p.value = x : null),
|
|
3553
|
+
name: i.name,
|
|
3554
|
+
disabled: i.disabled,
|
|
3555
|
+
placeholder: i.placeholder,
|
|
3556
|
+
class: [
|
|
3557
|
+
g.value,
|
|
3558
|
+
i.inputClass
|
|
3559
|
+
],
|
|
3560
|
+
style: i.inputStyle,
|
|
3561
|
+
spellcheck: i.spellcheck,
|
|
3562
|
+
rows: i.rows,
|
|
3563
|
+
maxlength: i.maxlength
|
|
3564
|
+
}, i.$attrs, {
|
|
3565
|
+
onBlur: k,
|
|
3566
|
+
onFocus: C,
|
|
3567
|
+
onInput: h
|
|
3568
|
+
}), null, 16, hn), [
|
|
3569
|
+
[be, f(p)]
|
|
3570
|
+
]),
|
|
3571
|
+
i.maxlength !== void 0 ? (o(), r("div", vn, w(f(p)?.length || 0) + "/" + w(i.maxlength), 1)) : b("", !0)
|
|
3572
|
+
])
|
|
3573
|
+
]),
|
|
3574
|
+
_: 1
|
|
3575
|
+
}, 8, ["id", "name", "label", "disabled", "optional", "tertiary-label", "box-shadow", "error-message", "success-message", "is-valid", "is-touched"])
|
|
3576
|
+
]));
|
|
3577
|
+
}
|
|
3578
|
+
}), bn = { class: "sl-w-full" }, xn = { class: "sl-flex sl-items-center sl-justify-between sl-gap-4" }, wn = {
|
|
3579
|
+
key: 0,
|
|
3580
|
+
class: "sl-flex-1"
|
|
3581
|
+
}, kn = ["for"], $n = ["innerHTML"], _n = { key: 1 }, Cn = { class: "sl-sr-only" }, Sn = {
|
|
3582
|
+
key: 1,
|
|
3583
|
+
class: "sl-ml-3 sl-text-sm"
|
|
3584
|
+
}, Mn = {
|
|
3585
|
+
key: 0,
|
|
3586
|
+
class: "sl-font-medium sl-text-gray-800"
|
|
3587
|
+
}, Tn = {
|
|
3588
|
+
key: 1,
|
|
3589
|
+
class: "sl-text-gray-500"
|
|
3590
|
+
}, Bn = {
|
|
3591
|
+
key: 2,
|
|
3592
|
+
class: "sl-flex-1"
|
|
3593
|
+
}, Vn = {
|
|
3594
|
+
key: 0,
|
|
3595
|
+
class: "sl-mt-1 sl-text-sm sl-text-gray-600"
|
|
3596
|
+
}, An = ["innerHTML"], Ae = /* @__PURE__ */ z({
|
|
3597
|
+
__name: "SwitchInput",
|
|
3598
|
+
props: {
|
|
3599
|
+
name: {},
|
|
3600
|
+
modelValue: { type: Boolean },
|
|
3601
|
+
label: {},
|
|
3602
|
+
description: {},
|
|
3603
|
+
disabled: { type: Boolean },
|
|
3604
|
+
immediate: { type: Boolean, default: !1 },
|
|
3605
|
+
boxShadow: { type: Boolean, default: !1 },
|
|
3606
|
+
defaultValue: { type: Boolean, default: !1 },
|
|
3607
|
+
hideMainLabel: { type: Boolean, default: !1 },
|
|
3608
|
+
textTrue: {},
|
|
3609
|
+
textFalse: {},
|
|
3610
|
+
rules: {},
|
|
3611
|
+
validateOnMount: { type: Boolean },
|
|
3612
|
+
successMessage: {},
|
|
3613
|
+
tertiaryLabel: {},
|
|
3614
|
+
isDescriptionHtml: { type: Boolean, default: !1 },
|
|
3615
|
+
showErrors: { type: Boolean, default: !1 },
|
|
3616
|
+
layout: { default: "stacked" }
|
|
3617
|
+
},
|
|
3618
|
+
emits: ["update:modelValue", "blur", "focus"],
|
|
3619
|
+
setup(t, { expose: l, emit: s }) {
|
|
3620
|
+
const a = t, m = s, u = P(), n = ae(`sl-${a.name}`), { value: p, errorMessage: v, handleChange: $, handleBlur: c, meta: d } = te(
|
|
3621
|
+
() => a.name,
|
|
3622
|
+
a.rules,
|
|
3623
|
+
{
|
|
3624
|
+
type: "checkbox",
|
|
3625
|
+
validateOnMount: a.validateOnMount,
|
|
3626
|
+
initialValue: a.modelValue ?? a.defaultValue,
|
|
3627
|
+
syncVModel: !0
|
|
3628
|
+
}
|
|
3629
|
+
), g = P(a.modelValue ?? a.defaultValue);
|
|
3630
|
+
q(
|
|
3631
|
+
() => a.modelValue,
|
|
3632
|
+
(i) => {
|
|
3633
|
+
if (i !== void 0 && i !== g.value) {
|
|
3634
|
+
const I = !!i;
|
|
3635
|
+
g.value = I, p.value = I;
|
|
3636
|
+
}
|
|
3637
|
+
},
|
|
3638
|
+
{ immediate: !0 }
|
|
3639
|
+
);
|
|
3640
|
+
const h = B(() => {
|
|
3641
|
+
const i = [
|
|
3642
|
+
"sl-relative",
|
|
3643
|
+
"sl-inline-flex",
|
|
3644
|
+
"sl-items-center",
|
|
3645
|
+
"sl-h-6",
|
|
3646
|
+
"sl-w-11",
|
|
3647
|
+
"sl-flex-shrink-0",
|
|
3648
|
+
"sl-cursor-pointer",
|
|
3649
|
+
"sl-rounded-full",
|
|
3650
|
+
"sl-border-2",
|
|
3651
|
+
"sl-border-transparent",
|
|
3652
|
+
"sl-transition-colors",
|
|
3653
|
+
"sl-duration-200",
|
|
3654
|
+
"sl-ease-in-out",
|
|
3655
|
+
"focus:sl-outline-none",
|
|
3656
|
+
"focus:sl-ring-2",
|
|
3657
|
+
"focus:sl-ring-stachelock-600",
|
|
3658
|
+
"focus:sl-ring-offset-2"
|
|
3659
|
+
];
|
|
3660
|
+
return a.disabled && i.push(
|
|
3661
|
+
"sl-cursor-not-allowed",
|
|
3662
|
+
"sl-opacity-50"
|
|
3663
|
+
), g.value ? i.push("sl-bg-stachelock-600") : i.push("sl-bg-gray-200"), i.join(" ");
|
|
3664
|
+
}), k = (i) => {
|
|
3665
|
+
a.disabled || (g.value = i, a.immediate && $(i), m("update:modelValue", i));
|
|
3666
|
+
}, C = (i) => {
|
|
3667
|
+
a.immediate || $(g.value), c(i), m("blur", i);
|
|
3668
|
+
}, A = (i) => {
|
|
3669
|
+
m("focus", i);
|
|
3670
|
+
}, D = () => {
|
|
3671
|
+
a.disabled || k(!g.value);
|
|
3672
|
+
};
|
|
3673
|
+
return l({
|
|
3674
|
+
toggle: D,
|
|
3675
|
+
value: g,
|
|
3676
|
+
focus: () => {
|
|
3677
|
+
(u.value?.$el ?? u.value)?.focus?.();
|
|
3678
|
+
},
|
|
3679
|
+
blur: () => {
|
|
3680
|
+
(u.value?.$el ?? u.value)?.blur?.();
|
|
3681
|
+
},
|
|
3682
|
+
switchRef: u
|
|
3683
|
+
}), (i, I) => (o(), r("div", bn, [
|
|
3684
|
+
_(ee, {
|
|
3685
|
+
id: f(n),
|
|
3686
|
+
name: i.name,
|
|
3687
|
+
label: i.layout === "stacked" && !i.hideMainLabel ? i.label : "",
|
|
3688
|
+
disabled: i.disabled,
|
|
3689
|
+
optional: !i.rules,
|
|
3690
|
+
"tertiary-label": i.tertiaryLabel,
|
|
3691
|
+
"box-shadow": i.boxShadow,
|
|
3692
|
+
"error-message": f(v),
|
|
3693
|
+
"success-message": i.successMessage,
|
|
3694
|
+
"is-valid": f(d).valid,
|
|
3695
|
+
"is-touched": f(d).touched,
|
|
3696
|
+
"show-errors": i.showErrors
|
|
3697
|
+
}, {
|
|
3698
|
+
default: L(() => [
|
|
3699
|
+
e("div", xn, [
|
|
3700
|
+
i.layout === "inline" ? (o(), r("div", wn, [
|
|
3701
|
+
i.label && !i.hideMainLabel ? (o(), r("label", {
|
|
3702
|
+
key: 0,
|
|
3703
|
+
for: f(n),
|
|
3704
|
+
class: "sl-block sl-text-sm sl-font-medium sl-text-gray-900 sl-cursor-pointer"
|
|
3705
|
+
}, w(i.label), 9, kn)) : b("", !0),
|
|
3706
|
+
i.description ? (o(), r("div", {
|
|
3707
|
+
key: 1,
|
|
3708
|
+
class: V(["sl-mt-1 sl-text-sm sl-text-gray-600", { "sl-cursor-pointer": !i.disabled }]),
|
|
3709
|
+
onClick: I[0] || (I[0] = (x) => !i.disabled && D())
|
|
3710
|
+
}, [
|
|
3711
|
+
i.isDescriptionHtml ? (o(), r("div", {
|
|
3712
|
+
key: 0,
|
|
3713
|
+
innerHTML: i.description
|
|
3714
|
+
}, null, 8, $n)) : (o(), r("span", _n, w(i.description), 1))
|
|
3715
|
+
], 2)) : b("", !0)
|
|
3716
|
+
])) : b("", !0),
|
|
3717
|
+
_(f(Qs), {
|
|
3718
|
+
id: f(n),
|
|
3719
|
+
ref_key: "switchRef",
|
|
3720
|
+
ref: u,
|
|
3721
|
+
modelValue: g.value,
|
|
3722
|
+
"onUpdate:modelValue": [
|
|
3723
|
+
I[1] || (I[1] = (x) => g.value = x),
|
|
3724
|
+
k
|
|
3725
|
+
],
|
|
3726
|
+
disabled: i.disabled,
|
|
3727
|
+
class: V([
|
|
3728
|
+
h.value,
|
|
3729
|
+
{ "sl-shadow-md": i.boxShadow }
|
|
3730
|
+
]),
|
|
3731
|
+
onFocus: A,
|
|
3732
|
+
onBlur: C,
|
|
3733
|
+
onKeydown: [
|
|
3734
|
+
fe(Y(D, ["prevent"]), ["space"]),
|
|
3735
|
+
fe(Y(D, ["prevent"]), ["enter"])
|
|
3736
|
+
]
|
|
3737
|
+
}, {
|
|
3738
|
+
default: L(() => [
|
|
3739
|
+
e("span", Cn, w(i.label), 1),
|
|
3740
|
+
e("span", {
|
|
3741
|
+
class: V([
|
|
3742
|
+
g.value ? "sl-translate-x-5" : "sl-translate-x-0",
|
|
3743
|
+
"sl-pointer-events-none sl-inline-block sl-h-5 sl-w-5 sl-transform sl-rounded-full sl-bg-white sl-shadow sl-ring-0 sl-transition sl-duration-200 sl-ease-in-out sl-relative"
|
|
3744
|
+
])
|
|
3745
|
+
}, null, 2)
|
|
3746
|
+
]),
|
|
3747
|
+
_: 1
|
|
3748
|
+
}, 8, ["id", "modelValue", "disabled", "class", "onKeydown"]),
|
|
3749
|
+
i.textTrue || i.textFalse ? (o(), r("span", Sn, [
|
|
3750
|
+
g.value && i.textTrue ? (o(), r("span", Mn, w(i.textTrue), 1)) : !g.value && i.textFalse ? (o(), r("span", Tn, w(i.textFalse), 1)) : b("", !0)
|
|
3751
|
+
])) : b("", !0),
|
|
3752
|
+
i.description && i.layout === "stacked" ? (o(), r("div", Bn, [
|
|
3753
|
+
i.isDescriptionHtml ? (o(), r("p", {
|
|
3754
|
+
key: 1,
|
|
3755
|
+
class: "sl-mt-1 sl-text-sm sl-text-gray-600",
|
|
3756
|
+
innerHTML: i.description
|
|
3757
|
+
}, null, 8, An)) : (o(), r("p", Vn, w(i.description), 1))
|
|
3758
|
+
])) : b("", !0)
|
|
3759
|
+
])
|
|
3760
|
+
]),
|
|
3761
|
+
_: 1
|
|
3762
|
+
}, 8, ["id", "name", "label", "disabled", "optional", "tertiary-label", "box-shadow", "error-message", "success-message", "is-valid", "is-touched", "show-errors"])
|
|
3763
|
+
]));
|
|
3764
|
+
}
|
|
3765
|
+
}), Ln = { class: "sl-bg-white sl-rounded-lg sl-shadow sl-p-6" }, In = { class: "sl-space-y-8" }, Dn = { class: "sl-grid sl-grid-cols-1 sl-md:grid-cols-2 sl-gap-6" }, En = { class: "sl-bg-gray-50 sl-rounded-md sl-p-4 sl-text-sm sl-text-gray-700" }, Pn = { class: "sl-whitespace-pre-wrap" }, gs = /* @__PURE__ */ z({
|
|
3766
|
+
__name: "InputsShowcase",
|
|
3767
|
+
setup(t) {
|
|
3768
|
+
const l = qe({
|
|
3769
|
+
text: "",
|
|
3770
|
+
textArea: "",
|
|
3771
|
+
switchOn: !1,
|
|
3772
|
+
checkbox: !1,
|
|
3773
|
+
selectedFruit: null,
|
|
3774
|
+
selectedLanguages: [],
|
|
3775
|
+
selectedCity: null
|
|
3776
|
+
}), s = [
|
|
3777
|
+
{ id: 1, name: "Apple" },
|
|
3778
|
+
{ id: 2, name: "Banana" },
|
|
3779
|
+
{ id: 3, name: "Cherry" },
|
|
3780
|
+
{ id: 4, name: "Durian", disabled: !0 }
|
|
3781
|
+
], a = [
|
|
3782
|
+
{ id: 1, name: "TypeScript" },
|
|
3783
|
+
{ id: 2, name: "JavaScript" },
|
|
3784
|
+
{ id: 3, name: "Python" },
|
|
3785
|
+
{ id: 4, name: "Go" },
|
|
3786
|
+
{ id: 5, name: "Rust" }
|
|
3787
|
+
], m = [
|
|
3788
|
+
{ id: 1, name: "New York" },
|
|
3789
|
+
{ id: 2, name: "San Francisco" },
|
|
3790
|
+
{ id: 3, name: "Seattle" },
|
|
3791
|
+
{ id: 4, name: "Austin" },
|
|
3792
|
+
{ id: 5, name: "Chicago" },
|
|
3793
|
+
{ id: 6, name: "Denver" },
|
|
3794
|
+
{ id: 7, name: "Miami" },
|
|
3795
|
+
{ id: 8, name: "Boston" }
|
|
3796
|
+
];
|
|
3797
|
+
return (u, n) => (o(), r("section", Ln, [
|
|
3798
|
+
n[15] || (n[15] = e("h2", { class: "sl-text-xl sl-font-semibold sl-mb-4" }, "All Inputs Showcase", -1)),
|
|
3799
|
+
e("div", In, [
|
|
3800
|
+
e("div", null, [
|
|
3801
|
+
n[7] || (n[7] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Text Input", -1)),
|
|
3802
|
+
_(J, {
|
|
3803
|
+
name: "demoText",
|
|
3804
|
+
label: "Text Input",
|
|
3805
|
+
placeholder: "Type something...",
|
|
3806
|
+
value: l.text,
|
|
3807
|
+
"onUpdate:value": n[0] || (n[0] = (p) => l.text = p)
|
|
3808
|
+
}, null, 8, ["value"])
|
|
3809
|
+
]),
|
|
3810
|
+
e("div", null, [
|
|
3811
|
+
n[8] || (n[8] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Text Area", -1)),
|
|
3812
|
+
_(Ve, {
|
|
3813
|
+
name: "demoTextArea",
|
|
3814
|
+
label: "Text Area",
|
|
3815
|
+
placeholder: "Write a longer message...",
|
|
3816
|
+
rows: 4,
|
|
3817
|
+
maxlength: 200,
|
|
3818
|
+
modelValue: l.textArea,
|
|
3819
|
+
"onUpdate:modelValue": n[1] || (n[1] = (p) => l.textArea = p)
|
|
3820
|
+
}, null, 8, ["modelValue"])
|
|
3821
|
+
]),
|
|
3822
|
+
e("div", null, [
|
|
3823
|
+
n[9] || (n[9] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Switch", -1)),
|
|
3824
|
+
_(Ae, {
|
|
3825
|
+
name: "demoSwitch",
|
|
3826
|
+
label: "Enable feature",
|
|
3827
|
+
modelValue: l.switchOn,
|
|
3828
|
+
"onUpdate:modelValue": n[2] || (n[2] = (p) => l.switchOn = p),
|
|
3829
|
+
textTrue: "ON",
|
|
3830
|
+
textFalse: "OFF"
|
|
3831
|
+
}, null, 8, ["modelValue"])
|
|
3832
|
+
]),
|
|
3833
|
+
e("div", null, [
|
|
3834
|
+
n[10] || (n[10] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Checkbox", -1)),
|
|
3835
|
+
_(Te, {
|
|
3836
|
+
name: "demoCheckbox",
|
|
3837
|
+
label: "I agree to the terms",
|
|
3838
|
+
modelValue: l.checkbox,
|
|
3839
|
+
"onUpdate:modelValue": n[3] || (n[3] = (p) => l.checkbox = p)
|
|
3840
|
+
}, null, 8, ["modelValue"])
|
|
3841
|
+
]),
|
|
3842
|
+
e("div", Dn, [
|
|
3843
|
+
e("div", null, [
|
|
3844
|
+
n[11] || (n[11] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Select (Single)", -1)),
|
|
3845
|
+
_(re, {
|
|
3846
|
+
name: "demoSelect",
|
|
3847
|
+
label: "Favorite Fruit",
|
|
3848
|
+
placeholder: "Select a fruit",
|
|
3849
|
+
items: s,
|
|
3850
|
+
modelValue: l.selectedFruit,
|
|
3851
|
+
"onUpdate:modelValue": n[4] || (n[4] = (p) => l.selectedFruit = p)
|
|
3852
|
+
}, null, 8, ["modelValue"])
|
|
3853
|
+
]),
|
|
3854
|
+
e("div", null, [
|
|
3855
|
+
n[12] || (n[12] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Select (Multiple)", -1)),
|
|
3856
|
+
_(re, {
|
|
3857
|
+
name: "demoSelectMulti",
|
|
3858
|
+
label: "Favorite Languages",
|
|
3859
|
+
placeholder: "Select languages",
|
|
3860
|
+
items: a,
|
|
3861
|
+
multiple: "",
|
|
3862
|
+
showAll: "",
|
|
3863
|
+
modelValue: l.selectedLanguages,
|
|
3864
|
+
"onUpdate:modelValue": n[5] || (n[5] = (p) => l.selectedLanguages = p)
|
|
3865
|
+
}, null, 8, ["modelValue"])
|
|
3866
|
+
])
|
|
3867
|
+
]),
|
|
3868
|
+
e("div", null, [
|
|
3869
|
+
n[13] || (n[13] = e("h3", { class: "sl-text-sm sl-font-medium sl-text-gray-700 sl-mb-2" }, "Combobox", -1)),
|
|
3870
|
+
_(Be, {
|
|
3871
|
+
name: "demoCombobox",
|
|
3872
|
+
label: "Search a City",
|
|
3873
|
+
placeholder: "Start typing...",
|
|
3874
|
+
items: m,
|
|
3875
|
+
modelValue: l.selectedCity,
|
|
3876
|
+
"onUpdate:modelValue": n[6] || (n[6] = (p) => l.selectedCity = p)
|
|
3877
|
+
}, null, 8, ["modelValue"])
|
|
3878
|
+
]),
|
|
3879
|
+
e("div", En, [
|
|
3880
|
+
n[14] || (n[14] = e("div", { class: "sl-font-semibold sl-mb-1" }, "State", -1)),
|
|
3881
|
+
e("pre", Pn, w(l), 1)
|
|
3882
|
+
])
|
|
3883
|
+
])
|
|
3884
|
+
]));
|
|
3885
|
+
}
|
|
3886
|
+
}), zn = { key: 0 }, On = ["onUpdate:modelValue", "placeholder", "disabled", "onKeydown", "onBlur"], jn = ["onClick", "disabled"], Fn = { class: "sl-flex-1 sl-min-w-0 sl-relative" }, Nn = ["placeholder", "disabled", "onKeydown"], Rn = { class: "sl-absolute sl-inset-y-0 sl-right-0 sl-flex sl-items-center sl-pr-3 sl-pointer-events-auto" }, Un = {
|
|
3887
|
+
key: 0,
|
|
3888
|
+
class: "sl-absolute sl-z-50 sl-mt-1 sl-max-h-60 sl-w-full sl-overflow-auto sl-rounded-md sl-bg-white sl-py-1 sl-text-base sl-shadow-lg sl-ring-1 sl-ring-black sl-ring-opacity-5 focus:sl-outline-none sm:sl-text-sm"
|
|
3889
|
+
}, Hn = ["onClick"], Kn = { class: "sl-flex" }, Wn = { class: "sl-truncate sl-font-semibold" }, qn = { class: "sl-block sl-truncate" }, Qn = {
|
|
3890
|
+
key: 0,
|
|
3891
|
+
class: "sl-ml-2 sl-truncate sl-text-gray-500"
|
|
3892
|
+
}, ps = /* @__PURE__ */ z({
|
|
3893
|
+
__name: "TagifyInput",
|
|
3894
|
+
props: {
|
|
3895
|
+
items: {
|
|
3896
|
+
type: Array,
|
|
3897
|
+
required: !0
|
|
3898
|
+
},
|
|
3899
|
+
value: {
|
|
3900
|
+
type: Array,
|
|
3901
|
+
default: () => []
|
|
3902
|
+
},
|
|
3903
|
+
name: {
|
|
3904
|
+
type: String,
|
|
3905
|
+
required: !0
|
|
3906
|
+
},
|
|
3907
|
+
label: {
|
|
3908
|
+
type: String,
|
|
3909
|
+
required: !1
|
|
3910
|
+
},
|
|
3911
|
+
itemKey: {
|
|
3912
|
+
type: String,
|
|
3913
|
+
default: "id"
|
|
3914
|
+
},
|
|
3915
|
+
itemText: {
|
|
3916
|
+
type: String,
|
|
3917
|
+
default: "value"
|
|
3918
|
+
},
|
|
3919
|
+
itemSubtext: {
|
|
3920
|
+
type: String,
|
|
3921
|
+
default: "name"
|
|
3922
|
+
},
|
|
3923
|
+
showSubext: {
|
|
3924
|
+
type: Boolean,
|
|
3925
|
+
default: !0
|
|
3926
|
+
},
|
|
3927
|
+
tagDisplayKey: {
|
|
3928
|
+
type: String,
|
|
3929
|
+
default: "name"
|
|
3930
|
+
},
|
|
3931
|
+
tertiaryLabel: {
|
|
3932
|
+
type: String,
|
|
3933
|
+
required: !1
|
|
3934
|
+
},
|
|
3935
|
+
pattern: {
|
|
3936
|
+
type: RegExp,
|
|
3937
|
+
default: null
|
|
3938
|
+
},
|
|
3939
|
+
inline: {
|
|
3940
|
+
type: Boolean,
|
|
3941
|
+
default: !1
|
|
3942
|
+
},
|
|
3943
|
+
placeholder: {
|
|
3944
|
+
type: String,
|
|
3945
|
+
default: "Add a tag..."
|
|
3946
|
+
},
|
|
3947
|
+
disabled: {
|
|
3948
|
+
type: Boolean,
|
|
3949
|
+
default: !1
|
|
3950
|
+
},
|
|
3951
|
+
optional: {
|
|
3952
|
+
type: Boolean,
|
|
3953
|
+
default: !1
|
|
3954
|
+
},
|
|
3955
|
+
errorMessage: {
|
|
3956
|
+
type: String,
|
|
3957
|
+
default: ""
|
|
3958
|
+
},
|
|
3959
|
+
hasInputRing: {
|
|
3960
|
+
type: Boolean,
|
|
3961
|
+
default: !1
|
|
3962
|
+
}
|
|
3963
|
+
},
|
|
3964
|
+
emits: ["update:value", "update:query", "invalid-tag"],
|
|
3965
|
+
setup(t, { expose: l, emit: s }) {
|
|
3966
|
+
const a = t, m = s, u = P(""), n = P([]), p = P(JSON.parse(JSON.stringify(a.value))), v = P(!1);
|
|
3967
|
+
q(
|
|
3968
|
+
() => a.value,
|
|
3969
|
+
(i) => {
|
|
3970
|
+
JSON.stringify(i) !== JSON.stringify(p.value) && (p.value = JSON.parse(JSON.stringify(i)));
|
|
3971
|
+
},
|
|
3972
|
+
{ deep: !0 }
|
|
3973
|
+
);
|
|
3974
|
+
const $ = (i) => i[a.itemSubtext] || i[a.itemText], c = (i) => i[a.itemSubtext] ? i[a.itemText] : void 0, d = (i) => i[a.tagDisplayKey] || i[a.itemText], g = () => {
|
|
3975
|
+
if (u.value && u.value.length > 0) {
|
|
3976
|
+
m("update:query", u.value);
|
|
3977
|
+
const i = u.value.toLowerCase();
|
|
3978
|
+
n.value = a.items.filter((I) => I[a.itemText]?.toLowerCase().includes(i) || I[a.itemSubtext]?.toLowerCase().includes(i)), v.value = !0;
|
|
3979
|
+
} else
|
|
3980
|
+
n.value = [], v.value = !1;
|
|
3981
|
+
}, h = () => {
|
|
3982
|
+
const i = u.value.trim();
|
|
3983
|
+
if (i === "")
|
|
3984
|
+
return;
|
|
3985
|
+
let I = null;
|
|
3986
|
+
const x = i.toLowerCase(), F = a.items.find(
|
|
3987
|
+
(y) => y[a.itemText]?.toLowerCase() === x || y[a.itemSubtext]?.toLowerCase() === x
|
|
3988
|
+
);
|
|
3989
|
+
if (F)
|
|
3990
|
+
I = { ...F };
|
|
3991
|
+
else if (a.pattern && a.pattern.test(i))
|
|
3992
|
+
I = { id: null, [a.itemText]: i };
|
|
3993
|
+
else
|
|
3994
|
+
return;
|
|
3995
|
+
p.value.some(
|
|
3996
|
+
(y) => y[a.itemText] === I[a.itemText]
|
|
3997
|
+
) || (p.value.push(I), m("update:value", p.value)), u.value = "", n.value = [], v.value = !1;
|
|
3998
|
+
}, k = (i) => {
|
|
3999
|
+
const I = i[a.itemText].trim();
|
|
4000
|
+
p.value.some(
|
|
4001
|
+
(x) => x[a.itemText] === I
|
|
4002
|
+
) || (p.value.push({ ...i }), m("update:value", p.value)), u.value = "", n.value = [], v.value = !1;
|
|
4003
|
+
}, C = (i) => {
|
|
4004
|
+
p.value.splice(i, 1), m("update:value", p.value);
|
|
4005
|
+
}, A = (i) => {
|
|
4006
|
+
p.value[i].isEditing = !0, de(() => {
|
|
4007
|
+
});
|
|
4008
|
+
}, D = (i) => {
|
|
4009
|
+
const I = p.value[i];
|
|
4010
|
+
if (I) {
|
|
4011
|
+
I.isEditing = !1;
|
|
4012
|
+
const x = I[a.itemText].trim();
|
|
4013
|
+
if (a.pattern && !a.pattern.test(x)) {
|
|
4014
|
+
m("invalid-tag", x), C(i);
|
|
4015
|
+
return;
|
|
4016
|
+
}
|
|
4017
|
+
I[a.itemText] = x, m("update:value", p.value);
|
|
4018
|
+
}
|
|
4019
|
+
};
|
|
4020
|
+
return ne(() => {
|
|
4021
|
+
n.value = [];
|
|
4022
|
+
}), l({
|
|
4023
|
+
selectedTags: p
|
|
4024
|
+
}), (i, I) => (o(), K(ee, {
|
|
4025
|
+
id: t.name,
|
|
4026
|
+
name: t.name,
|
|
4027
|
+
label: t.label,
|
|
4028
|
+
"tertiary-label": t.tertiaryLabel,
|
|
4029
|
+
"error-message": t.errorMessage,
|
|
4030
|
+
disabled: t.disabled,
|
|
4031
|
+
optional: t.optional
|
|
4032
|
+
}, {
|
|
4033
|
+
"tertiary-label-overlay": L(() => [
|
|
4034
|
+
S(i.$slots, "tertiary-overlay")
|
|
4035
|
+
]),
|
|
4036
|
+
default: L(() => [
|
|
4037
|
+
e("div", {
|
|
4038
|
+
class: V(["sl-flex sl-flex-wrap sl-items-center sl-gap-4 sl-rounded-md sl-bg-white sl-px-3 sm:sl-text-sm sm:sl-leading-6", t.inline ? null : "sl-shadow-sm sl-border sl-border-gray-300 focus-within:sl-ring-2 focus-within:sl-ring-stachelock-600"])
|
|
4039
|
+
}, [
|
|
4040
|
+
(o(!0), r(E, null, j(p.value, (x, F) => (o(), K(Ze, {
|
|
4041
|
+
key: F,
|
|
4042
|
+
onClick: (y) => A(F),
|
|
4043
|
+
theme: "primary",
|
|
4044
|
+
size: "sm"
|
|
4045
|
+
}, {
|
|
4046
|
+
default: L(() => [
|
|
4047
|
+
x.isEditing ? me((o(), r("input", {
|
|
4048
|
+
key: 1,
|
|
4049
|
+
ref_for: !0,
|
|
4050
|
+
ref: "editInput",
|
|
4051
|
+
"onUpdate:modelValue": (y) => x[a.itemText] = y,
|
|
4052
|
+
placeholder: t.placeholder,
|
|
4053
|
+
disabled: t.disabled,
|
|
4054
|
+
onKeydown: fe(Y((y) => D(F), ["prevent"]), ["enter"]),
|
|
4055
|
+
onBlur: (y) => D(F),
|
|
4056
|
+
class: "sl-bg-transparent sl-border-none sl-outline-none sl-text-stachelock-600 sl-text-sm placeholder:sl-text-stachelock-400/80 focus:sl-ring-0 focus:sl-ring-stachelock-600 focus:sl-rounded-lg -sl-mx-3 -sl-my-2",
|
|
4057
|
+
style: le({ width: x[a.itemText].length + 4 + "ch" })
|
|
4058
|
+
}, null, 44, On)), [
|
|
4059
|
+
[be, x[a.itemText]]
|
|
4060
|
+
]) : (o(), r("span", zn, w(d(x)), 1)),
|
|
4061
|
+
e("button", {
|
|
4062
|
+
type: "button",
|
|
4063
|
+
class: "sl-ml-2 sl-text-stachelock-600 hover:sl-text-stachelock-400 focus:sl-outline-none",
|
|
4064
|
+
onClick: Y((y) => C(F), ["stop"]),
|
|
4065
|
+
disabled: t.disabled
|
|
4066
|
+
}, [
|
|
4067
|
+
_(f(Os), { class: "sl-h-4 sl-w-4" })
|
|
4068
|
+
], 8, jn)
|
|
4069
|
+
]),
|
|
4070
|
+
_: 2
|
|
4071
|
+
}, 1032, ["onClick"]))), 128)),
|
|
4072
|
+
e("div", Fn, [
|
|
4073
|
+
me(e("input", {
|
|
4074
|
+
ref: "input",
|
|
4075
|
+
"onUpdate:modelValue": I[0] || (I[0] = (x) => u.value = x),
|
|
4076
|
+
placeholder: t.placeholder,
|
|
4077
|
+
onInput: g,
|
|
4078
|
+
disabled: t.disabled,
|
|
4079
|
+
onKeydown: fe(Y(h, ["prevent"]), ["enter"]),
|
|
4080
|
+
class: "sl-w-full sl-border-none sl-outline-none sl-rounded-md focus:sl-ring-0 sl-text-sm sl-font-light -sl-mx-3 sl-pr-12"
|
|
4081
|
+
}, null, 40, Nn), [
|
|
4082
|
+
[be, u.value]
|
|
4083
|
+
]),
|
|
4084
|
+
e("div", Rn, [
|
|
4085
|
+
S(i.$slots, "input-overlay")
|
|
4086
|
+
]),
|
|
4087
|
+
v.value && !t.disabled ? (o(), r("div", Un, [
|
|
4088
|
+
(o(!0), r(E, null, j(n.value, (x) => (o(), r("div", {
|
|
4089
|
+
key: x[t.itemKey],
|
|
4090
|
+
class: "sl-cursor-pointer sl-select-none sl-py-2 sl-pl-3 sl-pr-9 hover:sl-bg-stachelock-600 hover:sl-text-white",
|
|
4091
|
+
onClick: Y((F) => k(x), ["prevent"])
|
|
4092
|
+
}, [
|
|
4093
|
+
e("div", Kn, [
|
|
4094
|
+
e("span", Wn, [
|
|
4095
|
+
e("span", qn, w($(x)), 1)
|
|
4096
|
+
]),
|
|
4097
|
+
t.showSubext ? (o(), r("span", Qn, w(c(x)), 1)) : b("", !0)
|
|
4098
|
+
])
|
|
4099
|
+
], 8, Hn))), 128))
|
|
4100
|
+
])) : b("", !0)
|
|
4101
|
+
])
|
|
4102
|
+
], 2)
|
|
4103
|
+
]),
|
|
4104
|
+
_: 3
|
|
4105
|
+
}, 8, ["id", "name", "label", "tertiary-label", "error-message", "disabled", "optional"]));
|
|
4106
|
+
}
|
|
4107
|
+
}), Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4108
|
+
__proto__: null,
|
|
4109
|
+
CheckboxInput: Te,
|
|
4110
|
+
ComboboxInput: Be,
|
|
4111
|
+
InputsShowcase: gs,
|
|
4112
|
+
SelectInput: re,
|
|
4113
|
+
SwitchInput: Ae,
|
|
4114
|
+
TagifyInput: ps,
|
|
4115
|
+
TextAreaInput: Ve
|
|
4116
|
+
}, Symbol.toStringTag, { value: "Module" })), Jn = { class: "sl-min-h-screen sl-bg-gray-50" }, Yn = { class: "sl-fixed sl-inset-0 sl-flex" }, Xn = { class: "sl-absolute sl-left-full sl-top-0 sl-flex sl-w-16 sl-justify-center sl-pt-5" }, Zn = { class: "sl-flex sl-grow sl-flex-col sl-gap-y-5 sl-bg-stachelock-600 sl-px-6 sl-pb-2 sl-ring-1 sl-ring-white/10" }, er = { class: "sl-flex sl-h-16 sl-shrink-0 sl-items-center" }, sr = { class: "sl-flex sl-flex-1 sl-flex-col" }, lr = {
|
|
4117
|
+
role: "list",
|
|
4118
|
+
class: "-sl-mx-2 sl-flex-1 sl-space-y-1"
|
|
4119
|
+
}, tr = { class: "sl-mt-auto" }, ar = { class: "sl-flex sl-h-16 sl-shrink-0 sl-items-center sl-px-6" }, or = { class: "sl-mt-8 sl-flex sl-flex-col sl-justify-between sl-h-full" }, nr = { class: "sl-absolute sl-bottom-4 sl-left-0 sl-right-0 sl-px-6" }, rr = { class: "sl-sticky sl-top-0 sl-z-40 sl-flex sl-h-16 sl-shrink-0 sl-items-center sl-gap-x-4 sl-border-b sl-border-gray-200 sl-bg-white sl-px-4 sl-shadow-sm sm:sl-gap-x-6 sm:sl-px-6 lg:sl-px-8" }, ir = { class: "sl-flex sl-flex-1 sl-gap-x-4 sm:sl-self-stretch lg:sl-gap-x-6" }, dr = { class: "sl-relative sl-flex sl-flex-1" }, ur = { class: "sl-flex sl-items-center sl-gap-x-4 lg:sl-gap-x-6" }, cr = {
|
|
4120
|
+
key: 0,
|
|
4121
|
+
class: "sl-border-b sl-border-gray-200 sl-bg-white sl-px-4 sl-py-6 sm:sl-px-6 lg:sl-px-8"
|
|
4122
|
+
}, mr = { class: "sl-px-4 sm:sl-px-6 lg:sl-px-8 sl-py-6" }, fr = {
|
|
4123
|
+
key: 1,
|
|
4124
|
+
class: "sl-border-t sl-border-gray-200 sl-bg-white sl-px-4 sl-py-6 sm:sl-px-6 lg:sl-px-8"
|
|
4125
|
+
}, hs = /* @__PURE__ */ z({
|
|
4126
|
+
__name: "DashboardLayout",
|
|
4127
|
+
props: {
|
|
4128
|
+
isWideSidebar: {
|
|
4129
|
+
type: Boolean,
|
|
4130
|
+
default: !1
|
|
4131
|
+
}
|
|
4132
|
+
},
|
|
4133
|
+
emits: ["sidebar-toggle"],
|
|
4134
|
+
setup(t, { emit: l }) {
|
|
4135
|
+
const s = P(!1), a = () => {
|
|
4136
|
+
s.value = !1;
|
|
4137
|
+
}, m = () => {
|
|
4138
|
+
s.value = !0;
|
|
4139
|
+
};
|
|
4140
|
+
return (u, n) => (o(), r("div", Jn, [
|
|
4141
|
+
_(f(ve), {
|
|
4142
|
+
as: "template",
|
|
4143
|
+
show: s.value
|
|
4144
|
+
}, {
|
|
4145
|
+
default: L(() => [
|
|
4146
|
+
_(f(ke), {
|
|
4147
|
+
as: "div",
|
|
4148
|
+
class: "sl-relative sl-z-50 lg:sl-hidden",
|
|
4149
|
+
onClose: a
|
|
4150
|
+
}, {
|
|
4151
|
+
default: L(() => [
|
|
4152
|
+
_(f(se), {
|
|
4153
|
+
as: "template",
|
|
4154
|
+
enter: "sl-transition-opacity sl-ease-linear sl-duration-300",
|
|
4155
|
+
"enter-from": "sl-opacity-0",
|
|
4156
|
+
"enter-to": "sl-opacity-100",
|
|
4157
|
+
leave: "sl-transition-opacity sl-ease-linear sl-duration-300",
|
|
4158
|
+
"leave-from": "sl-opacity-100",
|
|
4159
|
+
"leave-to": "sl-opacity-0"
|
|
4160
|
+
}, {
|
|
4161
|
+
default: L(() => n[2] || (n[2] = [
|
|
4162
|
+
e("div", { class: "sl-fixed sl-inset-0 sl-bg-gray-900/80" }, null, -1)
|
|
4163
|
+
])),
|
|
4164
|
+
_: 1,
|
|
4165
|
+
__: [2]
|
|
4166
|
+
}),
|
|
4167
|
+
e("div", Yn, [
|
|
4168
|
+
_(f(se), {
|
|
4169
|
+
as: "template",
|
|
4170
|
+
enter: "sl-transition sl-ease-in-out sl-duration-300 sl-transform",
|
|
4171
|
+
"enter-from": "-sl-translate-x-full",
|
|
4172
|
+
"enter-to": "sl-translate-x-0",
|
|
4173
|
+
leave: "sl-transition sl-ease-in-out sl-duration-300 sl-transform",
|
|
4174
|
+
"leave-from": "sl-translate-x-0",
|
|
4175
|
+
"leave-to": "-sl-translate-x-full"
|
|
4176
|
+
}, {
|
|
4177
|
+
default: L(() => [
|
|
4178
|
+
_(f($e), { class: "sl-relative sl-mr-16 sl-flex sl-w-full sl-max-w-xs sl-flex-1" }, {
|
|
4179
|
+
default: L(() => [
|
|
4180
|
+
_(f(se), {
|
|
4181
|
+
as: "template",
|
|
4182
|
+
enter: "sl-ease-in-out sl-duration-300",
|
|
4183
|
+
"enter-from": "sl-opacity-0",
|
|
4184
|
+
"enter-to": "sl-opacity-100",
|
|
4185
|
+
leave: "sl-ease-in-out sl-duration-300",
|
|
4186
|
+
"leave-from": "sl-opacity-100",
|
|
4187
|
+
"leave-to": "sl-opacity-0"
|
|
4188
|
+
}, {
|
|
4189
|
+
default: L(() => [
|
|
4190
|
+
e("div", Xn, [
|
|
4191
|
+
e("button", {
|
|
4192
|
+
type: "button",
|
|
4193
|
+
class: "-sl-m-2.5 sl-p-2.5",
|
|
4194
|
+
onClick: n[0] || (n[0] = (p) => a())
|
|
4195
|
+
}, [
|
|
4196
|
+
n[3] || (n[3] = e("span", { class: "sl-sr-only" }, "Close sidebar", -1)),
|
|
4197
|
+
_(f(Je), {
|
|
4198
|
+
class: "sl-h-6 sl-w-6 sl-text-stachelock-050",
|
|
4199
|
+
"aria-hidden": "true"
|
|
4200
|
+
})
|
|
4201
|
+
])
|
|
4202
|
+
])
|
|
4203
|
+
]),
|
|
4204
|
+
_: 1
|
|
4205
|
+
}),
|
|
4206
|
+
e("div", Zn, [
|
|
4207
|
+
e("div", er, [
|
|
4208
|
+
S(u.$slots, "logo", {}, () => [
|
|
4209
|
+
n[4] || (n[4] = e("div", { class: "sl-text-stachelock-050 sl-font-semibold sl-text-lg" }, "Logo", -1))
|
|
4210
|
+
])
|
|
4211
|
+
]),
|
|
4212
|
+
e("nav", sr, [
|
|
4213
|
+
e("ul", lr, [
|
|
4214
|
+
S(u.$slots, "navigation")
|
|
4215
|
+
])
|
|
4216
|
+
]),
|
|
4217
|
+
e("div", tr, [
|
|
4218
|
+
S(u.$slots, "sidebar-footer")
|
|
4219
|
+
])
|
|
4220
|
+
])
|
|
4221
|
+
]),
|
|
4222
|
+
_: 3
|
|
4223
|
+
})
|
|
4224
|
+
]),
|
|
4225
|
+
_: 3
|
|
4226
|
+
})
|
|
4227
|
+
])
|
|
4228
|
+
]),
|
|
4229
|
+
_: 3
|
|
4230
|
+
})
|
|
4231
|
+
]),
|
|
4232
|
+
_: 3
|
|
4233
|
+
}, 8, ["show"]),
|
|
4234
|
+
e("div", {
|
|
4235
|
+
class: V(["sl-hidden lg:sl-fixed lg:sl-inset-y-0 lg:sl-left-0 lg:sl-z-50 lg:sl-block lg:sl-pb-4 sl-pt-4 lg:sl-bg-stachelock-600", t.isWideSidebar ? "lg:sl-w-72" : "lg:sl-w-20"])
|
|
4236
|
+
}, [
|
|
4237
|
+
e("div", ar, [
|
|
4238
|
+
S(u.$slots, "logo", {}, () => [
|
|
4239
|
+
n[5] || (n[5] = e("div", { class: "sl-text-stachelock-050 sl-font-semibold sl-text-lg" }, "Logo", -1))
|
|
4240
|
+
])
|
|
4241
|
+
]),
|
|
4242
|
+
e("nav", or, [
|
|
4243
|
+
e("ul", {
|
|
4244
|
+
role: "list",
|
|
4245
|
+
class: V(t.isWideSidebar ? "sl-flex sl-flex-col sl-items-start sl-mx-4 sl-space-y-1" : "sl-flex sl-flex-col sl-items-center sl-space-y-1")
|
|
4246
|
+
}, [
|
|
4247
|
+
S(u.$slots, "navigation")
|
|
4248
|
+
], 2),
|
|
4249
|
+
e("div", nr, [
|
|
4250
|
+
S(u.$slots, "sidebar-footer")
|
|
4251
|
+
])
|
|
4252
|
+
])
|
|
4253
|
+
], 2),
|
|
4254
|
+
e("div", {
|
|
4255
|
+
class: V(["lg:sl-pl-20", t.isWideSidebar ? "lg:sl-pl-72" : "lg:sl-pl-20"])
|
|
4256
|
+
}, [
|
|
4257
|
+
e("div", rr, [
|
|
4258
|
+
e("button", {
|
|
4259
|
+
type: "button",
|
|
4260
|
+
class: "-sl-m-2.5 sl-p-2.5 sl-text-gray-700 lg:sl-hidden",
|
|
4261
|
+
onClick: n[1] || (n[1] = (p) => m())
|
|
4262
|
+
}, [
|
|
4263
|
+
n[6] || (n[6] = e("span", { class: "sl-sr-only" }, "Open sidebar", -1)),
|
|
4264
|
+
_(f(Ye), {
|
|
4265
|
+
class: "sl-h-6 sl-w-6",
|
|
4266
|
+
"aria-hidden": "true"
|
|
4267
|
+
})
|
|
4268
|
+
]),
|
|
4269
|
+
n[7] || (n[7] = e("div", {
|
|
4270
|
+
class: "sl-h-6 sl-w-px sl-bg-gray-900/10 lg:sl-hidden",
|
|
4271
|
+
"aria-hidden": "true"
|
|
4272
|
+
}, null, -1)),
|
|
4273
|
+
e("div", ir, [
|
|
4274
|
+
e("div", dr, [
|
|
4275
|
+
S(u.$slots, "header-content")
|
|
4276
|
+
]),
|
|
4277
|
+
e("div", ur, [
|
|
4278
|
+
S(u.$slots, "header-right")
|
|
4279
|
+
])
|
|
4280
|
+
])
|
|
4281
|
+
]),
|
|
4282
|
+
u.$slots["page-header"] ? (o(), r("div", cr, [
|
|
4283
|
+
S(u.$slots, "page-header")
|
|
4284
|
+
])) : b("", !0),
|
|
4285
|
+
e("main", mr, [
|
|
4286
|
+
S(u.$slots, "main")
|
|
4287
|
+
]),
|
|
4288
|
+
u.$slots.footer ? (o(), r("footer", fr, [
|
|
4289
|
+
S(u.$slots, "footer")
|
|
4290
|
+
])) : b("", !0)
|
|
4291
|
+
], 2)
|
|
4292
|
+
]));
|
|
4293
|
+
}
|
|
4294
|
+
}), gr = { class: "sl-relative" }, pr = {
|
|
4295
|
+
key: 0,
|
|
4296
|
+
class: "sl-py-16 lg:sl-ml-12 sl-mx-2"
|
|
4297
|
+
}, hr = { class: "sl-mx-auto sl-max-w-7xl" }, vr = { class: "sl-mx-auto sl-max-w-2xl lg:sl-mx-0" }, yr = { class: "sl-h-2" }, br = {
|
|
4298
|
+
key: 0,
|
|
4299
|
+
class: "sl-mt-1"
|
|
4300
|
+
}, xr = {
|
|
4301
|
+
key: 1,
|
|
4302
|
+
class: "sl-mx-auto sl-z-50 sl-flex sl-h-16 lg:sl-h-16 sl-border-gray-900/10"
|
|
4303
|
+
}, wr = { class: "sl-flex sl-h-16 lg:sl-h-16 sl-w-full sl-px-4 sm:sl-px-6 lg:sl-px-8 sl-justify-between" }, kr = { class: "sl-flex sl-justify-end sl-items-center sl-ml-auto" }, $r = {
|
|
4304
|
+
key: 2,
|
|
4305
|
+
class: "lg:sl-mx-12 sl-mx-2 sl-pb-16"
|
|
4306
|
+
}, _r = {
|
|
4307
|
+
key: 5,
|
|
4308
|
+
class: "lg:sl-mx-12 sl-mx-2 sl-pb-16"
|
|
4309
|
+
}, vs = /* @__PURE__ */ z({
|
|
4310
|
+
__name: "DefaultLayout",
|
|
4311
|
+
props: {
|
|
4312
|
+
title: {
|
|
4313
|
+
type: String,
|
|
4314
|
+
required: !1,
|
|
4315
|
+
default: ""
|
|
4316
|
+
},
|
|
4317
|
+
titleClass: {
|
|
4318
|
+
type: String,
|
|
4319
|
+
default: "sl-text-4xl sl-font-bold sl-tracking-tight sl-text-gray-800"
|
|
4320
|
+
},
|
|
4321
|
+
subtitle: {
|
|
4322
|
+
type: String,
|
|
4323
|
+
required: !1,
|
|
4324
|
+
default: ""
|
|
4325
|
+
},
|
|
4326
|
+
subtitleClass: {
|
|
4327
|
+
type: String,
|
|
4328
|
+
default: "sl-text-lg sl-leading-8 sl-text-gray-600"
|
|
4329
|
+
}
|
|
4330
|
+
},
|
|
4331
|
+
setup(t) {
|
|
4332
|
+
return (l, s) => (o(), r("div", gr, [
|
|
4333
|
+
t.title ? (o(), r("div", pr, [
|
|
4334
|
+
e("div", hr, [
|
|
4335
|
+
e("div", vr, [
|
|
4336
|
+
e("h1", {
|
|
4337
|
+
class: V(t.titleClass)
|
|
4338
|
+
}, w(t.title), 3),
|
|
4339
|
+
t.subtitle ? (o(), r("p", {
|
|
4340
|
+
key: 0,
|
|
4341
|
+
class: V([t.subtitleClass, "sl-mt-6"])
|
|
4342
|
+
}, w(t.subtitle), 3)) : b("", !0),
|
|
4343
|
+
e("div", yr, [
|
|
4344
|
+
l.$slots.bottomCaption ? (o(), r("div", br, [
|
|
4345
|
+
S(l.$slots, "bottomCaption")
|
|
4346
|
+
])) : b("", !0)
|
|
4347
|
+
])
|
|
4348
|
+
])
|
|
4349
|
+
])
|
|
4350
|
+
])) : !t.title && l.$slots.right ? (o(), r("header", xr, [
|
|
4351
|
+
e("div", wr, [
|
|
4352
|
+
s[0] || (s[0] = e("div", { class: "sl-hidden lg:sl-flex lg:sl-justify-start lg:sl-items-center" }, null, -1)),
|
|
4353
|
+
e("div", kr, [
|
|
4354
|
+
S(l.$slots, "right")
|
|
4355
|
+
])
|
|
4356
|
+
])
|
|
4357
|
+
])) : b("", !0),
|
|
4358
|
+
l.$slots.main ? (o(), r("div", $r, [
|
|
4359
|
+
S(l.$slots, "main")
|
|
4360
|
+
])) : b("", !0),
|
|
4361
|
+
l.$slots.container ? (o(), r("div", {
|
|
4362
|
+
key: 3,
|
|
4363
|
+
class: V(t.title ? "sl-pb-12" : "sl-my-4 sm:sl-py-12")
|
|
4364
|
+
}, [
|
|
4365
|
+
S(l.$slots, "container")
|
|
4366
|
+
], 2)) : b("", !0),
|
|
4367
|
+
l.$slots.home ? S(l.$slots, "home", { key: 4 }) : b("", !0),
|
|
4368
|
+
l.$slots.default ? (o(), r("div", _r, [
|
|
4369
|
+
S(l.$slots, "default")
|
|
4370
|
+
])) : b("", !0)
|
|
4371
|
+
]));
|
|
4372
|
+
}
|
|
4373
|
+
}), Cr = { class: "sl-min-h-screen sl-bg-gray-50" }, Sr = { class: "sl-bg-white sl-shadow" }, Mr = { class: "sl-mx-auto sl-max-w-7xl sl-px-4 sm:sl-px-6 lg:sl-px-8" }, Tr = { class: "sl-flex sl-h-16 sl-items-center sl-justify-between" }, Br = { class: "sl-flex sl-items-center" }, Vr = { class: "sl-flex-shrink-0" }, Ar = { class: "sl-ml-10 sl-hidden sm:sl-flex sm:sl-space-x-8" }, Lr = { class: "sl-flex sl-items-center sl-space-x-4" }, Ir = { class: "sm:sl-hidden" }, Dr = { class: "sl-mx-auto sl-max-w-7xl sl-py-6 sm:sl-px-6 lg:sl-px-8" }, Er = {
|
|
4374
|
+
key: 0,
|
|
4375
|
+
class: "sl-bg-white sl-border-t sl-border-gray-200"
|
|
4376
|
+
}, Pr = { class: "sl-mx-auto sl-max-w-7xl sl-px-4 sm:sl-px-6 lg:sl-px-8" }, zr = { class: "sl-py-8" }, ys = /* @__PURE__ */ z({
|
|
4377
|
+
__name: "HeaderLayout",
|
|
4378
|
+
setup(t) {
|
|
4379
|
+
return (l, s) => (o(), r("div", Cr, [
|
|
4380
|
+
e("header", Sr, [
|
|
4381
|
+
e("div", Mr, [
|
|
4382
|
+
e("div", Tr, [
|
|
4383
|
+
e("div", Br, [
|
|
4384
|
+
e("div", Vr, [
|
|
4385
|
+
S(l.$slots, "logo", {}, () => [
|
|
4386
|
+
s[0] || (s[0] = e("div", { class: "sl-text-xl sl-font-bold sl-text-stachelock-600" }, "Logo", -1))
|
|
4387
|
+
])
|
|
4388
|
+
]),
|
|
4389
|
+
e("nav", Ar, [
|
|
4390
|
+
S(l.$slots, "primary-navigation")
|
|
4391
|
+
])
|
|
4392
|
+
]),
|
|
4393
|
+
e("div", Lr, [
|
|
4394
|
+
S(l.$slots, "header-right")
|
|
4395
|
+
])
|
|
4396
|
+
])
|
|
4397
|
+
]),
|
|
4398
|
+
e("div", Ir, [
|
|
4399
|
+
S(l.$slots, "mobile-navigation")
|
|
4400
|
+
])
|
|
4401
|
+
]),
|
|
4402
|
+
e("main", null, [
|
|
4403
|
+
e("div", Dr, [
|
|
4404
|
+
S(l.$slots, "main")
|
|
4405
|
+
])
|
|
4406
|
+
]),
|
|
4407
|
+
l.$slots.footer ? (o(), r("footer", Er, [
|
|
4408
|
+
e("div", Pr, [
|
|
4409
|
+
e("div", zr, [
|
|
4410
|
+
S(l.$slots, "footer")
|
|
4411
|
+
])
|
|
4412
|
+
])
|
|
4413
|
+
])) : b("", !0)
|
|
4414
|
+
]));
|
|
4415
|
+
}
|
|
4416
|
+
}), Or = { class: "sl-space-y-1" }, jr = {
|
|
4417
|
+
role: "list",
|
|
4418
|
+
class: "sl-space-y-1"
|
|
4419
|
+
}, bs = /* @__PURE__ */ z({
|
|
4420
|
+
__name: "NavigationGroup",
|
|
4421
|
+
props: {
|
|
4422
|
+
title: {},
|
|
4423
|
+
iconOnly: { type: Boolean }
|
|
4424
|
+
},
|
|
4425
|
+
setup(t) {
|
|
4426
|
+
return (l, s) => (o(), r("div", Or, [
|
|
4427
|
+
l.title ? (o(), r("h3", {
|
|
4428
|
+
key: 0,
|
|
4429
|
+
class: V([
|
|
4430
|
+
"sl-px-3 sl-py-2 sl-text-xs sl-font-semibold sl-text-stachelock-050 sl-uppercase sl-tracking-wider",
|
|
4431
|
+
l.iconOnly ? "sl-text-center" : ""
|
|
4432
|
+
])
|
|
4433
|
+
}, w(l.title), 3)) : b("", !0),
|
|
4434
|
+
e("ul", jr, [
|
|
4435
|
+
S(l.$slots, "default")
|
|
4436
|
+
])
|
|
4437
|
+
]));
|
|
4438
|
+
}
|
|
4439
|
+
}), Fr = ["href"], Nr = {
|
|
4440
|
+
key: 0,
|
|
4441
|
+
class: "sl-truncate"
|
|
4442
|
+
}, xs = /* @__PURE__ */ z({
|
|
4443
|
+
__name: "NavigationItem",
|
|
4444
|
+
props: {
|
|
4445
|
+
name: {},
|
|
4446
|
+
href: {},
|
|
4447
|
+
icon: {},
|
|
4448
|
+
isActive: { type: Boolean },
|
|
4449
|
+
iconOnly: { type: Boolean },
|
|
4450
|
+
badge: {},
|
|
4451
|
+
badgeTheme: {}
|
|
4452
|
+
},
|
|
4453
|
+
setup(t) {
|
|
4454
|
+
return (l, s) => (o(), r("li", null, [
|
|
4455
|
+
e("a", {
|
|
4456
|
+
href: l.href,
|
|
4457
|
+
class: V([
|
|
4458
|
+
"sl-group sl-flex sl-gap-x-3 sl-rounded-md sl-p-2 sl-text-sm sl-leading-6 sl-font-semibold",
|
|
4459
|
+
l.isActive ? "sl-bg-stachelock-400 sl-text-stachelock-050" : "sl-text-stachelock-300 hover:sl-text-stachelock-050 hover:sl-bg-white/10"
|
|
4460
|
+
])
|
|
4461
|
+
}, [
|
|
4462
|
+
(o(), K(ce(l.icon), {
|
|
4463
|
+
class: V([
|
|
4464
|
+
"sl-h-6 sl-w-6 sl-shrink-0",
|
|
4465
|
+
l.isActive ? "sl-text-stachelock-050" : "sl-text-stachelock-300 group-hover:sl-text-stachelock-050"
|
|
4466
|
+
]),
|
|
4467
|
+
"aria-hidden": "true"
|
|
4468
|
+
}, null, 8, ["class"])),
|
|
4469
|
+
l.iconOnly ? b("", !0) : (o(), r("span", Nr, w(l.name), 1)),
|
|
4470
|
+
l.badge ? (o(), r("span", {
|
|
4471
|
+
key: 1,
|
|
4472
|
+
class: V([
|
|
4473
|
+
"sl-ml-auto sl-inline-flex sl-items-center sl-rounded-md sl-px-2 sl-py-1 sl-text-xs sl-font-medium",
|
|
4474
|
+
l.badgeTheme === "primary" ? "sl-bg-stachelock-400 sl-text-white" : "",
|
|
4475
|
+
l.badgeTheme === "secondary" ? "sl-bg-gray-400 sl-text-white" : "",
|
|
4476
|
+
l.badgeTheme === "success" ? "sl-bg-green-400 sl-text-white" : "",
|
|
4477
|
+
l.badgeTheme === "warning" ? "sl-bg-yellow-400 sl-text-white" : "",
|
|
4478
|
+
l.badgeTheme === "danger" ? "sl-bg-red-400 sl-text-white" : ""
|
|
4479
|
+
])
|
|
4480
|
+
}, w(l.badge), 3)) : b("", !0)
|
|
4481
|
+
], 10, Fr)
|
|
4482
|
+
]));
|
|
4483
|
+
}
|
|
4484
|
+
}), Rr = { class: "sl-relative" }, Ur = { class: "sl-fixed sl-inset-0 sl-flex" }, Hr = { class: "sl-absolute sl-left-full sl-top-0 sl-flex sl-w-16 sl-justify-center sl-pt-5" }, Kr = { class: "sl-flex sl-grow sl-flex-col sl-gap-y-5 sl-bg-stachelock-600 sl-px-6 sl-pb-2 sl-ring-1 sl-ring-white/10" }, Wr = { class: "sl-flex sl-h-16 sl-shrink-0 sl-items-center" }, qr = { class: "sl-flex sl-flex-1 sl-flex-col" }, Qr = {
|
|
4485
|
+
role: "list",
|
|
4486
|
+
class: "-sl-mx-2 sl-flex-1 sl-space-y-1"
|
|
4487
|
+
}, Gr = { class: "sl-mt-auto" }, Jr = { class: "sl-flex sl-h-16 sl-shrink-0 sl-items-center sl-px-6" }, Yr = { class: "sl-mt-8 sl-flex sl-flex-col sl-justify-between sl-h-full" }, Xr = { class: "sl-absolute sl-bottom-4 sl-left-0 sl-right-0 sl-px-6" }, Zr = { class: "sl-sticky sl-top-0 sl-z-40 sl-flex sl-h-16 sl-shrink-0 sl-items-center sl-gap-x-4 sl-border-b sl-border-gray-200 sl-bg-white sl-px-4 sl-shadow-sm sm:sl-gap-x-6 sm:sl-px-6 lg:sl-px-8" }, ei = { class: "sl-flex sl-flex-1 sl-gap-x-4 sm:sl-self-stretch lg:sl-gap-x-6" }, si = { class: "sl-relative sl-flex sl-flex-1" }, li = { class: "sl-flex sl-items-center sl-gap-x-4 lg:sl-gap-x-6" }, ti = { class: "sl-px-4 sm:sl-px-6 lg:sl-px-8 sl-py-6" }, ws = /* @__PURE__ */ z({
|
|
4488
|
+
__name: "SidebarLayout",
|
|
4489
|
+
props: {
|
|
4490
|
+
isWideSidebar: {
|
|
4491
|
+
type: Boolean,
|
|
4492
|
+
default: !1
|
|
4493
|
+
}
|
|
4494
|
+
},
|
|
4495
|
+
setup(t) {
|
|
4496
|
+
const l = P(!1), s = () => {
|
|
4497
|
+
l.value = !1;
|
|
4498
|
+
}, a = () => {
|
|
4499
|
+
l.value = !0;
|
|
4500
|
+
};
|
|
4501
|
+
return (m, u) => (o(), r("div", Rr, [
|
|
4502
|
+
_(f(ve), {
|
|
4503
|
+
as: "template",
|
|
4504
|
+
show: l.value
|
|
4505
|
+
}, {
|
|
4506
|
+
default: L(() => [
|
|
4507
|
+
_(f(ke), {
|
|
4508
|
+
as: "div",
|
|
4509
|
+
class: "sl-relative sl-z-50 lg:sl-hidden",
|
|
4510
|
+
onClose: s
|
|
4511
|
+
}, {
|
|
4512
|
+
default: L(() => [
|
|
4513
|
+
_(f(se), {
|
|
4514
|
+
as: "template",
|
|
4515
|
+
enter: "sl-transition-opacity sl-ease-linear sl-duration-300",
|
|
4516
|
+
"enter-from": "sl-opacity-0",
|
|
4517
|
+
"enter-to": "sl-opacity-100",
|
|
4518
|
+
leave: "sl-transition-opacity sl-ease-linear sl-duration-300",
|
|
4519
|
+
"leave-from": "sl-opacity-100",
|
|
4520
|
+
"leave-to": "sl-opacity-0"
|
|
4521
|
+
}, {
|
|
4522
|
+
default: L(() => u[2] || (u[2] = [
|
|
4523
|
+
e("div", { class: "sl-fixed sl-inset-0 sl-bg-gray-900/80" }, null, -1)
|
|
4524
|
+
])),
|
|
4525
|
+
_: 1,
|
|
4526
|
+
__: [2]
|
|
4527
|
+
}),
|
|
4528
|
+
e("div", Ur, [
|
|
4529
|
+
_(f(se), {
|
|
4530
|
+
as: "template",
|
|
4531
|
+
enter: "sl-transition sl-ease-in-out sl-duration-300 sl-transform",
|
|
4532
|
+
"enter-from": "-sl-translate-x-full",
|
|
4533
|
+
"enter-to": "sl-translate-x-0",
|
|
4534
|
+
leave: "sl-transition sl-ease-in-out sl-duration-300 sl-transform",
|
|
4535
|
+
"leave-from": "sl-translate-x-0",
|
|
4536
|
+
"leave-to": "-sl-translate-x-full"
|
|
4537
|
+
}, {
|
|
4538
|
+
default: L(() => [
|
|
4539
|
+
_(f($e), { class: "sl-relative sl-mr-16 sl-flex sl-w-full sl-max-w-xs sl-flex-1" }, {
|
|
4540
|
+
default: L(() => [
|
|
4541
|
+
_(f(se), {
|
|
4542
|
+
as: "template",
|
|
4543
|
+
enter: "sl-ease-in-out sl-duration-300",
|
|
4544
|
+
"enter-from": "sl-opacity-0",
|
|
4545
|
+
"enter-to": "sl-opacity-100",
|
|
4546
|
+
leave: "sl-ease-in-out sl-duration-300",
|
|
4547
|
+
"leave-from": "sl-opacity-100",
|
|
4548
|
+
"leave-to": "sl-opacity-0"
|
|
4549
|
+
}, {
|
|
4550
|
+
default: L(() => [
|
|
4551
|
+
e("div", Hr, [
|
|
4552
|
+
e("button", {
|
|
4553
|
+
type: "button",
|
|
4554
|
+
class: "-sl-m-2.5 sl-p-2.5",
|
|
4555
|
+
onClick: u[0] || (u[0] = (n) => s())
|
|
4556
|
+
}, [
|
|
4557
|
+
u[3] || (u[3] = e("span", { class: "sl-sr-only" }, "Close sidebar", -1)),
|
|
4558
|
+
_(f(Je), {
|
|
4559
|
+
class: "sl-h-6 sl-w-6 sl-text-stachelock-050",
|
|
4560
|
+
"aria-hidden": "true"
|
|
4561
|
+
})
|
|
4562
|
+
])
|
|
4563
|
+
])
|
|
4564
|
+
]),
|
|
4565
|
+
_: 1
|
|
4566
|
+
}),
|
|
4567
|
+
e("div", Kr, [
|
|
4568
|
+
e("div", Wr, [
|
|
4569
|
+
S(m.$slots, "logo", {}, () => [
|
|
4570
|
+
u[4] || (u[4] = e("div", { class: "sl-text-stachelock-050 sl-font-semibold sl-text-lg" }, "Logo", -1))
|
|
4571
|
+
])
|
|
4572
|
+
]),
|
|
4573
|
+
e("nav", qr, [
|
|
4574
|
+
e("ul", Qr, [
|
|
4575
|
+
S(m.$slots, "navigation")
|
|
4576
|
+
])
|
|
4577
|
+
]),
|
|
4578
|
+
e("div", Gr, [
|
|
4579
|
+
S(m.$slots, "sidebar-footer")
|
|
4580
|
+
])
|
|
4581
|
+
])
|
|
4582
|
+
]),
|
|
4583
|
+
_: 3
|
|
4584
|
+
})
|
|
4585
|
+
]),
|
|
4586
|
+
_: 3
|
|
4587
|
+
})
|
|
4588
|
+
])
|
|
4589
|
+
]),
|
|
4590
|
+
_: 3
|
|
4591
|
+
})
|
|
4592
|
+
]),
|
|
4593
|
+
_: 3
|
|
4594
|
+
}, 8, ["show"]),
|
|
4595
|
+
e("div", {
|
|
4596
|
+
class: V(["sl-hidden lg:sl-fixed lg:sl-inset-y-0 lg:sl-left-0 lg:sl-z-50 lg:sl-block lg:sl-pb-4 sl-pt-4 lg:sl-bg-stachelock-600", t.isWideSidebar ? "lg:sl-w-72" : "lg:sl-w-20"])
|
|
4597
|
+
}, [
|
|
4598
|
+
e("div", Jr, [
|
|
4599
|
+
S(m.$slots, "logo", {}, () => [
|
|
4600
|
+
u[5] || (u[5] = e("div", { class: "sl-text-stachelock-050 sl-font-semibold sl-text-lg" }, "Logo", -1))
|
|
4601
|
+
])
|
|
4602
|
+
]),
|
|
4603
|
+
e("nav", Yr, [
|
|
4604
|
+
e("ul", {
|
|
4605
|
+
role: "list",
|
|
4606
|
+
class: V(t.isWideSidebar ? "sl-flex sl-flex-col sl-items-start sl-mx-4 sl-space-y-1" : "sl-flex sl-flex-col sl-items-center sl-space-y-1")
|
|
4607
|
+
}, [
|
|
4608
|
+
S(m.$slots, "navigation")
|
|
4609
|
+
], 2),
|
|
4610
|
+
e("div", Xr, [
|
|
4611
|
+
S(m.$slots, "sidebar-footer")
|
|
4612
|
+
])
|
|
4613
|
+
])
|
|
4614
|
+
], 2),
|
|
4615
|
+
e("div", {
|
|
4616
|
+
class: V(["lg:sl-pl-20", t.isWideSidebar ? "lg:sl-pl-72" : "lg:sl-pl-20"])
|
|
4617
|
+
}, [
|
|
4618
|
+
e("div", Zr, [
|
|
4619
|
+
e("button", {
|
|
4620
|
+
type: "button",
|
|
4621
|
+
class: "-sl-m-2.5 sl-p-2.5 sl-text-gray-700 lg:sl-hidden",
|
|
4622
|
+
onClick: u[1] || (u[1] = (n) => a())
|
|
4623
|
+
}, [
|
|
4624
|
+
u[6] || (u[6] = e("span", { class: "sl-sr-only" }, "Open sidebar", -1)),
|
|
4625
|
+
_(f(Ye), {
|
|
4626
|
+
class: "sl-h-6 sl-w-6",
|
|
4627
|
+
"aria-hidden": "true"
|
|
4628
|
+
})
|
|
4629
|
+
]),
|
|
4630
|
+
u[7] || (u[7] = e("div", {
|
|
4631
|
+
class: "sl-h-6 sl-w-px sl-bg-gray-900/10 lg:sl-hidden",
|
|
4632
|
+
"aria-hidden": "true"
|
|
4633
|
+
}, null, -1)),
|
|
4634
|
+
e("div", ei, [
|
|
4635
|
+
e("div", si, [
|
|
4636
|
+
S(m.$slots, "header-content")
|
|
4637
|
+
]),
|
|
4638
|
+
e("div", li, [
|
|
4639
|
+
S(m.$slots, "header-right")
|
|
4640
|
+
])
|
|
4641
|
+
])
|
|
4642
|
+
]),
|
|
4643
|
+
e("main", ti, [
|
|
4644
|
+
S(m.$slots, "main")
|
|
4645
|
+
])
|
|
4646
|
+
], 2)
|
|
4647
|
+
]));
|
|
4648
|
+
}
|
|
4649
|
+
}), ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4650
|
+
__proto__: null,
|
|
4651
|
+
DashboardLayout: hs,
|
|
4652
|
+
DefaultLayout: vs,
|
|
4653
|
+
HeaderLayout: ys,
|
|
4654
|
+
NavigationGroup: bs,
|
|
4655
|
+
NavigationItem: xs,
|
|
4656
|
+
SidebarLayout: ws
|
|
4657
|
+
}, Symbol.toStringTag, { value: "Module" })), oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4658
|
+
__proto__: null,
|
|
4659
|
+
Avatar: Vl,
|
|
4660
|
+
Badge: Ze,
|
|
4661
|
+
Breadcrumb: Xl,
|
|
4662
|
+
Button: X,
|
|
4663
|
+
CalendarDashboard: ns,
|
|
4664
|
+
CalendarHeader: _e,
|
|
4665
|
+
CheckboxInput: Te,
|
|
4666
|
+
ComboboxInput: Be,
|
|
4667
|
+
DashboardLayout: hs,
|
|
4668
|
+
DayCalendar: us,
|
|
4669
|
+
DefaultLayout: vs,
|
|
4670
|
+
DynamicForm: fs,
|
|
4671
|
+
EventCard: pe,
|
|
4672
|
+
EventsList: Se,
|
|
4673
|
+
FormField: Me,
|
|
4674
|
+
FormFieldWrapper: ee,
|
|
4675
|
+
HeaderLayout: ys,
|
|
4676
|
+
InputsShowcase: gs,
|
|
4677
|
+
Loading: os,
|
|
4678
|
+
LoadingDots: dt,
|
|
4679
|
+
Modal: bt,
|
|
4680
|
+
MonthCalendar: Ce,
|
|
4681
|
+
NavLink: as,
|
|
4682
|
+
NavigationGroup: bs,
|
|
4683
|
+
NavigationItem: xs,
|
|
4684
|
+
ProgressBar: _t,
|
|
4685
|
+
RadialProgressBar: Bt,
|
|
4686
|
+
SelectInput: re,
|
|
4687
|
+
SidebarLayout: ws,
|
|
4688
|
+
SwitchInput: Ae,
|
|
4689
|
+
Table: ia,
|
|
4690
|
+
TagifyInput: ps,
|
|
4691
|
+
TextAreaInput: Ve,
|
|
4692
|
+
TextInput: J,
|
|
4693
|
+
Transition: da,
|
|
4694
|
+
WeekCalendar: cs,
|
|
4695
|
+
YearCalendar: ms
|
|
4696
|
+
}, Symbol.toStringTag, { value: "Module" })), ni = {
|
|
4697
|
+
...oi,
|
|
4698
|
+
...ai,
|
|
4699
|
+
...Gn,
|
|
4700
|
+
...Lo,
|
|
4701
|
+
...Qo
|
|
4702
|
+
}, wi = {
|
|
4703
|
+
install(t, l = {}) {
|
|
4704
|
+
const { prefix: s = "Sl", installAll: a = !1, components: m } = l;
|
|
4705
|
+
Object.entries(ni).forEach(([u, n]) => {
|
|
4706
|
+
if (a || m && m.includes(u) || !m && !a) {
|
|
4707
|
+
t.component(u, n);
|
|
4708
|
+
const v = u.startsWith(s) ? u : `${s}${u}`;
|
|
4709
|
+
t.component(v, n);
|
|
4710
|
+
}
|
|
4711
|
+
});
|
|
4712
|
+
}
|
|
4713
|
+
};
|
|
4714
|
+
export {
|
|
4715
|
+
Vl as Avatar,
|
|
4716
|
+
Ze as Badge,
|
|
4717
|
+
Xl as Breadcrumb,
|
|
4718
|
+
X as Button,
|
|
4719
|
+
ns as CalendarDashboard,
|
|
4720
|
+
_e as CalendarHeader,
|
|
4721
|
+
Te as CheckboxInput,
|
|
4722
|
+
Be as ComboboxInput,
|
|
4723
|
+
Ml as ComponentRegistry,
|
|
4724
|
+
hs as DashboardLayout,
|
|
4725
|
+
us as DayCalendar,
|
|
4726
|
+
vs as DefaultLayout,
|
|
4727
|
+
fs as DynamicForm,
|
|
4728
|
+
pe as EventCard,
|
|
4729
|
+
Se as EventsList,
|
|
4730
|
+
Me as FormField,
|
|
4731
|
+
ee as FormFieldWrapper,
|
|
4732
|
+
ys as HeaderLayout,
|
|
4733
|
+
gs as InputsShowcase,
|
|
4734
|
+
os as Loading,
|
|
4735
|
+
dt as LoadingDots,
|
|
4736
|
+
bt as Modal,
|
|
4737
|
+
Ce as MonthCalendar,
|
|
4738
|
+
as as NavLink,
|
|
4739
|
+
bs as NavigationGroup,
|
|
4740
|
+
xs as NavigationItem,
|
|
4741
|
+
_t as ProgressBar,
|
|
4742
|
+
Bt as RadialProgressBar,
|
|
4743
|
+
re as SelectInput,
|
|
4744
|
+
ws as SidebarLayout,
|
|
4745
|
+
wi as StachelockUI,
|
|
4746
|
+
Ae as SwitchInput,
|
|
4747
|
+
ia as Table,
|
|
4748
|
+
ps as TagifyInput,
|
|
4749
|
+
Ve as TextAreaInput,
|
|
4750
|
+
J as TextInput,
|
|
4751
|
+
da as Transition,
|
|
4752
|
+
cs as WeekCalendar,
|
|
4753
|
+
ms as YearCalendar,
|
|
4754
|
+
Xe as componentRegistry,
|
|
4755
|
+
wi as default,
|
|
4756
|
+
Sl as defaultComponentMap,
|
|
4757
|
+
vi as generateDeterministicId,
|
|
4758
|
+
ae as generateId,
|
|
4759
|
+
xi as getComponent,
|
|
4760
|
+
bi as registerComponent,
|
|
4761
|
+
yi as sanitizeId
|
|
4762
|
+
};
|
|
4763
|
+
//# sourceMappingURL=index.js.map
|