@uniquedj95/vform 3.6.2 → 3.6.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/README.md +1 -1
- package/dist/components/vForm.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +336 -339
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/vform.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as I, computed as O, watch as N, defineComponent as q, createElementBlock as
|
|
1
|
+
import { ref as I, computed as O, watch as N, defineComponent as q, createElementBlock as F, openBlock as d, normalizeClass as K, createElementVNode as B, createCommentVNode as x, Fragment as L, renderList as X, toDisplayString as A, normalizeStyle as be, createBlock as _, resolveDynamicComponent as he, mergeProps as Re, unref as i, withCtx as V, createVNode as P, createTextVNode as U, toRef as Ae, mergeModels as J, useModel as Q, resolveDirective as $e, withDirectives as Fe, onMounted as we } from "vue";
|
|
2
2
|
import { IonGrid as Oe, IonRow as oe, IonCol as ae, IonButton as H, IonLabel as ne, IonText as Pe, IonInput as xe, IonInputPasswordToggle as Be, IonChip as Ue, IonIcon as ge, IonList as De, IonItem as Ve, IonCheckbox as Ie, actionSheetController as Te, alertController as Ne, IonTextarea as qe, IonNote as Le, IonRadioGroup as Me, IonRadio as je } from "@ionic/vue";
|
|
3
3
|
import { chevronDown as Ge, close as He, add as Ke, remove as We } from "ionicons/icons";
|
|
4
4
|
import { maskito as Ze } from "@maskito/vue";
|
|
5
5
|
function Je(t) {
|
|
6
|
-
return new Promise((
|
|
6
|
+
return new Promise((s) => {
|
|
7
7
|
requestAnimationFrame(async () => {
|
|
8
8
|
const l = await t.getInputElement();
|
|
9
|
-
|
|
9
|
+
s(l);
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -20,42 +20,42 @@ const Qe = {
|
|
|
20
20
|
a: ["A", "B", "C", "x", "y", "z", "D", "f"],
|
|
21
21
|
"*": ["A", "3", "b", "8", "z", "4", "D", "0"]
|
|
22
22
|
};
|
|
23
|
-
function Ye(t,
|
|
23
|
+
function Ye(t, s) {
|
|
24
24
|
const l = Xe[t];
|
|
25
|
-
return l[
|
|
25
|
+
return l[s % l.length];
|
|
26
26
|
}
|
|
27
27
|
function et(t) {
|
|
28
|
-
const
|
|
28
|
+
const s = [];
|
|
29
29
|
let l = "", e = 0, a = 0;
|
|
30
30
|
for (; e < t.length; ) {
|
|
31
31
|
const o = t[e];
|
|
32
32
|
if (["d", "a", "*"].includes(o)) {
|
|
33
|
-
let
|
|
33
|
+
let u = 1;
|
|
34
34
|
if (t[e + 1] === "{") {
|
|
35
35
|
const n = t.indexOf("}", e + 2);
|
|
36
36
|
if (n !== -1) {
|
|
37
37
|
const g = t.slice(e + 2, n);
|
|
38
38
|
if (g.includes(",")) {
|
|
39
39
|
const [, p] = g.split(",").map((v) => parseInt(v.trim()));
|
|
40
|
-
|
|
40
|
+
u = p || parseInt(g.split(",")[0]);
|
|
41
41
|
} else
|
|
42
|
-
|
|
42
|
+
u = parseInt(g);
|
|
43
43
|
e = n;
|
|
44
44
|
}
|
|
45
45
|
} else {
|
|
46
46
|
let n = e + 1;
|
|
47
47
|
for (; t[n] === o; )
|
|
48
|
-
|
|
48
|
+
u++, n++;
|
|
49
49
|
e = n - 1;
|
|
50
50
|
}
|
|
51
|
-
for (let n = 0; n <
|
|
52
|
-
|
|
51
|
+
for (let n = 0; n < u; n++)
|
|
52
|
+
s.push(Qe[o]), l += Ye(o, a++);
|
|
53
53
|
} else
|
|
54
|
-
|
|
54
|
+
s.push(o), l += o;
|
|
55
55
|
e++;
|
|
56
56
|
}
|
|
57
57
|
return {
|
|
58
|
-
mask:
|
|
58
|
+
mask: s,
|
|
59
59
|
placeholder: l,
|
|
60
60
|
elementPredicate: Je
|
|
61
61
|
};
|
|
@@ -63,77 +63,74 @@ function et(t) {
|
|
|
63
63
|
function Ce(t) {
|
|
64
64
|
return t == null || Array.isArray(t) && !t.length || typeof t == "object" && !Object.keys(t).length || !t;
|
|
65
65
|
}
|
|
66
|
-
function ke(t,
|
|
67
|
-
return typeof t.condition == "function" ? t.condition(
|
|
66
|
+
function ke(t, s, l) {
|
|
67
|
+
return typeof t.condition == "function" ? t.condition(s, l) : !0;
|
|
68
68
|
}
|
|
69
69
|
function Se(t) {
|
|
70
70
|
if (typeof t != "object" || t === null)
|
|
71
71
|
return t;
|
|
72
72
|
if (Array.isArray(t))
|
|
73
73
|
return t.map((l) => Se(l));
|
|
74
|
-
const
|
|
74
|
+
const s = {};
|
|
75
75
|
return Object.entries(t).forEach(([l, e]) => {
|
|
76
|
-
typeof e == "function" ?
|
|
77
|
-
}),
|
|
76
|
+
typeof e == "function" ? s[l] = e.bind(s) : s[l] = Se(e);
|
|
77
|
+
}), s;
|
|
78
78
|
}
|
|
79
|
-
function Ee(t,
|
|
80
|
-
return
|
|
79
|
+
function Ee(t, s) {
|
|
80
|
+
return s.findIndex((l) => l.value === t.value || l.label === t.label || l.value === t.label || l.label === t.value);
|
|
81
81
|
}
|
|
82
|
-
function le(t,
|
|
83
|
-
const l = Ee(t,
|
|
84
|
-
l >= 0 ?
|
|
82
|
+
function le(t, s) {
|
|
83
|
+
const l = Ee(t, s);
|
|
84
|
+
l >= 0 ? s[l].isChecked = !0 : s.push({ ...t, isChecked: !0 });
|
|
85
85
|
}
|
|
86
|
-
function tt(t,
|
|
87
|
-
const l = Ee(t,
|
|
88
|
-
l >= 0 && (
|
|
86
|
+
function tt(t, s) {
|
|
87
|
+
const l = Ee(t, s);
|
|
88
|
+
l >= 0 && (s[l].isChecked = !1);
|
|
89
89
|
}
|
|
90
90
|
function lt(t) {
|
|
91
|
-
t.forEach((
|
|
92
|
-
|
|
91
|
+
t.forEach((s) => {
|
|
92
|
+
s.isChecked = !1;
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
function at(t,
|
|
96
|
-
return
|
|
97
|
-
(l) => JSON.stringify(l).toLowerCase().includes(
|
|
95
|
+
function at(t, s) {
|
|
96
|
+
return s ? t.filter(
|
|
97
|
+
(l) => JSON.stringify(l).toLowerCase().includes(s.toLowerCase())
|
|
98
98
|
) : t;
|
|
99
99
|
}
|
|
100
100
|
function nt(t) {
|
|
101
|
-
const
|
|
102
|
-
return
|
|
101
|
+
const s = t.label || "", l = t.required ? " *" : "";
|
|
102
|
+
return s + l;
|
|
103
103
|
}
|
|
104
|
-
function de(t,
|
|
105
|
-
if (t ===
|
|
106
|
-
if (t == null ||
|
|
107
|
-
if (typeof t != "object") return t ===
|
|
108
|
-
if (Array.isArray(t) && Array.isArray(
|
|
109
|
-
return t.length !==
|
|
110
|
-
if (Array.isArray(t) !== Array.isArray(
|
|
111
|
-
const l = Object.keys(t), e = Object.keys(
|
|
104
|
+
function de(t, s) {
|
|
105
|
+
if (t === s) return !0;
|
|
106
|
+
if (t == null || s == null || typeof t != typeof s) return !1;
|
|
107
|
+
if (typeof t != "object") return t === s;
|
|
108
|
+
if (Array.isArray(t) && Array.isArray(s))
|
|
109
|
+
return t.length !== s.length ? !1 : t.every((a, o) => de(a, s[o]));
|
|
110
|
+
if (Array.isArray(t) !== Array.isArray(s)) return !1;
|
|
111
|
+
const l = Object.keys(t), e = Object.keys(s);
|
|
112
112
|
return l.length !== e.length ? !1 : l.every(
|
|
113
|
-
(a) => Object.prototype.hasOwnProperty.call(
|
|
113
|
+
(a) => Object.prototype.hasOwnProperty.call(s, a) && de(t[a], s[a])
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Z(t) {
|
|
117
117
|
return t.type !== "FormSection";
|
|
118
118
|
}
|
|
119
|
-
function ot(t) {
|
|
120
|
-
return t.type === "FormSection";
|
|
121
|
-
}
|
|
122
119
|
function ze() {
|
|
123
120
|
const t = I([]);
|
|
124
|
-
async function
|
|
121
|
+
async function s() {
|
|
125
122
|
console.debug("Validating form inputs");
|
|
126
123
|
const o = [];
|
|
127
|
-
for (const
|
|
128
|
-
if (typeof (
|
|
124
|
+
for (const u of t.value)
|
|
125
|
+
if (typeof (u == null ? void 0 : u.onValueUpdate) == "function" && await u.onValueUpdate(), typeof (u == null ? void 0 : u.getErrors) == "function")
|
|
129
126
|
try {
|
|
130
|
-
const n =
|
|
127
|
+
const n = u.getErrors();
|
|
131
128
|
Array.isArray(n) ? o.push(...n) : console.warn("getErrors() returned non-array value:", n);
|
|
132
129
|
} catch (n) {
|
|
133
|
-
console.error("Error calling getErrors on component:", n,
|
|
130
|
+
console.error("Error calling getErrors on component:", n, u);
|
|
134
131
|
}
|
|
135
132
|
else
|
|
136
|
-
console.warn("Component does not have getErrors function:",
|
|
133
|
+
console.warn("Component does not have getErrors function:", u);
|
|
137
134
|
return o.every(Ce);
|
|
138
135
|
}
|
|
139
136
|
function l() {
|
|
@@ -143,13 +140,13 @@ function ze() {
|
|
|
143
140
|
}
|
|
144
141
|
function e() {
|
|
145
142
|
const o = [];
|
|
146
|
-
for (const
|
|
147
|
-
if (typeof (
|
|
143
|
+
for (const u of t.value)
|
|
144
|
+
if (typeof (u == null ? void 0 : u.getErrors) == "function")
|
|
148
145
|
try {
|
|
149
|
-
const n =
|
|
146
|
+
const n = u.getErrors();
|
|
150
147
|
Array.isArray(n) ? o.push(...n) : o.push(String(n));
|
|
151
148
|
} catch (n) {
|
|
152
|
-
console.error("Error calling getErrors on component:", n,
|
|
149
|
+
console.error("Error calling getErrors on component:", n, u);
|
|
153
150
|
}
|
|
154
151
|
return o;
|
|
155
152
|
}
|
|
@@ -159,20 +156,20 @@ function ze() {
|
|
|
159
156
|
}
|
|
160
157
|
return {
|
|
161
158
|
dynamicRefs: t,
|
|
162
|
-
isFormValid:
|
|
159
|
+
isFormValid: s,
|
|
163
160
|
resetForm: l,
|
|
164
161
|
getFormErrors: e,
|
|
165
162
|
updateFormValues: a
|
|
166
163
|
};
|
|
167
164
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
() => Object.entries(t.value).reduce((p, [v, f]) => (
|
|
165
|
+
function ot(t) {
|
|
166
|
+
const s = O(
|
|
167
|
+
() => Object.entries(t.value).reduce((p, [v, f]) => (Z(f) && f.value !== void 0 && (typeof f.onChange == "function" ? p[v] = f.onChange(f.value, t.value) : p[v] = f.value), p), {})
|
|
171
168
|
), l = I({}), e = (p, v, f) => {
|
|
172
169
|
const r = t.value[p];
|
|
173
|
-
if (
|
|
170
|
+
if (Z(r) && r.children) {
|
|
174
171
|
const h = r.children[v];
|
|
175
|
-
if (h &&
|
|
172
|
+
if (h && Z(h) && typeof h.computedValue == "function")
|
|
176
173
|
return h.computedValue(f, t.value);
|
|
177
174
|
}
|
|
178
175
|
return f;
|
|
@@ -186,23 +183,23 @@ function ut(t) {
|
|
|
186
183
|
const S = f[h] ?? { other: {} };
|
|
187
184
|
a(p, r, S, h);
|
|
188
185
|
});
|
|
189
|
-
},
|
|
186
|
+
}, u = (p, { other: v }) => Object.entries(v ?? {}).reduce(
|
|
190
187
|
(f, [r, h]) => (f[r] = e(p, r, h), f),
|
|
191
188
|
{}
|
|
192
189
|
), n = (p, v, f) => {
|
|
193
190
|
l.value[p] || (l.value[p] = []);
|
|
194
191
|
const r = v;
|
|
195
|
-
Array.isArray(f[p]) ? o(p, r, f[p]) : l.value[p] = r.map((h) =>
|
|
192
|
+
Array.isArray(f[p]) ? o(p, r, f[p]) : l.value[p] = r.map((h) => u(p, h));
|
|
196
193
|
}, g = (p, v, f) => {
|
|
197
194
|
if (!v) {
|
|
198
195
|
delete l.value[p];
|
|
199
196
|
return;
|
|
200
197
|
}
|
|
201
198
|
const r = t.value[p];
|
|
202
|
-
|
|
199
|
+
Z(r) && (r.children !== void 0 ? n(p, v, f) : typeof r.computedValue == "function" && (l.value[p] = r.computedValue(v, t.value)));
|
|
203
200
|
};
|
|
204
201
|
return N(
|
|
205
|
-
|
|
202
|
+
s,
|
|
206
203
|
(p, v = {}) => {
|
|
207
204
|
Object.keys(p).forEach((f) => {
|
|
208
205
|
de(p[f], v[f]) || g(f, p[f], v);
|
|
@@ -215,31 +212,31 @@ function ut(t) {
|
|
|
215
212
|
deep: !0
|
|
216
213
|
}
|
|
217
214
|
), {
|
|
218
|
-
formData:
|
|
215
|
+
formData: s,
|
|
219
216
|
computedData: l
|
|
220
217
|
};
|
|
221
218
|
}
|
|
222
219
|
function st(t) {
|
|
223
|
-
const
|
|
220
|
+
const s = I(0), l = I({}), e = I({}), a = I({});
|
|
224
221
|
function o(C) {
|
|
225
222
|
const m = {};
|
|
226
223
|
return C.component || !C.schema || Object.entries(C.schema).forEach(([y, k]) => {
|
|
227
|
-
|
|
224
|
+
Z(k) && (m[y] = k.value);
|
|
228
225
|
}), m;
|
|
229
226
|
}
|
|
230
227
|
t.steps.forEach((C) => {
|
|
231
228
|
l.value[C.id] = o(C), e.value[C.id] = {}, a.value[C.id] = [];
|
|
232
229
|
});
|
|
233
|
-
const
|
|
230
|
+
const u = I(t.steps.map((C) => C.id)), n = O(() => t.steps.filter((m) => m.condition ? m.condition(l.value, e.value) : !0));
|
|
234
231
|
N(n, (C) => {
|
|
235
232
|
const m = C.map((k) => k.id);
|
|
236
|
-
|
|
233
|
+
u.value.filter(
|
|
237
234
|
(k) => !m.includes(k)
|
|
238
235
|
).forEach((k) => {
|
|
239
236
|
R(k);
|
|
240
|
-
}),
|
|
237
|
+
}), u.value = m;
|
|
241
238
|
});
|
|
242
|
-
const g = O(() => n.value.length > 0 ?
|
|
239
|
+
const g = O(() => n.value.length > 0 ? s.value >= n.value.length ? n.value[n.value.length - 1] : n.value[s.value] : t.steps[s.value]), p = O(() => s.value === 0), v = O(() => s.value === n.value.length - 1), f = O(() => !v.value), r = O(() => !p.value), h = O(() => n.value.length), S = O(() => h.value === 0 ? 0 : Math.round((s.value + 1) / h.value * 100));
|
|
243
240
|
function b(C, m) {
|
|
244
241
|
l.value[C] = { ...l.value[C], ...m };
|
|
245
242
|
}
|
|
@@ -250,7 +247,7 @@ function st(t) {
|
|
|
250
247
|
const m = t.steps.find((y) => y.id === C);
|
|
251
248
|
m && (l.value[C] = o(m), e.value[C] = {});
|
|
252
249
|
}
|
|
253
|
-
async function
|
|
250
|
+
async function $() {
|
|
254
251
|
const C = g.value;
|
|
255
252
|
if (!C) return !0;
|
|
256
253
|
const m = [];
|
|
@@ -263,17 +260,17 @@ function st(t) {
|
|
|
263
260
|
}
|
|
264
261
|
return a.value[C.id] = m, m.length === 0;
|
|
265
262
|
}
|
|
266
|
-
async function
|
|
267
|
-
return C < 0 || C >= n.value.length || C >
|
|
263
|
+
async function W(C) {
|
|
264
|
+
return C < 0 || C >= n.value.length || C > s.value && !await $() ? !1 : (s.value = C, !0);
|
|
268
265
|
}
|
|
269
266
|
async function te() {
|
|
270
|
-
return f.value ?
|
|
267
|
+
return f.value ? W(s.value + 1) : !1;
|
|
271
268
|
}
|
|
272
269
|
async function Y() {
|
|
273
|
-
return r.value ?
|
|
270
|
+
return r.value ? W(s.value - 1) : !1;
|
|
274
271
|
}
|
|
275
272
|
function ee() {
|
|
276
|
-
|
|
273
|
+
s.value = 0, a.value = {}, t.steps.forEach((C) => {
|
|
277
274
|
R(C.id), a.value[C.id] = [];
|
|
278
275
|
});
|
|
279
276
|
}
|
|
@@ -297,7 +294,7 @@ function st(t) {
|
|
|
297
294
|
}
|
|
298
295
|
return {
|
|
299
296
|
// State
|
|
300
|
-
currentStepIndex:
|
|
297
|
+
currentStepIndex: s,
|
|
301
298
|
currentStep: g,
|
|
302
299
|
stepData: l,
|
|
303
300
|
stepComputedData: e,
|
|
@@ -314,8 +311,8 @@ function st(t) {
|
|
|
314
311
|
updateStepData: b,
|
|
315
312
|
updateStepComputedData: w,
|
|
316
313
|
clearStepData: R,
|
|
317
|
-
validateCurrentStep:
|
|
318
|
-
goToStep:
|
|
314
|
+
validateCurrentStep: $,
|
|
315
|
+
goToStep: W,
|
|
319
316
|
nextStep: te,
|
|
320
317
|
previousStep: Y,
|
|
321
318
|
resetForm: ee,
|
|
@@ -323,13 +320,13 @@ function st(t) {
|
|
|
323
320
|
getMultiStepFormData: M
|
|
324
321
|
};
|
|
325
322
|
}
|
|
326
|
-
const
|
|
323
|
+
const ut = { class: "step-indicator__container" }, rt = ["onClick"], it = { class: "step-indicator__step-content" }, ct = { class: "step-indicator__step-marker" }, dt = { class: "step-indicator__step-info" }, vt = { class: "step-indicator__step-title" }, pt = {
|
|
327
324
|
key: 0,
|
|
328
325
|
class: "step-indicator__step-subtitle"
|
|
329
|
-
},
|
|
326
|
+
}, ft = {
|
|
330
327
|
key: 0,
|
|
331
328
|
class: "step-indicator__progress"
|
|
332
|
-
},
|
|
329
|
+
}, mt = { class: "step-indicator__progress-bar" }, ht = { class: "step-indicator__progress-text" }, gt = /* @__PURE__ */ q({
|
|
333
330
|
__name: "StepIndicator",
|
|
334
331
|
props: {
|
|
335
332
|
steps: {},
|
|
@@ -339,62 +336,62 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
339
336
|
allowNavigation: { type: Boolean, default: !1 }
|
|
340
337
|
},
|
|
341
338
|
emits: ["step-click"],
|
|
342
|
-
setup(t, { emit:
|
|
343
|
-
const l = t, e =
|
|
344
|
-
function o(
|
|
345
|
-
l.allowNavigation && e("step-click",
|
|
339
|
+
setup(t, { emit: s }) {
|
|
340
|
+
const l = t, e = s, a = O(() => l.steps.length === 0 ? 0 : (l.activeStepIndex + 1) / l.steps.length * 100);
|
|
341
|
+
function o(u) {
|
|
342
|
+
l.allowNavigation && e("step-click", u);
|
|
346
343
|
}
|
|
347
|
-
return (
|
|
348
|
-
class:
|
|
344
|
+
return (u, n) => (d(), F("div", {
|
|
345
|
+
class: K(["step-indicator", [`step-indicator--${u.position}`, { "step-indicator--clickable": u.allowNavigation }]])
|
|
349
346
|
}, [
|
|
350
|
-
B("div",
|
|
351
|
-
(d(!0),
|
|
347
|
+
B("div", ut, [
|
|
348
|
+
(d(!0), F(L, null, X(u.steps, (g, p) => (d(), F("div", {
|
|
352
349
|
key: g.id,
|
|
353
|
-
class:
|
|
354
|
-
"step-indicator__step--active": p ===
|
|
355
|
-
"step-indicator__step--completed": p <
|
|
356
|
-
"step-indicator__step--clickable":
|
|
350
|
+
class: K(["step-indicator__step", {
|
|
351
|
+
"step-indicator__step--active": p === u.activeStepIndex,
|
|
352
|
+
"step-indicator__step--completed": p < u.activeStepIndex,
|
|
353
|
+
"step-indicator__step--clickable": u.allowNavigation
|
|
357
354
|
}]),
|
|
358
355
|
onClick: (v) => o(p)
|
|
359
356
|
}, [
|
|
360
|
-
B("div",
|
|
361
|
-
B("div",
|
|
357
|
+
B("div", it, [
|
|
358
|
+
B("div", ct, [
|
|
362
359
|
B("span", null, A(p + 1), 1)
|
|
363
360
|
]),
|
|
364
|
-
B("div",
|
|
365
|
-
B("div",
|
|
366
|
-
g.subtitle ? (d(),
|
|
361
|
+
B("div", dt, [
|
|
362
|
+
B("div", vt, A(g.title), 1),
|
|
363
|
+
g.subtitle ? (d(), F("div", pt, A(g.subtitle), 1)) : x("", !0)
|
|
367
364
|
])
|
|
368
365
|
]),
|
|
369
|
-
p <
|
|
366
|
+
p < u.steps.length - 1 ? (d(), F("div", {
|
|
370
367
|
key: 0,
|
|
371
|
-
class:
|
|
368
|
+
class: K(["step-indicator__connector", { "step-indicator__connector--completed": p < u.activeStepIndex }])
|
|
372
369
|
}, null, 2)) : x("", !0)
|
|
373
|
-
], 10,
|
|
370
|
+
], 10, rt))), 128))
|
|
374
371
|
]),
|
|
375
|
-
|
|
376
|
-
B("div",
|
|
372
|
+
u.showProgress && (u.position === "top" || u.position === "bottom") ? (d(), F("div", ft, [
|
|
373
|
+
B("div", mt, [
|
|
377
374
|
B("div", {
|
|
378
375
|
class: "step-indicator__progress-fill",
|
|
379
376
|
style: be({ width: `${a.value}%` })
|
|
380
377
|
}, null, 4)
|
|
381
378
|
]),
|
|
382
|
-
B("div",
|
|
379
|
+
B("div", ht, " Step " + A(u.activeStepIndex + 1) + " of " + A(u.steps.length), 1)
|
|
383
380
|
])) : x("", !0)
|
|
384
381
|
], 2));
|
|
385
382
|
}
|
|
386
|
-
}), ve = (t,
|
|
383
|
+
}), ve = (t, s) => {
|
|
387
384
|
const l = t.__vccOpts || t;
|
|
388
|
-
for (const [e, a] of
|
|
385
|
+
for (const [e, a] of s)
|
|
389
386
|
l[e] = a;
|
|
390
387
|
return l;
|
|
391
|
-
}, me = /* @__PURE__ */ ve(
|
|
388
|
+
}, me = /* @__PURE__ */ ve(gt, [["__scopeId", "data-v-aca1a6d0"]]), yt = { class: "v-form-container" }, _t = {
|
|
392
389
|
key: 0,
|
|
393
390
|
class: "multi-step-form"
|
|
394
|
-
},
|
|
391
|
+
}, bt = { class: "multi-step-form-content" }, Vt = { class: "step-nav-buttons" }, Ct = { class: "step-action-buttons" }, kt = { class: "step-nav-buttons" }, St = {
|
|
395
392
|
key: 3,
|
|
396
393
|
class: "step-progress-bottom"
|
|
397
|
-
},
|
|
394
|
+
}, wt = { class: "step-progress-bar" }, Et = { class: "step-progress-text" }, Ot = /* @__PURE__ */ q({
|
|
398
395
|
__name: "vForm",
|
|
399
396
|
props: {
|
|
400
397
|
schema: {},
|
|
@@ -410,12 +407,12 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
410
407
|
customButtons: {}
|
|
411
408
|
},
|
|
412
409
|
emits: ["submit", "multi-step-submit", "step-change", "clear", "cancel"],
|
|
413
|
-
setup(t, { expose:
|
|
414
|
-
const e = t, a = l, o = O(() => !!e.multiStepConfig),
|
|
410
|
+
setup(t, { expose: s, emit: l }) {
|
|
411
|
+
const e = t, a = l, o = O(() => !!e.multiStepConfig), u = I(e.schema || {}), n = e.multiStepConfig ? st(e.multiStepConfig) : null, { dynamicRefs: g, isFormValid: p, resetForm: v } = ze(), { formData: f, computedData: r } = ot(u), h = I(null), S = O(() => (n == null ? void 0 : n.currentStepIndex.value) ?? 0), b = O(() => n == null ? void 0 : n.currentStep.value), w = O(() => (n == null ? void 0 : n.visibleSteps.value) ?? []), R = O(() => (n == null ? void 0 : n.isLastStep.value) ?? !0), $ = O(() => (n == null ? void 0 : n.canGoNext.value) ?? !1), W = O(() => (n == null ? void 0 : n.canGoPrevious.value) ?? !1), te = O(() => !o.value || !n ? 0 : n.progressPercentage.value);
|
|
415
412
|
N(
|
|
416
413
|
() => b.value,
|
|
417
414
|
(c) => {
|
|
418
|
-
c && o.value && (
|
|
415
|
+
c && o.value && (u.value = c.schema || {});
|
|
419
416
|
},
|
|
420
417
|
{ immediate: !0 }
|
|
421
418
|
), N(
|
|
@@ -428,9 +425,9 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
428
425
|
() => e.schema,
|
|
429
426
|
(c) => {
|
|
430
427
|
if (!o.value && c) {
|
|
431
|
-
|
|
432
|
-
for (const [z,
|
|
433
|
-
|
|
428
|
+
u.value = c;
|
|
429
|
+
for (const [z, D] of Object.entries(c))
|
|
430
|
+
Z(D) && "value" in D && D.value !== void 0 && (u.value[z].value = D.value);
|
|
434
431
|
}
|
|
435
432
|
},
|
|
436
433
|
{ deep: !0, immediate: !0 }
|
|
@@ -439,8 +436,8 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
439
436
|
var c;
|
|
440
437
|
if (o.value && n) {
|
|
441
438
|
if ((c = b.value) != null && c.component && h.value && typeof h.value.validate == "function" && !await h.value.validate() || !await n.validateAllSteps()) return;
|
|
442
|
-
const
|
|
443
|
-
a("multi-step-submit",
|
|
439
|
+
const D = n.getMultiStepFormData();
|
|
440
|
+
a("multi-step-submit", D);
|
|
444
441
|
} else {
|
|
445
442
|
if (!await p()) return;
|
|
446
443
|
a("submit", f.value, r.value);
|
|
@@ -482,10 +479,10 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
482
479
|
f,
|
|
483
480
|
async () => {
|
|
484
481
|
var c;
|
|
485
|
-
for (const [z,
|
|
486
|
-
if (
|
|
482
|
+
for (const [z, D] of Object.entries(u.value))
|
|
483
|
+
if (!ke(D, f.value, r.value)) {
|
|
487
484
|
const G = o.value && b.value && b.value.schema ? b.value.schema[z] : (c = e.schema) == null ? void 0 : c[z];
|
|
488
|
-
G &&
|
|
485
|
+
G && Z(G) && "value" in G && (D.value = G.value);
|
|
489
486
|
}
|
|
490
487
|
},
|
|
491
488
|
{
|
|
@@ -496,10 +493,10 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
496
493
|
function k(c) {
|
|
497
494
|
o.value && n && b.value && n.updateStepData(b.value.id, c);
|
|
498
495
|
}
|
|
499
|
-
function T(c, z,
|
|
500
|
-
return
|
|
496
|
+
function T(c, z, D) {
|
|
497
|
+
return ke(c, z, D);
|
|
501
498
|
}
|
|
502
|
-
return
|
|
499
|
+
return s({
|
|
503
500
|
resetForm: ee,
|
|
504
501
|
isFormValid: p,
|
|
505
502
|
resolveData: () => o.value && n ? n.getMultiStepFormData() : {
|
|
@@ -513,9 +510,9 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
513
510
|
getCurrentStep: () => b.value,
|
|
514
511
|
getCurrentStepIndex: () => S.value
|
|
515
512
|
}), (c, z) => {
|
|
516
|
-
var
|
|
517
|
-
return d(),
|
|
518
|
-
o.value ? (d(),
|
|
513
|
+
var D, G;
|
|
514
|
+
return d(), F("div", yt, [
|
|
515
|
+
o.value ? (d(), F("div", _t, [
|
|
519
516
|
c.multiStepConfig && c.multiStepConfig.stepPosition === "top" ? (d(), _(me, {
|
|
520
517
|
key: 0,
|
|
521
518
|
steps: w.value,
|
|
@@ -526,7 +523,7 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
526
523
|
onStepClick: y
|
|
527
524
|
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : x("", !0),
|
|
528
525
|
B("div", {
|
|
529
|
-
class:
|
|
526
|
+
class: K(["multi-step-content", `multi-step-content--${((D = c.multiStepConfig) == null ? void 0 : D.stepPosition) || "top"}`])
|
|
530
527
|
}, [
|
|
531
528
|
c.multiStepConfig && c.multiStepConfig.stepPosition === "left" ? (d(), _(me, {
|
|
532
529
|
key: 0,
|
|
@@ -538,7 +535,7 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
538
535
|
onStepClick: y,
|
|
539
536
|
class: "multi-step-sidebar"
|
|
540
537
|
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : x("", !0),
|
|
541
|
-
B("div",
|
|
538
|
+
B("div", bt, [
|
|
542
539
|
(G = b.value) != null && G.component ? (d(), _(he(b.value.component), Re({ key: 0 }, b.value.componentProps || {}, {
|
|
543
540
|
"onUpdate:data": k,
|
|
544
541
|
ref_key: "customComponentRef",
|
|
@@ -547,23 +544,23 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
547
544
|
default: V(() => [
|
|
548
545
|
P(i(oe), null, {
|
|
549
546
|
default: V(() => [
|
|
550
|
-
(d(!0),
|
|
551
|
-
var
|
|
552
|
-
return d(),
|
|
553
|
-
T(
|
|
547
|
+
(d(!0), F(L, null, X(Object.keys(u.value), (E) => {
|
|
548
|
+
var se, ue, re, ie, ce;
|
|
549
|
+
return d(), F(L, { key: E }, [
|
|
550
|
+
T(u.value[E], i(f), i(r)) ? (d(), _(i(ae), {
|
|
554
551
|
key: 0,
|
|
555
|
-
size: ((
|
|
556
|
-
"size-sm": (
|
|
557
|
-
"size-md": (re =
|
|
558
|
-
"size-lg": (ie =
|
|
559
|
-
"size-xl": (ce =
|
|
552
|
+
size: ((se = u.value[E].grid) == null ? void 0 : se.xs) ?? "12",
|
|
553
|
+
"size-sm": (ue = u.value[E].grid) == null ? void 0 : ue.sm,
|
|
554
|
+
"size-md": (re = u.value[E].grid) == null ? void 0 : re.md,
|
|
555
|
+
"size-lg": (ie = u.value[E].grid) == null ? void 0 : ie.lg,
|
|
556
|
+
"size-xl": (ce = u.value[E].grid) == null ? void 0 : ce.xl,
|
|
560
557
|
class: "ion-margin-vertical"
|
|
561
558
|
}, {
|
|
562
559
|
default: V(() => [
|
|
563
|
-
(d(), _(he(
|
|
564
|
-
modelValue:
|
|
565
|
-
"onUpdate:modelValue": (_e) =>
|
|
566
|
-
schema:
|
|
560
|
+
(d(), _(he(u.value[E].type), {
|
|
561
|
+
modelValue: u.value[E],
|
|
562
|
+
"onUpdate:modelValue": (_e) => u.value[E] = _e,
|
|
563
|
+
schema: u.value,
|
|
567
564
|
"form-id": E,
|
|
568
565
|
ref_for: !0,
|
|
569
566
|
ref_key: "dynamicRefs",
|
|
@@ -591,27 +588,27 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
591
588
|
class: "button-container"
|
|
592
589
|
}, {
|
|
593
590
|
default: V(() => [
|
|
594
|
-
B("div",
|
|
595
|
-
|
|
591
|
+
B("div", Vt, [
|
|
592
|
+
W.value ? (d(), _(i(H), {
|
|
596
593
|
key: 0,
|
|
597
594
|
onClick: m,
|
|
598
595
|
fill: "outline"
|
|
599
596
|
}, {
|
|
600
597
|
default: V(() => z[0] || (z[0] = [
|
|
601
|
-
|
|
598
|
+
U(" Previous ")
|
|
602
599
|
])),
|
|
603
600
|
_: 1,
|
|
604
601
|
__: [0]
|
|
605
602
|
})) : x("", !0)
|
|
606
603
|
]),
|
|
607
|
-
B("div",
|
|
604
|
+
B("div", Ct, [
|
|
608
605
|
c.showCancelButton ? (d(), _(i(H), {
|
|
609
606
|
key: 0,
|
|
610
607
|
onClick: M,
|
|
611
608
|
fill: "outline"
|
|
612
609
|
}, {
|
|
613
610
|
default: V(() => [
|
|
614
|
-
|
|
611
|
+
U(A(c.cancelButtonText ?? "Cancel"), 1)
|
|
615
612
|
]),
|
|
616
613
|
_: 1
|
|
617
614
|
})) : x("", !0),
|
|
@@ -621,28 +618,28 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
621
618
|
fill: "outline"
|
|
622
619
|
}, {
|
|
623
620
|
default: V(() => [
|
|
624
|
-
|
|
621
|
+
U(A(c.clearButtonText ?? "Reset"), 1)
|
|
625
622
|
]),
|
|
626
623
|
_: 1
|
|
627
624
|
})) : x("", !0),
|
|
628
|
-
(d(!0),
|
|
625
|
+
(d(!0), F(L, null, X(c.customButtons, (E) => (d(), _(i(H), {
|
|
629
626
|
key: E.label,
|
|
630
627
|
onClick: E.action,
|
|
631
628
|
color: E.color ?? "primary"
|
|
632
629
|
}, {
|
|
633
630
|
default: V(() => [
|
|
634
|
-
|
|
631
|
+
U(A(E.label), 1)
|
|
635
632
|
]),
|
|
636
633
|
_: 2
|
|
637
634
|
}, 1032, ["onClick", "color"]))), 128))
|
|
638
635
|
]),
|
|
639
|
-
B("div",
|
|
640
|
-
|
|
636
|
+
B("div", kt, [
|
|
637
|
+
$.value ? (d(), _(i(H), {
|
|
641
638
|
key: 0,
|
|
642
639
|
onClick: C
|
|
643
640
|
}, {
|
|
644
641
|
default: V(() => z[1] || (z[1] = [
|
|
645
|
-
|
|
642
|
+
U(" Next ")
|
|
646
643
|
])),
|
|
647
644
|
_: 1,
|
|
648
645
|
__: [1]
|
|
@@ -652,7 +649,7 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
652
649
|
onClick: Y
|
|
653
650
|
}, {
|
|
654
651
|
default: V(() => [
|
|
655
|
-
|
|
652
|
+
U(A(c.submitButtonText ?? "Submit"), 1)
|
|
656
653
|
]),
|
|
657
654
|
_: 1
|
|
658
655
|
})) : x("", !0)
|
|
@@ -663,14 +660,14 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
663
660
|
]),
|
|
664
661
|
_: 1
|
|
665
662
|
})),
|
|
666
|
-
c.multiStepConfig && (c.multiStepConfig.stepPosition === "left" || c.multiStepConfig.stepPosition === "right") && c.multiStepConfig.showProgress ? (d(),
|
|
667
|
-
B("div",
|
|
663
|
+
c.multiStepConfig && (c.multiStepConfig.stepPosition === "left" || c.multiStepConfig.stepPosition === "right") && c.multiStepConfig.showProgress ? (d(), F("div", St, [
|
|
664
|
+
B("div", wt, [
|
|
668
665
|
B("div", {
|
|
669
666
|
class: "step-progress-fill",
|
|
670
667
|
style: be({ width: `${te.value}%` })
|
|
671
668
|
}, null, 4)
|
|
672
669
|
]),
|
|
673
|
-
B("div",
|
|
670
|
+
B("div", Et, " Step " + A(S.value + 1) + " of " + A(w.value.length), 1)
|
|
674
671
|
])) : x("", !0)
|
|
675
672
|
]),
|
|
676
673
|
c.multiStepConfig && c.multiStepConfig.stepPosition === "right" ? (d(), _(me, {
|
|
@@ -697,23 +694,23 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
697
694
|
default: V(() => [
|
|
698
695
|
P(i(oe), null, {
|
|
699
696
|
default: V(() => [
|
|
700
|
-
(d(!0),
|
|
701
|
-
var
|
|
702
|
-
return d(),
|
|
703
|
-
T(
|
|
697
|
+
(d(!0), F(L, null, X(Object.keys(u.value), (E) => {
|
|
698
|
+
var se, ue, re, ie, ce;
|
|
699
|
+
return d(), F(L, { key: E }, [
|
|
700
|
+
T(u.value[E], i(f), i(r)) ? (d(), _(i(ae), {
|
|
704
701
|
key: 0,
|
|
705
|
-
size: ((
|
|
706
|
-
"size-sm": (
|
|
707
|
-
"size-md": (re =
|
|
708
|
-
"size-lg": (ie =
|
|
709
|
-
"size-xl": (ce =
|
|
702
|
+
size: ((se = u.value[E].grid) == null ? void 0 : se.xs) ?? "12",
|
|
703
|
+
"size-sm": (ue = u.value[E].grid) == null ? void 0 : ue.sm,
|
|
704
|
+
"size-md": (re = u.value[E].grid) == null ? void 0 : re.md,
|
|
705
|
+
"size-lg": (ie = u.value[E].grid) == null ? void 0 : ie.lg,
|
|
706
|
+
"size-xl": (ce = u.value[E].grid) == null ? void 0 : ce.xl,
|
|
710
707
|
class: "ion-margin-vertical"
|
|
711
708
|
}, {
|
|
712
709
|
default: V(() => [
|
|
713
|
-
(d(), _(he(
|
|
714
|
-
modelValue:
|
|
715
|
-
"onUpdate:modelValue": (_e) =>
|
|
716
|
-
schema:
|
|
710
|
+
(d(), _(he(u.value[E].type), {
|
|
711
|
+
modelValue: u.value[E],
|
|
712
|
+
"onUpdate:modelValue": (_e) => u.value[E] = _e,
|
|
713
|
+
schema: u.value,
|
|
717
714
|
"form-id": E,
|
|
718
715
|
ref_for: !0,
|
|
719
716
|
ref_key: "dynamicRefs",
|
|
@@ -741,7 +738,7 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
741
738
|
onClick: M
|
|
742
739
|
}, {
|
|
743
740
|
default: V(() => [
|
|
744
|
-
|
|
741
|
+
U(A(c.cancelButtonText ?? "Cancel"), 1)
|
|
745
742
|
]),
|
|
746
743
|
_: 1
|
|
747
744
|
})) : x("", !0),
|
|
@@ -750,23 +747,23 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
750
747
|
onClick: ee
|
|
751
748
|
}, {
|
|
752
749
|
default: V(() => [
|
|
753
|
-
|
|
750
|
+
U(A(c.clearButtonText ?? "Reset"), 1)
|
|
754
751
|
]),
|
|
755
752
|
_: 1
|
|
756
753
|
})) : x("", !0),
|
|
757
|
-
(d(!0),
|
|
754
|
+
(d(!0), F(L, null, X(c.customButtons, (E) => (d(), _(i(H), {
|
|
758
755
|
key: E.label,
|
|
759
756
|
onClick: E.action,
|
|
760
757
|
color: E.color ?? "primary"
|
|
761
758
|
}, {
|
|
762
759
|
default: V(() => [
|
|
763
|
-
|
|
760
|
+
U(A(E.label), 1)
|
|
764
761
|
]),
|
|
765
762
|
_: 2
|
|
766
763
|
}, 1032, ["onClick", "color"]))), 128)),
|
|
767
764
|
P(i(H), { onClick: Y }, {
|
|
768
765
|
default: V(() => [
|
|
769
|
-
|
|
766
|
+
U(A(c.submitButtonText ?? "Submit"), 1)
|
|
770
767
|
]),
|
|
771
768
|
_: 1
|
|
772
769
|
})
|
|
@@ -782,12 +779,12 @@ const rt = { class: "step-indicator__container" }, it = ["onClick"], ct = { clas
|
|
|
782
779
|
]);
|
|
783
780
|
};
|
|
784
781
|
}
|
|
785
|
-
}),
|
|
786
|
-
function
|
|
782
|
+
}), xt = /* @__PURE__ */ ve(Ot, [["__scopeId", "data-v-897e5a98"]]);
|
|
783
|
+
function It(t) {
|
|
787
784
|
return {
|
|
788
785
|
applyValidationState: async (e) => {
|
|
789
|
-
var a, o,
|
|
790
|
-
(a = t.value) == null || a.$el.classList.remove("ion-invalid"), (o = t.value) == null || o.$el.classList.remove("ion-valid"), e ? (
|
|
786
|
+
var a, o, u, n, g;
|
|
787
|
+
(a = t.value) == null || a.$el.classList.remove("ion-invalid"), (o = t.value) == null || o.$el.classList.remove("ion-valid"), e ? (u = t.value) == null || u.$el.classList.add("ion-valid") : (n = t.value) == null || n.$el.classList.add("ion-invalid"), (g = t.value) == null || g.$el.classList.add("ion-touched");
|
|
791
788
|
},
|
|
792
789
|
resetValidationState: () => {
|
|
793
790
|
var e, a;
|
|
@@ -795,37 +792,37 @@ function zt(t) {
|
|
|
795
792
|
}
|
|
796
793
|
};
|
|
797
794
|
}
|
|
798
|
-
function pe(t,
|
|
799
|
-
const { applyValidationState: o, resetValidationState:
|
|
795
|
+
function pe(t, s, l, e, a) {
|
|
796
|
+
const { applyValidationState: o, resetValidationState: u } = It(t);
|
|
800
797
|
async function n() {
|
|
801
|
-
if (
|
|
802
|
-
return
|
|
798
|
+
if (s.value.required && !l.value)
|
|
799
|
+
return s.value.error = "This field is required", !1;
|
|
803
800
|
if (a) {
|
|
804
801
|
const r = await a(l.value);
|
|
805
802
|
if (typeof r == "string")
|
|
806
|
-
return
|
|
803
|
+
return s.value.error = r, !1;
|
|
807
804
|
if (r === !1)
|
|
808
805
|
return !1;
|
|
809
806
|
}
|
|
810
|
-
if (
|
|
811
|
-
const r = await
|
|
807
|
+
if (s.value.validation) {
|
|
808
|
+
const r = await s.value.validation(l.value, e == null ? void 0 : e.value);
|
|
812
809
|
if (r && r.length)
|
|
813
|
-
return
|
|
810
|
+
return s.value.error = r.join(), !1;
|
|
814
811
|
}
|
|
815
812
|
return !0;
|
|
816
813
|
}
|
|
817
814
|
async function g() {
|
|
818
815
|
const r = await n();
|
|
819
|
-
r && (
|
|
816
|
+
r && (s.value.error = "", s.value.value = l.value), await o(r);
|
|
820
817
|
}
|
|
821
818
|
function p() {
|
|
822
|
-
|
|
819
|
+
u(), s.value.error = "";
|
|
823
820
|
}
|
|
824
821
|
function v(r = "") {
|
|
825
|
-
l.value = r,
|
|
822
|
+
l.value = r, s.value.error = "", s.value.value = r;
|
|
826
823
|
}
|
|
827
824
|
function f() {
|
|
828
|
-
return
|
|
825
|
+
return s.value.error ? [s.value.error] : [];
|
|
829
826
|
}
|
|
830
827
|
return {
|
|
831
828
|
isValid: n,
|
|
@@ -834,13 +831,13 @@ function pe(t, u, l, e, a) {
|
|
|
834
831
|
onReset: v,
|
|
835
832
|
getErrors: f,
|
|
836
833
|
applyValidationState: o,
|
|
837
|
-
resetValidationState:
|
|
834
|
+
resetValidationState: u
|
|
838
835
|
};
|
|
839
836
|
}
|
|
840
|
-
function
|
|
841
|
-
const
|
|
837
|
+
function zt(t) {
|
|
838
|
+
const s = O(() => !!t.value.label), l = O(() => !!t.value.required), e = O(() => t.value.label || "");
|
|
842
839
|
return {
|
|
843
|
-
showLabel:
|
|
840
|
+
showLabel: s,
|
|
844
841
|
showRequired: l,
|
|
845
842
|
labelText: e
|
|
846
843
|
};
|
|
@@ -852,20 +849,20 @@ const ye = /* @__PURE__ */ q({
|
|
|
852
849
|
slotName: {}
|
|
853
850
|
},
|
|
854
851
|
setup(t) {
|
|
855
|
-
const
|
|
856
|
-
return (o,
|
|
852
|
+
const s = t, { showLabel: l, showRequired: e, labelText: a } = zt(Ae(s, "model"));
|
|
853
|
+
return (o, u) => i(l) ? (d(), _(i(ne), {
|
|
857
854
|
key: 0,
|
|
858
855
|
slot: o.slotName,
|
|
859
856
|
class: "input-label"
|
|
860
857
|
}, {
|
|
861
858
|
default: V(() => [
|
|
862
|
-
|
|
859
|
+
U(A(i(a)) + " ", 1),
|
|
863
860
|
i(e) ? (d(), _(i(Pe), {
|
|
864
861
|
key: 0,
|
|
865
862
|
color: "danger"
|
|
866
863
|
}, {
|
|
867
|
-
default: V(() =>
|
|
868
|
-
|
|
864
|
+
default: V(() => u[0] || (u[0] = [
|
|
865
|
+
U("*")
|
|
869
866
|
])),
|
|
870
867
|
_: 1,
|
|
871
868
|
__: [0]
|
|
@@ -884,32 +881,32 @@ const ye = /* @__PURE__ */ q({
|
|
|
884
881
|
modelModifiers: {}
|
|
885
882
|
}),
|
|
886
883
|
emits: ["update:modelValue"],
|
|
887
|
-
setup(t, { expose:
|
|
888
|
-
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value),
|
|
884
|
+
setup(t, { expose: s }) {
|
|
885
|
+
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value), u = O(() => l.schema), { isValid: n, onValueUpdate: g, onFocus: p, onReset: v, getErrors: f } = pe(
|
|
889
886
|
a,
|
|
890
887
|
e,
|
|
891
888
|
o,
|
|
892
|
-
|
|
889
|
+
u
|
|
893
890
|
), r = O(() => {
|
|
894
891
|
if (e.value.pattern) return et(e.value.pattern);
|
|
895
892
|
});
|
|
896
893
|
return N(
|
|
897
894
|
() => e.value.value,
|
|
898
895
|
(h) => o.value = h
|
|
899
|
-
),
|
|
896
|
+
), s({
|
|
900
897
|
onValueUpdate: g,
|
|
901
898
|
onReset: v,
|
|
902
899
|
getErrors: f,
|
|
903
900
|
isValid: n
|
|
904
901
|
}), (h, S) => {
|
|
905
902
|
var w;
|
|
906
|
-
const b =
|
|
907
|
-
return
|
|
903
|
+
const b = $e("maskito");
|
|
904
|
+
return Fe((d(), _(i(xe), {
|
|
908
905
|
ref_key: "inputRef",
|
|
909
906
|
ref: a,
|
|
910
907
|
modelValue: o.value,
|
|
911
908
|
"onUpdate:modelValue": S[0] || (S[0] = (R) => o.value = R),
|
|
912
|
-
class:
|
|
909
|
+
class: K(e.value.className),
|
|
913
910
|
"clear-input": !0,
|
|
914
911
|
fill: e.value.fill ?? "solid",
|
|
915
912
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
|
@@ -940,7 +937,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
940
937
|
slot: "start"
|
|
941
938
|
}, {
|
|
942
939
|
default: V(() => [
|
|
943
|
-
|
|
940
|
+
U(A(e.value.prefix), 1)
|
|
944
941
|
]),
|
|
945
942
|
_: 1
|
|
946
943
|
})) : x("", !0),
|
|
@@ -949,7 +946,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
949
946
|
slot: "end"
|
|
950
947
|
}, {
|
|
951
948
|
default: V(() => [
|
|
952
|
-
|
|
949
|
+
U(A(e.value.suffix), 1)
|
|
953
950
|
]),
|
|
954
951
|
_: 1
|
|
955
952
|
})) : x("", !0),
|
|
@@ -964,7 +961,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
964
961
|
]);
|
|
965
962
|
};
|
|
966
963
|
}
|
|
967
|
-
}),
|
|
964
|
+
}), Rt = /* @__PURE__ */ q({
|
|
968
965
|
__name: "TextInput",
|
|
969
966
|
props: /* @__PURE__ */ J({
|
|
970
967
|
schema: {}
|
|
@@ -973,9 +970,9 @@ const ye = /* @__PURE__ */ q({
|
|
|
973
970
|
modelModifiers: {}
|
|
974
971
|
}),
|
|
975
972
|
emits: ["update:modelValue"],
|
|
976
|
-
setup(t, { expose:
|
|
973
|
+
setup(t, { expose: s }) {
|
|
977
974
|
const l = Q(t, "modelValue"), e = I(null);
|
|
978
|
-
return
|
|
975
|
+
return s({
|
|
979
976
|
onReset: () => {
|
|
980
977
|
var a;
|
|
981
978
|
return (a = e.value) == null ? void 0 : a.onReset();
|
|
@@ -990,14 +987,14 @@ const ye = /* @__PURE__ */ q({
|
|
|
990
987
|
}
|
|
991
988
|
}), (a, o) => (d(), _(fe, {
|
|
992
989
|
modelValue: l.value,
|
|
993
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
990
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
|
|
994
991
|
type: "text",
|
|
995
992
|
schema: a.schema,
|
|
996
993
|
ref_key: "inputRef",
|
|
997
994
|
ref: e
|
|
998
995
|
}, null, 8, ["modelValue", "schema"]));
|
|
999
996
|
}
|
|
1000
|
-
}),
|
|
997
|
+
}), At = /* @__PURE__ */ q({
|
|
1001
998
|
__name: "DateInput",
|
|
1002
999
|
props: /* @__PURE__ */ J({
|
|
1003
1000
|
schema: {}
|
|
@@ -1006,9 +1003,9 @@ const ye = /* @__PURE__ */ q({
|
|
|
1006
1003
|
modelModifiers: {}
|
|
1007
1004
|
}),
|
|
1008
1005
|
emits: ["update:modelValue"],
|
|
1009
|
-
setup(t, { expose:
|
|
1006
|
+
setup(t, { expose: s }) {
|
|
1010
1007
|
const l = Q(t, "modelValue"), e = I(null);
|
|
1011
|
-
return
|
|
1008
|
+
return s({
|
|
1012
1009
|
onValueUpdate: () => {
|
|
1013
1010
|
var a;
|
|
1014
1011
|
return (a = e.value) == null ? void 0 : a.onValueUpdate();
|
|
@@ -1023,7 +1020,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1023
1020
|
}
|
|
1024
1021
|
}), (a, o) => (d(), _(fe, {
|
|
1025
1022
|
modelValue: l.value,
|
|
1026
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1023
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
|
|
1027
1024
|
type: l.value.enableTime ? "datetime-local" : "date",
|
|
1028
1025
|
schema: a.schema,
|
|
1029
1026
|
ref_key: "inputRef",
|
|
@@ -1039,9 +1036,9 @@ const ye = /* @__PURE__ */ q({
|
|
|
1039
1036
|
modelModifiers: {}
|
|
1040
1037
|
}),
|
|
1041
1038
|
emits: ["update:modelValue"],
|
|
1042
|
-
setup(t, { expose:
|
|
1039
|
+
setup(t, { expose: s }) {
|
|
1043
1040
|
const l = Q(t, "modelValue"), e = I(null);
|
|
1044
|
-
return
|
|
1041
|
+
return s({
|
|
1045
1042
|
onReset: () => {
|
|
1046
1043
|
var a;
|
|
1047
1044
|
return (a = e.value) == null ? void 0 : a.onReset();
|
|
@@ -1056,14 +1053,14 @@ const ye = /* @__PURE__ */ q({
|
|
|
1056
1053
|
}
|
|
1057
1054
|
}), (a, o) => (d(), _(fe, {
|
|
1058
1055
|
modelValue: l.value,
|
|
1059
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1056
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
|
|
1060
1057
|
type: "number",
|
|
1061
1058
|
schema: a.schema,
|
|
1062
1059
|
ref_key: "inputRef",
|
|
1063
1060
|
ref: e
|
|
1064
1061
|
}, null, 8, ["modelValue", "schema"]));
|
|
1065
1062
|
}
|
|
1066
|
-
}),
|
|
1063
|
+
}), Ft = /* @__PURE__ */ q({
|
|
1067
1064
|
__name: "EmailInput",
|
|
1068
1065
|
props: /* @__PURE__ */ J({
|
|
1069
1066
|
schema: {}
|
|
@@ -1072,9 +1069,9 @@ const ye = /* @__PURE__ */ q({
|
|
|
1072
1069
|
modelModifiers: {}
|
|
1073
1070
|
}),
|
|
1074
1071
|
emits: ["update:modelValue"],
|
|
1075
|
-
setup(t, { expose:
|
|
1072
|
+
setup(t, { expose: s }) {
|
|
1076
1073
|
const l = Q(t, "modelValue"), e = I(null);
|
|
1077
|
-
return
|
|
1074
|
+
return s({
|
|
1078
1075
|
onReset: () => {
|
|
1079
1076
|
var a;
|
|
1080
1077
|
return (a = e.value) == null ? void 0 : a.onReset();
|
|
@@ -1089,14 +1086,14 @@ const ye = /* @__PURE__ */ q({
|
|
|
1089
1086
|
}
|
|
1090
1087
|
}), (a, o) => (d(), _(fe, {
|
|
1091
1088
|
modelValue: l.value,
|
|
1092
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1089
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
|
|
1093
1090
|
type: "email",
|
|
1094
1091
|
schema: a.schema,
|
|
1095
1092
|
ref_key: "inputRef",
|
|
1096
1093
|
ref: e
|
|
1097
1094
|
}, null, 8, ["modelValue", "schema"]));
|
|
1098
1095
|
}
|
|
1099
|
-
}),
|
|
1096
|
+
}), Pt = /* @__PURE__ */ q({
|
|
1100
1097
|
__name: "PasswordInput",
|
|
1101
1098
|
props: /* @__PURE__ */ J({
|
|
1102
1099
|
schema: {}
|
|
@@ -1105,9 +1102,9 @@ const ye = /* @__PURE__ */ q({
|
|
|
1105
1102
|
modelModifiers: {}
|
|
1106
1103
|
}),
|
|
1107
1104
|
emits: ["update:modelValue"],
|
|
1108
|
-
setup(t, { expose:
|
|
1105
|
+
setup(t, { expose: s }) {
|
|
1109
1106
|
const l = Q(t, "modelValue"), e = I(null);
|
|
1110
|
-
return
|
|
1107
|
+
return s({
|
|
1111
1108
|
onReset: () => {
|
|
1112
1109
|
var a;
|
|
1113
1110
|
return (a = e.value) == null ? void 0 : a.onReset();
|
|
@@ -1122,14 +1119,14 @@ const ye = /* @__PURE__ */ q({
|
|
|
1122
1119
|
}
|
|
1123
1120
|
}), (a, o) => (d(), _(fe, {
|
|
1124
1121
|
modelValue: l.value,
|
|
1125
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1122
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
|
|
1126
1123
|
type: "password",
|
|
1127
1124
|
schema: a.schema,
|
|
1128
1125
|
ref_key: "inputRef",
|
|
1129
1126
|
ref: e
|
|
1130
1127
|
}, null, 8, ["modelValue", "schema"]));
|
|
1131
1128
|
}
|
|
1132
|
-
}),
|
|
1129
|
+
}), Bt = /* @__PURE__ */ q({
|
|
1133
1130
|
__name: "SelectInput",
|
|
1134
1131
|
props: /* @__PURE__ */ J({
|
|
1135
1132
|
schema: Object,
|
|
@@ -1140,15 +1137,15 @@ const ye = /* @__PURE__ */ q({
|
|
|
1140
1137
|
modelModifiers: {}
|
|
1141
1138
|
}),
|
|
1142
1139
|
emits: ["update:modelValue"],
|
|
1143
|
-
setup(t, { expose:
|
|
1144
|
-
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(null),
|
|
1140
|
+
setup(t, { expose: s }) {
|
|
1141
|
+
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(null), u = I(!1), n = I([]), g = I(""), p = I(1), v = O(() => e.value.interface ?? "popover"), f = O(() => e.value.optionsPlacement === "top" ? "top" : "bottom"), r = O(() => n.value.filter((m) => !!m.isChecked)), h = O(() => !g.value && Ce(r.value) && !u.value ? e.value.placeholder ?? "Select an option" : "");
|
|
1145
1142
|
N([g, () => e.value.options], M, {
|
|
1146
1143
|
immediate: !0,
|
|
1147
1144
|
deep: !0
|
|
1148
1145
|
}), N(() => e.value.value, C, { immediate: !0, deep: !0 }), N(
|
|
1149
1146
|
() => !e.value.dependsOn || !l.schema ? null : (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).map((y) => {
|
|
1150
1147
|
const k = l.schema[y];
|
|
1151
|
-
return
|
|
1148
|
+
return Z(k) ? k.value : void 0;
|
|
1152
1149
|
}),
|
|
1153
1150
|
async (m, y) => {
|
|
1154
1151
|
m && y && !de(m, y) && (S(), n.value = [], await M());
|
|
@@ -1176,17 +1173,17 @@ const ye = /* @__PURE__ */ q({
|
|
|
1176
1173
|
R();
|
|
1177
1174
|
break;
|
|
1178
1175
|
case "alert":
|
|
1179
|
-
|
|
1176
|
+
$();
|
|
1180
1177
|
break;
|
|
1181
1178
|
case "popover":
|
|
1182
1179
|
default:
|
|
1183
|
-
|
|
1180
|
+
u.value = !0;
|
|
1184
1181
|
break;
|
|
1185
1182
|
}
|
|
1186
1183
|
}
|
|
1187
1184
|
async function R() {
|
|
1188
1185
|
if (await M(), e.value.multiple) {
|
|
1189
|
-
|
|
1186
|
+
u.value = !0;
|
|
1190
1187
|
return;
|
|
1191
1188
|
}
|
|
1192
1189
|
await (await Te.create({
|
|
@@ -1204,7 +1201,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1204
1201
|
]
|
|
1205
1202
|
})).present();
|
|
1206
1203
|
}
|
|
1207
|
-
async function
|
|
1204
|
+
async function $() {
|
|
1208
1205
|
await M();
|
|
1209
1206
|
const m = n.value.map((k) => ({
|
|
1210
1207
|
label: k.label,
|
|
@@ -1239,7 +1236,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1239
1236
|
]
|
|
1240
1237
|
})).present();
|
|
1241
1238
|
}
|
|
1242
|
-
async function
|
|
1239
|
+
async function W() {
|
|
1243
1240
|
if (e.value.required && Ce(r.value))
|
|
1244
1241
|
return "This field is required";
|
|
1245
1242
|
if (e.value.validation) {
|
|
@@ -1254,17 +1251,17 @@ const ye = /* @__PURE__ */ q({
|
|
|
1254
1251
|
e,
|
|
1255
1252
|
O(() => e.value.multiple ? r.value : r.value[0]),
|
|
1256
1253
|
O(() => l == null ? void 0 : l.schema),
|
|
1257
|
-
|
|
1254
|
+
W
|
|
1258
1255
|
);
|
|
1259
1256
|
function ee(m) {
|
|
1260
1257
|
var y;
|
|
1261
|
-
m.target === ((y = a.value) == null ? void 0 : y.$el) && (te(), v.value === "popover" && (
|
|
1258
|
+
m.target === ((y = a.value) == null ? void 0 : y.$el) && (te(), v.value === "popover" && (u.value = !0));
|
|
1262
1259
|
}
|
|
1263
1260
|
async function j(m) {
|
|
1264
1261
|
var k;
|
|
1265
1262
|
if ((k = m == null ? void 0 : m.relatedTarget) != null && k.closest(".suggestions-list")) return;
|
|
1266
|
-
|
|
1267
|
-
const y = await
|
|
1263
|
+
u.value = !1;
|
|
1264
|
+
const y = await W();
|
|
1268
1265
|
y === !0 ? (e.value.error = "", e.value.value = e.value.multiple ? r.value : r.value[0]) : e.value.error = typeof y == "string" ? y : "Validation failed", await Y(y === !0);
|
|
1269
1266
|
}
|
|
1270
1267
|
async function M() {
|
|
@@ -1276,8 +1273,8 @@ const ye = /* @__PURE__ */ q({
|
|
|
1276
1273
|
let T = !0;
|
|
1277
1274
|
if (y = k.reduce(
|
|
1278
1275
|
(c, z) => {
|
|
1279
|
-
const
|
|
1280
|
-
return c[z] =
|
|
1276
|
+
const D = l.schema[z];
|
|
1277
|
+
return c[z] = Z(D) ? D.value : void 0, (c[z] === void 0 || c[z] === null || c[z] === "") && (T = !1), c;
|
|
1281
1278
|
},
|
|
1282
1279
|
{}
|
|
1283
1280
|
), T) {
|
|
@@ -1310,12 +1307,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1310
1307
|
}
|
|
1311
1308
|
return we(async () => {
|
|
1312
1309
|
await M(), await C();
|
|
1313
|
-
}),
|
|
1310
|
+
}), s({
|
|
1314
1311
|
onValueUpdate: j,
|
|
1315
1312
|
onReset: S,
|
|
1316
1313
|
getErrors: () => e.value.error ? [e.value.error] : []
|
|
1317
|
-
}), (m, y) => (d(),
|
|
1318
|
-
class:
|
|
1314
|
+
}), (m, y) => (d(), F("div", {
|
|
1315
|
+
class: K(["autocomplete-container", e.value.className]),
|
|
1319
1316
|
onFocusout: j,
|
|
1320
1317
|
ref_key: "containerRef",
|
|
1321
1318
|
ref: o
|
|
@@ -1350,11 +1347,11 @@ const ye = /* @__PURE__ */ q({
|
|
|
1350
1347
|
slot: "start"
|
|
1351
1348
|
}, {
|
|
1352
1349
|
default: V(() => [
|
|
1353
|
-
(d(!0),
|
|
1350
|
+
(d(!0), F(L, null, X(r.value, (k, T) => (d(), _(i(Ue), { key: T }, {
|
|
1354
1351
|
default: V(() => [
|
|
1355
1352
|
P(i(ne), null, {
|
|
1356
1353
|
default: V(() => [
|
|
1357
|
-
|
|
1354
|
+
U(A(k.label), 1)
|
|
1358
1355
|
]),
|
|
1359
1356
|
_: 2
|
|
1360
1357
|
}, 1024)
|
|
@@ -1371,7 +1368,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1371
1368
|
default: V(() => {
|
|
1372
1369
|
var k;
|
|
1373
1370
|
return [
|
|
1374
|
-
|
|
1371
|
+
U(A(((k = r.value[0]) == null ? void 0 : k.label) ?? ""), 1)
|
|
1375
1372
|
];
|
|
1376
1373
|
}),
|
|
1377
1374
|
_: 1
|
|
@@ -1390,12 +1387,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1390
1387
|
]),
|
|
1391
1388
|
_: 1
|
|
1392
1389
|
}, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter"]),
|
|
1393
|
-
|
|
1390
|
+
u.value && n.value.length > 0 && v.value === "popover" ? (d(), _(i(De), {
|
|
1394
1391
|
key: 0,
|
|
1395
|
-
class:
|
|
1392
|
+
class: K(["suggestions-list", f.value])
|
|
1396
1393
|
}, {
|
|
1397
1394
|
default: V(() => [
|
|
1398
|
-
(d(!0),
|
|
1395
|
+
(d(!0), F(L, null, X(n.value, (k) => (d(), _(i(Ve), {
|
|
1399
1396
|
button: "",
|
|
1400
1397
|
key: k.label,
|
|
1401
1398
|
onClick: (T) => b(k),
|
|
@@ -1409,7 +1406,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1409
1406
|
}, null, 8, ["checked"])) : x("", !0),
|
|
1410
1407
|
P(i(ne), null, {
|
|
1411
1408
|
default: V(() => [
|
|
1412
|
-
|
|
1409
|
+
U(A(k.label), 1)
|
|
1413
1410
|
]),
|
|
1414
1411
|
_: 2
|
|
1415
1412
|
}, 1024)
|
|
@@ -1421,7 +1418,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1421
1418
|
}, 8, ["class"])) : x("", !0)
|
|
1422
1419
|
], 34));
|
|
1423
1420
|
}
|
|
1424
|
-
}),
|
|
1421
|
+
}), Ut = /* @__PURE__ */ ve(Bt, [["__scopeId", "data-v-9525dee8"]]), Dt = /* @__PURE__ */ q({
|
|
1425
1422
|
__name: "TextAreaInput",
|
|
1426
1423
|
props: /* @__PURE__ */ J({
|
|
1427
1424
|
schema: {}
|
|
@@ -1430,17 +1427,17 @@ const ye = /* @__PURE__ */ q({
|
|
|
1430
1427
|
modelModifiers: {}
|
|
1431
1428
|
}),
|
|
1432
1429
|
emits: ["update:modelValue"],
|
|
1433
|
-
setup(t, { expose:
|
|
1434
|
-
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value),
|
|
1430
|
+
setup(t, { expose: s }) {
|
|
1431
|
+
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value), u = O(() => l.schema), { onValueUpdate: n, onFocus: g, onReset: p, getErrors: v } = pe(
|
|
1435
1432
|
a,
|
|
1436
1433
|
e,
|
|
1437
1434
|
o,
|
|
1438
|
-
|
|
1435
|
+
u
|
|
1439
1436
|
);
|
|
1440
1437
|
return N(
|
|
1441
1438
|
() => e.value.value,
|
|
1442
1439
|
(f) => o.value = f
|
|
1443
|
-
),
|
|
1440
|
+
), s({
|
|
1444
1441
|
onReset: p,
|
|
1445
1442
|
onValueUpdate: n,
|
|
1446
1443
|
getErrors: v
|
|
@@ -1449,7 +1446,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1449
1446
|
ref: a,
|
|
1450
1447
|
modelValue: o.value,
|
|
1451
1448
|
"onUpdate:modelValue": r[0] || (r[0] = (h) => o.value = h),
|
|
1452
|
-
class:
|
|
1449
|
+
class: K(e.value.className),
|
|
1453
1450
|
"clear-input": !0,
|
|
1454
1451
|
fill: e.value.fill ?? "solid",
|
|
1455
1452
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
|
@@ -1481,7 +1478,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1481
1478
|
_: 1
|
|
1482
1479
|
}, 8, ["modelValue", "class", "fill", "label-placement", "required", "error-text", "autofocus", "placeholder", "disabled", "counter", "min", "max", "rows", "cols", "auto-grow", "max-length", "min-length", "pattern", "onIonFocus", "onIonChange", "onIonBlur"]));
|
|
1483
1480
|
}
|
|
1484
|
-
}),
|
|
1481
|
+
}), Tt = { class: "button-container" }, Nt = /* @__PURE__ */ q({
|
|
1485
1482
|
__name: "RepeatInput",
|
|
1486
1483
|
props: /* @__PURE__ */ J({
|
|
1487
1484
|
schema: {},
|
|
@@ -1492,12 +1489,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1492
1489
|
modelModifiers: {}
|
|
1493
1490
|
}),
|
|
1494
1491
|
emits: ["update:modelValue"],
|
|
1495
|
-
setup(t, { expose:
|
|
1496
|
-
const l = Q(t, "modelValue"), e = I([]), { dynamicRefs: a, resetForm: o, getFormErrors:
|
|
1492
|
+
setup(t, { expose: s }) {
|
|
1493
|
+
const l = Q(t, "modelValue"), e = I([]), { dynamicRefs: a, resetForm: o, getFormErrors: u, updateFormValues: n } = ze(), g = O(() => e.value.map((S, b) => ({
|
|
1497
1494
|
label: `Set ${b + 1}`,
|
|
1498
1495
|
value: b,
|
|
1499
1496
|
other: Object.entries(S).reduce(
|
|
1500
|
-
(w, [R,
|
|
1497
|
+
(w, [R, $]) => (Z($) && (w[R] = $.value), w),
|
|
1501
1498
|
{}
|
|
1502
1499
|
)
|
|
1503
1500
|
})));
|
|
@@ -1518,17 +1515,17 @@ const ye = /* @__PURE__ */ q({
|
|
|
1518
1515
|
o();
|
|
1519
1516
|
}
|
|
1520
1517
|
function r() {
|
|
1521
|
-
return
|
|
1518
|
+
return u();
|
|
1522
1519
|
}
|
|
1523
1520
|
async function h() {
|
|
1524
1521
|
await n();
|
|
1525
1522
|
}
|
|
1526
|
-
return
|
|
1523
|
+
return s({
|
|
1527
1524
|
onValueUpdate: h,
|
|
1528
1525
|
onReset: f,
|
|
1529
1526
|
getErrors: r
|
|
1530
|
-
}), (S, b) => (d(!0),
|
|
1531
|
-
class:
|
|
1527
|
+
}), (S, b) => (d(!0), F(L, null, X(e.value, (w, R) => (d(), F("div", {
|
|
1528
|
+
class: K(["repeat-input-wrapper", l.value.className]),
|
|
1532
1529
|
key: R
|
|
1533
1530
|
}, [
|
|
1534
1531
|
P(i(oe), { class: "repeat-row" }, {
|
|
@@ -1540,24 +1537,24 @@ const ye = /* @__PURE__ */ q({
|
|
|
1540
1537
|
default: V(() => [
|
|
1541
1538
|
P(i(oe), { class: "fields-row" }, {
|
|
1542
1539
|
default: V(() => [
|
|
1543
|
-
(d(!0),
|
|
1544
|
-
var
|
|
1545
|
-
return d(),
|
|
1546
|
-
i(ke)(w[
|
|
1547
|
-
key: `${R}-${
|
|
1548
|
-
size: ((
|
|
1549
|
-
"size-sm": (te = w[
|
|
1550
|
-
"size-md": (Y = w[
|
|
1551
|
-
"size-lg": (ee = w[
|
|
1552
|
-
"size-xl": (j = w[
|
|
1540
|
+
(d(!0), F(L, null, X(Object.keys(w), ($) => {
|
|
1541
|
+
var W, te, Y, ee, j;
|
|
1542
|
+
return d(), F(L, null, [
|
|
1543
|
+
i(ke)(w[$], S.data, S.computedData) ? (d(), _(i(ae), {
|
|
1544
|
+
key: `${R}-${$}`,
|
|
1545
|
+
size: ((W = w[$].grid) == null ? void 0 : W.xs) ?? "12",
|
|
1546
|
+
"size-sm": (te = w[$].grid) == null ? void 0 : te.sm,
|
|
1547
|
+
"size-md": (Y = w[$].grid) == null ? void 0 : Y.md,
|
|
1548
|
+
"size-lg": (ee = w[$].grid) == null ? void 0 : ee.lg,
|
|
1549
|
+
"size-xl": (j = w[$].grid) == null ? void 0 : j.xl,
|
|
1553
1550
|
class: "ion-margin-bottom"
|
|
1554
1551
|
}, {
|
|
1555
1552
|
default: V(() => [
|
|
1556
|
-
(d(), _(he(w[
|
|
1557
|
-
modelValue: w[
|
|
1558
|
-
"onUpdate:modelValue": (M) => w[
|
|
1553
|
+
(d(), _(he(w[$].type), {
|
|
1554
|
+
modelValue: w[$],
|
|
1555
|
+
"onUpdate:modelValue": (M) => w[$] = M,
|
|
1559
1556
|
schema: w,
|
|
1560
|
-
"ref-key": `${R}-${
|
|
1557
|
+
"ref-key": `${R}-${$}`,
|
|
1561
1558
|
ref_for: !0,
|
|
1562
1559
|
ref_key: "dynamicRefs",
|
|
1563
1560
|
ref: a,
|
|
@@ -1579,7 +1576,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1579
1576
|
class: "button-column"
|
|
1580
1577
|
}, {
|
|
1581
1578
|
default: V(() => [
|
|
1582
|
-
B("div",
|
|
1579
|
+
B("div", Tt, [
|
|
1583
1580
|
R === e.value.length - 1 ? (d(), _(i(H), {
|
|
1584
1581
|
key: 0,
|
|
1585
1582
|
onClick: p,
|
|
@@ -1596,7 +1593,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1596
1593
|
})) : x("", !0),
|
|
1597
1594
|
e.value.length > 1 ? (d(), _(i(H), {
|
|
1598
1595
|
key: 1,
|
|
1599
|
-
onClick: (
|
|
1596
|
+
onClick: ($) => v(R),
|
|
1600
1597
|
color: "warning",
|
|
1601
1598
|
size: "small"
|
|
1602
1599
|
}, {
|
|
@@ -1617,7 +1614,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1617
1614
|
}, 1024)
|
|
1618
1615
|
], 2))), 128));
|
|
1619
1616
|
}
|
|
1620
|
-
}),
|
|
1617
|
+
}), qt = /* @__PURE__ */ ve(Nt, [["__scopeId", "data-v-0eb7594d"]]), Lt = /* @__PURE__ */ q({
|
|
1621
1618
|
__name: "CheckboxInput",
|
|
1622
1619
|
props: /* @__PURE__ */ J({
|
|
1623
1620
|
schema: {}
|
|
@@ -1626,15 +1623,15 @@ const ye = /* @__PURE__ */ q({
|
|
|
1626
1623
|
modelModifiers: {}
|
|
1627
1624
|
}),
|
|
1628
1625
|
emits: ["update:modelValue"],
|
|
1629
|
-
setup(t, { expose:
|
|
1630
|
-
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value),
|
|
1626
|
+
setup(t, { expose: s }) {
|
|
1627
|
+
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value), u = O(() => l.schema), n = O(() => nt(e.value)), { onValueUpdate: g, onFocus: p, getErrors: v } = pe(a, e, o, u);
|
|
1631
1628
|
function f() {
|
|
1632
1629
|
o.value = !1, e.value.error = "", e.value.value = !1;
|
|
1633
1630
|
}
|
|
1634
1631
|
return N(
|
|
1635
1632
|
() => e.value.value,
|
|
1636
1633
|
(r) => o.value = r
|
|
1637
|
-
),
|
|
1634
|
+
), s({
|
|
1638
1635
|
onValueUpdate: g,
|
|
1639
1636
|
onReset: f,
|
|
1640
1637
|
getErrors: v
|
|
@@ -1644,7 +1641,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1644
1641
|
ref_key: "inputRef",
|
|
1645
1642
|
ref: a,
|
|
1646
1643
|
justify: "start",
|
|
1647
|
-
class:
|
|
1644
|
+
class: K(e.value.className),
|
|
1648
1645
|
required: e.value.required,
|
|
1649
1646
|
"error-text": e.value.error,
|
|
1650
1647
|
disabled: e.value.disabled,
|
|
@@ -1654,12 +1651,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1654
1651
|
style: { width: "100%" }
|
|
1655
1652
|
}, {
|
|
1656
1653
|
default: V(() => [
|
|
1657
|
-
|
|
1654
|
+
U(A(n.value), 1)
|
|
1658
1655
|
]),
|
|
1659
1656
|
_: 1
|
|
1660
1657
|
}, 8, ["modelValue", "class", "required", "error-text", "disabled", "onIonFocus", "onIonChange", "onIonBlur"]));
|
|
1661
1658
|
}
|
|
1662
|
-
}),
|
|
1659
|
+
}), Mt = /* @__PURE__ */ q({
|
|
1663
1660
|
__name: "RadioInput",
|
|
1664
1661
|
props: /* @__PURE__ */ J({
|
|
1665
1662
|
schema: {}
|
|
@@ -1668,12 +1665,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1668
1665
|
modelModifiers: {}
|
|
1669
1666
|
}),
|
|
1670
1667
|
emits: ["update:modelValue"],
|
|
1671
|
-
setup(t, { expose:
|
|
1672
|
-
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value),
|
|
1668
|
+
setup(t, { expose: s }) {
|
|
1669
|
+
const l = t, e = Q(t, "modelValue"), a = I(null), o = I(e.value.value), u = O(() => l.schema), n = I([]), { onValueUpdate: g, onFocus: p, getErrors: v, isValid: f } = pe(
|
|
1673
1670
|
a,
|
|
1674
1671
|
e,
|
|
1675
1672
|
o,
|
|
1676
|
-
|
|
1673
|
+
u
|
|
1677
1674
|
);
|
|
1678
1675
|
function r() {
|
|
1679
1676
|
e.value.error = "", o.value = void 0, e.value.value = void 0;
|
|
@@ -1687,12 +1684,12 @@ const ye = /* @__PURE__ */ q({
|
|
|
1687
1684
|
return N(
|
|
1688
1685
|
() => e.value.value,
|
|
1689
1686
|
(b) => o.value = b
|
|
1690
|
-
),
|
|
1687
|
+
), s({
|
|
1691
1688
|
onValueUpdate: g,
|
|
1692
1689
|
onReset: r,
|
|
1693
1690
|
getErrors: v,
|
|
1694
1691
|
isValid: f
|
|
1695
|
-
}), we(S), (b, w) => (d(),
|
|
1692
|
+
}), we(S), (b, w) => (d(), F(L, null, [
|
|
1696
1693
|
P(ye, { model: e.value }, null, 8, ["model"]),
|
|
1697
1694
|
w[1] || (w[1] = B("br", null, null, -1)),
|
|
1698
1695
|
e.value.error ? (d(), _(i(Le), {
|
|
@@ -1700,7 +1697,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1700
1697
|
color: "danger"
|
|
1701
1698
|
}, {
|
|
1702
1699
|
default: V(() => [
|
|
1703
|
-
|
|
1700
|
+
U(A(e.value.error), 1)
|
|
1704
1701
|
]),
|
|
1705
1702
|
_: 1
|
|
1706
1703
|
})) : x("", !0),
|
|
@@ -1709,7 +1706,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1709
1706
|
P(i(Me), {
|
|
1710
1707
|
modelValue: o.value,
|
|
1711
1708
|
"onUpdate:modelValue": w[0] || (w[0] = (R) => o.value = R),
|
|
1712
|
-
class:
|
|
1709
|
+
class: K(e.value.className),
|
|
1713
1710
|
required: e.value.required,
|
|
1714
1711
|
disabled: e.value.disabled,
|
|
1715
1712
|
compareWith: h,
|
|
@@ -1720,7 +1717,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1720
1717
|
style: { width: "100%" }
|
|
1721
1718
|
}, {
|
|
1722
1719
|
default: V(() => [
|
|
1723
|
-
(d(!0),
|
|
1720
|
+
(d(!0), F(L, null, X(n.value, (R) => (d(), _(i(Ve), {
|
|
1724
1721
|
key: R.value,
|
|
1725
1722
|
lines: e.value.showOptionsSeparator ? "none" : "full"
|
|
1726
1723
|
}, {
|
|
@@ -1732,7 +1729,7 @@ const ye = /* @__PURE__ */ q({
|
|
|
1732
1729
|
justify: "start"
|
|
1733
1730
|
}, {
|
|
1734
1731
|
default: V(() => [
|
|
1735
|
-
|
|
1732
|
+
U(A(R.label), 1)
|
|
1736
1733
|
]),
|
|
1737
1734
|
_: 2
|
|
1738
1735
|
}, 1032, ["value", "disabled"])
|
|
@@ -1747,10 +1744,10 @@ const ye = /* @__PURE__ */ q({
|
|
|
1747
1744
|
})
|
|
1748
1745
|
], 64));
|
|
1749
1746
|
}
|
|
1750
|
-
}),
|
|
1747
|
+
}), jt = { class: "form-section-header" }, Gt = { class: "form-section-title" }, Ht = {
|
|
1751
1748
|
key: 0,
|
|
1752
1749
|
class: "form-section-subtitle"
|
|
1753
|
-
},
|
|
1750
|
+
}, Kt = /* @__PURE__ */ q({
|
|
1754
1751
|
__name: "SectionTitle",
|
|
1755
1752
|
props: {
|
|
1756
1753
|
modelValue: {},
|
|
@@ -1761,27 +1758,27 @@ const ye = /* @__PURE__ */ q({
|
|
|
1761
1758
|
setup(t) {
|
|
1762
1759
|
const l = t.modelValue;
|
|
1763
1760
|
return (e, a) => {
|
|
1764
|
-
var o,
|
|
1761
|
+
var o, u, n, g, p;
|
|
1765
1762
|
return d(), _(i(ae), {
|
|
1766
1763
|
size: ((o = i(l).grid) == null ? void 0 : o.xs) ?? "12",
|
|
1767
|
-
"size-sm": (
|
|
1764
|
+
"size-sm": (u = i(l).grid) == null ? void 0 : u.sm,
|
|
1768
1765
|
"size-md": (n = i(l).grid) == null ? void 0 : n.md,
|
|
1769
1766
|
"size-lg": (g = i(l).grid) == null ? void 0 : g.lg,
|
|
1770
1767
|
"size-xl": (p = i(l).grid) == null ? void 0 : p.xl,
|
|
1771
|
-
class:
|
|
1768
|
+
class: K(["form-section-container", i(l).className])
|
|
1772
1769
|
}, {
|
|
1773
1770
|
default: V(() => [
|
|
1774
|
-
B("div",
|
|
1775
|
-
B("h3",
|
|
1776
|
-
i(l).subtitle ? (d(),
|
|
1771
|
+
B("div", jt, [
|
|
1772
|
+
B("h3", Gt, A(i(l).title), 1),
|
|
1773
|
+
i(l).subtitle ? (d(), F("p", Ht, A(i(l).subtitle), 1)) : x("", !0)
|
|
1777
1774
|
])
|
|
1778
1775
|
]),
|
|
1779
1776
|
_: 1
|
|
1780
1777
|
}, 8, ["size", "size-sm", "size-md", "size-lg", "size-xl", "class"]);
|
|
1781
1778
|
};
|
|
1782
1779
|
}
|
|
1783
|
-
}),
|
|
1784
|
-
function
|
|
1780
|
+
}), Wt = /* @__PURE__ */ ve(Kt, [["__scopeId", "data-v-e0bf7af0"]]);
|
|
1781
|
+
function Yt(t, s, l) {
|
|
1785
1782
|
const e = I({}), a = I({});
|
|
1786
1783
|
function o(v, f, r) {
|
|
1787
1784
|
a.value[v] = r, f.forEach((h) => {
|
|
@@ -1789,9 +1786,9 @@ function el(t, u, l) {
|
|
|
1789
1786
|
(S = e.value)[h] ?? (S[h] = []), e.value[h].includes(v) || e.value[h].push(v);
|
|
1790
1787
|
}), p(v);
|
|
1791
1788
|
}
|
|
1792
|
-
function
|
|
1789
|
+
function u(v) {
|
|
1793
1790
|
return Object.entries(e.value).filter(([, r]) => r.includes(v)).map(([r]) => r).reduce(
|
|
1794
|
-
(r, h) => (r[h] =
|
|
1791
|
+
(r, h) => (r[h] = s.value[h] ?? l.value[h], r),
|
|
1795
1792
|
{}
|
|
1796
1793
|
);
|
|
1797
1794
|
}
|
|
@@ -1803,7 +1800,7 @@ function el(t, u, l) {
|
|
|
1803
1800
|
}
|
|
1804
1801
|
async function p(v, f) {
|
|
1805
1802
|
if (!a.value[v]) return;
|
|
1806
|
-
const r =
|
|
1803
|
+
const r = u(v), h = Object.keys(r);
|
|
1807
1804
|
if (!(h.length === 0 || !h.every(
|
|
1808
1805
|
(b) => r[b] !== void 0 && r[b] !== null
|
|
1809
1806
|
)))
|
|
@@ -1811,20 +1808,20 @@ function el(t, u, l) {
|
|
|
1811
1808
|
const b = a.value[v], w = await b(f, r);
|
|
1812
1809
|
if (!t.value[v]) return;
|
|
1813
1810
|
const R = t.value[v];
|
|
1814
|
-
if (!
|
|
1811
|
+
if (!Z(R)) return;
|
|
1815
1812
|
R.options = w;
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1818
|
-
n(
|
|
1813
|
+
const $ = R.value;
|
|
1814
|
+
if (!$) return;
|
|
1815
|
+
n($, w) || (R.value = R.multiple ? [] : "");
|
|
1819
1816
|
} catch (b) {
|
|
1820
1817
|
console.error(`Error loading options for ${v}:`, b);
|
|
1821
1818
|
}
|
|
1822
1819
|
}
|
|
1823
1820
|
return N(
|
|
1824
|
-
[
|
|
1821
|
+
[s, l],
|
|
1825
1822
|
() => {
|
|
1826
1823
|
Object.entries(e.value).forEach(([v, f]) => {
|
|
1827
|
-
(
|
|
1824
|
+
(s.value[v] !== void 0 || l.value[v] !== void 0) && f.forEach((r) => {
|
|
1828
1825
|
p(r);
|
|
1829
1826
|
});
|
|
1830
1827
|
});
|
|
@@ -1835,28 +1832,28 @@ function el(t, u, l) {
|
|
|
1835
1832
|
updateOptions: p
|
|
1836
1833
|
};
|
|
1837
1834
|
}
|
|
1838
|
-
const
|
|
1835
|
+
const el = {
|
|
1839
1836
|
install(t) {
|
|
1840
|
-
t.component("VForm",
|
|
1837
|
+
t.component("VForm", xt), t.component("TextInput", Rt), t.component("DateInput", At), t.component("NumberInput", $t), t.component("EmailInput", Ft), t.component("PasswordInput", Pt), t.component("SelectInput", Ut), t.component("TextAreaInput", Dt), t.component("RepeatInput", qt), t.component("CheckboxInput", Lt), t.component("RadioInput", Mt), t.component("FormSection", Wt), t.directive("maskito", Ze);
|
|
1841
1838
|
}
|
|
1842
1839
|
};
|
|
1843
1840
|
export {
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1841
|
+
Lt as CheckboxInput,
|
|
1842
|
+
At as DateInput,
|
|
1843
|
+
Ft as EmailInput,
|
|
1844
|
+
xt as FormBuilder,
|
|
1845
|
+
Wt as FormSection,
|
|
1849
1846
|
$t as NumberInput,
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1847
|
+
Pt as PasswordInput,
|
|
1848
|
+
Mt as RadioInput,
|
|
1849
|
+
qt as RepeatInput,
|
|
1850
|
+
Ut as SelectInput,
|
|
1851
|
+
Dt as TextAreaInput,
|
|
1852
|
+
Rt as TextInput,
|
|
1853
|
+
el as VForm,
|
|
1854
|
+
el as default,
|
|
1855
|
+
ot as useDataTransformation,
|
|
1856
|
+
Yt as useDependentOptions,
|
|
1860
1857
|
ze as useFormValidation,
|
|
1861
1858
|
pe as useInputValidation,
|
|
1862
1859
|
st as useMultiStepForm
|