@uniquedj95/vform 3.3.0 → 3.4.1

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