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