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