@uniquedj95/vform 3.1.0 → 3.1.2

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