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