@uniquedj95/vform 3.0.6 → 3.1.1

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