@stonecrop/aform 0.2.24 → 0.2.26

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/aform.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as E, mergeModels as S, useModel as $, openBlock as v, createElementBlock as g, createElementVNode as c, toDisplayString as A, withDirectives as M, vModelCheckbox as de, vShow as x, resolveComponent as fe, createBlock as K, withCtx as pe, ref as m, onMounted as Y, onUnmounted as me, normalizeClass as P, withKeys as B, vModelText as G, Fragment as q, renderList as F, watch as U, onBeforeUnmount as ve, computed as H, unref as re, getCurrentScope as he, onScopeDispose as ye, nextTick as ge, withModifiers as _e, resolveDynamicComponent as be, mergeProps as ke, createTextVNode as we, createCommentVNode as De, renderSlot as Me, createVNode as Ee } from "vue";
2
- const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform__checkbox-container aform__input-field" }, Ve = ["id", "readonly", "required"], Le = ["innerHTML"], Se = /* @__PURE__ */ E({
1
+ import { defineComponent as A, mergeModels as V, useModel as x, openBlock as h, createElementBlock as g, createElementVNode as i, toDisplayString as E, withDirectives as D, vModelCheckbox as pe, vShow as H, resolveComponent as me, createBlock as G, withCtx as ve, ref as f, onMounted as W, onUnmounted as he, normalizeClass as R, withKeys as q, vModelText as I, Fragment as O, renderList as U, watch as B, onBeforeUnmount as _e, computed as $, unref as ie, getCurrentScope as ge, onScopeDispose as ye, getCurrentInstance as be, nextTick as we, withModifiers as ke, resolveDynamicComponent as De, mergeProps as Me, createTextVNode as Ee, createCommentVNode as ue, renderSlot as Ae, createVNode as Ce } from "vue";
2
+ const Te = { class: "aform__form-element" }, Se = ["for"], Le = { class: "aform__checkbox-container aform__input-field" }, $e = ["id", "readonly", "required"], Ve = ["innerHTML"], xe = /* @__PURE__ */ A({
3
3
  __name: "ACheckbox",
4
- props: /* @__PURE__ */ S({
4
+ props: /* @__PURE__ */ V({
5
5
  label: {},
6
6
  required: { type: Boolean },
7
7
  readOnly: { type: Boolean },
@@ -13,57 +13,57 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
13
13
  }),
14
14
  emits: ["update:modelValue"],
15
15
  setup(e) {
16
- const t = $(e, "modelValue");
17
- return (n, o) => (v(), g("div", Ae, [
18
- c("label", {
16
+ const t = x(e, "modelValue");
17
+ return (n, o) => (h(), g("div", Te, [
18
+ i("label", {
19
19
  class: "aform__field-label",
20
20
  for: n.uuid
21
- }, A(n.label), 9, Ce),
22
- c("span", Te, [
23
- M(c("input", {
21
+ }, E(n.label), 9, Se),
22
+ i("span", Le, [
23
+ D(i("input", {
24
24
  "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
25
25
  type: "checkbox",
26
26
  id: n.uuid,
27
27
  class: "aform__checkbox",
28
28
  readonly: n.readOnly,
29
29
  required: n.required
30
- }, null, 8, Ve), [
31
- [de, t.value]
30
+ }, null, 8, $e), [
31
+ [pe, t.value]
32
32
  ])
33
33
  ]),
34
- M(c("p", {
34
+ D(i("p", {
35
35
  class: "error",
36
36
  innerHTML: n.validation.errorMessage
37
- }, null, 8, Le), [
38
- [x, n.validation.errorMessage]
37
+ }, null, 8, Ve), [
38
+ [H, n.validation.errorMessage]
39
39
  ])
40
40
  ]));
41
41
  }
42
- }), $e = /* @__PURE__ */ c("div", null, [
43
- /* @__PURE__ */ c("input", { type: "text" }),
44
- /* @__PURE__ */ c("input", { type: "text" }),
45
- /* @__PURE__ */ c("input", { type: "text" })
46
- ], -1), xe = /* @__PURE__ */ E({
42
+ }), He = /* @__PURE__ */ i("div", null, [
43
+ /* @__PURE__ */ i("input", { type: "text" }),
44
+ /* @__PURE__ */ i("input", { type: "text" }),
45
+ /* @__PURE__ */ i("input", { type: "text" })
46
+ ], -1), Ie = /* @__PURE__ */ A({
47
47
  __name: "AComboBox",
48
48
  props: ["event", "cellData", "tableID"],
49
49
  setup(e) {
50
50
  return (t, n) => {
51
- const o = fe("ATableModal");
52
- return v(), K(o, {
51
+ const o = me("ATableModal");
52
+ return h(), G(o, {
53
53
  event: e.event,
54
54
  cellData: e.cellData,
55
55
  class: "amodal"
56
56
  }, {
57
- default: pe(() => [
58
- $e
57
+ default: ve(() => [
58
+ He
59
59
  ]),
60
60
  _: 1
61
61
  }, 8, ["event", "cellData"]);
62
62
  };
63
63
  }
64
- }), He = ["id", "disabled", "required", "value"], Ie = ["for"], Be = ["innerHTML"], Pe = /* @__PURE__ */ E({
64
+ }), Pe = ["id", "disabled", "required", "value"], Be = ["for"], Fe = ["innerHTML"], qe = /* @__PURE__ */ A({
65
65
  __name: "ADate",
66
- props: /* @__PURE__ */ S({
66
+ props: /* @__PURE__ */ V({
67
67
  label: { default: "Date" },
68
68
  required: { type: Boolean },
69
69
  readonly: { type: Boolean },
@@ -75,11 +75,11 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
75
75
  }),
76
76
  emits: ["update:modelValue"],
77
77
  setup(e) {
78
- const t = $(e, "modelValue"), n = m(null), o = () => {
78
+ const t = x(e, "modelValue"), n = f(null), o = () => {
79
79
  n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
80
80
  };
81
- return (l, r) => (v(), g("div", null, [
82
- c("input", {
81
+ return (l, a) => (h(), g("div", null, [
82
+ i("input", {
83
83
  ref_key: "dateRef",
84
84
  ref: n,
85
85
  type: "date",
@@ -88,29 +88,29 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
88
88
  required: l.required,
89
89
  value: t.value,
90
90
  onClick: o
91
- }, null, 8, He),
92
- c("label", { for: l.uuid }, A(l.label), 9, Ie),
93
- M(c("p", {
91
+ }, null, 8, Pe),
92
+ i("label", { for: l.uuid }, E(l.label), 9, Be),
93
+ D(i("p", {
94
94
  innerHTML: l.validation.errorMessage
95
- }, null, 8, Be), [
96
- [x, l.validation.errorMessage]
95
+ }, null, 8, Fe), [
96
+ [H, l.validation.errorMessage]
97
97
  ])
98
98
  ]));
99
99
  }
100
- }), O = (e, t) => {
100
+ }), Y = (e, t) => {
101
101
  const n = e.__vccOpts || e;
102
102
  for (const [o, l] of t)
103
103
  n[o] = l;
104
104
  return n;
105
- }, qe = /* @__PURE__ */ O(Pe, [["__scopeId", "data-v-69d0f23d"]]), Fe = { class: "input-wrapper" }, Re = {
105
+ }, Re = /* @__PURE__ */ Y(qe, [["__scopeId", "data-v-69d0f23d"]]), Oe = { class: "input-wrapper" }, Ue = {
106
106
  id: "autocomplete-results",
107
107
  class: "autocomplete-results"
108
- }, Ue = {
108
+ }, We = {
109
109
  key: 0,
110
110
  class: "loading autocomplete-result"
111
- }, Oe = ["onClick"], We = /* @__PURE__ */ E({
111
+ }, Ye = ["onClick"], Ke = /* @__PURE__ */ A({
112
112
  __name: "ADropdown",
113
- props: /* @__PURE__ */ S({
113
+ props: /* @__PURE__ */ V({
114
114
  label: {},
115
115
  items: {},
116
116
  isAsync: { type: Boolean }
@@ -118,151 +118,191 @@ const Ae = { class: "aform__form-element" }, Ce = ["for"], Te = { class: "aform_
118
118
  modelValue: {},
119
119
  modelModifiers: {}
120
120
  }),
121
- emits: /* @__PURE__ */ S(["filterChanged"], ["update:modelValue"]),
121
+ emits: /* @__PURE__ */ V(["filterChanged"], ["update:modelValue"]),
122
122
  setup(e, { emit: t }) {
123
- const n = e, o = t, l = m(n.items), r = $(e, "modelValue"), s = m(!1), a = m(0), i = m(!1), u = m(null);
124
- Y(() => {
123
+ const n = e, o = t, l = f(n.items), a = x(e, "modelValue"), r = f(!1), s = f(0), c = f(!1), u = f(null);
124
+ W(() => {
125
125
  document.addEventListener("click", _), p();
126
- }), me(() => {
126
+ }), he(() => {
127
127
  document.removeEventListener("click", _);
128
128
  });
129
- const d = (f) => {
130
- r.value = f, b();
129
+ const d = (m) => {
130
+ a.value = m, b();
131
131
  }, p = () => {
132
- r.value ? l.value = n.items.filter((f) => f.toLowerCase().indexOf(r.value.toLowerCase()) > -1) : l.value = n.items;
133
- }, h = () => {
134
- i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) : p();
135
- }, _ = (f) => {
136
- b(), a.value = 0;
132
+ a.value ? l.value = n.items.filter((m) => m.toLowerCase().indexOf(a.value.toLowerCase()) > -1) : l.value = n.items;
133
+ }, v = () => {
134
+ c.value = !0, n.isAsync ? (r.value = !0, o("filterChanged", a.value)) : p();
135
+ }, _ = () => {
136
+ b(), s.value = 0;
137
137
  }, b = () => {
138
- i.value = !1, n.items.includes(r.value) || (r.value = "");
139
- }, V = () => {
140
- a.value < l.value.length && (a.value = a.value + 1);
141
- }, w = () => {
142
- a.value > 0 && (a.value = a.value - 1);
138
+ c.value = !1, n.items.includes(a.value) || (a.value = "");
139
+ }, S = () => {
140
+ s.value < l.value.length && (s.value = s.value + 1);
141
+ }, k = () => {
142
+ s.value > 0 && (s.value = s.value - 1);
143
143
  }, L = () => {
144
- r.value = l.value[a.value], b(), a.value = 0;
144
+ a.value = l.value[s.value], b(), s.value = 0;
145
145
  };
146
- return (f, y) => (v(), g("div", {
147
- class: P(["autocomplete", { isOpen: i.value }])
146
+ return (m, y) => (h(), g("div", {
147
+ class: R(["autocomplete", { isOpen: c.value }])
148
148
  }, [
149
- c("div", Fe, [
150
- M(c("input", {
149
+ i("div", Oe, [
150
+ D(i("input", {
151
151
  ref_key: "mopInput",
152
152
  ref: u,
153
153
  type: "text",
154
- onInput: h,
155
- onFocus: h,
156
- "onUpdate:modelValue": y[0] || (y[0] = (k) => r.value = k),
154
+ onInput: v,
155
+ onFocus: v,
156
+ "onUpdate:modelValue": y[0] || (y[0] = (w) => a.value = w),
157
157
  onKeydown: [
158
- B(V, ["down"]),
159
- B(w, ["up"]),
160
- B(L, ["enter"])
158
+ q(S, ["down"]),
159
+ q(k, ["up"]),
160
+ q(L, ["enter"])
161
161
  ]
162
162
  }, null, 544), [
163
- [G, r.value]
163
+ [I, a.value]
164
164
  ]),
165
- M(c("ul", Re, [
166
- s.value ? (v(), g("li", Ue, "Loading results...")) : (v(!0), g(q, { key: 1 }, F(l.value, (k, D) => (v(), g("li", {
167
- key: D,
168
- onClick: (X) => d(k),
169
- class: P(["autocomplete-result", { "is-active": D === a.value }])
170
- }, A(k), 11, Oe))), 128))
165
+ D(i("ul", Ue, [
166
+ r.value ? (h(), g("li", We, "Loading results...")) : (h(!0), g(O, { key: 1 }, U(l.value, (w, M) => (h(), g("li", {
167
+ key: M,
168
+ onClick: (Z) => d(w),
169
+ class: R(["autocomplete-result", { "is-active": M === s.value }])
170
+ }, E(w), 11, Ye))), 128))
171
171
  ], 512), [
172
- [x, i.value]
172
+ [H, c.value]
173
173
  ]),
174
- c("label", null, A(f.label), 1)
174
+ i("label", null, E(m.label), 1)
175
175
  ])
176
176
  ], 2));
177
177
  }
178
178
  });
179
- function Ke(e) {
180
- return he() ? (ye(e), !0) : !1;
179
+ function ce(e) {
180
+ return ge() ? (ye(e), !0) : !1;
181
181
  }
182
- function ue(e) {
183
- return typeof e == "function" ? e() : re(e);
182
+ function N(e) {
183
+ return typeof e == "function" ? e() : ie(e);
184
184
  }
185
- const Ye = typeof window < "u" && typeof document < "u";
185
+ const ze = typeof window < "u" && typeof document < "u";
186
186
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
187
- const Ge = Object.prototype.toString, ze = (e) => Ge.call(e) === "[object Object]", je = () => {
187
+ const Ge = (e) => e != null, Ne = Object.prototype.toString, je = (e) => Ne.call(e) === "[object Object]", Je = () => {
188
188
  };
189
- function R(e) {
189
+ function P(e) {
190
190
  var t;
191
- const n = ue(e);
191
+ const n = N(e);
192
192
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
193
193
  }
194
- const z = Ye ? window : void 0;
195
- function W(...e) {
194
+ const K = ze ? window : void 0;
195
+ function z(...e) {
196
196
  let t, n, o, l;
197
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = z) : [t, n, o, l] = e, !t)
198
- return je;
197
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = K) : [t, n, o, l] = e, !t)
198
+ return Je;
199
199
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
200
- const r = [], s = () => {
201
- r.forEach((d) => d()), r.length = 0;
202
- }, a = (d, p, h, _) => (d.addEventListener(p, h, _), () => d.removeEventListener(p, h, _)), i = U(
203
- () => [R(t), ue(l)],
200
+ const a = [], r = () => {
201
+ a.forEach((d) => d()), a.length = 0;
202
+ }, s = (d, p, v, _) => (d.addEventListener(p, v, _), () => d.removeEventListener(p, v, _)), c = B(
203
+ () => [P(t), N(l)],
204
204
  ([d, p]) => {
205
- if (s(), !d)
205
+ if (r(), !d)
206
206
  return;
207
- const h = ze(p) ? { ...p } : p;
208
- r.push(
209
- ...n.flatMap((_) => o.map((b) => a(d, _, b, h)))
207
+ const v = je(p) ? { ...p } : p;
208
+ a.push(
209
+ ...n.flatMap((_) => o.map((b) => s(d, _, b, v)))
210
210
  );
211
211
  },
212
212
  { immediate: !0, flush: "post" }
213
213
  ), u = () => {
214
- i(), s();
214
+ c(), r();
215
215
  };
216
- return Ke(u), u;
216
+ return ce(u), u;
217
217
  }
218
- function Je(e = {}) {
218
+ function Qe() {
219
+ const e = f(!1), t = be();
220
+ return t && W(() => {
221
+ e.value = !0;
222
+ }, t), e;
223
+ }
224
+ function Xe(e) {
225
+ const t = Qe();
226
+ return $(() => (t.value, !!e()));
227
+ }
228
+ function Ze(e, t, n = {}) {
229
+ const { window: o = K, ...l } = n;
230
+ let a;
231
+ const r = Xe(() => o && "MutationObserver" in o), s = () => {
232
+ a && (a.disconnect(), a = void 0);
233
+ }, c = $(() => {
234
+ const v = N(e), _ = (Array.isArray(v) ? v : [v]).map(P).filter(Ge);
235
+ return new Set(_);
236
+ }), u = B(
237
+ () => c.value,
238
+ (v) => {
239
+ s(), r.value && v.size && (a = new MutationObserver(t), v.forEach((_) => a.observe(_, l)));
240
+ },
241
+ { immediate: !0, flush: "post" }
242
+ ), d = () => a == null ? void 0 : a.takeRecords(), p = () => {
243
+ s(), u();
244
+ };
245
+ return ce(p), {
246
+ isSupported: r,
247
+ stop: p,
248
+ takeRecords: d
249
+ };
250
+ }
251
+ function et(e = {}) {
219
252
  var t;
220
253
  const {
221
- window: n = z,
222
- deep: o = !0
223
- } = e, l = (t = e.document) != null ? t : n == null ? void 0 : n.document, r = () => {
224
- var i;
225
- let u = l == null ? void 0 : l.activeElement;
254
+ window: n = K,
255
+ deep: o = !0,
256
+ triggerOnRemoval: l = !1
257
+ } = e, a = (t = e.document) != null ? t : n == null ? void 0 : n.document, r = () => {
258
+ var u;
259
+ let d = a == null ? void 0 : a.activeElement;
226
260
  if (o)
227
- for (; u != null && u.shadowRoot; )
228
- u = (i = u == null ? void 0 : u.shadowRoot) == null ? void 0 : i.activeElement;
229
- return u;
230
- }, s = m(), a = () => {
261
+ for (; d != null && d.shadowRoot; )
262
+ d = (u = d == null ? void 0 : d.shadowRoot) == null ? void 0 : u.activeElement;
263
+ return d;
264
+ }, s = f(), c = () => {
231
265
  s.value = r();
232
266
  };
233
- return n && (W(n, "blur", (i) => {
234
- i.relatedTarget === null && a();
235
- }, !0), W(n, "focus", a, !0)), a(), s;
267
+ return n && (z(n, "blur", (u) => {
268
+ u.relatedTarget === null && c();
269
+ }, !0), z(n, "focus", c, !0)), l && Ze(a, (u) => {
270
+ u.filter((d) => d.removedNodes.length).map((d) => Array.from(d.removedNodes)).flat().forEach((d) => {
271
+ d === s.value && c();
272
+ });
273
+ }, {
274
+ childList: !0,
275
+ subtree: !0
276
+ }), c(), s;
236
277
  }
237
- function Ne(e, t = {}) {
238
- const n = Je(t), o = H(() => R(e));
239
- return { focused: H(() => o.value && n.value ? o.value.contains(n.value) : !1) };
278
+ function tt(e, t = {}) {
279
+ const n = et(t), o = $(() => P(e));
280
+ return { focused: $(() => o.value && n.value ? o.value.contains(n.value) : !1) };
240
281
  }
241
- function Qe(e, { window: t = z, scrollTarget: n } = {}) {
242
- const o = m(!1), l = () => {
243
- if (!t)
244
- return;
245
- const r = t.document, s = R(e);
246
- if (!s)
282
+ function nt(e, { window: t = K, scrollTarget: n } = {}) {
283
+ const o = f(!1), l = () => {
284
+ if (!t) return;
285
+ const a = t.document, r = P(e);
286
+ if (!r)
247
287
  o.value = !1;
248
288
  else {
249
- const a = s.getBoundingClientRect();
250
- o.value = a.top <= (t.innerHeight || r.documentElement.clientHeight) && a.left <= (t.innerWidth || r.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
289
+ const s = r.getBoundingClientRect();
290
+ o.value = s.top <= (t.innerHeight || a.documentElement.clientHeight) && s.left <= (t.innerWidth || a.documentElement.clientWidth) && s.bottom >= 0 && s.right >= 0;
251
291
  }
252
292
  };
253
- return U(
254
- () => R(e),
293
+ return B(
294
+ () => P(e),
255
295
  () => l(),
256
296
  { immediate: !0, flush: "post" }
257
- ), t && W(n || t, "scroll", l, {
297
+ ), t && z(n || t, "scroll", l, {
258
298
  capture: !1,
259
299
  passive: !0
260
300
  }), o;
261
301
  }
262
302
  const C = (e) => {
263
- let t = Qe(e).value;
303
+ let t = nt(e).value;
264
304
  return t = t && e.offsetHeight > 0, t;
265
- }, T = (e) => e.tabIndex >= 0, Z = (e) => {
305
+ }, T = (e) => e.tabIndex >= 0, ee = (e) => {
266
306
  const t = e.target;
267
307
  return j(t);
268
308
  }, j = (e) => {
@@ -279,25 +319,25 @@ const C = (e) => {
279
319
  o && (n = o);
280
320
  }
281
321
  return n && (!T(n) || !C(n)) ? j(n) : n;
282
- }, Xe = (e) => {
322
+ }, ot = (e) => {
283
323
  var t;
284
324
  const n = e.target;
285
325
  let o;
286
326
  if (n instanceof HTMLTableCellElement) {
287
327
  const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
288
328
  if (l) {
289
- const r = l.firstElementChild.children[n.cellIndex];
290
- r && (o = r);
329
+ const a = l.firstElementChild.children[n.cellIndex];
330
+ a && (o = a);
291
331
  }
292
332
  } else if (n instanceof HTMLTableRowElement) {
293
333
  const l = n.parentElement;
294
334
  if (l) {
295
- const r = l.firstElementChild;
296
- r && (o = r);
335
+ const a = l.firstElementChild;
336
+ a && (o = a);
297
337
  }
298
338
  }
299
339
  return o && (!T(o) || !C(o)) ? J(o) : o;
300
- }, ee = (e) => {
340
+ }, te = (e) => {
301
341
  const t = e.target;
302
342
  return J(t);
303
343
  }, J = (e) => {
@@ -314,28 +354,28 @@ const C = (e) => {
314
354
  o && (n = o);
315
355
  }
316
356
  return n && (!T(n) || !C(n)) ? J(n) : n;
317
- }, Ze = (e) => {
357
+ }, lt = (e) => {
318
358
  var t;
319
359
  const n = e.target;
320
360
  let o;
321
361
  if (n instanceof HTMLTableCellElement) {
322
362
  const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
323
363
  if (l) {
324
- const r = l.lastElementChild.children[n.cellIndex];
325
- r && (o = r);
364
+ const a = l.lastElementChild.children[n.cellIndex];
365
+ a && (o = a);
326
366
  }
327
367
  } else if (n instanceof HTMLTableRowElement) {
328
368
  const l = n.parentElement;
329
369
  if (l) {
330
- const r = l.lastElementChild;
331
- r && (o = r);
370
+ const a = l.lastElementChild;
371
+ a && (o = a);
332
372
  }
333
373
  }
334
374
  return o && (!T(o) || !C(o)) ? j(o) : o;
335
- }, te = (e) => {
375
+ }, ne = (e) => {
336
376
  const t = e.target;
337
- return N(t);
338
- }, N = (e) => {
377
+ return Q(t);
378
+ }, Q = (e) => {
339
379
  var t;
340
380
  let n;
341
381
  if (e.previousElementSibling)
@@ -344,11 +384,11 @@ const C = (e) => {
344
384
  const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
345
385
  n = o == null ? void 0 : o.lastElementChild;
346
386
  }
347
- return n && (!T(n) || !C(n)) ? N(n) : n;
348
- }, ne = (e) => {
387
+ return n && (!T(n) || !C(n)) ? Q(n) : n;
388
+ }, oe = (e) => {
349
389
  const t = e.target;
350
- return Q(t);
351
- }, Q = (e) => {
390
+ return X(t);
391
+ }, X = (e) => {
352
392
  var t;
353
393
  let n;
354
394
  if (e.nextElementSibling)
@@ -357,158 +397,157 @@ const C = (e) => {
357
397
  const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
358
398
  n = o == null ? void 0 : o.firstElementChild;
359
399
  }
360
- return n && (!T(n) || !C(n)) ? Q(n) : n;
361
- }, oe = (e) => {
362
- const t = e.target.parentElement.firstElementChild;
363
- return t && (!T(t) || !C(t)) ? Q(t) : t;
400
+ return n && (!T(n) || !C(n)) ? X(n) : n;
364
401
  }, le = (e) => {
402
+ const t = e.target.parentElement.firstElementChild;
403
+ return t && (!T(t) || !C(t)) ? X(t) : t;
404
+ }, ae = (e) => {
365
405
  const t = e.target.parentElement.lastElementChild;
366
- return t && (!T(t) || !C(t)) ? N(t) : t;
367
- }, I = ["alt", "control", "shift", "meta"], et = {
406
+ return t && (!T(t) || !C(t)) ? Q(t) : t;
407
+ }, F = ["alt", "control", "shift", "meta"], at = {
368
408
  ArrowUp: "up",
369
409
  ArrowDown: "down",
370
410
  ArrowLeft: "left",
371
411
  ArrowRight: "right"
372
- }, ie = {
412
+ }, de = {
373
413
  "keydown.up": (e) => {
374
- const t = Z(e);
414
+ const t = ee(e);
375
415
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
376
416
  },
377
417
  "keydown.down": (e) => {
378
- const t = ee(e);
418
+ const t = te(e);
379
419
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
380
420
  },
381
421
  "keydown.left": (e) => {
382
- const t = te(e);
422
+ const t = ne(e);
383
423
  e.preventDefault(), e.stopPropagation(), t && t.focus();
384
424
  },
385
425
  "keydown.right": (e) => {
386
- const t = ne(e);
426
+ const t = oe(e);
387
427
  e.preventDefault(), e.stopPropagation(), t && t.focus();
388
428
  },
389
429
  "keydown.control.up": (e) => {
390
- const t = Xe(e);
430
+ const t = ot(e);
391
431
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
392
432
  },
393
433
  "keydown.control.down": (e) => {
394
- const t = Ze(e);
434
+ const t = lt(e);
395
435
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
396
436
  },
397
437
  "keydown.control.left": (e) => {
398
- const t = oe(e);
438
+ const t = le(e);
399
439
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
400
440
  },
401
441
  "keydown.control.right": (e) => {
402
- const t = le(e);
442
+ const t = ae(e);
403
443
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
404
444
  },
405
445
  "keydown.end": (e) => {
406
- const t = le(e);
446
+ const t = ae(e);
407
447
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
408
448
  },
409
449
  "keydown.enter": (e) => {
410
450
  if (e.target instanceof HTMLTableCellElement) {
411
451
  e.preventDefault(), e.stopPropagation();
412
- const t = ee(e);
452
+ const t = te(e);
413
453
  t && t.focus();
414
454
  }
415
455
  },
416
456
  "keydown.shift.enter": (e) => {
417
457
  if (e.target instanceof HTMLTableCellElement) {
418
458
  e.preventDefault(), e.stopPropagation();
419
- const t = Z(e);
459
+ const t = ee(e);
420
460
  t && t.focus();
421
461
  }
422
462
  },
423
463
  "keydown.home": (e) => {
424
- const t = oe(e);
464
+ const t = le(e);
425
465
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
426
466
  },
427
467
  "keydown.tab": (e) => {
428
- const t = ne(e);
468
+ const t = oe(e);
429
469
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
430
470
  },
431
471
  "keydown.shift.tab": (e) => {
432
- const t = te(e);
472
+ const t = ne(e);
433
473
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
434
474
  }
435
475
  };
436
- function tt(e) {
437
- const t = (s) => {
438
- let a = null;
439
- return s.parent && (typeof s.parent == "string" ? a = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? a = s.parent : a = s.parent.value), a;
440
- }, n = (s) => {
441
- const a = t(s);
442
- let i = [];
443
- if (typeof s.selectors == "string")
444
- i = a ? Array.from(a.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
445
- else if (Array.isArray(s.selectors))
446
- for (const u of s.selectors)
447
- u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
448
- else if (s.selectors instanceof HTMLElement)
449
- i.push(s.selectors);
450
- else if (Array.isArray(s.selectors.value))
451
- for (const u of s.selectors.value)
452
- u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
476
+ function st(e) {
477
+ const t = (r) => {
478
+ let s = null;
479
+ return r.parent && (typeof r.parent == "string" ? s = document.querySelector(r.parent) : r.parent instanceof HTMLElement ? s = r.parent : s = r.parent.value), s;
480
+ }, n = (r) => {
481
+ const s = t(r);
482
+ let c = [];
483
+ if (typeof r.selectors == "string")
484
+ c = s ? Array.from(s.querySelectorAll(r.selectors)) : Array.from(document.querySelectorAll(r.selectors));
485
+ else if (Array.isArray(r.selectors))
486
+ for (const u of r.selectors)
487
+ u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
488
+ else if (r.selectors instanceof HTMLElement)
489
+ c.push(r.selectors);
490
+ else if (Array.isArray(r.selectors.value))
491
+ for (const u of r.selectors.value)
492
+ u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
453
493
  else
454
- i.push(s.selectors.value);
455
- return i;
456
- }, o = (s) => {
457
- const a = t(s);
458
- let i = [];
459
- return s.selectors ? i = n(s) : a && (i = Array.from(a.children).filter((u) => T(u) && C(u))), i;
460
- }, l = (s) => (a) => {
461
- const i = et[a.key] || a.key.toLowerCase();
462
- if (I.includes(i))
463
- return;
464
- const u = s.handlers || ie;
494
+ c.push(r.selectors.value);
495
+ return c;
496
+ }, o = (r) => {
497
+ const s = t(r);
498
+ let c = [];
499
+ return r.selectors ? c = n(r) : s && (c = Array.from(s.children).filter((u) => T(u) && C(u))), c;
500
+ }, l = (r) => (s) => {
501
+ const c = at[s.key] || s.key.toLowerCase();
502
+ if (F.includes(c)) return;
503
+ const u = r.handlers || de;
465
504
  for (const d of Object.keys(u)) {
466
- const [p, ...h] = d.split(".");
467
- if (p === "keydown" && h.includes(i)) {
468
- const _ = u[d], b = h.filter((w) => I.includes(w)), V = I.some((w) => {
469
- const L = w.charAt(0).toUpperCase() + w.slice(1);
470
- return a.getModifierState(L);
505
+ const [p, ...v] = d.split(".");
506
+ if (p === "keydown" && v.includes(c)) {
507
+ const _ = u[d], b = v.filter((k) => F.includes(k)), S = F.some((k) => {
508
+ const L = k.charAt(0).toUpperCase() + k.slice(1);
509
+ return s.getModifierState(L);
471
510
  });
472
511
  if (b.length > 0) {
473
- if (V) {
474
- for (const w of I)
475
- if (h.includes(w)) {
476
- const L = w.charAt(0).toUpperCase() + w.slice(1);
477
- a.getModifierState(L) && _(a);
512
+ if (S) {
513
+ for (const k of F)
514
+ if (v.includes(k)) {
515
+ const L = k.charAt(0).toUpperCase() + k.slice(1);
516
+ s.getModifierState(L) && _(s);
478
517
  }
479
518
  }
480
519
  } else
481
- V || _(a);
520
+ S || _(s);
482
521
  }
483
522
  }
484
- }, r = [];
485
- Y(() => {
486
- for (const s of e) {
487
- const a = t(s), i = o(s), u = l(s), d = a ? [a] : i;
523
+ }, a = [];
524
+ W(() => {
525
+ for (const r of e) {
526
+ const s = t(r), c = o(r), u = l(r), d = s ? [s] : c;
488
527
  for (const p of d) {
489
- const { focused: h } = Ne(m(p)), _ = U(h, (b) => {
528
+ const { focused: v } = tt(f(p)), _ = B(v, (b) => {
490
529
  b ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
491
530
  });
492
- r.push(_);
531
+ a.push(_);
493
532
  }
494
533
  }
495
- }), ve(() => {
496
- for (const s of r)
497
- s();
534
+ }), _e(() => {
535
+ for (const r of a)
536
+ r();
498
537
  });
499
538
  }
500
- const nt = {
539
+ const rt = {
501
540
  colspan: "5",
502
541
  tabindex: -1
503
- }, ot = /* @__PURE__ */ c("tr", { class: "days-header" }, [
504
- /* @__PURE__ */ c("td", null, "M"),
505
- /* @__PURE__ */ c("td", null, "T"),
506
- /* @__PURE__ */ c("td", null, "W"),
507
- /* @__PURE__ */ c("td", null, "T"),
508
- /* @__PURE__ */ c("td", null, "F"),
509
- /* @__PURE__ */ c("td", null, "S"),
510
- /* @__PURE__ */ c("td", null, "S")
511
- ], -1), lt = ["onClick", "onKeydown"], at = 6, ae = 7, st = /* @__PURE__ */ E({
542
+ }, it = /* @__PURE__ */ i("tr", { class: "days-header" }, [
543
+ /* @__PURE__ */ i("td", null, "M"),
544
+ /* @__PURE__ */ i("td", null, "T"),
545
+ /* @__PURE__ */ i("td", null, "W"),
546
+ /* @__PURE__ */ i("td", null, "T"),
547
+ /* @__PURE__ */ i("td", null, "F"),
548
+ /* @__PURE__ */ i("td", null, "S"),
549
+ /* @__PURE__ */ i("td", null, "S")
550
+ ], -1), ut = ["onClick", "onKeydown"], ct = 6, se = 7, dt = /* @__PURE__ */ A({
512
551
  __name: "ADatePicker",
513
552
  props: {
514
553
  modelValue: { default: /* @__PURE__ */ new Date() },
@@ -516,46 +555,46 @@ const nt = {
516
555
  },
517
556
  emits: ["update:modelValue"],
518
557
  setup(e) {
519
- const t = $(e, "modelValue"), n = m(new Date(t.value)), o = m(n.value.getMonth()), l = m(n.value.getFullYear()), r = m([]), s = m(null);
520
- Y(async () => {
521
- a(), await ge();
522
- const f = document.getElementsByClassName("selectedDate");
523
- if (f.length > 0)
524
- f[0].focus();
558
+ const t = x(e, "modelValue"), n = f(new Date(t.value)), o = f(n.value.getMonth()), l = f(n.value.getFullYear()), a = f([]), r = f(null);
559
+ W(async () => {
560
+ s(), await we();
561
+ const m = document.getElementsByClassName("selectedDate");
562
+ if (m.length > 0)
563
+ m[0].focus();
525
564
  else {
526
565
  const y = document.getElementsByClassName("todaysDate");
527
566
  y.length > 0 && y[0].focus();
528
567
  }
529
568
  });
530
- const a = () => {
531
- r.value = [];
532
- const f = new Date(l.value, o.value, 1), y = f.getDay(), k = f.setDate(f.getDate() - y);
533
- for (const D of Array(43).keys())
534
- r.value.push(k + D * 864e5);
569
+ const s = () => {
570
+ a.value = [];
571
+ const m = new Date(l.value, o.value, 1), y = m.getDay(), w = m.setDate(m.getDate() - y);
572
+ for (const M of Array(43).keys())
573
+ a.value.push(w + M * 864e5);
535
574
  };
536
- U([o, l], a);
537
- const i = () => l.value -= 1, u = () => l.value += 1, d = () => {
538
- o.value == 0 ? (o.value = 11, i()) : o.value -= 1;
575
+ B([o, l], s);
576
+ const c = () => l.value -= 1, u = () => l.value += 1, d = () => {
577
+ o.value == 0 ? (o.value = 11, c()) : o.value -= 1;
539
578
  }, p = () => {
540
579
  o.value == 11 ? (o.value = 0, u()) : o.value += 1;
541
- }, h = (f) => {
580
+ }, v = (m) => {
542
581
  const y = /* @__PURE__ */ new Date();
543
582
  if (o.value === y.getMonth())
544
- return y.toDateString() === new Date(f).toDateString();
545
- }, _ = (f) => new Date(f).toDateString() === new Date(n.value).toDateString(), b = (f, y) => (f - 1) * ae + y, V = (f, y) => r.value[b(f, y)], w = (f) => {
546
- t.value = n.value = new Date(r.value[f]);
547
- }, L = H(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
583
+ return y.toDateString() === new Date(m).toDateString();
584
+ }, _ = (m) => new Date(m).toDateString() === new Date(n.value).toDateString(), b = (m, y) => (m - 1) * se + y, S = (m, y) => a.value[b(m, y)], k = (m) => {
585
+ t.value = n.value = new Date(a.value[m]);
586
+ }, L = $(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
548
587
  year: "numeric",
549
588
  month: "long"
550
589
  }));
551
- return tt([
590
+ return st([
552
591
  {
553
- parent: s,
592
+ parent: r,
554
593
  selectors: "td",
555
594
  handlers: {
556
- ...ie,
595
+ ...de,
557
596
  "keydown.pageup": d,
558
- "keydown.shift.pageup": i,
597
+ "keydown.shift.pageup": c,
559
598
  "keydown.pagedown": p,
560
599
  "keydown.shift.pagedown": u,
561
600
  // TODO: this is a hack to override the stonecrop enter handler;
@@ -565,57 +604,57 @@ const nt = {
565
604
  }
566
605
  }
567
606
  }
568
- ]), (f, y) => (v(), g("div", {
607
+ ]), (m, y) => (h(), g("div", {
569
608
  class: "adatepicker",
570
609
  tabindex: "0",
571
610
  ref_key: "adatepicker",
572
- ref: s
611
+ ref: r
573
612
  }, [
574
- c("table", null, [
575
- c("tr", null, [
576
- c("td", {
613
+ i("table", null, [
614
+ i("tr", null, [
615
+ i("td", {
577
616
  id: "previous-month-btn",
578
617
  onClick: d,
579
618
  tabindex: -1
580
619
  }, "<"),
581
- c("th", nt, A(L.value), 1),
582
- c("td", {
620
+ i("th", rt, E(L.value), 1),
621
+ i("td", {
583
622
  id: "next-month-btn",
584
623
  onClick: p,
585
624
  tabindex: -1
586
625
  }, ">")
587
626
  ]),
588
- ot,
589
- (v(), g(q, null, F(at, (k) => c("tr", { key: k }, [
590
- (v(), g(q, null, F(ae, (D) => c("td", {
627
+ it,
628
+ (h(), g(O, null, U(ct, (w) => i("tr", { key: w }, [
629
+ (h(), g(O, null, U(se, (M) => i("td", {
591
630
  ref_for: !0,
592
631
  ref: "celldate",
593
- key: b(k, D),
632
+ key: b(w, M),
594
633
  contenteditable: !1,
595
634
  spellcheck: !1,
596
635
  tabindex: 0,
597
- onClick: _e((X) => w(b(k, D)), ["prevent", "stop"]),
598
- onKeydown: B((X) => w(b(k, D)), ["enter"]),
599
- class: P({
600
- todaysDate: h(V(k, D)),
601
- selectedDate: _(V(k, D))
636
+ onClick: ke((Z) => k(b(w, M)), ["prevent", "stop"]),
637
+ onKeydown: q((Z) => k(b(w, M)), ["enter"]),
638
+ class: R({
639
+ todaysDate: v(S(w, M)),
640
+ selectedDate: _(S(w, M))
602
641
  })
603
- }, A(new Date(V(k, D)).getDate()), 43, lt)), 64))
642
+ }, E(new Date(S(w, M)).getDate()), 43, ut)), 64))
604
643
  ])), 64))
605
644
  ])
606
645
  ], 512));
607
646
  }
608
- }), rt = /* @__PURE__ */ E({
647
+ }), ft = /* @__PURE__ */ A({
609
648
  __name: "CollapseButton",
610
649
  props: {
611
650
  collapsed: { type: Boolean }
612
651
  },
613
652
  setup(e) {
614
- return (t, n) => (v(), g("button", {
615
- class: P(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
653
+ return (t, n) => (h(), g("button", {
654
+ class: R(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
616
655
  }, "×", 2));
617
656
  }
618
- }), ut = /* @__PURE__ */ O(rt, [["__scopeId", "data-v-6f1c1b45"]]), it = { class: "aform" }, ct = /* @__PURE__ */ E({
657
+ }), pt = /* @__PURE__ */ Y(ft, [["__scopeId", "data-v-6f1c1b45"]]), mt = { class: "aform" }, vt = /* @__PURE__ */ A({
619
658
  __name: "AForm",
620
659
  props: {
621
660
  modelValue: {},
@@ -624,35 +663,36 @@ const nt = {
624
663
  },
625
664
  emits: ["update:modelValue"],
626
665
  setup(e, { emit: t }) {
627
- const n = e, o = t, l = m(n.data || {}), r = (a) => {
628
- let i = {};
629
- for (const [u, d] of Object.entries(a))
630
- ["component", "fieldtype"].includes(u) || (i[u] = d), u === "rows" && d && d.length === 0 && (i.rows = l.value[a.fieldname]);
631
- return i;
632
- }, s = H({
633
- get: () => n.modelValue.map((a, i) => H({
666
+ const n = e, o = t, l = f(n.data || {}), a = (s) => {
667
+ let c = {};
668
+ for (const [u, d] of Object.entries(s))
669
+ ["component", "fieldtype"].includes(u) || (c[u] = d), u === "rows" && d && d.length === 0 && (c.rows = l.value[s.fieldname]);
670
+ return c;
671
+ }, r = $({
672
+ get: () => n.modelValue.map((s, c) => $({
634
673
  get() {
635
- return a.value;
674
+ return s.value;
636
675
  },
637
676
  set: (u) => {
638
- n.modelValue[i].value = u, o("update:modelValue", n.modelValue);
677
+ n.modelValue[c].value = u, o("update:modelValue", n.modelValue);
639
678
  }
640
679
  })),
641
680
  set: () => {
642
681
  }
643
682
  });
644
- return (a, i) => (v(), g("form", it, [
645
- (v(!0), g(q, null, F(a.modelValue, (u, d) => (v(), K(be(u.component), ke({
683
+ return (s, c) => (h(), g("form", mt, [
684
+ (h(!0), g(O, null, U(s.modelValue, (u, d) => (h(), G(De(u.component), Me({
646
685
  key: d,
647
686
  schema: u,
648
- modelValue: s.value[d].value,
649
- "onUpdate:modelValue": (p) => s.value[d].value = p,
687
+ modelValue: r.value[d].value,
688
+ "onUpdate:modelValue": (p) => r.value[d].value = p,
650
689
  data: l.value[u.fieldname],
651
- readonly: a.readonly
652
- }, r(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
690
+ readonly: s.readonly,
691
+ ref_for: !0
692
+ }, a(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
653
693
  ]));
654
694
  }
655
- }), ce = /* @__PURE__ */ O(ct, [["__scopeId", "data-v-88047a70"]]), dt = /* @__PURE__ */ E({
695
+ }), fe = /* @__PURE__ */ Y(vt, [["__scopeId", "data-v-dc1a868d"]]), ht = /* @__PURE__ */ A({
656
696
  __name: "AFieldset",
657
697
  props: {
658
698
  schema: {},
@@ -661,35 +701,35 @@ const nt = {
661
701
  data: {}
662
702
  },
663
703
  setup(e) {
664
- const t = e, n = m(t.data || []), o = m(!1), l = m(t.collapsible), r = m(t.schema);
665
- function s(a) {
666
- a.preventDefault(), l.value && (o.value = !o.value);
704
+ const t = e, n = f(t.data || []), o = f(!1), l = f(t.collapsible), a = f(t.schema);
705
+ function r(s) {
706
+ s.preventDefault(), l.value && (o.value = !o.value);
667
707
  }
668
- return (a, i) => (v(), g("fieldset", null, [
669
- c("legend", {
670
- onClick: s,
671
- onSubmit: s
708
+ return (s, c) => (h(), g("fieldset", null, [
709
+ i("legend", {
710
+ onClick: r,
711
+ onSubmit: r
672
712
  }, [
673
- we(A(a.label) + " ", 1),
674
- l.value ? (v(), K(ut, {
713
+ Ee(E(s.label) + " ", 1),
714
+ l.value ? (h(), G(pt, {
675
715
  key: 0,
676
716
  collapsed: o.value
677
- }, null, 8, ["collapsed"])) : De("", !0)
717
+ }, null, 8, ["collapsed"])) : ue("", !0)
678
718
  ], 32),
679
- Me(a.$slots, "default", { collapsed: o.value }, () => [
680
- M(Ee(ce, {
681
- modelValue: r.value,
682
- "onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
719
+ Ae(s.$slots, "default", { collapsed: o.value }, () => [
720
+ D(Ce(fe, {
721
+ modelValue: a.value,
722
+ "onUpdate:modelValue": c[0] || (c[0] = (u) => a.value = u),
683
723
  data: n.value
684
724
  }, null, 8, ["modelValue", "data"]), [
685
- [x, !o.value]
725
+ [H, !o.value]
686
726
  ])
687
727
  ], !0)
688
728
  ]));
689
729
  }
690
- }), ft = /* @__PURE__ */ O(dt, [["__scopeId", "data-v-0f671e32"]]), pt = { class: "aform__form-element" }, mt = ["for"], vt = ["id", "disabled", "required"], ht = ["innerHTML"], yt = /* @__PURE__ */ E({
730
+ }), _t = /* @__PURE__ */ Y(ht, [["__scopeId", "data-v-b89db0c0"]]), gt = { class: "aform__form-element" }, yt = ["for"], bt = ["id", "disabled", "required"], wt = ["innerHTML"], kt = /* @__PURE__ */ A({
691
731
  __name: "ANumericInput",
692
- props: /* @__PURE__ */ S({
732
+ props: /* @__PURE__ */ V({
693
733
  label: {},
694
734
  required: { type: Boolean },
695
735
  readonly: { type: Boolean },
@@ -701,31 +741,31 @@ const nt = {
701
741
  }),
702
742
  emits: ["update:modelValue"],
703
743
  setup(e) {
704
- const t = $(e, "modelValue");
705
- return (n, o) => (v(), g("div", pt, [
706
- c("label", {
744
+ const t = x(e, "modelValue");
745
+ return (n, o) => (h(), g("div", gt, [
746
+ i("label", {
707
747
  class: "aform__field-label",
708
748
  for: n.uuid
709
- }, A(n.label), 9, mt),
710
- M(c("input", {
749
+ }, E(n.label), 9, yt),
750
+ D(i("input", {
711
751
  class: "aform__input-field",
712
752
  "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
713
753
  type: "number",
714
754
  id: n.uuid,
715
755
  disabled: n.readonly,
716
756
  required: n.required
717
- }, null, 8, vt), [
718
- [G, t.value]
757
+ }, null, 8, bt), [
758
+ [I, t.value]
719
759
  ]),
720
- M(c("p", {
760
+ D(i("p", {
721
761
  class: "error",
722
762
  innerHTML: n.validation.errorMessage
723
- }, null, 8, ht), [
724
- [x, n.validation.errorMessage]
763
+ }, null, 8, wt), [
764
+ [H, n.validation.errorMessage]
725
765
  ])
726
766
  ]));
727
767
  }
728
- }), se = {
768
+ }), re = {
729
769
  date: "##/##/####",
730
770
  datetime: "####/##/## ##:##",
731
771
  time: "##:##",
@@ -733,28 +773,28 @@ const nt = {
733
773
  phone: "(###) ### - ####",
734
774
  card: "#### #### #### ####"
735
775
  };
736
- function gt(e) {
776
+ function Dt(e) {
737
777
  try {
738
778
  return Function(`"use strict";return (${e})`)();
739
779
  } catch {
740
780
  }
741
781
  }
742
- function _t(e) {
782
+ function Mt(e) {
743
783
  var n;
744
784
  let t = e.value;
745
785
  if (t) {
746
- const o = gt(t);
786
+ const o = Dt(t);
747
787
  if (o) {
748
788
  const l = e.instance.locale;
749
789
  t = o(l);
750
790
  }
751
791
  } else {
752
792
  const o = e.instance.schema, l = (n = o == null ? void 0 : o.fieldtype) == null ? void 0 : n.toLowerCase();
753
- l && se[l] && (t = se[l]);
793
+ l && re[l] && (t = re[l]);
754
794
  }
755
795
  return t;
756
796
  }
757
- function bt(e, t) {
797
+ function Et(e, t) {
758
798
  t || (t = "#");
759
799
  let n = e;
760
800
  const o = [t, "/", "-", "(", ")", " "];
@@ -762,32 +802,31 @@ function bt(e, t) {
762
802
  n = n.replaceAll(l, "");
763
803
  return n;
764
804
  }
765
- function kt(e, t, n) {
805
+ function At(e, t, n) {
766
806
  n || (n = "#");
767
807
  let o = t;
768
808
  for (const l of e) {
769
- const r = o.indexOf(n);
770
- if (r !== -1) {
771
- const s = o.substring(0, r), a = o.substring(r + 1);
772
- o = s + l + a;
809
+ const a = o.indexOf(n);
810
+ if (a !== -1) {
811
+ const r = o.substring(0, a), s = o.substring(a + 1);
812
+ o = r + l + s;
773
813
  }
774
814
  }
775
815
  return o.slice(0, t.length);
776
816
  }
777
- function wt(e, t) {
778
- const n = _t(t);
779
- if (!n)
780
- return;
781
- const o = "#", l = e.value, r = bt(l, o);
782
- if (r) {
783
- const s = kt(r, n, o);
784
- t.instance.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
817
+ function Ct(e, t) {
818
+ const n = Mt(t);
819
+ if (!n) return;
820
+ const o = "#", l = e.value, a = Et(l, o);
821
+ if (a) {
822
+ const r = At(a, n, o);
823
+ t.instance.maskFilled && (t.instance.maskFilled = !r.includes(o)), e.value = r;
785
824
  } else
786
825
  e.value = n;
787
826
  }
788
- const Dt = { class: "aform__form-element" }, Mt = ["for"], Et = ["id", "disabled", "maxlength", "required"], At = ["innerHTML"], Ct = /* @__PURE__ */ E({
827
+ const Tt = { class: "aform__form-element" }, St = ["for"], Lt = ["id", "disabled", "maxlength", "required"], $t = ["innerHTML"], Vt = /* @__PURE__ */ A({
789
828
  __name: "ATextInput",
790
- props: /* @__PURE__ */ S({
829
+ props: /* @__PURE__ */ V({
791
830
  schema: {},
792
831
  label: {},
793
832
  mask: {},
@@ -801,45 +840,129 @@ const Dt = { class: "aform__form-element" }, Mt = ["for"], Et = ["id", "disabled
801
840
  }),
802
841
  emits: ["update:modelValue"],
803
842
  setup(e) {
804
- const t = m(!0), n = $(e, "modelValue");
805
- return (o, l) => (v(), g("div", Dt, [
806
- c("label", {
843
+ const t = f(!0), n = x(e, "modelValue");
844
+ return (o, l) => (h(), g("div", Tt, [
845
+ i("label", {
807
846
  class: "aform__field-label",
808
847
  for: o.uuid
809
- }, A(o.label), 9, Mt),
810
- M(c("input", {
848
+ }, E(o.label), 9, St),
849
+ D(i("input", {
811
850
  class: "aform__input-field",
812
- "onUpdate:modelValue": l[0] || (l[0] = (r) => n.value = r),
851
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => n.value = a),
813
852
  id: o.uuid,
814
853
  disabled: o.readonly,
815
854
  maxlength: o.mask ? t.value && o.mask.length : void 0,
816
855
  required: o.required
817
- }, null, 8, Et), [
818
- [G, n.value],
819
- [re(wt), o.mask]
856
+ }, null, 8, Lt), [
857
+ [I, n.value],
858
+ [ie(Ct), o.mask]
820
859
  ]),
821
- M(c("p", {
860
+ D(i("p", {
822
861
  class: "error",
823
862
  innerHTML: o.validation.errorMessage
824
- }, null, 8, At), [
825
- [x, o.validation.errorMessage]
863
+ }, null, 8, $t), [
864
+ [H, o.validation.errorMessage]
865
+ ])
866
+ ]));
867
+ }
868
+ }), xt = { class: "login-container" }, Ht = { class: "account-container" }, It = { class: "account-header" }, Pt = { id: "account-title" }, Bt = { id: "account-subtitle" }, Ft = { class: "login-form-container" }, qt = { class: "login-form-email login-form-element" }, Rt = /* @__PURE__ */ i("label", {
869
+ id: "login-email",
870
+ for: "email",
871
+ class: "aform__field-label"
872
+ }, "Email", -1), Ot = ["disabled"], Ut = { class: "login-form-password login-form-element" }, Wt = /* @__PURE__ */ i("label", {
873
+ id: "login-password",
874
+ for: "password",
875
+ class: "login-label"
876
+ }, "Password", -1), Yt = ["disabled"], Kt = ["disabled"], zt = {
877
+ key: 0,
878
+ class: "material-symbols-outlined loading-icon"
879
+ }, Gt = /* @__PURE__ */ i("span", { id: "login-form-button" }, "Login", -1), Nt = /* @__PURE__ */ i("button", { class: "btn" }, [
880
+ /* @__PURE__ */ i("span", { id: "forgot-password-button" }, "Forgot password?")
881
+ ], -1), Jt = /* @__PURE__ */ A({
882
+ __name: "Login",
883
+ props: {
884
+ headerTitle: { default: "Login" },
885
+ headerSubtitle: { default: "Enter your email and password to login" }
886
+ },
887
+ emits: ["loginFailed", "loginSuccess"],
888
+ setup(e, { emit: t }) {
889
+ const n = t, o = f(""), l = f(""), a = f(!1), r = f(!1);
890
+ function s(c) {
891
+ if (c.preventDefault(), a.value = !0, r.value) {
892
+ a.value = !1, n("loginFailed");
893
+ return;
894
+ }
895
+ a.value = !1, n("loginSuccess");
896
+ }
897
+ return (c, u) => (h(), g("div", xt, [
898
+ i("div", null, [
899
+ i("div", Ht, [
900
+ i("div", It, [
901
+ i("h1", Pt, E(c.headerTitle), 1),
902
+ i("p", Bt, E(c.headerSubtitle), 1)
903
+ ]),
904
+ i("form", { onSubmit: s }, [
905
+ i("div", Ft, [
906
+ i("div", qt, [
907
+ Rt,
908
+ D(i("input", {
909
+ id: "email",
910
+ class: "aform__input-field",
911
+ name: "email",
912
+ placeholder: "name@example.com",
913
+ type: "email",
914
+ "onUpdate:modelValue": u[0] || (u[0] = (d) => o.value = d),
915
+ "auto-capitalize": "none",
916
+ "auto-complete": "email",
917
+ "auto-correct": "off",
918
+ disabled: a.value
919
+ }, null, 8, Ot), [
920
+ [I, o.value]
921
+ ])
922
+ ]),
923
+ i("div", Ut, [
924
+ Wt,
925
+ D(i("input", {
926
+ id: "password",
927
+ class: "login-field",
928
+ name: "password",
929
+ type: "password",
930
+ "onUpdate:modelValue": u[1] || (u[1] = (d) => l.value = d),
931
+ disabled: a.value
932
+ }, null, 8, Yt), [
933
+ [I, l.value]
934
+ ])
935
+ ]),
936
+ i("button", {
937
+ class: "btn",
938
+ onClick: s,
939
+ disabled: a.value || !o.value || !l.value
940
+ }, [
941
+ a.value ? (h(), g("span", zt, "progress_activity")) : ue("", !0),
942
+ Gt
943
+ ], 8, Kt)
944
+ ])
945
+ ], 32),
946
+ Nt
947
+ ])
826
948
  ])
827
949
  ]));
828
950
  }
829
951
  });
830
- function Vt(e) {
831
- e.component("ACheckbox", Se), e.component("ACombobox", xe), e.component("ADate", qe), e.component("ADropdown", We), e.component("ADatePicker", st), e.component("AFieldset", ft), e.component("AForm", ce), e.component("ANumericInput", yt), e.component("ATextInput", Ct);
952
+ function Qt(e) {
953
+ e.component("ACheckbox", xe), e.component("ACombobox", Ie), e.component("ADate", Re), e.component("ADropdown", Ke), e.component("ADatePicker", dt), e.component("AFieldset", _t), e.component("AForm", fe), e.component("ANumericInput", kt), e.component("ATextInput", Vt);
832
954
  }
833
955
  export {
834
- Se as ACheckbox,
835
- xe as AComboBox,
836
- qe as ADate,
837
- st as ADatePicker,
838
- We as ADropdown,
839
- ft as AFieldset,
840
- ce as AForm,
841
- yt as ANumericInput,
842
- Ct as ATextInput,
843
- Vt as install
956
+ xe as ACheckbox,
957
+ Ie as AComboBox,
958
+ Re as ADate,
959
+ dt as ADatePicker,
960
+ Ke as ADropdown,
961
+ _t as AFieldset,
962
+ fe as AForm,
963
+ kt as ANumericInput,
964
+ Vt as ATextInput,
965
+ Jt as Login,
966
+ Qt as install
844
967
  };
845
968
  //# sourceMappingURL=aform.js.map