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