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