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