@stonecrop/aform 0.2.22 → 0.2.24

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 A, mergeModels as $, useModel as x, openBlock as v, createElementBlock as g, createElementVNode as c, withDirectives as M, vModelCheckbox as de, toDisplayString as E, vShow as I, resolveComponent as pe, createBlock as K, withCtx as fe, ref as m, onMounted as Y, onUnmounted as me, normalizeClass as q, withKeys as P, vModelText as G, Fragment as F, renderList as R, watch as O, onBeforeUnmount as ve, computed as H, unref as re, getCurrentScope as he, onScopeDispose as ye, nextTick as ge, withModifiers as be, resolveDynamicComponent as ke, mergeProps as _e, createTextVNode as we, createCommentVNode as De, renderSlot as Me, createVNode as Ee } from "vue";
2
- const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te = { id: "custom-checkbox" }, Ve = ["for"], Le = ["innerHTML"], Se = /* @__PURE__ */ A({
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({
3
3
  __name: "ACheckbox",
4
- props: /* @__PURE__ */ $({
4
+ props: /* @__PURE__ */ S({
5
5
  label: {},
6
6
  required: { type: Boolean },
7
7
  readOnly: { type: Boolean },
@@ -13,62 +13,57 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
13
13
  }),
14
14
  emits: ["update:modelValue"],
15
15
  setup(e) {
16
- const t = x(e, "modelValue");
17
- return (n, o) => (v(), g("div", null, [
18
- c("label", Ae, [
16
+ const t = $(e, "modelValue");
17
+ return (n, o) => (v(), g("div", Ae, [
18
+ c("label", {
19
+ class: "aform__field-label",
20
+ for: n.uuid
21
+ }, A(n.label), 9, Ce),
22
+ c("span", Te, [
19
23
  M(c("input", {
20
24
  "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
21
25
  type: "checkbox",
22
26
  id: n.uuid,
23
- class: "checkbox",
27
+ class: "aform__checkbox",
24
28
  readonly: n.readOnly,
25
29
  required: n.required
26
- }, null, 8, Ce), [
30
+ }, null, 8, Ve), [
27
31
  [de, t.value]
28
- ]),
29
- c("span", Te, E(t.value), 1)
32
+ ])
30
33
  ]),
31
- c("label", {
32
- for: n.uuid,
33
- id: "checkbox-label"
34
- }, E(n.label), 9, Ve),
35
34
  M(c("p", {
35
+ class: "error",
36
36
  innerHTML: n.validation.errorMessage
37
37
  }, null, 8, Le), [
38
- [I, n.validation.errorMessage]
38
+ [x, n.validation.errorMessage]
39
39
  ])
40
40
  ]));
41
41
  }
42
- }), S = (e, t) => {
43
- const n = e.__vccOpts || e;
44
- for (const [o, l] of t)
45
- n[o] = l;
46
- return n;
47
- }, $e = /* @__PURE__ */ S(Se, [["__scopeId", "data-v-5093f1cb"]]), xe = /* @__PURE__ */ c("div", null, [
42
+ }), $e = /* @__PURE__ */ c("div", null, [
48
43
  /* @__PURE__ */ c("input", { type: "text" }),
49
44
  /* @__PURE__ */ c("input", { type: "text" }),
50
45
  /* @__PURE__ */ c("input", { type: "text" })
51
- ], -1), Ie = /* @__PURE__ */ A({
46
+ ], -1), xe = /* @__PURE__ */ E({
52
47
  __name: "AComboBox",
53
48
  props: ["event", "cellData", "tableID"],
54
49
  setup(e) {
55
50
  return (t, n) => {
56
- const o = pe("ATableModal");
51
+ const o = fe("ATableModal");
57
52
  return v(), K(o, {
58
53
  event: e.event,
59
54
  cellData: e.cellData,
60
55
  class: "amodal"
61
56
  }, {
62
- default: fe(() => [
63
- xe
57
+ default: pe(() => [
58
+ $e
64
59
  ]),
65
60
  _: 1
66
61
  }, 8, ["event", "cellData"]);
67
62
  };
68
63
  }
69
- }), He = ["id", "disabled", "required", "value"], Be = ["for"], Pe = ["innerHTML"], qe = /* @__PURE__ */ A({
64
+ }), He = ["id", "disabled", "required", "value"], Ie = ["for"], Be = ["innerHTML"], Pe = /* @__PURE__ */ E({
70
65
  __name: "ADate",
71
- props: /* @__PURE__ */ $({
66
+ props: /* @__PURE__ */ S({
72
67
  label: { default: "Date" },
73
68
  required: { type: Boolean },
74
69
  readonly: { type: Boolean },
@@ -80,7 +75,7 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
80
75
  }),
81
76
  emits: ["update:modelValue"],
82
77
  setup(e) {
83
- const t = x(e, "modelValue"), n = m(null), o = () => {
78
+ const t = $(e, "modelValue"), n = m(null), o = () => {
84
79
  n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
85
80
  };
86
81
  return (l, r) => (v(), g("div", null, [
@@ -94,23 +89,28 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
94
89
  value: t.value,
95
90
  onClick: o
96
91
  }, null, 8, He),
97
- c("label", { for: l.uuid }, E(l.label), 9, Be),
92
+ c("label", { for: l.uuid }, A(l.label), 9, Ie),
98
93
  M(c("p", {
99
94
  innerHTML: l.validation.errorMessage
100
- }, null, 8, Pe), [
101
- [I, l.validation.errorMessage]
95
+ }, null, 8, Be), [
96
+ [x, l.validation.errorMessage]
102
97
  ])
103
98
  ]));
104
99
  }
105
- }), Fe = /* @__PURE__ */ S(qe, [["__scopeId", "data-v-69d0f23d"]]), Re = { class: "input-wrapper" }, Ue = {
100
+ }), O = (e, t) => {
101
+ const n = e.__vccOpts || e;
102
+ for (const [o, l] of t)
103
+ n[o] = l;
104
+ return n;
105
+ }, qe = /* @__PURE__ */ O(Pe, [["__scopeId", "data-v-69d0f23d"]]), Fe = { class: "input-wrapper" }, Re = {
106
106
  id: "autocomplete-results",
107
107
  class: "autocomplete-results"
108
- }, Oe = {
108
+ }, Ue = {
109
109
  key: 0,
110
110
  class: "loading autocomplete-result"
111
- }, We = ["onClick"], Ke = /* @__PURE__ */ A({
111
+ }, Oe = ["onClick"], We = /* @__PURE__ */ E({
112
112
  __name: "ADropdown",
113
- props: /* @__PURE__ */ $({
113
+ props: /* @__PURE__ */ S({
114
114
  label: {},
115
115
  items: {},
116
116
  isAsync: { type: Boolean }
@@ -118,104 +118,104 @@ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te
118
118
  modelValue: {},
119
119
  modelModifiers: {}
120
120
  }),
121
- emits: /* @__PURE__ */ $(["filterChanged"], ["update:modelValue"]),
121
+ emits: /* @__PURE__ */ S(["filterChanged"], ["update:modelValue"]),
122
122
  setup(e, { emit: t }) {
123
- const n = e, o = t, l = m(n.items), r = x(e, "modelValue"), s = m(!1), a = m(0), i = m(!1), u = m(null);
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
124
  Y(() => {
125
- document.addEventListener("click", b), f();
125
+ document.addEventListener("click", _), p();
126
126
  }), me(() => {
127
- document.removeEventListener("click", b);
127
+ document.removeEventListener("click", _);
128
128
  });
129
- const d = (p) => {
130
- r.value = p, k();
131
- }, f = () => {
132
- r.value ? l.value = n.items.filter((p) => p.toLowerCase().indexOf(r.value.toLowerCase()) > -1) : l.value = n.items;
129
+ const d = (f) => {
130
+ r.value = f, b();
131
+ }, p = () => {
132
+ r.value ? l.value = n.items.filter((f) => f.toLowerCase().indexOf(r.value.toLowerCase()) > -1) : l.value = n.items;
133
133
  }, h = () => {
134
- i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) : f();
135
- }, b = (p) => {
136
- k(), a.value = 0;
137
- }, k = () => {
134
+ i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) : p();
135
+ }, _ = (f) => {
136
+ b(), a.value = 0;
137
+ }, b = () => {
138
138
  i.value = !1, n.items.includes(r.value) || (r.value = "");
139
139
  }, V = () => {
140
140
  a.value < l.value.length && (a.value = a.value + 1);
141
141
  }, w = () => {
142
142
  a.value > 0 && (a.value = a.value - 1);
143
143
  }, L = () => {
144
- r.value = l.value[a.value], k(), a.value = 0;
144
+ r.value = l.value[a.value], b(), a.value = 0;
145
145
  };
146
- return (p, y) => (v(), g("div", {
147
- class: q(["autocomplete", { isOpen: i.value }])
146
+ return (f, y) => (v(), g("div", {
147
+ class: P(["autocomplete", { isOpen: i.value }])
148
148
  }, [
149
- c("div", Re, [
149
+ c("div", Fe, [
150
150
  M(c("input", {
151
151
  ref_key: "mopInput",
152
152
  ref: u,
153
153
  type: "text",
154
154
  onInput: h,
155
155
  onFocus: h,
156
- "onUpdate:modelValue": y[0] || (y[0] = (_) => r.value = _),
156
+ "onUpdate:modelValue": y[0] || (y[0] = (k) => r.value = k),
157
157
  onKeydown: [
158
- P(V, ["down"]),
159
- P(w, ["up"]),
160
- P(L, ["enter"])
158
+ B(V, ["down"]),
159
+ B(w, ["up"]),
160
+ B(L, ["enter"])
161
161
  ]
162
162
  }, null, 544), [
163
163
  [G, r.value]
164
164
  ]),
165
- M(c("ul", Ue, [
166
- s.value ? (v(), g("li", Oe, "Loading results...")) : (v(!0), g(F, { key: 1 }, R(l.value, (_, D) => (v(), g("li", {
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
167
  key: D,
168
- onClick: (X) => d(_),
169
- class: q(["autocomplete-result", { "is-active": D === a.value }])
170
- }, E(_), 11, We))), 128))
168
+ onClick: (X) => d(k),
169
+ class: P(["autocomplete-result", { "is-active": D === a.value }])
170
+ }, A(k), 11, Oe))), 128))
171
171
  ], 512), [
172
- [I, i.value]
172
+ [x, i.value]
173
173
  ]),
174
- c("label", null, E(p.label), 1)
174
+ c("label", null, A(f.label), 1)
175
175
  ])
176
176
  ], 2));
177
177
  }
178
178
  });
179
- function Ye(e) {
179
+ function Ke(e) {
180
180
  return he() ? (ye(e), !0) : !1;
181
181
  }
182
182
  function ue(e) {
183
183
  return typeof e == "function" ? e() : re(e);
184
184
  }
185
- const Ge = typeof window < "u" && typeof document < "u";
185
+ const Ye = typeof window < "u" && typeof document < "u";
186
186
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
187
- const ze = Object.prototype.toString, je = (e) => ze.call(e) === "[object Object]", Je = () => {
187
+ const Ge = Object.prototype.toString, ze = (e) => Ge.call(e) === "[object Object]", je = () => {
188
188
  };
189
- function U(e) {
189
+ function R(e) {
190
190
  var t;
191
191
  const n = ue(e);
192
192
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
193
193
  }
194
- const z = Ge ? window : void 0;
194
+ const z = Ye ? window : void 0;
195
195
  function W(...e) {
196
196
  let t, n, o, l;
197
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;
198
+ return je;
199
199
  Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
200
200
  const r = [], s = () => {
201
201
  r.forEach((d) => d()), r.length = 0;
202
- }, a = (d, f, h, b) => (d.addEventListener(f, h, b), () => d.removeEventListener(f, h, b)), i = O(
203
- () => [U(t), ue(l)],
204
- ([d, f]) => {
202
+ }, a = (d, p, h, _) => (d.addEventListener(p, h, _), () => d.removeEventListener(p, h, _)), i = U(
203
+ () => [R(t), ue(l)],
204
+ ([d, p]) => {
205
205
  if (s(), !d)
206
206
  return;
207
- const h = je(f) ? { ...f } : f;
207
+ const h = ze(p) ? { ...p } : p;
208
208
  r.push(
209
- ...n.flatMap((b) => o.map((k) => a(d, b, k, h)))
209
+ ...n.flatMap((_) => o.map((b) => a(d, _, b, h)))
210
210
  );
211
211
  },
212
212
  { immediate: !0, flush: "post" }
213
213
  ), u = () => {
214
214
  i(), s();
215
215
  };
216
- return Ye(u), u;
216
+ return Ke(u), u;
217
217
  }
218
- function Ne(e = {}) {
218
+ function Je(e = {}) {
219
219
  var t;
220
220
  const {
221
221
  window: n = z,
@@ -234,15 +234,15 @@ function Ne(e = {}) {
234
234
  i.relatedTarget === null && a();
235
235
  }, !0), W(n, "focus", a, !0)), a(), s;
236
236
  }
237
- function Qe(e, t = {}) {
238
- const n = Ne(t), o = H(() => U(e));
237
+ function Ne(e, t = {}) {
238
+ const n = Je(t), o = H(() => R(e));
239
239
  return { focused: H(() => o.value && n.value ? o.value.contains(n.value) : !1) };
240
240
  }
241
- function Xe(e, { window: t = z, scrollTarget: n } = {}) {
241
+ function Qe(e, { window: t = z, scrollTarget: n } = {}) {
242
242
  const o = m(!1), l = () => {
243
243
  if (!t)
244
244
  return;
245
- const r = t.document, s = U(e);
245
+ const r = t.document, s = R(e);
246
246
  if (!s)
247
247
  o.value = !1;
248
248
  else {
@@ -250,8 +250,8 @@ function Xe(e, { window: t = z, scrollTarget: n } = {}) {
250
250
  o.value = a.top <= (t.innerHeight || r.documentElement.clientHeight) && a.left <= (t.innerWidth || r.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
251
251
  }
252
252
  };
253
- return O(
254
- () => U(e),
253
+ return U(
254
+ () => R(e),
255
255
  () => l(),
256
256
  { immediate: !0, flush: "post" }
257
257
  ), t && W(n || t, "scroll", l, {
@@ -260,7 +260,7 @@ function Xe(e, { window: t = z, scrollTarget: n } = {}) {
260
260
  }), o;
261
261
  }
262
262
  const C = (e) => {
263
- let t = Xe(e).value;
263
+ let t = Qe(e).value;
264
264
  return t = t && e.offsetHeight > 0, t;
265
265
  }, T = (e) => e.tabIndex >= 0, Z = (e) => {
266
266
  const t = e.target;
@@ -279,7 +279,7 @@ const C = (e) => {
279
279
  o && (n = o);
280
280
  }
281
281
  return n && (!T(n) || !C(n)) ? j(n) : n;
282
- }, Ze = (e) => {
282
+ }, Xe = (e) => {
283
283
  var t;
284
284
  const n = e.target;
285
285
  let o;
@@ -314,7 +314,7 @@ const C = (e) => {
314
314
  o && (n = o);
315
315
  }
316
316
  return n && (!T(n) || !C(n)) ? J(n) : n;
317
- }, et = (e) => {
317
+ }, Ze = (e) => {
318
318
  var t;
319
319
  const n = e.target;
320
320
  let o;
@@ -364,7 +364,7 @@ const C = (e) => {
364
364
  }, le = (e) => {
365
365
  const t = e.target.parentElement.lastElementChild;
366
366
  return t && (!T(t) || !C(t)) ? N(t) : t;
367
- }, B = ["alt", "control", "shift", "meta"], tt = {
367
+ }, I = ["alt", "control", "shift", "meta"], et = {
368
368
  ArrowUp: "up",
369
369
  ArrowDown: "down",
370
370
  ArrowLeft: "left",
@@ -387,11 +387,11 @@ const C = (e) => {
387
387
  e.preventDefault(), e.stopPropagation(), t && t.focus();
388
388
  },
389
389
  "keydown.control.up": (e) => {
390
- const t = Ze(e);
390
+ const t = Xe(e);
391
391
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
392
392
  },
393
393
  "keydown.control.down": (e) => {
394
- const t = et(e);
394
+ const t = Ze(e);
395
395
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
396
396
  },
397
397
  "keydown.control.left": (e) => {
@@ -433,7 +433,7 @@ const C = (e) => {
433
433
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
434
434
  }
435
435
  };
436
- function nt(e) {
436
+ function tt(e) {
437
437
  const t = (s) => {
438
438
  let a = null;
439
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;
@@ -458,38 +458,38 @@ function nt(e) {
458
458
  let i = [];
459
459
  return s.selectors ? i = n(s) : a && (i = Array.from(a.children).filter((u) => T(u) && C(u))), i;
460
460
  }, l = (s) => (a) => {
461
- const i = tt[a.key] || a.key.toLowerCase();
462
- if (B.includes(i))
461
+ const i = et[a.key] || a.key.toLowerCase();
462
+ if (I.includes(i))
463
463
  return;
464
464
  const u = s.handlers || ie;
465
465
  for (const d of Object.keys(u)) {
466
- const [f, ...h] = d.split(".");
467
- if (f === "keydown" && h.includes(i)) {
468
- const b = u[d], k = h.filter((w) => B.includes(w)), V = B.some((w) => {
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
469
  const L = w.charAt(0).toUpperCase() + w.slice(1);
470
470
  return a.getModifierState(L);
471
471
  });
472
- if (k.length > 0) {
472
+ if (b.length > 0) {
473
473
  if (V) {
474
- for (const w of B)
474
+ for (const w of I)
475
475
  if (h.includes(w)) {
476
476
  const L = w.charAt(0).toUpperCase() + w.slice(1);
477
- a.getModifierState(L) && b(a);
477
+ a.getModifierState(L) && _(a);
478
478
  }
479
479
  }
480
480
  } else
481
- V || b(a);
481
+ V || _(a);
482
482
  }
483
483
  }
484
484
  }, r = [];
485
485
  Y(() => {
486
486
  for (const s of e) {
487
487
  const a = t(s), i = o(s), u = l(s), d = a ? [a] : i;
488
- for (const f of d) {
489
- const { focused: h } = Qe(m(f)), b = O(h, (k) => {
490
- k ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
488
+ for (const p of d) {
489
+ const { focused: h } = Ne(m(p)), _ = U(h, (b) => {
490
+ b ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
491
491
  });
492
- r.push(b);
492
+ r.push(_);
493
493
  }
494
494
  }
495
495
  }), ve(() => {
@@ -497,10 +497,10 @@ function nt(e) {
497
497
  s();
498
498
  });
499
499
  }
500
- const ot = {
500
+ const nt = {
501
501
  colspan: "5",
502
502
  tabindex: -1
503
- }, lt = /* @__PURE__ */ c("tr", { class: "days-header" }, [
503
+ }, ot = /* @__PURE__ */ c("tr", { class: "days-header" }, [
504
504
  /* @__PURE__ */ c("td", null, "M"),
505
505
  /* @__PURE__ */ c("td", null, "T"),
506
506
  /* @__PURE__ */ c("td", null, "W"),
@@ -508,7 +508,7 @@ const ot = {
508
508
  /* @__PURE__ */ c("td", null, "F"),
509
509
  /* @__PURE__ */ c("td", null, "S"),
510
510
  /* @__PURE__ */ c("td", null, "S")
511
- ], -1), at = ["onClick", "onKeydown"], st = 6, ae = 7, rt = /* @__PURE__ */ A({
511
+ ], -1), lt = ["onClick", "onKeydown"], at = 6, ae = 7, st = /* @__PURE__ */ E({
512
512
  __name: "ADatePicker",
513
513
  props: {
514
514
  modelValue: { default: /* @__PURE__ */ new Date() },
@@ -516,12 +516,12 @@ const ot = {
516
516
  },
517
517
  emits: ["update:modelValue"],
518
518
  setup(e) {
519
- const t = x(e, "modelValue"), n = m(new Date(t.value)), o = m(n.value.getMonth()), l = m(n.value.getFullYear()), r = m([]), s = m(null);
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
520
  Y(async () => {
521
521
  a(), await ge();
522
- const p = document.getElementsByClassName("selectedDate");
523
- if (p.length > 0)
524
- p[0].focus();
522
+ const f = document.getElementsByClassName("selectedDate");
523
+ if (f.length > 0)
524
+ f[0].focus();
525
525
  else {
526
526
  const y = document.getElementsByClassName("todaysDate");
527
527
  y.length > 0 && y[0].focus();
@@ -529,26 +529,26 @@ const ot = {
529
529
  });
530
530
  const a = () => {
531
531
  r.value = [];
532
- const p = new Date(l.value, o.value, 1), y = p.getDay(), _ = p.setDate(p.getDate() - y);
532
+ const f = new Date(l.value, o.value, 1), y = f.getDay(), k = f.setDate(f.getDate() - y);
533
533
  for (const D of Array(43).keys())
534
- r.value.push(_ + D * 864e5);
534
+ r.value.push(k + D * 864e5);
535
535
  };
536
- O([o, l], a);
536
+ U([o, l], a);
537
537
  const i = () => l.value -= 1, u = () => l.value += 1, d = () => {
538
538
  o.value == 0 ? (o.value = 11, i()) : o.value -= 1;
539
- }, f = () => {
539
+ }, p = () => {
540
540
  o.value == 11 ? (o.value = 0, u()) : o.value += 1;
541
- }, h = (p) => {
541
+ }, h = (f) => {
542
542
  const y = /* @__PURE__ */ new Date();
543
543
  if (o.value === y.getMonth())
544
- return y.toDateString() === new Date(p).toDateString();
545
- }, b = (p) => new Date(p).toDateString() === new Date(n.value).toDateString(), k = (p, y) => (p - 1) * ae + y, V = (p, y) => r.value[k(p, y)], w = (p) => {
546
- t.value = n.value = new Date(r.value[p]);
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
547
  }, L = H(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
548
548
  year: "numeric",
549
549
  month: "long"
550
550
  }));
551
- return nt([
551
+ return tt([
552
552
  {
553
553
  parent: s,
554
554
  selectors: "td",
@@ -556,7 +556,7 @@ const ot = {
556
556
  ...ie,
557
557
  "keydown.pageup": d,
558
558
  "keydown.shift.pageup": i,
559
- "keydown.pagedown": f,
559
+ "keydown.pagedown": p,
560
560
  "keydown.shift.pagedown": u,
561
561
  // TODO: this is a hack to override the stonecrop enter handler;
562
562
  // store context inside the component so that handlers can be setup consistently
@@ -565,7 +565,7 @@ const ot = {
565
565
  }
566
566
  }
567
567
  }
568
- ]), (p, y) => (v(), g("div", {
568
+ ]), (f, y) => (v(), g("div", {
569
569
  class: "adatepicker",
570
570
  tabindex: "0",
571
571
  ref_key: "adatepicker",
@@ -578,44 +578,44 @@ const ot = {
578
578
  onClick: d,
579
579
  tabindex: -1
580
580
  }, "<"),
581
- c("th", ot, E(L.value), 1),
581
+ c("th", nt, A(L.value), 1),
582
582
  c("td", {
583
583
  id: "next-month-btn",
584
- onClick: f,
584
+ onClick: p,
585
585
  tabindex: -1
586
586
  }, ">")
587
587
  ]),
588
- lt,
589
- (v(), g(F, null, R(st, (_) => c("tr", { key: _ }, [
590
- (v(), g(F, null, R(ae, (D) => c("td", {
588
+ ot,
589
+ (v(), g(q, null, F(at, (k) => c("tr", { key: k }, [
590
+ (v(), g(q, null, F(ae, (D) => c("td", {
591
591
  ref_for: !0,
592
592
  ref: "celldate",
593
- key: k(_, D),
593
+ key: b(k, D),
594
594
  contenteditable: !1,
595
595
  spellcheck: !1,
596
596
  tabindex: 0,
597
- onClick: be((X) => w(k(_, D)), ["prevent", "stop"]),
598
- onKeydown: P((X) => w(k(_, D)), ["enter"]),
599
- class: q({
600
- todaysDate: h(V(_, D)),
601
- selectedDate: b(V(_, D))
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))
602
602
  })
603
- }, E(new Date(V(_, D)).getDate()), 43, at)), 64))
603
+ }, A(new Date(V(k, D)).getDate()), 43, lt)), 64))
604
604
  ])), 64))
605
605
  ])
606
606
  ], 512));
607
607
  }
608
- }), ut = /* @__PURE__ */ A({
608
+ }), rt = /* @__PURE__ */ E({
609
609
  __name: "CollapseButton",
610
610
  props: {
611
611
  collapsed: { type: Boolean }
612
612
  },
613
613
  setup(e) {
614
614
  return (t, n) => (v(), g("button", {
615
- class: q(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
615
+ class: P(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
616
616
  }, "×", 2));
617
617
  }
618
- }), it = /* @__PURE__ */ S(ut, [["__scopeId", "data-v-6f1c1b45"]]), ct = /* @__PURE__ */ A({
618
+ }), ut = /* @__PURE__ */ O(rt, [["__scopeId", "data-v-6f1c1b45"]]), it = { class: "aform" }, ct = /* @__PURE__ */ E({
619
619
  __name: "AForm",
620
620
  props: {
621
621
  modelValue: {},
@@ -641,18 +641,18 @@ const ot = {
641
641
  set: () => {
642
642
  }
643
643
  });
644
- return (a, i) => (v(), g("form", null, [
645
- (v(!0), g(F, null, R(a.modelValue, (u, d) => (v(), K(ke(u.component), _e({
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({
646
646
  key: d,
647
647
  schema: u,
648
648
  modelValue: s.value[d].value,
649
- "onUpdate:modelValue": (f) => s.value[d].value = f,
649
+ "onUpdate:modelValue": (p) => s.value[d].value = p,
650
650
  data: l.value[u.fieldname],
651
651
  readonly: a.readonly
652
652
  }, r(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
653
653
  ]));
654
654
  }
655
- }), ce = /* @__PURE__ */ S(ct, [["__scopeId", "data-v-74d66cf2"]]), dt = /* @__PURE__ */ A({
655
+ }), ce = /* @__PURE__ */ O(ct, [["__scopeId", "data-v-88047a70"]]), dt = /* @__PURE__ */ E({
656
656
  __name: "AFieldset",
657
657
  props: {
658
658
  schema: {},
@@ -670,8 +670,8 @@ const ot = {
670
670
  onClick: s,
671
671
  onSubmit: s
672
672
  }, [
673
- we(E(a.label) + " ", 1),
674
- l.value ? (v(), K(it, {
673
+ we(A(a.label) + " ", 1),
674
+ l.value ? (v(), K(ut, {
675
675
  key: 0,
676
676
  collapsed: o.value
677
677
  }, null, 8, ["collapsed"])) : De("", !0)
@@ -682,14 +682,14 @@ const ot = {
682
682
  "onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
683
683
  data: n.value
684
684
  }, null, 8, ["modelValue", "data"]), [
685
- [I, !o.value]
685
+ [x, !o.value]
686
686
  ])
687
687
  ], !0)
688
688
  ]));
689
689
  }
690
- }), pt = /* @__PURE__ */ S(dt, [["__scopeId", "data-v-0f671e32"]]), ft = ["id", "disabled", "required"], mt = ["for"], vt = ["innerHTML"], ht = /* @__PURE__ */ A({
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({
691
691
  __name: "ANumericInput",
692
- props: /* @__PURE__ */ $({
692
+ props: /* @__PURE__ */ S({
693
693
  label: {},
694
694
  required: { type: Boolean },
695
695
  readonly: { type: Boolean },
@@ -701,26 +701,31 @@ const ot = {
701
701
  }),
702
702
  emits: ["update:modelValue"],
703
703
  setup(e) {
704
- const t = x(e, "modelValue");
705
- return (n, o) => (v(), g("div", null, [
704
+ const t = $(e, "modelValue");
705
+ return (n, o) => (v(), g("div", pt, [
706
+ c("label", {
707
+ class: "aform__field-label",
708
+ for: n.uuid
709
+ }, A(n.label), 9, mt),
706
710
  M(c("input", {
711
+ class: "aform__input-field",
707
712
  "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
708
713
  type: "number",
709
714
  id: n.uuid,
710
715
  disabled: n.readonly,
711
716
  required: n.required
712
- }, null, 8, ft), [
717
+ }, null, 8, vt), [
713
718
  [G, t.value]
714
719
  ]),
715
- c("label", { for: n.uuid }, E(n.label), 9, mt),
716
720
  M(c("p", {
721
+ class: "error",
717
722
  innerHTML: n.validation.errorMessage
718
- }, null, 8, vt), [
719
- [I, n.validation.errorMessage]
723
+ }, null, 8, ht), [
724
+ [x, n.validation.errorMessage]
720
725
  ])
721
726
  ]));
722
727
  }
723
- }), yt = /* @__PURE__ */ S(ht, [["__scopeId", "data-v-02907cd6"]]), se = {
728
+ }), se = {
724
729
  date: "##/##/####",
725
730
  datetime: "####/##/## ##:##",
726
731
  time: "##:##",
@@ -734,7 +739,7 @@ function gt(e) {
734
739
  } catch {
735
740
  }
736
741
  }
737
- function bt(e) {
742
+ function _t(e) {
738
743
  var n;
739
744
  let t = e.value;
740
745
  if (t) {
@@ -749,7 +754,7 @@ function bt(e) {
749
754
  }
750
755
  return t;
751
756
  }
752
- function kt(e, t) {
757
+ function bt(e, t) {
753
758
  t || (t = "#");
754
759
  let n = e;
755
760
  const o = [t, "/", "-", "(", ")", " "];
@@ -757,7 +762,7 @@ function kt(e, t) {
757
762
  n = n.replaceAll(l, "");
758
763
  return n;
759
764
  }
760
- function _t(e, t, n) {
765
+ function kt(e, t, n) {
761
766
  n || (n = "#");
762
767
  let o = t;
763
768
  for (const l of e) {
@@ -770,19 +775,19 @@ function _t(e, t, n) {
770
775
  return o.slice(0, t.length);
771
776
  }
772
777
  function wt(e, t) {
773
- const n = bt(t);
778
+ const n = _t(t);
774
779
  if (!n)
775
780
  return;
776
- const o = "#", l = e.value, r = kt(l, o);
781
+ const o = "#", l = e.value, r = bt(l, o);
777
782
  if (r) {
778
- const s = _t(r, n, o);
783
+ const s = kt(r, n, o);
779
784
  t.instance.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
780
785
  } else
781
786
  e.value = n;
782
787
  }
783
- const Dt = ["id", "disabled", "maxlength", "required"], Mt = ["for"], Et = ["innerHTML"], At = /* @__PURE__ */ A({
788
+ const Dt = { class: "aform__form-element" }, Mt = ["for"], Et = ["id", "disabled", "maxlength", "required"], At = ["innerHTML"], Ct = /* @__PURE__ */ E({
784
789
  __name: "ATextInput",
785
- props: /* @__PURE__ */ $({
790
+ props: /* @__PURE__ */ S({
786
791
  schema: {},
787
792
  label: {},
788
793
  mask: {},
@@ -796,37 +801,42 @@ const Dt = ["id", "disabled", "maxlength", "required"], Mt = ["for"], Et = ["inn
796
801
  }),
797
802
  emits: ["update:modelValue"],
798
803
  setup(e) {
799
- const t = m(!0), n = x(e, "modelValue");
800
- return (o, l) => (v(), g("div", null, [
804
+ const t = m(!0), n = $(e, "modelValue");
805
+ return (o, l) => (v(), g("div", Dt, [
806
+ c("label", {
807
+ class: "aform__field-label",
808
+ for: o.uuid
809
+ }, A(o.label), 9, Mt),
801
810
  M(c("input", {
811
+ class: "aform__input-field",
802
812
  "onUpdate:modelValue": l[0] || (l[0] = (r) => n.value = r),
803
813
  id: o.uuid,
804
814
  disabled: o.readonly,
805
815
  maxlength: o.mask ? t.value && o.mask.length : void 0,
806
816
  required: o.required
807
- }, null, 8, Dt), [
817
+ }, null, 8, Et), [
808
818
  [G, n.value],
809
819
  [re(wt), o.mask]
810
820
  ]),
811
- c("label", { for: o.uuid }, E(o.label), 9, Mt),
812
821
  M(c("p", {
822
+ class: "error",
813
823
  innerHTML: o.validation.errorMessage
814
- }, null, 8, Et), [
815
- [I, o.validation.errorMessage]
824
+ }, null, 8, At), [
825
+ [x, o.validation.errorMessage]
816
826
  ])
817
827
  ]));
818
828
  }
819
- }), Ct = /* @__PURE__ */ S(At, [["__scopeId", "data-v-2514e692"]]);
829
+ });
820
830
  function Vt(e) {
821
- e.component("ACheckbox", $e), e.component("ACombobox", Ie), e.component("ADate", Fe), e.component("ADropdown", Ke), e.component("ADatePicker", rt), e.component("AFieldset", pt), e.component("AForm", ce), e.component("ANumericInput", yt), e.component("ATextInput", Ct);
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);
822
832
  }
823
833
  export {
824
- $e as ACheckbox,
825
- Ie as AComboBox,
826
- Fe as ADate,
827
- rt as ADatePicker,
828
- Ke as ADropdown,
829
- pt as AFieldset,
834
+ Se as ACheckbox,
835
+ xe as AComboBox,
836
+ qe as ADate,
837
+ st as ADatePicker,
838
+ We as ADropdown,
839
+ ft as AFieldset,
830
840
  ce as AForm,
831
841
  yt as ANumericInput,
832
842
  Ct as ATextInput,