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