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