@stonecrop/aform 0.2.33 → 0.2.35

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