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