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.
- 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/Empty/Empty.vue.js +1 -1
- package/components/Empty/variants/Variant1.vue2.js +20 -17
- package/components/Empty/variants/Variant2.vue2.js +21 -21
- package/components/Empty/variants/Variant3.vue2.js +8 -11
- package/components/Empty/variants/Variant5.vue2.js +15 -18
- package/components/Empty/variants/Variant6.vue2.js +22 -22
- package/components/Form/Form.vue.d.ts +1 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +162 -169
- package/components/Form/utils/form.utils.d.ts +11 -0
- package/components/Form/utils/form.utils.js +115 -104
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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
|
|
10
|
-
import { useVLiteConfig as
|
|
11
|
-
const
|
|
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
|
-
},
|
|
13
|
+
}, Ue = {
|
|
15
14
|
key: 1,
|
|
16
15
|
class: "form-groups space-y-6"
|
|
17
|
-
},
|
|
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
|
-
},
|
|
19
|
+
}, Be = { class: "form-group-body p-4.5" }, De = {
|
|
21
20
|
key: 2,
|
|
22
21
|
class: "form-step"
|
|
23
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
63
|
-
const i = e,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
76
|
+
J.value = !t.isIntersecting;
|
|
79
77
|
},
|
|
80
78
|
{ threshold: 0 }
|
|
81
|
-
),
|
|
82
|
-
}),
|
|
83
|
-
|
|
79
|
+
), K.observe(I.value));
|
|
80
|
+
}), E(() => {
|
|
81
|
+
K?.disconnect();
|
|
84
82
|
});
|
|
85
|
-
const N =
|
|
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
|
-
})) : []),
|
|
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:
|
|
95
|
-
fieldLoading:
|
|
96
|
-
handleFieldChange:
|
|
97
|
-
validateField:
|
|
98
|
-
validateAll:
|
|
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:
|
|
102
|
-
handleSubmit:
|
|
103
|
-
} =
|
|
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
|
-
|
|
108
|
+
g("onSubmit", t, m?.close || (() => {
|
|
111
109
|
}));
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
|
-
|
|
115
|
-
() => i.loading ||
|
|
112
|
+
ee(
|
|
113
|
+
() => i.loading || h.value,
|
|
116
114
|
(t) => {
|
|
117
115
|
m?.setSubmitting && m.setSubmitting(t);
|
|
118
116
|
},
|
|
119
117
|
{ immediate: !0 }
|
|
120
|
-
),
|
|
118
|
+
), E(() => {
|
|
121
119
|
m?.setSubmitting && m.setSubmitting(!1);
|
|
122
|
-
}),
|
|
120
|
+
}), ee(
|
|
123
121
|
() => i.values,
|
|
124
122
|
(t) => {
|
|
125
123
|
},
|
|
126
124
|
{ deep: !0 }
|
|
127
125
|
);
|
|
128
126
|
const j = (t, s) => {
|
|
129
|
-
|
|
130
|
-
},
|
|
127
|
+
ne(t, s.value, s.data);
|
|
128
|
+
}, ce = () => {
|
|
131
129
|
if (!r.value) return !0;
|
|
132
|
-
const t =
|
|
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
|
-
|
|
134
|
+
re(u) && (s = !1);
|
|
137
135
|
}
|
|
138
136
|
return s;
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
s <= l.value && (l.value = s,
|
|
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
|
-
|
|
146
|
+
Y();
|
|
149
147
|
return;
|
|
150
148
|
}
|
|
151
|
-
if (!
|
|
152
|
-
const s =
|
|
153
|
-
(u) => u.some((
|
|
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,
|
|
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
|
|
158
|
+
await de();
|
|
161
159
|
} catch {
|
|
162
160
|
}
|
|
163
|
-
},
|
|
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
|
-
},
|
|
165
|
+
}, Z = (t) => {
|
|
168
166
|
(t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(), y());
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
}, xe = () => {
|
|
172
|
-
J.value && f("onBack");
|
|
167
|
+
}, be = () => {
|
|
168
|
+
g("onCancel"), m && m?.close?.();
|
|
173
169
|
};
|
|
174
|
-
return (t, s) => (
|
|
175
|
-
class:
|
|
176
|
-
onSubmit:
|
|
170
|
+
return (t, s) => (o(), d("form", {
|
|
171
|
+
class: f(["form-container ", i.class]),
|
|
172
|
+
onSubmit: G(y, ["prevent"]),
|
|
177
173
|
onKeydown: [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
ge,
|
|
175
|
+
te(G(Z, ["meta", "prevent"]), ["s"]),
|
|
176
|
+
te(G(Z, ["ctrl", "prevent"]), ["s"])
|
|
181
177
|
]
|
|
182
178
|
}, [
|
|
183
|
-
e.isPage ? (
|
|
179
|
+
e.isPage ? (o(), d("div", {
|
|
184
180
|
key: 0,
|
|
185
|
-
class:
|
|
186
|
-
"form-page-header sticky top-0 z-30 bg-background flex items-center justify-between
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
199
|
-
class:
|
|
200
|
-
},
|
|
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
|
-
|
|
203
|
-
|
|
195
|
+
v("div", Ne, [
|
|
196
|
+
ae(t.$slots, "header-actions", {
|
|
204
197
|
values: a(F),
|
|
205
|
-
isSubmitting: a(
|
|
198
|
+
isSubmitting: a(h),
|
|
206
199
|
handleSubmit: y
|
|
207
200
|
}, void 0, !0),
|
|
208
|
-
|
|
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(
|
|
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 &&
|
|
212
|
+
r.value && Q.value.length > 0 ? (o(), d("div", {
|
|
220
213
|
key: 1,
|
|
221
|
-
class:
|
|
214
|
+
class: f(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
|
|
222
215
|
}, [
|
|
223
|
-
|
|
224
|
-
steps:
|
|
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:
|
|
222
|
+
onStepClick: ve
|
|
230
223
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
231
224
|
], 2)) : c("", !0),
|
|
232
|
-
|
|
233
|
-
class:
|
|
225
|
+
v("div", {
|
|
226
|
+
class: f(e.footer && S.value ? "pb-2" : "")
|
|
234
227
|
}, [
|
|
235
|
-
N.value ? N.value && !r.value ? (
|
|
236
|
-
(
|
|
237
|
-
key:
|
|
238
|
-
class:
|
|
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?.[
|
|
233
|
+
e.groupsHeadings?.[b] ? (o(), d("div", {
|
|
241
234
|
key: 0,
|
|
242
|
-
class:
|
|
235
|
+
class: f(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
|
|
243
236
|
}, [
|
|
244
|
-
|
|
245
|
-
e.groupHeadingsDescription?.[
|
|
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
|
-
|
|
248
|
-
|
|
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:
|
|
254
|
-
size:
|
|
255
|
-
rounded:
|
|
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:
|
|
251
|
+
showRequiredAsterisk: H.value,
|
|
259
252
|
isFieldVisible: a(T),
|
|
260
253
|
isFieldDisabled: a(U),
|
|
261
|
-
isFieldReadonly: a(
|
|
254
|
+
isFieldReadonly: a($),
|
|
262
255
|
onChange: j,
|
|
263
|
-
onAddonAction: s[1] || (s[1] = (
|
|
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 ? (
|
|
268
|
-
e.tabs?.[l.value] ? (
|
|
260
|
+
])) : r.value ? (o(), d("div", De, [
|
|
261
|
+
e.tabs?.[l.value] ? (o(), d("div", {
|
|
269
262
|
key: 0,
|
|
270
|
-
class:
|
|
263
|
+
class: f(["form-step-header mb-6", e.headerClass])
|
|
271
264
|
}, [
|
|
272
|
-
|
|
273
|
-
e.tabs[l.value].description ? (
|
|
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
|
-
|
|
276
|
-
schema:
|
|
268
|
+
k(O, {
|
|
269
|
+
schema: W.value,
|
|
277
270
|
values: a(F),
|
|
278
271
|
errors: a(w),
|
|
279
|
-
fieldLoading: a(
|
|
280
|
-
variant:
|
|
281
|
-
size:
|
|
282
|
-
rounded:
|
|
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:
|
|
278
|
+
showRequiredAsterisk: H.value,
|
|
286
279
|
isFieldVisible: a(T),
|
|
287
280
|
isFieldDisabled: a(U),
|
|
288
|
-
isFieldReadonly: a(
|
|
281
|
+
isFieldReadonly: a($),
|
|
289
282
|
onChange: j,
|
|
290
|
-
onAddonAction: s[2] || (s[2] = (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) : (
|
|
293
|
-
|
|
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:
|
|
299
|
-
size:
|
|
300
|
-
rounded:
|
|
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:
|
|
296
|
+
showRequiredAsterisk: H.value,
|
|
304
297
|
isFieldVisible: a(T),
|
|
305
298
|
isFieldDisabled: a(U),
|
|
306
|
-
isFieldReadonly: a(
|
|
299
|
+
isFieldReadonly: a($),
|
|
307
300
|
onChange: j,
|
|
308
|
-
onAddonAction: s[0] || (s[0] = (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
|
-
|
|
304
|
+
ae(t.$slots, "default", {
|
|
312
305
|
values: a(F),
|
|
313
306
|
errors: a(w),
|
|
314
|
-
isSubmitting: a(
|
|
307
|
+
isSubmitting: a(h),
|
|
315
308
|
handleSubmit: y
|
|
316
309
|
}, void 0, !0),
|
|
317
|
-
|
|
310
|
+
v("div", {
|
|
318
311
|
ref_key: "sentinelRef",
|
|
319
|
-
ref:
|
|
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 ? (
|
|
317
|
+
e.footer ? (o(), d("div", {
|
|
325
318
|
key: 2,
|
|
326
319
|
ref_key: "footerRef",
|
|
327
|
-
ref:
|
|
328
|
-
class:
|
|
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
|
-
|
|
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
|
-
(
|
|
332
|
+
(S.value && J.value, ""),
|
|
340
333
|
// Inside modal: extend footer flush to modal edge padding
|
|
341
|
-
|
|
334
|
+
x.value ? "-mx-4 px-4 pb-3!" : "",
|
|
342
335
|
// Non-sticky inside modal keeps the original border styling
|
|
343
|
-
!
|
|
344
|
-
!
|
|
336
|
+
!S.value && x.value ? "border-t border-border/75 mt-5" : "",
|
|
337
|
+
!S.value && !x.value ? "mt-6" : ""
|
|
345
338
|
])
|
|
346
339
|
}, [
|
|
347
|
-
|
|
348
|
-
|
|
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(
|
|
354
|
-
onClick:
|
|
346
|
+
disabled: e.loading || a(h),
|
|
347
|
+
onClick: be
|
|
355
348
|
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
356
|
-
r.value && e.isUpdate && !V.value ? (
|
|
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(
|
|
355
|
+
loading: e.loading || a(h),
|
|
363
356
|
onClick: y
|
|
364
357
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
365
358
|
]),
|
|
366
|
-
|
|
367
|
-
class:
|
|
359
|
+
v("div", {
|
|
360
|
+
class: f(["flex items-center gap-3", r.value && "ml-auto"])
|
|
368
361
|
}, [
|
|
369
|
-
r.value &&
|
|
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:
|
|
368
|
+
onClick: fe
|
|
376
369
|
})) : c("", !0),
|
|
377
|
-
r.value && !V.value ? (
|
|
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:
|
|
376
|
+
onClick: Y
|
|
384
377
|
}, null, 8, ["variant"])) : c("", !0),
|
|
385
|
-
!r.value || V.value ? (
|
|
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(
|
|
384
|
+
loading: e.loading || a(h)
|
|
392
385
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
393
386
|
], 2)
|
|
394
387
|
], 2)) : c("", !0)
|
|
395
|
-
], 42,
|
|
388
|
+
], 42, Re));
|
|
396
389
|
}
|
|
397
390
|
});
|
|
398
391
|
export {
|
|
399
|
-
|
|
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>;
|