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