vlite3 0.8.3 → 0.8.4

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,29 +1,28 @@
1
- import { defineComponent as pe, inject as Ce, getCurrentInstance as Se, computed as o, onMounted as ee, onUnmounted as G, ref as z, watch as te, openBlock as n, createElementBlock as d, withKeys as ae, withModifiers as D, normalizeClass as v, createElementVNode as g, createBlock as x, mergeProps as A, toDisplayString as R, unref as a, renderSlot as ie, createVNode as P, createCommentVNode as c, Fragment as Fe, renderList as we } from "vue";
2
- import { useRouter as Ae } from "vue-router";
3
- import { useForm as Re } from "./composables/useForm.js";
1
+ import { defineComponent as ye, inject as xe, computed as n, onMounted as _, onUnmounted as E, ref as z, watch as ee, openBlock as o, createElementBlock as d, withKeys as te, withModifiers as G, normalizeClass as f, createElementVNode as v, createVNode as k, mergeProps as B, toDisplayString as A, unref as a, renderSlot as ae, createCommentVNode as c, Fragment as ke, renderList as pe, createBlock as R } from "vue";
2
+ import { useForm as Se } from "./composables/useForm.js";
4
3
  import O from "./FormFields.vue.js";
5
- import k from "../Button.vue.js";
6
- import Pe from "../BackButton.vue.js";
7
- import Be from "../Timeline/Timeline.vue.js";
4
+ import p from "../Button.vue.js";
5
+ import Ce from "../BackButton.vue.js";
6
+ import Fe from "../Timeline/Timeline.vue.js";
8
7
  import "@iconify/vue";
