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