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