@macrulez/vue-form-schema 0.1.7 → 0.1.9
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/LICENSE +21 -0
- package/dist/MaskEngine-DAKSNIHQ.cjs +1 -0
- package/dist/MaskEngine-mLoXKd4d.js +251 -0
- package/dist/core/ValidationEngine.d.ts +6 -0
- package/dist/core/ValidationEngine.d.ts.map +1 -1
- package/dist/core/types.d.ts +10 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/useForm.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +159 -151
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/tailwind/index.d.ts +11 -0
- package/dist/ui/tailwind/index.d.ts.map +1 -0
- package/dist/ui-tailwind.cjs +1 -0
- package/dist/ui-tailwind.d.ts +397 -0
- package/dist/ui-tailwind.js +650 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +47 -10
- package/dist/ui.js +436 -300
- package/dist/valibot.d.ts +10 -2
- package/dist/yup.d.ts +10 -2
- package/dist/zod.d.ts +10 -2
- package/package.json +38 -24
- package/dist/MaskEngine-BqJQYybS.js +0 -233
- package/dist/MaskEngine-BwAs2Zb0.cjs +0 -1
- package/dist/__tests__/ConditionEvaluator.test.d.ts +0 -2
- package/dist/__tests__/ConditionEvaluator.test.d.ts.map +0 -1
- package/dist/__tests__/MaskEngine.test.d.ts +0 -2
- package/dist/__tests__/MaskEngine.test.d.ts.map +0 -1
- package/dist/__tests__/ValidationEngine.test.d.ts +0 -2
- package/dist/__tests__/ValidationEngine.test.d.ts.map +0 -1
- package/dist/__tests__/parsers.test.d.ts +0 -2
- package/dist/__tests__/parsers.test.d.ts.map +0 -1
- package/dist/__tests__/phase3.test.d.ts +0 -2
- package/dist/__tests__/phase3.test.d.ts.map +0 -1
- package/dist/__tests__/phase4.test.d.ts +0 -2
- package/dist/__tests__/phase4.test.d.ts.map +0 -1
- package/dist/__tests__/useFieldArray.test.d.ts +0 -2
- package/dist/__tests__/useFieldArray.test.d.ts.map +0 -1
- package/dist/__tests__/useForm.test.d.ts +0 -2
- package/dist/__tests__/useForm.test.d.ts.map +0 -1
- package/dist/__tests__/useMultiStepForm.test.d.ts +0 -2
- package/dist/__tests__/useMultiStepForm.test.d.ts.map +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { b as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as V, computed as B, openBlock as t, createElementBlock as r, normalizeClass as T, createTextVNode as I, toDisplayString as y, createCommentVNode as k, renderSlot as A, normalizeProps as W, guardReactiveProps as X, Fragment as x, renderList as S, ref as w, onMounted as Y, onUnmounted as Z, createBlock as F, withCtx as q, createElementVNode as b, mergeProps as R, createVNode as M, unref as z, resolveDynamicComponent as U, resolveComponent as _, createSlots as ee } from "vue";
|
|
2
|
+
import { b as te, t as P, q as le, h as K } from "./MaskEngine-mLoXKd4d.js";
|
|
3
|
+
const ae = ["for"], ne = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "vfs-field__required",
|
|
6
6
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
7
|
+
}, re = ["id"], C = /* @__PURE__ */ V({
|
|
8
8
|
__name: "BaseField",
|
|
9
9
|
props: {
|
|
10
10
|
field: {},
|
|
@@ -12,37 +12,41 @@ const _ = ["for"], ee = {
|
|
|
12
12
|
touched: { type: Boolean }
|
|
13
13
|
},
|
|
14
14
|
setup(e) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const o = e, l = B(() => {
|
|
16
|
+
var u;
|
|
17
|
+
return !!(o.touched && ((u = o.error) != null && u.length));
|
|
18
|
+
}), s = B(() => `${o.field.name}-error`), a = B(() => ({
|
|
19
|
+
"aria-required": o.field.required ? "true" : void 0,
|
|
20
|
+
"aria-invalid": l.value ? "true" : "false",
|
|
21
|
+
"aria-describedby": l.value ? s.value : void 0
|
|
22
|
+
}));
|
|
23
|
+
return (u, m) => (t(), r("div", {
|
|
24
|
+
class: T(["vfs-field", [`vfs-field--${o.field.type}`, { "vfs-field--error": l.value }]])
|
|
25
|
+
}, [
|
|
26
|
+
o.field.label ? (t(), r("label", {
|
|
27
|
+
key: 0,
|
|
28
|
+
for: o.field.name,
|
|
29
|
+
class: "vfs-field__label"
|
|
20
30
|
}, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
key: m,
|
|
39
|
-
class: "vfs-field__error"
|
|
40
|
-
}, v(h), 1))), 128))
|
|
41
|
-
], 8, te)) : k("", !0)
|
|
42
|
-
], 2);
|
|
43
|
-
};
|
|
31
|
+
I(y(o.field.label) + " ", 1),
|
|
32
|
+
o.field.required ? (t(), r("span", ne, "*")) : k("", !0)
|
|
33
|
+
], 8, ae)) : k("", !0),
|
|
34
|
+
A(u.$slots, "default", W(X(a.value))),
|
|
35
|
+
l.value ? (t(), r("ul", {
|
|
36
|
+
key: 1,
|
|
37
|
+
id: s.value,
|
|
38
|
+
class: "vfs-field__errors",
|
|
39
|
+
role: "alert",
|
|
40
|
+
"aria-live": "polite"
|
|
41
|
+
}, [
|
|
42
|
+
(t(!0), r(x, null, S(e.error, (f, h) => (t(), r("li", {
|
|
43
|
+
key: h,
|
|
44
|
+
class: "vfs-field__error"
|
|
45
|
+
}, y(f), 1))), 128))
|
|
46
|
+
], 8, re)) : k("", !0)
|
|
47
|
+
], 2));
|
|
44
48
|
}
|
|
45
|
-
}),
|
|
49
|
+
}), oe = ["id", "type", "name", "value", "placeholder", "disabled", "required"], N = /* @__PURE__ */ V({
|
|
46
50
|
__name: "TextField",
|
|
47
51
|
props: {
|
|
48
52
|
field: {},
|
|
@@ -51,40 +55,41 @@ const _ = ["for"], ee = {
|
|
|
51
55
|
touched: { type: Boolean }
|
|
52
56
|
},
|
|
53
57
|
emits: ["update:modelValue", "blur"],
|
|
54
|
-
setup(e, { emit:
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
function
|
|
61
|
-
s("update:modelValue",
|
|
58
|
+
setup(e, { emit: o }) {
|
|
59
|
+
const l = e, s = o, a = w(null);
|
|
60
|
+
let u = null;
|
|
61
|
+
Y(() => {
|
|
62
|
+
a.value && l.field.mask && (u = te(a.value, l.field.mask));
|
|
63
|
+
}), Z(() => u == null ? void 0 : u());
|
|
64
|
+
function m(f) {
|
|
65
|
+
s("update:modelValue", f.target.value);
|
|
62
66
|
}
|
|
63
|
-
return (
|
|
67
|
+
return (f, h) => (t(), F(C, {
|
|
64
68
|
field: e.field,
|
|
65
69
|
error: e.error,
|
|
66
70
|
touched: e.touched
|
|
67
71
|
}, {
|
|
68
|
-
default:
|
|
69
|
-
b("input", {
|
|
72
|
+
default: q((c) => [
|
|
73
|
+
b("input", R({
|
|
70
74
|
id: e.field.name,
|
|
71
75
|
ref_key: "inputRef",
|
|
72
|
-
ref:
|
|
76
|
+
ref: a,
|
|
73
77
|
type: e.field.type === "email" ? "email" : "text",
|
|
74
78
|
name: e.field.name,
|
|
75
|
-
value: e.modelValue,
|
|
79
|
+
value: e.modelValue ?? "",
|
|
76
80
|
placeholder: e.field.placeholder,
|
|
77
81
|
disabled: e.field.disabled === !0,
|
|
78
|
-
required: e.field.required
|
|
82
|
+
required: e.field.required
|
|
83
|
+
}, c, {
|
|
79
84
|
class: "vfs-input",
|
|
80
|
-
onInput:
|
|
81
|
-
onBlur:
|
|
82
|
-
}, null,
|
|
85
|
+
onInput: m,
|
|
86
|
+
onBlur: h[0] || (h[0] = (g) => s("blur"))
|
|
87
|
+
}), null, 16, oe)
|
|
83
88
|
]),
|
|
84
89
|
_: 1
|
|
85
90
|
}, 8, ["field", "error", "touched"]));
|
|
86
91
|
}
|
|
87
|
-
}),
|
|
92
|
+
}), ie = ["id", "name", "value", "placeholder", "disabled", "required"], O = /* @__PURE__ */ V({
|
|
88
93
|
__name: "NumberField",
|
|
89
94
|
props: {
|
|
90
95
|
field: {},
|
|
@@ -93,35 +98,36 @@ const _ = ["for"], ee = {
|
|
|
93
98
|
touched: { type: Boolean }
|
|
94
99
|
},
|
|
95
100
|
emits: ["update:modelValue", "blur"],
|
|
96
|
-
setup(e, { emit:
|
|
97
|
-
const
|
|
98
|
-
function s(
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
+
setup(e, { emit: o }) {
|
|
102
|
+
const l = o;
|
|
103
|
+
function s(a) {
|
|
104
|
+
const u = a.target.value;
|
|
105
|
+
l("update:modelValue", u === "" ? null : Number(u));
|
|
101
106
|
}
|
|
102
|
-
return (
|
|
107
|
+
return (a, u) => (t(), F(C, {
|
|
103
108
|
field: e.field,
|
|
104
109
|
error: e.error,
|
|
105
110
|
touched: e.touched
|
|
106
111
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
b("input", {
|
|
112
|
+
default: q((m) => [
|
|
113
|
+
b("input", R({
|
|
109
114
|
id: e.field.name,
|
|
110
115
|
type: "number",
|
|
111
116
|
name: e.field.name,
|
|
112
117
|
value: e.modelValue ?? "",
|
|
113
118
|
placeholder: e.field.placeholder,
|
|
114
119
|
disabled: e.field.disabled === !0,
|
|
115
|
-
required: e.field.required
|
|
120
|
+
required: e.field.required
|
|
121
|
+
}, m, {
|
|
116
122
|
class: "vfs-input",
|
|
117
123
|
onInput: s,
|
|
118
|
-
onBlur:
|
|
119
|
-
}, null,
|
|
124
|
+
onBlur: u[0] || (u[0] = (f) => l("blur"))
|
|
125
|
+
}), null, 16, ie)
|
|
120
126
|
]),
|
|
121
127
|
_: 1
|
|
122
128
|
}, 8, ["field", "error", "touched"]));
|
|
123
129
|
}
|
|
124
|
-
}),
|
|
130
|
+
}), ue = ["id", "name", "value", "placeholder", "disabled", "required"], j = /* @__PURE__ */ V({
|
|
125
131
|
__name: "TextareaField",
|
|
126
132
|
props: {
|
|
127
133
|
field: {},
|
|
@@ -130,33 +136,34 @@ const _ = ["for"], ee = {
|
|
|
130
136
|
touched: { type: Boolean }
|
|
131
137
|
},
|
|
132
138
|
emits: ["update:modelValue", "blur"],
|
|
133
|
-
setup(e, { emit:
|
|
134
|
-
const
|
|
135
|
-
return (s,
|
|
139
|
+
setup(e, { emit: o }) {
|
|
140
|
+
const l = o;
|
|
141
|
+
return (s, a) => (t(), F(C, {
|
|
136
142
|
field: e.field,
|
|
137
143
|
error: e.error,
|
|
138
144
|
touched: e.touched
|
|
139
145
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
b("textarea", {
|
|
146
|
+
default: q((u) => [
|
|
147
|
+
b("textarea", R({
|
|
142
148
|
id: e.field.name,
|
|
143
149
|
name: e.field.name,
|
|
144
|
-
value: e.modelValue,
|
|
150
|
+
value: e.modelValue ?? "",
|
|
145
151
|
placeholder: e.field.placeholder,
|
|
146
152
|
disabled: e.field.disabled === !0,
|
|
147
|
-
required: e.field.required
|
|
153
|
+
required: e.field.required
|
|
154
|
+
}, u, {
|
|
148
155
|
class: "vfs-textarea",
|
|
149
|
-
onInput:
|
|
150
|
-
onBlur:
|
|
151
|
-
}, null,
|
|
156
|
+
onInput: a[0] || (a[0] = (m) => l("update:modelValue", m.target.value)),
|
|
157
|
+
onBlur: a[1] || (a[1] = (m) => l("blur"))
|
|
158
|
+
}), null, 16, ue)
|
|
152
159
|
]),
|
|
153
160
|
_: 1
|
|
154
161
|
}, 8, ["field", "error", "touched"]));
|
|
155
162
|
}
|
|
156
|
-
}),
|
|
163
|
+
}), de = {
|
|
157
164
|
key: 0,
|
|
158
165
|
class: "vfs-select-loading"
|
|
159
|
-
},
|
|
166
|
+
}, se = ["id", "name", "disabled", "required"], ce = ["selected"], me = ["value", "selected"], G = /* @__PURE__ */ V({
|
|
160
167
|
__name: "SelectField",
|
|
161
168
|
props: {
|
|
162
169
|
field: {},
|
|
@@ -165,84 +172,94 @@ const _ = ["for"], ee = {
|
|
|
165
172
|
touched: { type: Boolean }
|
|
166
173
|
},
|
|
167
174
|
emits: ["update:modelValue", "blur"],
|
|
168
|
-
setup(e, { emit:
|
|
169
|
-
const
|
|
170
|
-
() => Array.isArray(
|
|
175
|
+
setup(e, { emit: o }) {
|
|
176
|
+
const l = e, s = o, a = B(
|
|
177
|
+
() => Array.isArray(l.field.options) ? l.field.options : []
|
|
171
178
|
);
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
s("update:modelValue", (
|
|
179
|
+
function u(m) {
|
|
180
|
+
const f = m.target, h = a.value.find((c) => String(c.value) === f.value);
|
|
181
|
+
s("update:modelValue", (h == null ? void 0 : h.value) ?? f.value);
|
|
175
182
|
}
|
|
176
|
-
return (
|
|
183
|
+
return (m, f) => (t(), F(C, {
|
|
177
184
|
field: e.field,
|
|
178
185
|
error: e.error,
|
|
179
186
|
touched: e.touched
|
|
180
187
|
}, {
|
|
181
|
-
default:
|
|
182
|
-
e.field.optionsLoading ? (t(),
|
|
188
|
+
default: q((h) => [
|
|
189
|
+
e.field.optionsLoading ? (t(), r("div", de, "Loading…")) : (t(), r("select", R({
|
|
183
190
|
key: 1,
|
|
184
191
|
id: e.field.name,
|
|
185
192
|
name: e.field.name,
|
|
186
193
|
disabled: e.field.disabled === !0 || e.field.optionsLoading,
|
|
187
|
-
required: e.field.required
|
|
194
|
+
required: e.field.required
|
|
195
|
+
}, h, {
|
|
188
196
|
class: "vfs-select",
|
|
189
|
-
onChange:
|
|
190
|
-
onBlur:
|
|
191
|
-
}, [
|
|
197
|
+
onChange: u,
|
|
198
|
+
onBlur: f[0] || (f[0] = (c) => s("blur"))
|
|
199
|
+
}), [
|
|
192
200
|
b("option", {
|
|
193
201
|
value: "",
|
|
194
202
|
disabled: "",
|
|
195
203
|
selected: e.modelValue === null || e.modelValue === void 0 || e.modelValue === ""
|
|
196
|
-
},
|
|
197
|
-
(t(!0),
|
|
198
|
-
key: String(
|
|
199
|
-
value: String(
|
|
200
|
-
selected: e.modelValue ===
|
|
201
|
-
},
|
|
202
|
-
],
|
|
204
|
+
}, y(e.field.placeholder ?? "Select an option"), 9, ce),
|
|
205
|
+
(t(!0), r(x, null, S(a.value, (c) => (t(), r("option", {
|
|
206
|
+
key: String(c.value),
|
|
207
|
+
value: String(c.value),
|
|
208
|
+
selected: e.modelValue === c.value
|
|
209
|
+
}, y(c.label), 9, me))), 128))
|
|
210
|
+
], 16, se))
|
|
203
211
|
]),
|
|
204
212
|
_: 1
|
|
205
213
|
}, 8, ["field", "error", "touched"]));
|
|
206
214
|
}
|
|
207
|
-
}),
|
|
215
|
+
}), fe = { class: "vfs-checkbox-label" }, ve = ["id", "name", "checked", "disabled", "required", "aria-checked"], be = {
|
|
208
216
|
key: 0,
|
|
209
217
|
class: "vfs-checkbox-text"
|
|
210
|
-
},
|
|
218
|
+
}, H = /* @__PURE__ */ V({
|
|
211
219
|
__name: "CheckboxField",
|
|
212
220
|
props: {
|
|
213
221
|
field: {},
|
|
214
|
-
modelValue: { type: Boolean },
|
|
222
|
+
modelValue: { type: [Boolean, null] },
|
|
215
223
|
error: {},
|
|
216
224
|
touched: { type: Boolean }
|
|
217
225
|
},
|
|
218
226
|
emits: ["update:modelValue", "blur"],
|
|
219
|
-
setup(e, { emit:
|
|
220
|
-
const
|
|
221
|
-
return (s,
|
|
227
|
+
setup(e, { emit: o }) {
|
|
228
|
+
const l = o;
|
|
229
|
+
return (s, a) => (t(), F(C, {
|
|
222
230
|
field: { ...e.field, label: void 0 },
|
|
223
231
|
error: e.error,
|
|
224
232
|
touched: e.touched
|
|
225
233
|
}, {
|
|
226
|
-
default:
|
|
227
|
-
b("label",
|
|
228
|
-
b("input", {
|
|
234
|
+
default: q((u) => [
|
|
235
|
+
b("label", fe, [
|
|
236
|
+
b("input", R({
|
|
229
237
|
id: e.field.name,
|
|
230
238
|
type: "checkbox",
|
|
231
239
|
name: e.field.name,
|
|
232
|
-
checked: e.modelValue,
|
|
240
|
+
checked: !!e.modelValue,
|
|
233
241
|
disabled: e.field.disabled === !0,
|
|
234
242
|
required: e.field.required,
|
|
243
|
+
"aria-checked": e.modelValue ? "true" : "false"
|
|
244
|
+
}, u, {
|
|
235
245
|
class: "vfs-checkbox",
|
|
236
|
-
onChange:
|
|
237
|
-
onBlur:
|
|
238
|
-
}, null,
|
|
239
|
-
e.field.label ? (t(),
|
|
246
|
+
onChange: a[0] || (a[0] = (m) => l("update:modelValue", m.target.checked)),
|
|
247
|
+
onBlur: a[1] || (a[1] = (m) => l("blur"))
|
|
248
|
+
}), null, 16, ve),
|
|
249
|
+
e.field.label ? (t(), r("span", be, y(e.field.label), 1)) : k("", !0)
|
|
240
250
|
])
|
|
241
251
|
]),
|
|
242
252
|
_: 1
|
|
243
253
|
}, 8, ["field", "error", "touched"]));
|
|
244
254
|
}
|
|
245
|
-
}),
|
|
255
|
+
}), he = ["aria-required", "aria-invalid", "aria-describedby"], ye = {
|
|
256
|
+
key: 0,
|
|
257
|
+
class: "vfs-field__label"
|
|
258
|
+
}, $e = {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: "vfs-field__required",
|
|
261
|
+
"aria-hidden": "true"
|
|
262
|
+
}, ke = { class: "vfs-radio-group" }, ge = ["name", "value", "checked", "disabled", "onChange"], Ve = ["id"], J = /* @__PURE__ */ V({
|
|
246
263
|
__name: "RadioField",
|
|
247
264
|
props: {
|
|
248
265
|
field: {},
|
|
@@ -251,41 +268,56 @@ const _ = ["for"], ee = {
|
|
|
251
268
|
touched: { type: Boolean }
|
|
252
269
|
},
|
|
253
270
|
emits: ["update:modelValue", "blur"],
|
|
254
|
-
setup(e, { emit:
|
|
255
|
-
const a =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
setup(e, { emit: o }) {
|
|
272
|
+
const l = e, s = o, a = B(() => {
|
|
273
|
+
var f;
|
|
274
|
+
return !!(l.touched && ((f = l.error) != null && f.length));
|
|
275
|
+
}), u = B(() => `${l.field.name}-error`), m = B(
|
|
276
|
+
() => Array.isArray(l.field.options) ? l.field.options : []
|
|
277
|
+
);
|
|
278
|
+
return (f, h) => (t(), r("fieldset", {
|
|
279
|
+
class: T(["vfs-field vfs-field--radio", { "vfs-field--error": a.value }]),
|
|
280
|
+
"aria-required": e.field.required ? "true" : void 0,
|
|
281
|
+
"aria-invalid": a.value ? "true" : "false",
|
|
282
|
+
"aria-describedby": a.value ? u.value : void 0
|
|
283
|
+
}, [
|
|
284
|
+
e.field.label ? (t(), r("legend", ye, [
|
|
285
|
+
I(y(e.field.label) + " ", 1),
|
|
286
|
+
e.field.required ? (t(), r("span", $e, "*")) : k("", !0)
|
|
287
|
+
])) : k("", !0),
|
|
288
|
+
b("div", ke, [
|
|
289
|
+
(t(!0), r(x, null, S(m.value, (c) => (t(), r("label", {
|
|
290
|
+
key: String(c.value),
|
|
291
|
+
class: "vfs-radio-label"
|
|
266
292
|
}, [
|
|
267
|
-
(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
onBlur: n[0] || (n[0] = (h) => a("blur"))
|
|
280
|
-
}, null, 40, fe),
|
|
281
|
-
D(" " + v(o.label), 1)
|
|
282
|
-
]))), 128))
|
|
283
|
-
], 8, ce)
|
|
293
|
+
b("input", {
|
|
294
|
+
type: "radio",
|
|
295
|
+
name: e.field.name,
|
|
296
|
+
value: String(c.value),
|
|
297
|
+
checked: e.modelValue === c.value,
|
|
298
|
+
disabled: e.field.disabled === !0,
|
|
299
|
+
class: "vfs-radio",
|
|
300
|
+
onChange: (g) => s("update:modelValue", c.value),
|
|
301
|
+
onBlur: h[0] || (h[0] = (g) => s("blur"))
|
|
302
|
+
}, null, 40, ge),
|
|
303
|
+
I(" " + y(c.label), 1)
|
|
304
|
+
]))), 128))
|
|
284
305
|
]),
|
|
285
|
-
|
|
286
|
-
|
|
306
|
+
a.value ? (t(), r("ul", {
|
|
307
|
+
key: 1,
|
|
308
|
+
id: u.value,
|
|
309
|
+
class: "vfs-field__errors",
|
|
310
|
+
role: "alert",
|
|
311
|
+
"aria-live": "polite"
|
|
312
|
+
}, [
|
|
313
|
+
(t(!0), r(x, null, S(e.error, (c, g) => (t(), r("li", {
|
|
314
|
+
key: g,
|
|
315
|
+
class: "vfs-field__error"
|
|
316
|
+
}, y(c), 1))), 128))
|
|
317
|
+
], 8, Ve)) : k("", !0)
|
|
318
|
+
], 10, he));
|
|
287
319
|
}
|
|
288
|
-
}),
|
|
320
|
+
}), pe = ["id", "name", "value", "disabled", "required"], Q = /* @__PURE__ */ V({
|
|
289
321
|
__name: "DateField",
|
|
290
322
|
props: {
|
|
291
323
|
field: {},
|
|
@@ -294,33 +326,34 @@ const _ = ["for"], ee = {
|
|
|
294
326
|
touched: { type: Boolean }
|
|
295
327
|
},
|
|
296
328
|
emits: ["update:modelValue", "blur"],
|
|
297
|
-
setup(e, { emit:
|
|
298
|
-
const
|
|
299
|
-
return (s,
|
|
329
|
+
setup(e, { emit: o }) {
|
|
330
|
+
const l = o;
|
|
331
|
+
return (s, a) => (t(), F(C, {
|
|
300
332
|
field: e.field,
|
|
301
333
|
error: e.error,
|
|
302
334
|
touched: e.touched
|
|
303
335
|
}, {
|
|
304
|
-
default:
|
|
305
|
-
b("input", {
|
|
336
|
+
default: q((u) => [
|
|
337
|
+
b("input", R({
|
|
306
338
|
id: e.field.name,
|
|
307
339
|
type: "date",
|
|
308
340
|
name: e.field.name,
|
|
309
|
-
value: e.modelValue,
|
|
341
|
+
value: e.modelValue ?? "",
|
|
310
342
|
disabled: e.field.disabled === !0,
|
|
311
|
-
required: e.field.required
|
|
343
|
+
required: e.field.required
|
|
344
|
+
}, u, {
|
|
312
345
|
class: "vfs-input",
|
|
313
|
-
onInput:
|
|
314
|
-
onBlur:
|
|
315
|
-
}, null,
|
|
346
|
+
onInput: a[0] || (a[0] = (m) => l("update:modelValue", m.target.value)),
|
|
347
|
+
onBlur: a[1] || (a[1] = (m) => l("blur"))
|
|
348
|
+
}), null, 16, pe)
|
|
316
349
|
]),
|
|
317
350
|
_: 1
|
|
318
351
|
}, 8, ["field", "error", "touched"]));
|
|
319
352
|
}
|
|
320
|
-
}),
|
|
353
|
+
}), xe = { class: "vfs-array" }, Fe = {
|
|
321
354
|
key: 0,
|
|
322
355
|
class: "vfs-field__label"
|
|
323
|
-
},
|
|
356
|
+
}, qe = ["onClick"], Be = /* @__PURE__ */ V({
|
|
324
357
|
__name: "ArrayField",
|
|
325
358
|
props: {
|
|
326
359
|
field: {},
|
|
@@ -328,83 +361,184 @@ const _ = ["for"], ee = {
|
|
|
328
361
|
components: {}
|
|
329
362
|
},
|
|
330
363
|
setup(e) {
|
|
331
|
-
const
|
|
364
|
+
const o = e, l = P(), s = {
|
|
332
365
|
text: N,
|
|
333
366
|
email: N,
|
|
334
|
-
number:
|
|
335
|
-
textarea:
|
|
336
|
-
select:
|
|
337
|
-
checkbox:
|
|
338
|
-
radio:
|
|
339
|
-
date:
|
|
367
|
+
number: O,
|
|
368
|
+
textarea: j,
|
|
369
|
+
select: G,
|
|
370
|
+
checkbox: H,
|
|
371
|
+
radio: J,
|
|
372
|
+
date: Q
|
|
340
373
|
};
|
|
341
|
-
function
|
|
342
|
-
var
|
|
343
|
-
return
|
|
374
|
+
function a($) {
|
|
375
|
+
var n;
|
|
376
|
+
return $.component ? $.component : ((n = o.components) == null ? void 0 : n[$.type]) ?? l[$.type] ?? s[$.type] ?? null;
|
|
344
377
|
}
|
|
345
|
-
const { rows:
|
|
346
|
-
function
|
|
347
|
-
return
|
|
378
|
+
const { rows: u, append: m, remove: f } = le(o.form, o.field.name);
|
|
379
|
+
function h($) {
|
|
380
|
+
return K(o.form.values.value, $.name);
|
|
348
381
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
382
|
+
function c($, n) {
|
|
383
|
+
o.form.setField($.name, n);
|
|
351
384
|
}
|
|
352
|
-
function
|
|
353
|
-
var
|
|
354
|
-
const
|
|
355
|
-
(
|
|
385
|
+
function g($) {
|
|
386
|
+
var i;
|
|
387
|
+
const n = o.form;
|
|
388
|
+
(i = n.touchField) == null || i.call(n, $.name);
|
|
356
389
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
390
|
+
function D($) {
|
|
391
|
+
return o.form.errors.value[$.name] ?? [];
|
|
359
392
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
393
|
+
function L($) {
|
|
394
|
+
return o.form.touched.value[$.name] ?? !1;
|
|
362
395
|
}
|
|
363
|
-
return (
|
|
364
|
-
|
|
396
|
+
return ($, n) => (t(), r("div", xe, [
|
|
397
|
+
M(C, {
|
|
365
398
|
field: { ...e.field, label: void 0 },
|
|
366
399
|
error: [],
|
|
367
400
|
touched: !1
|
|
368
401
|
}, {
|
|
369
|
-
default:
|
|
370
|
-
e.field.label ? (t(),
|
|
371
|
-
(t(!0),
|
|
372
|
-
key:
|
|
402
|
+
default: q(() => [
|
|
403
|
+
e.field.label ? (t(), r("div", Fe, y(e.field.label), 1)) : k("", !0),
|
|
404
|
+
(t(!0), r(x, null, S(z(u), (i) => (t(), r("div", {
|
|
405
|
+
key: i.key,
|
|
373
406
|
class: "vfs-array__row"
|
|
374
407
|
}, [
|
|
375
|
-
(t(!0),
|
|
376
|
-
key:
|
|
408
|
+
(t(!0), r(x, null, S(i.fields, (v) => (t(), r(x, {
|
|
409
|
+
key: v.name
|
|
377
410
|
}, [
|
|
378
|
-
|
|
411
|
+
a(v) ? (t(), F(U(a(v)), {
|
|
379
412
|
key: 0,
|
|
380
|
-
field:
|
|
381
|
-
"model-value":
|
|
382
|
-
error:
|
|
383
|
-
touched:
|
|
384
|
-
"onUpdate:modelValue": (
|
|
385
|
-
onBlur: (
|
|
413
|
+
field: v,
|
|
414
|
+
"model-value": h(v),
|
|
415
|
+
error: D(v),
|
|
416
|
+
touched: L(v),
|
|
417
|
+
"onUpdate:modelValue": (d) => c(v, d),
|
|
418
|
+
onBlur: (d) => g(v)
|
|
386
419
|
}, null, 40, ["field", "model-value", "error", "touched", "onUpdate:modelValue", "onBlur"])) : k("", !0)
|
|
387
420
|
], 64))), 128)),
|
|
388
421
|
b("button", {
|
|
389
422
|
type: "button",
|
|
390
423
|
class: "vfs-array__remove",
|
|
391
|
-
onClick: (
|
|
392
|
-
}, " Remove ", 8,
|
|
424
|
+
onClick: (v) => z(f)(i.index)
|
|
425
|
+
}, " Remove ", 8, qe)
|
|
393
426
|
]))), 128)),
|
|
394
427
|
b("button", {
|
|
395
428
|
type: "button",
|
|
396
429
|
class: "vfs-array__add",
|
|
397
|
-
onClick:
|
|
430
|
+
onClick: n[0] || (n[0] = (i) => z(m)())
|
|
398
431
|
}, " + Add row ")
|
|
399
432
|
]),
|
|
400
433
|
_: 1
|
|
401
434
|
}, 8, ["field"])
|
|
402
435
|
]));
|
|
403
436
|
}
|
|
404
|
-
}),
|
|
437
|
+
}), Se = ["id", "name", "accept", "multiple", "disabled", "required"], Ce = ["for"], Re = {
|
|
438
|
+
key: 0,
|
|
439
|
+
class: "vfs-file-hint"
|
|
440
|
+
}, De = {
|
|
441
|
+
key: 0,
|
|
442
|
+
class: "vfs-file-list"
|
|
443
|
+
}, Le = { class: "vfs-file-name" }, Ae = { class: "vfs-file-size" }, Ne = ["aria-label", "onClick"], Te = /* @__PURE__ */ V({
|
|
444
|
+
__name: "FileField",
|
|
445
|
+
props: {
|
|
446
|
+
field: {},
|
|
447
|
+
modelValue: {},
|
|
448
|
+
error: {},
|
|
449
|
+
touched: { type: Boolean }
|
|
450
|
+
},
|
|
451
|
+
emits: ["update:modelValue", "blur"],
|
|
452
|
+
setup(e, { emit: o }) {
|
|
453
|
+
const l = e, s = o, a = w(!1), u = w(null), m = B(() => l.modelValue ? Array.isArray(l.modelValue) ? l.modelValue : [l.modelValue] : []), f = B(() => l.field.multiple ?? !1);
|
|
454
|
+
function h(i) {
|
|
455
|
+
if (!i || i.length === 0) {
|
|
456
|
+
s("update:modelValue", null);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
f.value ? s("update:modelValue", Array.from(i)) : s("update:modelValue", i[0]);
|
|
460
|
+
}
|
|
461
|
+
function c(i) {
|
|
462
|
+
h(i.target.files), s("blur");
|
|
463
|
+
}
|
|
464
|
+
function g(i) {
|
|
465
|
+
var v;
|
|
466
|
+
a.value = !1, i.preventDefault(), h(((v = i.dataTransfer) == null ? void 0 : v.files) ?? null), s("blur");
|
|
467
|
+
}
|
|
468
|
+
function D(i) {
|
|
469
|
+
i.preventDefault(), a.value = !0;
|
|
470
|
+
}
|
|
471
|
+
function L() {
|
|
472
|
+
a.value = !1;
|
|
473
|
+
}
|
|
474
|
+
function $(i) {
|
|
475
|
+
const v = m.value.filter((d, p) => p !== i);
|
|
476
|
+
v.length === 0 ? (s("update:modelValue", null), u.value && (u.value.value = "")) : f.value ? s("update:modelValue", v) : s("update:modelValue", v[0]);
|
|
477
|
+
}
|
|
478
|
+
function n(i) {
|
|
479
|
+
return i < 1024 ? `${i} B` : i < 1024 * 1024 ? `${(i / 1024).toFixed(1)} KB` : `${(i / (1024 * 1024)).toFixed(1)} MB`;
|
|
480
|
+
}
|
|
481
|
+
return (i, v) => (t(), F(C, {
|
|
482
|
+
field: e.field,
|
|
483
|
+
error: e.error,
|
|
484
|
+
touched: e.touched
|
|
485
|
+
}, {
|
|
486
|
+
default: q((d) => [
|
|
487
|
+
b("div", {
|
|
488
|
+
class: T(["vfs-file-zone", { "vfs-file-zone--dragging": a.value }]),
|
|
489
|
+
onDragover: D,
|
|
490
|
+
onDragleave: L,
|
|
491
|
+
onDrop: g
|
|
492
|
+
}, [
|
|
493
|
+
b("input", R({
|
|
494
|
+
id: e.field.name,
|
|
495
|
+
ref_key: "inputRef",
|
|
496
|
+
ref: u,
|
|
497
|
+
type: "file",
|
|
498
|
+
name: e.field.name,
|
|
499
|
+
accept: e.field.accept,
|
|
500
|
+
multiple: f.value,
|
|
501
|
+
disabled: e.field.disabled === !0,
|
|
502
|
+
required: e.field.required
|
|
503
|
+
}, d, {
|
|
504
|
+
class: "vfs-file-input",
|
|
505
|
+
onChange: c
|
|
506
|
+
}), null, 16, Se),
|
|
507
|
+
b("label", {
|
|
508
|
+
for: e.field.name,
|
|
509
|
+
class: "vfs-file-label"
|
|
510
|
+
}, [
|
|
511
|
+
v[0] || (v[0] = b("span", {
|
|
512
|
+
class: "vfs-file-icon",
|
|
513
|
+
"aria-hidden": "true"
|
|
514
|
+
}, "📁", -1)),
|
|
515
|
+
b("span", null, y(a.value ? "Drop files here" : "Click to upload or drag & drop"), 1),
|
|
516
|
+
e.field.accept ? (t(), r("span", Re, y(e.field.accept), 1)) : k("", !0)
|
|
517
|
+
], 8, Ce)
|
|
518
|
+
], 34),
|
|
519
|
+
m.value.length ? (t(), r("ul", De, [
|
|
520
|
+
(t(!0), r(x, null, S(m.value, (p, E) => (t(), r("li", {
|
|
521
|
+
key: `${p.name}-${E}`,
|
|
522
|
+
class: "vfs-file-item"
|
|
523
|
+
}, [
|
|
524
|
+
b("span", Le, y(p.name), 1),
|
|
525
|
+
b("span", Ae, y(n(p.size)), 1),
|
|
526
|
+
b("button", {
|
|
527
|
+
type: "button",
|
|
528
|
+
class: "vfs-file-remove",
|
|
529
|
+
"aria-label": `Remove ${p.name}`,
|
|
530
|
+
onClick: (He) => $(E)
|
|
531
|
+
}, " × ", 8, Ne)
|
|
532
|
+
]))), 128))
|
|
533
|
+
])) : k("", !0)
|
|
534
|
+
]),
|
|
535
|
+
_: 1
|
|
536
|
+
}, 8, ["field", "error", "touched"]));
|
|
537
|
+
}
|
|
538
|
+
}), ze = {
|
|
405
539
|
key: 1,
|
|
406
540
|
class: "vfs-group"
|
|
407
|
-
},
|
|
541
|
+
}, Ie = { key: 0 }, we = ["disabled"], Ee = /* @__PURE__ */ V({
|
|
408
542
|
__name: "FormRenderer",
|
|
409
543
|
props: {
|
|
410
544
|
form: {},
|
|
@@ -412,103 +546,104 @@ const _ = ["for"], ee = {
|
|
|
412
546
|
submitLabel: {}
|
|
413
547
|
},
|
|
414
548
|
emits: ["submit"],
|
|
415
|
-
setup(e, { emit:
|
|
416
|
-
const
|
|
549
|
+
setup(e, { emit: o }) {
|
|
550
|
+
const l = e, s = P(), a = o, u = {
|
|
417
551
|
text: N,
|
|
418
552
|
email: N,
|
|
419
|
-
number:
|
|
420
|
-
textarea:
|
|
421
|
-
select:
|
|
422
|
-
checkbox:
|
|
423
|
-
radio:
|
|
424
|
-
date:
|
|
553
|
+
number: O,
|
|
554
|
+
textarea: j,
|
|
555
|
+
select: G,
|
|
556
|
+
checkbox: H,
|
|
557
|
+
radio: J,
|
|
558
|
+
date: Q,
|
|
559
|
+
file: Te
|
|
425
560
|
};
|
|
426
|
-
function
|
|
427
|
-
var
|
|
428
|
-
return
|
|
561
|
+
function m(n) {
|
|
562
|
+
var i;
|
|
563
|
+
return n.component ? n.component : ((i = l.components) == null ? void 0 : i[n.type]) ?? s[n.type] ?? u[n.type] ?? null;
|
|
429
564
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
565
|
+
function f(n) {
|
|
566
|
+
return K(l.form.values.value, n.name);
|
|
432
567
|
}
|
|
433
|
-
function
|
|
434
|
-
|
|
568
|
+
function h(n, i) {
|
|
569
|
+
l.form.setField(n.name, i);
|
|
435
570
|
}
|
|
436
|
-
function
|
|
437
|
-
var
|
|
438
|
-
const
|
|
439
|
-
(
|
|
571
|
+
function c(n) {
|
|
572
|
+
var v;
|
|
573
|
+
const i = l.form;
|
|
574
|
+
(v = i.touchField) == null || v.call(i, n.name);
|
|
440
575
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
576
|
+
function g(n) {
|
|
577
|
+
return l.form.errors.value[n.name] ?? [];
|
|
443
578
|
}
|
|
444
|
-
function
|
|
445
|
-
return
|
|
579
|
+
function D(n) {
|
|
580
|
+
return l.form.touched.value[n.name] ?? !1;
|
|
446
581
|
}
|
|
447
|
-
const
|
|
448
|
-
() =>
|
|
582
|
+
const L = B(
|
|
583
|
+
() => l.form.fields.value.filter((n) => n.visible !== !1)
|
|
449
584
|
);
|
|
450
|
-
async function
|
|
451
|
-
|
|
585
|
+
async function $(n) {
|
|
586
|
+
n.preventDefault(), await l.form.submit(), a("submit");
|
|
452
587
|
}
|
|
453
|
-
return (
|
|
454
|
-
const
|
|
455
|
-
return t(),
|
|
588
|
+
return (n, i) => {
|
|
589
|
+
const v = _("FormRenderer", !0);
|
|
590
|
+
return t(), r("form", {
|
|
456
591
|
class: "vfs-form",
|
|
457
592
|
novalidate: "",
|
|
458
|
-
onSubmit:
|
|
593
|
+
onSubmit: $
|
|
459
594
|
}, [
|
|
460
|
-
(t(!0),
|
|
461
|
-
key:
|
|
595
|
+
(t(!0), r(x, null, S(L.value, (d) => (t(), r(x, {
|
|
596
|
+
key: d.name
|
|
462
597
|
}, [
|
|
463
|
-
|
|
598
|
+
n.$slots[`field-${d.name}`] ? A(n.$slots, `field-${d.name}`, {
|
|
464
599
|
key: 0,
|
|
465
|
-
field:
|
|
466
|
-
value:
|
|
467
|
-
error:
|
|
468
|
-
touched:
|
|
469
|
-
setValue: (
|
|
470
|
-
touch: () =>
|
|
471
|
-
}) :
|
|
472
|
-
|
|
473
|
-
|
|
600
|
+
field: d,
|
|
601
|
+
value: f(d),
|
|
602
|
+
error: g(d),
|
|
603
|
+
touched: D(d),
|
|
604
|
+
setValue: (p) => h(d, p),
|
|
605
|
+
touch: () => c(d)
|
|
606
|
+
}) : d.type === "group" ? (t(), r("fieldset", ze, [
|
|
607
|
+
d.label ? (t(), r("legend", Ie, y(d.label), 1)) : k("", !0),
|
|
608
|
+
d.fields ? (t(), F(v, {
|
|
474
609
|
key: 1,
|
|
475
610
|
form: e.form,
|
|
476
611
|
components: e.components
|
|
477
612
|
}, null, 8, ["form", "components"])) : k("", !0)
|
|
478
|
-
])) :
|
|
613
|
+
])) : d.type === "array" ? (t(), F(Be, {
|
|
479
614
|
key: 2,
|
|
480
|
-
field:
|
|
615
|
+
field: d,
|
|
481
616
|
form: e.form,
|
|
482
617
|
components: e.components
|
|
483
|
-
}, null, 8, ["field", "form", "components"])) :
|
|
618
|
+
}, null, 8, ["field", "form", "components"])) : m(d) ? (t(), F(U(m(d)), {
|
|
484
619
|
key: 3,
|
|
485
|
-
field:
|
|
486
|
-
"model-value":
|
|
487
|
-
error:
|
|
488
|
-
touched:
|
|
489
|
-
"onUpdate:modelValue": (
|
|
490
|
-
onBlur: (
|
|
491
|
-
},
|
|
492
|
-
|
|
620
|
+
field: d,
|
|
621
|
+
"model-value": f(d),
|
|
622
|
+
error: g(d),
|
|
623
|
+
touched: D(d),
|
|
624
|
+
"onUpdate:modelValue": (p) => h(d, p),
|
|
625
|
+
onBlur: (p) => c(d)
|
|
626
|
+
}, ee({ _: 2 }, [
|
|
627
|
+
n.$slots[`label-${d.name}`] ? {
|
|
493
628
|
name: "label",
|
|
494
|
-
fn:
|
|
495
|
-
|
|
629
|
+
fn: q(() => [
|
|
630
|
+
A(n.$slots, `label-${d.name}`, { field: d })
|
|
496
631
|
]),
|
|
497
632
|
key: "0"
|
|
498
633
|
} : void 0,
|
|
499
|
-
|
|
634
|
+
n.$slots[`error-${d.name}`] ? {
|
|
500
635
|
name: "error",
|
|
501
|
-
fn:
|
|
502
|
-
|
|
503
|
-
field:
|
|
504
|
-
error:
|
|
636
|
+
fn: q(() => [
|
|
637
|
+
A(n.$slots, `error-${d.name}`, {
|
|
638
|
+
field: d,
|
|
639
|
+
error: g(d)
|
|
505
640
|
})
|
|
506
641
|
]),
|
|
507
642
|
key: "1"
|
|
508
643
|
} : void 0
|
|
509
644
|
]), 1064, ["field", "model-value", "error", "touched", "onUpdate:modelValue", "onBlur"])) : k("", !0)
|
|
510
645
|
], 64))), 128)),
|
|
511
|
-
|
|
646
|
+
A(n.$slots, "submit", {
|
|
512
647
|
isSubmitting: e.form.isSubmitting.value,
|
|
513
648
|
isValid: e.form.isValid.value
|
|
514
649
|
}, () => [
|
|
@@ -516,15 +651,15 @@ const _ = ["for"], ee = {
|
|
|
516
651
|
type: "submit",
|
|
517
652
|
disabled: e.form.isSubmitting.value,
|
|
518
653
|
class: "vfs-submit"
|
|
519
|
-
},
|
|
654
|
+
}, y(e.submitLabel ?? "Submit"), 9, we)
|
|
520
655
|
])
|
|
521
656
|
], 32);
|
|
522
657
|
};
|
|
523
658
|
}
|
|
524
|
-
}),
|
|
659
|
+
}), Me = { class: "vfs-multistep" }, Ue = { class: "vfs-multistep__steps" }, Pe = { class: "vfs-multistep__step-number" }, Ke = {
|
|
525
660
|
key: 0,
|
|
526
661
|
class: "vfs-multistep__step-label"
|
|
527
|
-
},
|
|
662
|
+
}, Oe = { class: "vfs-multistep__progress" }, je = { class: "vfs-multistep__nav" }, Ge = ["disabled"], We = /* @__PURE__ */ V({
|
|
528
663
|
__name: "MultiStepFormRenderer",
|
|
529
664
|
props: {
|
|
530
665
|
form: {},
|
|
@@ -535,55 +670,55 @@ const _ = ["for"], ee = {
|
|
|
535
670
|
stepLabels: {}
|
|
536
671
|
},
|
|
537
672
|
emits: ["submit"],
|
|
538
|
-
setup(e, { emit:
|
|
539
|
-
const
|
|
540
|
-
async function
|
|
541
|
-
await
|
|
673
|
+
setup(e, { emit: o }) {
|
|
674
|
+
const l = e, s = o;
|
|
675
|
+
async function a() {
|
|
676
|
+
await l.form.next();
|
|
542
677
|
}
|
|
543
|
-
async function
|
|
544
|
-
await
|
|
678
|
+
async function u() {
|
|
679
|
+
await l.form.submit(), s("submit");
|
|
545
680
|
}
|
|
546
|
-
return (
|
|
547
|
-
b("div",
|
|
548
|
-
(t(!0),
|
|
549
|
-
var
|
|
550
|
-
return t(),
|
|
551
|
-
key:
|
|
552
|
-
class:
|
|
553
|
-
"vfs-multistep__step--active":
|
|
554
|
-
"vfs-multistep__step--done":
|
|
681
|
+
return (m, f) => (t(), r("div", Me, [
|
|
682
|
+
b("div", Ue, [
|
|
683
|
+
(t(!0), r(x, null, S(e.form.steps, (h, c) => {
|
|
684
|
+
var g;
|
|
685
|
+
return t(), r("div", {
|
|
686
|
+
key: c,
|
|
687
|
+
class: T(["vfs-multistep__step", {
|
|
688
|
+
"vfs-multistep__step--active": c === e.form.currentStep.value,
|
|
689
|
+
"vfs-multistep__step--done": c < e.form.currentStep.value
|
|
555
690
|
}])
|
|
556
691
|
}, [
|
|
557
|
-
b("span",
|
|
558
|
-
(
|
|
692
|
+
b("span", Pe, y(c + 1), 1),
|
|
693
|
+
(g = e.stepLabels) != null && g[c] ? (t(), r("span", Ke, y(e.stepLabels[c]), 1)) : k("", !0)
|
|
559
694
|
], 2);
|
|
560
695
|
}), 128))
|
|
561
696
|
]),
|
|
562
|
-
b("div",
|
|
563
|
-
|
|
697
|
+
b("div", Oe, " Step " + y(e.form.currentStep.value + 1) + " of " + y(e.form.totalSteps), 1),
|
|
698
|
+
M(Ee, {
|
|
564
699
|
form: e.form.form.value,
|
|
565
700
|
components: e.components
|
|
566
701
|
}, {
|
|
567
|
-
submit:
|
|
568
|
-
b("div",
|
|
569
|
-
e.form.isFirstStep.value ? k("", !0) : (t(),
|
|
702
|
+
submit: q(() => [
|
|
703
|
+
b("div", je, [
|
|
704
|
+
e.form.isFirstStep.value ? k("", !0) : (t(), r("button", {
|
|
570
705
|
key: 0,
|
|
571
706
|
type: "button",
|
|
572
707
|
class: "vfs-multistep__back",
|
|
573
|
-
onClick:
|
|
574
|
-
},
|
|
575
|
-
e.form.isLastStep.value ? (t(),
|
|
708
|
+
onClick: f[0] || (f[0] = (h) => e.form.back())
|
|
709
|
+
}, y(e.backLabel ?? "← Back"), 1)),
|
|
710
|
+
e.form.isLastStep.value ? (t(), r("button", {
|
|
576
711
|
key: 2,
|
|
577
712
|
type: "button",
|
|
578
713
|
class: "vfs-submit",
|
|
579
714
|
disabled: e.form.isSubmitting.value,
|
|
580
|
-
onClick:
|
|
581
|
-
},
|
|
715
|
+
onClick: u
|
|
716
|
+
}, y(e.submitLabel ?? "Submit"), 9, Ge)) : (t(), r("button", {
|
|
582
717
|
key: 1,
|
|
583
718
|
type: "button",
|
|
584
719
|
class: "vfs-multistep__next",
|
|
585
|
-
onClick:
|
|
586
|
-
},
|
|
720
|
+
onClick: a
|
|
721
|
+
}, y(e.nextLabel ?? "Next →"), 1))
|
|
587
722
|
])
|
|
588
723
|
]),
|
|
589
724
|
_: 1
|
|
@@ -592,14 +727,15 @@ const _ = ["for"], ee = {
|
|
|
592
727
|
}
|
|
593
728
|
});
|
|
594
729
|
export {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
730
|
+
Be as ArrayField,
|
|
731
|
+
H as CheckboxField,
|
|
732
|
+
Q as DateField,
|
|
733
|
+
Te as FileField,
|
|
734
|
+
Ee as FormRenderer,
|
|
735
|
+
We as MultiStepFormRenderer,
|
|
736
|
+
O as NumberField,
|
|
737
|
+
J as RadioField,
|
|
738
|
+
G as SelectField,
|
|
603
739
|
N as TextField,
|
|
604
|
-
|
|
740
|
+
j as TextareaField
|
|
605
741
|
};
|