@stonecrop/aform 0.3.4 → 0.3.6

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