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