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