@uniquedj95/vform 3.3.0 → 3.4.0
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 +240 -39
- package/dist/components/shared/StepIndicator.vue.d.ts +18 -0
- package/dist/components/shared/StepIndicator.vue.d.ts.map +1 -0
- package/dist/components/vForm.vue.d.ts +21 -7
- package/dist/components/vForm.vue.d.ts.map +1 -1
- package/dist/composables/useMultiStepForm.d.ts +27 -0
- package/dist/composables/useMultiStepForm.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1023 -618
- 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/types/index.d.ts +89 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/vform.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -1,202 +1,202 @@
|
|
1
|
-
import { ref as
|
2
|
-
import { IonGrid as Ce, IonRow as
|
3
|
-
import { chevronDown as
|
4
|
-
import { maskito as
|
5
|
-
function
|
6
|
-
return new Promise((
|
1
|
+
import { ref as E, computed as S, watch as I, defineComponent as U, createElementBlock as $, openBlock as f, normalizeClass as ne, createElementVNode as B, createCommentVNode as O, Fragment as T, renderList as K, toDisplayString as A, normalizeStyle as ve, createBlock as V, createVNode as P, unref as d, withCtx as b, resolveDynamicComponent as fe, createTextVNode as z, toRef as Oe, mergeModels as N, useModel as G, resolveDirective as Ee, withDirectives as xe, onMounted as ge } from "vue";
|
2
|
+
import { IonGrid as Ce, IonRow as le, IonCol as ae, IonButton as j, IonLabel as Y, IonText as Re, IonInput as Ve, IonInputPasswordToggle as Ae, IonChip as $e, IonIcon as ce, IonList as Fe, IonItem as ze, IonCheckbox as be, actionSheetController as Be, alertController as Pe, IonTextarea as Ie, IonRadioGroup as Ue, IonRadio as De } from "@ionic/vue";
|
3
|
+
import { chevronDown as Te, close as qe, add as Le, remove as Me } from "ionicons/icons";
|
4
|
+
import { maskito as je } from "@maskito/vue";
|
5
|
+
function Ne(t) {
|
6
|
+
return new Promise((o) => {
|
7
7
|
requestAnimationFrame(async () => {
|
8
8
|
const n = await t.getInputElement();
|
9
|
-
|
9
|
+
o(n);
|
10
10
|
});
|
11
11
|
});
|
12
12
|
}
|
13
|
-
const
|
13
|
+
const Ge = {
|
14
14
|
d: /\d/,
|
15
15
|
a: /[A-Za-z]/,
|
16
16
|
"*": /[A-Za-z0-9]/
|
17
17
|
// Default: alphanum, can customize if needed
|
18
|
-
},
|
18
|
+
}, He = {
|
19
19
|
d: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
|
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
|
24
|
-
const n =
|
25
|
-
return n[
|
23
|
+
function Ke(t, o) {
|
24
|
+
const n = He[t];
|
25
|
+
return n[o % n.length];
|
26
26
|
}
|
27
|
-
function
|
28
|
-
const
|
27
|
+
function We(t) {
|
28
|
+
const o = [];
|
29
29
|
let n = "", e = 0, l = 0;
|
30
30
|
for (; e < t.length; ) {
|
31
|
-
const
|
32
|
-
if (["d", "a", "*"].includes(
|
33
|
-
let
|
31
|
+
const u = t[e];
|
32
|
+
if (["d", "a", "*"].includes(u)) {
|
33
|
+
let r = 1;
|
34
34
|
if (t[e + 1] === "{") {
|
35
35
|
const s = t.indexOf("}", e + 2);
|
36
36
|
if (s !== -1) {
|
37
|
-
const
|
38
|
-
if (
|
39
|
-
const [,
|
40
|
-
|
37
|
+
const y = t.slice(e + 2, s);
|
38
|
+
if (y.includes(",")) {
|
39
|
+
const [, p] = y.split(",").map((c) => parseInt(c.trim()));
|
40
|
+
r = p || parseInt(y.split(",")[0]);
|
41
41
|
} else
|
42
|
-
|
42
|
+
r = parseInt(y);
|
43
43
|
e = s;
|
44
44
|
}
|
45
45
|
} else {
|
46
46
|
let s = e + 1;
|
47
|
-
for (; t[s] ===
|
48
|
-
|
47
|
+
for (; t[s] === u; )
|
48
|
+
r++, s++;
|
49
49
|
e = s - 1;
|
50
50
|
}
|
51
|
-
for (let s = 0; s <
|
52
|
-
|
51
|
+
for (let s = 0; s < r; s++)
|
52
|
+
o.push(Ge[u]), n += Ke(u, l++);
|
53
53
|
} else
|
54
|
-
|
54
|
+
o.push(u), n += u;
|
55
55
|
e++;
|
56
56
|
}
|
57
57
|
return {
|
58
|
-
mask:
|
58
|
+
mask: o,
|
59
59
|
placeholder: n,
|
60
|
-
elementPredicate:
|
60
|
+
elementPredicate: Ne
|
61
61
|
};
|
62
62
|
}
|
63
|
-
function
|
63
|
+
function me(t) {
|
64
64
|
return t == null || Array.isArray(t) && !t.length || typeof t == "object" && !Object.keys(t).length || !t;
|
65
65
|
}
|
66
|
-
function
|
67
|
-
return typeof t.condition == "function" ? t.condition(
|
66
|
+
function ie(t, o, n) {
|
67
|
+
return typeof t.condition == "function" ? t.condition(o, n) : !0;
|
68
68
|
}
|
69
|
-
function
|
69
|
+
function he(t) {
|
70
70
|
if (typeof t != "object" || t === null)
|
71
71
|
return t;
|
72
72
|
if (Array.isArray(t))
|
73
|
-
return t.map((n) =>
|
74
|
-
const
|
73
|
+
return t.map((n) => he(n));
|
74
|
+
const o = {};
|
75
75
|
return Object.entries(t).forEach(([n, e]) => {
|
76
|
-
typeof e == "function" ?
|
77
|
-
}),
|
76
|
+
typeof e == "function" ? o[n] = e.bind(o) : o[n] = he(e);
|
77
|
+
}), o;
|
78
78
|
}
|
79
|
-
function
|
80
|
-
return
|
79
|
+
function ke(t, o) {
|
80
|
+
return o.findIndex((n) => n.value === t.value || n.label === t.label || n.value === t.label || n.label === t.value);
|
81
81
|
}
|
82
|
-
function
|
83
|
-
const n =
|
84
|
-
n >= 0 ?
|
82
|
+
function X(t, o) {
|
83
|
+
const n = ke(t, o);
|
84
|
+
n >= 0 ? o[n].isChecked = !0 : o.push({ ...t, isChecked: !0 });
|
85
85
|
}
|
86
|
-
function
|
87
|
-
const n =
|
88
|
-
n >= 0 && (
|
86
|
+
function _e(t, o) {
|
87
|
+
const n = ke(t, o);
|
88
|
+
n >= 0 && (o[n].isChecked = !1);
|
89
89
|
}
|
90
|
-
function
|
91
|
-
t.forEach((
|
92
|
-
|
90
|
+
function Ze(t) {
|
91
|
+
t.forEach((o) => {
|
92
|
+
o.isChecked = !1;
|
93
93
|
});
|
94
94
|
}
|
95
|
-
function
|
96
|
-
return
|
97
|
-
(n) => JSON.stringify(n).toLowerCase().includes(
|
95
|
+
function Je(t, o) {
|
96
|
+
return o ? t.filter(
|
97
|
+
(n) => JSON.stringify(n).toLowerCase().includes(o.toLowerCase())
|
98
98
|
) : t;
|
99
99
|
}
|
100
|
-
function
|
101
|
-
const
|
102
|
-
return
|
100
|
+
function Se(t) {
|
101
|
+
const o = t.label || "", n = t.required ? " *" : "";
|
102
|
+
return o + n;
|
103
103
|
}
|
104
|
-
function
|
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 n = Object.keys(t), e = Object.keys(
|
104
|
+
function oe(t, o) {
|
105
|
+
if (t === o) return !0;
|
106
|
+
if (t == null || o == null || typeof t != typeof o) return !1;
|
107
|
+
if (typeof t != "object") return t === o;
|
108
|
+
if (Array.isArray(t) && Array.isArray(o))
|
109
|
+
return t.length !== o.length ? !1 : t.every((l, u) => oe(l, o[u]));
|
110
|
+
if (Array.isArray(t) !== Array.isArray(o)) return !1;
|
111
|
+
const n = Object.keys(t), e = Object.keys(o);
|
112
112
|
return n.length !== e.length ? !1 : n.every(
|
113
|
-
(l) => Object.prototype.hasOwnProperty.call(
|
113
|
+
(l) => Object.prototype.hasOwnProperty.call(o, l) && oe(t[l], o[l])
|
114
114
|
);
|
115
115
|
}
|
116
|
-
function
|
117
|
-
const t =
|
118
|
-
async function
|
116
|
+
function we() {
|
117
|
+
const t = E([]);
|
118
|
+
async function o() {
|
119
119
|
console.debug("Validating form inputs");
|
120
|
-
const
|
121
|
-
for (const
|
122
|
-
if (typeof (
|
120
|
+
const u = [];
|
121
|
+
for (const r of t.value)
|
122
|
+
if (typeof (r == null ? void 0 : r.onValueUpdate) == "function" && await r.onValueUpdate(), typeof (r == null ? void 0 : r.getErrors) == "function")
|
123
123
|
try {
|
124
|
-
const s =
|
125
|
-
Array.isArray(s) ?
|
124
|
+
const s = r.getErrors();
|
125
|
+
Array.isArray(s) ? u.push(...s) : console.warn("getErrors() returned non-array value:", s);
|
126
126
|
} catch (s) {
|
127
|
-
console.error("Error calling getErrors on component:", s,
|
127
|
+
console.error("Error calling getErrors on component:", s, r);
|
128
128
|
}
|
129
129
|
else
|
130
|
-
console.warn("Component does not have getErrors function:",
|
131
|
-
return
|
130
|
+
console.warn("Component does not have getErrors function:", r);
|
131
|
+
return u.every(me);
|
132
132
|
}
|
133
133
|
function n() {
|
134
|
-
t.value.forEach((
|
135
|
-
typeof (
|
134
|
+
t.value.forEach((u) => {
|
135
|
+
typeof (u == null ? void 0 : u.onReset) == "function" && u.onReset();
|
136
136
|
});
|
137
137
|
}
|
138
138
|
function e() {
|
139
|
-
const
|
140
|
-
for (const
|
141
|
-
if (typeof (
|
139
|
+
const u = [];
|
140
|
+
for (const r of t.value)
|
141
|
+
if (typeof (r == null ? void 0 : r.getErrors) == "function")
|
142
142
|
try {
|
143
|
-
const s =
|
144
|
-
Array.isArray(s) ?
|
143
|
+
const s = r.getErrors();
|
144
|
+
Array.isArray(s) ? u.push(...s) : u.push(String(s));
|
145
145
|
} catch (s) {
|
146
|
-
console.error("Error calling getErrors on component:", s,
|
146
|
+
console.error("Error calling getErrors on component:", s, r);
|
147
147
|
}
|
148
|
-
return
|
148
|
+
return u;
|
149
149
|
}
|
150
150
|
async function l() {
|
151
|
-
for (const
|
152
|
-
typeof (
|
151
|
+
for (const u of t.value)
|
152
|
+
typeof (u == null ? void 0 : u.onValueUpdate) == "function" && await u.onValueUpdate();
|
153
153
|
}
|
154
154
|
return {
|
155
155
|
dynamicRefs: t,
|
156
|
-
isFormValid:
|
156
|
+
isFormValid: o,
|
157
157
|
resetForm: n,
|
158
158
|
getFormErrors: e,
|
159
159
|
updateFormValues: l
|
160
160
|
};
|
161
161
|
}
|
162
|
-
function
|
163
|
-
const
|
164
|
-
() => Object.entries(t.value).reduce((
|
165
|
-
), n =
|
166
|
-
var
|
167
|
-
return typeof ((
|
168
|
-
}, l = (
|
169
|
-
n.value[
|
170
|
-
var
|
171
|
-
!
|
162
|
+
function Qe(t) {
|
163
|
+
const o = S(
|
164
|
+
() => Object.entries(t.value).reduce((p, [c, v]) => (v.value !== void 0 && (typeof v.onChange == "function" ? p[c] = v.onChange(v.value, t.value) : p[c] = v.value), p), {})
|
165
|
+
), n = E({}), e = (p, c, v) => {
|
166
|
+
var i;
|
167
|
+
return typeof ((i = t.value[p].children[c]) == null ? void 0 : i.computedValue) == "function" ? t.value[p].children[c].computedValue(v, t.value) : v;
|
168
|
+
}, l = (p, c, v, i) => {
|
169
|
+
n.value[p][i] || (n.value[p][i] = {}), Object.entries(c.other ?? {}).forEach(([m, C]) => {
|
170
|
+
var w;
|
171
|
+
!oe(C, (w = v.other) == null ? void 0 : w[m]) && (n.value[p][i][m] = e(p, m, C));
|
172
172
|
});
|
173
|
-
},
|
174
|
-
|
175
|
-
const
|
176
|
-
l(
|
173
|
+
}, u = (p, c, v) => {
|
174
|
+
c.forEach((i, m) => {
|
175
|
+
const C = v[m] ?? { other: {} };
|
176
|
+
l(p, i, C, m);
|
177
177
|
});
|
178
|
-
},
|
179
|
-
(
|
178
|
+
}, r = (p, { other: c }) => Object.entries(c ?? {}).reduce(
|
179
|
+
(v, [i, m]) => (v[i] = e(p, i, m), v),
|
180
180
|
{}
|
181
|
-
), s = (
|
182
|
-
n.value[
|
183
|
-
const
|
184
|
-
Array.isArray(
|
185
|
-
},
|
186
|
-
if (!
|
187
|
-
delete n.value[
|
181
|
+
), s = (p, c, v) => {
|
182
|
+
n.value[p] || (n.value[p] = []);
|
183
|
+
const i = c;
|
184
|
+
Array.isArray(v[p]) ? u(p, i, v[p]) : n.value[p] = i.map((m) => r(p, m));
|
185
|
+
}, y = (p, c, v) => {
|
186
|
+
if (!c) {
|
187
|
+
delete n.value[p];
|
188
188
|
return;
|
189
189
|
}
|
190
|
-
const
|
191
|
-
|
190
|
+
const i = t.value[p];
|
191
|
+
i.children !== void 0 ? s(p, c, v) : typeof i.computedValue == "function" && (n.value[p] = i.computedValue(c, t.value));
|
192
192
|
};
|
193
|
-
return
|
194
|
-
|
195
|
-
(
|
196
|
-
Object.keys(
|
197
|
-
|
198
|
-
}), Object.keys(
|
199
|
-
!(
|
193
|
+
return I(
|
194
|
+
o,
|
195
|
+
(p, c = {}) => {
|
196
|
+
Object.keys(p).forEach((v) => {
|
197
|
+
oe(p[v], c[v]) || y(v, p[v], c);
|
198
|
+
}), Object.keys(c).forEach((v) => {
|
199
|
+
!(v in p) && v in n.value && delete n.value[v];
|
200
200
|
});
|
201
201
|
},
|
202
202
|
{
|
@@ -204,14 +204,194 @@ function Ke(t) {
|
|
204
204
|
deep: !0
|
205
205
|
}
|
206
206
|
), {
|
207
|
-
formData:
|
207
|
+
formData: o,
|
208
208
|
computedData: n
|
209
209
|
};
|
210
210
|
}
|
211
|
-
|
211
|
+
function Xe(t) {
|
212
|
+
const o = E(0), n = E({}), e = E({}), l = E({});
|
213
|
+
function u(_) {
|
214
|
+
const a = {};
|
215
|
+
return Object.entries(_.schema).forEach(([h, k]) => {
|
216
|
+
a[h] = k.value;
|
217
|
+
}), a;
|
218
|
+
}
|
219
|
+
t.steps.forEach((_) => {
|
220
|
+
n.value[_.id] = u(_), e.value[_.id] = {}, l.value[_.id] = [];
|
221
|
+
});
|
222
|
+
const r = S(() => t.steps[o.value]), s = S(() => o.value === 0), y = S(() => o.value === t.steps.length - 1), p = S(() => !y.value), c = S(() => !s.value), v = S(() => t.steps.length), i = S(() => v.value === 0 ? 0 : Math.round((o.value + 1) / v.value * 100)), m = S(() => {
|
223
|
+
const _ = {};
|
224
|
+
return Object.values(n.value).forEach((a) => {
|
225
|
+
Object.assign(_, a);
|
226
|
+
}), _;
|
227
|
+
}), C = S(() => {
|
228
|
+
const _ = {};
|
229
|
+
return Object.values(e.value).forEach((a) => {
|
230
|
+
Object.assign(_, a);
|
231
|
+
}), _;
|
232
|
+
});
|
233
|
+
function x(_, a) {
|
234
|
+
n.value[_] = { ...n.value[_], ...a };
|
235
|
+
}
|
236
|
+
function w(_, a) {
|
237
|
+
e.value[_] = { ...e.value[_], ...a };
|
238
|
+
}
|
239
|
+
function R(_) {
|
240
|
+
const a = t.steps.find((h) => h.id === _);
|
241
|
+
a && (n.value[_] = u(a), e.value[_] = {});
|
242
|
+
}
|
243
|
+
async function F() {
|
244
|
+
const _ = r.value;
|
245
|
+
if (!_) return !0;
|
246
|
+
const a = [];
|
247
|
+
if (_.validation) {
|
248
|
+
const h = await _.validation(
|
249
|
+
n.value[_.id],
|
250
|
+
e.value[_.id]
|
251
|
+
);
|
252
|
+
h && a.push(...h);
|
253
|
+
}
|
254
|
+
return l.value[_.id] = a, a.length === 0;
|
255
|
+
}
|
256
|
+
async function q(_) {
|
257
|
+
return _ < 0 || _ >= t.steps.length || _ > o.value && !await F() ? !1 : (o.value = _, !0);
|
258
|
+
}
|
259
|
+
async function W() {
|
260
|
+
return p.value ? q(o.value + 1) : !1;
|
261
|
+
}
|
262
|
+
async function J() {
|
263
|
+
return c.value ? q(o.value - 1) : !1;
|
264
|
+
}
|
265
|
+
function Z() {
|
266
|
+
o.value = 0, l.value = {}, t.steps.forEach((_) => {
|
267
|
+
R(_.id), l.value[_.id] = [];
|
268
|
+
});
|
269
|
+
}
|
270
|
+
async function L() {
|
271
|
+
let _ = !0;
|
272
|
+
for (const a of t.steps)
|
273
|
+
if (a.validation) {
|
274
|
+
const h = await a.validation(
|
275
|
+
n.value[a.id],
|
276
|
+
e.value[a.id]
|
277
|
+
);
|
278
|
+
l.value[a.id] = h || [], h && h.length > 0 && (_ = !1);
|
279
|
+
}
|
280
|
+
return _;
|
281
|
+
}
|
282
|
+
function M() {
|
283
|
+
return {
|
284
|
+
steps: { ...n.value },
|
285
|
+
computedSteps: { ...e.value },
|
286
|
+
allFormData: m.value,
|
287
|
+
allComputedData: C.value
|
288
|
+
};
|
289
|
+
}
|
290
|
+
return {
|
291
|
+
// State
|
292
|
+
currentStepIndex: o,
|
293
|
+
currentStep: r,
|
294
|
+
stepData: n,
|
295
|
+
stepComputedData: e,
|
296
|
+
stepValidationErrors: l,
|
297
|
+
// Computed
|
298
|
+
isFirstStep: s,
|
299
|
+
isLastStep: y,
|
300
|
+
canGoNext: p,
|
301
|
+
canGoPrevious: c,
|
302
|
+
totalSteps: v,
|
303
|
+
progressPercentage: i,
|
304
|
+
allFormData: m,
|
305
|
+
allComputedData: C,
|
306
|
+
// Methods
|
307
|
+
updateStepData: x,
|
308
|
+
updateStepComputedData: w,
|
309
|
+
clearStepData: R,
|
310
|
+
validateCurrentStep: F,
|
311
|
+
goToStep: q,
|
312
|
+
nextStep: W,
|
313
|
+
previousStep: J,
|
314
|
+
resetForm: Z,
|
315
|
+
validateAllSteps: L,
|
316
|
+
getMultiStepFormData: M
|
317
|
+
};
|
318
|
+
}
|
319
|
+
const Ye = { class: "step-indicator__container" }, et = ["onClick"], tt = { class: "step-indicator__step-content" }, lt = { class: "step-indicator__step-marker" }, at = { class: "step-indicator__step-info" }, nt = { class: "step-indicator__step-title" }, ot = {
|
320
|
+
key: 0,
|
321
|
+
class: "step-indicator__step-subtitle"
|
322
|
+
}, ut = {
|
323
|
+
key: 0,
|
324
|
+
class: "step-indicator__progress"
|
325
|
+
}, st = { class: "step-indicator__progress-bar" }, rt = { class: "step-indicator__progress-text" }, it = /* @__PURE__ */ U({
|
326
|
+
__name: "StepIndicator",
|
327
|
+
props: {
|
328
|
+
steps: {},
|
329
|
+
activeStepIndex: {},
|
330
|
+
position: {},
|
331
|
+
showProgress: { type: Boolean, default: !0 },
|
332
|
+
allowNavigation: { type: Boolean, default: !1 }
|
333
|
+
},
|
334
|
+
emits: ["step-click"],
|
335
|
+
setup(t, { emit: o }) {
|
336
|
+
const n = t, e = o, l = S(() => n.steps.length === 0 ? 0 : (n.activeStepIndex + 1) / n.steps.length * 100);
|
337
|
+
function u(r) {
|
338
|
+
n.allowNavigation && e("step-click", r);
|
339
|
+
}
|
340
|
+
return (r, s) => (f(), $("div", {
|
341
|
+
class: ne(["step-indicator", [`step-indicator--${r.position}`, { "step-indicator--clickable": r.allowNavigation }]])
|
342
|
+
}, [
|
343
|
+
B("div", Ye, [
|
344
|
+
(f(!0), $(T, null, K(r.steps, (y, p) => (f(), $("div", {
|
345
|
+
key: y.id,
|
346
|
+
class: ne(["step-indicator__step", {
|
347
|
+
"step-indicator__step--active": p === r.activeStepIndex,
|
348
|
+
"step-indicator__step--completed": p < r.activeStepIndex,
|
349
|
+
"step-indicator__step--clickable": r.allowNavigation
|
350
|
+
}]),
|
351
|
+
onClick: (c) => u(p)
|
352
|
+
}, [
|
353
|
+
B("div", tt, [
|
354
|
+
B("div", lt, [
|
355
|
+
B("span", null, A(p + 1), 1)
|
356
|
+
]),
|
357
|
+
B("div", at, [
|
358
|
+
B("div", nt, A(y.title), 1),
|
359
|
+
y.subtitle ? (f(), $("div", ot, A(y.subtitle), 1)) : O("", !0)
|
360
|
+
])
|
361
|
+
]),
|
362
|
+
p < r.steps.length - 1 ? (f(), $("div", {
|
363
|
+
key: 0,
|
364
|
+
class: ne(["step-indicator__connector", { "step-indicator__connector--completed": p < r.activeStepIndex }])
|
365
|
+
}, null, 2)) : O("", !0)
|
366
|
+
], 10, et))), 128))
|
367
|
+
]),
|
368
|
+
r.showProgress && (r.position === "top" || r.position === "bottom") ? (f(), $("div", ut, [
|
369
|
+
B("div", st, [
|
370
|
+
B("div", {
|
371
|
+
class: "step-indicator__progress-fill",
|
372
|
+
style: ve({ width: `${l.value}%` })
|
373
|
+
}, null, 4)
|
374
|
+
]),
|
375
|
+
B("div", rt, " Step " + A(r.activeStepIndex + 1) + " of " + A(r.steps.length), 1)
|
376
|
+
])) : O("", !0)
|
377
|
+
], 2));
|
378
|
+
}
|
379
|
+
}), de = (t, o) => {
|
380
|
+
const n = t.__vccOpts || t;
|
381
|
+
for (const [e, l] of o)
|
382
|
+
n[e] = l;
|
383
|
+
return n;
|
384
|
+
}, re = /* @__PURE__ */ de(it, [["__scopeId", "data-v-aca1a6d0"]]), ct = { class: "v-form-container" }, dt = {
|
385
|
+
key: 0,
|
386
|
+
class: "multi-step-form"
|
387
|
+
}, pt = { class: "multi-step-form-content" }, vt = { class: "step-nav-buttons" }, ft = { class: "step-action-buttons" }, mt = { class: "step-nav-buttons" }, ht = {
|
388
|
+
key: 1,
|
389
|
+
class: "step-progress-bottom"
|
390
|
+
}, gt = { class: "step-progress-bar" }, yt = { class: "step-progress-text" }, Ct = /* @__PURE__ */ U({
|
212
391
|
__name: "vForm",
|
213
392
|
props: {
|
214
393
|
schema: {},
|
394
|
+
multiStepConfig: {},
|
215
395
|
showLabels: { type: Boolean, default: !0 },
|
216
396
|
showClearButton: { type: Boolean, default: !0 },
|
217
397
|
showCancelButton: { type: Boolean, default: !0 },
|
@@ -222,137 +402,366 @@ const We = /* @__PURE__ */ F({
|
|
222
402
|
hideButtons: { type: Boolean, default: !1 },
|
223
403
|
customButtons: {}
|
224
404
|
},
|
225
|
-
emits: ["submit", "clear", "cancel"],
|
226
|
-
setup(t, { expose:
|
227
|
-
const e = t, l = n,
|
228
|
-
|
229
|
-
|
405
|
+
emits: ["submit", "multi-step-submit", "step-change", "clear", "cancel"],
|
406
|
+
setup(t, { expose: o, emit: n }) {
|
407
|
+
const e = t, l = n, u = S(() => !!e.multiStepConfig), r = E(e.schema || {}), s = e.multiStepConfig ? Xe(e.multiStepConfig) : null, { dynamicRefs: y, isFormValid: p, resetForm: c } = we(), { formData: v, computedData: i } = Qe(r), m = S(() => (s == null ? void 0 : s.currentStepIndex.value) ?? 0), C = S(() => s == null ? void 0 : s.currentStep.value), x = S(() => (s == null ? void 0 : s.isLastStep.value) ?? !0), w = S(() => (s == null ? void 0 : s.canGoNext.value) ?? !1), R = S(() => (s == null ? void 0 : s.canGoPrevious.value) ?? !1), F = S(() => !u.value || !s ? 0 : s.progressPercentage.value);
|
408
|
+
I(
|
409
|
+
() => C.value,
|
410
|
+
(a) => {
|
411
|
+
a && u.value && (r.value = a.schema);
|
412
|
+
},
|
413
|
+
{ immediate: !0 }
|
414
|
+
), I(
|
415
|
+
[v, i],
|
416
|
+
([a, h]) => {
|
417
|
+
u.value && s && C.value && (s.updateStepData(C.value.id, a), s.updateStepComputedData(C.value.id, h));
|
418
|
+
},
|
419
|
+
{ deep: !0 }
|
420
|
+
), I(
|
421
|
+
() => e.schema,
|
422
|
+
(a) => {
|
423
|
+
if (!u.value && a) {
|
424
|
+
r.value = a;
|
425
|
+
for (const [h, k] of Object.entries(a))
|
426
|
+
k.value !== void 0 && (r.value[h].value = k.value);
|
427
|
+
}
|
428
|
+
},
|
429
|
+
{ deep: !0, immediate: !0 }
|
430
|
+
);
|
431
|
+
async function q() {
|
432
|
+
if (u.value && s) {
|
433
|
+
if (!await s.validateAllSteps()) return;
|
434
|
+
const h = s.getMultiStepFormData();
|
435
|
+
l("multi-step-submit", h);
|
436
|
+
} else {
|
437
|
+
if (!await p()) return;
|
438
|
+
l("submit", v.value, i.value);
|
439
|
+
}
|
440
|
+
}
|
441
|
+
function W() {
|
442
|
+
u.value && s ? s.resetForm() : c(), l("clear");
|
230
443
|
}
|
231
|
-
function
|
232
|
-
|
444
|
+
function J() {
|
445
|
+
u.value && s && C.value && s.clearStepData(C.value.id);
|
233
446
|
}
|
234
|
-
function
|
235
|
-
|
447
|
+
function Z() {
|
448
|
+
u.value && s ? s.resetForm() : c(), l("cancel");
|
236
449
|
}
|
237
|
-
|
238
|
-
|
450
|
+
async function L() {
|
451
|
+
if (s) {
|
452
|
+
if (!await p())
|
453
|
+
return;
|
454
|
+
await s.nextStep() && C.value && l("step-change", m.value, C.value.id);
|
455
|
+
}
|
456
|
+
}
|
457
|
+
async function M() {
|
458
|
+
s && await s.previousStep() && C.value && l("step-change", m.value, C.value.id);
|
459
|
+
}
|
460
|
+
async function _(a) {
|
461
|
+
if (s) {
|
462
|
+
if (a > m.value && !await p())
|
463
|
+
return;
|
464
|
+
await s.goToStep(a) && C.value && l("step-change", a, C.value.id);
|
465
|
+
}
|
466
|
+
}
|
467
|
+
return I(
|
468
|
+
v,
|
239
469
|
async () => {
|
240
|
-
|
241
|
-
|
470
|
+
var a;
|
471
|
+
for (const [h, k] of Object.entries(r.value))
|
472
|
+
if (!ie(k, v.value, i.value)) {
|
473
|
+
const g = u.value && C.value ? C.value.schema[h] : (a = e.schema) == null ? void 0 : a[h];
|
474
|
+
g && (k.value = g.value);
|
475
|
+
}
|
242
476
|
},
|
243
477
|
{
|
244
478
|
deep: !0,
|
245
479
|
immediate: !0
|
246
480
|
}
|
247
|
-
),
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
481
|
+
), o({
|
482
|
+
resetForm: W,
|
483
|
+
isFormValid: p,
|
484
|
+
resolveData: () => u.value && s ? s.getMultiStepFormData() : {
|
485
|
+
formData: v.value,
|
486
|
+
computedData: i.value
|
252
487
|
},
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
488
|
+
// Multi-step specific methods
|
489
|
+
nextStep: L,
|
490
|
+
previousStep: M,
|
491
|
+
goToStep: _,
|
492
|
+
getCurrentStep: () => C.value,
|
493
|
+
getCurrentStepIndex: () => m.value
|
494
|
+
}), (a, h) => {
|
495
|
+
var k;
|
496
|
+
return f(), $("div", ct, [
|
497
|
+
u.value ? (f(), $("div", dt, [
|
498
|
+
a.multiStepConfig && a.multiStepConfig.stepPosition === "top" ? (f(), V(re, {
|
499
|
+
key: 0,
|
500
|
+
steps: a.multiStepConfig.steps,
|
501
|
+
"active-step-index": m.value,
|
502
|
+
position: a.multiStepConfig.stepPosition || "top",
|
503
|
+
"show-progress": a.multiStepConfig.showProgress,
|
504
|
+
"allow-navigation": a.multiStepConfig.allowStepNavigation,
|
505
|
+
onStepClick: _
|
506
|
+
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0),
|
507
|
+
B("div", {
|
508
|
+
class: ne(["multi-step-content", `multi-step-content--${((k = a.multiStepConfig) == null ? void 0 : k.stepPosition) || "top"}`])
|
509
|
+
}, [
|
510
|
+
a.multiStepConfig && a.multiStepConfig.stepPosition === "left" ? (f(), V(re, {
|
511
|
+
key: 0,
|
512
|
+
steps: a.multiStepConfig.steps,
|
513
|
+
"active-step-index": m.value,
|
514
|
+
position: a.multiStepConfig.stepPosition ?? "top",
|
515
|
+
"show-progress": a.multiStepConfig.showProgress,
|
516
|
+
"allow-navigation": a.multiStepConfig.allowStepNavigation,
|
517
|
+
onStepClick: _,
|
518
|
+
class: "multi-step-sidebar"
|
519
|
+
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0),
|
520
|
+
B("div", pt, [
|
521
|
+
P(d(Ce), null, {
|
522
|
+
default: b(() => [
|
523
|
+
P(d(le), null, {
|
524
|
+
default: b(() => [
|
525
|
+
(f(!0), $(T, null, K(Object.keys(r.value), (g) => {
|
526
|
+
var D, H, Q, ee, te;
|
527
|
+
return f(), $(T, null, [
|
528
|
+
d(ie)(r.value[g], d(v), d(i)) ? (f(), V(d(ae), {
|
529
|
+
key: g,
|
530
|
+
size: ((D = r.value[g].grid) == null ? void 0 : D.xs) ?? "12",
|
531
|
+
"size-sm": (H = r.value[g].grid) == null ? void 0 : H.sm,
|
532
|
+
"size-md": (Q = r.value[g].grid) == null ? void 0 : Q.md,
|
533
|
+
"size-lg": (ee = r.value[g].grid) == null ? void 0 : ee.lg,
|
534
|
+
"size-xl": (te = r.value[g].grid) == null ? void 0 : te.xl,
|
535
|
+
class: "ion-margin-vertical"
|
536
|
+
}, {
|
537
|
+
default: b(() => [
|
538
|
+
(f(), V(fe(r.value[g].type), {
|
539
|
+
modelValue: r.value[g],
|
540
|
+
"onUpdate:modelValue": (pe) => r.value[g] = pe,
|
541
|
+
schema: r.value,
|
542
|
+
"form-id": g,
|
543
|
+
ref_for: !0,
|
544
|
+
ref_key: "dynamicRefs",
|
545
|
+
ref: y,
|
546
|
+
"ref-key": g
|
547
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "form-id", "ref-key"]))
|
548
|
+
]),
|
549
|
+
_: 2
|
550
|
+
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
|
551
|
+
], 64);
|
552
|
+
}), 256))
|
553
|
+
]),
|
554
|
+
_: 1
|
555
|
+
})
|
556
|
+
]),
|
557
|
+
_: 1
|
558
|
+
}),
|
559
|
+
a.hideButtons ? O("", !0) : (f(), V(d(le), {
|
560
|
+
key: 0,
|
561
|
+
class: "multi-step-buttons"
|
562
|
+
}, {
|
563
|
+
default: b(() => [
|
564
|
+
P(d(ae), {
|
565
|
+
size: "12",
|
566
|
+
class: "button-container"
|
567
|
+
}, {
|
568
|
+
default: b(() => [
|
569
|
+
B("div", vt, [
|
570
|
+
R.value ? (f(), V(d(j), {
|
571
|
+
key: 0,
|
572
|
+
onClick: M,
|
573
|
+
fill: "outline"
|
574
|
+
}, {
|
575
|
+
default: b(() => h[0] || (h[0] = [
|
576
|
+
z(" Previous ")
|
577
|
+
])),
|
578
|
+
_: 1,
|
579
|
+
__: [0]
|
580
|
+
})) : O("", !0)
|
581
|
+
]),
|
582
|
+
B("div", ft, [
|
583
|
+
a.showCancelButton ? (f(), V(d(j), {
|
584
|
+
key: 0,
|
585
|
+
onClick: Z,
|
586
|
+
fill: "outline"
|
587
|
+
}, {
|
588
|
+
default: b(() => [
|
589
|
+
z(A(a.cancelButtonText ?? "Cancel"), 1)
|
590
|
+
]),
|
591
|
+
_: 1
|
592
|
+
})) : O("", !0),
|
593
|
+
a.showClearButton ? (f(), V(d(j), {
|
594
|
+
key: 1,
|
595
|
+
onClick: J,
|
596
|
+
fill: "outline"
|
597
|
+
}, {
|
598
|
+
default: b(() => [
|
599
|
+
z(A(a.clearButtonText ?? "Reset"), 1)
|
600
|
+
]),
|
601
|
+
_: 1
|
602
|
+
})) : O("", !0),
|
603
|
+
(f(!0), $(T, null, K(a.customButtons, (g) => (f(), V(d(j), {
|
604
|
+
key: g.label,
|
605
|
+
onClick: g.action,
|
606
|
+
color: g.color ?? "primary"
|
607
|
+
}, {
|
608
|
+
default: b(() => [
|
609
|
+
z(A(g.label), 1)
|
610
|
+
]),
|
611
|
+
_: 2
|
612
|
+
}, 1032, ["onClick", "color"]))), 128))
|
613
|
+
]),
|
614
|
+
B("div", mt, [
|
615
|
+
w.value ? (f(), V(d(j), {
|
616
|
+
key: 0,
|
617
|
+
onClick: L
|
618
|
+
}, {
|
619
|
+
default: b(() => h[1] || (h[1] = [
|
620
|
+
z(" Next ")
|
621
|
+
])),
|
622
|
+
_: 1,
|
623
|
+
__: [1]
|
624
|
+
})) : O("", !0),
|
625
|
+
x.value ? (f(), V(d(j), {
|
626
|
+
key: 1,
|
627
|
+
onClick: q
|
628
|
+
}, {
|
629
|
+
default: b(() => [
|
630
|
+
z(A(a.submitButtonText ?? "Submit"), 1)
|
631
|
+
]),
|
632
|
+
_: 1
|
633
|
+
})) : O("", !0)
|
634
|
+
])
|
635
|
+
]),
|
636
|
+
_: 1
|
637
|
+
})
|
638
|
+
]),
|
639
|
+
_: 1
|
640
|
+
})),
|
641
|
+
a.multiStepConfig && (a.multiStepConfig.stepPosition === "left" || a.multiStepConfig.stepPosition === "right") && a.multiStepConfig.showProgress ? (f(), $("div", ht, [
|
642
|
+
B("div", gt, [
|
643
|
+
B("div", {
|
644
|
+
class: "step-progress-fill",
|
645
|
+
style: ve({ width: `${F.value}%` })
|
646
|
+
}, null, 4)
|
647
|
+
]),
|
648
|
+
B("div", yt, " Step " + A(m.value + 1) + " of " + A(a.multiStepConfig.steps.length), 1)
|
649
|
+
])) : O("", !0)
|
650
|
+
]),
|
651
|
+
a.multiStepConfig && a.multiStepConfig.stepPosition === "right" ? (f(), V(re, {
|
652
|
+
key: 1,
|
653
|
+
steps: a.multiStepConfig.steps,
|
654
|
+
"active-step-index": m.value,
|
655
|
+
position: a.multiStepConfig.stepPosition,
|
656
|
+
"show-progress": a.multiStepConfig.showProgress,
|
657
|
+
"allow-navigation": a.multiStepConfig.allowStepNavigation,
|
658
|
+
onStepClick: _,
|
659
|
+
class: "multi-step-sidebar"
|
660
|
+
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0)
|
661
|
+
], 2),
|
662
|
+
a.multiStepConfig && a.multiStepConfig.stepPosition === "bottom" ? (f(), V(re, {
|
663
|
+
key: 1,
|
664
|
+
steps: a.multiStepConfig.steps,
|
665
|
+
"active-step-index": m.value,
|
666
|
+
position: a.multiStepConfig.stepPosition,
|
667
|
+
"show-progress": a.multiStepConfig.showProgress,
|
668
|
+
"allow-navigation": a.multiStepConfig.allowStepNavigation,
|
669
|
+
onStepClick: _
|
670
|
+
}, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0)
|
671
|
+
])) : (f(), V(d(Ce), { key: 1 }, {
|
300
672
|
default: b(() => [
|
301
|
-
|
302
|
-
size: "12",
|
303
|
-
style: Ve([{ display: "flex" }, { justifyContent: y.buttonPlacement }])
|
304
|
-
}, {
|
673
|
+
P(d(le), null, {
|
305
674
|
default: b(() => [
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
675
|
+
(f(!0), $(T, null, K(Object.keys(r.value), (g) => {
|
676
|
+
var D, H, Q, ee, te;
|
677
|
+
return f(), $(T, null, [
|
678
|
+
d(ie)(r.value[g], d(v), d(i)) ? (f(), V(d(ae), {
|
679
|
+
key: g,
|
680
|
+
size: ((D = r.value[g].grid) == null ? void 0 : D.xs) ?? "12",
|
681
|
+
"size-sm": (H = r.value[g].grid) == null ? void 0 : H.sm,
|
682
|
+
"size-md": (Q = r.value[g].grid) == null ? void 0 : Q.md,
|
683
|
+
"size-lg": (ee = r.value[g].grid) == null ? void 0 : ee.lg,
|
684
|
+
"size-xl": (te = r.value[g].grid) == null ? void 0 : te.xl,
|
685
|
+
class: "ion-margin-vertical"
|
686
|
+
}, {
|
687
|
+
default: b(() => [
|
688
|
+
(f(), V(fe(r.value[g].type), {
|
689
|
+
modelValue: r.value[g],
|
690
|
+
"onUpdate:modelValue": (pe) => r.value[g] = pe,
|
691
|
+
schema: r.value,
|
692
|
+
"form-id": g,
|
693
|
+
ref_for: !0,
|
694
|
+
ref_key: "dynamicRefs",
|
695
|
+
ref: y,
|
696
|
+
"ref-key": g
|
697
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "form-id", "ref-key"]))
|
698
|
+
]),
|
699
|
+
_: 2
|
700
|
+
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
|
701
|
+
], 64);
|
702
|
+
}), 256))
|
703
|
+
]),
|
704
|
+
_: 1
|
705
|
+
}),
|
706
|
+
a.hideButtons ? O("", !0) : (f(), V(d(le), { key: 0 }, {
|
707
|
+
default: b(() => [
|
708
|
+
P(d(ae), {
|
709
|
+
size: "12",
|
710
|
+
style: ve([{ display: "flex" }, { justifyContent: a.buttonPlacement }])
|
318
711
|
}, {
|
319
712
|
default: b(() => [
|
320
|
-
|
713
|
+
a.showCancelButton ? (f(), V(d(j), {
|
714
|
+
key: 0,
|
715
|
+
onClick: Z
|
716
|
+
}, {
|
717
|
+
default: b(() => [
|
718
|
+
z(A(a.cancelButtonText ?? "Cancel"), 1)
|
719
|
+
]),
|
720
|
+
_: 1
|
721
|
+
})) : O("", !0),
|
722
|
+
a.showClearButton ? (f(), V(d(j), {
|
723
|
+
key: 1,
|
724
|
+
onClick: W
|
725
|
+
}, {
|
726
|
+
default: b(() => [
|
727
|
+
z(A(a.clearButtonText ?? "Reset"), 1)
|
728
|
+
]),
|
729
|
+
_: 1
|
730
|
+
})) : O("", !0),
|
731
|
+
(f(!0), $(T, null, K(a.customButtons, (g) => (f(), V(d(j), {
|
732
|
+
key: g.label,
|
733
|
+
onClick: g.action,
|
734
|
+
color: g.color ?? "primary"
|
735
|
+
}, {
|
736
|
+
default: b(() => [
|
737
|
+
z(A(g.label), 1)
|
738
|
+
]),
|
739
|
+
_: 2
|
740
|
+
}, 1032, ["onClick", "color"]))), 128)),
|
741
|
+
P(d(j), { onClick: q }, {
|
742
|
+
default: b(() => [
|
743
|
+
z(A(a.submitButtonText ?? "Submit"), 1)
|
744
|
+
]),
|
745
|
+
_: 1
|
746
|
+
})
|
321
747
|
]),
|
322
748
|
_: 1
|
323
|
-
}
|
324
|
-
(p(!0), q(T, null, K(y.customButtons, (f) => (p(), V(v(Z), {
|
325
|
-
key: f.label,
|
326
|
-
onClick: f.action,
|
327
|
-
color: f.color ?? "primary"
|
328
|
-
}, {
|
329
|
-
default: b(() => [
|
330
|
-
I(B(f.label), 1)
|
331
|
-
]),
|
332
|
-
_: 2
|
333
|
-
}, 1032, ["onClick", "color"]))), 128)),
|
334
|
-
A(v(Z), { onClick: d }, {
|
335
|
-
default: b(() => [
|
336
|
-
I(B(y.submitButtonText ?? "Submit"), 1)
|
337
|
-
]),
|
338
|
-
_: 1
|
339
|
-
})
|
749
|
+
}, 8, ["style"])
|
340
750
|
]),
|
341
751
|
_: 1
|
342
|
-
}
|
752
|
+
}))
|
343
753
|
]),
|
344
754
|
_: 1
|
345
755
|
}))
|
346
|
-
])
|
347
|
-
|
348
|
-
}));
|
756
|
+
]);
|
757
|
+
};
|
349
758
|
}
|
350
|
-
});
|
351
|
-
function
|
759
|
+
}), _t = /* @__PURE__ */ de(Ct, [["__scopeId", "data-v-3850cccc"]]);
|
760
|
+
function Vt(t) {
|
352
761
|
return {
|
353
762
|
applyValidationState: async (e) => {
|
354
|
-
var l,
|
355
|
-
(l = t.value) == null || l.$el.classList.remove("ion-invalid"), (
|
763
|
+
var l, u, r, s, y;
|
764
|
+
(l = t.value) == null || l.$el.classList.remove("ion-invalid"), (u = t.value) == null || u.$el.classList.remove("ion-valid"), e ? (r = t.value) == null || r.$el.classList.add("ion-valid") : (s = t.value) == null || s.$el.classList.add("ion-invalid"), (y = t.value) == null || y.$el.classList.add("ion-touched");
|
356
765
|
},
|
357
766
|
resetValidationState: () => {
|
358
767
|
var e, l;
|
@@ -360,87 +769,87 @@ function Ze(t) {
|
|
360
769
|
}
|
361
770
|
};
|
362
771
|
}
|
363
|
-
function
|
364
|
-
const { applyValidationState:
|
772
|
+
function ue(t, o, n, e, l) {
|
773
|
+
const { applyValidationState: u, resetValidationState: r } = Vt(t);
|
365
774
|
async function s() {
|
366
|
-
if (
|
367
|
-
return
|
775
|
+
if (o.value.required && !n.value)
|
776
|
+
return o.value.error = "This field is required", !1;
|
368
777
|
if (l) {
|
369
|
-
const
|
370
|
-
if (typeof
|
371
|
-
return
|
372
|
-
if (
|
778
|
+
const i = await l(n.value);
|
779
|
+
if (typeof i == "string")
|
780
|
+
return o.value.error = i, !1;
|
781
|
+
if (i === !1)
|
373
782
|
return !1;
|
374
783
|
}
|
375
|
-
if (
|
376
|
-
const
|
377
|
-
if (
|
378
|
-
return
|
784
|
+
if (o.value.validation) {
|
785
|
+
const i = await o.value.validation(n.value, e == null ? void 0 : e.value);
|
786
|
+
if (i && i.length)
|
787
|
+
return o.value.error = i.join(), !1;
|
379
788
|
}
|
380
789
|
return !0;
|
381
790
|
}
|
382
|
-
async function
|
383
|
-
const
|
384
|
-
|
791
|
+
async function y() {
|
792
|
+
const i = await s();
|
793
|
+
i && (o.value.error = "", o.value.value = n.value), await u(i);
|
385
794
|
}
|
386
|
-
function
|
387
|
-
|
795
|
+
function p() {
|
796
|
+
r(), o.value.error = "";
|
388
797
|
}
|
389
|
-
function
|
390
|
-
n.value =
|
798
|
+
function c(i = "") {
|
799
|
+
n.value = i, o.value.error = "", o.value.value = i;
|
391
800
|
}
|
392
|
-
function
|
393
|
-
return
|
801
|
+
function v() {
|
802
|
+
return o.value.error ? [o.value.error] : [];
|
394
803
|
}
|
395
804
|
return {
|
396
805
|
isValid: s,
|
397
|
-
onValueUpdate:
|
398
|
-
onFocus:
|
399
|
-
onReset:
|
400
|
-
getErrors:
|
401
|
-
applyValidationState:
|
402
|
-
resetValidationState:
|
806
|
+
onValueUpdate: y,
|
807
|
+
onFocus: p,
|
808
|
+
onReset: c,
|
809
|
+
getErrors: v,
|
810
|
+
applyValidationState: u,
|
811
|
+
resetValidationState: r
|
403
812
|
};
|
404
813
|
}
|
405
|
-
function
|
406
|
-
const
|
814
|
+
function bt(t) {
|
815
|
+
const o = S(() => !!t.value.label), n = S(() => !!t.value.required), e = S(() => t.value.label || "");
|
407
816
|
return {
|
408
|
-
showLabel:
|
817
|
+
showLabel: o,
|
409
818
|
showRequired: n,
|
410
819
|
labelText: e
|
411
820
|
};
|
412
821
|
}
|
413
|
-
const
|
822
|
+
const ye = /* @__PURE__ */ U({
|
414
823
|
__name: "InputLabel",
|
415
824
|
props: {
|
416
825
|
model: {}
|
417
826
|
},
|
418
827
|
setup(t) {
|
419
|
-
const
|
420
|
-
return (
|
828
|
+
const o = t, { showLabel: n, showRequired: e, labelText: l } = bt(Oe(o, "model"));
|
829
|
+
return (u, r) => d(n) ? (f(), V(d(Y), {
|
421
830
|
key: 0,
|
422
831
|
slot: "label",
|
423
832
|
class: "input-label"
|
424
833
|
}, {
|
425
834
|
default: b(() => [
|
426
|
-
|
427
|
-
|
835
|
+
z(A(d(l)) + " ", 1),
|
836
|
+
d(e) ? (f(), V(d(Re), {
|
428
837
|
key: 0,
|
429
838
|
color: "danger"
|
430
839
|
}, {
|
431
|
-
default: b(() =>
|
432
|
-
|
840
|
+
default: b(() => r[0] || (r[0] = [
|
841
|
+
z("*")
|
433
842
|
])),
|
434
843
|
_: 1,
|
435
844
|
__: [0]
|
436
|
-
})) :
|
845
|
+
})) : O("", !0)
|
437
846
|
]),
|
438
847
|
_: 1
|
439
|
-
})) :
|
848
|
+
})) : O("", !0);
|
440
849
|
}
|
441
|
-
}),
|
850
|
+
}), se = /* @__PURE__ */ U({
|
442
851
|
__name: "BaseInput",
|
443
|
-
props: /* @__PURE__ */
|
852
|
+
props: /* @__PURE__ */ N({
|
444
853
|
schema: {},
|
445
854
|
type: {}
|
446
855
|
}, {
|
@@ -448,31 +857,31 @@ const re = /* @__PURE__ */ F({
|
|
448
857
|
modelModifiers: {}
|
449
858
|
}),
|
450
859
|
emits: ["update:modelValue"],
|
451
|
-
setup(t, { expose:
|
452
|
-
const n = t, e =
|
860
|
+
setup(t, { expose: o }) {
|
861
|
+
const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), { isValid: s, onValueUpdate: y, onFocus: p, onReset: c, getErrors: v } = ue(
|
453
862
|
l,
|
454
863
|
e,
|
455
|
-
|
456
|
-
|
457
|
-
),
|
458
|
-
if (e.value.pattern) return
|
864
|
+
u,
|
865
|
+
r
|
866
|
+
), i = S(() => {
|
867
|
+
if (e.value.pattern) return We(e.value.pattern);
|
459
868
|
});
|
460
|
-
return
|
869
|
+
return I(
|
461
870
|
() => e.value.value,
|
462
|
-
(m) =>
|
463
|
-
),
|
464
|
-
onValueUpdate:
|
465
|
-
onReset:
|
466
|
-
getErrors:
|
871
|
+
(m) => u.value = m
|
872
|
+
), o({
|
873
|
+
onValueUpdate: y,
|
874
|
+
onReset: c,
|
875
|
+
getErrors: v,
|
467
876
|
isValid: s
|
468
|
-
}), (m,
|
469
|
-
var
|
470
|
-
const
|
471
|
-
return xe((
|
877
|
+
}), (m, C) => {
|
878
|
+
var w;
|
879
|
+
const x = Ee("maskito");
|
880
|
+
return xe((f(), V(d(Ve), {
|
472
881
|
ref_key: "inputRef",
|
473
882
|
ref: l,
|
474
|
-
modelValue:
|
475
|
-
"onUpdate:modelValue":
|
883
|
+
modelValue: u.value,
|
884
|
+
"onUpdate:modelValue": C[0] || (C[0] = (R) => u.value = R),
|
476
885
|
"clear-input": !0,
|
477
886
|
fill: e.value.fill ?? "solid",
|
478
887
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
@@ -480,7 +889,7 @@ const re = /* @__PURE__ */ F({
|
|
480
889
|
required: e.value.required,
|
481
890
|
"error-text": e.value.error,
|
482
891
|
autofocus: e.value.autoFocus,
|
483
|
-
placeholder: ((
|
892
|
+
placeholder: ((w = i.value) == null ? void 0 : w.placeholder) ?? e.value.placeholder,
|
484
893
|
disabled: e.value.disabled,
|
485
894
|
counter: e.value.counter,
|
486
895
|
min: e.value.min,
|
@@ -488,53 +897,53 @@ const re = /* @__PURE__ */ F({
|
|
488
897
|
"max-length": e.value.maxLength,
|
489
898
|
"min-length": e.value.minLength,
|
490
899
|
pattern: e.value.pattern,
|
491
|
-
onIonFocus:
|
492
|
-
onIonChange:
|
493
|
-
onIonBlur:
|
900
|
+
onIonFocus: d(p),
|
901
|
+
onIonChange: d(y),
|
902
|
+
onIonBlur: d(y)
|
494
903
|
}, {
|
495
904
|
default: b(() => [
|
496
|
-
|
497
|
-
e.value.prefix ? (
|
905
|
+
P(ye, { model: e.value }, null, 8, ["model"]),
|
906
|
+
e.value.prefix ? (f(), V(d(Y), {
|
498
907
|
key: 0,
|
499
908
|
slot: "start"
|
500
909
|
}, {
|
501
910
|
default: b(() => [
|
502
|
-
|
911
|
+
z(A(e.value.prefix), 1)
|
503
912
|
]),
|
504
913
|
_: 1
|
505
|
-
})) :
|
506
|
-
e.value.suffix ? (
|
914
|
+
})) : O("", !0),
|
915
|
+
e.value.suffix ? (f(), V(d(Y), {
|
507
916
|
key: 1,
|
508
917
|
slot: "end"
|
509
918
|
}, {
|
510
919
|
default: b(() => [
|
511
|
-
|
920
|
+
z(A(e.value.suffix), 1)
|
512
921
|
]),
|
513
922
|
_: 1
|
514
|
-
})) :
|
515
|
-
m.type === "password" ? (
|
923
|
+
})) : O("", !0),
|
924
|
+
m.type === "password" ? (f(), V(d(Ae), {
|
516
925
|
key: 2,
|
517
926
|
slot: "end"
|
518
|
-
})) :
|
927
|
+
})) : O("", !0)
|
519
928
|
]),
|
520
929
|
_: 1
|
521
930
|
}, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter", "min", "max", "max-length", "min-length", "pattern", "onIonFocus", "onIonChange", "onIonBlur"])), [
|
522
|
-
[
|
931
|
+
[x, i.value]
|
523
932
|
]);
|
524
933
|
};
|
525
934
|
}
|
526
|
-
}),
|
935
|
+
}), kt = /* @__PURE__ */ U({
|
527
936
|
__name: "TextInput",
|
528
|
-
props: /* @__PURE__ */
|
937
|
+
props: /* @__PURE__ */ N({
|
529
938
|
schema: {}
|
530
939
|
}, {
|
531
940
|
modelValue: { type: Object, default: {} },
|
532
941
|
modelModifiers: {}
|
533
942
|
}),
|
534
943
|
emits: ["update:modelValue"],
|
535
|
-
setup(t, { expose:
|
536
|
-
const n =
|
537
|
-
return
|
944
|
+
setup(t, { expose: o }) {
|
945
|
+
const n = G(t, "modelValue"), e = E(null);
|
946
|
+
return o({
|
538
947
|
onReset: () => {
|
539
948
|
var l;
|
540
949
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -544,30 +953,30 @@ const re = /* @__PURE__ */ F({
|
|
544
953
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
545
954
|
},
|
546
955
|
getErrors: () => {
|
547
|
-
var l,
|
548
|
-
return ((
|
956
|
+
var l, u;
|
957
|
+
return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
|
549
958
|
}
|
550
|
-
}), (l,
|
959
|
+
}), (l, u) => (f(), V(se, {
|
551
960
|
modelValue: n.value,
|
552
|
-
"onUpdate:modelValue":
|
961
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
|
553
962
|
type: "text",
|
554
963
|
schema: l.schema,
|
555
964
|
ref_key: "inputRef",
|
556
965
|
ref: e
|
557
966
|
}, null, 8, ["modelValue", "schema"]));
|
558
967
|
}
|
559
|
-
}),
|
968
|
+
}), St = /* @__PURE__ */ U({
|
560
969
|
__name: "DateInput",
|
561
|
-
props: /* @__PURE__ */
|
970
|
+
props: /* @__PURE__ */ N({
|
562
971
|
schema: {}
|
563
972
|
}, {
|
564
973
|
modelValue: { type: Object, default: {} },
|
565
974
|
modelModifiers: {}
|
566
975
|
}),
|
567
976
|
emits: ["update:modelValue"],
|
568
|
-
setup(t, { expose:
|
569
|
-
const n =
|
570
|
-
return
|
977
|
+
setup(t, { expose: o }) {
|
978
|
+
const n = G(t, "modelValue"), e = E(null);
|
979
|
+
return o({
|
571
980
|
onValueUpdate: () => {
|
572
981
|
var l;
|
573
982
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
@@ -577,30 +986,30 @@ const re = /* @__PURE__ */ F({
|
|
577
986
|
return (l = e.value) == null ? void 0 : l.onReset();
|
578
987
|
},
|
579
988
|
getErrors: () => {
|
580
|
-
var l,
|
581
|
-
return ((
|
989
|
+
var l, u;
|
990
|
+
return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
|
582
991
|
}
|
583
|
-
}), (l,
|
992
|
+
}), (l, u) => (f(), V(se, {
|
584
993
|
modelValue: n.value,
|
585
|
-
"onUpdate:modelValue":
|
994
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
|
586
995
|
type: n.value.enableTime ? "datetime-local" : "date",
|
587
996
|
schema: l.schema,
|
588
997
|
ref_key: "inputRef",
|
589
998
|
ref: e
|
590
999
|
}, null, 8, ["modelValue", "type", "schema"]));
|
591
1000
|
}
|
592
|
-
}),
|
1001
|
+
}), wt = /* @__PURE__ */ U({
|
593
1002
|
__name: "NumberInput",
|
594
|
-
props: /* @__PURE__ */
|
1003
|
+
props: /* @__PURE__ */ N({
|
595
1004
|
schema: {}
|
596
1005
|
}, {
|
597
1006
|
modelValue: { type: Object, default: {} },
|
598
1007
|
modelModifiers: {}
|
599
1008
|
}),
|
600
1009
|
emits: ["update:modelValue"],
|
601
|
-
setup(t, { expose:
|
602
|
-
const n =
|
603
|
-
return
|
1010
|
+
setup(t, { expose: o }) {
|
1011
|
+
const n = G(t, "modelValue"), e = E(null);
|
1012
|
+
return o({
|
604
1013
|
onReset: () => {
|
605
1014
|
var l;
|
606
1015
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -610,30 +1019,30 @@ const re = /* @__PURE__ */ F({
|
|
610
1019
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
611
1020
|
},
|
612
1021
|
getErrors: () => {
|
613
|
-
var l,
|
614
|
-
return ((
|
1022
|
+
var l, u;
|
1023
|
+
return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
|
615
1024
|
}
|
616
|
-
}), (l,
|
1025
|
+
}), (l, u) => (f(), V(se, {
|
617
1026
|
modelValue: n.value,
|
618
|
-
"onUpdate:modelValue":
|
1027
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
|
619
1028
|
type: "number",
|
620
1029
|
schema: l.schema,
|
621
1030
|
ref_key: "inputRef",
|
622
1031
|
ref: e
|
623
1032
|
}, null, 8, ["modelValue", "schema"]));
|
624
1033
|
}
|
625
|
-
}),
|
1034
|
+
}), Ot = /* @__PURE__ */ U({
|
626
1035
|
__name: "EmailInput",
|
627
|
-
props: /* @__PURE__ */
|
1036
|
+
props: /* @__PURE__ */ N({
|
628
1037
|
schema: {}
|
629
1038
|
}, {
|
630
1039
|
modelValue: { type: Object, default: {} },
|
631
1040
|
modelModifiers: {}
|
632
1041
|
}),
|
633
1042
|
emits: ["update:modelValue"],
|
634
|
-
setup(t, { expose:
|
635
|
-
const n =
|
636
|
-
return
|
1043
|
+
setup(t, { expose: o }) {
|
1044
|
+
const n = G(t, "modelValue"), e = E(null);
|
1045
|
+
return o({
|
637
1046
|
onReset: () => {
|
638
1047
|
var l;
|
639
1048
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -643,30 +1052,30 @@ const re = /* @__PURE__ */ F({
|
|
643
1052
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
644
1053
|
},
|
645
1054
|
getErrors: () => {
|
646
|
-
var l,
|
647
|
-
return ((
|
1055
|
+
var l, u;
|
1056
|
+
return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
|
648
1057
|
}
|
649
|
-
}), (l,
|
1058
|
+
}), (l, u) => (f(), V(se, {
|
650
1059
|
modelValue: n.value,
|
651
|
-
"onUpdate:modelValue":
|
1060
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
|
652
1061
|
type: "email",
|
653
1062
|
schema: l.schema,
|
654
1063
|
ref_key: "inputRef",
|
655
1064
|
ref: e
|
656
1065
|
}, null, 8, ["modelValue", "schema"]));
|
657
1066
|
}
|
658
|
-
}),
|
1067
|
+
}), Et = /* @__PURE__ */ U({
|
659
1068
|
__name: "PasswordInput",
|
660
|
-
props: /* @__PURE__ */
|
1069
|
+
props: /* @__PURE__ */ N({
|
661
1070
|
schema: {}
|
662
1071
|
}, {
|
663
1072
|
modelValue: { type: Object, default: {} },
|
664
1073
|
modelModifiers: {}
|
665
1074
|
}),
|
666
1075
|
emits: ["update:modelValue"],
|
667
|
-
setup(t, { expose:
|
668
|
-
const n =
|
669
|
-
return
|
1076
|
+
setup(t, { expose: o }) {
|
1077
|
+
const n = G(t, "modelValue"), e = E(null);
|
1078
|
+
return o({
|
670
1079
|
onReset: () => {
|
671
1080
|
var l;
|
672
1081
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -676,21 +1085,21 @@ const re = /* @__PURE__ */ F({
|
|
676
1085
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
677
1086
|
},
|
678
1087
|
getErrors: () => {
|
679
|
-
var l,
|
680
|
-
return ((
|
1088
|
+
var l, u;
|
1089
|
+
return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
|
681
1090
|
}
|
682
|
-
}), (l,
|
1091
|
+
}), (l, u) => (f(), V(se, {
|
683
1092
|
modelValue: n.value,
|
684
|
-
"onUpdate:modelValue":
|
1093
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
|
685
1094
|
type: "password",
|
686
1095
|
schema: l.schema,
|
687
1096
|
ref_key: "inputRef",
|
688
1097
|
ref: e
|
689
1098
|
}, null, 8, ["modelValue", "schema"]));
|
690
1099
|
}
|
691
|
-
}),
|
1100
|
+
}), xt = /* @__PURE__ */ U({
|
692
1101
|
__name: "SelectInput",
|
693
|
-
props: /* @__PURE__ */
|
1102
|
+
props: /* @__PURE__ */ N({
|
694
1103
|
schema: Object,
|
695
1104
|
type: String,
|
696
1105
|
formId: String
|
@@ -699,54 +1108,54 @@ const re = /* @__PURE__ */ F({
|
|
699
1108
|
modelModifiers: {}
|
700
1109
|
}),
|
701
1110
|
emits: ["update:modelValue"],
|
702
|
-
setup(t, { expose:
|
703
|
-
const n = t, e =
|
704
|
-
|
1111
|
+
setup(t, { expose: o }) {
|
1112
|
+
const n = t, e = G(t, "modelValue"), l = E(null), u = E(null), r = E(!1), s = E([]), y = E(""), p = E(1), c = S(() => e.value.interface ?? "popover"), v = S(() => e.value.optionsPlacement === "top" ? "top" : "bottom"), i = S(() => s.value.filter((a) => !!a.isChecked)), m = S(() => !y.value && me(i.value) && !r.value ? e.value.placeholder ?? "Select an option" : "");
|
1113
|
+
I([y, () => e.value.options], M, {
|
705
1114
|
immediate: !0,
|
706
1115
|
deep: !0
|
707
|
-
}),
|
708
|
-
() => !e.value.dependsOn || !n.schema ? null : (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).map((
|
1116
|
+
}), I(() => e.value.value, _, { immediate: !0, deep: !0 }), I(
|
1117
|
+
() => !e.value.dependsOn || !n.schema ? null : (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).map((h) => {
|
709
1118
|
var k;
|
710
|
-
return (k = n.schema[
|
1119
|
+
return (k = n.schema[h]) == null ? void 0 : k.value;
|
711
1120
|
}),
|
712
|
-
async (
|
713
|
-
|
1121
|
+
async (a, h) => {
|
1122
|
+
a && h && !oe(a, h) && (C(), s.value = [], await M());
|
714
1123
|
},
|
715
1124
|
{ deep: !0 }
|
716
1125
|
);
|
717
|
-
function
|
718
|
-
e.value.error = "",
|
1126
|
+
function C() {
|
1127
|
+
e.value.error = "", y.value = "", p.value = 1, e.value.value = e.value.multiple ? [] : "", Ze(s.value);
|
719
1128
|
}
|
720
|
-
function
|
721
|
-
if (
|
722
|
-
e.value.multiple ?
|
1129
|
+
function x(a) {
|
1130
|
+
if (a.isChecked) return _e(a, s.value);
|
1131
|
+
e.value.multiple ? X(a, s.value) : (C(), X(a, s.value), L()), y.value = "";
|
723
1132
|
}
|
724
|
-
function
|
725
|
-
switch (
|
1133
|
+
function w() {
|
1134
|
+
switch (c.value) {
|
726
1135
|
case "action-sheet":
|
727
|
-
|
1136
|
+
R();
|
728
1137
|
break;
|
729
1138
|
case "alert":
|
730
|
-
|
1139
|
+
F();
|
731
1140
|
break;
|
732
1141
|
case "popover":
|
733
1142
|
default:
|
734
|
-
|
1143
|
+
r.value = !0;
|
735
1144
|
break;
|
736
1145
|
}
|
737
1146
|
}
|
738
|
-
async function
|
739
|
-
if (await
|
740
|
-
|
1147
|
+
async function R() {
|
1148
|
+
if (await M(), e.value.multiple) {
|
1149
|
+
r.value = !0;
|
741
1150
|
return;
|
742
1151
|
}
|
743
|
-
await (await
|
1152
|
+
await (await Be.create({
|
744
1153
|
header: e.value.label || "Select an option",
|
745
1154
|
buttons: [
|
746
|
-
...s.value.map((
|
747
|
-
text:
|
748
|
-
cssClass:
|
749
|
-
handler: () => (
|
1155
|
+
...s.value.map((h) => ({
|
1156
|
+
text: h.label,
|
1157
|
+
cssClass: h.isChecked ? "selected-option" : "",
|
1158
|
+
handler: () => (x(h), !1)
|
750
1159
|
})),
|
751
1160
|
{
|
752
1161
|
text: "Cancel",
|
@@ -755,17 +1164,17 @@ const re = /* @__PURE__ */ F({
|
|
755
1164
|
]
|
756
1165
|
})).present();
|
757
1166
|
}
|
758
|
-
async function
|
759
|
-
await
|
760
|
-
const
|
1167
|
+
async function F() {
|
1168
|
+
await M();
|
1169
|
+
const a = s.value.map((k) => ({
|
761
1170
|
label: k.label,
|
762
1171
|
type: e.value.multiple ? "checkbox" : "radio",
|
763
1172
|
value: k,
|
764
1173
|
checked: k.isChecked
|
765
1174
|
}));
|
766
|
-
await (await
|
1175
|
+
await (await Pe.create({
|
767
1176
|
header: e.value.label || "Select an option",
|
768
|
-
inputs:
|
1177
|
+
inputs: a,
|
769
1178
|
buttons: [
|
770
1179
|
{
|
771
1180
|
text: "Cancel",
|
@@ -775,89 +1184,89 @@ const re = /* @__PURE__ */ F({
|
|
775
1184
|
text: "OK",
|
776
1185
|
handler: (k) => {
|
777
1186
|
if (e.value.multiple)
|
778
|
-
s.value.forEach((
|
779
|
-
const
|
780
|
-
|
1187
|
+
s.value.forEach((g) => _e(g, s.value)), k.forEach((g) => {
|
1188
|
+
const D = s.value.find((H) => H.value === g.value);
|
1189
|
+
D && X(D, s.value);
|
781
1190
|
});
|
782
1191
|
else {
|
783
|
-
|
784
|
-
const
|
785
|
-
|
1192
|
+
C();
|
1193
|
+
const g = s.value.find((D) => D.value === k.value);
|
1194
|
+
g && X(g, s.value);
|
786
1195
|
}
|
787
|
-
|
1196
|
+
L();
|
788
1197
|
}
|
789
1198
|
}
|
790
1199
|
]
|
791
1200
|
})).present();
|
792
1201
|
}
|
793
|
-
async function
|
794
|
-
if (e.value.required &&
|
1202
|
+
async function q() {
|
1203
|
+
if (e.value.required && me(i.value))
|
795
1204
|
return "This field is required";
|
796
1205
|
if (e.value.validation) {
|
797
|
-
const
|
798
|
-
if (
|
799
|
-
return
|
1206
|
+
const a = await e.value.validation(i.value, n == null ? void 0 : n.schema);
|
1207
|
+
if (a && a.length)
|
1208
|
+
return a.join();
|
800
1209
|
}
|
801
1210
|
return !0;
|
802
1211
|
}
|
803
|
-
const { onFocus:
|
1212
|
+
const { onFocus: W, applyValidationState: J } = ue(
|
804
1213
|
l,
|
805
1214
|
e,
|
806
|
-
|
807
|
-
|
808
|
-
|
1215
|
+
S(() => e.value.multiple ? i.value : i.value[0]),
|
1216
|
+
S(() => n == null ? void 0 : n.schema),
|
1217
|
+
q
|
809
1218
|
);
|
810
|
-
function
|
811
|
-
var
|
812
|
-
|
1219
|
+
function Z(a) {
|
1220
|
+
var h;
|
1221
|
+
a.target === ((h = l.value) == null ? void 0 : h.$el) && (W(), c.value === "popover" && (r.value = !0));
|
813
1222
|
}
|
814
|
-
async function
|
1223
|
+
async function L(a) {
|
815
1224
|
var k;
|
816
|
-
if ((k =
|
817
|
-
|
818
|
-
const
|
819
|
-
|
1225
|
+
if ((k = a == null ? void 0 : a.relatedTarget) != null && k.closest(".suggestions-list")) return;
|
1226
|
+
r.value = !1;
|
1227
|
+
const h = await q();
|
1228
|
+
h === !0 ? (e.value.error = "", e.value.value = e.value.multiple ? i.value : i.value[0]) : e.value.error = typeof h == "string" ? h : "Validation failed", await J(h === !0);
|
820
1229
|
}
|
821
|
-
async function
|
822
|
-
const
|
1230
|
+
async function M() {
|
1231
|
+
const a = [];
|
823
1232
|
if (typeof e.value.options == "function") {
|
824
|
-
let
|
825
|
-
e.value.dependsOn && n.schema && (
|
826
|
-
(
|
827
|
-
var
|
828
|
-
return
|
1233
|
+
let h = {};
|
1234
|
+
e.value.dependsOn && n.schema && (h = (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).reduce(
|
1235
|
+
(D, H) => {
|
1236
|
+
var Q;
|
1237
|
+
return D[H] = (Q = n.schema[H]) == null ? void 0 : Q.value, D;
|
829
1238
|
},
|
830
1239
|
{}
|
831
1240
|
));
|
832
|
-
const k = await e.value.options(
|
833
|
-
|
834
|
-
} else Array.isArray(e.value.options) &&
|
835
|
-
|
1241
|
+
const k = await e.value.options(y.value, h);
|
1242
|
+
a.push(...k.filter((g) => !!g.label));
|
1243
|
+
} else Array.isArray(e.value.options) && a.push(...Je(e.value.options, y.value));
|
1244
|
+
i.value.forEach((h) => X(h, a)), s.value = a;
|
836
1245
|
}
|
837
|
-
function
|
838
|
-
const
|
839
|
-
|
840
|
-
value:
|
841
|
-
label:
|
1246
|
+
function _() {
|
1247
|
+
const a = e.value.value;
|
1248
|
+
a && (Array.isArray(a) ? a.forEach((h) => X(h, s.value)) : X(typeof a == "object" ? a : {
|
1249
|
+
value: a,
|
1250
|
+
label: a
|
842
1251
|
}, s.value));
|
843
1252
|
}
|
844
|
-
return
|
845
|
-
|
846
|
-
}),
|
847
|
-
onValueUpdate:
|
848
|
-
onReset:
|
1253
|
+
return ge(() => {
|
1254
|
+
M();
|
1255
|
+
}), o({
|
1256
|
+
onValueUpdate: L,
|
1257
|
+
onReset: C,
|
849
1258
|
getErrors: () => e.value.error ? [e.value.error] : []
|
850
|
-
}), (
|
1259
|
+
}), (a, h) => (f(), $("div", {
|
851
1260
|
class: "autocomplete-container",
|
852
|
-
onFocusout:
|
1261
|
+
onFocusout: L,
|
853
1262
|
ref_key: "containerRef",
|
854
|
-
ref:
|
1263
|
+
ref: u
|
855
1264
|
}, [
|
856
|
-
|
1265
|
+
P(d(Ve), {
|
857
1266
|
ref_key: "inputRef",
|
858
1267
|
ref: l,
|
859
|
-
modelValue:
|
860
|
-
"onUpdate:modelValue":
|
1268
|
+
modelValue: y.value,
|
1269
|
+
"onUpdate:modelValue": h[0] || (h[0] = (k) => y.value = k),
|
861
1270
|
fill: e.value.fill ?? "solid",
|
862
1271
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
863
1272
|
type: t.type ?? "text",
|
@@ -867,23 +1276,23 @@ const re = /* @__PURE__ */ F({
|
|
867
1276
|
placeholder: m.value,
|
868
1277
|
disabled: e.value.disabled,
|
869
1278
|
counter: e.value.counter,
|
870
|
-
onIonFocus:
|
1279
|
+
onIonFocus: Z,
|
871
1280
|
debounce: 300,
|
872
|
-
onClick:
|
1281
|
+
onClick: w
|
873
1282
|
}, {
|
874
1283
|
default: b(() => [
|
875
|
-
|
876
|
-
e.value.multiple ? (
|
1284
|
+
P(ye, { model: e.value }, null, 8, ["model"]),
|
1285
|
+
e.value.multiple ? (f(), V(d(Y), {
|
877
1286
|
key: 0,
|
878
1287
|
style: { width: "fit-content" },
|
879
1288
|
slot: "start"
|
880
1289
|
}, {
|
881
1290
|
default: b(() => [
|
882
|
-
(
|
1291
|
+
(f(!0), $(T, null, K(i.value, (k, g) => (f(), V(d($e), { key: g }, {
|
883
1292
|
default: b(() => [
|
884
|
-
|
1293
|
+
P(d(Y), null, {
|
885
1294
|
default: b(() => [
|
886
|
-
|
1295
|
+
z(A(k.label), 1)
|
887
1296
|
]),
|
888
1297
|
_: 2
|
889
1298
|
}, 1024)
|
@@ -892,7 +1301,7 @@ const re = /* @__PURE__ */ F({
|
|
892
1301
|
}, 1024))), 128))
|
893
1302
|
]),
|
894
1303
|
_: 1
|
895
|
-
})) : (
|
1304
|
+
})) : (f(), V(d(Y), {
|
896
1305
|
key: 1,
|
897
1306
|
slot: "start",
|
898
1307
|
class: "ion-no-wrap"
|
@@ -900,44 +1309,44 @@ const re = /* @__PURE__ */ F({
|
|
900
1309
|
default: b(() => {
|
901
1310
|
var k;
|
902
1311
|
return [
|
903
|
-
|
1312
|
+
z(A(((k = i.value[0]) == null ? void 0 : k.label) ?? ""), 1)
|
904
1313
|
];
|
905
1314
|
}),
|
906
1315
|
_: 1
|
907
1316
|
})),
|
908
|
-
|
1317
|
+
P(d(ce), {
|
909
1318
|
slot: "end",
|
910
|
-
icon:
|
1319
|
+
icon: d(Te)
|
911
1320
|
}, null, 8, ["icon"]),
|
912
|
-
|
1321
|
+
i.value.length > 0 || y.value ? (f(), V(d(ce), {
|
913
1322
|
key: 2,
|
914
1323
|
slot: "end",
|
915
|
-
icon:
|
916
|
-
onClick:
|
1324
|
+
icon: d(qe),
|
1325
|
+
onClick: C,
|
917
1326
|
style: { "z-index": "999999" }
|
918
|
-
}, null, 8, ["icon"])) :
|
1327
|
+
}, null, 8, ["icon"])) : O("", !0)
|
919
1328
|
]),
|
920
1329
|
_: 1
|
921
1330
|
}, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter"]),
|
922
|
-
|
1331
|
+
r.value && s.value.length > 0 && c.value === "popover" ? (f(), V(d(Fe), {
|
923
1332
|
key: 0,
|
924
|
-
class:
|
1333
|
+
class: ne(["suggestions-list", v.value])
|
925
1334
|
}, {
|
926
1335
|
default: b(() => [
|
927
|
-
(
|
1336
|
+
(f(!0), $(T, null, K(s.value, (k) => (f(), V(d(ze), {
|
928
1337
|
button: "",
|
929
1338
|
key: k.label,
|
930
|
-
onClick: (
|
1339
|
+
onClick: (g) => x(k)
|
931
1340
|
}, {
|
932
1341
|
default: b(() => [
|
933
|
-
e.value.multiple ? (
|
1342
|
+
e.value.multiple ? (f(), V(d(be), {
|
934
1343
|
key: 0,
|
935
1344
|
slot: "start",
|
936
1345
|
checked: k.isChecked
|
937
|
-
}, null, 8, ["checked"])) :
|
938
|
-
|
1346
|
+
}, null, 8, ["checked"])) : O("", !0),
|
1347
|
+
P(d(Y), null, {
|
939
1348
|
default: b(() => [
|
940
|
-
|
1349
|
+
z(A(k.label), 1)
|
941
1350
|
]),
|
942
1351
|
_: 2
|
943
1352
|
}, 1024)
|
@@ -946,42 +1355,37 @@ const re = /* @__PURE__ */ F({
|
|
946
1355
|
}, 1032, ["onClick"]))), 128))
|
947
1356
|
]),
|
948
1357
|
_: 1
|
949
|
-
}, 8, ["class"])) :
|
1358
|
+
}, 8, ["class"])) : O("", !0)
|
950
1359
|
], 544));
|
951
1360
|
}
|
952
|
-
}),
|
953
|
-
const n = t.__vccOpts || t;
|
954
|
-
for (const [e, l] of u)
|
955
|
-
n[e] = l;
|
956
|
-
return n;
|
957
|
-
}, at = /* @__PURE__ */ he(lt, [["__scopeId", "data-v-4766dec2"]]), nt = /* @__PURE__ */ F({
|
1361
|
+
}), Rt = /* @__PURE__ */ de(xt, [["__scopeId", "data-v-4766dec2"]]), At = /* @__PURE__ */ U({
|
958
1362
|
__name: "TextAreaInput",
|
959
|
-
props: /* @__PURE__ */
|
1363
|
+
props: /* @__PURE__ */ N({
|
960
1364
|
schema: {}
|
961
1365
|
}, {
|
962
1366
|
modelValue: { type: Object, default: {} },
|
963
1367
|
modelModifiers: {}
|
964
1368
|
}),
|
965
1369
|
emits: ["update:modelValue"],
|
966
|
-
setup(t, { expose:
|
967
|
-
const n = t, e =
|
1370
|
+
setup(t, { expose: o }) {
|
1371
|
+
const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), { onValueUpdate: s, onFocus: y, onReset: p, getErrors: c } = ue(
|
968
1372
|
l,
|
969
1373
|
e,
|
970
|
-
|
971
|
-
|
1374
|
+
u,
|
1375
|
+
r
|
972
1376
|
);
|
973
|
-
return
|
1377
|
+
return I(
|
974
1378
|
() => e.value.value,
|
975
|
-
(
|
976
|
-
),
|
977
|
-
onReset:
|
1379
|
+
(v) => u.value = v
|
1380
|
+
), o({
|
1381
|
+
onReset: p,
|
978
1382
|
onValueUpdate: s,
|
979
|
-
getErrors:
|
980
|
-
}), (
|
1383
|
+
getErrors: c
|
1384
|
+
}), (v, i) => (f(), V(d(Ie), {
|
981
1385
|
ref_key: "inputRef",
|
982
1386
|
ref: l,
|
983
|
-
modelValue:
|
984
|
-
"onUpdate:modelValue":
|
1387
|
+
modelValue: u.value,
|
1388
|
+
"onUpdate:modelValue": i[0] || (i[0] = (m) => u.value = m),
|
985
1389
|
"clear-input": !0,
|
986
1390
|
fill: e.value.fill ?? "solid",
|
987
1391
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
@@ -999,22 +1403,22 @@ const re = /* @__PURE__ */ F({
|
|
999
1403
|
"max-length": e.value.maxLength,
|
1000
1404
|
"min-length": e.value.minLength,
|
1001
1405
|
pattern: e.value.pattern,
|
1002
|
-
onIonFocus:
|
1003
|
-
onIonChange:
|
1004
|
-
onIonBlur:
|
1406
|
+
onIonFocus: d(y),
|
1407
|
+
onIonChange: d(s),
|
1408
|
+
onIonBlur: d(s)
|
1005
1409
|
}, {
|
1006
1410
|
default: b(() => [
|
1007
|
-
|
1411
|
+
P(ye, { model: e.value }, null, 8, ["model"])
|
1008
1412
|
]),
|
1009
1413
|
_: 1
|
1010
1414
|
}, 8, ["modelValue", "fill", "label-placement", "required", "error-text", "autofocus", "placeholder", "disabled", "counter", "min", "max", "rows", "cols", "auto-grow", "max-length", "min-length", "pattern", "onIonFocus", "onIonChange", "onIonBlur"]));
|
1011
1415
|
}
|
1012
|
-
}),
|
1416
|
+
}), $t = {
|
1013
1417
|
class: "ion-margin-end",
|
1014
1418
|
style: { "flex-grow": "1" }
|
1015
|
-
},
|
1419
|
+
}, Ft = { style: { display: "flex", "justify-content": "flex-end" } }, zt = /* @__PURE__ */ U({
|
1016
1420
|
__name: "RepeatInput",
|
1017
|
-
props: /* @__PURE__ */
|
1421
|
+
props: /* @__PURE__ */ N({
|
1018
1422
|
schema: {},
|
1019
1423
|
data: {},
|
1020
1424
|
computedData: {}
|
@@ -1023,200 +1427,200 @@ const re = /* @__PURE__ */ F({
|
|
1023
1427
|
modelModifiers: {}
|
1024
1428
|
}),
|
1025
1429
|
emits: ["update:modelValue"],
|
1026
|
-
setup(t, { expose:
|
1027
|
-
const n =
|
1028
|
-
label: `Set ${
|
1029
|
-
value:
|
1030
|
-
other: Object.entries(
|
1031
|
-
(
|
1430
|
+
setup(t, { expose: o }) {
|
1431
|
+
const n = G(t, "modelValue"), e = E([]), { dynamicRefs: l, resetForm: u, getFormErrors: r, updateFormValues: s } = we(), y = S(() => e.value.map((C, x) => ({
|
1432
|
+
label: `Set ${x + 1}`,
|
1433
|
+
value: x,
|
1434
|
+
other: Object.entries(C).reduce(
|
1435
|
+
(w, [R, F]) => (w[R] = F.value, w),
|
1032
1436
|
{}
|
1033
1437
|
)
|
1034
1438
|
})));
|
1035
|
-
|
1036
|
-
|
1037
|
-
(
|
1038
|
-
n.value.value =
|
1439
|
+
I(
|
1440
|
+
y,
|
1441
|
+
(C) => {
|
1442
|
+
n.value.value = C;
|
1039
1443
|
},
|
1040
1444
|
{ deep: !0, immediate: !0 }
|
1041
|
-
),
|
1042
|
-
function
|
1043
|
-
n.value.children && e.value.push(
|
1445
|
+
), ge(p);
|
1446
|
+
function p() {
|
1447
|
+
n.value.children && e.value.push(he(n.value.children));
|
1044
1448
|
}
|
1045
|
-
function
|
1046
|
-
e.value.splice(
|
1449
|
+
function c(C) {
|
1450
|
+
e.value.splice(C, 1);
|
1047
1451
|
}
|
1048
|
-
function
|
1049
|
-
|
1452
|
+
function v() {
|
1453
|
+
u();
|
1050
1454
|
}
|
1051
|
-
function
|
1052
|
-
return
|
1455
|
+
function i() {
|
1456
|
+
return r();
|
1053
1457
|
}
|
1054
1458
|
async function m() {
|
1055
1459
|
await s();
|
1056
1460
|
}
|
1057
|
-
return
|
1461
|
+
return o({
|
1058
1462
|
onValueUpdate: m,
|
1059
|
-
onReset:
|
1060
|
-
getErrors:
|
1061
|
-
}), (
|
1463
|
+
onReset: v,
|
1464
|
+
getErrors: i
|
1465
|
+
}), (C, x) => (f(!0), $(T, null, K(e.value, (w, R) => (f(), $("div", {
|
1062
1466
|
class: "repeat-input-wrapper",
|
1063
|
-
key:
|
1467
|
+
key: R
|
1064
1468
|
}, [
|
1065
|
-
|
1066
|
-
|
1469
|
+
B("div", $t, [
|
1470
|
+
P(d(le), null, {
|
1067
1471
|
default: b(() => [
|
1068
|
-
(
|
1069
|
-
var
|
1070
|
-
return
|
1071
|
-
|
1072
|
-
key: `${
|
1073
|
-
size: ((
|
1074
|
-
"size-sm": (
|
1075
|
-
"size-md": (
|
1076
|
-
"size-lg": (
|
1077
|
-
"size-xl": (
|
1472
|
+
(f(!0), $(T, null, K(Object.keys(w), (F) => {
|
1473
|
+
var q, W, J, Z, L;
|
1474
|
+
return f(), $(T, null, [
|
1475
|
+
d(ie)(w[F], C.data, C.computedData) ? (f(), V(d(ae), {
|
1476
|
+
key: `${R}-${F}`,
|
1477
|
+
size: ((q = w[F].grid) == null ? void 0 : q.xs) ?? "12",
|
1478
|
+
"size-sm": (W = w[F].grid) == null ? void 0 : W.sm,
|
1479
|
+
"size-md": (J = w[F].grid) == null ? void 0 : J.md,
|
1480
|
+
"size-lg": (Z = w[F].grid) == null ? void 0 : Z.lg,
|
1481
|
+
"size-xl": (L = w[F].grid) == null ? void 0 : L.xl,
|
1078
1482
|
class: "ion-margin-bottom"
|
1079
1483
|
}, {
|
1080
1484
|
default: b(() => [
|
1081
|
-
(
|
1082
|
-
modelValue:
|
1083
|
-
"onUpdate:modelValue": (
|
1084
|
-
schema:
|
1085
|
-
"ref-key": `${
|
1485
|
+
(f(), V(fe(w[F].type), {
|
1486
|
+
modelValue: w[F],
|
1487
|
+
"onUpdate:modelValue": (M) => w[F] = M,
|
1488
|
+
schema: w,
|
1489
|
+
"ref-key": `${R}-${F}`,
|
1086
1490
|
ref_for: !0,
|
1087
1491
|
ref_key: "dynamicRefs",
|
1088
1492
|
ref: l
|
1089
1493
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "ref-key"]))
|
1090
1494
|
]),
|
1091
1495
|
_: 2
|
1092
|
-
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) :
|
1496
|
+
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
|
1093
1497
|
], 64);
|
1094
1498
|
}), 256))
|
1095
1499
|
]),
|
1096
1500
|
_: 2
|
1097
1501
|
}, 1024)
|
1098
1502
|
]),
|
1099
|
-
|
1100
|
-
|
1503
|
+
B("div", Ft, [
|
1504
|
+
R === e.value.length - 1 ? (f(), V(d(j), {
|
1101
1505
|
key: 0,
|
1102
|
-
onClick:
|
1506
|
+
onClick: p,
|
1103
1507
|
color: "primary"
|
1104
1508
|
}, {
|
1105
1509
|
default: b(() => [
|
1106
|
-
|
1510
|
+
P(d(ce), {
|
1107
1511
|
slot: "icon-only",
|
1108
|
-
icon:
|
1512
|
+
icon: d(Le)
|
1109
1513
|
}, null, 8, ["icon"])
|
1110
1514
|
]),
|
1111
1515
|
_: 1
|
1112
|
-
})) :
|
1113
|
-
e.value.length > 1 ? (
|
1516
|
+
})) : O("", !0),
|
1517
|
+
e.value.length > 1 ? (f(), V(d(j), {
|
1114
1518
|
key: 1,
|
1115
|
-
onClick: (
|
1519
|
+
onClick: (F) => c(R),
|
1116
1520
|
color: "warning"
|
1117
1521
|
}, {
|
1118
1522
|
default: b(() => [
|
1119
|
-
|
1523
|
+
P(d(ce), {
|
1120
1524
|
slot: "icon-only",
|
1121
|
-
icon:
|
1525
|
+
icon: d(Me)
|
1122
1526
|
}, null, 8, ["icon"])
|
1123
1527
|
]),
|
1124
1528
|
_: 2
|
1125
|
-
}, 1032, ["onClick"])) :
|
1529
|
+
}, 1032, ["onClick"])) : O("", !0)
|
1126
1530
|
])
|
1127
1531
|
]))), 128));
|
1128
1532
|
}
|
1129
|
-
}),
|
1533
|
+
}), Bt = /* @__PURE__ */ de(zt, [["__scopeId", "data-v-060bdf58"]]), Pt = /* @__PURE__ */ U({
|
1130
1534
|
__name: "CheckboxInput",
|
1131
|
-
props: /* @__PURE__ */
|
1535
|
+
props: /* @__PURE__ */ N({
|
1132
1536
|
schema: {}
|
1133
1537
|
}, {
|
1134
1538
|
modelValue: { type: Object, default: {} },
|
1135
1539
|
modelModifiers: {}
|
1136
1540
|
}),
|
1137
1541
|
emits: ["update:modelValue"],
|
1138
|
-
setup(t, { expose:
|
1139
|
-
const n = t, e =
|
1140
|
-
function
|
1141
|
-
|
1542
|
+
setup(t, { expose: o }) {
|
1543
|
+
const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), s = S(() => Se(e.value)), { onValueUpdate: y, onFocus: p, getErrors: c } = ue(l, e, u, r);
|
1544
|
+
function v() {
|
1545
|
+
u.value = !1, e.value.error = "", e.value.value = !1;
|
1142
1546
|
}
|
1143
|
-
return
|
1547
|
+
return I(
|
1144
1548
|
() => e.value.value,
|
1145
|
-
(
|
1146
|
-
),
|
1147
|
-
onValueUpdate:
|
1148
|
-
onReset:
|
1149
|
-
getErrors:
|
1150
|
-
}), (
|
1151
|
-
modelValue:
|
1152
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
1549
|
+
(i) => u.value = i
|
1550
|
+
), o({
|
1551
|
+
onValueUpdate: y,
|
1552
|
+
onReset: v,
|
1553
|
+
getErrors: c
|
1554
|
+
}), (i, m) => (f(), V(d(be), {
|
1555
|
+
modelValue: u.value,
|
1556
|
+
"onUpdate:modelValue": m[0] || (m[0] = (C) => u.value = C),
|
1153
1557
|
ref_key: "inputRef",
|
1154
1558
|
ref: l,
|
1155
1559
|
required: e.value.required,
|
1156
1560
|
"error-text": e.value.error,
|
1157
1561
|
disabled: e.value.disabled,
|
1158
|
-
onIonFocus:
|
1159
|
-
onIonChange:
|
1160
|
-
onIonBlur:
|
1562
|
+
onIonFocus: d(p),
|
1563
|
+
onIonChange: d(y),
|
1564
|
+
onIonBlur: d(y)
|
1161
1565
|
}, {
|
1162
1566
|
default: b(() => [
|
1163
|
-
|
1567
|
+
z(A(s.value), 1)
|
1164
1568
|
]),
|
1165
1569
|
_: 1
|
1166
1570
|
}, 8, ["modelValue", "required", "error-text", "disabled", "onIonFocus", "onIonChange", "onIonBlur"]));
|
1167
1571
|
}
|
1168
|
-
}),
|
1572
|
+
}), It = /* @__PURE__ */ U({
|
1169
1573
|
__name: "RadioInput",
|
1170
|
-
props: /* @__PURE__ */
|
1574
|
+
props: /* @__PURE__ */ N({
|
1171
1575
|
schema: {}
|
1172
1576
|
}, {
|
1173
1577
|
modelValue: { type: Object, default: {} },
|
1174
1578
|
modelModifiers: {}
|
1175
1579
|
}),
|
1176
1580
|
emits: ["update:modelValue"],
|
1177
|
-
setup(t, { expose:
|
1178
|
-
const n = t, e =
|
1179
|
-
function
|
1180
|
-
e.value.error = "",
|
1581
|
+
setup(t, { expose: o }) {
|
1582
|
+
const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), s = E([]), y = S(() => Se(e.value)), { onValueUpdate: p, onFocus: c, getErrors: v } = ue(l, e, u, r);
|
1583
|
+
function i() {
|
1584
|
+
e.value.error = "", u.value = void 0, e.value.value = void 0;
|
1181
1585
|
}
|
1182
|
-
function m(
|
1183
|
-
return
|
1586
|
+
function m(x, w) {
|
1587
|
+
return x.value === w.value;
|
1184
1588
|
}
|
1185
|
-
async function
|
1589
|
+
async function C() {
|
1186
1590
|
typeof e.value.options == "function" ? s.value = await e.value.options() : s.value = e.value.options;
|
1187
1591
|
}
|
1188
|
-
return
|
1592
|
+
return I(
|
1189
1593
|
() => e.value.value,
|
1190
|
-
(
|
1191
|
-
),
|
1192
|
-
onValueUpdate:
|
1193
|
-
onReset:
|
1194
|
-
getErrors:
|
1195
|
-
}),
|
1196
|
-
modelValue:
|
1197
|
-
"onUpdate:modelValue":
|
1594
|
+
(x) => u.value = x
|
1595
|
+
), o({
|
1596
|
+
onValueUpdate: p,
|
1597
|
+
onReset: i,
|
1598
|
+
getErrors: v
|
1599
|
+
}), ge(C), (x, w) => (f(), V(d(Ue), {
|
1600
|
+
modelValue: u.value,
|
1601
|
+
"onUpdate:modelValue": w[0] || (w[0] = (R) => u.value = R),
|
1198
1602
|
ref_key: "inputRef",
|
1199
1603
|
ref: l,
|
1200
1604
|
required: e.value.required,
|
1201
|
-
"helper-text":
|
1605
|
+
"helper-text": y.value,
|
1202
1606
|
"error-text": e.value.error,
|
1203
1607
|
disabled: e.value.disabled,
|
1204
1608
|
compareWith: m,
|
1205
1609
|
"allow-empty-selection": !e.value.required,
|
1206
|
-
onIonFocus:
|
1207
|
-
onIonChange:
|
1208
|
-
onIonBlur:
|
1610
|
+
onIonFocus: d(c),
|
1611
|
+
onIonChange: d(p),
|
1612
|
+
onIonBlur: d(p)
|
1209
1613
|
}, {
|
1210
1614
|
default: b(() => [
|
1211
|
-
(
|
1212
|
-
key:
|
1213
|
-
value:
|
1615
|
+
(f(!0), $(T, null, K(s.value, (R) => (f(), V(d(De), {
|
1616
|
+
key: R.value,
|
1617
|
+
value: R,
|
1214
1618
|
disabled: e.value.disabled,
|
1215
1619
|
"label-placement": "end",
|
1216
1620
|
justify: "start"
|
1217
1621
|
}, {
|
1218
1622
|
default: b(() => [
|
1219
|
-
|
1623
|
+
z(A(R.label), 1)
|
1220
1624
|
]),
|
1221
1625
|
_: 2
|
1222
1626
|
}, 1032, ["value", "disabled"]))), 128))
|
@@ -1225,69 +1629,70 @@ const re = /* @__PURE__ */ F({
|
|
1225
1629
|
}, 8, ["modelValue", "required", "helper-text", "error-text", "disabled", "allow-empty-selection", "onIonFocus", "onIonChange", "onIonBlur"]));
|
1226
1630
|
}
|
1227
1631
|
});
|
1228
|
-
function
|
1229
|
-
const e =
|
1230
|
-
function
|
1231
|
-
l.value[
|
1232
|
-
var
|
1233
|
-
(
|
1234
|
-
}), c
|
1632
|
+
function Lt(t, o, n) {
|
1633
|
+
const e = E({}), l = E({});
|
1634
|
+
function u(c, v, i) {
|
1635
|
+
l.value[c] = i, v.forEach((m) => {
|
1636
|
+
var C;
|
1637
|
+
(C = e.value)[m] ?? (C[m] = []), e.value[m].includes(c) || e.value[m].push(c);
|
1638
|
+
}), p(c);
|
1235
1639
|
}
|
1236
|
-
function
|
1237
|
-
return Object.entries(e.value).filter(([,
|
1238
|
-
(
|
1640
|
+
function r(c) {
|
1641
|
+
return Object.entries(e.value).filter(([, i]) => i.includes(c)).map(([i]) => i).reduce(
|
1642
|
+
(i, m) => (i[m] = o.value[m] ?? n.value[m], i),
|
1239
1643
|
{}
|
1240
1644
|
);
|
1241
1645
|
}
|
1242
|
-
function s(
|
1243
|
-
return
|
1646
|
+
function s(c, v) {
|
1647
|
+
return c ? Array.isArray(c) ? c.some((i) => v.some((m) => y(i, m.value))) : v.some((i) => y(c, i.value)) : !1;
|
1244
1648
|
}
|
1245
|
-
function
|
1246
|
-
return typeof
|
1649
|
+
function y(c, v) {
|
1650
|
+
return typeof c == "object" && c !== null ? c.value === v : String(c) === String(v);
|
1247
1651
|
}
|
1248
|
-
async function c
|
1249
|
-
if (!l.value[
|
1250
|
-
const
|
1652
|
+
async function p(c, v) {
|
1653
|
+
if (!l.value[c]) return;
|
1654
|
+
const i = r(c), m = Object.keys(i);
|
1251
1655
|
if (!(m.length === 0 || !m.every(
|
1252
|
-
(
|
1656
|
+
(x) => i[x] !== void 0 && i[x] !== null
|
1253
1657
|
)))
|
1254
1658
|
try {
|
1255
|
-
const
|
1256
|
-
if (!t.value[
|
1257
|
-
t.value[
|
1258
|
-
const
|
1259
|
-
if (!
|
1260
|
-
s(
|
1261
|
-
} catch (
|
1262
|
-
console.error(`Error loading options for ${
|
1659
|
+
const x = l.value[c], w = await x(v, i);
|
1660
|
+
if (!t.value[c]) return;
|
1661
|
+
t.value[c].options = w;
|
1662
|
+
const R = t.value[c].value;
|
1663
|
+
if (!R) return;
|
1664
|
+
s(R, w) || (t.value[c].value = t.value[c].multiple ? [] : "");
|
1665
|
+
} catch (x) {
|
1666
|
+
console.error(`Error loading options for ${c}:`, x);
|
1263
1667
|
}
|
1264
1668
|
}
|
1265
|
-
return
|
1266
|
-
[
|
1669
|
+
return I(
|
1670
|
+
[o, n],
|
1267
1671
|
() => {
|
1268
|
-
Object.entries(e.value).forEach(([
|
1269
|
-
(
|
1270
|
-
|
1672
|
+
Object.entries(e.value).forEach(([c, v]) => {
|
1673
|
+
(o.value[c] !== void 0 || n.value[c] !== void 0) && v.forEach((i) => {
|
1674
|
+
p(i);
|
1271
1675
|
});
|
1272
1676
|
});
|
1273
1677
|
},
|
1274
1678
|
{ deep: !0, immediate: !0 }
|
1275
1679
|
), {
|
1276
|
-
registerDependency:
|
1277
|
-
updateOptions:
|
1680
|
+
registerDependency: u,
|
1681
|
+
updateOptions: p
|
1278
1682
|
};
|
1279
1683
|
}
|
1280
|
-
const
|
1684
|
+
const Mt = {
|
1281
1685
|
install(t) {
|
1282
|
-
t.component("VForm",
|
1686
|
+
t.component("VForm", _t), t.component("TextInput", kt), t.component("DateInput", St), t.component("NumberInput", wt), t.component("EmailInput", Ot), t.component("PasswordInput", Et), t.component("SelectInput", Rt), t.component("TextAreaInput", At), t.component("RepeatInput", Bt), t.component("CheckboxInput", Pt), t.component("RadioInput", It), t.directive("maskito", je);
|
1283
1687
|
}
|
1284
1688
|
};
|
1285
1689
|
export {
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1690
|
+
Mt as VForm,
|
1691
|
+
Mt as default,
|
1692
|
+
Qe as useDataTransformation,
|
1693
|
+
Lt as useDependentOptions,
|
1694
|
+
we as useFormValidation,
|
1695
|
+
ue as useInputValidation,
|
1696
|
+
Xe as useMultiStepForm
|
1292
1697
|
};
|
1293
1698
|
//# sourceMappingURL=index.es.js.map
|