@uniquedj95/vform 3.2.0 → 3.4.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 (47) hide show
  1. package/README.md +347 -37
  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 +1 -7
  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/shared/StepIndicator.vue.d.ts +18 -0
  23. package/dist/components/shared/StepIndicator.vue.d.ts.map +1 -0
  24. package/dist/components/vForm.vue.d.ts +21 -7
  25. package/dist/components/vForm.vue.d.ts.map +1 -1
  26. package/dist/composables/useDataTransformation.d.ts +1 -1
  27. package/dist/composables/useDataTransformation.d.ts.map +1 -1
  28. package/dist/composables/useDependentOptions.d.ts.map +1 -1
  29. package/dist/composables/useInputProps.d.ts.map +1 -1
  30. package/dist/composables/useInputValidation.d.ts.map +1 -1
  31. package/dist/composables/useLabelTemplate.d.ts.map +1 -1
  32. package/dist/composables/useMultiStepForm.d.ts +27 -0
  33. package/dist/composables/useMultiStepForm.d.ts.map +1 -0
  34. package/dist/index.cjs.js +1 -1
  35. package/dist/index.cjs.js.map +1 -1
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.es.js +1040 -635
  39. package/dist/index.es.js.map +1 -1
  40. package/dist/index.umd.js +1 -1
  41. package/dist/index.umd.js.map +1 -1
  42. package/dist/types/index.d.ts +93 -2
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/utils/index.d.ts +7 -1
  45. package/dist/utils/index.d.ts.map +1 -1
  46. package/dist/vform.css +1 -1
  47. package/package.json +5 -1
