vlite3 1.3.11 → 1.4.2
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/components/Accordion/Accordion.vue.d.ts +2 -2
- package/components/Accordion/AccordionItem.vue.d.ts +1 -1
- package/components/Accordion/AccordionItem.vue.js +11 -7
- package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
- package/components/AppShell/AppShell.vue.d.ts +1 -0
- package/components/AppShell/AppShell.vue.js +33 -26
- package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +54 -0
- package/components/AppShell/AppShellLayoutStorefront.vue.js +222 -0
- package/components/AppShell/AppShellLayoutStorefront.vue2.js +4 -0
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/CategoryManager/CategoryManager.vue2.js +36 -31
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +22 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +106 -0
- package/components/CategoryMenu/CategoryMenu.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +17 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +146 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +18 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +162 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +4 -0
- package/components/CategoryMenu/index.d.ts +2 -0
- package/components/CategoryMenu/types.d.ts +32 -0
- package/components/CategoryMenu/utils.d.ts +16 -0
- package/components/CategoryMenu/utils.js +45 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +7 -3
- package/components/ColorPicker/ColorPicker.vue.js +59 -45
- package/components/DatePicker.vue.js +5 -4
- package/components/DateRangePicker.vue.js +3 -2
- package/components/Dropdown/Dropdown.vue.d.ts +4 -1
- package/components/Dropdown/Dropdown.vue.js +8 -7
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +5 -2
- package/components/Dropdown/DropdownGroupedLayout.vue3.js +111 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +2 -2
- package/components/Dropdown/DropdownItem.vue.js +66 -49
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +40 -40
- package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
- package/components/Form/Form.vue.d.ts +13 -1
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +313 -275
- package/components/Form/FormField.vue.js +103 -74
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +7 -6
- package/components/Form/composables/useForm.js +71 -67
- package/components/Form/types.d.ts +21 -1
- package/components/IconPicker.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +4 -0
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
- package/components/RichTextEditor/RichTextEditor.vue.js +43 -48
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue.d.ts +12 -3
- package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +157 -121
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/RichTextEditor/types.d.ts +38 -0
- package/components/RichTextEditor/types.js +52 -0
- package/components/Screen/ScreenFilter.vue.js +26 -21
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +2 -2
- package/components/SidebarMenu/SidebarMenuItem.vue.js +3 -2
- package/components/Switch.vue.js +8 -8
- package/components/Tooltip.vue.js +1 -0
- package/components/Workbook/Sheet.vue.d.ts +1 -1
- package/components/Workbook/Sheet.vue.js +14 -13
- package/components/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +306 -301
- package/package.json +2 -2
- package/style.css +2 -2
- package/types/appshell.type.d.ts +2 -1
- package/types/styles.d.ts +2 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { defineComponent as Pe, inject as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as Pe, inject as Ve, computed as r, onMounted as ue, onUnmounted as X, ref as M, watch as de, openBlock as n, createElementBlock as d, withKeys as ce, withModifiers as Y, normalizeClass as m, createElementVNode as b, createVNode as k, mergeProps as $, toDisplayString as G, unref as t, renderSlot as me, createCommentVNode as c, createBlock as F, withCtx as ve, Fragment as Le, renderList as Ie } from "vue";
|
|
2
|
+
import { useForm as ze } from "./composables/useForm.js";
|
|
3
|
+
import j from "./FormFields.vue.js";
|
|
4
|
+
import Ne from "./FormField.vue.js";
|
|
5
|
+
import Be from "./FormSkeleton.vue.js";
|
|
6
|
+
import De from "../Accordion/Accordion.vue.js";
|
|
6
7
|
import S from "../Button.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
8
|
+
import qe from "../BackButton.vue.js";
|
|
9
|
+
import $e from "../Timeline/Timeline.vue.js";
|
|
9
10
|
import "@iconify/vue";
|
|
10
11
|
import { $t as Ge } from "../../utils/i18n.js";
|
|
11
12
|
import { useVLiteConfig as He } from "../../core/config.js";
|
|
12
|
-
import { resolveFieldType as
|
|
13
|
-
const
|
|
13
|
+
import { resolveFieldType as Ee } from "./utils/form.utils.js";
|
|
14
|
+
const Ke = ["onKeydown"], Me = { class: "flex items-center gap-3" }, je = { class: "flex items-center gap-2 shrink-0" }, Oe = {
|
|
14
15
|
key: 0,
|
|
15
16
|
class: "w-full order-first lg:order-last lg:min-w-100 lg:max-w-[380px] shrink-0"
|
|
16
|
-
},
|
|
17
|
+
}, Je = { key: 0 }, Qe = {
|
|
17
18
|
key: 0,
|
|
18
19
|
class: "flex gap-3 items-end ml-auto"
|
|
19
|
-
},
|
|
20
|
+
}, We = { class: "text-base font-semibold text-foreground" }, Xe = {
|
|
20
21
|
key: 0,
|
|
21
22
|
class: "text-sm text-muted-foreground mt-1"
|
|
22
|
-
},
|
|
23
|
-
key:
|
|
23
|
+
}, Ye = {
|
|
24
|
+
key: 3,
|
|
24
25
|
class: "form-step"
|
|
25
|
-
},
|
|
26
|
+
}, Ze = { class: "text-lg font-semibold text-foreground" }, _e = {
|
|
26
27
|
key: 0,
|
|
27
28
|
class: "text-sm text-muted-foreground mt-1"
|
|
28
|
-
},
|
|
29
|
+
}, et = { class: "flex gap-3 items-center" }, ft = /* @__PURE__ */ Pe({
|
|
29
30
|
__name: "Form",
|
|
30
31
|
props: {
|
|
31
32
|
schema: {},
|
|
@@ -38,7 +39,8 @@ const Ee = ["onKeydown"], Ke = { class: "flex items-center gap-3" }, Me = { clas
|
|
|
38
39
|
footer: { type: Boolean, default: !0 },
|
|
39
40
|
groupsHeadings: { type: [Array, Function], default: () => [] },
|
|
40
41
|
groupHeadingsDescription: { type: [Array, Function], default: () => [] },
|
|
41
|
-
|
|
42
|
+
groupLayout: { default: "basic" },
|
|
43
|
+
tabs: { default: void 0 },
|
|
42
44
|
submitText: { default: "Submit" },
|
|
43
45
|
submitProps: {},
|
|
44
46
|
cancelText: { default: "Cancel" },
|
|
@@ -65,448 +67,484 @@ const Ee = ["onKeydown"], Ke = { class: "flex items-center gap-3" }, Me = { clas
|
|
|
65
67
|
backButtonPath: {},
|
|
66
68
|
layout: { default: "vertical" }
|
|
67
69
|
},
|
|
68
|
-
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction", "onBack"],
|
|
69
|
-
setup(e, { expose:
|
|
70
|
-
const
|
|
71
|
-
() =>
|
|
72
|
-
),
|
|
73
|
-
() =>
|
|
70
|
+
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction", "onBack", "onChange"],
|
|
71
|
+
setup(e, { expose: fe, emit: ge }) {
|
|
72
|
+
const l = e, g = ge, h = Ve("modal-context", null), he = He(), H = r(() => he?.components?.form || {}), P = r(() => l.variant ?? H.value.variant ?? "outline"), V = r(() => l.size ?? H.value.size ?? "md"), L = r(() => l.rounded ?? H.value.rounded ?? "md"), E = r(
|
|
73
|
+
() => l.showRequiredAsterisk ?? H.value.showRequiredAsterisk ?? !0
|
|
74
|
+
), Z = r(() => l.showCancel || !!h), R = r(() => !!h), I = r(
|
|
75
|
+
() => l.layout !== "inline" && (l.stickyFooter || R.value)
|
|
74
76
|
);
|
|
75
77
|
ue(() => {
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
|
|
78
|
+
l.footer && R.value && h?.registerFormFooter?.(!0);
|
|
79
|
+
}), X(() => {
|
|
80
|
+
R.value && h?.registerFormFooter?.(!1);
|
|
79
81
|
});
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
+
const be = M(null), O = M(null), _ = M(!1);
|
|
83
|
+
let J = null;
|
|
82
84
|
ue(() => {
|
|
83
|
-
|
|
84
|
-
([
|
|
85
|
-
|
|
85
|
+
O.value && (J = new IntersectionObserver(
|
|
86
|
+
([i]) => {
|
|
87
|
+
_.value = !i.isIntersecting;
|
|
86
88
|
},
|
|
87
89
|
{ threshold: 0 }
|
|
88
|
-
),
|
|
89
|
-
}),
|
|
90
|
-
|
|
90
|
+
), J.observe(O.value));
|
|
91
|
+
}), X(() => {
|
|
92
|
+
J?.disconnect();
|
|
91
93
|
});
|
|
92
|
-
const
|
|
93
|
-
id:
|
|
94
|
-
title:
|
|
95
|
-
icon:
|
|
96
|
-
description:
|
|
97
|
-
status:
|
|
98
|
-
})) : []),
|
|
99
|
-
if (!
|
|
100
|
-
if (Array.isArray(
|
|
94
|
+
const w = r(() => !l.schema || l.schema.length === 0 ? !1 : Array.isArray(l.schema[0])), u = r(() => l.tabs && l.tabs.length > 0 && w.value), o = M(0), ee = r(() => l.tabs ? l.tabs.map((i, a) => ({
|
|
95
|
+
id: i.id?.toString() || a.toString(),
|
|
96
|
+
title: i.title,
|
|
97
|
+
icon: i.icon,
|
|
98
|
+
description: i.description,
|
|
99
|
+
status: a < o.value ? "completed" : a === o.value ? "current" : "upcoming"
|
|
100
|
+
})) : []), z = r(() => w.value ? l.schema : [l.schema]), te = r(() => u.value ? z.value[o.value] || [] : []), ae = (i) => {
|
|
101
|
+
if (!i) return [];
|
|
102
|
+
if (Array.isArray(i)) return i;
|
|
101
103
|
try {
|
|
102
|
-
const
|
|
104
|
+
const a = i({
|
|
103
105
|
values: v.value,
|
|
104
106
|
globalValues: v.value,
|
|
105
|
-
isUpdate:
|
|
107
|
+
isUpdate: l.isUpdate
|
|
106
108
|
});
|
|
107
|
-
return Array.isArray(
|
|
108
|
-
} catch (
|
|
109
|
-
return console.error("[Form] Error evaluating dynamic group headings:",
|
|
109
|
+
return Array.isArray(a) ? a : [];
|
|
110
|
+
} catch (a) {
|
|
111
|
+
return console.error("[Form] Error evaluating dynamic group headings:", a), [];
|
|
110
112
|
}
|
|
111
|
-
},
|
|
112
|
-
() =>
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const x = a[s];
|
|
119
|
-
!Array.isArray(x) || x.length === 0 || x.some((Ue) => U(Ue)) && i.push({ schema: x, originalIndex: s });
|
|
113
|
+
}, Q = r(() => ae(l.groupsHeadings)), W = r(
|
|
114
|
+
() => ae(l.groupHeadingsDescription)
|
|
115
|
+
), N = r(() => {
|
|
116
|
+
const i = z.value, a = [];
|
|
117
|
+
for (let s = 0; s < i.length; s++) {
|
|
118
|
+
const f = i[s];
|
|
119
|
+
!Array.isArray(f) || f.length === 0 || f.some((Ue) => T(Ue)) && a.push({ schema: f, originalIndex: s });
|
|
120
120
|
}
|
|
121
|
-
return
|
|
122
|
-
}),
|
|
121
|
+
return a;
|
|
122
|
+
}), y = r(() => u.value ? null : (w.value ? l.schema.flat() : l.schema).find((a) => Ee(a, {
|
|
123
123
|
values: v.value,
|
|
124
124
|
globalValues: v.value,
|
|
125
|
-
isUpdate:
|
|
126
|
-
}) === "thumbnailSelector") ?? null),
|
|
125
|
+
isUpdate: l.isUpdate
|
|
126
|
+
}) === "thumbnailSelector") ?? null), A = r(() => !!y.value), {
|
|
127
127
|
formValues: v,
|
|
128
128
|
errors: p,
|
|
129
|
-
isSubmitting:
|
|
130
|
-
fieldLoading:
|
|
129
|
+
isSubmitting: x,
|
|
130
|
+
fieldLoading: B,
|
|
131
131
|
handleFieldChange: le,
|
|
132
|
-
validateField:
|
|
132
|
+
validateField: ye,
|
|
133
133
|
validateAll: ie,
|
|
134
|
-
isFieldVisible:
|
|
135
|
-
isFieldDisabled:
|
|
136
|
-
isFieldReadonly:
|
|
137
|
-
handleSubmit:
|
|
138
|
-
reinitialize:
|
|
139
|
-
resetForm:
|
|
140
|
-
setFieldError:
|
|
141
|
-
clearErrors:
|
|
142
|
-
} =
|
|
143
|
-
schema:
|
|
144
|
-
values:
|
|
145
|
-
isUpdate:
|
|
146
|
-
folderId:
|
|
147
|
-
emitFields:
|
|
148
|
-
onSubmit: (
|
|
149
|
-
|
|
134
|
+
isFieldVisible: T,
|
|
135
|
+
isFieldDisabled: U,
|
|
136
|
+
isFieldReadonly: D,
|
|
137
|
+
handleSubmit: xe,
|
|
138
|
+
reinitialize: pe,
|
|
139
|
+
resetForm: ke,
|
|
140
|
+
setFieldError: Ce,
|
|
141
|
+
clearErrors: Fe
|
|
142
|
+
} = ze({
|
|
143
|
+
schema: l.schema,
|
|
144
|
+
values: l.values,
|
|
145
|
+
isUpdate: l.isUpdate,
|
|
146
|
+
folderId: l.folderId,
|
|
147
|
+
emitFields: l.emitFields,
|
|
148
|
+
onSubmit: (i) => {
|
|
149
|
+
g("onSubmit", i, h?.close || (() => {
|
|
150
150
|
}));
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
de(
|
|
154
|
-
() =>
|
|
155
|
-
(
|
|
156
|
-
|
|
154
|
+
() => l.loading || x.value,
|
|
155
|
+
(i) => {
|
|
156
|
+
h?.setSubmitting && h.setSubmitting(i);
|
|
157
157
|
},
|
|
158
158
|
{ immediate: !0 }
|
|
159
|
-
),
|
|
160
|
-
|
|
159
|
+
), X(() => {
|
|
160
|
+
h?.setSubmitting && h.setSubmitting(!1);
|
|
161
161
|
}), de(
|
|
162
|
-
[() =>
|
|
163
|
-
([
|
|
164
|
-
s ||
|
|
162
|
+
[() => l.schema, () => l.values, () => l.schemaLoading],
|
|
163
|
+
([i, a, s]) => {
|
|
164
|
+
s || pe(i, a);
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
|
-
const
|
|
168
|
-
le(
|
|
167
|
+
const q = (i, a) => {
|
|
168
|
+
le(i, a.value, a.data), g("onChange", v.value);
|
|
169
169
|
}, Se = async () => {
|
|
170
|
-
if (!
|
|
171
|
-
const
|
|
172
|
-
let
|
|
173
|
-
for (const s of
|
|
174
|
-
if (!
|
|
175
|
-
await
|
|
170
|
+
if (!u.value) return !0;
|
|
171
|
+
const i = te.value;
|
|
172
|
+
let a = !0;
|
|
173
|
+
for (const s of i) {
|
|
174
|
+
if (!T(s) || U(s)) continue;
|
|
175
|
+
await ye(s) && (a = !1);
|
|
176
176
|
}
|
|
177
|
-
return
|
|
178
|
-
},
|
|
179
|
-
!
|
|
180
|
-
},
|
|
181
|
-
se.value && (o.value--,
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
if (
|
|
186
|
-
if (
|
|
177
|
+
return a;
|
|
178
|
+
}, we = r(() => u.value ? o.value < z.value.length - 1 : !1), se = r(() => u.value ? o.value > 0 : !1), K = r(() => u.value ? o.value === z.value.length - 1 : !0), ne = async () => {
|
|
179
|
+
!we.value || !await Se() || (o.value++, g("onStepChange", o.value));
|
|
180
|
+
}, Ae = () => {
|
|
181
|
+
se.value && (o.value--, g("onStepChange", o.value));
|
|
182
|
+
}, Te = (i, a) => {
|
|
183
|
+
a <= o.value && (o.value = a, g("onStepChange", o.value));
|
|
184
|
+
}, C = async () => {
|
|
185
|
+
if (u.value) {
|
|
186
|
+
if (!K.value && !l.isUpdate) {
|
|
187
187
|
await ne();
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
if (!await ie()) {
|
|
191
|
-
const
|
|
192
|
-
(s) => s.some((
|
|
191
|
+
const a = z.value.findIndex(
|
|
192
|
+
(s) => s.some((f) => !!p.value[f.name])
|
|
193
193
|
);
|
|
194
|
-
|
|
194
|
+
a !== -1 && a !== o.value && (o.value = a, g("onStepChange", o.value));
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
try {
|
|
199
|
-
await
|
|
199
|
+
await xe();
|
|
200
200
|
} catch {
|
|
201
201
|
}
|
|
202
|
-
},
|
|
203
|
-
if (
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
}, Re = (i) => {
|
|
203
|
+
if (i.key !== "Enter" || i.defaultPrevented) return;
|
|
204
|
+
const a = i.target;
|
|
205
|
+
if (!a) return;
|
|
206
|
+
const s = a.tagName.toLowerCase();
|
|
207
|
+
s !== "textarea" && s !== "button" && (a.isContentEditable || (i.preventDefault(), C()));
|
|
208
|
+
}, oe = (i) => {
|
|
209
|
+
(i.metaKey || i.ctrlKey) && i.key === "s" && (i.preventDefault(), C());
|
|
208
210
|
};
|
|
209
|
-
|
|
211
|
+
fe({
|
|
210
212
|
formValues: v,
|
|
211
213
|
errors: p,
|
|
212
|
-
isSubmitting:
|
|
213
|
-
handleSubmit:
|
|
214
|
+
isSubmitting: x,
|
|
215
|
+
handleSubmit: C,
|
|
214
216
|
validateAll: ie,
|
|
215
|
-
resetForm:
|
|
216
|
-
setFieldError:
|
|
217
|
-
clearErrors:
|
|
217
|
+
resetForm: ke,
|
|
218
|
+
setFieldError: Ce,
|
|
219
|
+
clearErrors: Fe,
|
|
218
220
|
setFieldValue: le
|
|
219
221
|
});
|
|
220
222
|
const re = () => {
|
|
221
|
-
|
|
223
|
+
g("onCancel"), h && h?.close?.();
|
|
222
224
|
};
|
|
223
|
-
return (
|
|
224
|
-
class: m(["form-container",
|
|
225
|
-
onSubmit:
|
|
225
|
+
return (i, a) => (n(), d("form", {
|
|
226
|
+
class: m(["form-container", l.class, e.isPage && "pb-10"]),
|
|
227
|
+
onSubmit: Y(C, ["prevent"]),
|
|
226
228
|
onKeydown: [
|
|
227
|
-
|
|
228
|
-
ce(
|
|
229
|
-
ce(
|
|
229
|
+
Re,
|
|
230
|
+
ce(Y(oe, ["meta", "prevent"]), ["s"]),
|
|
231
|
+
ce(Y(oe, ["ctrl", "prevent"]), ["s"])
|
|
230
232
|
]
|
|
231
233
|
}, [
|
|
232
|
-
e.isPage ? (n(),
|
|
234
|
+
e.isPage ? (n(), d("div", {
|
|
233
235
|
key: 0,
|
|
234
236
|
class: m([
|
|
235
237
|
"form-page-header sticky top-0 z-30 bg-background flex items-center justify-between pb-3.5 pt-4 -mt-3.5 mb-4.5",
|
|
236
238
|
e.pageHeaderClass
|
|
237
239
|
])
|
|
238
240
|
}, [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
+
b("div", Me, [
|
|
242
|
+
k(qe, $(e.backButtonProps, {
|
|
241
243
|
fallback: e.backButtonPath,
|
|
242
244
|
class: "max-sm:w-8 max-sm:h-8 max-sm:min-w-8 max-sm:min-h-8 max-sm:px-0 shrink-0"
|
|
243
245
|
}), null, 16, ["fallback"]),
|
|
244
|
-
|
|
246
|
+
b("h1", {
|
|
245
247
|
class: m(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
|
|
246
|
-
},
|
|
248
|
+
}, G(e.pageTitleI18n ? t(Ge)(e.pageTitleI18n) : e.pageTitle), 3)
|
|
247
249
|
]),
|
|
248
|
-
|
|
249
|
-
me(
|
|
250
|
-
values:
|
|
251
|
-
isSubmitting:
|
|
252
|
-
handleSubmit:
|
|
250
|
+
b("div", je, [
|
|
251
|
+
me(i.$slots, "header-actions", {
|
|
252
|
+
values: t(v),
|
|
253
|
+
isSubmitting: t(x),
|
|
254
|
+
handleSubmit: C
|
|
253
255
|
}, void 0, !0),
|
|
254
|
-
|
|
256
|
+
k(S, $({
|
|
255
257
|
type: "button",
|
|
256
258
|
variant: e.isUpdate ? "outline" : "primary",
|
|
257
259
|
text: e.submitText
|
|
258
260
|
}, e.submitProps, {
|
|
259
261
|
disabled: e.schemaLoading,
|
|
260
|
-
loading: e.loading ||
|
|
261
|
-
onClick:
|
|
262
|
+
loading: e.loading || t(x),
|
|
263
|
+
onClick: C,
|
|
262
264
|
class: "max-sm:hidden"
|
|
263
265
|
}), null, 16, ["variant", "text", "disabled", "loading"])
|
|
264
266
|
])
|
|
265
|
-
], 2)) :
|
|
266
|
-
!e.schemaLoading &&
|
|
267
|
+
], 2)) : c("", !0),
|
|
268
|
+
!e.schemaLoading && u.value && ee.value.length > 0 ? (n(), d("div", {
|
|
267
269
|
key: 1,
|
|
268
270
|
class: m(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
|
|
269
271
|
}, [
|
|
270
|
-
|
|
271
|
-
steps:
|
|
272
|
+
k(t($e), {
|
|
273
|
+
steps: ee.value,
|
|
272
274
|
activeStep: o.value,
|
|
273
275
|
direction: "horizontal",
|
|
274
276
|
textPosition: e.timelineTextPosition,
|
|
275
277
|
clickable: !0,
|
|
276
|
-
onStepClick:
|
|
278
|
+
onStepClick: Te
|
|
277
279
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
278
|
-
], 2)) :
|
|
279
|
-
|
|
280
|
-
class: m(e.footer &&
|
|
280
|
+
], 2)) : c("", !0),
|
|
281
|
+
b("div", {
|
|
282
|
+
class: m(e.footer && I.value ? "pb-2" : "")
|
|
281
283
|
}, [
|
|
282
|
-
e.schemaLoading ? (n(),
|
|
284
|
+
e.schemaLoading ? (n(), F(Be, {
|
|
283
285
|
key: 0,
|
|
284
|
-
isGrouped:
|
|
285
|
-
}, null, 8, ["isGrouped"])) : (n(),
|
|
286
|
+
isGrouped: w.value
|
|
287
|
+
}, null, 8, ["isGrouped"])) : (n(), d("div", {
|
|
286
288
|
key: 1,
|
|
287
|
-
class: m(
|
|
289
|
+
class: m(A.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
|
|
288
290
|
}, [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
A.value ? (n(), d("div", Oe, [
|
|
292
|
+
y.value && t(T)(y.value) ? (n(), F(Ne, {
|
|
291
293
|
key: 0,
|
|
292
|
-
field:
|
|
293
|
-
value:
|
|
294
|
-
values:
|
|
295
|
-
errors:
|
|
296
|
-
variant:
|
|
297
|
-
size:
|
|
298
|
-
rounded:
|
|
299
|
-
disabled:
|
|
300
|
-
readonly:
|
|
301
|
-
error:
|
|
294
|
+
field: y.value,
|
|
295
|
+
value: t(v)[y.value.name],
|
|
296
|
+
values: t(v),
|
|
297
|
+
errors: t(p),
|
|
298
|
+
variant: P.value,
|
|
299
|
+
size: V.value,
|
|
300
|
+
rounded: L.value,
|
|
301
|
+
disabled: t(U)(y.value),
|
|
302
|
+
readonly: t(D)(y.value),
|
|
303
|
+
error: t(p)[y.value.name] || "",
|
|
302
304
|
isUpdate: e.isUpdate,
|
|
303
|
-
loading:
|
|
304
|
-
onChange:
|
|
305
|
-
}, null, 8, ["field", "value", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading"])) :
|
|
306
|
-
])) :
|
|
307
|
-
|
|
308
|
-
class: m(
|
|
305
|
+
loading: t(B)[y.value?.name],
|
|
306
|
+
onChange: a[0] || (a[0] = (s) => q(y.value.name, s))
|
|
307
|
+
}, null, 8, ["field", "value", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading"])) : c("", !0)
|
|
308
|
+
])) : c("", !0),
|
|
309
|
+
b("div", {
|
|
310
|
+
class: m(A.value ? "flex-1 min-w-0 order-last lg:order-first" : "w-full")
|
|
309
311
|
}, [
|
|
310
|
-
|
|
312
|
+
w.value ? w.value && !u.value && e.groupLayout === "basic" ? (n(), d("div", {
|
|
311
313
|
key: 1,
|
|
312
314
|
class: m(["form-groups space-y-6", e.groupContainerClass])
|
|
313
315
|
}, [
|
|
314
|
-
(n(!0),
|
|
316
|
+
(n(!0), d(Le, null, Ie(N.value, (s) => (n(), d("div", {
|
|
315
317
|
key: s.originalIndex,
|
|
316
318
|
class: m([
|
|
317
319
|
"form-group overflow-hidden bg-body",
|
|
318
320
|
e.groupClass,
|
|
319
|
-
|
|
321
|
+
N.value.length > 1 ? "border rounded" : ""
|
|
320
322
|
])
|
|
321
323
|
}, [
|
|
322
|
-
|
|
324
|
+
Q.value?.[s.originalIndex] ? (n(), d("div", {
|
|
323
325
|
key: 0,
|
|
324
326
|
class: m(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
|
|
325
327
|
}, [
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
], 2)) :
|
|
329
|
-
|
|
330
|
-
class: m(["form-group-body", [e.groupBodyClass,
|
|
328
|
+
b("h3", We, G(Q.value[s.originalIndex]), 1),
|
|
329
|
+
W.value?.[s.originalIndex] ? (n(), d("p", Xe, G(W.value[s.originalIndex]), 1)) : c("", !0)
|
|
330
|
+
], 2)) : c("", !0),
|
|
331
|
+
b("div", {
|
|
332
|
+
class: m(["form-group-body", [e.groupBodyClass, N.value.length > 1 ? "p-4.5" : ""]])
|
|
331
333
|
}, [
|
|
332
|
-
|
|
334
|
+
k(j, {
|
|
333
335
|
schema: s.schema,
|
|
334
|
-
values:
|
|
335
|
-
errors:
|
|
336
|
-
fieldLoading:
|
|
337
|
-
variant:
|
|
338
|
-
size:
|
|
339
|
-
rounded:
|
|
336
|
+
values: t(v),
|
|
337
|
+
errors: t(p),
|
|
338
|
+
fieldLoading: t(B),
|
|
339
|
+
variant: P.value,
|
|
340
|
+
size: V.value,
|
|
341
|
+
rounded: L.value,
|
|
340
342
|
className: e.className,
|
|
341
343
|
isUpdate: e.isUpdate,
|
|
342
|
-
showRequiredAsterisk:
|
|
343
|
-
isFieldVisible:
|
|
344
|
-
isFieldDisabled:
|
|
345
|
-
isFieldReadonly:
|
|
346
|
-
excludeTypes:
|
|
347
|
-
onChange:
|
|
348
|
-
onAddonAction:
|
|
344
|
+
showRequiredAsterisk: E.value,
|
|
345
|
+
isFieldVisible: t(T),
|
|
346
|
+
isFieldDisabled: t(U),
|
|
347
|
+
isFieldReadonly: t(D),
|
|
348
|
+
excludeTypes: A.value ? ["thumbnailSelector"] : [],
|
|
349
|
+
onChange: q,
|
|
350
|
+
onAddonAction: a[2] || (a[2] = (f) => g("onAddonAction", f))
|
|
349
351
|
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes"])
|
|
350
352
|
], 2)
|
|
351
353
|
], 2))), 128))
|
|
352
|
-
], 2)) :
|
|
353
|
-
|
|
354
|
+
], 2)) : w.value && !u.value && e.groupLayout === "accordion" ? (n(), d("div", {
|
|
355
|
+
key: 2,
|
|
356
|
+
class: m(e.groupContainerClass)
|
|
357
|
+
}, [
|
|
358
|
+
k(De, {
|
|
359
|
+
variant: "solid",
|
|
360
|
+
items: N.value.map((s) => ({
|
|
361
|
+
id: `form-group-${s.originalIndex}`,
|
|
362
|
+
title: Q.value?.[s.originalIndex] || "",
|
|
363
|
+
description: W.value?.[s.originalIndex] || void 0
|
|
364
|
+
})),
|
|
365
|
+
"allow-multiple": "",
|
|
366
|
+
class: m(e.groupClass)
|
|
367
|
+
}, {
|
|
368
|
+
content: ve(({ item: s }) => [
|
|
369
|
+
k(j, {
|
|
370
|
+
schema: N.value.find((f) => `form-group-${f.originalIndex}` === s.id)?.schema || [],
|
|
371
|
+
values: t(v),
|
|
372
|
+
errors: t(p),
|
|
373
|
+
fieldLoading: t(B),
|
|
374
|
+
variant: P.value,
|
|
375
|
+
size: V.value,
|
|
376
|
+
rounded: L.value,
|
|
377
|
+
className: e.className,
|
|
378
|
+
isUpdate: e.isUpdate,
|
|
379
|
+
showRequiredAsterisk: E.value,
|
|
380
|
+
isFieldVisible: t(T),
|
|
381
|
+
isFieldDisabled: t(U),
|
|
382
|
+
isFieldReadonly: t(D),
|
|
383
|
+
excludeTypes: A.value ? ["thumbnailSelector"] : [],
|
|
384
|
+
onChange: q,
|
|
385
|
+
onAddonAction: a[3] || (a[3] = (f) => g("onAddonAction", f))
|
|
386
|
+
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes"])
|
|
387
|
+
]),
|
|
388
|
+
_: 1
|
|
389
|
+
}, 8, ["items", "class"])
|
|
390
|
+
], 2)) : u.value ? (n(), d("div", Ye, [
|
|
391
|
+
e.tabs?.[o.value] ? (n(), d("div", {
|
|
354
392
|
key: 0,
|
|
355
393
|
class: m(["form-step-header mb-6", e.headerClass])
|
|
356
394
|
}, [
|
|
357
|
-
|
|
358
|
-
e.tabs[o.value].description ? (n(),
|
|
359
|
-
], 2)) :
|
|
360
|
-
|
|
361
|
-
schema:
|
|
362
|
-
values:
|
|
363
|
-
errors:
|
|
364
|
-
fieldLoading:
|
|
365
|
-
variant:
|
|
366
|
-
size:
|
|
367
|
-
rounded:
|
|
395
|
+
b("h2", Ze, G(e.tabs[o.value].title), 1),
|
|
396
|
+
e.tabs[o.value].description ? (n(), d("p", _e, G(e.tabs[o.value].description), 1)) : c("", !0)
|
|
397
|
+
], 2)) : c("", !0),
|
|
398
|
+
k(j, {
|
|
399
|
+
schema: te.value,
|
|
400
|
+
values: t(v),
|
|
401
|
+
errors: t(p),
|
|
402
|
+
fieldLoading: t(B),
|
|
403
|
+
variant: P.value,
|
|
404
|
+
size: V.value,
|
|
405
|
+
rounded: L.value,
|
|
368
406
|
className: e.className,
|
|
369
407
|
isUpdate: e.isUpdate,
|
|
370
|
-
showRequiredAsterisk:
|
|
371
|
-
isFieldVisible:
|
|
372
|
-
isFieldDisabled:
|
|
373
|
-
isFieldReadonly:
|
|
374
|
-
excludeTypes:
|
|
375
|
-
onChange:
|
|
376
|
-
onAddonAction:
|
|
408
|
+
showRequiredAsterisk: E.value,
|
|
409
|
+
isFieldVisible: t(T),
|
|
410
|
+
isFieldDisabled: t(U),
|
|
411
|
+
isFieldReadonly: t(D),
|
|
412
|
+
excludeTypes: A.value ? ["thumbnailSelector"] : [],
|
|
413
|
+
onChange: q,
|
|
414
|
+
onAddonAction: a[4] || (a[4] = (s) => g("onAddonAction", s))
|
|
377
415
|
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes"])
|
|
378
|
-
])) :
|
|
379
|
-
|
|
416
|
+
])) : c("", !0) : (n(), d("div", Je, [
|
|
417
|
+
k(j, {
|
|
380
418
|
schema: e.schema,
|
|
381
|
-
values:
|
|
382
|
-
errors:
|
|
383
|
-
fieldLoading:
|
|
384
|
-
variant:
|
|
385
|
-
size:
|
|
386
|
-
rounded:
|
|
419
|
+
values: t(v),
|
|
420
|
+
errors: t(p),
|
|
421
|
+
fieldLoading: t(B),
|
|
422
|
+
variant: P.value,
|
|
423
|
+
size: V.value,
|
|
424
|
+
rounded: L.value,
|
|
387
425
|
className: e.className,
|
|
388
426
|
isUpdate: e.isUpdate,
|
|
389
|
-
showRequiredAsterisk:
|
|
390
|
-
isFieldVisible:
|
|
391
|
-
isFieldDisabled:
|
|
392
|
-
isFieldReadonly:
|
|
393
|
-
excludeTypes:
|
|
394
|
-
layout:
|
|
395
|
-
onChange:
|
|
396
|
-
onAddonAction:
|
|
427
|
+
showRequiredAsterisk: E.value,
|
|
428
|
+
isFieldVisible: t(T),
|
|
429
|
+
isFieldDisabled: t(U),
|
|
430
|
+
isFieldReadonly: t(D),
|
|
431
|
+
excludeTypes: A.value ? ["thumbnailSelector"] : [],
|
|
432
|
+
layout: l.layout,
|
|
433
|
+
onChange: q,
|
|
434
|
+
onAddonAction: a[1] || (a[1] = (s) => g("onAddonAction", s))
|
|
397
435
|
}, {
|
|
398
|
-
default:
|
|
399
|
-
|
|
400
|
-
|
|
436
|
+
default: ve(() => [
|
|
437
|
+
l.layout === "inline" && e.footer ? (n(), d("div", Qe, [
|
|
438
|
+
Z.value ? (n(), F(S, {
|
|
401
439
|
key: 0,
|
|
402
440
|
type: "button",
|
|
403
441
|
variant: "outline",
|
|
404
442
|
text: e.cancelText,
|
|
405
|
-
disabled: e.loading ||
|
|
443
|
+
disabled: e.loading || t(x),
|
|
406
444
|
onClick: re
|
|
407
|
-
}, null, 8, ["text", "disabled"])) :
|
|
408
|
-
|
|
445
|
+
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
446
|
+
k(S, $({
|
|
409
447
|
type: "submit",
|
|
410
448
|
variant: "primary",
|
|
411
449
|
text: e.submitText
|
|
412
450
|
}, e.submitProps, {
|
|
413
|
-
loading: e.loading ||
|
|
451
|
+
loading: e.loading || t(x)
|
|
414
452
|
}), null, 16, ["text", "loading"])
|
|
415
|
-
])) :
|
|
453
|
+
])) : c("", !0)
|
|
416
454
|
]),
|
|
417
455
|
_: 1
|
|
418
456
|
}, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes", "layout"])
|
|
419
457
|
])),
|
|
420
|
-
me(
|
|
421
|
-
values:
|
|
422
|
-
errors:
|
|
423
|
-
isSubmitting:
|
|
424
|
-
handleSubmit:
|
|
458
|
+
me(i.$slots, "default", {
|
|
459
|
+
values: t(v),
|
|
460
|
+
errors: t(p),
|
|
461
|
+
isSubmitting: t(x),
|
|
462
|
+
handleSubmit: C
|
|
425
463
|
}, void 0, !0)
|
|
426
464
|
], 2)
|
|
427
465
|
], 2)),
|
|
428
|
-
|
|
466
|
+
b("div", {
|
|
429
467
|
ref_key: "sentinelRef",
|
|
430
|
-
ref:
|
|
468
|
+
ref: O,
|
|
431
469
|
class: "form-scroll-sentinel h-px w-full",
|
|
432
470
|
"aria-hidden": "true"
|
|
433
471
|
}, null, 512)
|
|
434
472
|
], 2),
|
|
435
|
-
e.footer && !e.schemaLoading &&
|
|
473
|
+
e.footer && !e.schemaLoading && l.layout !== "inline" ? (n(), d("div", {
|
|
436
474
|
key: 2,
|
|
437
475
|
ref_key: "footerRef",
|
|
438
|
-
ref:
|
|
476
|
+
ref: be,
|
|
439
477
|
class: m([
|
|
440
478
|
"form-footer items-center gap-3 z-20 rounded-b-md!",
|
|
441
479
|
e.isPage ? "flex sm:hidden" : "flex",
|
|
442
480
|
e.footerClass,
|
|
443
|
-
|
|
481
|
+
u.value ? "justify-between" : "justify-end",
|
|
444
482
|
// Sticky footer: always applied when inside a modal or when stickyFooter prop is set.
|
|
445
483
|
// `sticky bottom-0` anchors the footer to the bottom of the nearest scrollable ancestor
|
|
446
484
|
// (the modal's overflow-y-auto body), keeping it visible at all times without leaving
|
|
447
485
|
// the normal document flow (unlike `fixed` which would escape the modal bounds).
|
|
448
|
-
|
|
486
|
+
I.value ? "sticky bottom-0 bg-body pt-3 pb-3 -mx-0.5 px-0.5 mt-6 border-t border-border/75" : l.layout !== "inline" ? "mt-6" : "",
|
|
449
487
|
// Show a subtle top shadow while content is scrolling beneath the sticky footer
|
|
450
|
-
(
|
|
488
|
+
(I.value && _.value, ""),
|
|
451
489
|
// Inside modal: extend footer flush to modal edge padding
|
|
452
|
-
|
|
490
|
+
R.value && l.layout !== "inline" ? "-mx-4 px-4 pb-3! mt-7.5!" : "",
|
|
453
491
|
// Non-sticky inside modal keeps the original border styling
|
|
454
|
-
!
|
|
455
|
-
!
|
|
456
|
-
|
|
492
|
+
!I.value && R.value && l.layout !== "inline" ? "border-t border-border/75 mt-5" : "",
|
|
493
|
+
!I.value && !R.value && l.layout !== "inline" ? "mt-6" : "",
|
|
494
|
+
l.layout === "inline" ? "mt-0 shrink-0" : ""
|
|
457
495
|
])
|
|
458
496
|
}, [
|
|
459
|
-
|
|
460
|
-
|
|
497
|
+
b("div", et, [
|
|
498
|
+
Z.value ? (n(), F(S, {
|
|
461
499
|
key: 0,
|
|
462
500
|
type: "button",
|
|
463
501
|
variant: "outline",
|
|
464
502
|
text: e.cancelText,
|
|
465
|
-
disabled: e.loading ||
|
|
503
|
+
disabled: e.loading || t(x),
|
|
466
504
|
onClick: re
|
|
467
|
-
}, null, 8, ["text", "disabled"])) :
|
|
468
|
-
|
|
505
|
+
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
506
|
+
u.value && e.isUpdate && !K.value ? (n(), F(S, $({
|
|
469
507
|
key: 1,
|
|
470
508
|
type: "button",
|
|
471
509
|
variant: "primary",
|
|
472
510
|
text: e.submitText
|
|
473
511
|
}, e.submitProps, {
|
|
474
|
-
loading: e.loading ||
|
|
475
|
-
onClick:
|
|
476
|
-
}), null, 16, ["text", "loading"])) :
|
|
512
|
+
loading: e.loading || t(x),
|
|
513
|
+
onClick: C
|
|
514
|
+
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
477
515
|
]),
|
|
478
|
-
|
|
479
|
-
class: m(["flex gap-3 items-center",
|
|
516
|
+
b("div", {
|
|
517
|
+
class: m(["flex gap-3 items-center", u.value && "ml-auto"])
|
|
480
518
|
}, [
|
|
481
|
-
|
|
519
|
+
u.value && se.value ? (n(), F(S, {
|
|
482
520
|
key: 0,
|
|
483
521
|
type: "button",
|
|
484
522
|
variant: "outline",
|
|
485
523
|
icon: "lucide:arrow-left",
|
|
486
524
|
text: "Previous",
|
|
487
|
-
onClick:
|
|
488
|
-
})) :
|
|
489
|
-
|
|
525
|
+
onClick: Ae
|
|
526
|
+
})) : c("", !0),
|
|
527
|
+
u.value && !K.value ? (n(), F(S, {
|
|
490
528
|
key: 1,
|
|
491
529
|
type: "button",
|
|
492
530
|
variant: e.isUpdate ? "outline" : "primary",
|
|
493
531
|
text: "Next",
|
|
494
532
|
iconRight: "lucide:arrow-right",
|
|
495
533
|
onClick: ne
|
|
496
|
-
}, null, 8, ["variant"])) :
|
|
497
|
-
!
|
|
534
|
+
}, null, 8, ["variant"])) : c("", !0),
|
|
535
|
+
!u.value || K.value ? (n(), F(S, $({
|
|
498
536
|
key: 2,
|
|
499
537
|
type: "submit",
|
|
500
538
|
variant: "primary",
|
|
501
539
|
text: e.submitText
|
|
502
540
|
}, e.submitProps, {
|
|
503
|
-
loading: e.loading ||
|
|
504
|
-
}), null, 16, ["text", "loading"])) :
|
|
541
|
+
loading: e.loading || t(x)
|
|
542
|
+
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
505
543
|
], 2)
|
|
506
|
-
], 2)) :
|
|
507
|
-
], 42,
|
|
544
|
+
], 2)) : c("", !0)
|
|
545
|
+
], 42, Ke));
|
|
508
546
|
}
|
|
509
547
|
});
|
|
510
548
|
export {
|
|
511
|
-
|
|
549
|
+
ft as default
|
|
512
550
|
};
|