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