@uniquedj95/vform 3.1.4 → 3.3.0

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