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