@stonecrop/aform 0.2.30 → 0.2.32

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