9
- import { $t as Ne } from "../../utils/i18n.js";
10
- import { useVLiteConfig as Te } from "../../core/config.js";
11
- const Ue = ["onKeydown"], Ve = { class: "flex items-center gap-3" }, ze = { class: "flex items-center gap-2 flex-shrink-0" }, De = {
8
+ import { $t as we } from "../../utils/i18n.js";
9
+ import { useVLiteConfig as Ae } from "../../core/config.js";
10
+ const Re = ["onKeydown"], Pe = { class: "flex items-center gap-3" }, Ne = { class: "flex items-center gap-2 flex-shrink-0" }, Te = {
12
11
  key: 0,
13
12
  class: "form-fields-single"
14
- }, Le = {
13
+ }, Ue = {
15
14
  key: 1,
16
15
  class: "form-groups space-y-6"
17
- }, qe = { class: "text-base font-semibold text-foreground" }, He = {
16
+ }, Ve = { class: "text-base font-semibold text-foreground" }, ze = {
18
17
  key: 0,
19
18
  class: "text-sm text-muted-foreground mt-1"
20
- }, Ie = { class: "form-group-body p-4.5" }, Ke = {
19
+ }, Be = { class: "form-group-body p-4.5" }, De = {
21
20
  key: 2,
22
21
  class: "form-step"
23
- }, Me = { class: "text-lg font-semibold text-foreground" }, $e = {
22
+ }, Le = { class: "text-lg font-semibold text-foreground" }, qe = {
24
23
  key: 0,
25
24
  class: "text-sm text-muted-foreground mt-1"
26
- }, Ee = { class: "flex items-center gap-3" }, et = /* @__PURE__ */ pe({
25
+ }, He = { class: "flex items-center gap-3" }, Qe = /* @__PURE__ */ ye({
27
26
  __name: "Form",
28
27
  props: {
29
28
  schema: {},
@@ -56,276 +55,270 @@ const Ue = ["onKeydown"], Ve = { class: "flex items-center gap-3" }, ze = { clas
56
55
  pageTitleI18n: {},
57
56
  pageTitleClass: { default: "text-2xl font-bold" },
58
57
  pageHeaderClass: { default: "" },
59
- backButtonProps: { default: () => ({ size: "sm", variant: "ghost", icon: "heroicons-solid:arrow-left" }) }
58
+ backButtonProps: { default: () => ({ size: "sm", variant: "ghost", icon: "heroicons-solid:arrow-left" }) },
59
+ backButtonPath: {}
60
60
  },
61
61
  emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction", "onBack"],
62
- setup(e, { emit: se }) {
63
- const i = e, f = se, m = Ce("modal-context", null);
64
- Ae();
65
- const le = Se(), J = o(() => !!le?.vnode.props?.onOnBack), ne = Te(), B = o(() => ne?.components?.form || {}), L = o(() => i.variant ?? B.value.variant ?? "outline"), q = o(() => i.size ?? B.value.size ?? "md"), H = o(() => i.rounded ?? B.value.rounded ?? "md"), I = o(
66
- () => i.showRequiredAsterisk ?? B.value.showRequiredAsterisk ?? !0
67
- ), oe = o(() => i.showCancel || !!m), p = o(() => !!m), C = o(() => i.stickyFooter || p.value);
68
- ee(() => {
69
- i.footer && p.value && m?.registerFormFooter?.(!0);
70
- }), G(() => {
71
- p.value && m?.registerFormFooter?.(!1);
62
+ setup(e, { emit: ie }) {
63
+ const i = e, g = ie, m = xe("modal-context", null), se = Ae(), P = n(() => se?.components?.form || {}), D = n(() => i.variant ?? P.value.variant ?? "outline"), L = n(() => i.size ?? P.value.size ?? "md"), q = n(() => i.rounded ?? P.value.rounded ?? "md"), H = n(
64
+ () => i.showRequiredAsterisk ?? P.value.showRequiredAsterisk ?? !0
65
+ ), le = n(() => i.showCancel || !!m), x = n(() => !!m), S = n(() => i.stickyFooter || x.value);
66
+ _(() => {
67
+ i.footer && x.value && m?.registerFormFooter?.(!0);
68
+ }), E(() => {
69
+ x.value && m?.registerFormFooter?.(!1);
72
70
  });
73
- const re = z(null), K = z(null), Q = z(!1);
74
- let M = null;
75
- ee(() => {
76
- K.value && (M = new IntersectionObserver(
71
+ const oe = z(null), I = z(null), J = z(!1);
72
+ let K = null;
73
+ _(() => {
74
+ I.value && (K = new IntersectionObserver(
77
75
  ([t]) => {
78
- Q.value = !t.isIntersecting;
76
+ J.value = !t.isIntersecting;
79
77
  },
80
78
  { threshold: 0 }
81
- ), M.observe(K.value));
82
- }), G(() => {
83
- M?.disconnect();
79
+ ), K.observe(I.value));
80
+ }), E(() => {
81
+ K?.disconnect();
84
82
  });
85
- const N = o(() => !i.schema || i.schema.length === 0 ? !1 : Array.isArray(i.schema[0])), r = o(() => i.tabs && i.tabs.length > 0 && N.value), l = z(0), W = o(() => i.tabs ? i.tabs.map((t, s) => ({
83
+ const N = n(() => !i.schema || i.schema.length === 0 ? !1 : Array.isArray(i.schema[0])), r = n(() => i.tabs && i.tabs.length > 0 && N.value), l = z(0), Q = n(() => i.tabs ? i.tabs.map((t, s) => ({
86
84
  id: t.id?.toString() || s.toString(),
87
85
  title: t.title,
88
86
  icon: t.icon,
89
87
  description: t.description,
90
88
  status: s < l.value ? "completed" : s === l.value ? "current" : "upcoming"
91
- })) : []), S = o(() => N.value ? i.schema : [i.schema]), X = o(() => r.value ? S.value[l.value] || [] : []), {
89
+ })) : []), C = n(() => N.value ? i.schema : [i.schema]), W = n(() => r.value ? C.value[l.value] || [] : []), {
92
90
  formValues: F,
93
91
  errors: w,
94
- isSubmitting: b,
95
- fieldLoading: $,
96
- handleFieldChange: ue,
97
- validateField: de,
98
- validateAll: ce,
92
+ isSubmitting: h,
93
+ fieldLoading: M,
94
+ handleFieldChange: ne,
95
+ validateField: re,
96
+ validateAll: ue,
99
97
  isFieldVisible: T,
100
98
  isFieldDisabled: U,
101
- isFieldReadonly: E,
102
- handleSubmit: me
103
- } = Re({
99
+ isFieldReadonly: $,
100
+ handleSubmit: de
101
+ } = Se({
104
102
  schema: i.schema,
105
103
  values: i.values,
106
104
  isUpdate: i.isUpdate,
107
105
  folderId: i.folderId,
108
106
  emitFields: i.emitFields,
109
107
  onSubmit: (t) => {
110
- f("onSubmit", t, m?.close || (() => {
108
+ g("onSubmit", t, m?.close || (() => {
111
109
  }));
112
110
  }
113
111
  });
114
- te(
115
- () => i.loading || b.value,
112
+ ee(
113
+ () => i.loading || h.value,
116
114
  (t) => {
117
115
  m?.setSubmitting && m.setSubmitting(t);
118
116
  },
119
117
  { immediate: !0 }
120
- ), G(() => {
118
+ ), E(() => {
121
119
  m?.setSubmitting && m.setSubmitting(!1);
122
- }), te(
120
+ }), ee(
123
121
  () => i.values,
124
122
  (t) => {
125
123
  },
126
124
  { deep: !0 }
127
125
  );
128
126
  const j = (t, s) => {
129
- ue(t, s.value, s.data);
130
- }, fe = () => {
127
+ ne(t, s.value, s.data);
128
+ }, ce = () => {
131
129
  if (!r.value) return !0;
132
- const t = X.value;
130
+ const t = W.value;
133
131
  let s = !0;
134
132
  for (const u of t) {
135
133
  if (!T(u) || U(u)) continue;
136
- de(u) && (s = !1);
134
+ re(u) && (s = !1);
137
135
  }
138
136
  return s;
139
- }, ve = o(() => r.value ? l.value < S.value.length - 1 : !1), Y = o(() => r.value ? l.value > 0 : !1), V = o(() => r.value ? l.value === S.value.length - 1 : !0), Z = () => {
140
- ve.value && fe() && (l.value++, f("onStepChange", l.value));
141
- }, ge = () => {
142
- Y.value && (l.value--, f("onStepChange", l.value));
143
- }, he = (t, s) => {
144
- s <= l.value && (l.value = s, f("onStepChange", l.value));
137
+ }, me = n(() => r.value ? l.value < C.value.length - 1 : !1), X = n(() => r.value ? l.value > 0 : !1), V = n(() => r.value ? l.value === C.value.length - 1 : !0), Y = () => {
138
+ me.value && ce() && (l.value++, g("onStepChange", l.value));
139
+ }, fe = () => {
140
+ X.value && (l.value--, g("onStepChange", l.value));
141
+ }, ve = (t, s) => {
142
+ s <= l.value && (l.value = s, g("onStepChange", l.value));
145
143
  }, y = async () => {
146
144
  if (r.value) {
147
145
  if (!V.value && !i.isUpdate) {
148
- Z();
146
+ Y();
149
147
  return;
150
148
  }
151
- if (!ce()) {
152
- const s = S.value.findIndex(
153
- (u) => u.some((h) => !!w.value[h.name])
149
+ if (!ue()) {
150
+ const s = C.value.findIndex(
151
+ (u) => u.some((b) => !!w.value[b.name])
154
152
  );
155
- s !== -1 && s !== l.value && (l.value = s, f("onStepChange", l.value));
153
+ s !== -1 && s !== l.value && (l.value = s, g("onStepChange", l.value));
156
154
  return;
157
155
  }
158
156
  }
159
157
  try {
160
- await me();
158
+ await de();
161
159
  } catch {
162
160
  }
163
- }, be = (t) => {
161
+ }, ge = (t) => {
164
162
  if (t.key !== "Enter") return;
165
163
  const u = t.target.tagName.toLowerCase();
166
164
  u !== "textarea" && u !== "button" && (t.preventDefault(), y());
167
- }, _ = (t) => {
165
+ }, Z = (t) => {
168
166
  (t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(), y());
169
- }, ye = () => {
170
- f("onCancel"), m && m?.close?.();
171
- }, xe = () => {
172
- J.value && f("onBack");
167
+ }, be = () => {
168
+ g("onCancel"), m && m?.close?.();
173
169
  };
174
- return (t, s) => (n(), d("form", {
175
- class: v(["form-container ", i.class]),
176
- onSubmit: D(y, ["prevent"]),
170
+ return (t, s) => (o(), d("form", {
171
+ class: f(["form-container ", i.class]),
172
+ onSubmit: G(y, ["prevent"]),
177
173
  onKeydown: [
178
- be,
179
- ae(D(_, ["meta", "prevent"]), ["s"]),
180
- ae(D(_, ["ctrl", "prevent"]), ["s"])
174
+ ge,
175
+ te(G(Z, ["meta", "prevent"]), ["s"]),
176
+ te(G(Z, ["ctrl", "prevent"]), ["s"])
181
177
  ]
182
178
  }, [
183
- e.isPage ? (n(), d("div", {
179
+ e.isPage ? (o(), d("div", {
184
180
  key: 0,
185
- class: v([
186
- "form-page-header sticky top-0 z-30 bg-background flex items-center justify-between border-b border-border pb-4 pt-4 -mt-4 mb-6",
181
+ class: f([
182
+ "form-page-header sticky top-0 z-30 bg-background flex items-center justify-between pb-2 pt-4 -mt-4 mb-6.5",
187
183
  e.pageHeaderClass
188
184
  ])
189
185
  }, [
190
- g("div", Ve, [
191
- J.value ? (n(), x(Pe, A({ key: 1 }, e.backButtonProps, { class: "max-sm:w-8 max-sm:h-8 max-sm:min-w-8 max-sm:min-h-8 max-sm:px-0 flex-shrink-0" }), null, 16)) : (n(), x(k, A({
192
- key: 0,
193
- type: "button"
194
- }, e.backButtonProps, {
195
- onClick: D(xe, ["prevent"]),
186
+ v("div", Pe, [
187
+ k(Ce, B(e.backButtonProps, {
188
+ fallback: e.backButtonPath,
196
189
  class: "max-sm:w-8 max-sm:h-8 max-sm:min-w-8 max-sm:min-h-8 max-sm:px-0 flex-shrink-0"
197
- }), null, 16)),
198
- g("h1", {
199
- class: v(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
200
- }, R(e.pageTitleI18n ? a(Ne)(e.pageTitleI18n) : e.pageTitle), 3)
190
+ }), null, 16, ["fallback"]),
191
+ v("h1", {
192
+ class: f(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
193
+ }, A(e.pageTitleI18n ? a(we)(e.pageTitleI18n) : e.pageTitle), 3)
201
194
  ]),
202
- g("div", ze, [
203
- ie(t.$slots, "header-actions", {
195
+ v("div", Ne, [
196
+ ae(t.$slots, "header-actions", {
204
197
  values: a(F),
205
- isSubmitting: a(b),
198
+ isSubmitting: a(h),
206
199
  handleSubmit: y
207
200
  }, void 0, !0),
208
- P(k, A({
201
+ k(p, B({
209
202
  type: "button",
210
203
  variant: e.isUpdate ? "outline" : "primary",
211
204
  text: e.submitText
212
205
  }, e.submitProps, {
213
- loading: e.loading || a(b),
206
+ loading: e.loading || a(h),
214
207
  onClick: y,
215
208
  class: "max-sm:hidden"
216
209
  }), null, 16, ["variant", "text", "loading"])
217
210
  ])
218
211
  ], 2)) : c("", !0),
219
- r.value && W.value.length > 0 ? (n(), d("div", {
212
+ r.value && Q.value.length > 0 ? (o(), d("div", {
220
213
  key: 1,
221
- class: v(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
214
+ class: f(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
222
215
  }, [
223
- P(a(Be), {
224
- steps: W.value,
216
+ k(a(Fe), {
217
+ steps: Q.value,
225
218
  activeStep: l.value,
226
219
  direction: "horizontal",
227
220
  textPosition: e.timelineTextPosition,
228
221
  clickable: !0,
229
- onStepClick: he
222
+ onStepClick: ve
230
223
  }, null, 8, ["steps", "activeStep", "textPosition"])
231
224
  ], 2)) : c("", !0),
232
- g("div", {
233
- class: v(e.footer && C.value ? "pb-2" : "")
225
+ v("div", {
226
+ class: f(e.footer && S.value ? "pb-2" : "")
234
227
  }, [
235
- N.value ? N.value && !r.value ? (n(), d("div", Le, [
236
- (n(!0), d(Fe, null, we(S.value, (u, h) => (n(), d("div", {
237
- key: h,
238
- class: v(["form-group border rounded overflow-hidden bg-body", e.groupClass])
228
+ N.value ? N.value && !r.value ? (o(), d("div", Ue, [
229
+ (o(!0), d(ke, null, pe(C.value, (u, b) => (o(), d("div", {
230
+ key: b,
231
+ class: f(["form-group border rounded overflow-hidden bg-body", e.groupClass])
239
232
  }, [
240
- e.groupsHeadings?.[h] ? (n(), d("div", {
233
+ e.groupsHeadings?.[b] ? (o(), d("div", {
241
234
  key: 0,
242
- class: v(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
235
+ class: f(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
243
236
  }, [
244
- g("h3", qe, R(e.groupsHeadings[h]), 1),
245
- e.groupHeadingsDescription?.[h] ? (n(), d("p", He, R(e.groupHeadingsDescription[h]), 1)) : c("", !0)
237
+ v("h3", Ve, A(e.groupsHeadings[b]), 1),
238
+ e.groupHeadingsDescription?.[b] ? (o(), d("p", ze, A(e.groupHeadingsDescription[b]), 1)) : c("", !0)
246
239
  ], 2)) : c("", !0),
247
- g("div", Ie, [
248
- P(O, {
240
+ v("div", Be, [
241
+ k(O, {
249
242
  schema: u,
250
243
  values: a(F),
251
244
  errors: a(w),
252
- fieldLoading: a($),
253
- variant: L.value,
254
- size: q.value,
255
- rounded: H.value,
245
+ fieldLoading: a(M),
246
+ variant: D.value,
247
+ size: L.value,
248
+ rounded: q.value,
256
249
  className: e.className,
257
250
  isUpdate: e.isUpdate,
258
- showRequiredAsterisk: I.value,
251
+ showRequiredAsterisk: H.value,
259
252
  isFieldVisible: a(T),
260
253
  isFieldDisabled: a(U),
261
- isFieldReadonly: a(E),
254
+ isFieldReadonly: a($),
262
255
  onChange: j,
263
- onAddonAction: s[1] || (s[1] = (ke) => f("onAddonAction", ke))
256
+ onAddonAction: s[1] || (s[1] = (he) => g("onAddonAction", he))
264
257
  }, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
265
258
  ])
266
259
  ], 2))), 128))
267
- ])) : r.value ? (n(), d("div", Ke, [
268
- e.tabs?.[l.value] ? (n(), d("div", {
260
+ ])) : r.value ? (o(), d("div", De, [
261
+ e.tabs?.[l.value] ? (o(), d("div", {
269
262
  key: 0,
270
- class: v(["form-step-header mb-6", e.headerClass])
263
+ class: f(["form-step-header mb-6", e.headerClass])
271
264
  }, [
272
- g("h2", Me, R(e.tabs[l.value].title), 1),
273
- e.tabs[l.value].description ? (n(), d("p", $e, R(e.tabs[l.value].description), 1)) : c("", !0)
265
+ v("h2", Le, A(e.tabs[l.value].title), 1),
266
+ e.tabs[l.value].description ? (o(), d("p", qe, A(e.tabs[l.value].description), 1)) : c("", !0)
274
267
  ], 2)) : c("", !0),
275
- P(O, {
276
- schema: X.value,
268
+ k(O, {
269
+ schema: W.value,
277
270
  values: a(F),
278
271
  errors: a(w),
279
- fieldLoading: a($),
280
- variant: L.value,
281
- size: q.value,
282
- rounded: H.value,
272
+ fieldLoading: a(M),
273
+ variant: D.value,
274
+ size: L.value,
275
+ rounded: q.value,
283
276
  className: e.className,
284
277
  isUpdate: e.isUpdate,
285
- showRequiredAsterisk: I.value,
278
+ showRequiredAsterisk: H.value,
286
279
  isFieldVisible: a(T),
287
280
  isFieldDisabled: a(U),
288
- isFieldReadonly: a(E),
281
+ isFieldReadonly: a($),
289
282
  onChange: j,
290
- onAddonAction: s[2] || (s[2] = (u) => f("onAddonAction", u))
283
+ onAddonAction: s[2] || (s[2] = (u) => g("onAddonAction", u))
291
284
  }, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
292
- ])) : c("", !0) : (n(), d("div", De, [
293
- P(O, {
285
+ ])) : c("", !0) : (o(), d("div", Te, [
286
+ k(O, {
294
287
  schema: e.schema,
295
288
  values: a(F),
296
289
  errors: a(w),
297
- fieldLoading: a($),
298
- variant: L.value,
299
- size: q.value,
300
- rounded: H.value,
290
+ fieldLoading: a(M),
291
+ variant: D.value,
292
+ size: L.value,
293
+ rounded: q.value,
301
294
  className: e.className,
302
295
  isUpdate: e.isUpdate,
303
- showRequiredAsterisk: I.value,
296
+ showRequiredAsterisk: H.value,
304
297
  isFieldVisible: a(T),
305
298
  isFieldDisabled: a(U),
306
- isFieldReadonly: a(E),
299
+ isFieldReadonly: a($),
307
300
  onChange: j,
308
- onAddonAction: s[0] || (s[0] = (u) => f("onAddonAction", u))
301
+ onAddonAction: s[0] || (s[0] = (u) => g("onAddonAction", u))
309
302
  }, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
310
303
  ])),
311
- ie(t.$slots, "default", {
304
+ ae(t.$slots, "default", {
312
305
  values: a(F),
313
306
  errors: a(w),
314
- isSubmitting: a(b),
307
+ isSubmitting: a(h),
315
308
  handleSubmit: y
316
309
  }, void 0, !0),
317
- g("div", {
310
+ v("div", {
318
311
  ref_key: "sentinelRef",
319
- ref: K,
312
+ ref: I,
320
313
  class: "form-scroll-sentinel h-px w-full",
321
314
  "aria-hidden": "true"
322
315
  }, null, 512)
323
316
  ], 2),
324
- e.footer ? (n(), d("div", {
317
+ e.footer ? (o(), d("div", {
325
318
  key: 2,
326
319
  ref_key: "footerRef",
327
- ref: re,
328
- class: v([
320
+ ref: oe,
321
+ class: f([
329
322
  "form-footer items-center gap-3 z-20",
330
323
  e.isPage ? "flex sm:hidden" : "flex",
331
324
  e.footerClass,
@@ -334,67 +327,67 @@ const Ue = ["onKeydown"], Ve = { class: "flex items-center gap-3" }, ze = { clas
334
327
  // `sticky bottom-0` anchors the footer to the bottom of the nearest scrollable ancestor
335
328
  // (the modal's overflow-y-auto body), keeping it visible at all times without leaving
336
329
  // the normal document flow (unlike `fixed` which would escape the modal bounds).
337
- C.value ? "sticky bottom-0 bg-body pt-3 pb-3 -mx-0.5 px-0.5 border-t border-border/75" : "mt-6",
330
+ S.value ? "sticky bottom-0 bg-body pt-3 pb-3 -mx-0.5 px-0.5 border-t border-border/75" : "mt-6",
338
331
  // Show a subtle top shadow while content is scrolling beneath the sticky footer
339
- (C.value && Q.value, ""),
332
+ (S.value && J.value, ""),
340
333
  // Inside modal: extend footer flush to modal edge padding
341
- p.value ? "-mx-4 px-4 pb-3!" : "",
334
+ x.value ? "-mx-4 px-4 pb-3!" : "",
342
335
  // Non-sticky inside modal keeps the original border styling
343
- !C.value && p.value ? "border-t border-border/75 mt-5" : "",
344
- !C.value && !p.value ? "mt-6" : ""
336
+ !S.value && x.value ? "border-t border-border/75 mt-5" : "",
337
+ !S.value && !x.value ? "mt-6" : ""
345
338
  ])
346
339
  }, [
347
- g("div", Ee, [
348
- oe.value ? (n(), x(k, {
340
+ v("div", He, [
341
+ le.value ? (o(), R(p, {
349
342
  key: 0,
350
343
  type: "button",
351
344
  variant: "outline",
352
345
  text: e.cancelText,
353
- disabled: e.loading || a(b),
354
- onClick: ye
346
+ disabled: e.loading || a(h),
347
+ onClick: be
355
348
  }, null, 8, ["text", "disabled"])) : c("", !0),
356
- r.value && e.isUpdate && !V.value ? (n(), x(k, A({
349
+ r.value && e.isUpdate && !V.value ? (o(), R(p, B({
357
350
  key: 1,
358
351
  type: "button",
359
352
  variant: "primary",
360
353
  text: e.submitText
361
354
  }, e.submitProps, {
362
- loading: e.loading || a(b),
355
+ loading: e.loading || a(h),
363
356
  onClick: y
364
357
  }), null, 16, ["text", "loading"])) : c("", !0)
365
358
  ]),
366
- g("div", {
367
- class: v(["flex items-center gap-3", r.value && "ml-auto"])
359
+ v("div", {
360
+ class: f(["flex items-center gap-3", r.value && "ml-auto"])
368
361
  }, [
369
- r.value && Y.value ? (n(), x(k, {
362
+ r.value && X.value ? (o(), R(p, {
370
363
  key: 0,
371
364
  type: "button",
372
365
  variant: "outline",
373
366
  icon: "lucide:arrow-left",
374
367
  text: "Previous",
375
- onClick: ge
368
+ onClick: fe
376
369
  })) : c("", !0),
377
- r.value && !V.value ? (n(), x(k, {
370
+ r.value && !V.value ? (o(), R(p, {
378
371
  key: 1,
379
372
  type: "button",
380
373
  variant: e.isUpdate ? "outline" : "primary",
381
374
  text: "Next",
382
375
  iconRight: "lucide:arrow-right",
383
- onClick: Z
376
+ onClick: Y
384
377
  }, null, 8, ["variant"])) : c("", !0),
385
- !r.value || V.value ? (n(), x(k, A({
378
+ !r.value || V.value ? (o(), R(p, B({
386
379
  key: 2,
387
380
  type: "submit",
388
381
  variant: "primary",
389
382
  text: e.submitText
390
383
  }, e.submitProps, {
391
- loading: e.loading || a(b)
384
+ loading: e.loading || a(h)
392
385
  }), null, 16, ["text", "loading"])) : c("", !0)
393
386
  ], 2)
394
387
  ], 2)) : c("", !0)
395
- ], 42, Ue));
388
+ ], 42, Re));
396
389
  }
397
390
  });
398
391
  export {
399
- et as default
392
+ Qe as default
400
393
  };
@@ -51,5 +51,16 @@ export declare function isComponent(value: any): boolean;
51
51
  * Cleans the submit payload by extracting only schema fields,
52
52
  * injecting specified emitFields, and removing ignoreFields recursively.
53
53
  * Also processes mapped output and transformation functions.
54
+ *
55
+ * KEY BEHAVIOUR (fix for Prisma / Postgres sync on updates):
56
+ * A field is included in the payload only when:
57
+ * 1. It has a non-empty value — always included (create & update).
58
+ * 2. It is empty AND the field key already existed in the original `values`
59
+ * object — meaning the user explicitly cleared a pre-existing value during
60
+ * an update. In this case the canonical empty value (`[]` for multiSelect,
61
+ * `null` for everything else) is sent so the backend overwrites the old data.
62
+ *
63
+ * Fields that were never filled in (key absent from `values`) are silently
64
+ * omitted to keep create payloads lean.
54
65
  */
55
66
  export declare function cleanSubmitValues(values: Record<string, any>, schema: IForm[] | IForm[][], emitFields?: string[], ignoreFields?: string[]): Record<string, any>;