@uniquedj95/vform 3.2.0 → 3.3.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 +110 -1
- 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/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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +599 -599
- 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 +4 -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 C, computed as
|
2
|
-
import { IonGrid as
|
3
|
-
import { chevronDown as
|
4
|
-
import { maskito as
|
5
|
-
function
|
6
|
-
return new Promise((
|
1
|
+
import { ref as C, computed as w, watch as S, defineComponent as F, createBlock as V, openBlock as p, unref as v, withCtx as b, createVNode as A, createCommentVNode as R, createElementBlock as q, Fragment as T, renderList as K, resolveDynamicComponent as de, normalizeStyle as Ve, createTextVNode as I, toDisplayString as B, toRef as be, mergeModels as z, useModel as $, resolveDirective as _e, withDirectives as xe, onMounted as oe, normalizeClass as ke, createElementVNode as ie } from "vue";
|
2
|
+
import { IonGrid as Ce, IonRow as te, IonCol as le, IonButton as Z, IonLabel as H, IonText as Oe, IonInput as ve, IonInputPasswordToggle as Ee, IonChip as we, IonIcon as ee, IonList as Re, IonItem as Ae, IonCheckbox as fe, actionSheetController as Ie, alertController as Fe, IonTextarea as Ue, IonRadioGroup as Be, IonRadio as Se } from "@ionic/vue";
|
3
|
+
import { chevronDown as qe, close as ze, add as $e, remove as Te } from "ionicons/icons";
|
4
|
+
import { maskito as Le } from "@maskito/vue";
|
5
|
+
function De(t) {
|
6
|
+
return new Promise((u) => {
|
7
7
|
requestAnimationFrame(async () => {
|
8
|
-
const
|
9
|
-
|
8
|
+
const n = await t.getInputElement();
|
9
|
+
u(n);
|
10
10
|
});
|
11
11
|
});
|
12
12
|
}
|
13
|
-
const
|
13
|
+
const Me = {
|
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
|
+
}, je = {
|
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 Pe(t, u) {
|
24
|
+
const n = je[t];
|
25
|
+
return n[u % n.length];
|
26
26
|
}
|
27
|
-
function
|
28
|
-
const
|
29
|
-
let
|
27
|
+
function Ne(t) {
|
28
|
+
const u = [];
|
29
|
+
let n = "", e = 0, l = 0;
|
30
30
|
for (; e < t.length; ) {
|
31
|
-
const
|
32
|
-
if (["d", "a", "*"].includes(
|
31
|
+
const a = t[e];
|
32
|
+
if (["d", "a", "*"].includes(a)) {
|
33
33
|
let i = 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 [, c] =
|
40
|
-
i = c || parseInt(
|
37
|
+
const h = t.slice(e + 2, s);
|
38
|
+
if (h.includes(",")) {
|
39
|
+
const [, c] = h.split(",").map((r) => parseInt(r.trim()));
|
40
|
+
i = c || parseInt(h.split(",")[0]);
|
41
41
|
} else
|
42
|
-
i = parseInt(
|
42
|
+
i = parseInt(h);
|
43
43
|
e = s;
|
44
44
|
}
|
45
45
|
} else {
|
46
46
|
let s = e + 1;
|
47
|
-
for (; t[s] ===
|
47
|
+
for (; t[s] === a; )
|
48
48
|
i++, s++;
|
49
49
|
e = s - 1;
|
50
50
|
}
|
51
51
|
for (let s = 0; s < i; s++)
|
52
|
-
|
52
|
+
u.push(Me[a]), n += Pe(a, l++);
|
53
53
|
} else
|
54
|
-
|
54
|
+
u.push(a), n += a;
|
55
55
|
e++;
|
56
56
|
}
|
57
57
|
return {
|
58
|
-
mask:
|
59
|
-
placeholder:
|
60
|
-
elementPredicate:
|
58
|
+
mask: u,
|
59
|
+
placeholder: n,
|
60
|
+
elementPredicate: De
|
61
61
|
};
|
62
62
|
}
|
63
63
|
function ae(t) {
|
64
64
|
return t == null || Array.isArray(t) && !t.length || typeof t == "object" && !Object.keys(t).length || !t;
|
65
65
|
}
|
66
|
-
function ne(t,
|
67
|
-
return typeof t.condition == "function" ? t.condition(
|
66
|
+
function ne(t, u, n) {
|
67
|
+
return typeof t.condition == "function" ? t.condition(u, n) : !0;
|
68
68
|
}
|
69
|
-
function
|
69
|
+
function ue(t) {
|
70
70
|
if (typeof t != "object" || t === null)
|
71
71
|
return t;
|
72
72
|
if (Array.isArray(t))
|
73
|
-
return t.map((
|
74
|
-
const
|
75
|
-
return Object.entries(t).forEach(([
|
76
|
-
typeof e == "function" ?
|
77
|
-
}),
|
73
|
+
return t.map((n) => ue(n));
|
74
|
+
const u = {};
|
75
|
+
return Object.entries(t).forEach(([n, e]) => {
|
76
|
+
typeof e == "function" ? u[n] = e.bind(u) : u[n] = ue(e);
|
77
|
+
}), u;
|
78
78
|
}
|
79
|
-
function
|
80
|
-
return
|
79
|
+
function pe(t, u) {
|
80
|
+
return u.findIndex((n) => n.value === t.value || n.label === t.label || n.value === t.label || n.label === t.value);
|
81
81
|
}
|
82
|
-
function D(t,
|
83
|
-
const
|
84
|
-
|
82
|
+
function D(t, u) {
|
83
|
+
const n = pe(t, u);
|
84
|
+
n >= 0 ? u[n].isChecked = !0 : u.push({ ...t, isChecked: !0 });
|
85
85
|
}
|
86
|
-
function
|
87
|
-
const
|
88
|
-
|
86
|
+
function ce(t, u) {
|
87
|
+
const n = pe(t, u);
|
88
|
+
n >= 0 && (u[n].isChecked = !1);
|
89
89
|
}
|
90
|
-
function
|
91
|
-
|
92
|
-
|
90
|
+
function Ge(t) {
|
91
|
+
t.forEach((u) => {
|
92
|
+
u.isChecked = !1;
|
93
|
+
});
|
94
|
+
}
|
95
|
+
function He(t, u) {
|
96
|
+
return u ? t.filter(
|
97
|
+
(n) => JSON.stringify(n).toLowerCase().includes(u.toLowerCase())
|
93
98
|
) : t;
|
94
99
|
}
|
95
|
-
function
|
96
|
-
const
|
97
|
-
return
|
100
|
+
function me(t) {
|
101
|
+
const u = t.label || "", n = t.required ? " *" : "";
|
102
|
+
return u + n;
|
98
103
|
}
|
99
|
-
function
|
100
|
-
if (t ===
|
101
|
-
if (t == null ||
|
102
|
-
if (typeof t != "object") return t ===
|
103
|
-
if (Array.isArray(t) && Array.isArray(
|
104
|
-
return t.length !==
|
105
|
-
if (Array.isArray(t) !== Array.isArray(
|
106
|
-
const
|
107
|
-
return
|
108
|
-
(l) => Object.prototype.hasOwnProperty.call(
|
104
|
+
function J(t, u) {
|
105
|
+
if (t === u) return !0;
|
106
|
+
if (t == null || u == null || typeof t != typeof u) return !1;
|
107
|
+
if (typeof t != "object") return t === u;
|
108
|
+
if (Array.isArray(t) && Array.isArray(u))
|
109
|
+
return t.length !== u.length ? !1 : t.every((l, a) => J(l, u[a]));
|
110
|
+
if (Array.isArray(t) !== Array.isArray(u)) return !1;
|
111
|
+
const n = Object.keys(t), e = Object.keys(u);
|
112
|
+
return n.length !== e.length ? !1 : n.every(
|
113
|
+
(l) => Object.prototype.hasOwnProperty.call(u, l) && J(t[l], u[l])
|
109
114
|
);
|
110
115
|
}
|
111
|
-
function
|
116
|
+
function ye() {
|
112
117
|
const t = C([]);
|
113
|
-
async function
|
118
|
+
async function u() {
|
114
119
|
console.debug("Validating form inputs");
|
115
|
-
const
|
120
|
+
const a = [];
|
116
121
|
for (const i of t.value)
|
117
122
|
if (typeof (i == null ? void 0 : i.onValueUpdate) == "function" && await i.onValueUpdate(), typeof (i == null ? void 0 : i.getErrors) == "function")
|
118
123
|
try {
|
119
124
|
const s = i.getErrors();
|
120
|
-
Array.isArray(s) ?
|
125
|
+
Array.isArray(s) ? a.push(...s) : console.warn("getErrors() returned non-array value:", s);
|
121
126
|
} catch (s) {
|
122
127
|
console.error("Error calling getErrors on component:", s, i);
|
123
128
|
}
|
124
129
|
else
|
125
130
|
console.warn("Component does not have getErrors function:", i);
|
126
|
-
return
|
131
|
+
return a.every(ae);
|
127
132
|
}
|
128
|
-
function
|
129
|
-
t.value.forEach((
|
130
|
-
typeof (
|
133
|
+
function n() {
|
134
|
+
t.value.forEach((a) => {
|
135
|
+
typeof (a == null ? void 0 : a.onReset) == "function" && a.onReset();
|
131
136
|
});
|
132
137
|
}
|
133
138
|
function e() {
|
134
|
-
const
|
139
|
+
const a = [];
|
135
140
|
for (const i of t.value)
|
136
141
|
if (typeof (i == null ? void 0 : i.getErrors) == "function")
|
137
142
|
try {
|
138
143
|
const s = i.getErrors();
|
139
|
-
Array.isArray(s) ?
|
144
|
+
Array.isArray(s) ? a.push(...s) : a.push(String(s));
|
140
145
|
} catch (s) {
|
141
146
|
console.error("Error calling getErrors on component:", s, i);
|
142
147
|
}
|
143
|
-
return
|
148
|
+
return a;
|
144
149
|
}
|
145
150
|
async function l() {
|
146
|
-
for (const
|
147
|
-
typeof (
|
151
|
+
for (const a of t.value)
|
152
|
+
typeof (a == null ? void 0 : a.onValueUpdate) == "function" && await a.onValueUpdate();
|
148
153
|
}
|
149
154
|
return {
|
150
155
|
dynamicRefs: t,
|
151
|
-
isFormValid:
|
152
|
-
resetForm:
|
156
|
+
isFormValid: u,
|
157
|
+
resetForm: n,
|
153
158
|
getFormErrors: e,
|
154
159
|
updateFormValues: l
|
155
160
|
};
|
156
161
|
}
|
157
|
-
function
|
158
|
-
const
|
159
|
-
() => Object.entries(t.value).reduce((c, [r,
|
160
|
-
),
|
161
|
-
var
|
162
|
-
return typeof ((
|
163
|
-
}, l = (c, r,
|
164
|
-
|
165
|
-
var
|
166
|
-
!
|
162
|
+
function Ke(t) {
|
163
|
+
const u = w(
|
164
|
+
() => Object.entries(t.value).reduce((c, [r, d]) => (d.value !== void 0 && (typeof d.onChange == "function" ? c[r] = d.onChange(d.value, t.value) : c[r] = d.value), c), {})
|
165
|
+
), n = C({}), e = (c, r, d) => {
|
166
|
+
var o;
|
167
|
+
return typeof ((o = t.value[c].children[r]) == null ? void 0 : o.computedValue) == "function" ? t.value[c].children[r].computedValue(d, t.value) : d;
|
168
|
+
}, l = (c, r, d, o) => {
|
169
|
+
n.value[c][o] || (n.value[c][o] = {}), Object.entries(r.other ?? {}).forEach(([m, y]) => {
|
170
|
+
var f;
|
171
|
+
!J(y, (f = d.other) == null ? void 0 : f[m]) && (n.value[c][o][m] = e(c, m, y));
|
167
172
|
});
|
168
|
-
},
|
169
|
-
r.forEach((
|
170
|
-
const
|
171
|
-
l(c,
|
173
|
+
}, a = (c, r, d) => {
|
174
|
+
r.forEach((o, m) => {
|
175
|
+
const y = d[m] ?? { other: {} };
|
176
|
+
l(c, o, y, m);
|
172
177
|
});
|
173
178
|
}, i = (c, { other: r }) => Object.entries(r ?? {}).reduce(
|
174
|
-
(
|
179
|
+
(d, [o, m]) => (d[o] = e(c, o, m), d),
|
175
180
|
{}
|
176
|
-
), s = (c, r,
|
177
|
-
|
178
|
-
const
|
179
|
-
Array.isArray(
|
180
|
-
},
|
181
|
+
), s = (c, r, d) => {
|
182
|
+
n.value[c] || (n.value[c] = []);
|
183
|
+
const o = r;
|
184
|
+
Array.isArray(d[c]) ? a(c, o, d[c]) : n.value[c] = o.map((m) => i(c, m));
|
185
|
+
}, h = (c, r, d) => {
|
181
186
|
if (!r) {
|
182
|
-
delete
|
187
|
+
delete n.value[c];
|
183
188
|
return;
|
184
189
|
}
|
185
|
-
const
|
186
|
-
|
190
|
+
const o = t.value[c];
|
191
|
+
o.children !== void 0 ? s(c, r, d) : typeof o.computedValue == "function" && (n.value[c] = o.computedValue(r, t.value));
|
187
192
|
};
|
188
|
-
return
|
189
|
-
|
193
|
+
return S(
|
194
|
+
u,
|
190
195
|
(c, r = {}) => {
|
191
|
-
Object.keys(c).forEach((
|
192
|
-
|
193
|
-
}), Object.keys(r).forEach((
|
194
|
-
!(
|
196
|
+
Object.keys(c).forEach((d) => {
|
197
|
+
J(c[d], r[d]) || h(d, c[d], r);
|
198
|
+
}), Object.keys(r).forEach((d) => {
|
199
|
+
!(d in c) && d in n.value && delete n.value[d];
|
195
200
|
});
|
196
201
|
},
|
197
202
|
{
|
@@ -199,63 +204,11 @@ function Ge(t) {
|
|
199
204
|
deep: !0
|
200
205
|
}
|
201
206
|
), {
|
202
|
-
formData:
|
203
|
-
computedData:
|
204
|
-
};
|
205
|
-
}
|
206
|
-
function He(t, o, a) {
|
207
|
-
const e = C({}), l = C({});
|
208
|
-
function n(r, v, u) {
|
209
|
-
l.value[r] = u, v.forEach((m) => {
|
210
|
-
var _;
|
211
|
-
(_ = e.value)[m] ?? (_[m] = []), e.value[m].includes(r) || e.value[m].push(r);
|
212
|
-
}), c(r);
|
213
|
-
}
|
214
|
-
function i(r) {
|
215
|
-
return Object.entries(e.value).filter(([, u]) => u.includes(r)).map(([u]) => u).reduce(
|
216
|
-
(u, m) => (u[m] = o.value[m] ?? a.value[m], u),
|
217
|
-
{}
|
218
|
-
);
|
219
|
-
}
|
220
|
-
function s(r, v) {
|
221
|
-
return r ? Array.isArray(r) ? r.some((u) => v.some((m) => f(u, m.value))) : v.some((u) => f(r, u.value)) : !1;
|
222
|
-
}
|
223
|
-
function f(r, v) {
|
224
|
-
return typeof r == "object" && r !== null ? r.value === v : String(r) === String(v);
|
225
|
-
}
|
226
|
-
async function c(r, v) {
|
227
|
-
if (!l.value[r]) return;
|
228
|
-
const u = i(r), m = Object.keys(u);
|
229
|
-
if (!(m.length === 0 || !m.every(
|
230
|
-
(V) => u[V] !== void 0 && u[V] !== null
|
231
|
-
)))
|
232
|
-
try {
|
233
|
-
const V = l.value[r], g = await V(v, u);
|
234
|
-
if (!t.value[r]) return;
|
235
|
-
t.value[r].options = g;
|
236
|
-
const y = t.value[r].value;
|
237
|
-
if (!y) return;
|
238
|
-
s(y, g) || (t.value[r].value = t.value[r].multiple ? [] : "");
|
239
|
-
} catch (V) {
|
240
|
-
console.error(`Error loading options for ${r}:`, V);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
return q(
|
244
|
-
[o, a],
|
245
|
-
() => {
|
246
|
-
Object.entries(e.value).forEach(([r, v]) => {
|
247
|
-
(o.value[r] !== void 0 || a.value[r] !== void 0) && v.forEach((u) => {
|
248
|
-
c(u);
|
249
|
-
});
|
250
|
-
});
|
251
|
-
},
|
252
|
-
{ deep: !0, immediate: !0 }
|
253
|
-
), {
|
254
|
-
registerDependency: n,
|
255
|
-
updateOptions: c
|
207
|
+
formData: u,
|
208
|
+
computedData: n
|
256
209
|
};
|
257
210
|
}
|
258
|
-
const
|
211
|
+
const We = /* @__PURE__ */ F({
|
259
212
|
__name: "vForm",
|
260
213
|
props: {
|
261
214
|
schema: {},
|
@@ -270,118 +223,117 @@ const Ke = /* @__PURE__ */ U({
|
|
270
223
|
customButtons: {}
|
271
224
|
},
|
272
225
|
emits: ["submit", "clear", "cancel"],
|
273
|
-
setup(t, { expose:
|
274
|
-
const e = t, l =
|
275
|
-
async function
|
226
|
+
setup(t, { expose: u, emit: n }) {
|
227
|
+
const e = t, l = n, a = C(e.schema), { dynamicRefs: i, isFormValid: s, resetForm: h } = ye(), { formData: c, computedData: r } = Ke(a);
|
228
|
+
async function d() {
|
276
229
|
await s() && l("submit", c.value, r.value);
|
277
230
|
}
|
278
|
-
function
|
279
|
-
|
231
|
+
function o() {
|
232
|
+
h(), l("clear");
|
280
233
|
}
|
281
|
-
function
|
282
|
-
|
234
|
+
function m() {
|
235
|
+
h(), l("cancel");
|
283
236
|
}
|
284
|
-
return
|
237
|
+
return S(
|
285
238
|
c,
|
286
239
|
async () => {
|
287
|
-
for (const [
|
288
|
-
ne(
|
240
|
+
for (const [y, _] of Object.entries(a.value))
|
241
|
+
ne(_, c.value, r.value) || (_.value = e.schema[y].value);
|
289
242
|
},
|
290
243
|
{
|
291
244
|
deep: !0,
|
292
245
|
immediate: !0
|
293
246
|
}
|
294
|
-
),
|
247
|
+
), S(
|
295
248
|
() => e.schema,
|
296
|
-
(
|
297
|
-
for (const [
|
298
|
-
|
249
|
+
(y) => {
|
250
|
+
for (const [_, f] of Object.entries(y))
|
251
|
+
f.value !== void 0 && (a.value[_].value = f.value);
|
299
252
|
},
|
300
253
|
{
|
301
254
|
deep: !0,
|
302
255
|
immediate: !0
|
303
256
|
}
|
304
|
-
),
|
305
|
-
resetForm:
|
257
|
+
), u({
|
258
|
+
resetForm: h,
|
306
259
|
isFormValid: s,
|
307
260
|
resolveData: () => ({
|
308
261
|
formData: c.value,
|
309
262
|
computedData: r.value
|
310
263
|
})
|
311
|
-
}), (
|
312
|
-
default:
|
313
|
-
A(
|
314
|
-
default:
|
315
|
-
(p(!0),
|
316
|
-
var
|
317
|
-
return p(),
|
318
|
-
|
319
|
-
key:
|
320
|
-
size: ((
|
321
|
-
"size-sm": (
|
322
|
-
"size-md": (
|
323
|
-
"size-lg": (
|
324
|
-
"size-xl": (
|
264
|
+
}), (y, _) => (p(), V(v(Ce), null, {
|
265
|
+
default: b(() => [
|
266
|
+
A(v(te), null, {
|
267
|
+
default: b(() => [
|
268
|
+
(p(!0), q(T, null, K(Object.keys(a.value), (f) => {
|
269
|
+
var O, E, L, M, j;
|
270
|
+
return p(), q(T, null, [
|
271
|
+
v(ne)(a.value[f], v(c), v(r)) ? (p(), V(v(le), {
|
272
|
+
key: f,
|
273
|
+
size: ((O = a.value[f].grid) == null ? void 0 : O.xs) ?? "12",
|
274
|
+
"size-sm": (E = a.value[f].grid) == null ? void 0 : E.sm,
|
275
|
+
"size-md": (L = a.value[f].grid) == null ? void 0 : L.md,
|
276
|
+
"size-lg": (M = a.value[f].grid) == null ? void 0 : M.lg,
|
277
|
+
"size-xl": (j = a.value[f].grid) == null ? void 0 : j.xl,
|
325
278
|
class: "ion-margin-vertical"
|
326
279
|
}, {
|
327
|
-
default:
|
328
|
-
(p(),
|
329
|
-
modelValue:
|
330
|
-
"onUpdate:modelValue": (
|
331
|
-
schema:
|
332
|
-
"
|
333
|
-
"form-id": y,
|
280
|
+
default: b(() => [
|
281
|
+
(p(), V(de(a.value[f].type), {
|
282
|
+
modelValue: a.value[f],
|
283
|
+
"onUpdate:modelValue": (W) => a.value[f] = W,
|
284
|
+
schema: a.value,
|
285
|
+
"form-id": f,
|
334
286
|
ref_for: !0,
|
335
287
|
ref_key: "dynamicRefs",
|
336
288
|
ref: i,
|
337
|
-
"ref-key":
|
338
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "
|
289
|
+
"ref-key": f
|
290
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "form-id", "ref-key"]))
|
339
291
|
]),
|
340
292
|
_: 2
|
341
|
-
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) :
|
293
|
+
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : R("", !0)
|
342
294
|
], 64);
|
343
295
|
}), 256))
|
344
296
|
]),
|
345
297
|
_: 1
|
346
298
|
}),
|
347
|
-
|
348
|
-
default:
|
349
|
-
A(
|
299
|
+
y.hideButtons ? R("", !0) : (p(), V(v(te), { key: 0 }, {
|
300
|
+
default: b(() => [
|
301
|
+
A(v(le), {
|
350
302
|
size: "12",
|
351
|
-
style:
|
303
|
+
style: Ve([{ display: "flex" }, { justifyContent: y.buttonPlacement }])
|
352
304
|
}, {
|
353
|
-
default:
|
354
|
-
|
305
|
+
default: b(() => [
|
306
|
+
y.showCancelButton ? (p(), V(v(Z), {
|
355
307
|
key: 0,
|
356
|
-
onClick:
|
308
|
+
onClick: m
|
357
309
|
}, {
|
358
|
-
default:
|
359
|
-
|
310
|
+
default: b(() => [
|
311
|
+
I(B(y.cancelButtonText ?? "Cancel"), 1)
|
360
312
|
]),
|
361
313
|
_: 1
|
362
|
-
})) :
|
363
|
-
|
314
|
+
})) : R("", !0),
|
315
|
+
y.showClearButton ? (p(), V(v(Z), {
|
364
316
|
key: 1,
|
365
|
-
onClick:
|
317
|
+
onClick: o
|
366
318
|
}, {
|
367
|
-
default:
|
368
|
-
|
319
|
+
default: b(() => [
|
320
|
+
I(B(y.clearButtonText ?? "Reset"), 1)
|
369
321
|
]),
|
370
322
|
_: 1
|
371
|
-
})) :
|
372
|
-
(p(!0),
|
373
|
-
key:
|
374
|
-
onClick:
|
375
|
-
color:
|
323
|
+
})) : R("", !0),
|
324
|
+
(p(!0), q(T, null, K(y.customButtons, (f) => (p(), V(v(Z), {
|
325
|
+
key: f.label,
|
326
|
+
onClick: f.action,
|
327
|
+
color: f.color ?? "primary"
|
376
328
|
}, {
|
377
|
-
default:
|
378
|
-
|
329
|
+
default: b(() => [
|
330
|
+
I(B(f.label), 1)
|
379
331
|
]),
|
380
332
|
_: 2
|
381
333
|
}, 1032, ["onClick", "color"]))), 128)),
|
382
|
-
A(
|
383
|
-
default:
|
384
|
-
|
334
|
+
A(v(Z), { onClick: d }, {
|
335
|
+
default: b(() => [
|
336
|
+
I(B(y.submitButtonText ?? "Submit"), 1)
|
385
337
|
]),
|
386
338
|
_: 1
|
387
339
|
})
|
@@ -396,11 +348,11 @@ const Ke = /* @__PURE__ */ U({
|
|
396
348
|
}));
|
397
349
|
}
|
398
350
|
});
|
399
|
-
function
|
351
|
+
function Ze(t) {
|
400
352
|
return {
|
401
353
|
applyValidationState: async (e) => {
|
402
|
-
var l,
|
403
|
-
(l = t.value) == null || l.$el.classList.remove("ion-invalid"), (
|
354
|
+
var l, a, i, s, h;
|
355
|
+
(l = t.value) == null || l.$el.classList.remove("ion-invalid"), (a = t.value) == null || a.$el.classList.remove("ion-valid"), e ? (i = t.value) == null || i.$el.classList.add("ion-valid") : (s = t.value) == null || s.$el.classList.add("ion-invalid"), (h = t.value) == null || h.$el.classList.add("ion-touched");
|
404
356
|
},
|
405
357
|
resetValidationState: () => {
|
406
358
|
var e, l;
|
@@ -408,85 +360,85 @@ function We(t) {
|
|
408
360
|
}
|
409
361
|
};
|
410
362
|
}
|
411
|
-
function
|
412
|
-
const { applyValidationState:
|
363
|
+
function Q(t, u, n, e, l) {
|
364
|
+
const { applyValidationState: a, resetValidationState: i } = Ze(t);
|
413
365
|
async function s() {
|
414
|
-
if (
|
415
|
-
return
|
366
|
+
if (u.value.required && !n.value)
|
367
|
+
return u.value.error = "This field is required", !1;
|
416
368
|
if (l) {
|
417
|
-
const
|
418
|
-
if (typeof
|
419
|
-
return
|
420
|
-
if (
|
369
|
+
const o = await l(n.value);
|
370
|
+
if (typeof o == "string")
|
371
|
+
return u.value.error = o, !1;
|
372
|
+
if (o === !1)
|
421
373
|
return !1;
|
422
374
|
}
|
423
|
-
if (
|
424
|
-
const
|
425
|
-
if (
|
426
|
-
return
|
375
|
+
if (u.value.validation) {
|
376
|
+
const o = await u.value.validation(n.value, e == null ? void 0 : e.value);
|
377
|
+
if (o && o.length)
|
378
|
+
return u.value.error = o.join(), !1;
|
427
379
|
}
|
428
380
|
return !0;
|
429
381
|
}
|
430
|
-
async function
|
431
|
-
const
|
432
|
-
|
382
|
+
async function h() {
|
383
|
+
const o = await s();
|
384
|
+
o && (u.value.error = "", u.value.value = n.value), await a(o);
|
433
385
|
}
|
434
386
|
function c() {
|
435
|
-
i(),
|
387
|
+
i(), u.value.error = "";
|
436
388
|
}
|
437
|
-
function r(
|
438
|
-
|
389
|
+
function r(o = "") {
|
390
|
+
n.value = o, u.value.error = "", u.value.value = o;
|
439
391
|
}
|
440
|
-
function
|
441
|
-
return
|
392
|
+
function d() {
|
393
|
+
return u.value.error ? [u.value.error] : [];
|
442
394
|
}
|
443
395
|
return {
|
444
396
|
isValid: s,
|
445
|
-
onValueUpdate:
|
397
|
+
onValueUpdate: h,
|
446
398
|
onFocus: c,
|
447
399
|
onReset: r,
|
448
|
-
getErrors:
|
449
|
-
applyValidationState:
|
400
|
+
getErrors: d,
|
401
|
+
applyValidationState: a,
|
450
402
|
resetValidationState: i
|
451
403
|
};
|
452
404
|
}
|
453
|
-
function
|
454
|
-
const
|
405
|
+
function Je(t) {
|
406
|
+
const u = w(() => !!t.value.label), n = w(() => !!t.value.required), e = w(() => t.value.label || "");
|
455
407
|
return {
|
456
|
-
showLabel:
|
457
|
-
showRequired:
|
408
|
+
showLabel: u,
|
409
|
+
showRequired: n,
|
458
410
|
labelText: e
|
459
411
|
};
|
460
412
|
}
|
461
|
-
const re = /* @__PURE__ */
|
413
|
+
const re = /* @__PURE__ */ F({
|
462
414
|
__name: "InputLabel",
|
463
415
|
props: {
|
464
416
|
model: {}
|
465
417
|
},
|
466
418
|
setup(t) {
|
467
|
-
const
|
468
|
-
return (
|
419
|
+
const u = t, { showLabel: n, showRequired: e, labelText: l } = Je(be(u, "model"));
|
420
|
+
return (a, i) => v(n) ? (p(), V(v(H), {
|
469
421
|
key: 0,
|
470
422
|
slot: "label",
|
471
423
|
class: "input-label"
|
472
424
|
}, {
|
473
|
-
default:
|
474
|
-
|
475
|
-
|
425
|
+
default: b(() => [
|
426
|
+
I(B(v(l)) + " ", 1),
|
427
|
+
v(e) ? (p(), V(v(Oe), {
|
476
428
|
key: 0,
|
477
429
|
color: "danger"
|
478
430
|
}, {
|
479
|
-
default:
|
480
|
-
|
431
|
+
default: b(() => i[0] || (i[0] = [
|
432
|
+
I("*")
|
481
433
|
])),
|
482
434
|
_: 1,
|
483
435
|
__: [0]
|
484
|
-
})) :
|
436
|
+
})) : R("", !0)
|
485
437
|
]),
|
486
438
|
_: 1
|
487
|
-
})) :
|
439
|
+
})) : R("", !0);
|
488
440
|
}
|
489
|
-
}),
|
441
|
+
}), X = /* @__PURE__ */ F({
|
490
442
|
__name: "BaseInput",
|
491
443
|
props: /* @__PURE__ */ z({
|
492
444
|
schema: {},
|
@@ -496,31 +448,31 @@ const re = /* @__PURE__ */ U({
|
|
496
448
|
modelModifiers: {}
|
497
449
|
}),
|
498
450
|
emits: ["update:modelValue"],
|
499
|
-
setup(t, { expose:
|
500
|
-
const
|
451
|
+
setup(t, { expose: u }) {
|
452
|
+
const n = t, e = $(t, "modelValue"), l = C(null), a = C(e.value.value), i = w(() => n.schema), { isValid: s, onValueUpdate: h, onFocus: c, onReset: r, getErrors: d } = Q(
|
501
453
|
l,
|
502
454
|
e,
|
503
|
-
|
455
|
+
a,
|
504
456
|
i
|
505
|
-
),
|
506
|
-
if (e.value.pattern) return
|
457
|
+
), o = w(() => {
|
458
|
+
if (e.value.pattern) return Ne(e.value.pattern);
|
507
459
|
});
|
508
|
-
return
|
460
|
+
return S(
|
509
461
|
() => e.value.value,
|
510
|
-
(m) =>
|
511
|
-
),
|
512
|
-
onValueUpdate:
|
462
|
+
(m) => a.value = m
|
463
|
+
), u({
|
464
|
+
onValueUpdate: h,
|
513
465
|
onReset: r,
|
514
|
-
getErrors:
|
466
|
+
getErrors: d,
|
515
467
|
isValid: s
|
516
|
-
}), (m,
|
517
|
-
var
|
518
|
-
const
|
519
|
-
return
|
468
|
+
}), (m, y) => {
|
469
|
+
var f;
|
470
|
+
const _ = _e("maskito");
|
471
|
+
return xe((p(), V(v(ve), {
|
520
472
|
ref_key: "inputRef",
|
521
473
|
ref: l,
|
522
|
-
modelValue:
|
523
|
-
"onUpdate:modelValue":
|
474
|
+
modelValue: a.value,
|
475
|
+
"onUpdate:modelValue": y[0] || (y[0] = (O) => a.value = O),
|
524
476
|
"clear-input": !0,
|
525
477
|
fill: e.value.fill ?? "solid",
|
526
478
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
@@ -528,7 +480,7 @@ const re = /* @__PURE__ */ U({
|
|
528
480
|
required: e.value.required,
|
529
481
|
"error-text": e.value.error,
|
530
482
|
autofocus: e.value.autoFocus,
|
531
|
-
placeholder: ((
|
483
|
+
placeholder: ((f = o.value) == null ? void 0 : f.placeholder) ?? e.value.placeholder,
|
532
484
|
disabled: e.value.disabled,
|
533
485
|
counter: e.value.counter,
|
534
486
|
min: e.value.min,
|
@@ -536,42 +488,42 @@ const re = /* @__PURE__ */ U({
|
|
536
488
|
"max-length": e.value.maxLength,
|
537
489
|
"min-length": e.value.minLength,
|
538
490
|
pattern: e.value.pattern,
|
539
|
-
onIonFocus:
|
540
|
-
onIonChange:
|
541
|
-
onIonBlur:
|
491
|
+
onIonFocus: v(c),
|
492
|
+
onIonChange: v(h),
|
493
|
+
onIonBlur: v(h)
|
542
494
|
}, {
|
543
|
-
default:
|
495
|
+
default: b(() => [
|
544
496
|
A(re, { model: e.value }, null, 8, ["model"]),
|
545
|
-
e.value.prefix ? (p(),
|
497
|
+
e.value.prefix ? (p(), V(v(H), {
|
546
498
|
key: 0,
|
547
499
|
slot: "start"
|
548
500
|
}, {
|
549
|
-
default:
|
550
|
-
|
501
|
+
default: b(() => [
|
502
|
+
I(B(e.value.prefix), 1)
|
551
503
|
]),
|
552
504
|
_: 1
|
553
|
-
})) :
|
554
|
-
e.value.suffix ? (p(),
|
505
|
+
})) : R("", !0),
|
506
|
+
e.value.suffix ? (p(), V(v(H), {
|
555
507
|
key: 1,
|
556
508
|
slot: "end"
|
557
509
|
}, {
|
558
|
-
default:
|
559
|
-
|
510
|
+
default: b(() => [
|
511
|
+
I(B(e.value.suffix), 1)
|
560
512
|
]),
|
561
513
|
_: 1
|
562
|
-
})) :
|
563
|
-
m.type === "password" ? (p(),
|
514
|
+
})) : R("", !0),
|
515
|
+
m.type === "password" ? (p(), V(v(Ee), {
|
564
516
|
key: 2,
|
565
517
|
slot: "end"
|
566
|
-
})) :
|
518
|
+
})) : R("", !0)
|
567
519
|
]),
|
568
520
|
_: 1
|
569
521
|
}, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter", "min", "max", "max-length", "min-length", "pattern", "onIonFocus", "onIonChange", "onIonBlur"])), [
|
570
|
-
[
|
522
|
+
[_, o.value]
|
571
523
|
]);
|
572
524
|
};
|
573
525
|
}
|
574
|
-
}),
|
526
|
+
}), Qe = /* @__PURE__ */ F({
|
575
527
|
__name: "TextInput",
|
576
528
|
props: /* @__PURE__ */ z({
|
577
529
|
schema: {}
|
@@ -580,9 +532,9 @@ const re = /* @__PURE__ */ U({
|
|
580
532
|
modelModifiers: {}
|
581
533
|
}),
|
582
534
|
emits: ["update:modelValue"],
|
583
|
-
setup(t, { expose:
|
584
|
-
const
|
585
|
-
return
|
535
|
+
setup(t, { expose: u }) {
|
536
|
+
const n = $(t, "modelValue"), e = C(null);
|
537
|
+
return u({
|
586
538
|
onReset: () => {
|
587
539
|
var l;
|
588
540
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -592,19 +544,19 @@ const re = /* @__PURE__ */ U({
|
|
592
544
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
593
545
|
},
|
594
546
|
getErrors: () => {
|
595
|
-
var l,
|
596
|
-
return ((
|
547
|
+
var l, a;
|
548
|
+
return ((a = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : a.call(l)) ?? [];
|
597
549
|
}
|
598
|
-
}), (l,
|
599
|
-
modelValue:
|
600
|
-
"onUpdate:modelValue":
|
550
|
+
}), (l, a) => (p(), V(X, {
|
551
|
+
modelValue: n.value,
|
552
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.value = i),
|
601
553
|
type: "text",
|
602
554
|
schema: l.schema,
|
603
555
|
ref_key: "inputRef",
|
604
556
|
ref: e
|
605
557
|
}, null, 8, ["modelValue", "schema"]));
|
606
558
|
}
|
607
|
-
}),
|
559
|
+
}), Xe = /* @__PURE__ */ F({
|
608
560
|
__name: "DateInput",
|
609
561
|
props: /* @__PURE__ */ z({
|
610
562
|
schema: {}
|
@@ -613,9 +565,9 @@ const re = /* @__PURE__ */ U({
|
|
613
565
|
modelModifiers: {}
|
614
566
|
}),
|
615
567
|
emits: ["update:modelValue"],
|
616
|
-
setup(t, { expose:
|
617
|
-
const
|
618
|
-
return
|
568
|
+
setup(t, { expose: u }) {
|
569
|
+
const n = $(t, "modelValue"), e = C(null);
|
570
|
+
return u({
|
619
571
|
onValueUpdate: () => {
|
620
572
|
var l;
|
621
573
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
@@ -625,19 +577,19 @@ const re = /* @__PURE__ */ U({
|
|
625
577
|
return (l = e.value) == null ? void 0 : l.onReset();
|
626
578
|
},
|
627
579
|
getErrors: () => {
|
628
|
-
var l,
|
629
|
-
return ((
|
580
|
+
var l, a;
|
581
|
+
return ((a = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : a.call(l)) ?? [];
|
630
582
|
}
|
631
|
-
}), (l,
|
632
|
-
modelValue:
|
633
|
-
"onUpdate:modelValue":
|
634
|
-
type:
|
583
|
+
}), (l, a) => (p(), V(X, {
|
584
|
+
modelValue: n.value,
|
585
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.value = i),
|
586
|
+
type: n.value.enableTime ? "datetime-local" : "date",
|
635
587
|
schema: l.schema,
|
636
588
|
ref_key: "inputRef",
|
637
589
|
ref: e
|
638
590
|
}, null, 8, ["modelValue", "type", "schema"]));
|
639
591
|
}
|
640
|
-
}),
|
592
|
+
}), Ye = /* @__PURE__ */ F({
|
641
593
|
__name: "NumberInput",
|
642
594
|
props: /* @__PURE__ */ z({
|
643
595
|
schema: {}
|
@@ -646,9 +598,9 @@ const re = /* @__PURE__ */ U({
|
|
646
598
|
modelModifiers: {}
|
647
599
|
}),
|
648
600
|
emits: ["update:modelValue"],
|
649
|
-
setup(t, { expose:
|
650
|
-
const
|
651
|
-
return
|
601
|
+
setup(t, { expose: u }) {
|
602
|
+
const n = $(t, "modelValue"), e = C(null);
|
603
|
+
return u({
|
652
604
|
onReset: () => {
|
653
605
|
var l;
|
654
606
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -658,19 +610,19 @@ const re = /* @__PURE__ */ U({
|
|
658
610
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
659
611
|
},
|
660
612
|
getErrors: () => {
|
661
|
-
var l,
|
662
|
-
return ((
|
613
|
+
var l, a;
|
614
|
+
return ((a = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : a.call(l)) ?? [];
|
663
615
|
}
|
664
|
-
}), (l,
|
665
|
-
modelValue:
|
666
|
-
"onUpdate:modelValue":
|
616
|
+
}), (l, a) => (p(), V(X, {
|
617
|
+
modelValue: n.value,
|
618
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.value = i),
|
667
619
|
type: "number",
|
668
620
|
schema: l.schema,
|
669
621
|
ref_key: "inputRef",
|
670
622
|
ref: e
|
671
623
|
}, null, 8, ["modelValue", "schema"]));
|
672
624
|
}
|
673
|
-
}),
|
625
|
+
}), et = /* @__PURE__ */ F({
|
674
626
|
__name: "EmailInput",
|
675
627
|
props: /* @__PURE__ */ z({
|
676
628
|
schema: {}
|
@@ -679,9 +631,9 @@ const re = /* @__PURE__ */ U({
|
|
679
631
|
modelModifiers: {}
|
680
632
|
}),
|
681
633
|
emits: ["update:modelValue"],
|
682
|
-
setup(t, { expose:
|
683
|
-
const
|
684
|
-
return
|
634
|
+
setup(t, { expose: u }) {
|
635
|
+
const n = $(t, "modelValue"), e = C(null);
|
636
|
+
return u({
|
685
637
|
onReset: () => {
|
686
638
|
var l;
|
687
639
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -691,19 +643,19 @@ const re = /* @__PURE__ */ U({
|
|
691
643
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
692
644
|
},
|
693
645
|
getErrors: () => {
|
694
|
-
var l,
|
695
|
-
return ((
|
646
|
+
var l, a;
|
647
|
+
return ((a = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : a.call(l)) ?? [];
|
696
648
|
}
|
697
|
-
}), (l,
|
698
|
-
modelValue:
|
699
|
-
"onUpdate:modelValue":
|
649
|
+
}), (l, a) => (p(), V(X, {
|
650
|
+
modelValue: n.value,
|
651
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.value = i),
|
700
652
|
type: "email",
|
701
653
|
schema: l.schema,
|
702
654
|
ref_key: "inputRef",
|
703
655
|
ref: e
|
704
656
|
}, null, 8, ["modelValue", "schema"]));
|
705
657
|
}
|
706
|
-
}),
|
658
|
+
}), tt = /* @__PURE__ */ F({
|
707
659
|
__name: "PasswordInput",
|
708
660
|
props: /* @__PURE__ */ z({
|
709
661
|
schema: {}
|
@@ -712,9 +664,9 @@ const re = /* @__PURE__ */ U({
|
|
712
664
|
modelModifiers: {}
|
713
665
|
}),
|
714
666
|
emits: ["update:modelValue"],
|
715
|
-
setup(t, { expose:
|
716
|
-
const
|
717
|
-
return
|
667
|
+
setup(t, { expose: u }) {
|
668
|
+
const n = $(t, "modelValue"), e = C(null);
|
669
|
+
return u({
|
718
670
|
onReset: () => {
|
719
671
|
var l;
|
720
672
|
return (l = e.value) == null ? void 0 : l.onReset();
|
@@ -724,50 +676,58 @@ const re = /* @__PURE__ */ U({
|
|
724
676
|
return (l = e.value) == null ? void 0 : l.onValueUpdate();
|
725
677
|
},
|
726
678
|
getErrors: () => {
|
727
|
-
var l,
|
728
|
-
return ((
|
679
|
+
var l, a;
|
680
|
+
return ((a = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : a.call(l)) ?? [];
|
729
681
|
}
|
730
|
-
}), (l,
|
731
|
-
modelValue:
|
732
|
-
"onUpdate:modelValue":
|
682
|
+
}), (l, a) => (p(), V(X, {
|
683
|
+
modelValue: n.value,
|
684
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => n.value = i),
|
733
685
|
type: "password",
|
734
686
|
schema: l.schema,
|
735
687
|
ref_key: "inputRef",
|
736
688
|
ref: e
|
737
689
|
}, null, 8, ["modelValue", "schema"]));
|
738
690
|
}
|
739
|
-
}),
|
691
|
+
}), lt = /* @__PURE__ */ F({
|
740
692
|
__name: "SelectInput",
|
741
693
|
props: /* @__PURE__ */ z({
|
742
694
|
schema: Object,
|
743
695
|
type: String,
|
744
|
-
dependencyManager: Object,
|
745
696
|
formId: String
|
746
697
|
}, {
|
747
698
|
modelValue: { type: Object, default: {} },
|
748
699
|
modelModifiers: {}
|
749
700
|
}),
|
750
701
|
emits: ["update:modelValue"],
|
751
|
-
setup(t, { expose:
|
752
|
-
const
|
753
|
-
|
702
|
+
setup(t, { expose: u }) {
|
703
|
+
const n = t, e = $(t, "modelValue"), l = C(null), a = C(null), i = C(!1), s = C([]), h = C(""), c = C(1), r = w(() => e.value.interface ?? "popover"), d = w(() => e.value.optionsPlacement === "top" ? "top" : "bottom"), o = w(() => s.value.filter((g) => !!g.isChecked)), m = w(() => !h.value && ae(o.value) && !i.value ? e.value.placeholder ?? "Select an option" : "");
|
704
|
+
S([h, () => e.value.options], N, {
|
754
705
|
immediate: !0,
|
755
706
|
deep: !0
|
756
|
-
}),
|
757
|
-
|
758
|
-
|
707
|
+
}), S(() => e.value.value, ge, { immediate: !0, deep: !0 }), S(
|
708
|
+
() => !e.value.dependsOn || !n.schema ? null : (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).map((x) => {
|
709
|
+
var k;
|
710
|
+
return (k = n.schema[x]) == null ? void 0 : k.value;
|
711
|
+
}),
|
712
|
+
async (g, x) => {
|
713
|
+
g && x && !J(g, x) && (y(), s.value = [], await N());
|
714
|
+
},
|
715
|
+
{ deep: !0 }
|
716
|
+
);
|
717
|
+
function y() {
|
718
|
+
e.value.error = "", h.value = "", c.value = 1, e.value.value = e.value.multiple ? [] : "", Ge(s.value);
|
759
719
|
}
|
760
|
-
function
|
761
|
-
if (
|
762
|
-
e.value.multiple ? D(
|
720
|
+
function _(g) {
|
721
|
+
if (g.isChecked) return ce(g, s.value);
|
722
|
+
e.value.multiple ? D(g, s.value) : (y(), D(g, s.value), P()), h.value = "";
|
763
723
|
}
|
764
|
-
function
|
724
|
+
function f() {
|
765
725
|
switch (r.value) {
|
766
726
|
case "action-sheet":
|
767
|
-
|
727
|
+
O();
|
768
728
|
break;
|
769
729
|
case "alert":
|
770
|
-
|
730
|
+
E();
|
771
731
|
break;
|
772
732
|
case "popover":
|
773
733
|
default:
|
@@ -775,18 +735,18 @@ const re = /* @__PURE__ */ U({
|
|
775
735
|
break;
|
776
736
|
}
|
777
737
|
}
|
778
|
-
async function
|
779
|
-
if (await
|
738
|
+
async function O() {
|
739
|
+
if (await N(), e.value.multiple) {
|
780
740
|
i.value = !0;
|
781
741
|
return;
|
782
742
|
}
|
783
|
-
await (await
|
743
|
+
await (await Ie.create({
|
784
744
|
header: e.value.label || "Select an option",
|
785
745
|
buttons: [
|
786
|
-
...s.value.map((
|
787
|
-
text:
|
788
|
-
cssClass:
|
789
|
-
handler: () => (
|
746
|
+
...s.value.map((x) => ({
|
747
|
+
text: x.label,
|
748
|
+
cssClass: x.isChecked ? "selected-option" : "",
|
749
|
+
handler: () => (_(x), !1)
|
790
750
|
})),
|
791
751
|
{
|
792
752
|
text: "Cancel",
|
@@ -795,17 +755,17 @@ const re = /* @__PURE__ */ U({
|
|
795
755
|
]
|
796
756
|
})).present();
|
797
757
|
}
|
798
|
-
async function
|
799
|
-
await
|
800
|
-
const
|
801
|
-
label:
|
758
|
+
async function E() {
|
759
|
+
await N();
|
760
|
+
const g = s.value.map((k) => ({
|
761
|
+
label: k.label,
|
802
762
|
type: e.value.multiple ? "checkbox" : "radio",
|
803
|
-
value:
|
804
|
-
checked:
|
763
|
+
value: k,
|
764
|
+
checked: k.isChecked
|
805
765
|
}));
|
806
|
-
await (await
|
766
|
+
await (await Fe.create({
|
807
767
|
header: e.value.label || "Select an option",
|
808
|
-
inputs:
|
768
|
+
inputs: g,
|
809
769
|
buttons: [
|
810
770
|
{
|
811
771
|
text: "Cancel",
|
@@ -813,104 +773,91 @@ const re = /* @__PURE__ */ U({
|
|
813
773
|
},
|
814
774
|
{
|
815
775
|
text: "OK",
|
816
|
-
handler: (
|
776
|
+
handler: (k) => {
|
817
777
|
if (e.value.multiple)
|
818
|
-
s.value.forEach((
|
819
|
-
const G = s.value.find((
|
778
|
+
s.value.forEach((U) => ce(U, s.value)), k.forEach((U) => {
|
779
|
+
const G = s.value.find((Y) => Y.value === U.value);
|
820
780
|
G && D(G, s.value);
|
821
781
|
});
|
822
782
|
else {
|
823
|
-
|
824
|
-
const
|
825
|
-
|
783
|
+
y();
|
784
|
+
const U = s.value.find((G) => G.value === k.value);
|
785
|
+
U && D(U, s.value);
|
826
786
|
}
|
827
|
-
|
787
|
+
P();
|
828
788
|
}
|
829
789
|
}
|
830
790
|
]
|
831
791
|
})).present();
|
832
792
|
}
|
833
793
|
async function L() {
|
834
|
-
if (e.value.required && ae(
|
794
|
+
if (e.value.required && ae(o.value))
|
835
795
|
return "This field is required";
|
836
796
|
if (e.value.validation) {
|
837
|
-
const
|
838
|
-
if (
|
839
|
-
return
|
797
|
+
const g = await e.value.validation(o.value, n == null ? void 0 : n.schema);
|
798
|
+
if (g && g.length)
|
799
|
+
return g.join();
|
840
800
|
}
|
841
801
|
return !0;
|
842
802
|
}
|
843
|
-
const { onFocus:
|
803
|
+
const { onFocus: M, applyValidationState: j } = Q(
|
844
804
|
l,
|
845
805
|
e,
|
846
|
-
|
847
|
-
|
806
|
+
w(() => e.value.multiple ? o.value : o.value[0]),
|
807
|
+
w(() => n == null ? void 0 : n.schema),
|
848
808
|
L
|
849
809
|
);
|
850
|
-
function
|
851
|
-
var
|
852
|
-
|
810
|
+
function W(g) {
|
811
|
+
var x;
|
812
|
+
g.target === ((x = l.value) == null ? void 0 : x.$el) && (M(), r.value === "popover" && (i.value = !0));
|
853
813
|
}
|
854
|
-
async function
|
855
|
-
var
|
856
|
-
if ((
|
814
|
+
async function P(g) {
|
815
|
+
var k;
|
816
|
+
if ((k = g == null ? void 0 : g.relatedTarget) != null && k.closest(".suggestions-list")) return;
|
857
817
|
i.value = !1;
|
858
|
-
const
|
859
|
-
|
818
|
+
const x = await L();
|
819
|
+
x === !0 ? (e.value.error = "", e.value.value = e.value.multiple ? o.value : o.value[0]) : e.value.error = typeof x == "string" ? x : "Validation failed", await j(x === !0);
|
860
820
|
}
|
861
|
-
async function
|
862
|
-
const
|
863
|
-
if (
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
821
|
+
async function N() {
|
822
|
+
const g = [];
|
823
|
+
if (typeof e.value.options == "function") {
|
824
|
+
let x = {};
|
825
|
+
e.value.dependsOn && n.schema && (x = (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).reduce(
|
826
|
+
(G, Y) => {
|
827
|
+
var se;
|
828
|
+
return G[Y] = (se = n.schema[Y]) == null ? void 0 : se.value, G;
|
829
|
+
},
|
830
|
+
{}
|
831
|
+
));
|
832
|
+
const k = await e.value.options(h.value, x);
|
833
|
+
g.push(...k.filter((U) => !!U.label));
|
834
|
+
} else Array.isArray(e.value.options) && g.push(...He(e.value.options, h.value));
|
835
|
+
o.value.forEach((x) => D(x, g)), s.value = g;
|
871
836
|
}
|
872
|
-
function
|
873
|
-
const
|
874
|
-
|
875
|
-
value:
|
876
|
-
label:
|
837
|
+
function ge() {
|
838
|
+
const g = e.value.value;
|
839
|
+
g && (Array.isArray(g) ? g.forEach((x) => D(x, s.value)) : D(typeof g == "object" ? g : {
|
840
|
+
value: g,
|
841
|
+
label: g
|
877
842
|
}, s.value));
|
878
843
|
}
|
879
|
-
return
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
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
|
-
}
|
899
|
-
}), o({
|
900
|
-
onValueUpdate: T,
|
901
|
-
onReset: _,
|
844
|
+
return oe(() => {
|
845
|
+
N();
|
846
|
+
}), u({
|
847
|
+
onValueUpdate: P,
|
848
|
+
onReset: y,
|
902
849
|
getErrors: () => e.value.error ? [e.value.error] : []
|
903
|
-
}), (
|
850
|
+
}), (g, x) => (p(), q("div", {
|
904
851
|
class: "autocomplete-container",
|
905
|
-
onFocusout:
|
852
|
+
onFocusout: P,
|
906
853
|
ref_key: "containerRef",
|
907
|
-
ref:
|
854
|
+
ref: a
|
908
855
|
}, [
|
909
|
-
A(
|
856
|
+
A(v(ve), {
|
910
857
|
ref_key: "inputRef",
|
911
858
|
ref: l,
|
912
|
-
modelValue:
|
913
|
-
"onUpdate:modelValue":
|
859
|
+
modelValue: h.value,
|
860
|
+
"onUpdate:modelValue": x[0] || (x[0] = (k) => h.value = k),
|
914
861
|
fill: e.value.fill ?? "solid",
|
915
862
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
916
863
|
type: t.type ?? "text",
|
@@ -920,23 +867,23 @@ const re = /* @__PURE__ */ U({
|
|
920
867
|
placeholder: m.value,
|
921
868
|
disabled: e.value.disabled,
|
922
869
|
counter: e.value.counter,
|
923
|
-
onIonFocus:
|
870
|
+
onIonFocus: W,
|
924
871
|
debounce: 300,
|
925
|
-
onClick:
|
872
|
+
onClick: f
|
926
873
|
}, {
|
927
|
-
default:
|
874
|
+
default: b(() => [
|
928
875
|
A(re, { model: e.value }, null, 8, ["model"]),
|
929
|
-
e.value.multiple ? (p(),
|
876
|
+
e.value.multiple ? (p(), V(v(H), {
|
930
877
|
key: 0,
|
931
878
|
style: { width: "fit-content" },
|
932
879
|
slot: "start"
|
933
880
|
}, {
|
934
|
-
default:
|
935
|
-
(p(!0),
|
936
|
-
default:
|
937
|
-
A(
|
938
|
-
default:
|
939
|
-
|
881
|
+
default: b(() => [
|
882
|
+
(p(!0), q(T, null, K(o.value, (k, U) => (p(), V(v(we), { key: U }, {
|
883
|
+
default: b(() => [
|
884
|
+
A(v(H), null, {
|
885
|
+
default: b(() => [
|
886
|
+
I(B(k.label), 1)
|
940
887
|
]),
|
941
888
|
_: 2
|
942
889
|
}, 1024)
|
@@ -945,52 +892,52 @@ const re = /* @__PURE__ */ U({
|
|
945
892
|
}, 1024))), 128))
|
946
893
|
]),
|
947
894
|
_: 1
|
948
|
-
})) : (p(),
|
895
|
+
})) : (p(), V(v(H), {
|
949
896
|
key: 1,
|
950
897
|
slot: "start",
|
951
898
|
class: "ion-no-wrap"
|
952
899
|
}, {
|
953
|
-
default:
|
954
|
-
var
|
900
|
+
default: b(() => {
|
901
|
+
var k;
|
955
902
|
return [
|
956
|
-
|
903
|
+
I(B(((k = o.value[0]) == null ? void 0 : k.label) ?? ""), 1)
|
957
904
|
];
|
958
905
|
}),
|
959
906
|
_: 1
|
960
907
|
})),
|
961
|
-
A(
|
908
|
+
A(v(ee), {
|
962
909
|
slot: "end",
|
963
|
-
icon:
|
910
|
+
icon: v(qe)
|
964
911
|
}, null, 8, ["icon"]),
|
965
|
-
|
912
|
+
o.value.length > 0 || h.value ? (p(), V(v(ee), {
|
966
913
|
key: 2,
|
967
914
|
slot: "end",
|
968
|
-
icon:
|
969
|
-
onClick:
|
915
|
+
icon: v(ze),
|
916
|
+
onClick: y,
|
970
917
|
style: { "z-index": "999999" }
|
971
|
-
}, null, 8, ["icon"])) :
|
918
|
+
}, null, 8, ["icon"])) : R("", !0)
|
972
919
|
]),
|
973
920
|
_: 1
|
974
921
|
}, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter"]),
|
975
|
-
i.value && s.value.length > 0 && r.value === "popover" ? (p(),
|
922
|
+
i.value && s.value.length > 0 && r.value === "popover" ? (p(), V(v(Re), {
|
976
923
|
key: 0,
|
977
|
-
class:
|
924
|
+
class: ke(["suggestions-list", d.value])
|
978
925
|
}, {
|
979
|
-
default:
|
980
|
-
(p(!0),
|
926
|
+
default: b(() => [
|
927
|
+
(p(!0), q(T, null, K(s.value, (k) => (p(), V(v(Ae), {
|
981
928
|
button: "",
|
982
|
-
key:
|
983
|
-
onClick: (
|
929
|
+
key: k.label,
|
930
|
+
onClick: (U) => _(k)
|
984
931
|
}, {
|
985
|
-
default:
|
986
|
-
e.value.multiple ? (p(),
|
932
|
+
default: b(() => [
|
933
|
+
e.value.multiple ? (p(), V(v(fe), {
|
987
934
|
key: 0,
|
988
935
|
slot: "start",
|
989
|
-
checked:
|
990
|
-
}, null, 8, ["checked"])) :
|
991
|
-
A(
|
992
|
-
default:
|
993
|
-
|
936
|
+
checked: k.isChecked
|
937
|
+
}, null, 8, ["checked"])) : R("", !0),
|
938
|
+
A(v(H), null, {
|
939
|
+
default: b(() => [
|
940
|
+
I(B(k.label), 1)
|
994
941
|
]),
|
995
942
|
_: 2
|
996
943
|
}, 1024)
|
@@ -999,15 +946,15 @@ const re = /* @__PURE__ */ U({
|
|
999
946
|
}, 1032, ["onClick"]))), 128))
|
1000
947
|
]),
|
1001
948
|
_: 1
|
1002
|
-
}, 8, ["class"])) :
|
949
|
+
}, 8, ["class"])) : R("", !0)
|
1003
950
|
], 544));
|
1004
951
|
}
|
1005
|
-
}),
|
1006
|
-
const
|
1007
|
-
for (const [e, l] of
|
1008
|
-
|
1009
|
-
return
|
1010
|
-
},
|
952
|
+
}), he = (t, u) => {
|
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({
|
1011
958
|
__name: "TextAreaInput",
|
1012
959
|
props: /* @__PURE__ */ z({
|
1013
960
|
schema: {}
|
@@ -1016,25 +963,25 @@ const re = /* @__PURE__ */ U({
|
|
1016
963
|
modelModifiers: {}
|
1017
964
|
}),
|
1018
965
|
emits: ["update:modelValue"],
|
1019
|
-
setup(t, { expose:
|
1020
|
-
const
|
966
|
+
setup(t, { expose: u }) {
|
967
|
+
const n = t, e = $(t, "modelValue"), l = C(null), a = C(e.value.value), i = w(() => n.schema), { onValueUpdate: s, onFocus: h, onReset: c, getErrors: r } = Q(
|
1021
968
|
l,
|
1022
969
|
e,
|
1023
|
-
|
970
|
+
a,
|
1024
971
|
i
|
1025
972
|
);
|
1026
|
-
return
|
973
|
+
return S(
|
1027
974
|
() => e.value.value,
|
1028
|
-
(
|
1029
|
-
),
|
975
|
+
(d) => a.value = d
|
976
|
+
), u({
|
1030
977
|
onReset: c,
|
1031
978
|
onValueUpdate: s,
|
1032
979
|
getErrors: r
|
1033
|
-
}), (
|
980
|
+
}), (d, o) => (p(), V(v(Ue), {
|
1034
981
|
ref_key: "inputRef",
|
1035
982
|
ref: l,
|
1036
|
-
modelValue:
|
1037
|
-
"onUpdate:modelValue":
|
983
|
+
modelValue: a.value,
|
984
|
+
"onUpdate:modelValue": o[0] || (o[0] = (m) => a.value = m),
|
1038
985
|
"clear-input": !0,
|
1039
986
|
fill: e.value.fill ?? "solid",
|
1040
987
|
"label-placement": e.value.labelPlacement ?? "stacked",
|
@@ -1052,20 +999,20 @@ const re = /* @__PURE__ */ U({
|
|
1052
999
|
"max-length": e.value.maxLength,
|
1053
1000
|
"min-length": e.value.minLength,
|
1054
1001
|
pattern: e.value.pattern,
|
1055
|
-
onIonFocus:
|
1056
|
-
onIonChange:
|
1057
|
-
onIonBlur:
|
1002
|
+
onIonFocus: v(h),
|
1003
|
+
onIonChange: v(s),
|
1004
|
+
onIonBlur: v(s)
|
1058
1005
|
}, {
|
1059
|
-
default:
|
1006
|
+
default: b(() => [
|
1060
1007
|
A(re, { model: e.value }, null, 8, ["model"])
|
1061
1008
|
]),
|
1062
1009
|
_: 1
|
1063
1010
|
}, 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
1011
|
}
|
1065
|
-
}),
|
1012
|
+
}), ut = {
|
1066
1013
|
class: "ion-margin-end",
|
1067
1014
|
style: { "flex-grow": "1" }
|
1068
|
-
}, ot = { style: { display: "flex", "justify-content": "flex-end" } },
|
1015
|
+
}, ot = { style: { display: "flex", "justify-content": "flex-end" } }, rt = /* @__PURE__ */ F({
|
1069
1016
|
__name: "RepeatInput",
|
1070
1017
|
props: /* @__PURE__ */ z({
|
1071
1018
|
schema: {},
|
@@ -1076,110 +1023,110 @@ const re = /* @__PURE__ */ U({
|
|
1076
1023
|
modelModifiers: {}
|
1077
1024
|
}),
|
1078
1025
|
emits: ["update:modelValue"],
|
1079
|
-
setup(t, { expose:
|
1080
|
-
const
|
1081
|
-
label: `Set ${
|
1082
|
-
value:
|
1083
|
-
other: Object.entries(
|
1084
|
-
(
|
1026
|
+
setup(t, { expose: u }) {
|
1027
|
+
const n = $(t, "modelValue"), e = C([]), { dynamicRefs: l, resetForm: a, getFormErrors: i, updateFormValues: s } = ye(), h = w(() => e.value.map((y, _) => ({
|
1028
|
+
label: `Set ${_ + 1}`,
|
1029
|
+
value: _,
|
1030
|
+
other: Object.entries(y).reduce(
|
1031
|
+
(f, [O, E]) => (f[O] = E.value, f),
|
1085
1032
|
{}
|
1086
1033
|
)
|
1087
1034
|
})));
|
1088
|
-
|
1089
|
-
|
1090
|
-
(
|
1091
|
-
|
1035
|
+
S(
|
1036
|
+
h,
|
1037
|
+
(y) => {
|
1038
|
+
n.value.value = y;
|
1092
1039
|
},
|
1093
1040
|
{ deep: !0, immediate: !0 }
|
1094
|
-
),
|
1041
|
+
), oe(c);
|
1095
1042
|
function c() {
|
1096
|
-
|
1043
|
+
n.value.children && e.value.push(ue(n.value.children));
|
1097
1044
|
}
|
1098
|
-
function r(
|
1099
|
-
e.value.splice(
|
1045
|
+
function r(y) {
|
1046
|
+
e.value.splice(y, 1);
|
1100
1047
|
}
|
1101
|
-
function
|
1102
|
-
|
1048
|
+
function d() {
|
1049
|
+
a();
|
1103
1050
|
}
|
1104
|
-
function
|
1051
|
+
function o() {
|
1105
1052
|
return i();
|
1106
1053
|
}
|
1107
1054
|
async function m() {
|
1108
1055
|
await s();
|
1109
1056
|
}
|
1110
|
-
return
|
1057
|
+
return u({
|
1111
1058
|
onValueUpdate: m,
|
1112
|
-
onReset:
|
1113
|
-
getErrors:
|
1114
|
-
}), (
|
1059
|
+
onReset: d,
|
1060
|
+
getErrors: o
|
1061
|
+
}), (y, _) => (p(!0), q(T, null, K(e.value, (f, O) => (p(), q("div", {
|
1115
1062
|
class: "repeat-input-wrapper",
|
1116
|
-
key:
|
1063
|
+
key: O
|
1117
1064
|
}, [
|
1118
|
-
|
1119
|
-
A(
|
1120
|
-
default:
|
1121
|
-
(p(!0),
|
1122
|
-
var L,
|
1123
|
-
return p(),
|
1124
|
-
|
1125
|
-
key: `${
|
1126
|
-
size: ((L =
|
1127
|
-
"size-sm": (
|
1128
|
-
"size-md": (
|
1129
|
-
"size-lg": (
|
1130
|
-
"size-xl": (
|
1065
|
+
ie("div", ut, [
|
1066
|
+
A(v(te), null, {
|
1067
|
+
default: b(() => [
|
1068
|
+
(p(!0), q(T, null, K(Object.keys(f), (E) => {
|
1069
|
+
var L, M, j, W, P;
|
1070
|
+
return p(), q(T, null, [
|
1071
|
+
v(ne)(f[E], y.data, y.computedData) ? (p(), V(v(le), {
|
1072
|
+
key: `${O}-${E}`,
|
1073
|
+
size: ((L = f[E].grid) == null ? void 0 : L.xs) ?? "12",
|
1074
|
+
"size-sm": (M = f[E].grid) == null ? void 0 : M.sm,
|
1075
|
+
"size-md": (j = f[E].grid) == null ? void 0 : j.md,
|
1076
|
+
"size-lg": (W = f[E].grid) == null ? void 0 : W.lg,
|
1077
|
+
"size-xl": (P = f[E].grid) == null ? void 0 : P.xl,
|
1131
1078
|
class: "ion-margin-bottom"
|
1132
1079
|
}, {
|
1133
|
-
default:
|
1134
|
-
(p(),
|
1135
|
-
modelValue:
|
1136
|
-
"onUpdate:modelValue": (
|
1137
|
-
schema:
|
1138
|
-
"ref-key": `${
|
1080
|
+
default: b(() => [
|
1081
|
+
(p(), V(de(f[E].type), {
|
1082
|
+
modelValue: f[E],
|
1083
|
+
"onUpdate:modelValue": (N) => f[E] = N,
|
1084
|
+
schema: f,
|
1085
|
+
"ref-key": `${O}-${E}`,
|
1139
1086
|
ref_for: !0,
|
1140
1087
|
ref_key: "dynamicRefs",
|
1141
1088
|
ref: l
|
1142
1089
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "ref-key"]))
|
1143
1090
|
]),
|
1144
1091
|
_: 2
|
1145
|
-
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) :
|
1092
|
+
}, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : R("", !0)
|
1146
1093
|
], 64);
|
1147
1094
|
}), 256))
|
1148
1095
|
]),
|
1149
1096
|
_: 2
|
1150
1097
|
}, 1024)
|
1151
1098
|
]),
|
1152
|
-
|
1153
|
-
|
1099
|
+
ie("div", ot, [
|
1100
|
+
O === e.value.length - 1 ? (p(), V(v(Z), {
|
1154
1101
|
key: 0,
|
1155
1102
|
onClick: c,
|
1156
1103
|
color: "primary"
|
1157
1104
|
}, {
|
1158
|
-
default:
|
1159
|
-
A(
|
1105
|
+
default: b(() => [
|
1106
|
+
A(v(ee), {
|
1160
1107
|
slot: "icon-only",
|
1161
|
-
icon:
|
1108
|
+
icon: v($e)
|
1162
1109
|
}, null, 8, ["icon"])
|
1163
1110
|
]),
|
1164
1111
|
_: 1
|
1165
|
-
})) :
|
1166
|
-
e.value.length > 1 ? (p(),
|
1112
|
+
})) : R("", !0),
|
1113
|
+
e.value.length > 1 ? (p(), V(v(Z), {
|
1167
1114
|
key: 1,
|
1168
|
-
onClick: (
|
1115
|
+
onClick: (E) => r(O),
|
1169
1116
|
color: "warning"
|
1170
1117
|
}, {
|
1171
|
-
default:
|
1172
|
-
A(
|
1118
|
+
default: b(() => [
|
1119
|
+
A(v(ee), {
|
1173
1120
|
slot: "icon-only",
|
1174
|
-
icon:
|
1121
|
+
icon: v(Te)
|
1175
1122
|
}, null, 8, ["icon"])
|
1176
1123
|
]),
|
1177
1124
|
_: 2
|
1178
|
-
}, 1032, ["onClick"])) :
|
1125
|
+
}, 1032, ["onClick"])) : R("", !0)
|
1179
1126
|
])
|
1180
1127
|
]))), 128));
|
1181
1128
|
}
|
1182
|
-
}),
|
1129
|
+
}), st = /* @__PURE__ */ he(rt, [["__scopeId", "data-v-060bdf58"]]), it = /* @__PURE__ */ F({
|
1183
1130
|
__name: "CheckboxInput",
|
1184
1131
|
props: /* @__PURE__ */ z({
|
1185
1132
|
schema: {}
|
@@ -1188,37 +1135,37 @@ const re = /* @__PURE__ */ U({
|
|
1188
1135
|
modelModifiers: {}
|
1189
1136
|
}),
|
1190
1137
|
emits: ["update:modelValue"],
|
1191
|
-
setup(t, { expose:
|
1192
|
-
const
|
1193
|
-
function
|
1194
|
-
|
1138
|
+
setup(t, { expose: u }) {
|
1139
|
+
const n = t, e = $(t, "modelValue"), l = C(null), a = C(e.value.value), i = w(() => n.schema), s = w(() => me(e.value)), { onValueUpdate: h, onFocus: c, getErrors: r } = Q(l, e, a, i);
|
1140
|
+
function d() {
|
1141
|
+
a.value = !1, e.value.error = "", e.value.value = !1;
|
1195
1142
|
}
|
1196
|
-
return
|
1143
|
+
return S(
|
1197
1144
|
() => e.value.value,
|
1198
|
-
(
|
1199
|
-
),
|
1200
|
-
onValueUpdate:
|
1201
|
-
onReset:
|
1145
|
+
(o) => a.value = o
|
1146
|
+
), u({
|
1147
|
+
onValueUpdate: h,
|
1148
|
+
onReset: d,
|
1202
1149
|
getErrors: r
|
1203
|
-
}), (
|
1204
|
-
modelValue:
|
1205
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
1150
|
+
}), (o, m) => (p(), V(v(fe), {
|
1151
|
+
modelValue: a.value,
|
1152
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => a.value = y),
|
1206
1153
|
ref_key: "inputRef",
|
1207
1154
|
ref: l,
|
1208
1155
|
required: e.value.required,
|
1209
1156
|
"error-text": e.value.error,
|
1210
1157
|
disabled: e.value.disabled,
|
1211
|
-
onIonFocus:
|
1212
|
-
onIonChange:
|
1213
|
-
onIonBlur:
|
1158
|
+
onIonFocus: v(c),
|
1159
|
+
onIonChange: v(h),
|
1160
|
+
onIonBlur: v(h)
|
1214
1161
|
}, {
|
1215
|
-
default:
|
1216
|
-
|
1162
|
+
default: b(() => [
|
1163
|
+
I(B(s.value), 1)
|
1217
1164
|
]),
|
1218
1165
|
_: 1
|
1219
1166
|
}, 8, ["modelValue", "required", "error-text", "disabled", "onIonFocus", "onIonChange", "onIonBlur"]));
|
1220
1167
|
}
|
1221
|
-
}),
|
1168
|
+
}), ct = /* @__PURE__ */ F({
|
1222
1169
|
__name: "RadioInput",
|
1223
1170
|
props: /* @__PURE__ */ z({
|
1224
1171
|
schema: {}
|
@@ -1227,49 +1174,49 @@ const re = /* @__PURE__ */ U({
|
|
1227
1174
|
modelModifiers: {}
|
1228
1175
|
}),
|
1229
1176
|
emits: ["update:modelValue"],
|
1230
|
-
setup(t, { expose:
|
1231
|
-
const
|
1232
|
-
function
|
1233
|
-
e.value.error = "",
|
1177
|
+
setup(t, { expose: u }) {
|
1178
|
+
const n = t, e = $(t, "modelValue"), l = C(null), a = C(e.value.value), i = w(() => n.schema), s = C([]), h = w(() => me(e.value)), { onValueUpdate: c, onFocus: r, getErrors: d } = Q(l, e, a, i);
|
1179
|
+
function o() {
|
1180
|
+
e.value.error = "", a.value = void 0, e.value.value = void 0;
|
1234
1181
|
}
|
1235
|
-
function m(
|
1236
|
-
return
|
1182
|
+
function m(_, f) {
|
1183
|
+
return _.value === f.value;
|
1237
1184
|
}
|
1238
|
-
async function
|
1185
|
+
async function y() {
|
1239
1186
|
typeof e.value.options == "function" ? s.value = await e.value.options() : s.value = e.value.options;
|
1240
1187
|
}
|
1241
|
-
return
|
1188
|
+
return S(
|
1242
1189
|
() => e.value.value,
|
1243
|
-
(
|
1244
|
-
),
|
1190
|
+
(_) => a.value = _
|
1191
|
+
), u({
|
1245
1192
|
onValueUpdate: c,
|
1246
|
-
onReset:
|
1247
|
-
getErrors:
|
1248
|
-
}),
|
1249
|
-
modelValue:
|
1250
|
-
"onUpdate:modelValue":
|
1193
|
+
onReset: o,
|
1194
|
+
getErrors: d
|
1195
|
+
}), oe(y), (_, f) => (p(), V(v(Be), {
|
1196
|
+
modelValue: a.value,
|
1197
|
+
"onUpdate:modelValue": f[0] || (f[0] = (O) => a.value = O),
|
1251
1198
|
ref_key: "inputRef",
|
1252
1199
|
ref: l,
|
1253
1200
|
required: e.value.required,
|
1254
|
-
"helper-text":
|
1201
|
+
"helper-text": h.value,
|
1255
1202
|
"error-text": e.value.error,
|
1256
1203
|
disabled: e.value.disabled,
|
1257
1204
|
compareWith: m,
|
1258
1205
|
"allow-empty-selection": !e.value.required,
|
1259
|
-
onIonFocus:
|
1260
|
-
onIonChange:
|
1261
|
-
onIonBlur:
|
1206
|
+
onIonFocus: v(r),
|
1207
|
+
onIonChange: v(c),
|
1208
|
+
onIonBlur: v(c)
|
1262
1209
|
}, {
|
1263
|
-
default:
|
1264
|
-
(p(!0),
|
1265
|
-
key:
|
1266
|
-
value:
|
1210
|
+
default: b(() => [
|
1211
|
+
(p(!0), q(T, null, K(s.value, (O) => (p(), V(v(Se), {
|
1212
|
+
key: O.value,
|
1213
|
+
value: O,
|
1267
1214
|
disabled: e.value.disabled,
|
1268
1215
|
"label-placement": "end",
|
1269
1216
|
justify: "start"
|
1270
1217
|
}, {
|
1271
|
-
default:
|
1272
|
-
|
1218
|
+
default: b(() => [
|
1219
|
+
I(B(O.label), 1)
|
1273
1220
|
]),
|
1274
1221
|
_: 2
|
1275
1222
|
}, 1032, ["value", "disabled"]))), 128))
|
@@ -1277,17 +1224,70 @@ const re = /* @__PURE__ */ U({
|
|
1277
1224
|
_: 1
|
1278
1225
|
}, 8, ["modelValue", "required", "helper-text", "error-text", "disabled", "allow-empty-selection", "onIonFocus", "onIonChange", "onIonBlur"]));
|
1279
1226
|
}
|
1280
|
-
})
|
1227
|
+
});
|
1228
|
+
function mt(t, u, n) {
|
1229
|
+
const e = C({}), l = C({});
|
1230
|
+
function a(r, d, o) {
|
1231
|
+
l.value[r] = o, d.forEach((m) => {
|
1232
|
+
var y;
|
1233
|
+
(y = e.value)[m] ?? (y[m] = []), e.value[m].includes(r) || e.value[m].push(r);
|
1234
|
+
}), c(r);
|
1235
|
+
}
|
1236
|
+
function i(r) {
|
1237
|
+
return Object.entries(e.value).filter(([, o]) => o.includes(r)).map(([o]) => o).reduce(
|
1238
|
+
(o, m) => (o[m] = u.value[m] ?? n.value[m], o),
|
1239
|
+
{}
|
1240
|
+
);
|
1241
|
+
}
|
1242
|
+
function s(r, d) {
|
1243
|
+
return r ? Array.isArray(r) ? r.some((o) => d.some((m) => h(o, m.value))) : d.some((o) => h(r, o.value)) : !1;
|
1244
|
+
}
|
1245
|
+
function h(r, d) {
|
1246
|
+
return typeof r == "object" && r !== null ? r.value === d : String(r) === String(d);
|
1247
|
+
}
|
1248
|
+
async function c(r, d) {
|
1249
|
+
if (!l.value[r]) return;
|
1250
|
+
const o = i(r), m = Object.keys(o);
|
1251
|
+
if (!(m.length === 0 || !m.every(
|
1252
|
+
(_) => o[_] !== void 0 && o[_] !== null
|
1253
|
+
)))
|
1254
|
+
try {
|
1255
|
+
const _ = l.value[r], f = await _(d, o);
|
1256
|
+
if (!t.value[r]) return;
|
1257
|
+
t.value[r].options = f;
|
1258
|
+
const O = t.value[r].value;
|
1259
|
+
if (!O) return;
|
1260
|
+
s(O, f) || (t.value[r].value = t.value[r].multiple ? [] : "");
|
1261
|
+
} catch (_) {
|
1262
|
+
console.error(`Error loading options for ${r}:`, _);
|
1263
|
+
}
|
1264
|
+
}
|
1265
|
+
return S(
|
1266
|
+
[u, n],
|
1267
|
+
() => {
|
1268
|
+
Object.entries(e.value).forEach(([r, d]) => {
|
1269
|
+
(u.value[r] !== void 0 || n.value[r] !== void 0) && d.forEach((o) => {
|
1270
|
+
c(o);
|
1271
|
+
});
|
1272
|
+
});
|
1273
|
+
},
|
1274
|
+
{ deep: !0, immediate: !0 }
|
1275
|
+
), {
|
1276
|
+
registerDependency: a,
|
1277
|
+
updateOptions: c
|
1278
|
+
};
|
1279
|
+
}
|
1280
|
+
const yt = {
|
1281
1281
|
install(t) {
|
1282
|
-
t.component("VForm",
|
1282
|
+
t.component("VForm", We), t.component("TextInput", Qe), t.component("DateInput", Xe), t.component("NumberInput", Ye), t.component("EmailInput", et), t.component("PasswordInput", tt), t.component("SelectInput", at), t.component("TextAreaInput", nt), t.component("RepeatInput", st), t.component("CheckboxInput", it), t.component("RadioInput", ct), t.directive("maskito", Le);
|
1283
1283
|
}
|
1284
1284
|
};
|
1285
1285
|
export {
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1286
|
+
yt as VForm,
|
1287
|
+
yt as default,
|
1288
|
+
Ke as useDataTransformation,
|
1289
|
+
mt as useDependentOptions,
|
1290
|
+
ye as useFormValidation,
|
1291
|
+
Q as useInputValidation
|
1292
1292
|
};
|
1293
1293
|
//# sourceMappingURL=index.es.js.map
|