@stonecrop/aform 0.4.36 → 0.4.37

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,5 +1,5 @@
1
- import { defineComponent as C, mergeModels as z, useModel as q, createElementBlock as w, openBlock as g, createElementVNode as c, withDirectives as M, toDisplayString as A, vModelCheckbox as Re, vShow as W, resolveComponent as He, createBlock as ae, withCtx as Be, useTemplateRef as Ae, vModelText as H, watch as O, getCurrentScope as Ie, onScopeDispose as Te, toRef as qe, readonly as Ce, ref as D, customRef as We, computed as T, watchEffect as _e, toValue as b, unref as S, shallowRef as G, reactive as Ue, normalizeClass as Z, withKeys as R, Fragment as Y, renderList as j, withModifiers as Se, onMounted as se, onBeforeUnmount as Ne, getCurrentInstance as Ye, nextTick as je, resolveDynamicComponent as Ke, mergeProps as ze, renderSlot as Ge, createTextVNode as $e, createCommentVNode as re, createVNode as Xe } from "vue";
2
- import './assets/index.css';const Je = { class: "aform_form-element" }, Qe = ["for"], Ze = { class: "aform_checkbox-container aform_input-field" }, et = ["id", "readonly", "required"], tt = ["innerHTML"], nt = /* @__PURE__ */ C({
1
+ import { defineComponent as C, mergeModels as z, useModel as q, createElementBlock as b, openBlock as g, createElementVNode as c, withDirectives as M, toDisplayString as I, vModelCheckbox as Pe, vShow as U, resolveComponent as Fe, createBlock as le, withCtx as Re, useTemplateRef as De, vModelText as H, watch as F, getCurrentScope as Ee, onScopeDispose as Me, toRef as Oe, readonly as Ie, ref as D, customRef as He, computed as T, watchEffect as Ae, toValue as w, unref as S, shallowRef as G, reactive as Be, normalizeClass as X, withKeys as R, Fragment as j, renderList as Y, withModifiers as Te, onMounted as ae, onBeforeUnmount as qe, getCurrentInstance as Ue, nextTick as We, resolveDynamicComponent as Ne, mergeProps as je, renderSlot as Ye, createTextVNode as Ce, createCommentVNode as se, createVNode as Ke } from "vue";
2
+ import './assets/index.css';const ze = { class: "aform_form-element" }, Ge = ["for"], Je = { class: "aform_checkbox-container aform_input-field" }, Qe = ["id", "readonly", "required"], Xe = ["innerHTML"], Ze = /* @__PURE__ */ C({
3
3
  __name: "ACheckbox",
4
4
  props: /* @__PURE__ */ z({
5
5
  schema: {},
@@ -16,48 +16,48 @@ import './assets/index.css';const Je = { class: "aform_form-element" }, Qe = ["f
16
16
  emits: ["update:modelValue"],
17
17
  setup(e) {
18
18
  const t = q(e, "modelValue");
19
- return (n, o) => (g(), w("div", Je, [
19
+ return (n, o) => (g(), b("div", ze, [
20
20
  c("label", {
21
21
  class: "aform_field-label",
22
22
  for: e.uuid
23
- }, A(e.label), 9, Qe),
24
- c("span", Ze, [
23
+ }, I(e.label), 9, Ge),
24
+ c("span", Je, [
25
25
  M(c("input", {
26
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
27
- type: "checkbox",
28
26
  id: e.uuid,
27
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
28
+ type: "checkbox",
29
29
  class: "aform_checkbox",
30
30
  readonly: e.readonly,
31
31
  required: e.required
32
- }, null, 8, et), [
33
- [Re, t.value]
32
+ }, null, 8, Qe), [
33
+ [Pe, t.value]
34
34
  ])
35
35
  ]),
36
36
  M(c("p", {
37
37
  class: "aform_error",
38
38
  innerHTML: e.validation.errorMessage
39
- }, null, 8, tt), [
40
- [W, e.validation.errorMessage]
39
+ }, null, 8, Xe), [
40
+ [U, e.validation.errorMessage]
41
41
  ])
42
42
  ]));
43
43
  }
44
- }), $ = (e, t) => {
44
+ }), _ = (e, t) => {
45
45
  const n = e.__vccOpts || e;
46
- for (const [o, s] of t)
47
- n[o] = s;
46
+ for (const [o, r] of t)
47
+ n[o] = r;
48
48
  return n;
49
- }, ot = /* @__PURE__ */ $(nt, [["__scopeId", "data-v-9f382ad4"]]), lt = /* @__PURE__ */ C({
49
+ }, et = /* @__PURE__ */ _(Ze, [["__scopeId", "data-v-aaa1a4c4"]]), tt = /* @__PURE__ */ C({
50
50
  __name: "AComboBox",
51
51
  props: ["event", "cellData", "tableID"],
52
52
  setup(e) {
53
53
  return (t, n) => {
54
- const o = He("ATableModal");
55
- return g(), ae(o, {
54
+ const o = Fe("ATableModal");
55
+ return g(), le(o, {
56
56
  event: e.event,
57
- cellData: e.cellData,
57
+ "cell-data": e.cellData,
58
58
  class: "amodal"
59
59
  }, {
60
- default: Be(() => [...n[0] || (n[0] = [
60
+ default: Re(() => [...n[0] || (n[0] = [
61
61
  c("div", null, [
62
62
  c("input", { type: "text" }),
63
63
  c("input", { type: "text" }),
@@ -65,10 +65,10 @@ import './assets/index.css';const Je = { class: "aform_form-element" }, Qe = ["f
65
65
  ], -1)
66
66
  ])]),
67
67
  _: 1
68
- }, 8, ["event", "cellData"]);
68
+ }, 8, ["event", "cell-data"]);
69
69
  };
70
70
  }
71
- }), at = ["id", "disabled", "required"], st = ["for"], rt = ["innerHTML"], it = /* @__PURE__ */ C({
71
+ }), nt = ["id", "disabled", "required"], ot = ["for"], lt = ["innerHTML"], at = /* @__PURE__ */ C({
72
72
  __name: "ADate",
73
73
  props: /* @__PURE__ */ z({
74
74
  schema: {},
@@ -88,213 +88,129 @@ import './assets/index.css';const Je = { class: "aform_form-element" }, Qe = ["f
88
88
  setup(e) {
89
89
  const t = q(e, "modelValue", {
90
90
  // format the date to be compatible with the native input datepicker
91
- set: (s) => new Date(s).toISOString().split("T")[0]
92
- }), n = Ae("date"), o = () => {
91
+ set: (r) => new Date(r).toISOString().split("T")[0]
92
+ }), n = De("date"), o = () => {
93
93
  n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
94
94
  };
95
- return (s, u) => (g(), w("div", null, [
95
+ return (r, u) => (g(), b("div", null, [
96
96
  M(c("input", {
97
- "onUpdate:modelValue": u[0] || (u[0] = (i) => t.value = i),
97
+ id: e.uuid,
98
98
  ref: "date",
99
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => t.value = s),
99
100
  type: "date",
100
- id: e.uuid,
101
101
  disabled: e.readonly,
102
102
  required: e.required,
103
103
  onClick: o
104
- }, null, 8, at), [
104
+ }, null, 8, nt), [
105
105
  [H, t.value]
106
106
  ]),
107
- c("label", { for: e.uuid }, A(e.label), 9, st),
107
+ c("label", { for: e.uuid }, I(e.label), 9, ot),
108
108
  M(c("p", {
109
109
  innerHTML: e.validation.errorMessage
110
- }, null, 8, rt), [
111
- [W, e.validation.errorMessage]
110
+ }, null, 8, lt), [
111
+ [U, e.validation.errorMessage]
112
112
  ])
113
113
  ]));
114
114
  }
115
- }), ut = /* @__PURE__ */ $(it, [["__scopeId", "data-v-280b3d1a"]]);
116
- function ie(e) {
117
- return Ie() ? (Te(e), !0) : !1;
115
+ }), st = /* @__PURE__ */ _(at, [["__scopeId", "data-v-455d9e30"]]);
116
+ function re(e, t) {
117
+ return Ee() ? (Me(e, t), !0) : !1;
118
118
  }
119
119
  // @__NO_SIDE_EFFECTS__
120
- function ve() {
120
+ function me() {
121
121
  const e = /* @__PURE__ */ new Set(), t = (u) => {
122
122
  e.delete(u);
123
123
  };
124
124
  return {
125
125
  on: (u) => {
126
126
  e.add(u);
127
- const i = () => t(u);
128
- return ie(i), {
129
- off: i
130
- };
127
+ const s = () => t(u);
128
+ return re(s), { off: s };
131
129
  },
132
130
  off: t,
133
- trigger: (...u) => Promise.all(Array.from(e).map((i) => i(...u))),
131
+ trigger: (...u) => Promise.all(Array.from(e).map((s) => s(...u))),
134
132
  clear: () => {
135
133
  e.clear();
136
134
  }
137
135
  };
138
136
  }
139
- const ue = typeof window < "u" && typeof document < "u";
137
+ const $e = typeof window < "u" && typeof document < "u";
140
138
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
141
- const ct = Object.prototype.toString, dt = (e) => ct.call(e) === "[object Object]", F = () => {
142
- }, ft = (e, t) => Object.prototype.hasOwnProperty.call(e, t), le = /* @__PURE__ */ mt();
143
- function mt() {
144
- var e, t;
145
- return ue && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
146
- }
147
- function pt(...e) {
148
- if (e.length !== 1)
149
- return qe(...e);
139
+ const rt = Object.prototype.toString, it = (e) => rt.call(e) === "[object Object]", N = () => {
140
+ }, ut = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
141
+ function ct(...e) {
142
+ if (e.length !== 1) return Oe(...e);
150
143
  const t = e[0];
151
- return typeof t == "function" ? Ce(We(() => ({ get: t, set: F }))) : D(t);
144
+ return typeof t == "function" ? Ie(He(() => ({
145
+ get: t,
146
+ set: N
147
+ }))) : D(t);
152
148
  }
153
- function ee(e) {
149
+ function Z(e) {
154
150
  return Array.isArray(e) ? e : [e];
155
151
  }
156
- function vt(e, t, n) {
157
- return O(
158
- e,
159
- t,
160
- {
161
- ...n,
162
- immediate: !0
163
- }
164
- );
165
- }
166
- const ht = ue ? window.document : void 0;
167
- function gt(e) {
168
- var t;
169
- const n = b(e);
170
- return (t = n?.$el) != null ? t : n;
171
- }
172
- const yt = {
173
- multiple: !0,
174
- accept: "*",
175
- reset: !1,
176
- directory: !1
177
- };
178
- function bt(e) {
179
- if (!e)
180
- return null;
181
- if (e instanceof FileList)
182
- return e;
183
- const t = new DataTransfer();
184
- for (const n of e)
185
- t.items.add(n);
186
- return t.files;
187
- }
188
- function wt(e = {}) {
189
- const {
190
- document: t = ht
191
- } = e, n = D(bt(e.initialFiles)), { on: o, trigger: s } = /* @__PURE__ */ ve(), { on: u, trigger: i } = /* @__PURE__ */ ve(), l = T(() => {
192
- var v;
193
- const d = (v = gt(e.input)) != null ? v : t ? t.createElement("input") : void 0;
194
- return d && (d.type = "file", d.onchange = (p) => {
195
- const k = p.target;
196
- n.value = k.files, s(n.value);
197
- }, d.oncancel = () => {
198
- i();
199
- }), d;
200
- }), a = () => {
201
- n.value = null, l.value && l.value.value && (l.value.value = "", s(null));
202
- }, r = (v) => {
203
- const d = l.value;
204
- d && (d.multiple = b(v.multiple), d.accept = b(v.accept), d.webkitdirectory = b(v.directory), ft(v, "capture") && (d.capture = b(v.capture)));
205
- }, f = (v) => {
206
- const d = l.value;
207
- if (!d)
208
- return;
209
- const p = {
210
- ...yt,
211
- ...e,
212
- ...v
213
- };
214
- r(p), b(p.reset) && a(), d.click();
215
- };
216
- return _e(() => {
217
- r(e);
218
- }), {
219
- files: Ce(n),
220
- open: f,
221
- reset: a,
222
- onCancel: u,
223
- onChange: o
224
- };
152
+ function dt(e, t, n) {
153
+ return F(e, t, {
154
+ ...n,
155
+ immediate: !0
156
+ });
225
157
  }
226
- const Le = ue ? window : void 0;
227
- function N(e) {
158
+ const Se = $e ? window : void 0, ft = $e ? window.document : void 0;
159
+ function O(e) {
228
160
  var t;
229
- const n = b(e);
230
- return (t = n?.$el) != null ? t : n;
161
+ const n = w(e);
162
+ return (t = n?.$el) !== null && t !== void 0 ? t : n;
231
163
  }
232
- function J(...e) {
164
+ function ee(...e) {
233
165
  const t = [], n = () => {
234
166
  t.forEach((l) => l()), t.length = 0;
235
- }, o = (l, a, r, f) => (l.addEventListener(a, r, f), () => l.removeEventListener(a, r, f)), s = T(() => {
236
- const l = ee(b(e[0])).filter((a) => a != null);
167
+ }, o = (l, a, i, f) => (l.addEventListener(a, i, f), () => l.removeEventListener(a, i, f)), r = T(() => {
168
+ const l = Z(w(e[0])).filter((a) => a != null);
237
169
  return l.every((a) => typeof a != "string") ? l : void 0;
238
- }), u = vt(
239
- () => {
240
- var l, a;
241
- return [
242
- (a = (l = s.value) == null ? void 0 : l.map((r) => N(r))) != null ? a : [Le].filter((r) => r != null),
243
- ee(b(s.value ? e[1] : e[0])),
244
- ee(S(s.value ? e[2] : e[1])),
245
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
246
- b(s.value ? e[3] : e[2])
247
- ];
248
- },
249
- ([l, a, r, f]) => {
250
- if (n(), !l?.length || !a?.length || !r?.length)
251
- return;
252
- const v = dt(f) ? { ...f } : f;
253
- t.push(
254
- ...l.flatMap(
255
- (d) => a.flatMap(
256
- (p) => r.map((k) => o(d, p, k, v))
257
- )
258
- )
259
- );
260
- },
261
- { flush: "post" }
262
- ), i = () => {
170
+ }), u = dt(() => {
171
+ var l, a;
172
+ return [
173
+ (l = (a = r.value) === null || a === void 0 ? void 0 : a.map((i) => O(i))) !== null && l !== void 0 ? l : [Se].filter((i) => i != null),
174
+ Z(w(r.value ? e[1] : e[0])),
175
+ Z(S(r.value ? e[2] : e[1])),
176
+ w(r.value ? e[3] : e[2])
177
+ ];
178
+ }, ([l, a, i, f]) => {
179
+ if (n(), !l?.length || !a?.length || !i?.length) return;
180
+ const v = it(f) ? { ...f } : f;
181
+ t.push(...l.flatMap((d) => a.flatMap((p) => i.map((k) => o(d, p, k, v)))));
182
+ }, { flush: "post" }), s = () => {
263
183
  u(), n();
264
184
  };
265
- return ie(n), i;
185
+ return re(n), s;
266
186
  }
267
- let he = !1;
268
- function ge(e, t, n = {}) {
269
- const { window: o = Le, ignore: s = [], capture: u = !0, detectIframe: i = !1, controls: l = !1 } = n;
270
- if (!o)
271
- return l ? { stop: F, cancel: F, trigger: F } : F;
272
- if (le && !he) {
273
- he = !0;
274
- const m = { passive: !0 };
275
- Array.from(o.document.body.children).forEach((h) => h.addEventListener("click", F, m)), o.document.documentElement.addEventListener("click", F, m);
276
- }
187
+ function ve(e, t, n = {}) {
188
+ const { window: o = Se, ignore: r = [], capture: u = !0, detectIframe: s = !1, controls: l = !1 } = n;
189
+ if (!o) return l ? {
190
+ stop: N,
191
+ cancel: N,
192
+ trigger: N
193
+ } : N;
277
194
  let a = !0;
278
- const r = (m) => b(s).some((h) => {
279
- if (typeof h == "string")
280
- return Array.from(o.document.querySelectorAll(h)).some((E) => E === m.target || m.composedPath().includes(E));
195
+ const i = (m) => w(r).some((h) => {
196
+ if (typeof h == "string") return Array.from(o.document.querySelectorAll(h)).some((E) => E === m.target || m.composedPath().includes(E));
281
197
  {
282
- const E = N(h);
198
+ const E = O(h);
283
199
  return E && (m.target === E || m.composedPath().includes(E));
284
200
  }
285
201
  });
286
202
  function f(m) {
287
- const h = b(m);
203
+ const h = w(m);
288
204
  return h && h.$.subTree.shapeFlag === 16;
289
205
  }
290
206
  function v(m, h) {
291
- const E = b(m), y = E.$.subTree && E.$.subTree.children;
207
+ const E = w(m), y = E.$.subTree && E.$.subTree.children;
292
208
  return y == null || !Array.isArray(y) ? !1 : y.some((x) => x.el === h.target || h.composedPath().includes(x.el));
293
209
  }
294
210
  const d = (m) => {
295
- const h = N(e);
211
+ const h = O(e);
296
212
  if (m.target != null && !(!(h instanceof Element) && f(e) && v(e, m)) && !(!h || h === m.target || m.composedPath().includes(h))) {
297
- if ("detail" in m && m.detail === 0 && (a = !r(m)), !a) {
213
+ if ("detail" in m && m.detail === 0 && (a = !i(m)), !a) {
298
214
  a = !0;
299
215
  return;
300
216
  }
@@ -303,147 +219,171 @@ function ge(e, t, n = {}) {
303
219
  };
304
220
  let p = !1;
305
221
  const k = [
306
- J(o, "click", (m) => {
222
+ ee(o, "click", (m) => {
307
223
  p || (p = !0, setTimeout(() => {
308
224
  p = !1;
309
225
  }, 0), d(m));
310
- }, { passive: !0, capture: u }),
311
- J(o, "pointerdown", (m) => {
312
- const h = N(e);
313
- a = !r(m) && !!(h && !m.composedPath().includes(h));
226
+ }, {
227
+ passive: !0,
228
+ capture: u
229
+ }),
230
+ ee(o, "pointerdown", (m) => {
231
+ const h = O(e);
232
+ a = !i(m) && !!(h && !m.composedPath().includes(h));
314
233
  }, { passive: !0 }),
315
- i && J(o, "blur", (m) => {
234
+ s && ee(o, "blur", (m) => {
316
235
  setTimeout(() => {
317
236
  var h;
318
- const E = N(e);
319
- ((h = o.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !E?.contains(o.document.activeElement) && t(m);
237
+ const E = O(e);
238
+ ((h = o.document.activeElement) === null || h === void 0 ? void 0 : h.tagName) === "IFRAME" && !E?.contains(o.document.activeElement) && t(m);
320
239
  }, 0);
321
240
  }, { passive: !0 })
322
- ].filter(Boolean), I = () => k.forEach((m) => m());
241
+ ].filter(Boolean), A = () => k.forEach((m) => m());
323
242
  return l ? {
324
- stop: I,
243
+ stop: A,
325
244
  cancel: () => {
326
245
  a = !1;
327
246
  },
328
247
  trigger: (m) => {
329
248
  a = !0, d(m), a = !1;
330
249
  }
331
- } : I;
250
+ } : A;
332
251
  }
333
- const te = /* @__PURE__ */ new WeakMap(), kt = {
334
- mounted(e, t) {
335
- const n = !t.modifiers.bubble;
336
- let o;
337
- if (typeof t.value == "function")
338
- o = ge(e, t.value, { capture: n });
339
- else {
340
- const [s, u] = t.value;
341
- o = ge(e, s, Object.assign({ capture: n }, u));
342
- }
343
- te.set(e, o);
344
- },
345
- unmounted(e) {
346
- const t = te.get(e);
347
- t && typeof t == "function" ? t() : t?.stop(), te.delete(e);
348
- }
252
+ const mt = {
253
+ multiple: !0,
254
+ accept: "*",
255
+ reset: !1,
256
+ directory: !1
349
257
  };
350
- function ne(e) {
351
- return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
258
+ function vt(e) {
259
+ if (!e) return null;
260
+ if (e instanceof FileList) return e;
261
+ const t = new DataTransfer();
262
+ for (const n of e) t.items.add(n);
263
+ return t.files;
352
264
  }
353
- function Ve(e) {
354
- const t = window.getComputedStyle(e);
355
- if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
356
- return !0;
357
- {
358
- const n = e.parentNode;
359
- return !n || n.tagName === "BODY" ? !1 : Ve(n);
360
- }
265
+ function pt(e = {}) {
266
+ const { document: t = ft } = e, n = D(vt(e.initialFiles)), { on: o, trigger: r } = /* @__PURE__ */ me(), { on: u, trigger: s } = /* @__PURE__ */ me(), l = T(() => {
267
+ var v;
268
+ const d = (v = O(e.input)) !== null && v !== void 0 ? v : t ? t.createElement("input") : void 0;
269
+ return d && (d.type = "file", d.onchange = (p) => {
270
+ n.value = p.target.files, r(n.value);
271
+ }, d.oncancel = () => {
272
+ s();
273
+ }), d;
274
+ }), a = () => {
275
+ n.value = null, l.value && l.value.value && (l.value.value = "", r(null));
276
+ }, i = (v) => {
277
+ const d = l.value;
278
+ d && (d.multiple = w(v.multiple), d.accept = w(v.accept), d.webkitdirectory = w(v.directory), ut(v, "capture") && (d.capture = w(v.capture)));
279
+ }, f = (v) => {
280
+ const d = l.value;
281
+ if (!d) return;
282
+ const p = {
283
+ ...mt,
284
+ ...e,
285
+ ...v
286
+ };
287
+ i(p), w(p.reset) && a(), d.click();
288
+ };
289
+ return Ae(() => {
290
+ i(e);
291
+ }), {
292
+ files: Ie(n),
293
+ open: f,
294
+ reset: a,
295
+ onCancel: u,
296
+ onChange: o
297
+ };
361
298
  }
362
- function xt(e) {
363
- const t = e || window.event, n = t.target;
364
- return Ve(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
299
+ function te(e) {
300
+ return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
365
301
  }
366
- const oe = /* @__PURE__ */ new WeakMap();
367
- function Dt(e, t = !1) {
302
+ const ne = /* @__PURE__ */ new WeakMap();
303
+ function ht(e, t = !1) {
368
304
  const n = G(t);
369
- let o = null, s = "";
370
- O(pt(e), (l) => {
371
- const a = ne(b(l));
372
- if (a) {
373
- const r = a;
374
- if (oe.get(r) || oe.set(r, r.style.overflow), r.style.overflow !== "hidden" && (s = r.style.overflow), r.style.overflow === "hidden")
375
- return n.value = !0;
376
- if (n.value)
377
- return r.style.overflow = "hidden";
305
+ let o = "";
306
+ F(ct(e), (s) => {
307
+ const l = te(w(s));
308
+ if (l) {
309
+ const a = l;
310
+ if (ne.get(a) || ne.set(a, a.style.overflow), a.style.overflow !== "hidden" && (o = a.style.overflow), a.style.overflow === "hidden") return n.value = !0;
311
+ if (n.value) return a.style.overflow = "hidden";
378
312
  }
379
- }, {
380
- immediate: !0
381
- });
382
- const u = () => {
383
- const l = ne(b(e));
384
- !l || n.value || (le && (o = J(
385
- l,
386
- "touchmove",
387
- (a) => {
388
- xt(a);
389
- },
390
- { passive: !1 }
391
- )), l.style.overflow = "hidden", n.value = !0);
392
- }, i = () => {
393
- const l = ne(b(e));
394
- !l || !n.value || (le && o?.(), l.style.overflow = s, oe.delete(l), n.value = !1);
313
+ }, { immediate: !0 });
314
+ const r = () => {
315
+ const s = te(w(e));
316
+ !s || n.value || (s.style.overflow = "hidden", n.value = !0);
317
+ }, u = () => {
318
+ const s = te(w(e));
319
+ !s || !n.value || (s.style.overflow = o, ne.delete(s), n.value = !1);
395
320
  };
396
- return ie(i), T({
321
+ return re(u), T({
397
322
  get() {
398
323
  return n.value;
399
324
  },
400
- set(l) {
401
- l ? u() : i();
325
+ set(s) {
326
+ s ? r() : u();
402
327
  }
403
328
  });
404
329
  }
405
- function Et() {
330
+ const oe = /* @__PURE__ */ new WeakMap(), gt = {
331
+ mounted(e, t) {
332
+ const n = !t.modifiers.bubble;
333
+ let o;
334
+ if (typeof t.value == "function") o = ve(e, t.value, { capture: n });
335
+ else {
336
+ const [r, u] = t.value;
337
+ o = ve(e, r, Object.assign({ capture: n }, u));
338
+ }
339
+ oe.set(e, o);
340
+ },
341
+ unmounted(e) {
342
+ const t = oe.get(e);
343
+ t && typeof t == "function" ? t() : t?.stop(), oe.delete(e);
344
+ }
345
+ };
346
+ function yt() {
406
347
  let e = !1;
407
348
  const t = G(!1);
408
349
  return (n, o) => {
409
- if (t.value = o.value, e)
410
- return;
350
+ if (t.value = o.value, e) return;
411
351
  e = !0;
412
- const s = Dt(n, o.value);
413
- O(t, (u) => s.value = u);
352
+ const r = ht(n, o.value);
353
+ F(t, (u) => r.value = u);
414
354
  };
415
355
  }
416
- Et();
417
- const Mt = { class: "input-wrapper" }, At = {
356
+ yt();
357
+ const bt = { class: "input-wrapper" }, wt = {
418
358
  id: "autocomplete-results",
419
359
  class: "autocomplete-results"
420
- }, It = {
360
+ }, kt = {
421
361
  key: 0,
422
362
  class: "loading autocomplete-result"
423
- }, Tt = ["onClick"], Ct = /* @__PURE__ */ C({
363
+ }, xt = ["onClick"], Dt = /* @__PURE__ */ C({
424
364
  __name: "ADropdown",
425
365
  props: /* @__PURE__ */ z({
426
366
  label: {},
427
- items: {},
428
- isAsync: { type: Boolean },
429
- filterFunction: { type: Function }
367
+ items: { default: () => [] },
368
+ isAsync: { type: Boolean, default: !1 },
369
+ filterFunction: { type: Function, default: void 0 }
430
370
  }, {
431
371
  modelValue: {},
432
372
  modelModifiers: {}
433
373
  }),
434
374
  emits: ["update:modelValue"],
435
375
  setup(e) {
436
- const t = q(e, "modelValue"), n = Ue({
376
+ const t = q(e, "modelValue"), n = Be({
437
377
  activeItemIndex: null,
438
378
  open: !1,
439
379
  loading: !1,
440
380
  results: e.items
441
- }), o = () => l(), s = async () => {
442
- if (n.open = !0, e.filterFunction) {
381
+ }), o = () => l(), r = async () => {
382
+ if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {
443
383
  e.isAsync && (n.loading = !0);
444
384
  try {
445
385
  const d = await e.filterFunction(t.value || "");
446
- n.results = d;
386
+ n.results = d || [];
447
387
  } catch {
448
388
  n.results = [];
449
389
  } finally {
@@ -453,13 +393,13 @@ const Mt = { class: "input-wrapper" }, At = {
453
393
  a();
454
394
  }, u = (d) => {
455
395
  t.value = d, l(d);
456
- }, i = () => {
396
+ }, s = () => {
457
397
  n.activeItemIndex = e.isAsync ? null : t.value && e.items?.indexOf(t.value) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;
458
398
  }, l = (d) => {
459
399
  n.activeItemIndex = null, n.open = !1, e.items?.includes(d || t.value || "") || (t.value = "");
460
400
  }, a = () => {
461
401
  t.value ? n.results = e.items?.filter((d) => d.toLowerCase().includes((t.value ?? "").toLowerCase())) : n.results = e.items;
462
- }, r = () => {
402
+ }, i = () => {
463
403
  const d = n.results?.length || 0;
464
404
  if (n.activeItemIndex != null) {
465
405
  const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;
@@ -470,7 +410,7 @@ const Mt = { class: "input-wrapper" }, At = {
470
410
  const d = n.results?.length || 0;
471
411
  if (n.activeItemIndex != null) {
472
412
  const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;
473
- n.activeItemIndex = (p - 1 + d) % d;
413
+ p === 0 ? n.activeItemIndex = null : n.activeItemIndex = p - 1;
474
414
  } else
475
415
  n.activeItemIndex = d - 1;
476
416
  }, v = () => {
@@ -480,17 +420,17 @@ const Mt = { class: "input-wrapper" }, At = {
480
420
  }
481
421
  n.activeItemIndex = 0;
482
422
  };
483
- return (d, p) => M((g(), w("div", {
484
- class: Z(["autocomplete", { isOpen: n.open }])
423
+ return (d, p) => M((g(), b("div", {
424
+ class: X(["autocomplete", { isOpen: n.open }])
485
425
  }, [
486
- c("div", Mt, [
426
+ c("div", bt, [
487
427
  M(c("input", {
488
428
  "onUpdate:modelValue": p[0] || (p[0] = (k) => t.value = k),
489
429
  type: "text",
490
- onInput: s,
491
- onFocus: i,
430
+ onInput: r,
431
+ onFocus: s,
492
432
  onKeydown: [
493
- R(r, ["down"]),
433
+ R(i, ["down"]),
494
434
  R(f, ["up"]),
495
435
  R(v, ["enter"]),
496
436
  R(o, ["esc"]),
@@ -499,226 +439,183 @@ const Mt = { class: "input-wrapper" }, At = {
499
439
  }, null, 544), [
500
440
  [H, t.value]
501
441
  ]),
502
- M(c("ul", At, [
503
- n.loading ? (g(), w("li", It, "Loading results...")) : (g(!0), w(Y, { key: 1 }, j(n.results, (k, I) => (g(), w("li", {
442
+ M(c("ul", wt, [
443
+ n.loading ? (g(), b("li", kt, "Loading results...")) : (g(!0), b(j, { key: 1 }, Y(n.results, (k, A) => (g(), b("li", {
504
444
  key: k,
505
- onClick: Se((m) => u(k), ["stop"]),
506
- class: Z(["autocomplete-result", { "is-active": I === n.activeItemIndex }])
507
- }, A(k), 11, Tt))), 128))
445
+ class: X(["autocomplete-result", { "is-active": A === n.activeItemIndex }]),
446
+ onClick: Te((m) => u(k), ["stop"])
447
+ }, I(k), 11, xt))), 128))
508
448
  ], 512), [
509
- [W, n.open]
449
+ [U, n.open]
510
450
  ]),
511
- c("label", null, A(e.label), 1)
451
+ c("label", null, I(e.label), 1)
512
452
  ])
513
453
  ], 2)), [
514
- [S(kt), o]
454
+ [S(gt), o]
515
455
  ]);
516
456
  }
517
- }), _t = /* @__PURE__ */ $(Ct, [["__scopeId", "data-v-16c329d1"]]);
518
- function ce(e) {
519
- return Ie() ? (Te(e), !0) : !1;
457
+ }), Et = /* @__PURE__ */ _(Dt, [["__scopeId", "data-v-31a6db8c"]]);
458
+ function ie(e, t) {
459
+ return Ee() ? (Me(e, t), !0) : !1;
520
460
  }
521
- const St = typeof window < "u" && typeof document < "u";
461
+ const Mt = typeof window < "u" && typeof document < "u";
522
462
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
523
- const $t = (e) => e != null, Lt = Object.prototype.toString, Vt = (e) => Lt.call(e) === "[object Object]", Pt = () => {
463
+ const It = (e) => e != null, At = Object.prototype.toString, Tt = (e) => At.call(e) === "[object Object]", Ct = () => {
524
464
  };
525
465
  function Q(e) {
526
466
  return Array.isArray(e) ? e : [e];
527
467
  }
528
- function Ot(e, t, n) {
529
- return O(
530
- e,
531
- t,
532
- {
533
- ...n,
534
- immediate: !0
535
- }
536
- );
468
+ function $t(e, t, n) {
469
+ return F(e, t, {
470
+ ...n,
471
+ immediate: !0
472
+ });
537
473
  }
538
- const U = St ? window : void 0;
474
+ const W = Mt ? window : void 0;
539
475
  function B(e) {
540
476
  var t;
541
- const n = b(e);
542
- return (t = n?.$el) != null ? t : n;
477
+ const n = w(e);
478
+ return (t = n?.$el) !== null && t !== void 0 ? t : n;
543
479
  }
544
480
  function K(...e) {
545
481
  const t = [], n = () => {
546
482
  t.forEach((l) => l()), t.length = 0;
547
- }, o = (l, a, r, f) => (l.addEventListener(a, r, f), () => l.removeEventListener(a, r, f)), s = T(() => {
548
- const l = Q(b(e[0])).filter((a) => a != null);
483
+ }, o = (l, a, i, f) => (l.addEventListener(a, i, f), () => l.removeEventListener(a, i, f)), r = T(() => {
484
+ const l = Q(w(e[0])).filter((a) => a != null);
549
485
  return l.every((a) => typeof a != "string") ? l : void 0;
550
- }), u = Ot(
551
- () => {
552
- var l, a;
553
- return [
554
- (a = (l = s.value) == null ? void 0 : l.map((r) => B(r))) != null ? a : [U].filter((r) => r != null),
555
- Q(b(s.value ? e[1] : e[0])),
556
- Q(S(s.value ? e[2] : e[1])),
557
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
558
- b(s.value ? e[3] : e[2])
559
- ];
560
- },
561
- ([l, a, r, f]) => {
562
- if (n(), !l?.length || !a?.length || !r?.length)
563
- return;
564
- const v = Vt(f) ? { ...f } : f;
565
- t.push(
566
- ...l.flatMap(
567
- (d) => a.flatMap(
568
- (p) => r.map((k) => o(d, p, k, v))
569
- )
570
- )
571
- );
572
- },
573
- { flush: "post" }
574
- ), i = () => {
486
+ }), u = $t(() => {
487
+ var l, a;
488
+ return [
489
+ (l = (a = r.value) === null || a === void 0 ? void 0 : a.map((i) => B(i))) !== null && l !== void 0 ? l : [W].filter((i) => i != null),
490
+ Q(w(r.value ? e[1] : e[0])),
491
+ Q(S(r.value ? e[2] : e[1])),
492
+ w(r.value ? e[3] : e[2])
493
+ ];
494
+ }, ([l, a, i, f]) => {
495
+ if (n(), !l?.length || !a?.length || !i?.length) return;
496
+ const v = Tt(f) ? { ...f } : f;
497
+ t.push(...l.flatMap((d) => a.flatMap((p) => i.map((k) => o(d, p, k, v)))));
498
+ }, { flush: "post" }), s = () => {
575
499
  u(), n();
576
500
  };
577
- return ce(n), i;
501
+ return ie(n), s;
578
502
  }
579
503
  // @__NO_SIDE_EFFECTS__
580
- function Ft() {
581
- const e = G(!1), t = Ye();
582
- return t && se(() => {
504
+ function St() {
505
+ const e = G(!1), t = Ue();
506
+ return t && ae(() => {
583
507
  e.value = !0;
584
508
  }, t), e;
585
509
  }
586
510
  // @__NO_SIDE_EFFECTS__
587
- function Rt(e) {
588
- const t = /* @__PURE__ */ Ft();
511
+ function _t(e) {
512
+ const t = /* @__PURE__ */ St();
589
513
  return T(() => (t.value, !!e()));
590
514
  }
591
- function Ht(e, t, n = {}) {
592
- const { window: o = U, ...s } = n;
515
+ function Lt(e, t, n = {}) {
516
+ const { window: o = W, ...r } = n;
593
517
  let u;
594
- const i = /* @__PURE__ */ Rt(() => o && "MutationObserver" in o), l = () => {
518
+ const s = /* @__PURE__ */ _t(() => o && "MutationObserver" in o), l = () => {
595
519
  u && (u.disconnect(), u = void 0);
596
- }, a = T(() => {
597
- const d = b(e), p = Q(d).map(B).filter($t);
598
- return new Set(p);
599
- }), r = O(
600
- () => a.value,
601
- (d) => {
602
- l(), i.value && d.size && (u = new MutationObserver(t), d.forEach((p) => u.observe(p, s)));
603
- },
604
- { immediate: !0, flush: "post" }
605
- ), f = () => u?.takeRecords(), v = () => {
606
- r(), l();
520
+ }, a = F(T(() => {
521
+ const v = Q(w(e)).map(B).filter(It);
522
+ return new Set(v);
523
+ }), (v) => {
524
+ l(), s.value && v.size && (u = new MutationObserver(t), v.forEach((d) => u.observe(d, r)));
525
+ }, {
526
+ immediate: !0,
527
+ flush: "post"
528
+ }), i = () => u?.takeRecords(), f = () => {
529
+ a(), l();
607
530
  };
608
- return ce(v), {
609
- isSupported: i,
610
- stop: v,
611
- takeRecords: f
531
+ return ie(f), {
532
+ isSupported: s,
533
+ stop: f,
534
+ takeRecords: i
612
535
  };
613
536
  }
614
- function Bt(e, t, n = {}) {
615
- const {
616
- window: o = U,
617
- document: s = o?.document,
618
- flush: u = "sync"
619
- } = n;
620
- if (!o || !s)
621
- return Pt;
622
- let i;
537
+ function Vt(e, t, n = {}) {
538
+ const { window: o = W, document: r = o?.document, flush: u = "sync" } = n;
539
+ if (!o || !r) return Ct;
540
+ let s;
623
541
  const l = (f) => {
624
- i?.(), i = f;
625
- }, a = _e(() => {
542
+ s?.(), s = f;
543
+ }, a = Ae(() => {
626
544
  const f = B(e);
627
545
  if (f) {
628
- const { stop: v } = Ht(
629
- s,
630
- (d) => {
631
- d.map((p) => [...p.removedNodes]).flat().some((p) => p === f || p.contains(f)) && t(d);
632
- },
633
- {
634
- window: o,
635
- childList: !0,
636
- subtree: !0
637
- }
638
- );
546
+ const { stop: v } = Lt(r, (d) => {
547
+ d.map((p) => [...p.removedNodes]).flat().some((p) => p === f || p.contains(f)) && t(d);
548
+ }, {
549
+ window: o,
550
+ childList: !0,
551
+ subtree: !0
552
+ });
639
553
  l(v);
640
554
  }
641
- }, { flush: u }), r = () => {
555
+ }, { flush: u }), i = () => {
642
556
  a(), l();
643
557
  };
644
- return ce(r), r;
558
+ return ie(i), i;
645
559
  }
646
560
  // @__NO_SIDE_EFFECTS__
647
- function qt(e = {}) {
561
+ function Pt(e = {}) {
648
562
  var t;
649
- const {
650
- window: n = U,
651
- deep: o = !0,
652
- triggerOnRemoval: s = !1
653
- } = e, u = (t = e.document) != null ? t : n?.document, i = () => {
654
- var r;
655
- let f = u?.activeElement;
563
+ const { window: n = W, deep: o = !0, triggerOnRemoval: r = !1 } = e, u = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {
564
+ let i = u?.activeElement;
656
565
  if (o)
657
- for (; f?.shadowRoot; )
658
- f = (r = f?.shadowRoot) == null ? void 0 : r.activeElement;
659
- return f;
566
+ for (var f; i?.shadowRoot; ) i = i == null || (f = i.shadowRoot) === null || f === void 0 ? void 0 : f.activeElement;
567
+ return i;
660
568
  }, l = G(), a = () => {
661
- l.value = i();
569
+ l.value = s();
662
570
  };
663
571
  if (n) {
664
- const r = {
572
+ const i = {
665
573
  capture: !0,
666
574
  passive: !0
667
575
  };
668
- K(
669
- n,
670
- "blur",
671
- (f) => {
672
- f.relatedTarget === null && a();
673
- },
674
- r
675
- ), K(
676
- n,
677
- "focus",
678
- a,
679
- r
680
- );
576
+ K(n, "blur", (f) => {
577
+ f.relatedTarget === null && a();
578
+ }, i), K(n, "focus", a, i);
681
579
  }
682
- return s && Bt(l, a, { document: u }), a(), l;
580
+ return r && Vt(l, a, { document: u }), a(), l;
683
581
  }
684
- const Wt = "focusin", Ut = "focusout", Nt = ":focus-within";
685
- function Yt(e, t = {}) {
686
- const { window: n = U } = t, o = T(() => B(e)), s = G(!1), u = T(() => s.value);
687
- if (!n || !(/* @__PURE__ */ qt(t)).value)
688
- return { focused: u };
689
- const i = { passive: !0 };
690
- return K(o, Wt, () => s.value = !0, i), K(o, Ut, () => {
691
- var l, a, r;
692
- return s.value = (r = (a = (l = o.value) == null ? void 0 : l.matches) == null ? void 0 : a.call(l, Nt)) != null ? r : !1;
693
- }, i), { focused: u };
582
+ const Ft = "focusin", Rt = "focusout", Ot = ":focus-within";
583
+ function Ht(e, t = {}) {
584
+ const { window: n = W } = t, o = T(() => B(e)), r = G(!1), u = T(() => r.value);
585
+ if (!n || !(/* @__PURE__ */ Pt(t)).value) return { focused: u };
586
+ const s = { passive: !0 };
587
+ return K(o, Ft, () => r.value = !0, s), K(o, Rt, () => {
588
+ var l, a, i;
589
+ return r.value = (l = (a = o.value) === null || a === void 0 || (i = a.matches) === null || i === void 0 ? void 0 : i.call(a, Ot)) !== null && l !== void 0 ? l : !1;
590
+ }, s), { focused: u };
694
591
  }
695
- function jt(e, { window: t = U, scrollTarget: n } = {}) {
696
- const o = D(!1), s = () => {
592
+ function Bt(e, { window: t = W, scrollTarget: n } = {}) {
593
+ const o = D(!1), r = () => {
697
594
  if (!t) return;
698
- const u = t.document, i = B(e);
699
- if (!i)
595
+ const u = t.document, s = B(e);
596
+ if (!s)
700
597
  o.value = !1;
701
598
  else {
702
- const l = i.getBoundingClientRect();
599
+ const l = s.getBoundingClientRect();
703
600
  o.value = l.top <= (t.innerHeight || u.documentElement.clientHeight) && l.left <= (t.innerWidth || u.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;
704
601
  }
705
602
  };
706
- return O(
603
+ return F(
707
604
  () => B(e),
708
- () => s(),
605
+ () => r(),
709
606
  { immediate: !0, flush: "post" }
710
- ), t && K(n || t, "scroll", s, {
607
+ ), t && K(n || t, "scroll", r, {
711
608
  capture: !1,
712
609
  passive: !0
713
610
  }), o;
714
611
  }
715
612
  const L = (e) => {
716
- let t = jt(e).value;
613
+ let t = Bt(e).value;
717
614
  return t = t && e.offsetHeight > 0, t;
718
- }, V = (e) => e.tabIndex >= 0, ye = (e) => {
615
+ }, V = (e) => e.tabIndex >= 0, pe = (e) => {
719
616
  const t = e.target;
720
- return de(t);
721
- }, de = (e) => {
617
+ return ue(t);
618
+ }, ue = (e) => {
722
619
  let t;
723
620
  if (e instanceof HTMLTableCellElement) {
724
621
  const n = e.parentElement?.previousElementSibling;
@@ -730,28 +627,28 @@ const L = (e) => {
730
627
  const n = e.previousElementSibling;
731
628
  n && (t = n);
732
629
  }
733
- return t && (!V(t) || !L(t)) ? de(t) : t;
734
- }, Kt = (e) => {
630
+ return t && (!V(t) || !L(t)) ? ue(t) : t;
631
+ }, qt = (e) => {
735
632
  const t = e.target;
736
633
  let n;
737
634
  if (t instanceof HTMLTableCellElement) {
738
635
  const o = t.parentElement?.parentElement;
739
636
  if (o) {
740
- const s = o.firstElementChild?.children[t.cellIndex];
741
- s && (n = s);
637
+ const r = o.firstElementChild?.children[t.cellIndex];
638
+ r && (n = r);
742
639
  }
743
640
  } else if (t instanceof HTMLTableRowElement) {
744
641
  const o = t.parentElement;
745
642
  if (o) {
746
- const s = o.firstElementChild;
747
- s && (n = s);
643
+ const r = o.firstElementChild;
644
+ r && (n = r);
748
645
  }
749
646
  }
750
- return n && (!V(n) || !L(n)) ? fe(n) : n;
751
- }, be = (e) => {
647
+ return n && (!V(n) || !L(n)) ? ce(n) : n;
648
+ }, he = (e) => {
752
649
  const t = e.target;
753
- return fe(t);
754
- }, fe = (e) => {
650
+ return ce(t);
651
+ }, ce = (e) => {
755
652
  let t;
756
653
  if (e instanceof HTMLTableCellElement) {
757
654
  const n = e.parentElement?.nextElementSibling;
@@ -763,183 +660,183 @@ const L = (e) => {
763
660
  const n = e.nextElementSibling;
764
661
  n && (t = n);
765
662
  }
766
- return t && (!V(t) || !L(t)) ? fe(t) : t;
767
- }, zt = (e) => {
663
+ return t && (!V(t) || !L(t)) ? ce(t) : t;
664
+ }, Ut = (e) => {
768
665
  const t = e.target;
769
666
  let n;
770
667
  if (t instanceof HTMLTableCellElement) {
771
668
  const o = t.parentElement?.parentElement;
772
669
  if (o) {
773
- const s = o.lastElementChild?.children[t.cellIndex];
774
- s && (n = s);
670
+ const r = o.lastElementChild?.children[t.cellIndex];
671
+ r && (n = r);
775
672
  }
776
673
  } else if (t instanceof HTMLTableRowElement) {
777
674
  const o = t.parentElement;
778
675
  if (o) {
779
- const s = o.lastElementChild;
780
- s && (n = s);
676
+ const r = o.lastElementChild;
677
+ r && (n = r);
781
678
  }
782
679
  }
783
- return n && (!V(n) || !L(n)) ? de(n) : n;
784
- }, we = (e) => {
680
+ return n && (!V(n) || !L(n)) ? ue(n) : n;
681
+ }, ge = (e) => {
785
682
  const t = e.target;
786
- return me(t);
787
- }, me = (e) => {
683
+ return de(t);
684
+ }, de = (e) => {
788
685
  let t;
789
- return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!V(t) || !L(t)) ? me(t) : t;
790
- }, ke = (e) => {
686
+ return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!V(t) || !L(t)) ? de(t) : t;
687
+ }, ye = (e) => {
791
688
  const t = e.target;
792
- return pe(t);
793
- }, pe = (e) => {
689
+ return fe(t);
690
+ }, fe = (e) => {
794
691
  let t;
795
- return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!V(t) || !L(t)) ? pe(t) : t;
796
- }, xe = (e) => {
692
+ return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!V(t) || !L(t)) ? fe(t) : t;
693
+ }, be = (e) => {
797
694
  const t = e.target.parentElement?.firstElementChild;
798
- return t && (!V(t) || !L(t)) ? pe(t) : t;
799
- }, De = (e) => {
695
+ return t && (!V(t) || !L(t)) ? fe(t) : t;
696
+ }, we = (e) => {
800
697
  const t = e.target.parentElement?.lastElementChild;
801
- return t && (!V(t) || !L(t)) ? me(t) : t;
802
- }, X = ["alt", "control", "shift", "meta"], Gt = {
698
+ return t && (!V(t) || !L(t)) ? de(t) : t;
699
+ }, J = ["alt", "control", "shift", "meta"], Wt = {
803
700
  ArrowUp: "up",
804
701
  ArrowDown: "down",
805
702
  ArrowLeft: "left",
806
703
  ArrowRight: "right"
807
- }, Pe = {
704
+ }, _e = {
808
705
  "keydown.up": (e) => {
809
- const t = ye(e);
706
+ const t = pe(e);
810
707
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
811
708
  },
812
709
  "keydown.down": (e) => {
813
- const t = be(e);
710
+ const t = he(e);
814
711
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
815
712
  },
816
713
  "keydown.left": (e) => {
817
- const t = we(e);
714
+ const t = ge(e);
818
715
  e.preventDefault(), e.stopPropagation(), t && t.focus();
819
716
  },
820
717
  "keydown.right": (e) => {
821
- const t = ke(e);
718
+ const t = ye(e);
822
719
  e.preventDefault(), e.stopPropagation(), t && t.focus();
823
720
  },
824
721
  "keydown.control.up": (e) => {
825
- const t = Kt(e);
722
+ const t = qt(e);
826
723
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
827
724
  },
828
725
  "keydown.control.down": (e) => {
829
- const t = zt(e);
726
+ const t = Ut(e);
830
727
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
831
728
  },
832
729
  "keydown.control.left": (e) => {
833
- const t = xe(e);
730
+ const t = be(e);
834
731
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
835
732
  },
836
733
  "keydown.control.right": (e) => {
837
- const t = De(e);
734
+ const t = we(e);
838
735
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
839
736
  },
840
737
  "keydown.end": (e) => {
841
- const t = De(e);
738
+ const t = we(e);
842
739
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
843
740
  },
844
741
  "keydown.enter": (e) => {
845
742
  if (e.target instanceof HTMLTableCellElement) {
846
743
  e.preventDefault(), e.stopPropagation();
847
- const t = be(e);
744
+ const t = he(e);
848
745
  t && t.focus();
849
746
  }
850
747
  },
851
748
  "keydown.shift.enter": (e) => {
852
749
  if (e.target instanceof HTMLTableCellElement) {
853
750
  e.preventDefault(), e.stopPropagation();
854
- const t = ye(e);
751
+ const t = pe(e);
855
752
  t && t.focus();
856
753
  }
857
754
  },
858
755
  "keydown.home": (e) => {
859
- const t = xe(e);
756
+ const t = be(e);
860
757
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
861
758
  },
862
759
  "keydown.tab": (e) => {
863
- const t = ke(e);
760
+ const t = ye(e);
864
761
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
865
762
  },
866
763
  "keydown.shift.tab": (e) => {
867
- const t = we(e);
764
+ const t = ge(e);
868
765
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
869
766
  }
870
767
  };
871
- function Xt(e) {
872
- const t = (i) => {
768
+ function Nt(e) {
769
+ const t = (s) => {
873
770
  let l = null;
874
- return i.parent && (typeof i.parent == "string" ? l = document.querySelector(i.parent) : i.parent instanceof HTMLElement ? l = i.parent : l = i.parent.value), l;
875
- }, n = (i) => {
876
- const l = t(i);
771
+ return s.parent && (typeof s.parent == "string" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;
772
+ }, n = (s) => {
773
+ const l = t(s);
877
774
  let a = [];
878
- if (typeof i.selectors == "string")
879
- a = l ? Array.from(l.querySelectorAll(i.selectors)) : Array.from(document.querySelectorAll(i.selectors));
880
- else if (Array.isArray(i.selectors))
881
- for (const r of i.selectors)
882
- r instanceof HTMLElement ? a.push(r) : a.push(r.$el);
883
- else if (i.selectors instanceof HTMLElement)
884
- a.push(i.selectors);
885
- else if (i.selectors?.value)
886
- if (Array.isArray(i.selectors.value))
887
- for (const r of i.selectors.value)
888
- r instanceof HTMLElement ? a.push(r) : a.push(r.$el);
775
+ if (typeof s.selectors == "string")
776
+ a = l ? Array.from(l.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
777
+ else if (Array.isArray(s.selectors))
778
+ for (const i of s.selectors)
779
+ i instanceof HTMLElement ? a.push(i) : a.push(i.$el);
780
+ else if (s.selectors instanceof HTMLElement)
781
+ a.push(s.selectors);
782
+ else if (s.selectors?.value)
783
+ if (Array.isArray(s.selectors.value))
784
+ for (const i of s.selectors.value)
785
+ i instanceof HTMLElement ? a.push(i) : a.push(i.$el);
889
786
  else
890
- a.push(i.selectors.value);
787
+ a.push(s.selectors.value);
891
788
  return a;
892
- }, o = (i) => {
893
- const l = t(i);
789
+ }, o = (s) => {
790
+ const l = t(s);
894
791
  let a = [];
895
- return i.selectors ? a = n(i) : l && (a = Array.from(l.children).filter((r) => V(r) && L(r))), a;
896
- }, s = (i) => (l) => {
897
- const a = Gt[l.key] || l.key.toLowerCase();
898
- if (X.includes(a)) return;
899
- const r = i.handlers || Pe;
900
- for (const f of Object.keys(r)) {
792
+ return s.selectors ? a = n(s) : l && (a = Array.from(l.children).filter((i) => V(i) && L(i))), a;
793
+ }, r = (s) => (l) => {
794
+ const a = Wt[l.key] || l.key.toLowerCase();
795
+ if (J.includes(a)) return;
796
+ const i = s.handlers || _e;
797
+ for (const f of Object.keys(i)) {
901
798
  const [v, ...d] = f.split(".");
902
799
  if (v === "keydown" && d.includes(a)) {
903
- const p = r[f], k = d.filter((m) => X.includes(m)), I = X.some((m) => {
800
+ const p = i[f], k = d.filter((m) => J.includes(m)), A = J.some((m) => {
904
801
  const h = m.charAt(0).toUpperCase() + m.slice(1);
905
802
  return l.getModifierState(h);
906
803
  });
907
804
  if (k.length > 0) {
908
- if (I) {
909
- for (const m of X)
805
+ if (A) {
806
+ for (const m of J)
910
807
  if (d.includes(m)) {
911
808
  const h = m.charAt(0).toUpperCase() + m.slice(1);
912
809
  l.getModifierState(h) && p(l);
913
810
  }
914
811
  }
915
812
  } else
916
- I || p(l);
813
+ A || p(l);
917
814
  }
918
815
  }
919
816
  }, u = [];
920
- se(() => {
921
- for (const i of e) {
922
- const l = t(i), a = o(i), r = s(i), f = l ? [l] : a;
817
+ ae(() => {
818
+ for (const s of e) {
819
+ const l = t(s), a = o(s), i = r(s), f = l ? [l] : a;
923
820
  for (const v of f) {
924
- const { focused: d } = Yt(D(v)), p = O(d, (k) => {
925
- k ? v.addEventListener("keydown", r) : v.removeEventListener("keydown", r);
821
+ const { focused: d } = Ht(D(v)), p = F(d, (k) => {
822
+ k ? v.addEventListener("keydown", i) : v.removeEventListener("keydown", i);
926
823
  });
927
824
  u.push(p);
928
825
  }
929
826
  }
930
- }), Ne(() => {
931
- for (const i of u)
932
- i();
827
+ }), qe(() => {
828
+ for (const s of u)
829
+ s();
933
830
  });
934
831
  }
935
- const Jt = {
832
+ const jt = {
833
+ ref: "datepicker",
936
834
  class: "adatepicker",
937
- tabindex: "0",
938
- ref: "datepicker"
939
- }, Qt = {
835
+ tabindex: "0"
836
+ }, Yt = {
940
837
  colspan: "5",
941
838
  tabindex: -1
942
- }, Zt = ["onClick", "onKeydown"], en = 6, Ee = 7, tn = /* @__PURE__ */ C({
839
+ }, Kt = ["onClick", "onKeydown"], zt = 6, ke = 7, Gt = /* @__PURE__ */ C({
943
840
  __name: "ADatePicker",
944
841
  props: {
945
842
  modelValue: { default: /* @__PURE__ */ new Date() },
@@ -947,9 +844,9 @@ const Jt = {
947
844
  },
948
845
  emits: ["update:modelValue"],
949
846
  setup(e, { expose: t }) {
950
- const n = q(e, "modelValue"), o = D(new Date(n.value)), s = D(o.value.getMonth()), u = D(o.value.getFullYear()), i = D([]), l = Ae("datepicker");
951
- se(async () => {
952
- a(), await je();
847
+ const n = q(e, "modelValue"), o = D(new Date(n.value)), r = D(o.value.getMonth()), u = D(o.value.getFullYear()), s = D([]), l = De("datepicker");
848
+ ae(async () => {
849
+ a(), await We();
953
850
  const y = document.getElementsByClassName("selectedDate");
954
851
  if (y.length > 0)
955
852
  y[0].focus();
@@ -959,57 +856,56 @@ const Jt = {
959
856
  }
960
857
  });
961
858
  const a = () => {
962
- i.value = [];
963
- const y = new Date(u.value, s.value, 1), x = y.getDay(), _ = y.setDate(y.getDate() - x);
859
+ s.value = [];
860
+ const y = new Date(u.value, r.value, 1), x = y.getDay(), $ = y.setDate(y.getDate() - x);
964
861
  for (const P of Array(43).keys())
965
- i.value.push(_ + P * 864e5);
862
+ s.value.push($ + P * 864e5);
966
863
  };
967
- O([s, u], a);
968
- const r = () => u.value -= 1, f = () => u.value += 1, v = () => {
969
- s.value == 0 ? (s.value = 11, r()) : s.value -= 1;
864
+ F([r, u], a);
865
+ const i = () => u.value -= 1, f = () => u.value += 1, v = () => {
866
+ r.value == 0 ? (r.value = 11, i()) : r.value -= 1;
970
867
  }, d = () => {
971
- s.value == 11 ? (s.value = 0, f()) : s.value += 1;
868
+ r.value == 11 ? (r.value = 0, f()) : r.value += 1;
972
869
  }, p = (y) => {
973
870
  const x = /* @__PURE__ */ new Date();
974
- if (s.value === x.getMonth())
871
+ if (r.value === x.getMonth())
975
872
  return x.toDateString() === new Date(y).toDateString();
976
- }, k = (y) => new Date(y).toDateString() === new Date(o.value).toDateString(), I = (y, x) => (y - 1) * Ee + x, m = (y, x) => i.value[I(y, x)], h = (y) => {
977
- n.value = o.value = new Date(i.value[y]);
978
- }, E = T(() => new Date(u.value, s.value, 1).toLocaleDateString(void 0, {
873
+ }, k = (y) => new Date(y).toDateString() === new Date(o.value).toDateString(), A = (y, x) => (y - 1) * ke + x, m = (y, x) => s.value[A(y, x)], h = (y) => {
874
+ n.value = o.value = new Date(s.value[y]);
875
+ }, E = T(() => new Date(u.value, r.value, 1).toLocaleDateString(void 0, {
979
876
  year: "numeric",
980
877
  month: "long"
981
878
  }));
982
- return Xt([
879
+ return Nt([
983
880
  {
984
881
  parent: l,
985
882
  selectors: "td",
986
883
  handlers: {
987
- ...Pe,
884
+ ..._e,
988
885
  "keydown.pageup": v,
989
- "keydown.shift.pageup": r,
886
+ "keydown.shift.pageup": i,
990
887
  "keydown.pagedown": d,
991
888
  "keydown.shift.pagedown": f,
992
889
  // TODO: this is a hack to override the stonecrop enter handler;
993
890
  // store context inside the component so that handlers can be setup consistently
994
- // eslint-disable-next-line @typescript-eslint/no-empty-function
995
891
  "keydown.enter": () => {
996
892
  }
997
893
  }
998
894
  }
999
- ]), t({ currentMonth: s, currentYear: u, selectedDate: o }), (y, x) => (g(), w("div", Jt, [
895
+ ]), t({ currentMonth: r, currentYear: u, selectedDate: o }), (y, x) => (g(), b("div", jt, [
1000
896
  c("table", null, [
1001
897
  c("tbody", null, [
1002
898
  c("tr", null, [
1003
899
  c("td", {
1004
900
  id: "previous-month-btn",
1005
- onClick: v,
1006
- tabindex: -1
901
+ tabindex: -1,
902
+ onClick: v
1007
903
  }, "<"),
1008
- c("th", Qt, A(E.value), 1),
904
+ c("th", Yt, I(E.value), 1),
1009
905
  c("td", {
1010
906
  id: "next-month-btn",
1011
- onClick: d,
1012
- tabindex: -1
907
+ tabindex: -1,
908
+ onClick: d
1013
909
  }, ">")
1014
910
  ]),
1015
911
  x[0] || (x[0] = c("tr", { class: "days-header" }, [
@@ -1021,37 +917,37 @@ const Jt = {
1021
917
  c("td", null, "S"),
1022
918
  c("td", null, "S")
1023
919
  ], -1)),
1024
- (g(), w(Y, null, j(en, (_) => c("tr", { key: _ }, [
1025
- (g(), w(Y, null, j(Ee, (P) => c("td", {
920
+ (g(), b(j, null, Y(zt, ($) => c("tr", { key: $ }, [
921
+ (g(), b(j, null, Y(ke, (P) => c("td", {
1026
922
  ref_for: !0,
1027
923
  ref: "celldate",
1028
- key: I(_, P),
924
+ key: A($, P),
1029
925
  contenteditable: !1,
1030
926
  spellcheck: !1,
1031
927
  tabindex: 0,
1032
- onClick: Se((Fe) => h(I(_, P)), ["prevent", "stop"]),
1033
- onKeydown: R((Fe) => h(I(_, P)), ["enter"]),
1034
- class: Z({
1035
- todaysDate: p(m(_, P)),
1036
- selectedDate: k(m(_, P))
1037
- })
1038
- }, A(new Date(m(_, P)).getDate()), 43, Zt)), 64))
928
+ class: X({
929
+ todaysDate: p(m($, P)),
930
+ selectedDate: k(m($, P))
931
+ }),
932
+ onClick: Te((Ve) => h(A($, P)), ["prevent", "stop"]),
933
+ onKeydown: R((Ve) => h(A($, P)), ["enter"])
934
+ }, I(new Date(m($, P)).getDate()), 43, Kt)), 64))
1039
935
  ])), 64))
1040
936
  ])
1041
937
  ])
1042
938
  ], 512));
1043
939
  }
1044
- }), nn = /* @__PURE__ */ $(tn, [["__scopeId", "data-v-f49cfd40"]]), on = /* @__PURE__ */ C({
940
+ }), Jt = /* @__PURE__ */ _(Gt, [["__scopeId", "data-v-056d2b5e"]]), Qt = /* @__PURE__ */ C({
1045
941
  __name: "CollapseButton",
1046
942
  props: {
1047
943
  collapsed: { type: Boolean }
1048
944
  },
1049
945
  setup(e) {
1050
- return (t, n) => (g(), w("button", {
1051
- class: Z(["collapse-button", e.collapsed ? "rotated" : "unrotated"])
946
+ return (t, n) => (g(), b("button", {
947
+ class: X(["collapse-button", e.collapsed ? "rotated" : "unrotated"])
1052
948
  }, "×", 2));
1053
949
  }
1054
- }), ln = /* @__PURE__ */ $(on, [["__scopeId", "data-v-6f1c1b45"]]), an = { class: "aform" }, sn = /* @__PURE__ */ C({
950
+ }), Xt = /* @__PURE__ */ _(Qt, [["__scopeId", "data-v-6f1c1b45"]]), Zt = { class: "aform" }, en = /* @__PURE__ */ C({
1055
951
  __name: "AForm",
1056
952
  props: {
1057
953
  modelValue: {},
@@ -1060,15 +956,15 @@ const Jt = {
1060
956
  },
1061
957
  emits: ["update:modelValue"],
1062
958
  setup(e, { emit: t }) {
1063
- const n = t, o = D(e.data || {}), s = (i) => {
959
+ const n = t, o = D(e.data || {}), r = (s) => {
1064
960
  let l = {};
1065
- for (const [a, r] of Object.entries(i))
1066
- ["component", "fieldtype"].includes(a) || (l[a] = r), a === "rows" && r && r.length === 0 && (l.rows = o.value[i.fieldname]);
961
+ for (const [a, i] of Object.entries(s))
962
+ ["component", "fieldtype"].includes(a) || (l[a] = i), a === "rows" && i && i.length === 0 && (l.rows = o.value[s.fieldname]);
1067
963
  return l;
1068
964
  }, u = T({
1069
- get: () => e.modelValue.map((i, l) => T({
965
+ get: () => e.modelValue.map((s, l) => T({
1070
966
  get() {
1071
- return i.value;
967
+ return s.value;
1072
968
  },
1073
969
  set: (a) => {
1074
970
  e.modelValue[l].value = a, n("update:modelValue", e.modelValue);
@@ -1077,85 +973,85 @@ const Jt = {
1077
973
  set: () => {
1078
974
  }
1079
975
  });
1080
- return (i, l) => (g(), w("form", an, [
1081
- (g(!0), w(Y, null, j(e.modelValue, (a, r) => (g(), ae(Ke(a.component), ze({
1082
- key: r,
976
+ return (s, l) => (g(), b("form", Zt, [
977
+ (g(!0), b(j, null, Y(e.modelValue, (a, i) => (g(), le(Ne(a.component), je({
978
+ key: i,
979
+ modelValue: u.value[i].value,
980
+ "onUpdate:modelValue": (f) => u.value[i].value = f,
1083
981
  schema: a,
1084
- modelValue: u.value[r].value,
1085
- "onUpdate:modelValue": (f) => u.value[r].value = f,
1086
982
  data: o.value[a.fieldname],
1087
983
  readonly: e.readonly
1088
- }, { ref_for: !0 }, s(a)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
984
+ }, { ref_for: !0 }, r(a)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "readonly"]))), 128))
1089
985
  ]));
1090
986
  }
1091
- }), Oe = /* @__PURE__ */ $(sn, [["__scopeId", "data-v-68845234"]]), rn = /* @__PURE__ */ C({
987
+ }), Le = /* @__PURE__ */ _(en, [["__scopeId", "data-v-da354cb0"]]), tn = /* @__PURE__ */ C({
1092
988
  __name: "AFieldset",
1093
989
  props: {
1094
990
  schema: {},
1095
991
  label: {},
1096
992
  collapsible: { type: Boolean },
1097
- data: {}
993
+ data: { default: () => ({}) }
1098
994
  },
1099
995
  setup(e, { expose: t }) {
1100
- const n = D(!1), o = D(e.data || []), s = D(e.schema), u = (i) => {
1101
- i.preventDefault(), e.collapsible && (n.value = !n.value);
996
+ const n = D(!1), o = D(e.data || []), r = D(e.schema), u = (s) => {
997
+ s.preventDefault(), e.collapsible && (n.value = !n.value);
1102
998
  };
1103
- return t({ collapsed: n }), (i, l) => (g(), w("fieldset", null, [
999
+ return t({ collapsed: n }), (s, l) => (g(), b("fieldset", null, [
1104
1000
  c("legend", {
1105
1001
  onClick: u,
1106
1002
  onSubmit: u
1107
1003
  }, [
1108
- $e(A(e.label) + " ", 1),
1109
- e.collapsible ? (g(), ae(ln, {
1004
+ Ce(I(e.label) + " ", 1),
1005
+ e.collapsible ? (g(), le(Xt, {
1110
1006
  key: 0,
1111
1007
  collapsed: n.value
1112
- }, null, 8, ["collapsed"])) : re("", !0)
1008
+ }, null, 8, ["collapsed"])) : se("", !0)
1113
1009
  ], 32),
1114
- Ge(i.$slots, "default", { collapsed: n.value }, () => [
1115
- M(Xe(Oe, {
1116
- modelValue: s.value,
1117
- "onUpdate:modelValue": l[0] || (l[0] = (a) => s.value = a),
1010
+ Ye(s.$slots, "default", { collapsed: n.value }, () => [
1011
+ M(Ke(Le, {
1012
+ modelValue: r.value,
1013
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => r.value = a),
1118
1014
  data: o.value
1119
1015
  }, null, 8, ["modelValue", "data"]), [
1120
- [W, !n.value]
1016
+ [U, !n.value]
1121
1017
  ])
1122
1018
  ], !0)
1123
1019
  ]));
1124
1020
  }
1125
- }), un = /* @__PURE__ */ $(rn, [["__scopeId", "data-v-e7ea7e12"]]), cn = { class: "aform_form-element aform_file-attach aform__grid--full" }, dn = {
1021
+ }), nn = /* @__PURE__ */ _(tn, [["__scopeId", "data-v-40b2a95d"]]), on = { class: "aform_form-element aform_file-attach aform__grid--full" }, ln = {
1126
1022
  key: 0,
1127
1023
  class: "aform_file-attach-feedback"
1128
- }, fn = ["disabled"], mn = /* @__PURE__ */ C({
1024
+ }, an = ["disabled"], sn = /* @__PURE__ */ C({
1129
1025
  __name: "AFileAttach",
1130
1026
  props: {
1131
1027
  label: {}
1132
1028
  },
1133
1029
  setup(e) {
1134
- const { files: t, open: n, reset: o, onChange: s } = wt(), u = T(() => `${t.value.length} ${t.value.length === 1 ? "file" : "files"}`);
1135
- return s((i) => i), (i, l) => (g(), w("div", cn, [
1136
- S(t) ? (g(), w("div", dn, [
1030
+ const { files: t, open: n, reset: o, onChange: r } = pt(), u = T(() => `${t.value.length} ${t.value.length === 1 ? "file" : "files"}`);
1031
+ return r((s) => s), (s, l) => (g(), b("div", on, [
1032
+ S(t) ? (g(), b("div", ln, [
1137
1033
  c("p", null, [
1138
- l[2] || (l[2] = $e(" You have selected: ", -1)),
1139
- c("b", null, A(u.value), 1)
1034
+ l[2] || (l[2] = Ce(" You have selected: ", -1)),
1035
+ c("b", null, I(u.value), 1)
1140
1036
  ]),
1141
- (g(!0), w(Y, null, j(S(t), (a) => (g(), w("li", {
1037
+ (g(!0), b(j, null, Y(S(t), (a) => (g(), b("li", {
1142
1038
  key: a.name
1143
- }, A(a.name), 1))), 128))
1144
- ])) : re("", !0),
1039
+ }, I(a.name), 1))), 128))
1040
+ ])) : se("", !0),
1145
1041
  c("button", {
1146
1042
  type: "button",
1147
- onClick: l[0] || (l[0] = (a) => S(n)()),
1148
- class: "aform_form-btn"
1149
- }, A(e.label), 1),
1043
+ class: "aform_form-btn",
1044
+ onClick: l[0] || (l[0] = (a) => S(n)())
1045
+ }, I(e.label), 1),
1150
1046
  c("button", {
1151
1047
  type: "button",
1152
1048
  disabled: !S(t),
1153
- onClick: l[1] || (l[1] = (a) => S(o)()),
1154
- class: "aform_form-btn"
1155
- }, "Reset", 8, fn)
1049
+ class: "aform_form-btn",
1050
+ onClick: l[1] || (l[1] = (a) => S(o)())
1051
+ }, "Reset", 8, an)
1156
1052
  ]));
1157
1053
  }
1158
- }), pn = /* @__PURE__ */ $(mn, [["__scopeId", "data-v-0b3a11cc"]]), vn = { class: "aform_form-element" }, hn = ["id", "disabled", "required"], gn = ["for"], yn = ["innerHTML"], bn = /* @__PURE__ */ C({
1054
+ }), rn = /* @__PURE__ */ _(sn, [["__scopeId", "data-v-b700734f"]]), un = { class: "aform_form-element" }, cn = ["id", "disabled", "required"], dn = ["for"], fn = ["innerHTML"], mn = /* @__PURE__ */ C({
1159
1055
  __name: "ANumericInput",
1160
1056
  props: /* @__PURE__ */ z({
1161
1057
  schema: {},
@@ -1172,30 +1068,30 @@ const Jt = {
1172
1068
  emits: ["update:modelValue"],
1173
1069
  setup(e) {
1174
1070
  const t = q(e, "modelValue");
1175
- return (n, o) => (g(), w("div", vn, [
1071
+ return (n, o) => (g(), b("div", un, [
1176
1072
  M(c("input", {
1073
+ id: e.uuid,
1074
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
1177
1075
  class: "aform_input-field",
1178
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
1179
1076
  type: "number",
1180
- id: e.uuid,
1181
1077
  disabled: e.readonly,
1182
1078
  required: e.required
1183
- }, null, 8, hn), [
1079
+ }, null, 8, cn), [
1184
1080
  [H, t.value]
1185
1081
  ]),
1186
1082
  c("label", {
1187
1083
  class: "aform_field-label",
1188
1084
  for: e.uuid
1189
- }, A(e.label), 9, gn),
1085
+ }, I(e.label), 9, dn),
1190
1086
  M(c("p", {
1191
1087
  class: "aform_error",
1192
1088
  innerHTML: e.validation.errorMessage
1193
- }, null, 8, yn), [
1194
- [W, e.validation.errorMessage]
1089
+ }, null, 8, fn), [
1090
+ [U, e.validation.errorMessage]
1195
1091
  ])
1196
1092
  ]));
1197
1093
  }
1198
- }), Me = {
1094
+ }), xe = {
1199
1095
  date: "##/##/####",
1200
1096
  datetime: "####/##/## ##:##",
1201
1097
  time: "##:##",
@@ -1203,55 +1099,55 @@ const Jt = {
1203
1099
  phone: "(###) ### - ####",
1204
1100
  card: "#### #### #### ####"
1205
1101
  };
1206
- function wn(e) {
1102
+ function vn(e) {
1207
1103
  try {
1208
1104
  return Function(`"use strict";return (${e})`)();
1209
1105
  } catch {
1210
1106
  }
1211
1107
  }
1212
- function kn(e) {
1108
+ function pn(e) {
1213
1109
  let t = e.value;
1214
1110
  if (t) {
1215
- const n = wn(t);
1111
+ const n = vn(t);
1216
1112
  if (n) {
1217
1113
  const o = e.instance?.locale;
1218
1114
  t = n(o);
1219
1115
  }
1220
1116
  } else {
1221
1117
  const o = e.instance?.schema?.fieldtype?.toLowerCase();
1222
- o && Me[o] && (t = Me[o]);
1118
+ o && xe[o] && (t = xe[o]);
1223
1119
  }
1224
1120
  return t;
1225
1121
  }
1226
- function xn(e, t) {
1122
+ function hn(e, t) {
1227
1123
  let n = e;
1228
1124
  const o = [t, "/", "-", "(", ")", " "];
1229
- for (const s of o)
1230
- n = n.replaceAll(s, "");
1125
+ for (const r of o)
1126
+ n = n.replaceAll(r, "");
1231
1127
  return n;
1232
1128
  }
1233
- function Dn(e, t, n) {
1129
+ function gn(e, t, n) {
1234
1130
  let o = t;
1235
- for (const s of e) {
1131
+ for (const r of e) {
1236
1132
  const u = o.indexOf(n);
1237
1133
  if (u !== -1) {
1238
- const i = o.substring(0, u), l = o.substring(u + 1);
1239
- o = i + s + l;
1134
+ const s = o.substring(0, u), l = o.substring(u + 1);
1135
+ o = s + r + l;
1240
1136
  }
1241
1137
  }
1242
1138
  return o.slice(0, t.length);
1243
1139
  }
1244
- function En(e, t) {
1245
- const n = kn(t);
1140
+ function yn(e, t) {
1141
+ const n = pn(t);
1246
1142
  if (!n) return;
1247
- const o = "#", s = e.value, u = xn(s, o);
1143
+ const o = "#", r = e.value, u = hn(r, o);
1248
1144
  if (u) {
1249
- const i = Dn(u, n, o);
1250
- t.instance?.maskFilled && (t.instance.maskFilled = !i.includes(o)), e.value = i;
1145
+ const s = gn(u, n, o);
1146
+ t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
1251
1147
  } else
1252
1148
  e.value = n;
1253
1149
  }
1254
- const Mn = { class: "aform_form-element" }, An = ["id", "disabled", "maxlength", "required"], In = ["for"], Tn = ["innerHTML"], Cn = /* @__PURE__ */ C({
1150
+ const bn = { class: "aform_form-element" }, wn = ["id", "disabled", "maxlength", "required"], kn = ["for"], xn = ["innerHTML"], Dn = /* @__PURE__ */ C({
1255
1151
  __name: "ATextInput",
1256
1152
  props: /* @__PURE__ */ z({
1257
1153
  schema: {},
@@ -1268,34 +1164,34 @@ const Mn = { class: "aform_form-element" }, An = ["id", "disabled", "maxlength",
1268
1164
  emits: ["update:modelValue"],
1269
1165
  setup(e) {
1270
1166
  const t = D(!0), n = q(e, "modelValue");
1271
- return (o, s) => (g(), w("div", Mn, [
1167
+ return (o, r) => (g(), b("div", bn, [
1272
1168
  M(c("input", {
1273
- class: "aform_input-field",
1274
- "onUpdate:modelValue": s[0] || (s[0] = (u) => n.value = u),
1275
1169
  id: e.uuid,
1170
+ "onUpdate:modelValue": r[0] || (r[0] = (u) => n.value = u),
1171
+ class: "aform_input-field",
1276
1172
  disabled: e.readonly,
1277
- maxlength: e.mask ? t.value && e.mask.length : void 0,
1173
+ maxlength: e.mask && t.value ? e.mask.length : void 0,
1278
1174
  required: e.required
1279
- }, null, 8, An), [
1175
+ }, null, 8, wn), [
1280
1176
  [H, n.value],
1281
- [S(En), e.mask]
1177
+ [S(yn), e.mask]
1282
1178
  ]),
1283
1179
  c("label", {
1284
1180
  class: "aform_field-label",
1285
1181
  for: e.uuid
1286
- }, A(e.label), 9, In),
1182
+ }, I(e.label), 9, kn),
1287
1183
  M(c("p", {
1288
1184
  class: "aform_error",
1289
1185
  innerHTML: e.validation.errorMessage
1290
- }, null, 8, Tn), [
1291
- [W, e.validation.errorMessage]
1186
+ }, null, 8, xn), [
1187
+ [U, e.validation.errorMessage]
1292
1188
  ])
1293
1189
  ]));
1294
1190
  }
1295
- }), _n = { class: "login-container" }, Sn = { class: "account-container" }, $n = { class: "account-header" }, Ln = { id: "account-title" }, Vn = { id: "account-subtitle" }, Pn = { class: "login-form-container" }, On = { class: "login-form-email aform_form-element" }, Fn = ["disabled"], Rn = { class: "login-form-password aform_form-element" }, Hn = ["disabled"], Bn = ["disabled"], qn = {
1191
+ }), En = { class: "login-container" }, Mn = { class: "account-container" }, In = { class: "account-header" }, An = { id: "account-title" }, Tn = { id: "account-subtitle" }, Cn = { class: "login-form-container" }, $n = { class: "login-form-email aform_form-element" }, Sn = ["disabled"], _n = { class: "login-form-password aform_form-element" }, Ln = ["disabled"], Vn = ["disabled"], Pn = {
1296
1192
  key: 0,
1297
1193
  class: "material-symbols-outlined loading-icon"
1298
- }, Wn = /* @__PURE__ */ C({
1194
+ }, Fn = /* @__PURE__ */ C({
1299
1195
  __name: "Login",
1300
1196
  props: {
1301
1197
  headerTitle: { default: "Login" },
@@ -1303,94 +1199,94 @@ const Mn = { class: "aform_form-element" }, An = ["id", "disabled", "maxlength",
1303
1199
  },
1304
1200
  emits: ["loginFailed", "loginSuccess"],
1305
1201
  setup(e, { emit: t }) {
1306
- const n = t, o = D(""), s = D(""), u = D(!1), i = D(!1);
1202
+ const n = t, o = D(""), r = D(""), u = D(!1), s = D(!1);
1307
1203
  function l(a) {
1308
- if (a.preventDefault(), u.value = !0, i.value) {
1204
+ if (a.preventDefault(), u.value = !0, s.value) {
1309
1205
  u.value = !1, n("loginFailed");
1310
1206
  return;
1311
1207
  }
1312
1208
  u.value = !1, n("loginSuccess");
1313
1209
  }
1314
- return (a, r) => (g(), w("div", _n, [
1210
+ return (a, i) => (g(), b("div", En, [
1315
1211
  c("div", null, [
1316
- c("div", Sn, [
1317
- c("div", $n, [
1318
- c("h1", Ln, A(e.headerTitle), 1),
1319
- c("p", Vn, A(e.headerSubtitle), 1)
1212
+ c("div", Mn, [
1213
+ c("div", In, [
1214
+ c("h1", An, I(e.headerTitle), 1),
1215
+ c("p", Tn, I(e.headerSubtitle), 1)
1320
1216
  ]),
1321
1217
  c("form", { onSubmit: l }, [
1322
- c("div", Pn, [
1323
- c("div", On, [
1324
- r[2] || (r[2] = c("label", {
1218
+ c("div", Cn, [
1219
+ c("div", $n, [
1220
+ i[2] || (i[2] = c("label", {
1325
1221
  id: "login-email",
1326
1222
  for: "email",
1327
1223
  class: "aform_field-label"
1328
1224
  }, "Email", -1)),
1329
1225
  M(c("input", {
1330
1226
  id: "email",
1227
+ "onUpdate:modelValue": i[0] || (i[0] = (f) => o.value = f),
1331
1228
  class: "aform_input-field",
1332
1229
  name: "email",
1333
1230
  placeholder: "name@example.com",
1334
1231
  type: "email",
1335
- "onUpdate:modelValue": r[0] || (r[0] = (f) => o.value = f),
1336
1232
  "auto-capitalize": "none",
1337
1233
  "auto-complete": "email",
1338
1234
  "auto-correct": "off",
1339
1235
  disabled: u.value
1340
- }, null, 8, Fn), [
1236
+ }, null, 8, Sn), [
1341
1237
  [H, o.value]
1342
1238
  ])
1343
1239
  ]),
1344
- c("div", Rn, [
1345
- r[3] || (r[3] = c("label", {
1240
+ c("div", _n, [
1241
+ i[3] || (i[3] = c("label", {
1346
1242
  id: "login-password",
1347
1243
  for: "password",
1348
1244
  class: "aform_field-label"
1349
1245
  }, "Password", -1)),
1350
1246
  M(c("input", {
1351
1247
  id: "password",
1248
+ "onUpdate:modelValue": i[1] || (i[1] = (f) => r.value = f),
1352
1249
  class: "aform_input-field",
1353
1250
  name: "password",
1354
1251
  type: "password",
1355
- "onUpdate:modelValue": r[1] || (r[1] = (f) => s.value = f),
1356
1252
  disabled: u.value
1357
- }, null, 8, Hn), [
1358
- [H, s.value]
1253
+ }, null, 8, Ln), [
1254
+ [H, r.value]
1359
1255
  ])
1360
1256
  ]),
1361
1257
  c("button", {
1362
1258
  class: "btn",
1363
- onClick: l,
1364
- disabled: u.value || !o.value || !s.value
1259
+ disabled: u.value || !o.value || !r.value,
1260
+ onClick: l
1365
1261
  }, [
1366
- u.value ? (g(), w("span", qn, "progress_activity")) : re("", !0),
1367
- r[4] || (r[4] = c("span", { id: "login-form-button" }, "Login", -1))
1368
- ], 8, Bn)
1262
+ u.value ? (g(), b("span", Pn, "progress_activity")) : se("", !0),
1263
+ i[4] || (i[4] = c("span", { id: "login-form-button" }, "Login", -1))
1264
+ ], 8, Vn)
1369
1265
  ])
1370
1266
  ], 32),
1371
- r[5] || (r[5] = c("button", { class: "btn" }, [
1267
+ i[5] || (i[5] = c("button", { class: "btn" }, [
1372
1268
  c("span", { id: "forgot-password-button" }, "Forgot password?")
1373
1269
  ], -1))
1374
1270
  ])
1375
1271
  ])
1376
1272
  ]));
1377
1273
  }
1378
- }), Nn = /* @__PURE__ */ $(Wn, [["__scopeId", "data-v-6cbd3add"]]);
1379
- function Yn(e) {
1380
- e.component("ACheckbox", ot), e.component("ACombobox", lt), e.component("ADate", ut), e.component("ADropdown", _t), e.component("ADatePicker", nn), e.component("AFieldset", un), e.component("AFileAttach", pn), e.component("AForm", Oe), e.component("ANumericInput", bn), e.component("ATextInput", Cn);
1274
+ }), On = /* @__PURE__ */ _(Fn, [["__scopeId", "data-v-d9ffd0a7"]]);
1275
+ function Hn(e) {
1276
+ e.component("ACheckbox", et), e.component("ACombobox", tt), e.component("ADate", st), e.component("ADropdown", Et), e.component("ADatePicker", Jt), e.component("AFieldset", nn), e.component("AFileAttach", rn), e.component("AForm", Le), e.component("ANumericInput", mn), e.component("ATextInput", Dn);
1381
1277
  }
1382
1278
  export {
1383
- ot as ACheckbox,
1384
- lt as AComboBox,
1385
- ut as ADate,
1386
- nn as ADatePicker,
1387
- _t as ADropdown,
1388
- un as AFieldset,
1389
- pn as AFileAttach,
1390
- Oe as AForm,
1391
- bn as ANumericInput,
1392
- Cn as ATextInput,
1393
- Nn as Login,
1394
- Yn as install
1279
+ et as ACheckbox,
1280
+ tt as AComboBox,
1281
+ st as ADate,
1282
+ Jt as ADatePicker,
1283
+ Et as ADropdown,
1284
+ nn as AFieldset,
1285
+ rn as AFileAttach,
1286
+ Le as AForm,
1287
+ mn as ANumericInput,
1288
+ Dn as ATextInput,
1289
+ On as Login,
1290
+ Hn as install
1395
1291
  };
1396
1292
  //# sourceMappingURL=aform.js.map