package/dist/index.es.js CHANGED
@@ -1,197 +1,202 @@
1
- import { ref as C, computed as O, watch as q, defineComponent as U, createBlock as b, openBlock as p, unref as d, withCtx as x, createVNode as A, createCommentVNode as I, createElementBlock as B, Fragment as M, renderList as K, resolveDynamicComponent as ie, normalizeStyle as ge, createTextVNode as F, toDisplayString as S, toRef as Ve, mergeModels as z, useModel as $, resolveDirective as be, withDirectives as _e, onMounted as ue, normalizeClass as xe, createElementVNode as se } from "vue";
2
- import { IonGrid as ke, IonRow as te, IonCol as le, IonButton as W, IonLabel as H, IonText as Ce, IonInput as ce, IonInputPasswordToggle as Ee, IonChip as we, IonIcon as X, IonList as Oe, IonItem as Ie, IonCheckbox as de, actionSheetController as Re, alertController as Ae, IonTextarea as Fe, IonRadioGroup as Ue, IonRadio as Se } from "@ionic/vue";
3
- import { chevronDown as Be, close as qe, add as ze, remove as $e } from "ionicons/icons";
4
- import { maskito as Te } from "@maskito/vue";
5
- function Me(t) {
1
+ import { ref as E, computed as S, watch as I, defineComponent as U, createElementBlock as $, openBlock as f, normalizeClass as ne, createElementVNode as B, createCommentVNode as O, Fragment as T, renderList as K, toDisplayString as A, normalizeStyle as ve, createBlock as V, createVNode as P, unref as d, withCtx as b, resolveDynamicComponent as fe, createTextVNode as z, toRef as Oe, mergeModels as N, useModel as G, resolveDirective as Ee, withDirectives as xe, onMounted as ge } from "vue";
2
+ import { IonGrid as Ce, IonRow as le, IonCol as ae, IonButton as j, IonLabel as Y, IonText as Re, IonInput as Ve, IonInputPasswordToggle as Ae, IonChip as $e, IonIcon as ce, IonList as Fe, IonItem as ze, IonCheckbox as be, actionSheetController as Be, alertController as Pe, IonTextarea as Ie, IonRadioGroup as Ue, IonRadio as De } from "@ionic/vue";
3
+ import { chevronDown as Te, close as qe, add as Le, remove as Me } from "ionicons/icons";
4
+ import { maskito as je } from "@maskito/vue";
5
+ function Ne(t) {
6
6
  return new Promise((o) => {
7
7
  requestAnimationFrame(async () => {
8
- const a = await t.getInputElement();
9
- o(a);
8
+ const n = await t.getInputElement();
9
+ o(n);
10
10
  });
11
11
  });
12
12
  }
13
- const Le = {
13
+ const Ge = {
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
- }, De = {
18
+ }, He = {
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 je(t, o) {
24
- const a = De[t];
25
- return a[o % a.length];
23
+ function Ke(t, o) {
24
+ const n = He[t];
25
+ return n[o % n.length];
26
26
  }
27
- function Pe(t) {
27
+ function We(t) {
28
28
  const o = [];
29
- let a = "", e = 0, l = 0;
29
+ let n = "", e = 0, l = 0;
30
30
  for (; e < t.length; ) {
31
- const n = t[e];
32
- if (["d", "a", "*"].includes(n)) {
33
- let i = 1;
31
+ const u = t[e];
32
+ if (["d", "a", "*"].includes(u)) {
33
+ let r = 1;
34
34
  if (t[e + 1] === "{") {
35
35
  const s = t.indexOf("}", e + 2);
36
36
  if (s !== -1) {
37
- const f = t.slice(e + 2, s);
38
- if (f.includes(",")) {
39
- const [, c] = f.split(",").map((r) => parseInt(r.trim()));
40
- i = c || parseInt(f.split(",")[0]);
37
+ const y = t.slice(e + 2, s);
38
+ if (y.includes(",")) {
39
+ const [, p] = y.split(",").map((c) => parseInt(c.trim()));
40
+ r = p || parseInt(y.split(",")[0]);
41
41
  } else
42
- i = parseInt(f);
42
+ r = parseInt(y);
43
43
  e = s;
44
44
  }
45
45
  } else {
46
46
  let s = e + 1;
47
- for (; t[s] === n; )
48
- i++, s++;
47
+ for (; t[s] === u; )
48
+ r++, s++;
49
49
  e = s - 1;
50
50
  }
51
- for (let s = 0; s < i; s++)
52
- o.push(Le[n]), a += je(n, l++);
51
+ for (let s = 0; s < r; s++)
52
+ o.push(Ge[u]), n += Ke(u, l++);
53
53
  } else
54
- o.push(n), a += n;
54
+ o.push(u), n += u;
55
55
  e++;
56
56
  }
57
57
  return {
58
58
  mask: o,
59
- placeholder: a,
60
- elementPredicate: Me
59
+ placeholder: n,
60
+ elementPredicate: Ne
61
61
  };
62
62
  }
63
- function ae(t) {
63
+ function me(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, a) {
67
- return typeof t.condition == "function" ? t.condition(o, a) : !0;
66
+ function ie(t, o, n) {
67
+ return typeof t.condition == "function" ? t.condition(o, n) : !0;
68
68
  }
69
- function oe(t) {
69
+ function he(t) {
70
70
  if (typeof t != "object" || t === null)
71
71
  return t;
72
72
  if (Array.isArray(t))
73
- return t.map((a) => oe(a));
73
+ return t.map((n) => he(n));
74
74
  const o = {};
75
- return Object.entries(t).forEach(([a, e]) => {
76
- typeof e == "function" ? o[a] = e.bind(o) : o[a] = oe(e);
75
+ return Object.entries(t).forEach(([n, e]) => {
76
+ typeof e == "function" ? o[n] = e.bind(o) : o[n] = he(e);
77
77
  }), o;
78
78
  }
79
- function ve(t, o) {
80
- return o.findIndex((a) => a.value === t.value || a.label === t.label || a.value === t.label || a.label === t.value);
79
+ function ke(t, o) {
80
+ return o.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 a = ve(t, o);
84
- a >= 0 ? o[a].isChecked = !0 : o.push({ ...t, isChecked: !0 });
82
+ function X(t, o) {
83
+ const n = ke(t, o);
84
+ n >= 0 ? o[n].isChecked = !0 : o.push({ ...t, isChecked: !0 });
85
85
  }
86
- function ee(t, o) {
87
- const a = ve(t, o);
88
- a >= 0 && (o[a].isChecked = !1);
86
+ function _e(t, o) {
87
+ const n = ke(t, o);
88
+ n >= 0 && (o[n].isChecked = !1);
89
89
  }
90
- function Ne(t, o) {
90
+ function Ze(t) {
91
+ t.forEach((o) => {
92
+ o.isChecked = !1;
93
+ });
94
+ }
95
+ function Je(t, o) {
91
96
  return o ? t.filter(
92
- (a) => JSON.stringify(a).toLowerCase().includes(o.toLowerCase())
97
+ (n) => JSON.stringify(n).toLowerCase().includes(o.toLowerCase())
93
98
  ) : t;
94
99
  }
95
- function fe(t) {
96
- const o = t.label || "", a = t.required ? " *" : "";
97
- return o + a;
100
+ function Se(t) {
101
+ const o = t.label || "", n = t.required ? " *" : "";
102
+ return o + n;
98
103
  }
99
- function Y(t, o) {
104
+ function oe(t, o) {
100
105
  if (t === o) return !0;
101
106
  if (t == null || o == null || typeof t != typeof o) return !1;
102
107
  if (typeof t != "object") return t === o;
103
108
  if (Array.isArray(t) && Array.isArray(o))
104
- return t.length !== o.length ? !1 : t.every((l, n) => Y(l, o[n]));
109
+ return t.length !== o.length ? !1 : t.every((l, u) => oe(l, o[u]));
105
110
  if (Array.isArray(t) !== Array.isArray(o)) return !1;
106
- const a = Object.keys(t), e = Object.keys(o);
107
- return a.length !== e.length ? !1 : a.every(
108
- (l) => Object.prototype.hasOwnProperty.call(o, l) && Y(t[l], o[l])
111
+ const n = Object.keys(t), e = Object.keys(o);
112
+ return n.length !== e.length ? !1 : n.every(
113
+ (l) => Object.prototype.hasOwnProperty.call(o, l) && oe(t[l], o[l])
109
114
  );
110
115
  }
111
- function pe() {
112
- const t = C([]);
116
+ function we() {
117
+ const t = E([]);
113
118
  async function o() {
114
119
  console.debug("Validating form inputs");
115
- const n = [];
116
- for (const i of t.value)
117
- if (typeof (i == null ? void 0 : i.onValueUpdate) == "function" && await i.onValueUpdate(), typeof (i == null ? void 0 : i.getErrors) == "function")
120
+ const u = [];
121
+ for (const r of t.value)
122
+ if (typeof (r == null ? void 0 : r.onValueUpdate) == "function" && await r.onValueUpdate(), typeof (r == null ? void 0 : r.getErrors) == "function")
118
123
  try {
119
- const s = i.getErrors();
120
- Array.isArray(s) ? n.push(...s) : console.warn("getErrors() returned non-array value:", s);
124
+ const s = r.getErrors();
125
+ Array.isArray(s) ? u.push(...s) : console.warn("getErrors() returned non-array value:", s);
121
126
  } catch (s) {
122
- console.error("Error calling getErrors on component:", s, i);
127
+ console.error("Error calling getErrors on component:", s, r);
123
128
  }
124
129
  else
125
- console.warn("Component does not have getErrors function:", i);
126
- return n.every(ae);
130
+ console.warn("Component does not have getErrors function:", r);
131
+ return u.every(me);
127
132
  }
128
- function a() {
129
- t.value.forEach((n) => {
130
- typeof (n == null ? void 0 : n.onReset) == "function" && n.onReset();
133
+ function n() {
134
+ t.value.forEach((u) => {
135
+ typeof (u == null ? void 0 : u.onReset) == "function" && u.onReset();
131
136
  });
132
137
  }
133
138
  function e() {
134
- const n = [];
135
- for (const i of t.value)
136
- if (typeof (i == null ? void 0 : i.getErrors) == "function")
139
+ const u = [];
140
+ for (const r of t.value)
141
+ if (typeof (r == null ? void 0 : r.getErrors) == "function")
137
142
  try {
138
- const s = i.getErrors();
139
- Array.isArray(s) ? n.push(...s) : n.push(String(s));
143
+ const s = r.getErrors();
144
+ Array.isArray(s) ? u.push(...s) : u.push(String(s));
140
145
  } catch (s) {
141
- console.error("Error calling getErrors on component:", s, i);
146
+ console.error("Error calling getErrors on component:", s, r);
142
147
  }
143
- return n;
148
+ return u;
144
149
  }
145
150
  async function l() {
146
- for (const n of t.value)
147
- typeof (n == null ? void 0 : n.onValueUpdate) == "function" && await n.onValueUpdate();
151
+ for (const u of t.value)
152
+ typeof (u == null ? void 0 : u.onValueUpdate) == "function" && await u.onValueUpdate();
148
153
  }
149
154
  return {
150
155
  dynamicRefs: t,
151
156
  isFormValid: o,
152
- resetForm: a,
157
+ resetForm: n,
153
158
  getFormErrors: e,
154
159
  updateFormValues: l
155
160
  };
156
161
  }
157
- function Ge(t) {
158
- const o = O(
159
- () => Object.entries(t.value).reduce((c, [r, v]) => (v.value !== void 0 && (typeof v.onChange == "function" ? c[r] = v.onChange(v.value) : c[r] = v.value), c), {})
160
- ), a = C({}), e = (c, r, v) => {
161
- var u;
162
- return typeof ((u = t.value[c].children[r]) == null ? void 0 : u.computedValue) == "function" ? t.value[c].children[r].computedValue(v, t.value) : v;
163
- }, l = (c, r, v, u) => {
164
- a.value[c][u] || (a.value[c][u] = {}), Object.entries(r.other ?? {}).forEach(([m, _]) => {
165
- var g;
166
- !Y(_, (g = v.other) == null ? void 0 : g[m]) && (a.value[c][u][m] = e(c, m, _));
162
+ function Qe(t) {
163
+ const o = S(
164
+ () => Object.entries(t.value).reduce((p, [c, v]) => (v.value !== void 0 && (typeof v.onChange == "function" ? p[c] = v.onChange(v.value, t.value) : p[c] = v.value), p), {})
165
+ ), n = E({}), e = (p, c, v) => {
166
+ var i;
167
+ return typeof ((i = t.value[p].children[c]) == null ? void 0 : i.computedValue) == "function" ? t.value[p].children[c].computedValue(v, t.value) : v;
168
+ }, l = (p, c, v, i) => {
169
+ n.value[p][i] || (n.value[p][i] = {}), Object.entries(c.other ?? {}).forEach(([m, C]) => {
170
+ var w;
171
+ !oe(C, (w = v.other) == null ? void 0 : w[m]) && (n.value[p][i][m] = e(p, m, C));
167
172
  });
168
- }, n = (c, r, v) => {
169
- r.forEach((u, m) => {
170
- const _ = v[m] ?? { other: {} };
171
- l(c, u, _, m);
173
+ }, u = (p, c, v) => {
174
+ c.forEach((i, m) => {
175
+ const C = v[m] ?? { other: {} };
176
+ l(p, i, C, m);
172
177
  });
173
- }, i = (c, { other: r }) => Object.entries(r ?? {}).reduce(
174
- (v, [u, m]) => (v[u] = e(c, u, m), v),
178
+ }, r = (p, { other: c }) => Object.entries(c ?? {}).reduce(
179
+ (v, [i, m]) => (v[i] = e(p, i, m), v),
175
180
  {}
176
- ), s = (c, r, v) => {
177
- a.value[c] || (a.value[c] = []);
178
- const u = r;
179
- Array.isArray(v[c]) ? n(c, u, v[c]) : a.value[c] = u.map((m) => i(c, m));
180
- }, f = (c, r, v) => {
181
- if (!r) {
182
- delete a.value[c];
181
+ ), s = (p, c, v) => {
182
+ n.value[p] || (n.value[p] = []);
183
+ const i = c;
184
+ Array.isArray(v[p]) ? u(p, i, v[p]) : n.value[p] = i.map((m) => r(p, m));
185
+ }, y = (p, c, v) => {
186
+ if (!c) {
187
+ delete n.value[p];
183
188
  return;
184
189
  }
185
- const u = t.value[c];
186
- u.children !== void 0 ? s(c, r, v) : typeof u.computedValue == "function" && (a.value[c] = u.computedValue(r, t.value));
190
+ const i = t.value[p];
191
+ i.children !== void 0 ? s(p, c, v) : typeof i.computedValue == "function" && (n.value[p] = i.computedValue(c, t.value));
187
192
  };
188
- return q(
193
+ return I(
189
194
  o,
190
- (c, r = {}) => {
191
- Object.keys(c).forEach((v) => {
192
- Y(c[v], r[v]) || f(v, c[v], r);
193
- }), Object.keys(r).forEach((v) => {
194
- !(v in c) && v in a.value && delete a.value[v];
195
+ (p, c = {}) => {
196
+ Object.keys(p).forEach((v) => {
197
+ oe(p[v], c[v]) || y(v, p[v], c);
198
+ }), Object.keys(c).forEach((v) => {
199
+ !(v in p) && v in n.value && delete n.value[v];
195
200
  });
196
201
  },
197
202
  {
@@ -200,65 +205,193 @@ function Ge(t) {
200
205
  }
201
206
  ), {
202
207
  formData: o,
203
- computedData: a
208
+ computedData: n
204
209
  };
205
210
  }
206
- function He(t, o, a) {
207
- const e = C({}), l = C({});
208
- function n(r, v, u) {
209
- l.value[r] = u, v.forEach((m) => {
210
- var _;
211
- (_ = e.value)[m] ?? (_[m] = []), e.value[m].includes(r) || e.value[m].push(r);
212
- }), c(r);
211
+ function Xe(t) {
212
+ const o = E(0), n = E({}), e = E({}), l = E({});
213
+ function u(_) {
214
+ const a = {};
215
+ return Object.entries(_.schema).forEach(([h, k]) => {
216
+ a[h] = k.value;
217
+ }), a;
213
218
  }
214
- function i(r) {
215
- return Object.entries(e.value).filter(([, u]) => u.includes(r)).map(([u]) => u).reduce(
216
- (u, m) => (u[m] = o.value[m] ?? a.value[m], u),
217
- {}
218
- );
219
+ t.steps.forEach((_) => {
220
+ n.value[_.id] = u(_), e.value[_.id] = {}, l.value[_.id] = [];
221
+ });
222
+ const r = S(() => t.steps[o.value]), s = S(() => o.value === 0), y = S(() => o.value === t.steps.length - 1), p = S(() => !y.value), c = S(() => !s.value), v = S(() => t.steps.length), i = S(() => v.value === 0 ? 0 : Math.round((o.value + 1) / v.value * 100)), m = S(() => {
223
+ const _ = {};
224
+ return Object.values(n.value).forEach((a) => {
225
+ Object.assign(_, a);
226
+ }), _;
227
+ }), C = S(() => {
228
+ const _ = {};
229
+ return Object.values(e.value).forEach((a) => {
230
+ Object.assign(_, a);
231
+ }), _;
232
+ });
233
+ function x(_, a) {
234
+ n.value[_] = { ...n.value[_], ...a };
219
235
  }
220
- function s(r, v) {
221
- return r ? Array.isArray(r) ? r.some((u) => v.some((m) => f(u, m.value))) : v.some((u) => f(r, u.value)) : !1;
236
+ function w(_, a) {
237
+ e.value[_] = { ...e.value[_], ...a };
222
238
  }
223
- function f(r, v) {
224
- return typeof r == "object" && r !== null ? r.value === v : String(r) === String(v);
239
+ function R(_) {
240
+ const a = t.steps.find((h) => h.id === _);
241
+ a && (n.value[_] = u(a), e.value[_] = {});
225
242
  }
226
- async function c(r, v) {
227
- if (!l.value[r]) return;
228
- const u = i(r), m = Object.keys(u);
229
- if (!(m.length === 0 || !m.every(
230
- (V) => u[V] !== void 0 && u[V] !== null
231
- )))
232
- try {
233
- const V = l.value[r], g = await V(v, u);
234
- if (!t.value[r]) return;
235
- t.value[r].options = g;
236
- const y = t.value[r].value;
237
- if (!y) return;
238
- s(y, g) || (t.value[r].value = t.value[r].multiple ? [] : "");
239
- } catch (V) {
240
- console.error(`Error loading options for ${r}:`, V);
243
+ async function F() {
244
+ const _ = r.value;
245
+ if (!_) return !0;
246
+ const a = [];
247
+ if (_.validation) {
248
+ const h = await _.validation(
249
+ n.value[_.id],
250
+ e.value[_.id]
251
+ );
252
+ h && a.push(...h);
253
+ }
254
+ return l.value[_.id] = a, a.length === 0;
255
+ }
256
+ async function q(_) {
257
+ return _ < 0 || _ >= t.steps.length || _ > o.value && !await F() ? !1 : (o.value = _, !0);
258
+ }
259
+ async function W() {
260
+ return p.value ? q(o.value + 1) : !1;
261
+ }
262
+ async function J() {
263
+ return c.value ? q(o.value - 1) : !1;
264
+ }
265
+ function Z() {
266
+ o.value = 0, l.value = {}, t.steps.forEach((_) => {
267
+ R(_.id), l.value[_.id] = [];
268
+ });
269
+ }
270
+ async function L() {
271
+ let _ = !0;
272
+ for (const a of t.steps)
273
+ if (a.validation) {
274
+ const h = await a.validation(
275
+ n.value[a.id],
276
+ e.value[a.id]
277
+ );
278
+ l.value[a.id] = h || [], h && h.length > 0 && (_ = !1);
241
279
  }
280
+ return _;
242
281
  }
243
- return q(
244
- [o, a],
245
- () => {
246
- Object.entries(e.value).forEach(([r, v]) => {
247
- (o.value[r] !== void 0 || a.value[r] !== void 0) && v.forEach((u) => {
248
- c(u);
249
- });
250
- });
251
- },
252
- { deep: !0, immediate: !0 }
253
- ), {
254
- registerDependency: n,
255
- updateOptions: c
282
+ function M() {
283
+ return {
284
+ steps: { ...n.value },
285
+ computedSteps: { ...e.value },
286
+ allFormData: m.value,
287
+ allComputedData: C.value
288
+ };
289
+ }
290
+ return {
291
+ // State
292
+ currentStepIndex: o,
293
+ currentStep: r,
294
+ stepData: n,
295
+ stepComputedData: e,
296
+ stepValidationErrors: l,
297
+ // Computed
298
+ isFirstStep: s,
299
+ isLastStep: y,
300
+ canGoNext: p,
301
+ canGoPrevious: c,
302
+ totalSteps: v,
303
+ progressPercentage: i,
304
+ allFormData: m,
305
+ allComputedData: C,
306
+ // Methods
307
+ updateStepData: x,
308
+ updateStepComputedData: w,
309
+ clearStepData: R,
310
+ validateCurrentStep: F,
311
+ goToStep: q,
312
+ nextStep: W,
313
+ previousStep: J,
314
+ resetForm: Z,
315
+ validateAllSteps: L,
316
+ getMultiStepFormData: M
256
317
  };
257
318
  }
258
- const Ke = /* @__PURE__ */ U({
319
+ const Ye = { class: "step-indicator__container" }, et = ["onClick"], tt = { class: "step-indicator__step-content" }, lt = { class: "step-indicator__step-marker" }, at = { class: "step-indicator__step-info" }, nt = { class: "step-indicator__step-title" }, ot = {
320
+ key: 0,
321
+ class: "step-indicator__step-subtitle"
322
+ }, ut = {
323
+ key: 0,
324
+ class: "step-indicator__progress"
325
+ }, st = { class: "step-indicator__progress-bar" }, rt = { class: "step-indicator__progress-text" }, it = /* @__PURE__ */ U({
326
+ __name: "StepIndicator",
327
+ props: {
328
+ steps: {},
329
+ activeStepIndex: {},
330
+ position: {},
331
+ showProgress: { type: Boolean, default: !0 },
332
+ allowNavigation: { type: Boolean, default: !1 }
333
+ },
334
+ emits: ["step-click"],
335
+ setup(t, { emit: o }) {
336
+ const n = t, e = o, l = S(() => n.steps.length === 0 ? 0 : (n.activeStepIndex + 1) / n.steps.length * 100);
337
+ function u(r) {
338
+ n.allowNavigation && e("step-click", r);
339
+ }
340
+ return (r, s) => (f(), $("div", {
341
+ class: ne(["step-indicator", [`step-indicator--${r.position}`, { "step-indicator--clickable": r.allowNavigation }]])
342
+ }, [
343
+ B("div", Ye, [
344
+ (f(!0), $(T, null, K(r.steps, (y, p) => (f(), $("div", {
345
+ key: y.id,
346
+ class: ne(["step-indicator__step", {
347
+ "step-indicator__step--active": p === r.activeStepIndex,
348
+ "step-indicator__step--completed": p < r.activeStepIndex,
349
+ "step-indicator__step--clickable": r.allowNavigation
350
+ }]),
351
+ onClick: (c) => u(p)
352
+ }, [
353
+ B("div", tt, [
354
+ B("div", lt, [
355
+ B("span", null, A(p + 1), 1)
356
+ ]),
357
+ B("div", at, [
358
+ B("div", nt, A(y.title), 1),
359
+ y.subtitle ? (f(), $("div", ot, A(y.subtitle), 1)) : O("", !0)
360
+ ])
361
+ ]),
362
+ p < r.steps.length - 1 ? (f(), $("div", {
363
+ key: 0,
364
+ class: ne(["step-indicator__connector", { "step-indicator__connector--completed": p < r.activeStepIndex }])
365
+ }, null, 2)) : O("", !0)
366
+ ], 10, et))), 128))
367
+ ]),
368
+ r.showProgress && (r.position === "top" || r.position === "bottom") ? (f(), $("div", ut, [
369
+ B("div", st, [
370
+ B("div", {
371
+ class: "step-indicator__progress-fill",
372
+ style: ve({ width: `${l.value}%` })
373
+ }, null, 4)
374
+ ]),
375
+ B("div", rt, " Step " + A(r.activeStepIndex + 1) + " of " + A(r.steps.length), 1)
376
+ ])) : O("", !0)
377
+ ], 2));
378
+ }
379
+ }), de = (t, o) => {
380
+ const n = t.__vccOpts || t;
381
+ for (const [e, l] of o)
382
+ n[e] = l;
383
+ return n;
384
+ }, re = /* @__PURE__ */ de(it, [["__scopeId", "data-v-aca1a6d0"]]), ct = { class: "v-form-container" }, dt = {
385
+ key: 0,
386
+ class: "multi-step-form"
387
+ }, pt = { class: "multi-step-form-content" }, vt = { class: "step-nav-buttons" }, ft = { class: "step-action-buttons" }, mt = { class: "step-nav-buttons" }, ht = {
388
+ key: 1,
389
+ class: "step-progress-bottom"
390
+ }, gt = { class: "step-progress-bar" }, yt = { class: "step-progress-text" }, Ct = /* @__PURE__ */ U({
259
391
  __name: "vForm",
260
392
  props: {
261
393
  schema: {},
394
+ multiStepConfig: {},
262
395
  showLabels: { type: Boolean, default: !0 },
263
396
  showClearButton: { type: Boolean, default: !0 },
264
397
  showCancelButton: { type: Boolean, default: !0 },
@@ -269,138 +402,366 @@ const Ke = /* @__PURE__ */ U({
269
402
  hideButtons: { type: Boolean, default: !1 },
270
403
  customButtons: {}
271
404
  },
272
- emits: ["submit", "clear", "cancel"],
273
- setup(t, { expose: o, emit: a }) {
274
- const e = t, l = a, n = C(e.schema), { dynamicRefs: i, isFormValid: s, resetForm: f } = pe(), { formData: c, computedData: r } = Ge(n), v = He(n, c, r);
275
- async function u() {
276
- await s() && l("submit", c.value, r.value);
405
+ emits: ["submit", "multi-step-submit", "step-change", "clear", "cancel"],
406
+ setup(t, { expose: o, emit: n }) {
407
+ const e = t, l = n, u = S(() => !!e.multiStepConfig), r = E(e.schema || {}), s = e.multiStepConfig ? Xe(e.multiStepConfig) : null, { dynamicRefs: y, isFormValid: p, resetForm: c } = we(), { formData: v, computedData: i } = Qe(r), m = S(() => (s == null ? void 0 : s.currentStepIndex.value) ?? 0), C = S(() => s == null ? void 0 : s.currentStep.value), x = S(() => (s == null ? void 0 : s.isLastStep.value) ?? !0), w = S(() => (s == null ? void 0 : s.canGoNext.value) ?? !1), R = S(() => (s == null ? void 0 : s.canGoPrevious.value) ?? !1), F = S(() => !u.value || !s ? 0 : s.progressPercentage.value);
408
+ I(
409
+ () => C.value,
410
+ (a) => {
411
+ a && u.value && (r.value = a.schema);
412
+ },
413
+ { immediate: !0 }
414
+ ), I(
415
+ [v, i],
416
+ ([a, h]) => {
417
+ u.value && s && C.value && (s.updateStepData(C.value.id, a), s.updateStepComputedData(C.value.id, h));
418
+ },
419
+ { deep: !0 }
420
+ ), I(
421
+ () => e.schema,
422
+ (a) => {
423
+ if (!u.value && a) {
424
+ r.value = a;
425
+ for (const [h, k] of Object.entries(a))
426
+ k.value !== void 0 && (r.value[h].value = k.value);
427
+ }
428
+ },
429
+ { deep: !0, immediate: !0 }
430
+ );
431
+ async function q() {
432
+ if (u.value && s) {
433
+ if (!await s.validateAllSteps()) return;
434
+ const h = s.getMultiStepFormData();
435
+ l("multi-step-submit", h);
436
+ } else {
437
+ if (!await p()) return;
438
+ l("submit", v.value, i.value);
439
+ }
277
440
  }
278
- function m() {
279
- f(), l("clear");
441
+ function W() {
442
+ u.value && s ? s.resetForm() : c(), l("clear");
280
443
  }
281
- function _() {
282
- f(), l("cancel");
444
+ function J() {
445
+ u.value && s && C.value && s.clearStepData(C.value.id);
283
446
  }
284
- return q(
285
- c,
286
- async () => {
287
- for (const [V, g] of Object.entries(n.value))
288
- ne(g, c.value, r.value) || (g.value = e.schema[V].value);
289
- },
290
- {
291
- deep: !0,
292
- immediate: !0
447
+ function Z() {
448
+ u.value && s ? s.resetForm() : c(), l("cancel");
449
+ }
450
+ async function L() {
451
+ if (s) {
452
+ if (!await p())
453
+ return;
454
+ await s.nextStep() && C.value && l("step-change", m.value, C.value.id);
293
455
  }
294
- ), q(
295
- () => e.schema,
296
- (V) => {
297
- for (const [g, y] of Object.entries(V))
298
- y.value !== void 0 && (n.value[g].value = y.value);
456
+ }
457
+ async function M() {
458
+ s && await s.previousStep() && C.value && l("step-change", m.value, C.value.id);
459
+ }
460
+ async function _(a) {
461
+ if (s) {
462
+ if (a > m.value && !await p())
463
+ return;
464
+ await s.goToStep(a) && C.value && l("step-change", a, C.value.id);
465
+ }
466
+ }
467
+ return I(
468
+ v,
469
+ async () => {
470
+ var a;
471
+ for (const [h, k] of Object.entries(r.value))
472
+ if (!ie(k, v.value, i.value)) {
473
+ const g = u.value && C.value ? C.value.schema[h] : (a = e.schema) == null ? void 0 : a[h];
474
+ g && (k.value = g.value);
475
+ }
299
476
  },
300
477
  {
301
478
  deep: !0,
302
479
  immediate: !0
303
480
  }
304
481
  ), o({
305
- resetForm: f,
306
- isFormValid: s,
307
- resolveData: () => ({
308
- formData: c.value,
309
- computedData: r.value
310
- })
311
- }), (V, g) => (p(), b(d(ke), null, {
312
- default: x(() => [
313
- A(d(te), null, {
314
- default: x(() => [
315
- (p(!0), B(M, null, K(Object.keys(n.value), (y) => {
316
- var w, L, j, P, N;
317
- return p(), B(M, null, [
318
- d(ne)(n.value[y], d(c), d(r)) ? (p(), b(d(le), {
319
- key: y,
320
- size: ((w = n.value[y].grid) == null ? void 0 : w.xs) ?? "12",
321
- "size-sm": (L = n.value[y].grid) == null ? void 0 : L.sm,
322
- "size-md": (j = n.value[y].grid) == null ? void 0 : j.md,
323
- "size-lg": (P = n.value[y].grid) == null ? void 0 : P.lg,
324
- "size-xl": (N = n.value[y].grid) == null ? void 0 : N.xl,
325
- class: "ion-margin-vertical"
326
- }, {
327
- default: x(() => [
328
- (p(), b(ie(n.value[y].type), {
329
- modelValue: n.value[y],
330
- "onUpdate:modelValue": (T) => n.value[y] = T,
331
- schema: n.value,
332
- "dependency-manager": d(v),
333
- "form-id": y,
334
- ref_for: !0,
335
- ref_key: "dynamicRefs",
336
- ref: i,
337
- "ref-key": y
338
- }, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "dependency-manager", "form-id", "ref-key"]))
339
- ]),
340
- _: 2
341
- }, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : I("", !0)
342
- ], 64);
343
- }), 256))
344
- ]),
345
- _: 1
346
- }),
347
- V.hideButtons ? I("", !0) : (p(), b(d(te), { key: 0 }, {
348
- default: x(() => [
349
- A(d(le), {
350
- size: "12",
351
- style: ge([{ display: "flex" }, { justifyContent: V.buttonPlacement }])
352
- }, {
353
- default: x(() => [
354
- V.showCancelButton ? (p(), b(d(W), {
355
- key: 0,
356
- onClick: _
357
- }, {
358
- default: x(() => [
359
- F(S(V.cancelButtonText ?? "Cancel"), 1)
360
- ]),
361
- _: 1
362
- })) : I("", !0),
363
- V.showClearButton ? (p(), b(d(W), {
364
- key: 1,
365
- onClick: m
482
+ resetForm: W,
483
+ isFormValid: p,
484
+ resolveData: () => u.value && s ? s.getMultiStepFormData() : {
485
+ formData: v.value,
486
+ computedData: i.value
487
+ },
488
+ // Multi-step specific methods
489
+ nextStep: L,
490
+ previousStep: M,
491
+ goToStep: _,
492
+ getCurrentStep: () => C.value,
493
+ getCurrentStepIndex: () => m.value
494
+ }), (a, h) => {
495
+ var k;
496
+ return f(), $("div", ct, [
497
+ u.value ? (f(), $("div", dt, [
498
+ a.multiStepConfig && a.multiStepConfig.stepPosition === "top" ? (f(), V(re, {
499
+ key: 0,
500
+ steps: a.multiStepConfig.steps,
501
+ "active-step-index": m.value,
502
+ position: a.multiStepConfig.stepPosition || "top",
503
+ "show-progress": a.multiStepConfig.showProgress,
504
+ "allow-navigation": a.multiStepConfig.allowStepNavigation,
505
+ onStepClick: _
506
+ }, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0),
507
+ B("div", {
508
+ class: ne(["multi-step-content", `multi-step-content--${((k = a.multiStepConfig) == null ? void 0 : k.stepPosition) || "top"}`])
509
+ }, [
510
+ a.multiStepConfig && a.multiStepConfig.stepPosition === "left" ? (f(), V(re, {
511
+ key: 0,
512
+ steps: a.multiStepConfig.steps,
513
+ "active-step-index": m.value,
514
+ position: a.multiStepConfig.stepPosition ?? "top",
515
+ "show-progress": a.multiStepConfig.showProgress,
516
+ "allow-navigation": a.multiStepConfig.allowStepNavigation,
517
+ onStepClick: _,
518
+ class: "multi-step-sidebar"
519
+ }, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0),
520
+ B("div", pt, [
521
+ P(d(Ce), null, {
522
+ default: b(() => [
523
+ P(d(le), null, {
524
+ default: b(() => [
525
+ (f(!0), $(T, null, K(Object.keys(r.value), (g) => {
526
+ var D, H, Q, ee, te;
527
+ return f(), $(T, null, [
528
+ d(ie)(r.value[g], d(v), d(i)) ? (f(), V(d(ae), {
529
+ key: g,
530
+ size: ((D = r.value[g].grid) == null ? void 0 : D.xs) ?? "12",
531
+ "size-sm": (H = r.value[g].grid) == null ? void 0 : H.sm,
532
+ "size-md": (Q = r.value[g].grid) == null ? void 0 : Q.md,
533
+ "size-lg": (ee = r.value[g].grid) == null ? void 0 : ee.lg,
534
+ "size-xl": (te = r.value[g].grid) == null ? void 0 : te.xl,
535
+ class: "ion-margin-vertical"
536
+ }, {
537
+ default: b(() => [
538
+ (f(), V(fe(r.value[g].type), {
539
+ modelValue: r.value[g],
540
+ "onUpdate:modelValue": (pe) => r.value[g] = pe,
541
+ schema: r.value,
542
+ "form-id": g,
543
+ ref_for: !0,
544
+ ref_key: "dynamicRefs",
545
+ ref: y,
546
+ "ref-key": g
547
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "form-id", "ref-key"]))
548
+ ]),
549
+ _: 2
550
+ }, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
551
+ ], 64);
552
+ }), 256))
553
+ ]),
554
+ _: 1
555
+ })
556
+ ]),
557
+ _: 1
558
+ }),
559
+ a.hideButtons ? O("", !0) : (f(), V(d(le), {
560
+ key: 0,
561
+ class: "multi-step-buttons"
562
+ }, {
563
+ default: b(() => [
564
+ P(d(ae), {
565
+ size: "12",
566
+ class: "button-container"
567
+ }, {
568
+ default: b(() => [
569
+ B("div", vt, [
570
+ R.value ? (f(), V(d(j), {
571
+ key: 0,
572
+ onClick: M,
573
+ fill: "outline"
574
+ }, {
575
+ default: b(() => h[0] || (h[0] = [
576
+ z(" Previous ")
577
+ ])),
578
+ _: 1,
579
+ __: [0]
580
+ })) : O("", !0)
581
+ ]),
582
+ B("div", ft, [
583
+ a.showCancelButton ? (f(), V(d(j), {
584
+ key: 0,
585
+ onClick: Z,
586
+ fill: "outline"
587
+ }, {
588
+ default: b(() => [
589
+ z(A(a.cancelButtonText ?? "Cancel"), 1)
590
+ ]),
591
+ _: 1
592
+ })) : O("", !0),
593
+ a.showClearButton ? (f(), V(d(j), {
594
+ key: 1,
595
+ onClick: J,
596
+ fill: "outline"
597
+ }, {
598
+ default: b(() => [
599
+ z(A(a.clearButtonText ?? "Reset"), 1)
600
+ ]),
601
+ _: 1
602
+ })) : O("", !0),
603
+ (f(!0), $(T, null, K(a.customButtons, (g) => (f(), V(d(j), {
604
+ key: g.label,
605
+ onClick: g.action,
606
+ color: g.color ?? "primary"
607
+ }, {
608
+ default: b(() => [
609
+ z(A(g.label), 1)
610
+ ]),
611
+ _: 2
612
+ }, 1032, ["onClick", "color"]))), 128))
613
+ ]),
614
+ B("div", mt, [
615
+ w.value ? (f(), V(d(j), {
616
+ key: 0,
617
+ onClick: L
618
+ }, {
619
+ default: b(() => h[1] || (h[1] = [
620
+ z(" Next ")
621
+ ])),
622
+ _: 1,
623
+ __: [1]
624
+ })) : O("", !0),
625
+ x.value ? (f(), V(d(j), {
626
+ key: 1,
627
+ onClick: q
628
+ }, {
629
+ default: b(() => [
630
+ z(A(a.submitButtonText ?? "Submit"), 1)
631
+ ]),
632
+ _: 1
633
+ })) : O("", !0)
634
+ ])
635
+ ]),
636
+ _: 1
637
+ })
638
+ ]),
639
+ _: 1
640
+ })),
641
+ a.multiStepConfig && (a.multiStepConfig.stepPosition === "left" || a.multiStepConfig.stepPosition === "right") && a.multiStepConfig.showProgress ? (f(), $("div", ht, [
642
+ B("div", gt, [
643
+ B("div", {
644
+ class: "step-progress-fill",
645
+ style: ve({ width: `${F.value}%` })
646
+ }, null, 4)
647
+ ]),
648
+ B("div", yt, " Step " + A(m.value + 1) + " of " + A(a.multiStepConfig.steps.length), 1)
649
+ ])) : O("", !0)
650
+ ]),
651
+ a.multiStepConfig && a.multiStepConfig.stepPosition === "right" ? (f(), V(re, {
652
+ key: 1,
653
+ steps: a.multiStepConfig.steps,
654
+ "active-step-index": m.value,
655
+ position: a.multiStepConfig.stepPosition,
656
+ "show-progress": a.multiStepConfig.showProgress,
657
+ "allow-navigation": a.multiStepConfig.allowStepNavigation,
658
+ onStepClick: _,
659
+ class: "multi-step-sidebar"
660
+ }, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0)
661
+ ], 2),
662
+ a.multiStepConfig && a.multiStepConfig.stepPosition === "bottom" ? (f(), V(re, {
663
+ key: 1,
664
+ steps: a.multiStepConfig.steps,
665
+ "active-step-index": m.value,
666
+ position: a.multiStepConfig.stepPosition,
667
+ "show-progress": a.multiStepConfig.showProgress,
668
+ "allow-navigation": a.multiStepConfig.allowStepNavigation,
669
+ onStepClick: _
670
+ }, null, 8, ["steps", "active-step-index", "position", "show-progress", "allow-navigation"])) : O("", !0)
671
+ ])) : (f(), V(d(Ce), { key: 1 }, {
672
+ default: b(() => [
673
+ P(d(le), null, {
674
+ default: b(() => [
675
+ (f(!0), $(T, null, K(Object.keys(r.value), (g) => {
676
+ var D, H, Q, ee, te;
677
+ return f(), $(T, null, [
678
+ d(ie)(r.value[g], d(v), d(i)) ? (f(), V(d(ae), {
679
+ key: g,
680
+ size: ((D = r.value[g].grid) == null ? void 0 : D.xs) ?? "12",
681
+ "size-sm": (H = r.value[g].grid) == null ? void 0 : H.sm,
682
+ "size-md": (Q = r.value[g].grid) == null ? void 0 : Q.md,
683
+ "size-lg": (ee = r.value[g].grid) == null ? void 0 : ee.lg,
684
+ "size-xl": (te = r.value[g].grid) == null ? void 0 : te.xl,
685
+ class: "ion-margin-vertical"
686
+ }, {
687
+ default: b(() => [
688
+ (f(), V(fe(r.value[g].type), {
689
+ modelValue: r.value[g],
690
+ "onUpdate:modelValue": (pe) => r.value[g] = pe,
691
+ schema: r.value,
692
+ "form-id": g,
693
+ ref_for: !0,
694
+ ref_key: "dynamicRefs",
695
+ ref: y,
696
+ "ref-key": g
697
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "form-id", "ref-key"]))
698
+ ]),
699
+ _: 2
700
+ }, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
701
+ ], 64);
702
+ }), 256))
703
+ ]),
704
+ _: 1
705
+ }),
706
+ a.hideButtons ? O("", !0) : (f(), V(d(le), { key: 0 }, {
707
+ default: b(() => [
708
+ P(d(ae), {
709
+ size: "12",
710
+ style: ve([{ display: "flex" }, { justifyContent: a.buttonPlacement }])
366
711
  }, {
367
- default: x(() => [
368
- F(S(V.clearButtonText ?? "Reset"), 1)
712
+ default: b(() => [
713
+ a.showCancelButton ? (f(), V(d(j), {
714
+ key: 0,
715
+ onClick: Z
716
+ }, {
717
+ default: b(() => [
718
+ z(A(a.cancelButtonText ?? "Cancel"), 1)
719
+ ]),
720
+ _: 1
721
+ })) : O("", !0),
722
+ a.showClearButton ? (f(), V(d(j), {
723
+ key: 1,
724
+ onClick: W
725
+ }, {
726
+ default: b(() => [
727
+ z(A(a.clearButtonText ?? "Reset"), 1)
728
+ ]),
729
+ _: 1
730
+ })) : O("", !0),
731
+ (f(!0), $(T, null, K(a.customButtons, (g) => (f(), V(d(j), {
732
+ key: g.label,
733
+ onClick: g.action,
734
+ color: g.color ?? "primary"
735
+ }, {
736
+ default: b(() => [
737
+ z(A(g.label), 1)
738
+ ]),
739
+ _: 2
740
+ }, 1032, ["onClick", "color"]))), 128)),
741
+ P(d(j), { onClick: q }, {
742
+ default: b(() => [
743
+ z(A(a.submitButtonText ?? "Submit"), 1)
744
+ ]),
745
+ _: 1
746
+ })
369
747
  ]),
370
748
  _: 1
371
- })) : I("", !0),
372
- (p(!0), B(M, null, K(V.customButtons, (y) => (p(), b(d(W), {
373
- key: y.label,
374
- onClick: y.action,
375
- color: y.color ?? "primary"
376
- }, {
377
- default: x(() => [
378
- F(S(y.label), 1)
379
- ]),
380
- _: 2
381
- }, 1032, ["onClick", "color"]))), 128)),
382
- A(d(W), { onClick: u }, {
383
- default: x(() => [
384
- F(S(V.submitButtonText ?? "Submit"), 1)
385
- ]),
386
- _: 1
387
- })
749
+ }, 8, ["style"])
388
750
  ]),
389
751
  _: 1
390
- }, 8, ["style"])
752
+ }))
391
753
  ]),
392
754
  _: 1
393
755
  }))
394
- ]),
395
- _: 1
396
- }));
756
+ ]);
757
+ };
397
758
  }
398
- });
399
- function We(t) {
759
+ }), _t = /* @__PURE__ */ de(Ct, [["__scopeId", "data-v-3850cccc"]]);
760
+ function Vt(t) {
400
761
  return {
401
762
  applyValidationState: async (e) => {
402
- var l, n, i, s, f;
403
- (l = t.value) == null || l.$el.classList.remove("ion-invalid"), (n = t.value) == null || n.$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"), (f = t.value) == null || f.$el.classList.add("ion-touched");
763
+ var l, u, r, s, y;
764
+ (l = t.value) == null || l.$el.classList.remove("ion-invalid"), (u = t.value) == null || u.$el.classList.remove("ion-valid"), e ? (r = t.value) == null || r.$el.classList.add("ion-valid") : (s = t.value) == null || s.$el.classList.add("ion-invalid"), (y = t.value) == null || y.$el.classList.add("ion-touched");
404
765
  },
405
766
  resetValidationState: () => {
406
767
  var e, l;
@@ -408,87 +769,87 @@ function We(t) {
408
769
  }
409
770
  };
410
771
  }
411
- function J(t, o, a, e, l) {
412
- const { applyValidationState: n, resetValidationState: i } = We(t);
772
+ function ue(t, o, n, e, l) {
773
+ const { applyValidationState: u, resetValidationState: r } = Vt(t);
413
774
  async function s() {
414
- if (o.value.required && !a.value)
775
+ if (o.value.required && !n.value)
415
776
  return o.value.error = "This field is required", !1;
416
777
  if (l) {
417
- const u = await l(a.value);
418
- if (typeof u == "string")
419
- return o.value.error = u, !1;
420
- if (u === !1)
778
+ const i = await l(n.value);
779
+ if (typeof i == "string")
780
+ return o.value.error = i, !1;
781
+ if (i === !1)
421
782
  return !1;
422
783
  }
423
784
  if (o.value.validation) {
424
- const u = await o.value.validation(a.value, e == null ? void 0 : e.value);
425
- if (u && u.length)
426
- return o.value.error = u.join(), !1;
785
+ const i = await o.value.validation(n.value, e == null ? void 0 : e.value);
786
+ if (i && i.length)
787
+ return o.value.error = i.join(), !1;
427
788
  }
428
789
  return !0;
429
790
  }
430
- async function f() {
431
- const u = await s();
432
- u && (o.value.error = "", o.value.value = a.value), await n(u);
791
+ async function y() {
792
+ const i = await s();
793
+ i && (o.value.error = "", o.value.value = n.value), await u(i);
433
794
  }
434
- function c() {
435
- i(), o.value.error = "";
795
+ function p() {
796
+ r(), o.value.error = "";
436
797
  }
437
- function r(u = "") {
438
- a.value = u, o.value.error = "", o.value.value = u;
798
+ function c(i = "") {
799
+ n.value = i, o.value.error = "", o.value.value = i;
439
800
  }
440
801
  function v() {
441
802
  return o.value.error ? [o.value.error] : [];
442
803
  }
443
804
  return {
444
805
  isValid: s,
445
- onValueUpdate: f,
446
- onFocus: c,
447
- onReset: r,
806
+ onValueUpdate: y,
807
+ onFocus: p,
808
+ onReset: c,
448
809
  getErrors: v,
449
- applyValidationState: n,
450
- resetValidationState: i
810
+ applyValidationState: u,
811
+ resetValidationState: r
451
812
  };
452
813
  }
453
- function Ze(t) {
454
- const o = O(() => !!t.value.label), a = O(() => !!t.value.required), e = O(() => t.value.label || "");
814
+ function bt(t) {
815
+ const o = S(() => !!t.value.label), n = S(() => !!t.value.required), e = S(() => t.value.label || "");
455
816
  return {
456
817
  showLabel: o,
457
- showRequired: a,
818
+ showRequired: n,
458
819
  labelText: e
459
820
  };
460
821
  }
461
- const re = /* @__PURE__ */ U({
822
+ const ye = /* @__PURE__ */ U({
462
823
  __name: "InputLabel",
463
824
  props: {
464
825
  model: {}
465
826
  },
466
827
  setup(t) {
467
- const o = t, { showLabel: a, showRequired: e, labelText: l } = Ze(Ve(o, "model"));
468
- return (n, i) => d(a) ? (p(), b(d(H), {
828
+ const o = t, { showLabel: n, showRequired: e, labelText: l } = bt(Oe(o, "model"));
829
+ return (u, r) => d(n) ? (f(), V(d(Y), {
469
830
  key: 0,
470
831
  slot: "label",
471
832
  class: "input-label"
472
833
  }, {
473
- default: x(() => [
474
- F(S(d(l)) + " ", 1),
475
- d(e) ? (p(), b(d(Ce), {
834
+ default: b(() => [
835
+ z(A(d(l)) + " ", 1),
836
+ d(e) ? (f(), V(d(Re), {
476
837
  key: 0,
477
838
  color: "danger"
478
839
  }, {
479
- default: x(() => i[0] || (i[0] = [
480
- F("*")
840
+ default: b(() => r[0] || (r[0] = [
841
+ z("*")
481
842
  ])),
482
843
  _: 1,
483
844
  __: [0]
484
- })) : I("", !0)
845
+ })) : O("", !0)
485
846
  ]),
486
847
  _: 1
487
- })) : I("", !0);
848
+ })) : O("", !0);
488
849
  }
489
- }), Q = /* @__PURE__ */ U({
850
+ }), se = /* @__PURE__ */ U({
490
851
  __name: "BaseInput",
491
- props: /* @__PURE__ */ z({
852
+ props: /* @__PURE__ */ N({
492
853
  schema: {},
493
854
  type: {}
494
855
  }, {
@@ -497,30 +858,30 @@ const re = /* @__PURE__ */ U({
497
858
  }),
498
859
  emits: ["update:modelValue"],
499
860
  setup(t, { expose: o }) {
500
- const a = t, e = $(t, "modelValue"), l = C(null), n = C(e.value.value), i = O(() => a.schema), { isValid: s, onValueUpdate: f, onFocus: c, onReset: r, getErrors: v } = J(
861
+ const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), { isValid: s, onValueUpdate: y, onFocus: p, onReset: c, getErrors: v } = ue(
501
862
  l,
502
863
  e,
503
- n,
504
- i
505
- ), u = O(() => {
506
- if (e.value.pattern) return Pe(e.value.pattern);
864
+ u,
865
+ r
866
+ ), i = S(() => {
867
+ if (e.value.pattern) return We(e.value.pattern);
507
868
  });
508
- return q(
869
+ return I(
509
870
  () => e.value.value,
510
- (m) => n.value = m
871
+ (m) => u.value = m
511
872
  ), o({
512
- onValueUpdate: f,
513
- onReset: r,
873
+ onValueUpdate: y,
874
+ onReset: c,
514
875
  getErrors: v,
515
876
  isValid: s
516
- }), (m, _) => {
517
- var g;
518
- const V = be("maskito");
519
- return _e((p(), b(d(ce), {
877
+ }), (m, C) => {
878
+ var w;
879
+ const x = Ee("maskito");
880
+ return xe((f(), V(d(Ve), {
520
881
  ref_key: "inputRef",
521
882
  ref: l,
522
- modelValue: n.value,
523
- "onUpdate:modelValue": _[0] || (_[0] = (y) => n.value = y),
883
+ modelValue: u.value,
884
+ "onUpdate:modelValue": C[0] || (C[0] = (R) => u.value = R),
524
885
  "clear-input": !0,
525
886
  fill: e.value.fill ?? "solid",
526
887
  "label-placement": e.value.labelPlacement ?? "stacked",
@@ -528,7 +889,7 @@ const re = /* @__PURE__ */ U({
528
889
  required: e.value.required,
529
890
  "error-text": e.value.error,
530
891
  autofocus: e.value.autoFocus,
531
- placeholder: ((g = u.value) == null ? void 0 : g.placeholder) ?? e.value.placeholder,
892
+ placeholder: ((w = i.value) == null ? void 0 : w.placeholder) ?? e.value.placeholder,
532
893
  disabled: e.value.disabled,
533
894
  counter: e.value.counter,
534
895
  min: e.value.min,
@@ -536,44 +897,44 @@ const re = /* @__PURE__ */ U({
536
897
  "max-length": e.value.maxLength,
537
898
  "min-length": e.value.minLength,
538
899
  pattern: e.value.pattern,
539
- onIonFocus: d(c),
540
- onIonChange: d(f),
541
- onIonBlur: d(f)
900
+ onIonFocus: d(p),
901
+ onIonChange: d(y),
902
+ onIonBlur: d(y)
542
903
  }, {
543
- default: x(() => [
544
- A(re, { model: e.value }, null, 8, ["model"]),
545
- e.value.prefix ? (p(), b(d(H), {
904
+ default: b(() => [
905
+ P(ye, { model: e.value }, null, 8, ["model"]),
906
+ e.value.prefix ? (f(), V(d(Y), {
546
907
  key: 0,
547
908
  slot: "start"
548
909
  }, {
549
- default: x(() => [
550
- F(S(e.value.prefix), 1)
910
+ default: b(() => [
911
+ z(A(e.value.prefix), 1)
551
912
  ]),
552
913
  _: 1
553
- })) : I("", !0),
554
- e.value.suffix ? (p(), b(d(H), {
914
+ })) : O("", !0),
915
+ e.value.suffix ? (f(), V(d(Y), {
555
916
  key: 1,
556
917
  slot: "end"
557
918
  }, {
558
- default: x(() => [
559
- F(S(e.value.suffix), 1)
919
+ default: b(() => [
920
+ z(A(e.value.suffix), 1)
560
921
  ]),
561
922
  _: 1
562
- })) : I("", !0),
563
- m.type === "password" ? (p(), b(d(Ee), {
923
+ })) : O("", !0),
924
+ m.type === "password" ? (f(), V(d(Ae), {
564
925
  key: 2,
565
926
  slot: "end"
566
- })) : I("", !0)
927
+ })) : O("", !0)
567
928
  ]),
568
929
  _: 1
569
930
  }, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter", "min", "max", "max-length", "min-length", "pattern", "onIonFocus", "onIonChange", "onIonBlur"])), [
570
- [V, u.value]
931
+ [x, i.value]
571
932
  ]);
572
933
  };
573
934
  }
574
- }), Je = /* @__PURE__ */ U({
935
+ }), kt = /* @__PURE__ */ U({
575
936
  __name: "TextInput",
576
- props: /* @__PURE__ */ z({
937
+ props: /* @__PURE__ */ N({
577
938
  schema: {}
578
939
  }, {
579
940
  modelValue: { type: Object, default: {} },
@@ -581,7 +942,7 @@ const re = /* @__PURE__ */ U({
581
942
  }),
582
943
  emits: ["update:modelValue"],
583
944
  setup(t, { expose: o }) {
584
- const a = $(t, "modelValue"), e = C(null);
945
+ const n = G(t, "modelValue"), e = E(null);
585
946
  return o({
586
947
  onReset: () => {
587
948
  var l;
@@ -592,21 +953,21 @@ const re = /* @__PURE__ */ U({
592
953
  return (l = e.value) == null ? void 0 : l.onValueUpdate();
593
954
  },
594
955
  getErrors: () => {
595
- var l, n;
596
- return ((n = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : n.call(l)) ?? [];
956
+ var l, u;
957
+ return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
597
958
  }
598
- }), (l, n) => (p(), b(Q, {
599
- modelValue: a.value,
600
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
959
+ }), (l, u) => (f(), V(se, {
960
+ modelValue: n.value,
961
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
601
962
  type: "text",
602
963
  schema: l.schema,
603
964
  ref_key: "inputRef",
604
965
  ref: e
605
966
  }, null, 8, ["modelValue", "schema"]));
606
967
  }
607
- }), Qe = /* @__PURE__ */ U({
968
+ }), St = /* @__PURE__ */ U({
608
969
  __name: "DateInput",
609
- props: /* @__PURE__ */ z({
970
+ props: /* @__PURE__ */ N({
610
971
  schema: {}
611
972
  }, {
612
973
  modelValue: { type: Object, default: {} },
@@ -614,7 +975,7 @@ const re = /* @__PURE__ */ U({
614
975
  }),
615
976
  emits: ["update:modelValue"],
616
977
  setup(t, { expose: o }) {
617
- const a = $(t, "modelValue"), e = C(null);
978
+ const n = G(t, "modelValue"), e = E(null);
618
979
  return o({
619
980
  onValueUpdate: () => {
620
981
  var l;
@@ -625,21 +986,21 @@ const re = /* @__PURE__ */ U({
625
986
  return (l = e.value) == null ? void 0 : l.onReset();
626
987
  },
627
988
  getErrors: () => {
628
- var l, n;
629
- return ((n = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : n.call(l)) ?? [];
989
+ var l, u;
990
+ return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
630
991
  }
631
- }), (l, n) => (p(), b(Q, {
632
- modelValue: a.value,
633
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
634
- type: a.value.enableTime ? "datetime-local" : "date",
992
+ }), (l, u) => (f(), V(se, {
993
+ modelValue: n.value,
994
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
995
+ type: n.value.enableTime ? "datetime-local" : "date",
635
996
  schema: l.schema,
636
997
  ref_key: "inputRef",
637
998
  ref: e
638
999
  }, null, 8, ["modelValue", "type", "schema"]));
639
1000
  }
640
- }), Xe = /* @__PURE__ */ U({
1001
+ }), wt = /* @__PURE__ */ U({
641
1002
  __name: "NumberInput",
642
- props: /* @__PURE__ */ z({
1003
+ props: /* @__PURE__ */ N({
643
1004
  schema: {}
644
1005
  }, {
645
1006
  modelValue: { type: Object, default: {} },
@@ -647,7 +1008,7 @@ const re = /* @__PURE__ */ U({
647
1008
  }),
648
1009
  emits: ["update:modelValue"],
649
1010
  setup(t, { expose: o }) {
650
- const a = $(t, "modelValue"), e = C(null);
1011
+ const n = G(t, "modelValue"), e = E(null);
651
1012
  return o({
652
1013
  onReset: () => {
653
1014
  var l;
@@ -658,21 +1019,21 @@ const re = /* @__PURE__ */ U({
658
1019
  return (l = e.value) == null ? void 0 : l.onValueUpdate();
659
1020
  },
660
1021
  getErrors: () => {
661
- var l, n;
662
- return ((n = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : n.call(l)) ?? [];
1022
+ var l, u;
1023
+ return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
663
1024
  }
664
- }), (l, n) => (p(), b(Q, {
665
- modelValue: a.value,
666
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
1025
+ }), (l, u) => (f(), V(se, {
1026
+ modelValue: n.value,
1027
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
667
1028
  type: "number",
668
1029
  schema: l.schema,
669
1030
  ref_key: "inputRef",
670
1031
  ref: e
671
1032
  }, null, 8, ["modelValue", "schema"]));
672
1033
  }
673
- }), Ye = /* @__PURE__ */ U({
1034
+ }), Ot = /* @__PURE__ */ U({
674
1035
  __name: "EmailInput",
675
- props: /* @__PURE__ */ z({
1036
+ props: /* @__PURE__ */ N({
676
1037
  schema: {}
677
1038
  }, {
678
1039
  modelValue: { type: Object, default: {} },
@@ -680,7 +1041,7 @@ const re = /* @__PURE__ */ U({
680
1041
  }),
681
1042
  emits: ["update:modelValue"],
682
1043
  setup(t, { expose: o }) {
683
- const a = $(t, "modelValue"), e = C(null);
1044
+ const n = G(t, "modelValue"), e = E(null);
684
1045
  return o({
685
1046
  onReset: () => {
686
1047
  var l;
@@ -691,21 +1052,21 @@ const re = /* @__PURE__ */ U({
691
1052
  return (l = e.value) == null ? void 0 : l.onValueUpdate();
692
1053
  },
693
1054
  getErrors: () => {
694
- var l, n;
695
- return ((n = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : n.call(l)) ?? [];
1055
+ var l, u;
1056
+ return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
696
1057
  }
697
- }), (l, n) => (p(), b(Q, {
698
- modelValue: a.value,
699
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
1058
+ }), (l, u) => (f(), V(se, {
1059
+ modelValue: n.value,
1060
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
700
1061
  type: "email",
701
1062
  schema: l.schema,
702
1063
  ref_key: "inputRef",
703
1064
  ref: e
704
1065
  }, null, 8, ["modelValue", "schema"]));
705
1066
  }
706
- }), et = /* @__PURE__ */ U({
1067
+ }), Et = /* @__PURE__ */ U({
707
1068
  __name: "PasswordInput",
708
- props: /* @__PURE__ */ z({
1069
+ props: /* @__PURE__ */ N({
709
1070
  schema: {}
710
1071
  }, {
711
1072
  modelValue: { type: Object, default: {} },
@@ -713,7 +1074,7 @@ const re = /* @__PURE__ */ U({
713
1074
  }),
714
1075
  emits: ["update:modelValue"],
715
1076
  setup(t, { expose: o }) {
716
- const a = $(t, "modelValue"), e = C(null);
1077
+ const n = G(t, "modelValue"), e = E(null);
717
1078
  return o({
718
1079
  onReset: () => {
719
1080
  var l;
@@ -724,24 +1085,23 @@ const re = /* @__PURE__ */ U({
724
1085
  return (l = e.value) == null ? void 0 : l.onValueUpdate();
725
1086
  },
726
1087
  getErrors: () => {
727
- var l, n;
728
- return ((n = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : n.call(l)) ?? [];
1088
+ var l, u;
1089
+ return ((u = (l = e.value) == null ? void 0 : l.getErrors) == null ? void 0 : u.call(l)) ?? [];
729
1090
  }
730
- }), (l, n) => (p(), b(Q, {
731
- modelValue: a.value,
732
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a.value = i),
1091
+ }), (l, u) => (f(), V(se, {
1092
+ modelValue: n.value,
1093
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => n.value = r),
733
1094
  type: "password",
734
1095
  schema: l.schema,
735
1096
  ref_key: "inputRef",
736
1097
  ref: e
737
1098
  }, null, 8, ["modelValue", "schema"]));
738
1099
  }
739
- }), tt = /* @__PURE__ */ U({
1100
+ }), xt = /* @__PURE__ */ U({
740
1101
  __name: "SelectInput",
741
- props: /* @__PURE__ */ z({
1102
+ props: /* @__PURE__ */ N({
742
1103
  schema: Object,
743
1104
  type: String,
744
- dependencyManager: Object,
745
1105
  formId: String
746
1106
  }, {
747
1107
  modelValue: { type: Object, default: {} },
@@ -749,44 +1109,53 @@ const re = /* @__PURE__ */ U({
749
1109
  }),
750
1110
  emits: ["update:modelValue"],
751
1111
  setup(t, { expose: o }) {
752
- const a = t, e = $(t, "modelValue"), l = C(null), n = C(null), i = C(!1), s = C([]), f = C(""), c = C(1), r = O(() => e.value.interface ?? "popover"), v = O(() => e.value.optionsPlacement === "top" ? "top" : "bottom"), u = O(() => s.value.filter((h) => !!h.isChecked)), m = O(() => !f.value && ae(u.value) && !i.value ? e.value.placeholder ?? "Select an option" : "");
753
- q([f, () => e.value.options], Z, {
1112
+ const n = t, e = G(t, "modelValue"), l = E(null), u = E(null), r = E(!1), s = E([]), y = E(""), p = E(1), c = S(() => e.value.interface ?? "popover"), v = S(() => e.value.optionsPlacement === "top" ? "top" : "bottom"), i = S(() => s.value.filter((a) => !!a.isChecked)), m = S(() => !y.value && me(i.value) && !r.value ? e.value.placeholder ?? "Select an option" : "");
1113
+ I([y, () => e.value.options], M, {
754
1114
  immediate: !0,
755
1115
  deep: !0
756
- }), q(() => e.value.value, ye, { immediate: !0, deep: !0 });
757
- function _() {
758
- s.value.forEach((h) => ee(h, s.value)), e.value.error = "", f.value = "", c.value = 1, e.value.value = e.value.multiple ? [] : "";
1116
+ }), I(() => e.value.value, _, { immediate: !0, deep: !0 }), I(
1117
+ () => !e.value.dependsOn || !n.schema ? null : (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).map((h) => {
1118
+ var k;
1119
+ return (k = n.schema[h]) == null ? void 0 : k.value;
1120
+ }),
1121
+ async (a, h) => {
1122
+ a && h && !oe(a, h) && (C(), s.value = [], await M());
1123
+ },
1124
+ { deep: !0 }
1125
+ );
1126
+ function C() {
1127
+ e.value.error = "", y.value = "", p.value = 1, e.value.value = e.value.multiple ? [] : "", Ze(s.value);
759
1128
  }
760
- function V(h) {
761
- if (h.isChecked) return ee(h, s.value);
762
- e.value.multiple ? D(h, s.value) : (_(), D(h, s.value), T()), f.value = "";
1129
+ function x(a) {
1130
+ if (a.isChecked) return _e(a, s.value);
1131
+ e.value.multiple ? X(a, s.value) : (C(), X(a, s.value), L()), y.value = "";
763
1132
  }
764
- function g() {
765
- switch (r.value) {
1133
+ function w() {
1134
+ switch (c.value) {
766
1135
  case "action-sheet":
767
- y();
1136
+ R();
768
1137
  break;
769
1138
  case "alert":
770
- w();
1139
+ F();
771
1140
  break;
772
1141
  case "popover":
773
1142
  default:
774
- i.value = !0;
1143
+ r.value = !0;
775
1144
  break;
776
1145
  }
777
1146
  }
778
- async function y() {
779
- if (await Z(), e.value.multiple) {
780
- i.value = !0;
1147
+ async function R() {
1148
+ if (await M(), e.value.multiple) {
1149
+ r.value = !0;
781
1150
  return;
782
1151
  }
783
- await (await Re.create({
1152
+ await (await Be.create({
784
1153
  header: e.value.label || "Select an option",
785
1154
  buttons: [
786
- ...s.value.map((k) => ({
787
- text: k.label,
788
- cssClass: k.isChecked ? "selected-option" : "",
789
- handler: () => (V(k), !1)
1155
+ ...s.value.map((h) => ({
1156
+ text: h.label,
1157
+ cssClass: h.isChecked ? "selected-option" : "",
1158
+ handler: () => (x(h), !1)
790
1159
  })),
791
1160
  {
792
1161
  text: "Cancel",
@@ -795,17 +1164,17 @@ const re = /* @__PURE__ */ U({
795
1164
  ]
796
1165
  })).present();
797
1166
  }
798
- async function w() {
799
- await Z();
800
- const h = s.value.map((E) => ({
801
- label: E.label,
1167
+ async function F() {
1168
+ await M();
1169
+ const a = s.value.map((k) => ({
1170
+ label: k.label,
802
1171
  type: e.value.multiple ? "checkbox" : "radio",
803
- value: E,
804
- checked: E.isChecked
1172
+ value: k,
1173
+ checked: k.isChecked
805
1174
  }));
806
- await (await Ae.create({
1175
+ await (await Pe.create({
807
1176
  header: e.value.label || "Select an option",
808
- inputs: h,
1177
+ inputs: a,
809
1178
  buttons: [
810
1179
  {
811
1180
  text: "Cancel",
@@ -813,104 +1182,91 @@ const re = /* @__PURE__ */ U({
813
1182
  },
814
1183
  {
815
1184
  text: "OK",
816
- handler: (E) => {
1185
+ handler: (k) => {
817
1186
  if (e.value.multiple)
818
- s.value.forEach((R) => ee(R, s.value)), E.forEach((R) => {
819
- const G = s.value.find((he) => he.value === R.value);
820
- G && D(G, s.value);
1187
+ s.value.forEach((g) => _e(g, s.value)), k.forEach((g) => {
1188
+ const D = s.value.find((H) => H.value === g.value);
1189
+ D && X(D, s.value);
821
1190
  });
822
1191
  else {
823
- _();
824
- const R = s.value.find((G) => G.value === E.value);
825
- R && D(R, s.value);
1192
+ C();
1193
+ const g = s.value.find((D) => D.value === k.value);
1194
+ g && X(g, s.value);
826
1195
  }
827
- T();
1196
+ L();
828
1197
  }
829
1198
  }
830
1199
  ]
831
1200
  })).present();
832
1201
  }
833
- async function L() {
834
- if (e.value.required && ae(u.value))
1202
+ async function q() {
1203
+ if (e.value.required && me(i.value))
835
1204
  return "This field is required";
836
1205
  if (e.value.validation) {
837
- const h = await e.value.validation(u.value, a == null ? void 0 : a.schema);
838
- if (h && h.length)
839
- return h.join();
1206
+ const a = await e.value.validation(i.value, n == null ? void 0 : n.schema);
1207
+ if (a && a.length)
1208
+ return a.join();
840
1209
  }
841
1210
  return !0;
842
1211
  }
843
- const { onFocus: j, applyValidationState: P } = J(
1212
+ const { onFocus: W, applyValidationState: J } = ue(
844
1213
  l,
845
1214
  e,
846
- O(() => e.value.multiple ? u.value : u.value[0]),
847
- O(() => a == null ? void 0 : a.schema),
848
- L
1215
+ S(() => e.value.multiple ? i.value : i.value[0]),
1216
+ S(() => n == null ? void 0 : n.schema),
1217
+ q
849
1218
  );
850
- function N(h) {
851
- var k;
852
- h.target === ((k = l.value) == null ? void 0 : k.$el) && (j(), r.value === "popover" && (i.value = !0));
1219
+ function Z(a) {
1220
+ var h;
1221
+ a.target === ((h = l.value) == null ? void 0 : h.$el) && (W(), c.value === "popover" && (r.value = !0));
853
1222
  }
854
- async function T(h) {
855
- var E;
856
- if ((E = h == null ? void 0 : h.relatedTarget) != null && E.closest(".suggestions-list")) return;
857
- i.value = !1;
858
- const k = await L();
859
- k === !0 ? (e.value.error = "", e.value.value = e.value.multiple ? u.value : u.value[0]) : e.value.error = typeof k == "string" ? k : "Validation failed", await P(k === !0);
1223
+ async function L(a) {
1224
+ var k;
1225
+ if ((k = a == null ? void 0 : a.relatedTarget) != null && k.closest(".suggestions-list")) return;
1226
+ r.value = !1;
1227
+ const h = await q();
1228
+ h === !0 ? (e.value.error = "", e.value.value = e.value.multiple ? i.value : i.value[0]) : e.value.error = typeof h == "string" ? h : "Validation failed", await J(h === !0);
860
1229
  }
861
- async function Z() {
862
- const h = [];
863
- if (a.dependencyManager && a.formId && e.value.dependsOn)
864
- a.dependencyManager.updateOptions(a.formId, f.value), Array.isArray(e.value.options) && h.push(...e.value.options.filter((k) => !!k.label));
865
- else if (typeof e.value.options == "function") {
866
- const k = await e.value.options(f.value);
867
- h.push(...k.filter((E) => !!E.label));
868
- } else
869
- h.push(...Ne(e.value.options ?? [], f.value));
870
- u.value.forEach((k) => D(k, h)), s.value = h;
1230
+ async function M() {
1231
+ const a = [];
1232
+ if (typeof e.value.options == "function") {
1233
+ let h = {};
1234
+ e.value.dependsOn && n.schema && (h = (Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn]).reduce(
1235
+ (D, H) => {
1236
+ var Q;
1237
+ return D[H] = (Q = n.schema[H]) == null ? void 0 : Q.value, D;
1238
+ },
1239
+ {}
1240
+ ));
1241
+ const k = await e.value.options(y.value, h);
1242
+ a.push(...k.filter((g) => !!g.label));
1243
+ } else Array.isArray(e.value.options) && a.push(...Je(e.value.options, y.value));
1244
+ i.value.forEach((h) => X(h, a)), s.value = a;
871
1245
  }
872
- function ye() {
873
- const h = e.value.value;
874
- h && (Array.isArray(h) ? h.forEach((k) => D(k, s.value)) : D(typeof h == "object" ? h : {
875
- value: h,
876
- label: h
1246
+ function _() {
1247
+ const a = e.value.value;
1248
+ a && (Array.isArray(a) ? a.forEach((h) => X(h, s.value)) : X(typeof a == "object" ? a : {
1249
+ value: a,
1250
+ label: a
877
1251
  }, s.value));
878
1252
  }
879
- return ue(() => {
880
- if (a.dependencyManager && a.formId && e.value.dependsOn && typeof a.dependencyManager.registerDependency == "function") {
881
- const h = Array.isArray(e.value.dependsOn) ? e.value.dependsOn : [e.value.dependsOn];
882
- a.dependencyManager.registerDependency(
883
- a.formId,
884
- h,
885
- async (k, E) => {
886
- if (Array.isArray(e.value.options))
887
- return e.value.options;
888
- if (typeof e.value.options == "function")
889
- try {
890
- const R = k !== void 0 ? k : f.value, G = await e.value.options(R, E);
891
- return Array.isArray(G) ? G : [];
892
- } catch (R) {
893
- return console.error(`Error loading options for ${a.formId}:`, R), [];
894
- }
895
- return [];
896
- }
897
- );
898
- }
1253
+ return ge(() => {
1254
+ M();
899
1255
  }), o({
900
- onValueUpdate: T,
901
- onReset: _,
1256
+ onValueUpdate: L,
1257
+ onReset: C,
902
1258
  getErrors: () => e.value.error ? [e.value.error] : []
903
- }), (h, k) => (p(), B("div", {
1259
+ }), (a, h) => (f(), $("div", {
904
1260
  class: "autocomplete-container",
905
- onFocusout: T,
1261
+ onFocusout: L,
906
1262
  ref_key: "containerRef",
907
- ref: n
1263
+ ref: u
908
1264
  }, [
909
- A(d(ce), {
1265
+ P(d(Ve), {
910
1266
  ref_key: "inputRef",
911
1267
  ref: l,
912
- modelValue: f.value,
913
- "onUpdate:modelValue": k[0] || (k[0] = (E) => f.value = E),
1268
+ modelValue: y.value,
1269
+ "onUpdate:modelValue": h[0] || (h[0] = (k) => y.value = k),
914
1270
  fill: e.value.fill ?? "solid",
915
1271
  "label-placement": e.value.labelPlacement ?? "stacked",
916
1272
  type: t.type ?? "text",
@@ -920,23 +1276,23 @@ const re = /* @__PURE__ */ U({
920
1276
  placeholder: m.value,
921
1277
  disabled: e.value.disabled,
922
1278
  counter: e.value.counter,
923
- onIonFocus: N,
1279
+ onIonFocus: Z,
924
1280
  debounce: 300,
925
- onClick: g
1281
+ onClick: w
926
1282
  }, {
927
- default: x(() => [
928
- A(re, { model: e.value }, null, 8, ["model"]),
929
- e.value.multiple ? (p(), b(d(H), {
1283
+ default: b(() => [
1284
+ P(ye, { model: e.value }, null, 8, ["model"]),
1285
+ e.value.multiple ? (f(), V(d(Y), {
930
1286
  key: 0,
931
1287
  style: { width: "fit-content" },
932
1288
  slot: "start"
933
1289
  }, {
934
- default: x(() => [
935
- (p(!0), B(M, null, K(u.value, (E, R) => (p(), b(d(we), { key: R }, {
936
- default: x(() => [
937
- A(d(H), null, {
938
- default: x(() => [
939
- F(S(E.label), 1)
1290
+ default: b(() => [
1291
+ (f(!0), $(T, null, K(i.value, (k, g) => (f(), V(d($e), { key: g }, {
1292
+ default: b(() => [
1293
+ P(d(Y), null, {
1294
+ default: b(() => [
1295
+ z(A(k.label), 1)
940
1296
  ]),
941
1297
  _: 2
942
1298
  }, 1024)
@@ -945,52 +1301,52 @@ const re = /* @__PURE__ */ U({
945
1301
  }, 1024))), 128))
946
1302
  ]),
947
1303
  _: 1
948
- })) : (p(), b(d(H), {
1304
+ })) : (f(), V(d(Y), {
949
1305
  key: 1,
950
1306
  slot: "start",
951
1307
  class: "ion-no-wrap"
952
1308
  }, {
953
- default: x(() => {
954
- var E;
1309
+ default: b(() => {
1310
+ var k;
955
1311
  return [
956
- F(S(((E = u.value[0]) == null ? void 0 : E.label) ?? ""), 1)
1312
+ z(A(((k = i.value[0]) == null ? void 0 : k.label) ?? ""), 1)
957
1313
  ];
958
1314
  }),
959
1315
  _: 1
960
1316
  })),
961
- A(d(X), {
1317
+ P(d(ce), {
962
1318
  slot: "end",
963
- icon: d(Be)
1319
+ icon: d(Te)
964
1320
  }, null, 8, ["icon"]),
965
- u.value.length > 0 || f.value ? (p(), b(d(X), {
1321
+ i.value.length > 0 || y.value ? (f(), V(d(ce), {
966
1322
  key: 2,
967
1323
  slot: "end",
968
1324
  icon: d(qe),
969
- onClick: _,
1325
+ onClick: C,
970
1326
  style: { "z-index": "999999" }
971
- }, null, 8, ["icon"])) : I("", !0)
1327
+ }, null, 8, ["icon"])) : O("", !0)
972
1328
  ]),
973
1329
  _: 1
974
1330
  }, 8, ["modelValue", "fill", "label-placement", "type", "required", "error-text", "autofocus", "placeholder", "disabled", "counter"]),
975
- i.value && s.value.length > 0 && r.value === "popover" ? (p(), b(d(Oe), {
1331
+ r.value && s.value.length > 0 && c.value === "popover" ? (f(), V(d(Fe), {
976
1332
  key: 0,
977
- class: xe(["suggestions-list", v.value])
1333
+ class: ne(["suggestions-list", v.value])
978
1334
  }, {
979
- default: x(() => [
980
- (p(!0), B(M, null, K(s.value, (E) => (p(), b(d(Ie), {
1335
+ default: b(() => [
1336
+ (f(!0), $(T, null, K(s.value, (k) => (f(), V(d(ze), {
981
1337
  button: "",
982
- key: E.label,
983
- onClick: (R) => V(E)
1338
+ key: k.label,
1339
+ onClick: (g) => x(k)
984
1340
  }, {
985
- default: x(() => [
986
- e.value.multiple ? (p(), b(d(de), {
1341
+ default: b(() => [
1342
+ e.value.multiple ? (f(), V(d(be), {
987
1343
  key: 0,
988
1344
  slot: "start",
989
- checked: E.isChecked
990
- }, null, 8, ["checked"])) : I("", !0),
991
- A(d(H), null, {
992
- default: x(() => [
993
- F(S(E.label), 1)
1345
+ checked: k.isChecked
1346
+ }, null, 8, ["checked"])) : O("", !0),
1347
+ P(d(Y), null, {
1348
+ default: b(() => [
1349
+ z(A(k.label), 1)
994
1350
  ]),
995
1351
  _: 2
996
1352
  }, 1024)
@@ -999,17 +1355,12 @@ const re = /* @__PURE__ */ U({
999
1355
  }, 1032, ["onClick"]))), 128))
1000
1356
  ]),
1001
1357
  _: 1
1002
- }, 8, ["class"])) : I("", !0)
1358
+ }, 8, ["class"])) : O("", !0)
1003
1359
  ], 544));
1004
1360
  }
1005
- }), me = (t, o) => {
1006
- const a = t.__vccOpts || t;
1007
- for (const [e, l] of o)
1008
- a[e] = l;
1009
- return a;
1010
- }, lt = /* @__PURE__ */ me(tt, [["__scopeId", "data-v-439c5bca"]]), at = /* @__PURE__ */ U({
1361
+ }), Rt = /* @__PURE__ */ de(xt, [["__scopeId", "data-v-4766dec2"]]), At = /* @__PURE__ */ U({
1011
1362
  __name: "TextAreaInput",
1012
- props: /* @__PURE__ */ z({
1363
+ props: /* @__PURE__ */ N({
1013
1364
  schema: {}
1014
1365
  }, {
1015
1366
  modelValue: { type: Object, default: {} },
@@ -1017,24 +1368,24 @@ const re = /* @__PURE__ */ U({
1017
1368
  }),
1018
1369
  emits: ["update:modelValue"],
1019
1370
  setup(t, { expose: o }) {
1020
- const a = t, e = $(t, "modelValue"), l = C(null), n = C(e.value.value), i = O(() => a.schema), { onValueUpdate: s, onFocus: f, onReset: c, getErrors: r } = J(
1371
+ const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), { onValueUpdate: s, onFocus: y, onReset: p, getErrors: c } = ue(
1021
1372
  l,
1022
1373
  e,
1023
- n,
1024
- i
1374
+ u,
1375
+ r
1025
1376
  );
1026
- return q(
1377
+ return I(
1027
1378
  () => e.value.value,
1028
- (v) => n.value = v
1379
+ (v) => u.value = v
1029
1380
  ), o({
1030
- onReset: c,
1381
+ onReset: p,
1031
1382
  onValueUpdate: s,
1032
- getErrors: r
1033
- }), (v, u) => (p(), b(d(Fe), {
1383
+ getErrors: c
1384
+ }), (v, i) => (f(), V(d(Ie), {
1034
1385
  ref_key: "inputRef",
1035
1386
  ref: l,
1036
- modelValue: n.value,
1037
- "onUpdate:modelValue": u[0] || (u[0] = (m) => n.value = m),
1387
+ modelValue: u.value,
1388
+ "onUpdate:modelValue": i[0] || (i[0] = (m) => u.value = m),
1038
1389
  "clear-input": !0,
1039
1390
  fill: e.value.fill ?? "solid",
1040
1391
  "label-placement": e.value.labelPlacement ?? "stacked",
@@ -1052,22 +1403,22 @@ const re = /* @__PURE__ */ U({
1052
1403
  "max-length": e.value.maxLength,
1053
1404
  "min-length": e.value.minLength,
1054
1405
  pattern: e.value.pattern,
1055
- onIonFocus: d(f),
1406
+ onIonFocus: d(y),
1056
1407
  onIonChange: d(s),
1057
1408
  onIonBlur: d(s)
1058
1409
  }, {
1059
- default: x(() => [
1060
- A(re, { model: e.value }, null, 8, ["model"])
1410
+ default: b(() => [
1411
+ P(ye, { model: e.value }, null, 8, ["model"])
1061
1412
  ]),
1062
1413
  _: 1
1063
1414
  }, 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"]));
1064
1415
  }
1065
- }), nt = {
1416
+ }), $t = {
1066
1417
  class: "ion-margin-end",
1067
1418
  style: { "flex-grow": "1" }
1068
- }, ot = { style: { display: "flex", "justify-content": "flex-end" } }, ut = /* @__PURE__ */ U({
1419
+ }, Ft = { style: { display: "flex", "justify-content": "flex-end" } }, zt = /* @__PURE__ */ U({
1069
1420
  __name: "RepeatInput",
1070
- props: /* @__PURE__ */ z({
1421
+ props: /* @__PURE__ */ N({
1071
1422
  schema: {},
1072
1423
  data: {},
1073
1424
  computedData: {}
@@ -1077,32 +1428,32 @@ const re = /* @__PURE__ */ U({
1077
1428
  }),
1078
1429
  emits: ["update:modelValue"],
1079
1430
  setup(t, { expose: o }) {
1080
- const a = $(t, "modelValue"), e = C([]), { dynamicRefs: l, resetForm: n, getFormErrors: i, updateFormValues: s } = pe(), f = O(() => e.value.map((_, V) => ({
1081
- label: `Set ${V + 1}`,
1082
- value: V,
1083
- other: Object.entries(_).reduce(
1084
- (g, [y, w]) => (g[y] = w.value, g),
1431
+ const n = G(t, "modelValue"), e = E([]), { dynamicRefs: l, resetForm: u, getFormErrors: r, updateFormValues: s } = we(), y = S(() => e.value.map((C, x) => ({
1432
+ label: `Set ${x + 1}`,
1433
+ value: x,
1434
+ other: Object.entries(C).reduce(
1435
+ (w, [R, F]) => (w[R] = F.value, w),
1085
1436
  {}
1086
1437
  )
1087
1438
  })));
1088
- q(
1089
- f,
1090
- (_) => {
1091
- a.value.value = _;
1439
+ I(
1440
+ y,
1441
+ (C) => {
1442
+ n.value.value = C;
1092
1443
  },
1093
1444
  { deep: !0, immediate: !0 }
1094
- ), ue(c);
1095
- function c() {
1096
- a.value.children && e.value.push(oe(a.value.children));
1445
+ ), ge(p);
1446
+ function p() {
1447
+ n.value.children && e.value.push(he(n.value.children));
1097
1448
  }
1098
- function r(_) {
1099
- e.value.splice(_, 1);
1449
+ function c(C) {
1450
+ e.value.splice(C, 1);
1100
1451
  }
1101
1452
  function v() {
1102
- n();
1453
+ u();
1103
1454
  }
1104
- function u() {
1105
- return i();
1455
+ function i() {
1456
+ return r();
1106
1457
  }
1107
1458
  async function m() {
1108
1459
  await s();
@@ -1110,78 +1461,78 @@ const re = /* @__PURE__ */ U({
1110
1461
  return o({
1111
1462
  onValueUpdate: m,
1112
1463
  onReset: v,
1113
- getErrors: u
1114
- }), (_, V) => (p(!0), B(M, null, K(e.value, (g, y) => (p(), B("div", {
1464
+ getErrors: i
1465
+ }), (C, x) => (f(!0), $(T, null, K(e.value, (w, R) => (f(), $("div", {
1115
1466
  class: "repeat-input-wrapper",
1116
- key: y
1467
+ key: R
1117
1468
  }, [
1118
- se("div", nt, [
1119
- A(d(te), null, {
1120
- default: x(() => [
1121
- (p(!0), B(M, null, K(Object.keys(g), (w) => {
1122
- var L, j, P, N, T;
1123
- return p(), B(M, null, [
1124
- d(ne)(g[w], _.data, _.computedData) ? (p(), b(d(le), {
1125
- key: `${y}-${w}`,
1126
- size: ((L = g[w].grid) == null ? void 0 : L.xs) ?? "12",
1127
- "size-sm": (j = g[w].grid) == null ? void 0 : j.sm,
1128
- "size-md": (P = g[w].grid) == null ? void 0 : P.md,
1129
- "size-lg": (N = g[w].grid) == null ? void 0 : N.lg,
1130
- "size-xl": (T = g[w].grid) == null ? void 0 : T.xl,
1469
+ B("div", $t, [
1470
+ P(d(le), null, {
1471
+ default: b(() => [
1472
+ (f(!0), $(T, null, K(Object.keys(w), (F) => {
1473
+ var q, W, J, Z, L;
1474
+ return f(), $(T, null, [
1475
+ d(ie)(w[F], C.data, C.computedData) ? (f(), V(d(ae), {
1476
+ key: `${R}-${F}`,
1477
+ size: ((q = w[F].grid) == null ? void 0 : q.xs) ?? "12",
1478
+ "size-sm": (W = w[F].grid) == null ? void 0 : W.sm,
1479
+ "size-md": (J = w[F].grid) == null ? void 0 : J.md,
1480
+ "size-lg": (Z = w[F].grid) == null ? void 0 : Z.lg,
1481
+ "size-xl": (L = w[F].grid) == null ? void 0 : L.xl,
1131
1482
  class: "ion-margin-bottom"
1132
1483
  }, {
1133
- default: x(() => [
1134
- (p(), b(ie(g[w].type), {
1135
- modelValue: g[w],
1136
- "onUpdate:modelValue": (Z) => g[w] = Z,
1137
- schema: g,
1138
- "ref-key": `${y}-${w}`,
1484
+ default: b(() => [
1485
+ (f(), V(fe(w[F].type), {
1486
+ modelValue: w[F],
1487
+ "onUpdate:modelValue": (M) => w[F] = M,
1488
+ schema: w,
1489
+ "ref-key": `${R}-${F}`,
1139
1490
  ref_for: !0,
1140
1491
  ref_key: "dynamicRefs",
1141
1492
  ref: l
1142
1493
  }, null, 8, ["modelValue", "onUpdate:modelValue", "schema", "ref-key"]))
1143
1494
  ]),
1144
1495
  _: 2
1145
- }, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : I("", !0)
1496
+ }, 1032, ["size", "size-sm", "size-md", "size-lg", "size-xl"])) : O("", !0)
1146
1497
  ], 64);
1147
1498
  }), 256))
1148
1499
  ]),
1149
1500
  _: 2
1150
1501
  }, 1024)
1151
1502
  ]),
1152
- se("div", ot, [
1153
- y === e.value.length - 1 ? (p(), b(d(W), {
1503
+ B("div", Ft, [
1504
+ R === e.value.length - 1 ? (f(), V(d(j), {
1154
1505
  key: 0,
1155
- onClick: c,
1506
+ onClick: p,
1156
1507
  color: "primary"
1157
1508
  }, {
1158
- default: x(() => [
1159
- A(d(X), {
1509
+ default: b(() => [
1510
+ P(d(ce), {
1160
1511
  slot: "icon-only",
1161
- icon: d(ze)
1512
+ icon: d(Le)
1162
1513
  }, null, 8, ["icon"])
1163
1514
  ]),
1164
1515
  _: 1
1165
- })) : I("", !0),
1166
- e.value.length > 1 ? (p(), b(d(W), {
1516
+ })) : O("", !0),
1517
+ e.value.length > 1 ? (f(), V(d(j), {
1167
1518
  key: 1,
1168
- onClick: (w) => r(y),
1519
+ onClick: (F) => c(R),
1169
1520
  color: "warning"
1170
1521
  }, {
1171
- default: x(() => [
1172
- A(d(X), {
1522
+ default: b(() => [
1523
+ P(d(ce), {
1173
1524
  slot: "icon-only",
1174
- icon: d($e)
1525
+ icon: d(Me)
1175
1526
  }, null, 8, ["icon"])
1176
1527
  ]),
1177
1528
  _: 2
1178
- }, 1032, ["onClick"])) : I("", !0)
1529
+ }, 1032, ["onClick"])) : O("", !0)
1179
1530
  ])
1180
1531
  ]))), 128));
1181
1532
  }
1182
- }), rt = /* @__PURE__ */ me(ut, [["__scopeId", "data-v-402695fe"]]), st = /* @__PURE__ */ U({
1533
+ }), Bt = /* @__PURE__ */ de(zt, [["__scopeId", "data-v-060bdf58"]]), Pt = /* @__PURE__ */ U({
1183
1534
  __name: "CheckboxInput",
1184
- props: /* @__PURE__ */ z({
1535
+ props: /* @__PURE__ */ N({
1185
1536
  schema: {}
1186
1537
  }, {
1187
1538
  modelValue: { type: Object, default: {} },
@@ -1189,38 +1540,38 @@ const re = /* @__PURE__ */ U({
1189
1540
  }),
1190
1541
  emits: ["update:modelValue"],
1191
1542
  setup(t, { expose: o }) {
1192
- const a = t, e = $(t, "modelValue"), l = C(null), n = C(e.value.value), i = O(() => a.schema), s = O(() => fe(e.value)), { onValueUpdate: f, onFocus: c, getErrors: r } = J(l, e, n, i);
1543
+ const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), s = S(() => Se(e.value)), { onValueUpdate: y, onFocus: p, getErrors: c } = ue(l, e, u, r);
1193
1544
  function v() {
1194
- n.value = !1, e.value.error = "", e.value.value = !1;
1545
+ u.value = !1, e.value.error = "", e.value.value = !1;
1195
1546
  }
1196
- return q(
1547
+ return I(
1197
1548
  () => e.value.value,
1198
- (u) => n.value = u
1549
+ (i) => u.value = i
1199
1550
  ), o({
1200
- onValueUpdate: f,
1551
+ onValueUpdate: y,
1201
1552
  onReset: v,
1202
- getErrors: r
1203
- }), (u, m) => (p(), b(d(de), {
1204
- modelValue: n.value,
1205
- "onUpdate:modelValue": m[0] || (m[0] = (_) => n.value = _),
1553
+ getErrors: c
1554
+ }), (i, m) => (f(), V(d(be), {
1555
+ modelValue: u.value,
1556
+ "onUpdate:modelValue": m[0] || (m[0] = (C) => u.value = C),
1206
1557
  ref_key: "inputRef",
1207
1558
  ref: l,
1208
1559
  required: e.value.required,
1209
1560
  "error-text": e.value.error,
1210
1561
  disabled: e.value.disabled,
1211
- onIonFocus: d(c),
1212
- onIonChange: d(f),
1213
- onIonBlur: d(f)
1562
+ onIonFocus: d(p),
1563
+ onIonChange: d(y),
1564
+ onIonBlur: d(y)
1214
1565
  }, {
1215
- default: x(() => [
1216
- F(S(s.value), 1)
1566
+ default: b(() => [
1567
+ z(A(s.value), 1)
1217
1568
  ]),
1218
1569
  _: 1
1219
1570
  }, 8, ["modelValue", "required", "error-text", "disabled", "onIonFocus", "onIonChange", "onIonBlur"]));
1220
1571
  }
1221
- }), it = /* @__PURE__ */ U({
1572
+ }), It = /* @__PURE__ */ U({
1222
1573
  __name: "RadioInput",
1223
- props: /* @__PURE__ */ z({
1574
+ props: /* @__PURE__ */ N({
1224
1575
  schema: {}
1225
1576
  }, {
1226
1577
  modelValue: { type: Object, default: {} },
@@ -1228,48 +1579,48 @@ const re = /* @__PURE__ */ U({
1228
1579
  }),
1229
1580
  emits: ["update:modelValue"],
1230
1581
  setup(t, { expose: o }) {
1231
- const a = t, e = $(t, "modelValue"), l = C(null), n = C(e.value.value), i = O(() => a.schema), s = C([]), f = O(() => fe(e.value)), { onValueUpdate: c, onFocus: r, getErrors: v } = J(l, e, n, i);
1232
- function u() {
1233
- e.value.error = "", n.value = void 0, e.value.value = void 0;
1582
+ const n = t, e = G(t, "modelValue"), l = E(null), u = E(e.value.value), r = S(() => n.schema), s = E([]), y = S(() => Se(e.value)), { onValueUpdate: p, onFocus: c, getErrors: v } = ue(l, e, u, r);
1583
+ function i() {
1584
+ e.value.error = "", u.value = void 0, e.value.value = void 0;
1234
1585
  }
1235
- function m(V, g) {
1236
- return V.value === g.value;
1586
+ function m(x, w) {
1587
+ return x.value === w.value;
1237
1588
  }
1238
- async function _() {
1589
+ async function C() {
1239
1590
  typeof e.value.options == "function" ? s.value = await e.value.options() : s.value = e.value.options;
1240
1591
  }
1241
- return q(
1592
+ return I(
1242
1593
  () => e.value.value,
1243
- (V) => n.value = V
1594
+ (x) => u.value = x
1244
1595
  ), o({
1245
- onValueUpdate: c,
1246
- onReset: u,
1596
+ onValueUpdate: p,
1597
+ onReset: i,
1247
1598
  getErrors: v
1248
- }), ue(_), (V, g) => (p(), b(d(Ue), {
1249
- modelValue: n.value,
1250
- "onUpdate:modelValue": g[0] || (g[0] = (y) => n.value = y),
1599
+ }), ge(C), (x, w) => (f(), V(d(Ue), {
1600
+ modelValue: u.value,
1601
+ "onUpdate:modelValue": w[0] || (w[0] = (R) => u.value = R),
1251
1602
  ref_key: "inputRef",
1252
1603
  ref: l,
1253
1604
  required: e.value.required,
1254
- "helper-text": f.value,
1605
+ "helper-text": y.value,
1255
1606
  "error-text": e.value.error,
1256
1607
  disabled: e.value.disabled,
1257
1608
  compareWith: m,
1258
1609
  "allow-empty-selection": !e.value.required,
1259
- onIonFocus: d(r),
1260
- onIonChange: d(c),
1261
- onIonBlur: d(c)
1610
+ onIonFocus: d(c),
1611
+ onIonChange: d(p),
1612
+ onIonBlur: d(p)
1262
1613
  }, {
1263
- default: x(() => [
1264
- (p(!0), B(M, null, K(s.value, (y) => (p(), b(d(Se), {
1265
- key: y.value,
1266
- value: y,
1614
+ default: b(() => [
1615
+ (f(!0), $(T, null, K(s.value, (R) => (f(), V(d(De), {
1616
+ key: R.value,
1617
+ value: R,
1267
1618
  disabled: e.value.disabled,
1268
1619
  "label-placement": "end",
1269
1620
  justify: "start"
1270
1621
  }, {
1271
- default: x(() => [
1272
- F(S(y.label), 1)
1622
+ default: b(() => [
1623
+ z(A(R.label), 1)
1273
1624
  ]),
1274
1625
  _: 2
1275
1626
  }, 1032, ["value", "disabled"]))), 128))
@@ -1277,17 +1628,71 @@ const re = /* @__PURE__ */ U({
1277
1628
  _: 1
1278
1629
  }, 8, ["modelValue", "required", "helper-text", "error-text", "disabled", "allow-empty-selection", "onIonFocus", "onIonChange", "onIonBlur"]));
1279
1630
  }
1280
- }), pt = {
1631
+ });
1632
+ function Lt(t, o, n) {
1633
+ const e = E({}), l = E({});
1634
+ function u(c, v, i) {
1635
+ l.value[c] = i, v.forEach((m) => {
1636
+ var C;
1637
+ (C = e.value)[m] ?? (C[m] = []), e.value[m].includes(c) || e.value[m].push(c);
1638
+ }), p(c);
1639
+ }
1640
+ function r(c) {
1641
+ return Object.entries(e.value).filter(([, i]) => i.includes(c)).map(([i]) => i).reduce(
1642
+ (i, m) => (i[m] = o.value[m] ?? n.value[m], i),
1643
+ {}
1644
+ );
1645
+ }
1646
+ function s(c, v) {
1647
+ return c ? Array.isArray(c) ? c.some((i) => v.some((m) => y(i, m.value))) : v.some((i) => y(c, i.value)) : !1;
1648
+ }
1649
+ function y(c, v) {
1650
+ return typeof c == "object" && c !== null ? c.value === v : String(c) === String(v);
1651
+ }
1652
+ async function p(c, v) {
1653
+ if (!l.value[c]) return;
1654
+ const i = r(c), m = Object.keys(i);
1655
+ if (!(m.length === 0 || !m.every(
1656
+ (x) => i[x] !== void 0 && i[x] !== null
1657
+ )))
1658
+ try {
1659
+ const x = l.value[c], w = await x(v, i);
1660
+ if (!t.value[c]) return;
1661
+ t.value[c].options = w;
1662
+ const R = t.value[c].value;
1663
+ if (!R) return;
1664
+ s(R, w) || (t.value[c].value = t.value[c].multiple ? [] : "");
1665
+ } catch (x) {
1666
+ console.error(`Error loading options for ${c}:`, x);
1667
+ }
1668
+ }
1669
+ return I(
1670
+ [o, n],
1671
+ () => {
1672
+ Object.entries(e.value).forEach(([c, v]) => {
1673
+ (o.value[c] !== void 0 || n.value[c] !== void 0) && v.forEach((i) => {
1674
+ p(i);
1675
+ });
1676
+ });
1677
+ },
1678
+ { deep: !0, immediate: !0 }
1679
+ ), {
1680
+ registerDependency: u,
1681
+ updateOptions: p
1682
+ };
1683
+ }
1684
+ const Mt = {
1281
1685
  install(t) {
1282
- t.component("VForm", Ke), t.component("TextInput", Je), t.component("DateInput", Qe), t.component("NumberInput", Xe), t.component("EmailInput", Ye), t.component("PasswordInput", et), t.component("SelectInput", lt), t.component("TextAreaInput", at), t.component("RepeatInput", rt), t.component("CheckboxInput", st), t.component("RadioInput", it), t.directive("maskito", Te);
1686
+ t.component("VForm", _t), t.component("TextInput", kt), t.component("DateInput", St), t.component("NumberInput", wt), t.component("EmailInput", Ot), t.component("PasswordInput", Et), t.component("SelectInput", Rt), t.component("TextAreaInput", At), t.component("RepeatInput", Bt), t.component("CheckboxInput", Pt), t.component("RadioInput", It), t.directive("maskito", je);
1283
1687
  }
1284
1688
  };
1285
1689
  export {
1286
- pt as VForm,
1287
- pt as default,
1288
- Ge as useDataTransformation,
1289
- He as useDependentOptions,
1290
- pe as useFormValidation,
1291
- J as useInputValidation
1690
+ Mt as VForm,
1691
+ Mt as default,
1692
+ Qe as useDataTransformation,
1693
+ Lt as useDependentOptions,
1694
+ we as useFormValidation,
1695
+ ue as useInputValidation,
1696
+ Xe as useMultiStepForm
1292
1697
  };
1293
1698
  //# sourceMappingURL=index.es.js.map