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.
@@ -1,35 +1,35 @@
1
- import { defineComponent as Ve, computed as o, inject as Le, onMounted as ue, onUnmounted as Y, ref as M, watch as de, openBlock as n, createElementBlock as d, withKeys as ce, withModifiers as Z, normalizeClass as m, createElementVNode as x, createVNode as k, mergeProps as G, toDisplayString as H, 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
- import j from "./FormFields.vue.js";
4
- import Be from "./FormField.vue.js";
5
- import De from "./FormSkeleton.vue.js";
6
- import qe from "../Accordion/Accordion.vue.js";
7
- import S from "../Button.vue.js";
8
- import $e from "../BackButton.vue.js";
9
- import Ge from "../Timeline/Timeline.vue.js";
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 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 = {
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
- }, Qe = { key: 0 }, We = {
17
+ }, et = { key: 0 }, tt = {
18
18
  key: 0,
19
19
  class: "flex gap-3 items-end ml-auto"
20
- }, Xe = { class: "text-base font-semibold text-foreground" }, Ye = {
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
- }, Ze = {
23
+ }, it = {
24
24
  key: 3,
25
25
  class: "form-step"
26
- }, _e = { class: "text-lg font-semibold text-foreground" }, et = {
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
- }, tt = {
29
+ }, ot = {
30
30
  key: 0,
31
31
  class: "flex gap-3 items-center"
32
- }, gt = /* @__PURE__ */ Ve({
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: fe, emit: ge }) {
75
- const t = e, g = ge, he = o(() => He(t.pageTitleI18n, t.pageTitle)), h = Le("modal-context", null), ye = Ee(), E = o(() => ye?.components?.form || {}), V = o(() => t.variant ?? E.value.variant ?? "outline"), L = o(() => t.size ?? E.value.size ?? "md"), I = o(() => t.rounded ?? E.value.rounded ?? "md"), K = o(
76
- () => t.showRequiredAsterisk ?? E.value.showRequiredAsterisk ?? !0
77
- ), O = o(() => t.showCancel || !!h), U = o(() => !!h), z = o(
78
- () => t.layout !== "inline" && (t.stickyFooter || U.value)
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
- ue(() => {
81
- t.footer && U.value && h?.registerFormFooter?.(!0);
82
- }), Y(() => {
83
- U.value && h?.registerFormFooter?.(!1);
83
+ De(() => {
84
+ i.footer && B.value && y?.registerFormFooter?.(!0);
85
+ }), Z(() => {
86
+ B.value && y?.registerFormFooter?.(!1);
84
87
  });
85
- const be = M(null), J = M(null), _ = M(!1);
86
- let Q = null;
87
- ue(() => {
88
- J.value && (Q = new IntersectionObserver(
89
- ([i]) => {
90
- _.value = !i.isIntersecting;
91
- },
92
- { threshold: 0 }
93
- ), Q.observe(J.value));
94
- }), Y(() => {
95
- Q?.disconnect();
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 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) => ({
98
- id: i.id?.toString() || l.toString(),
99
- title: i.title,
100
- icon: i.icon,
101
- description: i.description,
102
- status: l < r.value ? "completed" : l === r.value ? "current" : "upcoming"
103
- })) : []), N = o(() => w.value ? t.schema : [t.schema]), te = o(() => u.value ? N.value[r.value] || [] : []), ae = (i) => {
104
- if (!i) return [];
105
- if (Array.isArray(i)) return i;
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 l = i({
108
- values: v.value,
109
- globalValues: v.value,
110
- isUpdate: t.isUpdate
139
+ const t = a({
140
+ values: m.value,
141
+ globalValues: m.value,
142
+ isUpdate: i.isUpdate
111
143
  });
112
- return Array.isArray(l) ? l : [];
113
- } catch (l) {
114
- return console.error("[Form] Error evaluating dynamic group headings:", l), [];
144
+ return Array.isArray(t) ? t : [];
145
+ } catch (t) {
146
+ return console.error("[Form] Error evaluating dynamic group headings:", t), [];
115
147
  }
116
- }, W = o(() => ae(t.groupsHeadings)), X = o(
117
- () => ae(t.groupHeadingsDescription)
118
- ), B = o(() => {
119
- const i = N.value, l = [];
120
- for (let s = 0; s < i.length; s++) {
121
- const f = i[s];
122
- !Array.isArray(f) || f.length === 0 || f.some((Pe) => T(Pe)) && l.push({ schema: f, originalIndex: s });
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 l;
125
- }), y = o(() => u.value ? null : (w.value ? t.schema.flat() : t.schema).find((l) => Ke(l, {
126
- values: v.value,
127
- globalValues: v.value,
128
- isUpdate: t.isUpdate
129
- }) === "thumbnailSelector") ?? null), A = o(() => !!y.value), {
130
- formValues: v,
131
- errors: p,
132
- isSubmitting: b,
133
- fieldLoading: D,
134
- handleFieldChange: le,
135
- validateField: xe,
136
- validateAll: ie,
137
- isFieldVisible: T,
138
- isFieldDisabled: R,
139
- isFieldReadonly: q,
140
- handleSubmit: pe,
141
- reinitialize: ke,
142
- resetForm: Ce,
143
- setFieldError: Fe,
144
- clearErrors: Se
145
- } = Ne({
146
- schema: t.schema,
147
- values: t.values,
148
- isUpdate: t.isUpdate,
149
- folderId: t.folderId,
150
- emitFields: t.emitFields,
151
- onSubmit: (i) => {
152
- g("onSubmit", i, h?.close || (() => {
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
- de(
157
- () => t.loading || b.value,
158
- (i) => {
159
- h?.setSubmitting && h.setSubmitting(i);
188
+ ee(
189
+ () => i.loading || h.value,
190
+ (a) => {
191
+ y?.setSubmitting && y.setSubmitting(a);
160
192
  },
161
193
  { immediate: !0 }
162
- ), Y(() => {
163
- h?.setSubmitting && h.setSubmitting(!1);
164
- }), de(
165
- [() => t.schema, () => t.values, () => t.schemaLoading],
166
- ([i, l, s]) => {
167
- s || ke(i, l);
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 $ = (i, l) => {
171
- le(i, l.value, l.data), g("onChange", v.value);
172
- }, we = async () => {
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 i = te.value;
175
- let l = !0;
176
- for (const s of i) {
177
- if (!T(s) || R(s)) continue;
178
- await xe(s) && (l = !1);
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 l;
181
- }, Ae = o(() => u.value ? r.value < N.value.length - 1 : !1), se = o(() => u.value ? r.value > 0 : !1), P = o(() => u.value ? r.value === N.value.length - 1 : !0), ne = async () => {
182
- !Ae.value || !await we() || (r.value++, g("onStepChange", r.value));
183
- }, Te = () => {
184
- se.value && (r.value--, g("onStepChange", r.value));
185
- }, Ue = (i, l) => {
186
- l <= r.value && (r.value = l, g("onStepChange", r.value));
187
- }, C = async () => {
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 (!P.value && !t.isUpdate) {
190
- await ne();
221
+ if (!L.value && !i.isUpdate) {
222
+ await de();
191
223
  return;
192
224
  }
193
- if (!await ie()) {
194
- const l = N.value.findIndex(
195
- (s) => s.some((f) => !!p.value[f.name])
225
+ if (!await re()) {
226
+ const t = E.value.findIndex(
227
+ (s) => s.some((f) => !!x.value[f.name])
196
228
  );
197
- l !== -1 && l !== r.value && (r.value = l, g("onStepChange", r.value));
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 pe();
234
+ await Fe();
203
235
  } catch {
204
236
  }
205
- }, Re = (i) => {
206
- if (i.key !== "Enter" || i.defaultPrevented) return;
207
- const l = i.target;
208
- if (!l) return;
209
- const s = l.tagName.toLowerCase();
210
- s !== "textarea" && s !== "button" && (l.isContentEditable || (i.preventDefault(), C()));
211
- }, oe = (i) => {
212
- (i.metaKey || i.ctrlKey) && i.key === "s" && (i.preventDefault(), C());
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
- fe({
215
- formValues: v,
216
- errors: p,
217
- isSubmitting: b,
218
- handleSubmit: C,
219
- validateAll: ie,
220
- resetForm: Ce,
221
- setFieldError: Fe,
222
- clearErrors: Se,
223
- setFieldValue: le
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 re = () => {
226
- g("onCancel"), h && h?.close?.();
257
+ const X = () => {
258
+ g("onCancel"), y && y?.close?.();
227
259
  };
228
- return (i, l) => (n(), d("form", {
229
- class: m(["form-container", t.class, e.isPage && "pb-10"]),
230
- onSubmit: Z(C, ["prevent"]),
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
- Re,
233
- ce(Z(oe, ["meta", "prevent"]), ["s"]),
234
- ce(Z(oe, ["ctrl", "prevent"]), ["s"])
264
+ Le,
265
+ ve(te(ce, ["meta", "prevent"]), ["s"]),
266
+ ve(te(ce, ["ctrl", "prevent"]), ["s"])
235
267
  ]
236
268
  }, [
237
- e.isPage ? (n(), d("div", {
269
+ e.isPage ? (n(), c("div", {
238
270
  key: 0,
239
- class: m([
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
- x("div", je, [
245
- k($e, G(e.backButtonProps, {
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
- x("h1", {
250
- class: m(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
251
- }, H(he.value), 3)
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
- x("div", Oe, [
254
- me(i.$slots, "header-actions", {
255
- values: a(v),
256
- isSubmitting: a(b),
257
- handleSubmit: C
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(S, G({
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 || a(b),
266
- onClick: C,
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)) : c("", !0),
271
- !e.schemaLoading && u.value && ee.value.length > 0 ? (n(), d("div", {
302
+ ], 2)) : d("", !0),
303
+ !e.schemaLoading && u.value && ie.value.length > 0 ? (n(), c("div", {
272
304
  key: 1,
273
- class: m(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
305
+ class: v(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
274
306
  }, [
275
- k(a(Ge), {
276
- steps: ee.value,
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: Ue
313
+ onStepClick: ze
282
314
  }, null, 8, ["steps", "activeStep", "textPosition"])
283
- ], 2)) : c("", !0),
284
- x("div", {
285
- class: m(e.footer && z.value ? "pb-2" : "")
315
+ ], 2)) : d("", !0),
316
+ p("div", {
317
+ class: v(e.footer && U.value ? "pb-2" : "")
286
318
  }, [
287
- e.schemaLoading ? (n(), F(De, {
319
+ e.schemaLoading ? (n(), C(Oe, {
288
320
  key: 0,
289
- isGrouped: w.value
290
- }, null, 8, ["isGrouped"])) : (n(), d("div", {
321
+ isGrouped: T.value
322
+ }, null, 8, ["isGrouped"])) : (n(), c("div", {
291
323
  key: 1,
292
- class: m(A.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
324
+ class: v(P.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
293
325
  }, [
294
- A.value ? (n(), d("div", Je, [
295
- y.value && a(T)(y.value) ? (n(), F(Be, {
326
+ P.value ? (n(), c("div", _e, [
327
+ b.value && l(R)(b.value) ? (n(), C(Ge, {
296
328
  key: 0,
297
- field: y.value,
298
- value: a(v)[y.value.name],
299
- values: a(v),
300
- errors: a(p),
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: L.value,
303
- rounded: I.value,
304
- disabled: a(R)(y.value),
305
- readonly: a(q)(y.value),
306
- error: a(p)[y.value.name] || "",
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: a(D)[y.value?.name],
309
- onChange: l[0] || (l[0] = (s) => $(y.value.name, s))
310
- }, null, 8, ["field", "value", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading"])) : c("", !0)
311
- ])) : c("", !0),
312
- x("div", {
313
- class: m(A.value ? "flex-1 min-w-0 order-last lg:order-first" : "w-full")
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
- w.value ? w.value && !u.value && e.groupLayout === "basic" ? (n(), d("div", {
347
+ T.value ? T.value && !u.value && e.groupLayout === "basic" ? (n(), c("div", {
316
348
  key: 1,
317
- class: m(["form-groups space-y-6", e.groupContainerClass])
349
+ class: v(["form-groups space-y-6", e.groupContainerClass])
318
350
  }, [
319
- (n(!0), d(Ie, null, ze(B.value, (s) => (n(), d("div", {
351
+ (n(!0), c(qe, null, He(q.value, (s) => (n(), c("div", {
320
352
  key: s.originalIndex,
321
- class: m([
353
+ class: v([
322
354
  "form-group overflow-hidden bg-body",
323
355
  e.groupClass,
324
- B.value.length > 1 ? "border rounded" : ""
356
+ q.value.length > 1 ? "border rounded" : ""
325
357
  ])
326
358
  }, [
327
- W.value?.[s.originalIndex] ? (n(), d("div", {
359
+ Q.value?.[s.originalIndex] ? (n(), c("div", {
328
360
  key: 0,
329
- class: m(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
361
+ class: v(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
330
362
  }, [
331
- x("h3", Xe, H(W.value[s.originalIndex]), 1),
332
- X.value?.[s.originalIndex] ? (n(), d("p", Ye, H(X.value[s.originalIndex]), 1)) : c("", !0)
333
- ], 2)) : c("", !0),
334
- x("div", {
335
- class: m(["form-group-body", [e.groupBodyClass, B.value.length > 1 ? "p-4.5" : ""]])
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(j, {
369
+ k(J, {
338
370
  schema: s.schema,
339
- values: a(v),
340
- errors: a(p),
341
- fieldLoading: a(D),
371
+ values: l(m),
372
+ errors: l(x),
373
+ fieldLoading: l(H),
342
374
  variant: V.value,
343
- size: L.value,
344
- rounded: I.value,
375
+ size: I.value,
376
+ rounded: N.value,
345
377
  className: e.className,
346
378
  isUpdate: e.isUpdate,
347
- showRequiredAsterisk: K.value,
348
- isFieldVisible: a(T),
349
- isFieldDisabled: a(R),
350
- isFieldReadonly: a(q),
351
- excludeTypes: A.value ? ["thumbnailSelector"] : [],
352
- onChange: $,
353
- onAddonAction: l[2] || (l[2] = (f) => g("onAddonAction", f))
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)) : w.value && !u.value && e.groupLayout === "accordion" ? (n(), d("div", {
389
+ ], 2)) : T.value && !u.value && e.groupLayout === "accordion" ? (n(), c("div", {
358
390
  key: 2,
359
- class: m(e.groupContainerClass)
391
+ class: v(e.groupContainerClass)
360
392
  }, [
361
- k(qe, {
393
+ k(je, {
362
394
  variant: "solid",
363
- items: B.value.map((s) => ({
395
+ items: q.value.map((s) => ({
364
396
  id: `form-group-${s.originalIndex}`,
365
- title: W.value?.[s.originalIndex] || "",
366
- description: X.value?.[s.originalIndex] || void 0
397
+ title: Q.value?.[s.originalIndex] || "",
398
+ description: W.value?.[s.originalIndex] || void 0
367
399
  })),
368
400
  "allow-multiple": "",
369
- class: m(e.groupClass)
401
+ class: v(e.groupClass)
370
402
  }, {
371
- content: ve(({ item: s }) => [
372
- k(j, {
373
- schema: B.value.find((f) => `form-group-${f.originalIndex}` === s.id)?.schema || [],
374
- values: a(v),
375
- errors: a(p),
376
- fieldLoading: a(D),
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: L.value,
379
- rounded: I.value,
410
+ size: I.value,
411
+ rounded: N.value,
380
412
  className: e.className,
381
413
  isUpdate: e.isUpdate,
382
- showRequiredAsterisk: K.value,
383
- isFieldVisible: a(T),
384
- isFieldDisabled: a(R),
385
- isFieldReadonly: a(q),
386
- excludeTypes: A.value ? ["thumbnailSelector"] : [],
387
- onChange: $,
388
- onAddonAction: l[3] || (l[3] = (f) => g("onAddonAction", f))
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(), d("div", Ze, [
394
- e.tabs?.[r.value] ? (n(), d("div", {
425
+ ], 2)) : u.value ? (n(), c("div", it, [
426
+ e.tabs?.[r.value] ? (n(), c("div", {
395
427
  key: 0,
396
- class: m(["form-step-header mb-6", e.headerClass])
428
+ class: v(["form-step-header mb-6", e.headerClass])
397
429
  }, [
398
- x("h2", _e, H(e.tabs[r.value].title), 1),
399
- e.tabs[r.value].description ? (n(), d("p", et, H(e.tabs[r.value].description), 1)) : c("", !0)
400
- ], 2)) : c("", !0),
401
- k(j, {
402
- schema: te.value,
403
- values: a(v),
404
- errors: a(p),
405
- fieldLoading: a(D),
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: L.value,
408
- rounded: I.value,
439
+ size: I.value,
440
+ rounded: N.value,
409
441
  className: e.className,
410
442
  isUpdate: e.isUpdate,
411
- showRequiredAsterisk: K.value,
412
- isFieldVisible: a(T),
413
- isFieldDisabled: a(R),
414
- isFieldReadonly: a(q),
415
- excludeTypes: A.value ? ["thumbnailSelector"] : [],
416
- onChange: $,
417
- onAddonAction: l[4] || (l[4] = (s) => g("onAddonAction", s))
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
- ])) : c("", !0) : (n(), d("div", Qe, [
420
- k(j, {
451
+ ])) : d("", !0) : (n(), c("div", et, [
452
+ k(J, {
421
453
  schema: e.schema,
422
- values: a(v),
423
- errors: a(p),
424
- fieldLoading: a(D),
454
+ values: l(m),
455
+ errors: l(x),
456
+ fieldLoading: l(H),
425
457
  variant: V.value,
426
- size: L.value,
427
- rounded: I.value,
458
+ size: I.value,
459
+ rounded: N.value,
428
460
  className: e.className,
429
461
  isUpdate: e.isUpdate,
430
- showRequiredAsterisk: K.value,
431
- isFieldVisible: a(T),
432
- isFieldDisabled: a(R),
433
- isFieldReadonly: a(q),
434
- excludeTypes: A.value ? ["thumbnailSelector"] : [],
435
- layout: t.layout,
436
- onChange: $,
437
- onAddonAction: l[1] || (l[1] = (s) => g("onAddonAction", s))
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: ve(() => [
440
- t.layout === "inline" && e.footer ? (n(), d("div", We, [
441
- O.value ? (n(), F(S, {
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 || a(b),
447
- onClick: re
448
- }, null, 8, ["text", "disabled"])) : c("", !0),
449
- k(S, G({
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 || a(b)
486
+ loading: e.loading || l(h)
455
487
  }), null, 16, ["text", "loading"])
456
- ])) : c("", !0)
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(i.$slots, "default", {
462
- values: a(v),
463
- errors: a(p),
464
- isSubmitting: a(b),
465
- handleSubmit: C
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 && t.layout !== "inline" ? (n(), d("div", {
502
+ e.footer && !e.schemaLoading && i.layout !== "inline" ? (n(), c("div", {
477
503
  key: 2,
478
504
  ref_key: "footerRef",
479
- ref: be,
480
- class: m([
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
- z.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" : "",
490
- // Show a subtle top shadow while content is scrolling beneath the sticky footer
491
- (z.value && _.value, ""),
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
- U.value && t.layout !== "inline" ? "-mx-4 px-4 pb-3! mt-7.5!" : "",
494
- // Non-sticky inside modal keeps the original border styling
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
- O.value || u.value && e.isUpdate && !P.value ? (n(), d("div", tt, [
501
- O.value ? (n(), F(S, {
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 || a(b),
507
- onClick: re
508
- }, null, 8, ["text", "disabled"])) : c("", !0),
509
- u.value && e.isUpdate && !P.value ? (n(), F(S, G({
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 || a(b),
516
- onClick: C
517
- }), null, 16, ["text", "loading"])) : c("", !0)
518
- ])) : c("", !0),
519
- x("div", {
520
- class: m(["flex gap-3 items-center", [
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 || P.value ? "w-full justify-end" : ""
546
+ !u.value || L.value ? "w-full justify-end" : ""
523
547
  ]])
524
548
  }, [
525
- u.value && se.value ? (n(), F(S, {
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: Te
532
- })) : c("", !0),
533
- u.value && !P.value ? (n(), F(S, {
534
- key: 1,
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: ne
540
- }, null, 8, ["variant"])) : c("", !0),
541
- !u.value || P.value ? (n(), F(S, G({
542
- key: 2,
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 || a(b)
548
- }), null, 16, ["text", "loading"])) : c("", !0)
579
+ loading: e.loading || l(h)
580
+ }), null, 16, ["text", "loading"])) : d("", !0)
549
581
  ], 2)
550
- ], 2)) : c("", !0)
551
- ], 42, Me));
582
+ ], 2)) : d("", !0)
583
+ ], 42, We));
552
584
  }
553
585
  });
554
586
  export {
555
- gt as default
587
+ kt as default
556
588
  };