vlite3 0.8.2 → 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/BackButton.vue.js +10 -11
- package/components/Breadcrumb/Breadcrumb.vue.js +2 -2
- package/components/Chip/Chip.vue.d.ts +2 -2
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +1 -1
- 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/DataTable/DataTable.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.d.ts +2 -0
- package/components/Empty/Empty.vue.js +50 -33
- package/components/Empty/index.d.ts +1 -0
- package/components/Empty/variants/Variant1.vue.d.ts +22 -0
- package/components/Empty/variants/Variant1.vue.js +4 -0
- package/components/Empty/variants/Variant1.vue2.js +33 -0
- package/components/Empty/variants/Variant10.vue.d.ts +22 -0
- package/components/Empty/variants/Variant10.vue.js +4 -0
- package/components/Empty/variants/Variant10.vue2.js +37 -0
- package/components/Empty/variants/Variant11.vue.d.ts +22 -0
- package/components/Empty/variants/Variant11.vue.js +4 -0
- package/components/Empty/variants/Variant11.vue2.js +29 -0
- package/components/Empty/variants/Variant2.vue.d.ts +22 -0
- package/components/Empty/variants/Variant2.vue.js +4 -0
- package/components/Empty/variants/Variant2.vue2.js +33 -0
- package/components/Empty/variants/Variant3.vue.d.ts +22 -0
- package/components/Empty/variants/Variant3.vue.js +4 -0
- package/components/Empty/variants/Variant3.vue2.js +22 -0
- package/components/Empty/variants/Variant4.vue.d.ts +22 -0
- package/components/Empty/variants/Variant4.vue.js +4 -0
- package/components/Empty/variants/Variant4.vue2.js +33 -0
- package/components/Empty/variants/Variant5.vue.d.ts +22 -0
- package/components/Empty/variants/Variant5.vue.js +4 -0
- package/components/Empty/variants/Variant5.vue2.js +30 -0
- package/components/Empty/variants/Variant6.vue.d.ts +22 -0
- package/components/Empty/variants/Variant6.vue.js +4 -0
- package/components/Empty/variants/Variant6.vue2.js +33 -0
- package/components/Empty/variants/Variant7.vue.d.ts +22 -0
- package/components/Empty/variants/Variant7.vue.js +4 -0
- package/components/Empty/variants/Variant7.vue2.js +35 -0
- package/components/Empty/variants/Variant8.vue.d.ts +22 -0
- package/components/Empty/variants/Variant8.vue.js +4 -0
- package/components/Empty/variants/Variant8.vue2.js +33 -0
- package/components/Empty/variants/Variant9.vue.d.ts +22 -0
- package/components/Empty/variants/Variant9.vue.js +4 -0
- package/components/Empty/variants/Variant9.vue2.js +33 -0
- package/components/Form/Form.vue.d.ts +18 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +219 -170
- package/components/Form/types.d.ts +13 -1
- package/components/Form/utils/form.utils.d.ts +11 -0
- package/components/Form/utils/form.utils.js +115 -104
- package/components/Modal.vue.js +2 -2
- package/components/Modal.vue2.js +45 -43
- package/components/Navbar/Navbar.vue.d.ts +2 -2
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.js +249 -241
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidebarMenu/SidebarMenuItem.vue.js +5 -7
- package/components/Workbook/Workbook.vue.d.ts +2 -2
- package/core/config.d.ts +6 -0
- package/core/config.js +14 -8
- package/core/index.js +12 -7
- package/index.d.ts +1 -0
- package/index.js +120 -117
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/config.type.d.ts +9 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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";
|
|
3
|
+
import O from "./FormFields.vue.js";
|
|
4
|
+
import p from "../Button.vue.js";
|
|
5
|
+
import Ce from "../BackButton.vue.js";
|
|
6
|
+
import Fe from "../Timeline/Timeline.vue.js";
|
|
6
7
|
import "@iconify/vue";
|
|
7
|
-
import {
|
|
8
|
-
|
|
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 = {
|
|
9
11
|
key: 0,
|
|
10
12
|
class: "form-fields-single"
|
|
11
|
-
},
|
|
13
|
+
}, Ue = {
|
|
12
14
|
key: 1,
|
|
13
15
|
class: "form-groups space-y-6"
|
|
14
|
-
},
|
|
16
|
+
}, Ve = { class: "text-base font-semibold text-foreground" }, ze = {
|
|
15
17
|
key: 0,
|
|
16
18
|
class: "text-sm text-muted-foreground mt-1"
|
|
17
|
-
},
|
|
19
|
+
}, Be = { class: "form-group-body p-4.5" }, De = {
|
|
18
20
|
key: 2,
|
|
19
21
|
class: "form-step"
|
|
20
|
-
},
|
|
22
|
+
}, Le = { class: "text-lg font-semibold text-foreground" }, qe = {
|
|
21
23
|
key: 0,
|
|
22
24
|
class: "text-sm text-muted-foreground mt-1"
|
|
23
|
-
},
|
|
25
|
+
}, He = { class: "flex items-center gap-3" }, Qe = /* @__PURE__ */ ye({
|
|
24
26
|
__name: "Form",
|
|
25
27
|
props: {
|
|
26
28
|
schema: {},
|
|
@@ -47,129 +49,172 @@ const we = ["onKeydown"], Ae = {
|
|
|
47
49
|
timelineTextPosition: { default: "right" },
|
|
48
50
|
emitFields: { default: () => ["__typename"] },
|
|
49
51
|
showRequiredAsterisk: { type: Boolean },
|
|
50
|
-
stickyFooter: { type: Boolean, default: !1 }
|
|
52
|
+
stickyFooter: { type: Boolean, default: !1 },
|
|
53
|
+
isPage: { type: Boolean, default: !1 },
|
|
54
|
+
pageTitle: {},
|
|
55
|
+
pageTitleI18n: {},
|
|
56
|
+
pageTitleClass: { default: "text-2xl font-bold" },
|
|
57
|
+
pageHeaderClass: { default: "" },
|
|
58
|
+
backButtonProps: { default: () => ({ size: "sm", variant: "ghost", icon: "heroicons-solid:arrow-left" }) },
|
|
59
|
+
backButtonPath: {}
|
|
51
60
|
},
|
|
52
|
-
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction"],
|
|
53
|
-
setup(e, { emit:
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
),
|
|
61
|
+
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction", "onBack"],
|
|
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);
|
|
70
|
+
});
|
|
71
|
+
const oe = z(null), I = z(null), J = z(!1);
|
|
60
72
|
let K = null;
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
_(() => {
|
|
74
|
+
I.value && (K = new IntersectionObserver(
|
|
63
75
|
([t]) => {
|
|
64
|
-
|
|
76
|
+
J.value = !t.isIntersecting;
|
|
65
77
|
},
|
|
66
78
|
{ threshold: 0 }
|
|
67
|
-
), K.observe(
|
|
68
|
-
}),
|
|
79
|
+
), K.observe(I.value));
|
|
80
|
+
}), E(() => {
|
|
69
81
|
K?.disconnect();
|
|
70
82
|
});
|
|
71
|
-
const
|
|
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) => ({
|
|
72
84
|
id: t.id?.toString() || s.toString(),
|
|
73
85
|
title: t.title,
|
|
74
86
|
icon: t.icon,
|
|
75
87
|
description: t.description,
|
|
76
88
|
status: s < l.value ? "completed" : s === l.value ? "current" : "upcoming"
|
|
77
|
-
})) : []),
|
|
78
|
-
formValues:
|
|
79
|
-
errors:
|
|
80
|
-
isSubmitting:
|
|
89
|
+
})) : []), C = n(() => N.value ? i.schema : [i.schema]), W = n(() => r.value ? C.value[l.value] || [] : []), {
|
|
90
|
+
formValues: F,
|
|
91
|
+
errors: w,
|
|
92
|
+
isSubmitting: h,
|
|
81
93
|
fieldLoading: M,
|
|
82
|
-
handleFieldChange:
|
|
83
|
-
validateField:
|
|
84
|
-
validateAll:
|
|
85
|
-
isFieldVisible:
|
|
86
|
-
isFieldDisabled:
|
|
87
|
-
isFieldReadonly:
|
|
88
|
-
handleSubmit:
|
|
89
|
-
} =
|
|
90
|
-
schema:
|
|
91
|
-
values:
|
|
92
|
-
isUpdate:
|
|
93
|
-
folderId:
|
|
94
|
-
emitFields:
|
|
94
|
+
handleFieldChange: ne,
|
|
95
|
+
validateField: re,
|
|
96
|
+
validateAll: ue,
|
|
97
|
+
isFieldVisible: T,
|
|
98
|
+
isFieldDisabled: U,
|
|
99
|
+
isFieldReadonly: $,
|
|
100
|
+
handleSubmit: de
|
|
101
|
+
} = Se({
|
|
102
|
+
schema: i.schema,
|
|
103
|
+
values: i.values,
|
|
104
|
+
isUpdate: i.isUpdate,
|
|
105
|
+
folderId: i.folderId,
|
|
106
|
+
emitFields: i.emitFields,
|
|
95
107
|
onSubmit: (t) => {
|
|
96
|
-
|
|
108
|
+
g("onSubmit", t, m?.close || (() => {
|
|
97
109
|
}));
|
|
98
110
|
}
|
|
99
111
|
});
|
|
100
|
-
|
|
101
|
-
() =>
|
|
112
|
+
ee(
|
|
113
|
+
() => i.loading || h.value,
|
|
102
114
|
(t) => {
|
|
103
115
|
m?.setSubmitting && m.setSubmitting(t);
|
|
104
116
|
},
|
|
105
117
|
{ immediate: !0 }
|
|
106
|
-
),
|
|
118
|
+
), E(() => {
|
|
107
119
|
m?.setSubmitting && m.setSubmitting(!1);
|
|
108
|
-
}),
|
|
109
|
-
() =>
|
|
120
|
+
}), ee(
|
|
121
|
+
() => i.values,
|
|
110
122
|
(t) => {
|
|
111
123
|
},
|
|
112
124
|
{ deep: !0 }
|
|
113
125
|
);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
},
|
|
126
|
+
const j = (t, s) => {
|
|
127
|
+
ne(t, s.value, s.data);
|
|
128
|
+
}, ce = () => {
|
|
117
129
|
if (!r.value) return !0;
|
|
118
|
-
const t =
|
|
130
|
+
const t = W.value;
|
|
119
131
|
let s = !0;
|
|
120
132
|
for (const u of t) {
|
|
121
|
-
if (!
|
|
122
|
-
|
|
133
|
+
if (!T(u) || U(u)) continue;
|
|
134
|
+
re(u) && (s = !1);
|
|
123
135
|
}
|
|
124
136
|
return s;
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
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));
|
|
129
141
|
}, ve = (t, s) => {
|
|
130
|
-
s <= l.value && (l.value = s,
|
|
131
|
-
},
|
|
142
|
+
s <= l.value && (l.value = s, g("onStepChange", l.value));
|
|
143
|
+
}, y = async () => {
|
|
132
144
|
if (r.value) {
|
|
133
|
-
if (!V.value && !
|
|
134
|
-
|
|
145
|
+
if (!V.value && !i.isUpdate) {
|
|
146
|
+
Y();
|
|
135
147
|
return;
|
|
136
148
|
}
|
|
137
|
-
if (!
|
|
138
|
-
const s =
|
|
139
|
-
(u) => u.some((
|
|
149
|
+
if (!ue()) {
|
|
150
|
+
const s = C.value.findIndex(
|
|
151
|
+
(u) => u.some((b) => !!w.value[b.name])
|
|
140
152
|
);
|
|
141
|
-
s !== -1 && s !== l.value && (l.value = s,
|
|
153
|
+
s !== -1 && s !== l.value && (l.value = s, g("onStepChange", l.value));
|
|
142
154
|
return;
|
|
143
155
|
}
|
|
144
156
|
}
|
|
145
157
|
try {
|
|
146
|
-
await
|
|
158
|
+
await de();
|
|
147
159
|
} catch {
|
|
148
160
|
}
|
|
149
|
-
},
|
|
161
|
+
}, ge = (t) => {
|
|
150
162
|
if (t.key !== "Enter") return;
|
|
151
163
|
const u = t.target.tagName.toLowerCase();
|
|
152
|
-
u !== "textarea" && u !== "button" && (t.preventDefault(),
|
|
153
|
-
},
|
|
154
|
-
(t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(),
|
|
155
|
-
},
|
|
156
|
-
|
|
164
|
+
u !== "textarea" && u !== "button" && (t.preventDefault(), y());
|
|
165
|
+
}, Z = (t) => {
|
|
166
|
+
(t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(), y());
|
|
167
|
+
}, be = () => {
|
|
168
|
+
g("onCancel"), m && m?.close?.();
|
|
157
169
|
};
|
|
158
170
|
return (t, s) => (o(), d("form", {
|
|
159
|
-
class:
|
|
160
|
-
onSubmit:
|
|
171
|
+
class: f(["form-container ", i.class]),
|
|
172
|
+
onSubmit: G(y, ["prevent"]),
|
|
161
173
|
onKeydown: [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
ge,
|
|
175
|
+
te(G(Z, ["meta", "prevent"]), ["s"]),
|
|
176
|
+
te(G(Z, ["ctrl", "prevent"]), ["s"])
|
|
165
177
|
]
|
|
166
178
|
}, [
|
|
167
|
-
|
|
179
|
+
e.isPage ? (o(), d("div", {
|
|
168
180
|
key: 0,
|
|
169
|
-
class:
|
|
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",
|
|
183
|
+
e.pageHeaderClass
|
|
184
|
+
])
|
|
185
|
+
}, [
|
|
186
|
+
v("div", Pe, [
|
|
187
|
+
k(Ce, B(e.backButtonProps, {
|
|
188
|
+
fallback: e.backButtonPath,
|
|
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"
|
|
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)
|
|
194
|
+
]),
|
|
195
|
+
v("div", Ne, [
|
|
196
|
+
ae(t.$slots, "header-actions", {
|
|
197
|
+
values: a(F),
|
|
198
|
+
isSubmitting: a(h),
|
|
199
|
+
handleSubmit: y
|
|
200
|
+
}, void 0, !0),
|
|
201
|
+
k(p, B({
|
|
202
|
+
type: "button",
|
|
203
|
+
variant: e.isUpdate ? "outline" : "primary",
|
|
204
|
+
text: e.submitText
|
|
205
|
+
}, e.submitProps, {
|
|
206
|
+
loading: e.loading || a(h),
|
|
207
|
+
onClick: y,
|
|
208
|
+
class: "max-sm:hidden"
|
|
209
|
+
}), null, 16, ["variant", "text", "loading"])
|
|
210
|
+
])
|
|
211
|
+
], 2)) : c("", !0),
|
|
212
|
+
r.value && Q.value.length > 0 ? (o(), d("div", {
|
|
213
|
+
key: 1,
|
|
214
|
+
class: f(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
|
|
170
215
|
}, [
|
|
171
|
-
|
|
172
|
-
steps:
|
|
216
|
+
k(a(Fe), {
|
|
217
|
+
steps: Q.value,
|
|
173
218
|
activeStep: l.value,
|
|
174
219
|
direction: "horizontal",
|
|
175
220
|
textPosition: e.timelineTextPosition,
|
|
@@ -177,168 +222,172 @@ const we = ["onKeydown"], Ae = {
|
|
|
177
222
|
onStepClick: ve
|
|
178
223
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
179
224
|
], 2)) : c("", !0),
|
|
180
|
-
|
|
181
|
-
class:
|
|
225
|
+
v("div", {
|
|
226
|
+
class: f(e.footer && S.value ? "pb-2" : "")
|
|
182
227
|
}, [
|
|
183
|
-
|
|
184
|
-
(o(!0), d(
|
|
185
|
-
key:
|
|
186
|
-
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])
|
|
187
232
|
}, [
|
|
188
|
-
e.groupsHeadings?.[
|
|
233
|
+
e.groupsHeadings?.[b] ? (o(), d("div", {
|
|
189
234
|
key: 0,
|
|
190
|
-
class:
|
|
235
|
+
class: f(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
|
|
191
236
|
}, [
|
|
192
|
-
|
|
193
|
-
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)
|
|
194
239
|
], 2)) : c("", !0),
|
|
195
|
-
|
|
196
|
-
|
|
240
|
+
v("div", Be, [
|
|
241
|
+
k(O, {
|
|
197
242
|
schema: u,
|
|
198
|
-
values:
|
|
199
|
-
errors:
|
|
200
|
-
fieldLoading:
|
|
201
|
-
variant:
|
|
243
|
+
values: a(F),
|
|
244
|
+
errors: a(w),
|
|
245
|
+
fieldLoading: a(M),
|
|
246
|
+
variant: D.value,
|
|
202
247
|
size: L.value,
|
|
203
248
|
rounded: q.value,
|
|
204
249
|
className: e.className,
|
|
205
250
|
isUpdate: e.isUpdate,
|
|
206
|
-
showRequiredAsterisk:
|
|
207
|
-
isFieldVisible:
|
|
208
|
-
isFieldDisabled:
|
|
209
|
-
isFieldReadonly:
|
|
210
|
-
onChange:
|
|
211
|
-
onAddonAction: s[1] || (s[1] = (
|
|
251
|
+
showRequiredAsterisk: H.value,
|
|
252
|
+
isFieldVisible: a(T),
|
|
253
|
+
isFieldDisabled: a(U),
|
|
254
|
+
isFieldReadonly: a($),
|
|
255
|
+
onChange: j,
|
|
256
|
+
onAddonAction: s[1] || (s[1] = (he) => g("onAddonAction", he))
|
|
212
257
|
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
213
258
|
])
|
|
214
259
|
], 2))), 128))
|
|
215
|
-
])) : r.value ? (o(), d("div",
|
|
260
|
+
])) : r.value ? (o(), d("div", De, [
|
|
216
261
|
e.tabs?.[l.value] ? (o(), d("div", {
|
|
217
262
|
key: 0,
|
|
218
|
-
class:
|
|
263
|
+
class: f(["form-step-header mb-6", e.headerClass])
|
|
219
264
|
}, [
|
|
220
|
-
|
|
221
|
-
e.tabs[l.value].description ? (o(), d("p",
|
|
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)
|
|
222
267
|
], 2)) : c("", !0),
|
|
223
|
-
|
|
224
|
-
schema:
|
|
225
|
-
values:
|
|
226
|
-
errors:
|
|
227
|
-
fieldLoading:
|
|
228
|
-
variant:
|
|
268
|
+
k(O, {
|
|
269
|
+
schema: W.value,
|
|
270
|
+
values: a(F),
|
|
271
|
+
errors: a(w),
|
|
272
|
+
fieldLoading: a(M),
|
|
273
|
+
variant: D.value,
|
|
229
274
|
size: L.value,
|
|
230
275
|
rounded: q.value,
|
|
231
276
|
className: e.className,
|
|
232
277
|
isUpdate: e.isUpdate,
|
|
233
|
-
showRequiredAsterisk:
|
|
234
|
-
isFieldVisible:
|
|
235
|
-
isFieldDisabled:
|
|
236
|
-
isFieldReadonly:
|
|
237
|
-
onChange:
|
|
238
|
-
onAddonAction: s[2] || (s[2] = (u) =>
|
|
278
|
+
showRequiredAsterisk: H.value,
|
|
279
|
+
isFieldVisible: a(T),
|
|
280
|
+
isFieldDisabled: a(U),
|
|
281
|
+
isFieldReadonly: a($),
|
|
282
|
+
onChange: j,
|
|
283
|
+
onAddonAction: s[2] || (s[2] = (u) => g("onAddonAction", u))
|
|
239
284
|
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
240
|
-
])) : c("", !0) : (o(), d("div",
|
|
241
|
-
|
|
285
|
+
])) : c("", !0) : (o(), d("div", Te, [
|
|
286
|
+
k(O, {
|
|
242
287
|
schema: e.schema,
|
|
243
|
-
values:
|
|
244
|
-
errors:
|
|
245
|
-
fieldLoading:
|
|
246
|
-
variant:
|
|
288
|
+
values: a(F),
|
|
289
|
+
errors: a(w),
|
|
290
|
+
fieldLoading: a(M),
|
|
291
|
+
variant: D.value,
|
|
247
292
|
size: L.value,
|
|
248
293
|
rounded: q.value,
|
|
249
294
|
className: e.className,
|
|
250
295
|
isUpdate: e.isUpdate,
|
|
251
|
-
showRequiredAsterisk:
|
|
252
|
-
isFieldVisible:
|
|
253
|
-
isFieldDisabled:
|
|
254
|
-
isFieldReadonly:
|
|
255
|
-
onChange:
|
|
256
|
-
onAddonAction: s[0] || (s[0] = (u) =>
|
|
296
|
+
showRequiredAsterisk: H.value,
|
|
297
|
+
isFieldVisible: a(T),
|
|
298
|
+
isFieldDisabled: a(U),
|
|
299
|
+
isFieldReadonly: a($),
|
|
300
|
+
onChange: j,
|
|
301
|
+
onAddonAction: s[0] || (s[0] = (u) => g("onAddonAction", u))
|
|
257
302
|
}, null, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
258
303
|
])),
|
|
259
|
-
|
|
260
|
-
values:
|
|
261
|
-
errors:
|
|
262
|
-
isSubmitting:
|
|
263
|
-
handleSubmit:
|
|
304
|
+
ae(t.$slots, "default", {
|
|
305
|
+
values: a(F),
|
|
306
|
+
errors: a(w),
|
|
307
|
+
isSubmitting: a(h),
|
|
308
|
+
handleSubmit: y
|
|
264
309
|
}, void 0, !0),
|
|
265
|
-
|
|
310
|
+
v("div", {
|
|
266
311
|
ref_key: "sentinelRef",
|
|
267
|
-
ref:
|
|
312
|
+
ref: I,
|
|
268
313
|
class: "form-scroll-sentinel h-px w-full",
|
|
269
314
|
"aria-hidden": "true"
|
|
270
315
|
}, null, 512)
|
|
271
316
|
], 2),
|
|
272
317
|
e.footer ? (o(), d("div", {
|
|
273
|
-
key:
|
|
318
|
+
key: 2,
|
|
274
319
|
ref_key: "footerRef",
|
|
275
|
-
ref:
|
|
276
|
-
class:
|
|
277
|
-
"form-footer
|
|
320
|
+
ref: oe,
|
|
321
|
+
class: f([
|
|
322
|
+
"form-footer items-center gap-3 z-20",
|
|
323
|
+
e.isPage ? "flex sm:hidden" : "flex",
|
|
278
324
|
e.footerClass,
|
|
279
325
|
r.value ? "justify-between" : "justify-end",
|
|
280
|
-
// Sticky
|
|
281
|
-
|
|
282
|
-
//
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
326
|
+
// Sticky footer: always applied when inside a modal or when stickyFooter prop is set.
|
|
327
|
+
// `sticky bottom-0` anchors the footer to the bottom of the nearest scrollable ancestor
|
|
328
|
+
// (the modal's overflow-y-auto body), keeping it visible at all times without leaving
|
|
329
|
+
// the normal document flow (unlike `fixed` which would escape the modal bounds).
|
|
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",
|
|
331
|
+
// Show a subtle top shadow while content is scrolling beneath the sticky footer
|
|
332
|
+
(S.value && J.value, ""),
|
|
333
|
+
// Inside modal: extend footer flush to modal edge padding
|
|
334
|
+
x.value ? "-mx-4 px-4 pb-3!" : "",
|
|
286
335
|
// Non-sticky inside modal keeps the original border styling
|
|
287
|
-
!
|
|
288
|
-
!
|
|
336
|
+
!S.value && x.value ? "border-t border-border/75 mt-5" : "",
|
|
337
|
+
!S.value && !x.value ? "mt-6" : ""
|
|
289
338
|
])
|
|
290
339
|
}, [
|
|
291
|
-
|
|
292
|
-
|
|
340
|
+
v("div", He, [
|
|
341
|
+
le.value ? (o(), R(p, {
|
|
293
342
|
key: 0,
|
|
294
343
|
type: "button",
|
|
295
344
|
variant: "outline",
|
|
296
345
|
text: e.cancelText,
|
|
297
|
-
disabled: e.loading ||
|
|
298
|
-
onClick:
|
|
346
|
+
disabled: e.loading || a(h),
|
|
347
|
+
onClick: be
|
|
299
348
|
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
300
|
-
r.value && e.isUpdate && !V.value ? (o(),
|
|
349
|
+
r.value && e.isUpdate && !V.value ? (o(), R(p, B({
|
|
301
350
|
key: 1,
|
|
302
351
|
type: "button",
|
|
303
352
|
variant: "primary",
|
|
304
353
|
text: e.submitText
|
|
305
354
|
}, e.submitProps, {
|
|
306
|
-
loading: e.loading ||
|
|
307
|
-
onClick:
|
|
355
|
+
loading: e.loading || a(h),
|
|
356
|
+
onClick: y
|
|
308
357
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
309
358
|
]),
|
|
310
|
-
|
|
311
|
-
class:
|
|
359
|
+
v("div", {
|
|
360
|
+
class: f(["flex items-center gap-3", r.value && "ml-auto"])
|
|
312
361
|
}, [
|
|
313
|
-
r.value &&
|
|
362
|
+
r.value && X.value ? (o(), R(p, {
|
|
314
363
|
key: 0,
|
|
315
364
|
type: "button",
|
|
316
365
|
variant: "outline",
|
|
317
366
|
icon: "lucide:arrow-left",
|
|
318
367
|
text: "Previous",
|
|
319
|
-
onClick:
|
|
368
|
+
onClick: fe
|
|
320
369
|
})) : c("", !0),
|
|
321
|
-
r.value && !V.value ? (o(),
|
|
370
|
+
r.value && !V.value ? (o(), R(p, {
|
|
322
371
|
key: 1,
|
|
323
372
|
type: "button",
|
|
324
373
|
variant: e.isUpdate ? "outline" : "primary",
|
|
325
374
|
text: "Next",
|
|
326
375
|
iconRight: "lucide:arrow-right",
|
|
327
|
-
onClick:
|
|
376
|
+
onClick: Y
|
|
328
377
|
}, null, 8, ["variant"])) : c("", !0),
|
|
329
|
-
!r.value || V.value ? (o(),
|
|
378
|
+
!r.value || V.value ? (o(), R(p, B({
|
|
330
379
|
key: 2,
|
|
331
380
|
type: "submit",
|
|
332
381
|
variant: "primary",
|
|
333
382
|
text: e.submitText
|
|
334
383
|
}, e.submitProps, {
|
|
335
|
-
loading: e.loading ||
|
|
384
|
+
loading: e.loading || a(h)
|
|
336
385
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
337
386
|
], 2)
|
|
338
387
|
], 2)) : c("", !0)
|
|
339
|
-
], 42,
|
|
388
|
+
], 42, Re));
|
|
340
389
|
}
|
|
341
390
|
});
|
|
342
391
|
export {
|
|
343
|
-
|
|
392
|
+
Qe as default
|
|
344
393
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { IDropdownOptions, InputVariant, InputSize, InputRounded } from '../../types';
|
|
2
|
+
import { IDropdownOptions, InputVariant, InputSize, InputRounded, ButtonProps } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Addon configuration for input field addons (left/right)
|
|
5
5
|
* Allows rendering dropdowns or buttons inside input addons from schema
|
|
@@ -193,6 +193,18 @@ export interface IFormProps {
|
|
|
193
193
|
footerClass?: string;
|
|
194
194
|
/** Fields to explicitly include in the submit payload (e.g., ['__typename', 'id']) */
|
|
195
195
|
emitFields?: string[];
|
|
196
|
+
/** Enable full-page layout mode */
|
|
197
|
+
isPage?: boolean;
|
|
198
|
+
/** Title for the page mode header */
|
|
199
|
+
pageTitle?: string;
|
|
200
|
+
/** I18n key for the page title */
|
|
201
|
+
pageTitleI18n?: string;
|
|
202
|
+
/** Custom CSS class for the page title */
|
|
203
|
+
pageTitleClass?: string;
|
|
204
|
+
/** Custom CSS class for the page header container */
|
|
205
|
+
pageHeaderClass?: string;
|
|
206
|
+
/** Props to pass to the back button in page mode */
|
|
207
|
+
backButtonProps?: ButtonProps;
|
|
196
208
|
}
|
|
197
209
|
/**
|
|
198
210
|
* Form submit payload
|
|
@@ -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>;
|