@stonecrop/aform 0.2.17 → 0.2.20

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 ADDED
@@ -0,0 +1,835 @@
1
+ import { defineComponent as A, mergeModels as $, useModel as x, openBlock as v, createElementBlock as g, createElementVNode as c, withDirectives as M, vModelCheckbox as de, toDisplayString as E, vShow as I, resolveComponent as pe, createBlock as K, withCtx as fe, ref as m, onMounted as Y, onUnmounted as me, normalizeClass as q, withKeys as P, vModelText as G, Fragment as F, renderList as R, watch as O, onBeforeUnmount as ve, computed as H, unref as re, getCurrentScope as he, onScopeDispose as ye, nextTick as ge, withModifiers as be, resolveDynamicComponent as ke, mergeProps as _e, createTextVNode as we, createCommentVNode as De, renderSlot as Me, createVNode as Ee } from "vue";
2
+ const Ae = { id: "checkbox-container" }, Ce = ["id", "readonly", "required"], Te = { id: "custom-checkbox" }, Ve = ["for"], Le = ["innerHTML"], Se = /* @__PURE__ */ A({
3
+ __name: "ACheckbox",
4
+ props: /* @__PURE__ */ $({
5
+ label: {},
6
+ required: { type: Boolean },
7
+ readOnly: { type: Boolean },
8
+ uuid: {},
9
+ validation: { default: () => ({ errorMessage: " " }) }
10
+ }, {
11
+ modelValue: {},
12
+ modelModifiers: {}
13
+ }),
14
+ emits: ["update:modelValue"],
15
+ setup(e) {
16
+ const t = x(e, "modelValue");
17
+ return (n, o) => (v(), g("div", null, [
18
+ c("label", Ae, [
19
+ M(c("input", {
20
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
21
+ type: "checkbox",
22
+ id: n.uuid,
23
+ class: "checkbox",
24
+ readonly: n.readOnly,
25
+ required: n.required
26
+ }, null, 8, Ce), [
27
+ [de, t.value]
28
+ ]),
29
+ c("span", Te, E(t.value), 1)
30
+ ]),
31
+ c("label", {
32
+ for: n.uuid,
33
+ id: "checkbox-label"
34
+ }, E(n.label), 9, Ve),
35
+ M(c("p", {
36
+ innerHTML: n.validation.errorMessage
37
+ }, null, 8, Le), [
38
+ [I, n.validation.errorMessage]
39
+ ])
40
+ ]));
41
+ }
42
+ }), S = (e, t) => {
43
+ const n = e.__vccOpts || e;
44
+ for (const [o, l] of t)
45
+ n[o] = l;
46
+ return n;
47
+ }, $e = /* @__PURE__ */ S(Se, [["__scopeId", "data-v-5093f1cb"]]), xe = /* @__PURE__ */ c("div", null, [
48
+ /* @__PURE__ */ c("input", { type: "text" }),
49
+ /* @__PURE__ */ c("input", { type: "text" }),
50
+ /* @__PURE__ */ c("input", { type: "text" })
51
+ ], -1), Ie = /* @__PURE__ */ A({
52
+ __name: "AComboBox",
53
+ props: ["event", "cellData", "tableID"],
54
+ setup(e) {
55
+ return (t, n) => {
56
+ const o = pe("ATableModal");
57
+ return v(), K(o, {
58
+ event: e.event,
59
+ cellData: e.cellData,
60
+ class: "amodal"
61
+ }, {
62
+ default: fe(() => [
63
+ xe
64
+ ]),
65
+ _: 1
66
+ }, 8, ["event", "cellData"]);
67
+ };
68
+ }
69
+ }), He = ["id", "disabled", "required", "value"], Be = ["for"], Pe = ["innerHTML"], qe = /* @__PURE__ */ A({
70
+ __name: "ADate",
71
+ props: /* @__PURE__ */ $({
72
+ label: { default: "Date" },
73
+ required: { type: Boolean },
74
+ readonly: { type: Boolean },
75
+ uuid: {},
76
+ validation: { default: () => ({ errorMessage: " " }) }
77
+ }, {
78
+ modelValue: {},
79
+ modelModifiers: {}
80
+ }),
81
+ emits: ["update:modelValue"],
82
+ setup(e) {
83
+ const t = x(e, "modelValue"), n = m(null), o = () => {
84
+ n.value && "showPicker" in HTMLInputElement.prototype && n.value.showPicker();
85
+ };
86
+ return (l, r) => (v(), g("div", null, [
87
+ c("input", {
88
+ ref_key: "dateRef",
89
+ ref: n,
90
+ type: "date",
91
+ id: l.uuid,
92
+ disabled: l.readonly,
93
+ required: l.required,
94
+ value: t.value,
95
+ onClick: o
96
+ }, null, 8, He),
97
+ c("label", { for: l.uuid }, E(l.label), 9, Be),
98
+ M(c("p", {
99
+ innerHTML: l.validation.errorMessage
100
+ }, null, 8, Pe), [
101
+ [I, l.validation.errorMessage]
102
+ ])
103
+ ]));
104
+ }
105
+ }), Fe = /* @__PURE__ */ S(qe, [["__scopeId", "data-v-69d0f23d"]]), Re = { class: "input-wrapper" }, Ue = {
106
+ id: "autocomplete-results",
107
+ class: "autocomplete-results"
108
+ }, Oe = {
109
+ key: 0,
110
+ class: "loading autocomplete-result"
111
+ }, We = ["onClick"], Ke = /* @__PURE__ */ A({
112
+ __name: "ADropdown",
113
+ props: /* @__PURE__ */ $({
114
+ label: {},
115
+ items: {},
116
+ isAsync: { type: Boolean }
117
+ }, {
118
+ modelValue: {},
119
+ modelModifiers: {}
120
+ }),
121
+ emits: /* @__PURE__ */ $(["filterChanged"], ["update:modelValue"]),
122
+ setup(e, { emit: t }) {
123
+ const n = e, o = t, l = m(n.items), r = x(e, "modelValue"), s = m(!1), a = m(0), i = m(!1), u = m(null);
124
+ Y(() => {
125
+ document.addEventListener("click", b), f();
126
+ }), me(() => {
127
+ document.removeEventListener("click", b);
128
+ });
129
+ const d = (p) => {
130
+ r.value = p, k();
131
+ }, f = () => {
132
+ r.value ? l.value = n.items.filter((p) => p.toLowerCase().indexOf(r.value.toLowerCase()) > -1) : l.value = n.items;
133
+ }, h = () => {
134
+ i.value = !0, n.isAsync ? (s.value = !0, o("filterChanged", r.value)) : f();
135
+ }, b = (p) => {
136
+ k(), a.value = 0;
137
+ }, k = () => {
138
+ i.value = !1, n.items.includes(r.value) || (r.value = "");
139
+ }, V = () => {
140
+ a.value < l.value.length && (a.value = a.value + 1);
141
+ }, w = () => {
142
+ a.value > 0 && (a.value = a.value - 1);
143
+ }, L = () => {
144
+ r.value = l.value[a.value], k(), a.value = 0;
145
+ };
146
+ return (p, y) => (v(), g("div", {
147
+ class: q(["autocomplete", { isOpen: i.value }])
148
+ }, [
149
+ c("div", Re, [
150
+ M(c("input", {
151
+ ref_key: "mopInput",
152
+ ref: u,
153
+ type: "text",
154
+ onInput: h,
155
+ onFocus: h,
156
+ "onUpdate:modelValue": y[0] || (y[0] = (_) => r.value = _),
157
+ onKeydown: [
158
+ P(V, ["down"]),
159
+ P(w, ["up"]),
160
+ P(L, ["enter"])
161
+ ]
162
+ }, null, 544), [
163
+ [G, r.value]
164
+ ]),
165
+ M(c("ul", Ue, [
166
+ s.value ? (v(), g("li", Oe, "Loading results...")) : (v(!0), g(F, { key: 1 }, R(l.value, (_, D) => (v(), g("li", {
167
+ key: D,
168
+ onClick: (X) => d(_),
169
+ class: q(["autocomplete-result", { "is-active": D === a.value }])
170
+ }, E(_), 11, We))), 128))
171
+ ], 512), [
172
+ [I, i.value]
173
+ ]),
174
+ c("label", null, E(p.label), 1)
175
+ ])
176
+ ], 2));
177
+ }
178
+ });
179
+ function Ye(e) {
180
+ return he() ? (ye(e), !0) : !1;
181
+ }
182
+ function ue(e) {
183
+ return typeof e == "function" ? e() : re(e);
184
+ }
185
+ const Ge = typeof window < "u" && typeof document < "u";
186
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
187
+ const ze = Object.prototype.toString, je = (e) => ze.call(e) === "[object Object]", Je = () => {
188
+ };
189
+ function U(e) {
190
+ var t;
191
+ const n = ue(e);
192
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
193
+ }
194
+ const z = Ge ? window : void 0;
195
+ function W(...e) {
196
+ let t, n, o, l;
197
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = z) : [t, n, o, l] = e, !t)
198
+ return Je;
199
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
200
+ const r = [], s = () => {
201
+ r.forEach((d) => d()), r.length = 0;
202
+ }, a = (d, f, h, b) => (d.addEventListener(f, h, b), () => d.removeEventListener(f, h, b)), i = O(
203
+ () => [U(t), ue(l)],
204
+ ([d, f]) => {
205
+ if (s(), !d)
206
+ return;
207
+ const h = je(f) ? { ...f } : f;
208
+ r.push(
209
+ ...n.flatMap((b) => o.map((k) => a(d, b, k, h)))
210
+ );
211
+ },
212
+ { immediate: !0, flush: "post" }
213
+ ), u = () => {
214
+ i(), s();
215
+ };
216
+ return Ye(u), u;
217
+ }
218
+ function Ne(e = {}) {
219
+ var t;
220
+ const {
221
+ window: n = z,
222
+ deep: o = !0
223
+ } = e, l = (t = e.document) != null ? t : n == null ? void 0 : n.document, r = () => {
224
+ var i;
225
+ let u = l == null ? void 0 : l.activeElement;
226
+ if (o)
227
+ for (; u != null && u.shadowRoot; )
228
+ u = (i = u == null ? void 0 : u.shadowRoot) == null ? void 0 : i.activeElement;
229
+ return u;
230
+ }, s = m(), a = () => {
231
+ s.value = r();
232
+ };
233
+ return n && (W(n, "blur", (i) => {
234
+ i.relatedTarget === null && a();
235
+ }, !0), W(n, "focus", a, !0)), a(), s;
236
+ }
237
+ function Qe(e, t = {}) {
238
+ const n = Ne(t), o = H(() => U(e));
239
+ return { focused: H(() => o.value && n.value ? o.value.contains(n.value) : !1) };
240
+ }
241
+ function Xe(e, { window: t = z, scrollTarget: n } = {}) {
242
+ const o = m(!1), l = () => {
243
+ if (!t)
244
+ return;
245
+ const r = t.document, s = U(e);
246
+ if (!s)
247
+ o.value = !1;
248
+ else {
249
+ const a = s.getBoundingClientRect();
250
+ o.value = a.top <= (t.innerHeight || r.documentElement.clientHeight) && a.left <= (t.innerWidth || r.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
251
+ }
252
+ };
253
+ return O(
254
+ () => U(e),
255
+ () => l(),
256
+ { immediate: !0, flush: "post" }
257
+ ), t && W(n || t, "scroll", l, {
258
+ capture: !1,
259
+ passive: !0
260
+ }), o;
261
+ }
262
+ const C = (e) => {
263
+ let t = Xe(e).value;
264
+ return t = t && e.offsetHeight > 0, t;
265
+ }, T = (e) => e.tabIndex >= 0, Z = (e) => {
266
+ const t = e.target;
267
+ return j(t);
268
+ }, j = (e) => {
269
+ var t;
270
+ let n;
271
+ if (e instanceof HTMLTableCellElement) {
272
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
273
+ if (o) {
274
+ const l = Array.from(o.children)[e.cellIndex];
275
+ l && (n = l);
276
+ }
277
+ } else if (e instanceof HTMLTableRowElement) {
278
+ const o = e.previousElementSibling;
279
+ o && (n = o);
280
+ }
281
+ return n && (!T(n) || !C(n)) ? j(n) : n;
282
+ }, Ze = (e) => {
283
+ var t;
284
+ const n = e.target;
285
+ let o;
286
+ if (n instanceof HTMLTableCellElement) {
287
+ const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
288
+ if (l) {
289
+ const r = l.firstElementChild.children[n.cellIndex];
290
+ r && (o = r);
291
+ }
292
+ } else if (n instanceof HTMLTableRowElement) {
293
+ const l = n.parentElement;
294
+ if (l) {
295
+ const r = l.firstElementChild;
296
+ r && (o = r);
297
+ }
298
+ }
299
+ return o && (!T(o) || !C(o)) ? J(o) : o;
300
+ }, ee = (e) => {
301
+ const t = e.target;
302
+ return J(t);
303
+ }, J = (e) => {
304
+ var t;
305
+ let n;
306
+ if (e instanceof HTMLTableCellElement) {
307
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
308
+ if (o) {
309
+ const l = Array.from(o.children)[e.cellIndex];
310
+ l && (n = l);
311
+ }
312
+ } else if (e instanceof HTMLTableRowElement) {
313
+ const o = e.nextElementSibling;
314
+ o && (n = o);
315
+ }
316
+ return n && (!T(n) || !C(n)) ? J(n) : n;
317
+ }, et = (e) => {
318
+ var t;
319
+ const n = e.target;
320
+ let o;
321
+ if (n instanceof HTMLTableCellElement) {
322
+ const l = (t = n.parentElement) == null ? void 0 : t.parentElement;
323
+ if (l) {
324
+ const r = l.lastElementChild.children[n.cellIndex];
325
+ r && (o = r);
326
+ }
327
+ } else if (n instanceof HTMLTableRowElement) {
328
+ const l = n.parentElement;
329
+ if (l) {
330
+ const r = l.lastElementChild;
331
+ r && (o = r);
332
+ }
333
+ }
334
+ return o && (!T(o) || !C(o)) ? j(o) : o;
335
+ }, te = (e) => {
336
+ const t = e.target;
337
+ return N(t);
338
+ }, N = (e) => {
339
+ var t;
340
+ let n;
341
+ if (e.previousElementSibling)
342
+ n = e.previousElementSibling;
343
+ else {
344
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
345
+ n = o == null ? void 0 : o.lastElementChild;
346
+ }
347
+ return n && (!T(n) || !C(n)) ? N(n) : n;
348
+ }, ne = (e) => {
349
+ const t = e.target;
350
+ return Q(t);
351
+ }, Q = (e) => {
352
+ var t;
353
+ let n;
354
+ if (e.nextElementSibling)
355
+ n = e.nextElementSibling;
356
+ else {
357
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
358
+ n = o == null ? void 0 : o.firstElementChild;
359
+ }
360
+ return n && (!T(n) || !C(n)) ? Q(n) : n;
361
+ }, oe = (e) => {
362
+ const t = e.target.parentElement.firstElementChild;
363
+ return t && (!T(t) || !C(t)) ? Q(t) : t;
364
+ }, le = (e) => {
365
+ const t = e.target.parentElement.lastElementChild;
366
+ return t && (!T(t) || !C(t)) ? N(t) : t;
367
+ }, B = ["alt", "control", "shift", "meta"], tt = {
368
+ ArrowUp: "up",
369
+ ArrowDown: "down",
370
+ ArrowLeft: "left",
371
+ ArrowRight: "right"
372
+ }, ie = {
373
+ "keydown.up": (e) => {
374
+ const t = Z(e);
375
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
376
+ },
377
+ "keydown.down": (e) => {
378
+ const t = ee(e);
379
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
380
+ },
381
+ "keydown.left": (e) => {
382
+ const t = te(e);
383
+ e.preventDefault(), e.stopPropagation(), t && t.focus();
384
+ },
385
+ "keydown.right": (e) => {
386
+ const t = ne(e);
387
+ e.preventDefault(), e.stopPropagation(), t && t.focus();
388
+ },
389
+ "keydown.control.up": (e) => {
390
+ const t = Ze(e);
391
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
392
+ },
393
+ "keydown.control.down": (e) => {
394
+ const t = et(e);
395
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
396
+ },
397
+ "keydown.control.left": (e) => {
398
+ const t = oe(e);
399
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
400
+ },
401
+ "keydown.control.right": (e) => {
402
+ const t = le(e);
403
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
404
+ },
405
+ "keydown.end": (e) => {
406
+ const t = le(e);
407
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
408
+ },
409
+ "keydown.enter": (e) => {
410
+ if (e.target instanceof HTMLTableCellElement) {
411
+ e.preventDefault(), e.stopPropagation();
412
+ const t = ee(e);
413
+ t && t.focus();
414
+ }
415
+ },
416
+ "keydown.shift.enter": (e) => {
417
+ if (e.target instanceof HTMLTableCellElement) {
418
+ e.preventDefault(), e.stopPropagation();
419
+ const t = Z(e);
420
+ t && t.focus();
421
+ }
422
+ },
423
+ "keydown.home": (e) => {
424
+ const t = oe(e);
425
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
426
+ },
427
+ "keydown.tab": (e) => {
428
+ const t = ne(e);
429
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
430
+ },
431
+ "keydown.shift.tab": (e) => {
432
+ const t = te(e);
433
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
434
+ }
435
+ };
436
+ function nt(e) {
437
+ const t = (s) => {
438
+ let a = null;
439
+ return s.parent && (typeof s.parent == "string" ? a = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? a = s.parent : a = s.parent.value), a;
440
+ }, n = (s) => {
441
+ const a = t(s);
442
+ let i = [];
443
+ if (typeof s.selectors == "string")
444
+ i = a ? Array.from(a.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));
445
+ else if (Array.isArray(s.selectors))
446
+ for (const u of s.selectors)
447
+ u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
448
+ else if (s.selectors instanceof HTMLElement)
449
+ i.push(s.selectors);
450
+ else if (Array.isArray(s.selectors.value))
451
+ for (const u of s.selectors.value)
452
+ u instanceof HTMLElement ? i.push(u) : i.push(u.$el);
453
+ else
454
+ i.push(s.selectors.value);
455
+ return i;
456
+ }, o = (s) => {
457
+ const a = t(s);
458
+ let i = [];
459
+ return s.selectors ? i = n(s) : a && (i = Array.from(a.children).filter((u) => T(u) && C(u))), i;
460
+ }, l = (s) => (a) => {
461
+ const i = tt[a.key] || a.key.toLowerCase();
462
+ if (B.includes(i))
463
+ return;
464
+ const u = s.handlers || ie;
465
+ for (const d of Object.keys(u)) {
466
+ const [f, ...h] = d.split(".");
467
+ if (f === "keydown" && h.includes(i)) {
468
+ const b = u[d], k = h.filter((w) => B.includes(w)), V = B.some((w) => {
469
+ const L = w.charAt(0).toUpperCase() + w.slice(1);
470
+ return a.getModifierState(L);
471
+ });
472
+ if (k.length > 0) {
473
+ if (V) {
474
+ for (const w of B)
475
+ if (h.includes(w)) {
476
+ const L = w.charAt(0).toUpperCase() + w.slice(1);
477
+ a.getModifierState(L) && b(a);
478
+ }
479
+ }
480
+ } else
481
+ V || b(a);
482
+ }
483
+ }
484
+ }, r = [];
485
+ Y(() => {
486
+ for (const s of e) {
487
+ const a = t(s), i = o(s), u = l(s), d = a ? [a] : i;
488
+ for (const f of d) {
489
+ const { focused: h } = Qe(m(f)), b = O(h, (k) => {
490
+ k ? f.addEventListener("keydown", u) : f.removeEventListener("keydown", u);
491
+ });
492
+ r.push(b);
493
+ }
494
+ }
495
+ }), ve(() => {
496
+ for (const s of r)
497
+ s();
498
+ });
499
+ }
500
+ const ot = {
501
+ colspan: "5",
502
+ tabindex: -1
503
+ }, lt = /* @__PURE__ */ c("tr", { class: "days-header" }, [
504
+ /* @__PURE__ */ c("td", null, "M"),
505
+ /* @__PURE__ */ c("td", null, "T"),
506
+ /* @__PURE__ */ c("td", null, "W"),
507
+ /* @__PURE__ */ c("td", null, "T"),
508
+ /* @__PURE__ */ c("td", null, "F"),
509
+ /* @__PURE__ */ c("td", null, "S"),
510
+ /* @__PURE__ */ c("td", null, "S")
511
+ ], -1), at = ["onClick", "onKeydown"], st = 6, ae = 7, rt = /* @__PURE__ */ A({
512
+ __name: "ADatePicker",
513
+ props: {
514
+ modelValue: { default: /* @__PURE__ */ new Date() },
515
+ modelModifiers: {}
516
+ },
517
+ emits: ["update:modelValue"],
518
+ setup(e) {
519
+ const t = x(e, "modelValue"), n = m(new Date(t.value)), o = m(n.value.getMonth()), l = m(n.value.getFullYear()), r = m([]), s = m(null);
520
+ Y(async () => {
521
+ a(), await ge();
522
+ const p = document.getElementsByClassName("selectedDate");
523
+ if (p.length > 0)
524
+ p[0].focus();
525
+ else {
526
+ const y = document.getElementsByClassName("todaysDate");
527
+ y.length > 0 && y[0].focus();
528
+ }
529
+ });
530
+ const a = () => {
531
+ r.value = [];
532
+ const p = new Date(l.value, o.value, 1), y = p.getDay(), _ = p.setDate(p.getDate() - y);
533
+ for (const D of Array(43).keys())
534
+ r.value.push(_ + D * 864e5);
535
+ };
536
+ O([o, l], a);
537
+ const i = () => l.value -= 1, u = () => l.value += 1, d = () => {
538
+ o.value == 0 ? (o.value = 11, i()) : o.value -= 1;
539
+ }, f = () => {
540
+ o.value == 11 ? (o.value = 0, u()) : o.value += 1;
541
+ }, h = (p) => {
542
+ const y = /* @__PURE__ */ new Date();
543
+ if (o.value === y.getMonth())
544
+ return y.toDateString() === new Date(p).toDateString();
545
+ }, b = (p) => new Date(p).toDateString() === new Date(n.value).toDateString(), k = (p, y) => (p - 1) * ae + y, V = (p, y) => r.value[k(p, y)], w = (p) => {
546
+ t.value = n.value = new Date(r.value[p]);
547
+ }, L = H(() => new Date(l.value, o.value, 1).toLocaleDateString(void 0, {
548
+ year: "numeric",
549
+ month: "long"
550
+ }));
551
+ return nt([
552
+ {
553
+ parent: s,
554
+ selectors: "td",
555
+ handlers: {
556
+ ...ie,
557
+ "keydown.pageup": d,
558
+ "keydown.shift.pageup": i,
559
+ "keydown.pagedown": f,
560
+ "keydown.shift.pagedown": u,
561
+ // TODO: this is a hack to override the stonecrop enter handler;
562
+ // store context inside the component so that handlers can be setup consistently
563
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
564
+ "keydown.enter": () => {
565
+ }
566
+ }
567
+ }
568
+ ]), (p, y) => (v(), g("div", {
569
+ class: "adatepicker",
570
+ tabindex: "0",
571
+ ref_key: "adatepicker",
572
+ ref: s
573
+ }, [
574
+ c("table", null, [
575
+ c("tr", null, [
576
+ c("td", {
577
+ id: "previous-month-btn",
578
+ onClick: d,
579
+ tabindex: -1
580
+ }, "<"),
581
+ c("th", ot, E(L.value), 1),
582
+ c("td", {
583
+ id: "next-month-btn",
584
+ onClick: f,
585
+ tabindex: -1
586
+ }, ">")
587
+ ]),
588
+ lt,
589
+ (v(), g(F, null, R(st, (_) => c("tr", { key: _ }, [
590
+ (v(), g(F, null, R(ae, (D) => c("td", {
591
+ ref_for: !0,
592
+ ref: "celldate",
593
+ key: k(_, D),
594
+ contenteditable: !1,
595
+ spellcheck: !1,
596
+ tabindex: 0,
597
+ onClick: be((X) => w(k(_, D)), ["prevent", "stop"]),
598
+ onKeydown: P((X) => w(k(_, D)), ["enter"]),
599
+ class: q({
600
+ todaysDate: h(V(_, D)),
601
+ selectedDate: b(V(_, D))
602
+ })
603
+ }, E(new Date(V(_, D)).getDate()), 43, at)), 64))
604
+ ])), 64))
605
+ ])
606
+ ], 512));
607
+ }
608
+ }), ut = /* @__PURE__ */ A({
609
+ __name: "CollapseButton",
610
+ props: {
611
+ collapsed: { type: Boolean }
612
+ },
613
+ setup(e) {
614
+ return (t, n) => (v(), g("button", {
615
+ class: q(["collapse-button", t.collapsed ? "rotated" : "unrotated"])
616
+ }, "×", 2));
617
+ }
618
+ }), it = /* @__PURE__ */ S(ut, [["__scopeId", "data-v-6f1c1b45"]]), ct = /* @__PURE__ */ A({
619
+ __name: "AForm",
620
+ props: {
621
+ modelValue: {},
622
+ data: {},
623
+ readonly: { type: Boolean }
624
+ },
625
+ emits: ["update:modelValue"],
626
+ setup(e, { emit: t }) {
627
+ const n = e, o = t, l = m(n.data || {}), r = (a) => {
628
+ let i = {};
629
+ for (const [u, d] of Object.entries(a))
630
+ ["component", "fieldtype"].includes(u) || (i[u] = d), u === "rows" && d && d.length === 0 && (i.rows = l.value[a.fieldname]);
631
+ return i;
632
+ }, s = H({
633
+ get: () => n.modelValue.map((a, i) => H({
634
+ get() {
635
+ return a.value;
636
+ },
637
+ set: (u) => {
638
+ n.modelValue[i].value = u, o("update:modelValue", n.modelValue);
639
+ }
640
+ })),
641
+ set: () => {
642
+ }
643
+ });
644
+ return (a, i) => (v(), g("form", null, [
645
+ (v(!0), g(F, null, R(a.modelValue, (u, d) => (v(), K(ke(u.component), _e({
646
+ key: d,
647
+ schema: u,
648
+ modelValue: s.value[d].value,
649
+ "onUpdate:modelValue": (f) => s.value[d].value = f,
650
+ data: l.value[u.fieldname],
651
+ readonly: a.readonly
652
+ }, r(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
653
+ ]));
654
+ }
655
+ }), ce = /* @__PURE__ */ S(ct, [["__scopeId", "data-v-74d66cf2"]]), dt = /* @__PURE__ */ A({
656
+ __name: "AFieldset",
657
+ props: {
658
+ schema: {},
659
+ label: {},
660
+ collapsible: { type: Boolean },
661
+ data: {}
662
+ },
663
+ setup(e) {
664
+ const t = e, n = m(t.data || []), o = m(!1), l = m(t.collapsible), r = m(t.schema);
665
+ function s(a) {
666
+ a.preventDefault(), l.value && (o.value = !o.value);
667
+ }
668
+ return (a, i) => (v(), g("fieldset", null, [
669
+ c("legend", {
670
+ onClick: s,
671
+ onSubmit: s
672
+ }, [
673
+ we(E(a.label) + " ", 1),
674
+ l.value ? (v(), K(it, {
675
+ key: 0,
676
+ collapsed: o.value
677
+ }, null, 8, ["collapsed"])) : De("", !0)
678
+ ], 32),
679
+ Me(a.$slots, "default", { collapsed: o.value }, () => [
680
+ M(Ee(ce, {
681
+ modelValue: r.value,
682
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
683
+ data: n.value
684
+ }, null, 8, ["modelValue", "data"]), [
685
+ [I, !o.value]
686
+ ])
687
+ ], !0)
688
+ ]));
689
+ }
690
+ }), pt = /* @__PURE__ */ S(dt, [["__scopeId", "data-v-0f671e32"]]), ft = ["id", "disabled", "required"], mt = ["for"], vt = ["innerHTML"], ht = /* @__PURE__ */ A({
691
+ __name: "ANumericInput",
692
+ props: /* @__PURE__ */ $({
693
+ label: {},
694
+ required: { type: Boolean },
695
+ readonly: { type: Boolean },
696
+ uuid: {},
697
+ validation: { default: () => ({ errorMessage: "&nbsp;" }) }
698
+ }, {
699
+ modelValue: {},
700
+ modelModifiers: {}
701
+ }),
702
+ emits: ["update:modelValue"],
703
+ setup(e) {
704
+ const t = x(e, "modelValue");
705
+ return (n, o) => (v(), g("div", null, [
706
+ M(c("input", {
707
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
708
+ type: "number",
709
+ id: n.uuid,
710
+ disabled: n.readonly,
711
+ required: n.required
712
+ }, null, 8, ft), [
713
+ [G, t.value]
714
+ ]),
715
+ c("label", { for: n.uuid }, E(n.label), 9, mt),
716
+ M(c("p", {
717
+ innerHTML: n.validation.errorMessage
718
+ }, null, 8, vt), [
719
+ [I, n.validation.errorMessage]
720
+ ])
721
+ ]));
722
+ }
723
+ }), yt = /* @__PURE__ */ S(ht, [["__scopeId", "data-v-02907cd6"]]), se = {
724
+ date: "##/##/####",
725
+ datetime: "####/##/## ##:##",
726
+ time: "##:##",
727
+ fulltime: "##:##:##",
728
+ phone: "(###) ### - ####",
729
+ card: "#### #### #### ####"
730
+ };
731
+ function gt(e) {
732
+ try {
733
+ return Function(`"use strict";return (${e})`)();
734
+ } catch {
735
+ }
736
+ }
737
+ function bt(e) {
738
+ var n;
739
+ let t = e.value;
740
+ if (t) {
741
+ const o = gt(t);
742
+ if (o) {
743
+ const l = e.instance.locale;
744
+ t = o(l);
745
+ }
746
+ } else {
747
+ const o = e.instance.schema, l = (n = o == null ? void 0 : o.fieldtype) == null ? void 0 : n.toLowerCase();
748
+ l && se[l] && (t = se[l]);
749
+ }
750
+ return t;
751
+ }
752
+ function kt(e, t) {
753
+ t || (t = "#");
754
+ let n = e;
755
+ const o = [t, "/", "-", "(", ")", " "];
756
+ for (const l of o)
757
+ n = n.replaceAll(l, "");
758
+ return n;
759
+ }
760
+ function _t(e, t, n) {
761
+ n || (n = "#");
762
+ let o = t;
763
+ for (const l of e) {
764
+ const r = o.indexOf(n);
765
+ if (r !== -1) {
766
+ const s = o.substring(0, r), a = o.substring(r + 1);
767
+ o = s + l + a;
768
+ }
769
+ }
770
+ return o.slice(0, t.length);
771
+ }
772
+ function wt(e, t) {
773
+ const n = bt(t);
774
+ if (!n)
775
+ return;
776
+ const o = "#", l = e.value, r = kt(l, o);
777
+ if (r) {
778
+ const s = _t(r, n, o);
779
+ t.instance.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;
780
+ } else
781
+ e.value = n;
782
+ }
783
+ const Dt = ["id", "disabled", "maxlength", "required"], Mt = ["for"], Et = ["innerHTML"], At = /* @__PURE__ */ A({
784
+ __name: "ATextInput",
785
+ props: /* @__PURE__ */ $({
786
+ schema: {},
787
+ label: {},
788
+ mask: {},
789
+ required: { type: Boolean },
790
+ readonly: { type: Boolean },
791
+ uuid: {},
792
+ validation: { default: () => ({ errorMessage: "&nbsp;" }) }
793
+ }, {
794
+ modelValue: {},
795
+ modelModifiers: {}
796
+ }),
797
+ emits: ["update:modelValue"],
798
+ setup(e) {
799
+ const t = m(!0), n = x(e, "modelValue");
800
+ return (o, l) => (v(), g("div", null, [
801
+ M(c("input", {
802
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => n.value = r),
803
+ id: o.uuid,
804
+ disabled: o.readonly,
805
+ maxlength: o.mask ? t.value && o.mask.length : void 0,
806
+ required: o.required
807
+ }, null, 8, Dt), [
808
+ [G, n.value],
809
+ [re(wt), o.mask]
810
+ ]),
811
+ c("label", { for: o.uuid }, E(o.label), 9, Mt),
812
+ M(c("p", {
813
+ innerHTML: o.validation.errorMessage
814
+ }, null, 8, Et), [
815
+ [I, o.validation.errorMessage]
816
+ ])
817
+ ]));
818
+ }
819
+ }), Ct = /* @__PURE__ */ S(At, [["__scopeId", "data-v-2514e692"]]);
820
+ function Vt(e) {
821
+ e.component("ACheckbox", $e), e.component("ACombobox", Ie), e.component("ADate", Fe), e.component("ADropdown", Ke), e.component("ADatePicker", rt), e.component("AFieldset", pt), e.component("AForm", ce), e.component("ANumericInput", yt), e.component("ATextInput", Ct);
822
+ }
823
+ export {
824
+ $e as ACheckbox,
825
+ Ie as AComboBox,
826
+ Fe as ADate,
827
+ rt as ADatePicker,
828
+ Ke as ADropdown,
829
+ pt as AFieldset,
830
+ ce as AForm,
831
+ yt as ANumericInput,
832
+ Ct as ATextInput,
833
+ Vt as install
834
+ };
835
+ //# sourceMappingURL=aform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aform.js","sources":["../src/components/form/ACheckbox.vue","../src/components/form/ADate.vue","../src/components/form/ADropdown.vue","../../utilities/dist/utilities.js","../src/components/form/ADatePicker.vue","../src/components/AForm.vue","../src/components/form/AFieldset.vue","../src/components/form/ANumericInput.vue","../src/directives/mask.ts","../src/components/form/ATextInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<div>\n\t\t<label id=\"checkbox-container\">\n\t\t\t<input v-model=\"checkbox\" type=\"checkbox\" :id=\"uuid\" class=\"checkbox\" :readonly=\"readOnly\" :required=\"required\" />\n\t\t\t<span id=\"custom-checkbox\">{{ checkbox }}</span>\n\t\t</label>\n\t\t<label :for=\"uuid\" id=\"checkbox-label\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { InputHTMLAttributes } from 'vue'\n\nwithDefaults(\n\tdefineProps<{\n\t\tlabel?: string\n\t\trequired?: boolean\n\t\treadOnly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst checkbox = defineModel<InputHTMLAttributes['checked']>()\n</script>\n\n<style scoped>\ndiv {\n\tdisplay: inline-block;\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\n.checkbox {\n\tvisibility: hidden;\n}\n\n.checkbox + #custom-checkbox:after {\n\tcontent: '⬡';\n\tpadding: 1ch 0 0.5ch 0;\n\tfont-size: 120%;\n\tcursor: pointer;\n\tposition: relative;\n\tleft: -18px;\n}\n\n.checkbox:checked + #custom-checkbox:after {\n\tcontent: '⬣';\n\tpadding: 1ch 0 0.5ch 0;\n\tfont-size: 120%;\n\tcursor: pointer;\n\tposition: relative;\n\tleft: -18px;\n}\n\n#custom-checkbox {\n\tdisplay: inline-block;\n}\n\n#checkbox-container {\n\tdisplay: inline-block;\n\tmin-width: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\theight: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\n#checkbox-container:hover {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\n#checkbox-container:hover + label {\n\tcolor: var(--input-active-label-color);\n}\n\n#checkbox-label {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n</style>\n","<template>\n\t<div>\n\t\t<input\n\t\t\tref=\"dateRef\"\n\t\t\ttype=\"date\"\n\t\t\t:id=\"uuid\"\n\t\t\t:disabled=\"readonly\"\n\t\t\t:required=\"required\"\n\t\t\t:value=\"inputDate\"\n\t\t\t@click=\"showPicker\" />\n\t\t<label :for=\"uuid\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nwithDefaults(\n\tdefineProps<{\n\t\tlabel?: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tlabel: 'Date',\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst inputDate = defineModel<string | number | Date>()\nconst dateRef = ref<HTMLInputElement | null>(null)\n\nconst showPicker = () => {\n\tif (dateRef.value) {\n\t\tif ('showPicker' in HTMLInputElement.prototype) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker\n\t\t\t// TODO: re-check browser support and compatibility; figure out alternative ways\n\t\t\t// to spawn the native datepicker and eventually replace with ADatepicker\n\t\t\tdateRef.value.showPicker()\n\t\t}\n\t}\n}\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","<template>\n\t<div class=\"autocomplete\" :class=\"{ isOpen: isOpen }\">\n\t\t<div class=\"input-wrapper\">\n\t\t\t<input\n\t\t\t\tref=\"mopInput\"\n\t\t\t\ttype=\"text\"\n\t\t\t\t@input=\"onChange\"\n\t\t\t\t@focus=\"onChange\"\n\t\t\t\tv-model=\"search\"\n\t\t\t\t@keydown.down=\"onArrowDown\"\n\t\t\t\t@keydown.up=\"onArrowUp\"\n\t\t\t\t@keydown.enter=\"onEnter\" />\n\n\t\t\t<ul id=\"autocomplete-results\" v-show=\"isOpen\" class=\"autocomplete-results\">\n\t\t\t\t<li class=\"loading autocomplete-result\" v-if=\"isLoading\">Loading results...</li>\n\t\t\t\t<li\n\t\t\t\t\tv-else\n\t\t\t\t\tv-for=\"(result, i) in results\"\n\t\t\t\t\t:key=\"i\"\n\t\t\t\t\t@click=\"setResult(result)\"\n\t\t\t\t\tclass=\"autocomplete-result\"\n\t\t\t\t\t:class=\"{ 'is-active': i === arrowCounter }\">\n\t\t\t\t\t{{ result }}\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<label>{{ label }}</label>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst props = defineProps<{\n\tlabel: string\n\titems?: string[]\n\tisAsync?: boolean\n}>()\n\nconst emit = defineEmits(['filterChanged'])\n\nconst results = ref(props.items)\nconst search = defineModel<string>()\nconst isLoading = ref(false)\nconst arrowCounter = ref(0)\nconst isOpen = ref(false)\nconst mopInput = ref(null)\n\nonMounted(() => {\n\tdocument.addEventListener('click', handleClickOutside)\n\tfilterResults()\n})\n\nonUnmounted(() => {\n\tdocument.removeEventListener('click', handleClickOutside)\n})\n\nconst setResult = result => {\n\tsearch.value = result\n\tcloseResults()\n}\n\nconst filterResults = () => {\n\tif (!search.value) {\n\t\tresults.value = props.items\n\t} else {\n\t\tresults.value = props.items.filter(item => {\n\t\t\treturn item.toLowerCase().indexOf(search.value.toLowerCase()) > -1\n\t\t})\n\t}\n}\n\nconst onChange = () => {\n\tisOpen.value = true\n\tif (props.isAsync) {\n\t\tisLoading.value = true\n\t\temit('filterChanged', search.value)\n\t} else {\n\t\tfilterResults()\n\t}\n}\n\nconst handleClickOutside = (event: MouseEvent) => {\n\tcloseResults()\n\tarrowCounter.value = 0\n}\n\nconst closeResults = () => {\n\tisOpen.value = false\n\n\t// TODO: (test) when would this occur? how should this be tested?\n\tif (!props.items.includes(search.value)) {\n\t\tsearch.value = ''\n\t}\n}\n\nconst onArrowDown = () => {\n\tif (arrowCounter.value < results.value.length) {\n\t\tarrowCounter.value = arrowCounter.value + 1\n\t}\n}\n\nconst onArrowUp = () => {\n\tif (arrowCounter.value > 0) {\n\t\tarrowCounter.value = arrowCounter.value - 1\n\t}\n}\n\nconst onEnter = () => {\n\tsearch.value = results.value[arrowCounter.value]\n\tcloseResults()\n\tarrowCounter.value = 0\n}\n\n// const openWithSearch = () => {\n// \tsearch.value = ''\n// \tonChange()\n// \tmopInput.value.focus()\n// }\n</script>\n\n<style>\n/* variables taken from here: https://github.com/frappe/frappe/blob/version-13/frappe/public/scss/common/awesomeplete.scss */\n.autocomplete {\n\tposition: relative;\n}\n\n.input-wrapper {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n\tborder-radius: 0.25rem 0.25rem 0 0;\n\tborder-bottom: none;\n}\n\nlabel {\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\n.autocomplete-results {\n\tposition: absolute;\n\twidth: calc(100% - 1ch + 1.5px);\n\tz-index: 1;\n\tpadding: 0;\n\tmargin: 0;\n\tcolor: #000000;\n\tborder: 1px solid var(--input-active-border-color);\n\tborder-radius: 0 0 0.25rem 0.25rem;\n\tborder-top: none;\n}\n\n.autocomplete-result {\n\tlist-style: none;\n\ttext-align: left;\n\tpadding: 4px 6px;\n\tcursor: pointer;\n}\n\n.autocomplete-result.is-active,\n.autocomplete-result:hover {\n\tbackground-color: var(--row-color-zebra-light);\n\tcolor: #000000;\n}\n</style>\n","import { unref as I, getCurrentScope as O, onScopeDispose as U, computed as M, ref as b, watch as v, onMounted as j, onBeforeUnmount as V } from \"vue\";\nfunction B(e) {\n return O() ? (U(e), !0) : !1;\n}\nfunction _(e) {\n return typeof e == \"function\" ? e() : I(e);\n}\nconst F = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst q = Object.prototype.toString, N = (e) => q.call(e) === \"[object Object]\", G = () => {\n};\nfunction y(e) {\n var t;\n const n = _(e);\n return (t = n == null ? void 0 : n.$el) != null ? t : n;\n}\nconst T = F ? window : void 0;\nfunction w(...e) {\n let t, n, l, s;\n if (typeof e[0] == \"string\" || Array.isArray(e[0]) ? ([n, l, s] = e, t = T) : [t, n, l, s] = e, !t)\n return G;\n Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);\n const i = [], o = () => {\n i.forEach((f) => f()), i.length = 0;\n }, r = (f, u, p, d) => (f.addEventListener(u, p, d), () => f.removeEventListener(u, p, d)), c = v(\n () => [y(t), _(s)],\n ([f, u]) => {\n if (o(), !f)\n return;\n const p = N(u) ? { ...u } : u;\n i.push(\n ...n.flatMap((d) => l.map((E) => r(f, d, E, p)))\n );\n },\n { immediate: !0, flush: \"post\" }\n ), a = () => {\n c(), o();\n };\n return B(a), a;\n}\nfunction z(e = {}) {\n var t;\n const {\n window: n = T,\n deep: l = !0\n } = e, s = (t = e.document) != null ? t : n == null ? void 0 : n.document, i = () => {\n var c;\n let a = s == null ? void 0 : s.activeElement;\n if (l)\n for (; a != null && a.shadowRoot; )\n a = (c = a == null ? void 0 : a.shadowRoot) == null ? void 0 : c.activeElement;\n return a;\n }, o = b(), r = () => {\n o.value = i();\n };\n return n && (w(n, \"blur\", (c) => {\n c.relatedTarget === null && r();\n }, !0), w(n, \"focus\", r, !0)), r(), o;\n}\nfunction J(e, t = {}) {\n const n = z(t), l = M(() => y(e));\n return { focused: M(() => l.value && n.value ? l.value.contains(n.value) : !1) };\n}\nfunction Q(e, { window: t = T, scrollTarget: n } = {}) {\n const l = b(!1), s = () => {\n if (!t)\n return;\n const i = t.document, o = y(e);\n if (!o)\n l.value = !1;\n else {\n const r = o.getBoundingClientRect();\n l.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;\n }\n };\n return v(\n () => y(e),\n () => s(),\n { immediate: !0, flush: \"post\" }\n ), t && w(n || t, \"scroll\", s, {\n capture: !1,\n passive: !0\n }), l;\n}\nconst g = (e) => {\n let t = Q(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, m = (e) => e.tabIndex >= 0, x = (e) => {\n const t = e.target;\n return A(t);\n}, A = (e) => {\n var n;\n let t;\n if (e instanceof HTMLTableCellElement) {\n const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;\n if (l) {\n const i = Array.from(l.children)[e.cellIndex];\n i && (t = i);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const l = e.previousElementSibling;\n l && (t = l);\n }\n return t && (!m(t) || !g(t)) ? A(t) : t;\n}, X = (e) => {\n var l;\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const s = (l = t.parentElement) == null ? void 0 : l.parentElement;\n if (s) {\n const o = s.firstElementChild.children[t.cellIndex];\n o && (n = o);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const s = t.parentElement;\n if (s) {\n const i = s.firstElementChild;\n i && (n = i);\n }\n }\n return n && (!m(n) || !g(n)) ? S(n) : n;\n}, D = (e) => {\n const t = e.target;\n return S(t);\n}, S = (e) => {\n var n;\n let t;\n if (e instanceof HTMLTableCellElement) {\n const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;\n if (l) {\n const i = Array.from(l.children)[e.cellIndex];\n i && (t = i);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const l = e.nextElementSibling;\n l && (t = l);\n }\n return t && (!m(t) || !g(t)) ? S(t) : t;\n}, Y = (e) => {\n var l;\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const s = (l = t.parentElement) == null ? void 0 : l.parentElement;\n if (s) {\n const o = s.lastElementChild.children[t.cellIndex];\n o && (n = o);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const s = t.parentElement;\n if (s) {\n const i = s.lastElementChild;\n i && (n = i);\n }\n }\n return n && (!m(n) || !g(n)) ? A(n) : n;\n}, R = (e) => {\n const t = e.target;\n return k(t);\n}, k = (e) => {\n var n;\n let t;\n if (e.previousElementSibling)\n t = e.previousElementSibling;\n else {\n const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;\n t = l == null ? void 0 : l.lastElementChild;\n }\n return t && (!m(t) || !g(t)) ? k(t) : t;\n}, P = (e) => {\n const t = e.target;\n return L(t);\n}, L = (e) => {\n var n;\n let t;\n if (e.nextElementSibling)\n t = e.nextElementSibling;\n else {\n const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;\n t = l == null ? void 0 : l.firstElementChild;\n }\n return t && (!m(t) || !g(t)) ? L(t) : t;\n}, K = (e) => {\n const l = e.target.parentElement.firstElementChild;\n return l && (!m(l) || !g(l)) ? L(l) : l;\n}, W = (e) => {\n const l = e.target.parentElement.lastElementChild;\n return l && (!m(l) || !g(l)) ? k(l) : l;\n}, C = [\"alt\", \"control\", \"shift\", \"meta\"], Z = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, ee = {\n \"keydown.up\": (e) => {\n const t = x(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = D(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = R(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = P(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = X(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Y(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = K(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = W(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = W(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const n = D(e);\n n && n.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const n = x(e);\n n && n.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = K(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = P(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = R(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction ne(e) {\n const t = (o) => {\n let r = null;\n return o.parent && (typeof o.parent == \"string\" ? r = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? r = o.parent : r = o.parent.value), r;\n }, n = (o) => {\n const r = t(o);\n let c = [];\n if (typeof o.selectors == \"string\")\n c = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));\n else if (Array.isArray(o.selectors))\n for (const a of o.selectors)\n a instanceof HTMLElement ? c.push(a) : c.push(a.$el);\n else if (o.selectors instanceof HTMLElement)\n c.push(o.selectors);\n else if (Array.isArray(o.selectors.value))\n for (const a of o.selectors.value)\n a instanceof HTMLElement ? c.push(a) : c.push(a.$el);\n else\n c.push(o.selectors.value);\n return c;\n }, l = (o) => {\n const r = t(o);\n let c = [];\n return o.selectors ? c = n(o) : r && (c = Array.from(r.children).filter((f) => m(f) && g(f))), c;\n }, s = (o) => (r) => {\n const c = Z[r.key] || r.key.toLowerCase();\n if (C.includes(c))\n return;\n const a = o.handlers || ee;\n for (const f of Object.keys(a)) {\n const [u, ...p] = f.split(\".\");\n if (u === \"keydown\" && p.includes(c)) {\n const d = a[f], E = p.filter(($) => C.includes($)), H = C.some(($) => {\n const h = $.charAt(0).toUpperCase() + $.slice(1);\n return r.getModifierState(h);\n });\n if (E.length > 0) {\n if (H) {\n for (const $ of C)\n if (p.includes($)) {\n const h = $.charAt(0).toUpperCase() + $.slice(1);\n r.getModifierState(h) && d(r);\n }\n }\n } else\n H || d(r);\n }\n }\n }, i = [];\n j(() => {\n for (const o of e) {\n const r = t(o), c = l(o), a = s(o), f = r ? [r] : c;\n for (const u of f) {\n const { focused: p } = J(b(u)), d = v(p, (E) => {\n E ? u.addEventListener(\"keydown\", a) : u.removeEventListener(\"keydown\", a);\n });\n i.push(d);\n }\n }\n }), V(() => {\n for (const o of i)\n o();\n });\n}\nfunction le(e) {\n}\nexport {\n ee as defaultKeypressHandlers,\n le as install,\n ne as useKeyboardNav\n};\n//# sourceMappingURL=utilities.js.map\n","<template>\n\t<div class=\"adatepicker\" tabindex=\"0\" ref=\"adatepicker\">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td id=\"previous-month-btn\" @click=\"previousMonth\" :tabindex=\"-1\">&lt;</td>\n\t\t\t\t<th colspan=\"5\" :tabindex=\"-1\">{{ monthAndYear }}</th>\n\t\t\t\t<td id=\"next-month-btn\" @click=\"nextMonth\" :tabindex=\"-1\">&gt;</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"days-header\">\n\t\t\t\t<td>M</td>\n\t\t\t\t<td>T</td>\n\t\t\t\t<td>W</td>\n\t\t\t\t<td>T</td>\n\t\t\t\t<td>F</td>\n\t\t\t\t<td>S</td>\n\t\t\t\t<td>S</td>\n\t\t\t</tr>\n\t\t\t<tr v-for=\"rowNo in numberOfRows\" :key=\"rowNo\">\n\t\t\t\t<td\n\t\t\t\t\tv-for=\"colNo in numberOfColumns\"\n\t\t\t\t\tref=\"celldate\"\n\t\t\t\t\t:key=\"getCurrentCell(rowNo, colNo)\"\n\t\t\t\t\t:contenteditable=\"false\"\n\t\t\t\t\t:spellcheck=\"false\"\n\t\t\t\t\t:tabindex=\"0\"\n\t\t\t\t\t@click.prevent.stop=\"selectDate(getCurrentCell(rowNo, colNo))\"\n\t\t\t\t\t@keydown.enter=\"selectDate(getCurrentCell(rowNo, colNo))\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\ttodaysDate: isTodaysDate(getCurrentDate(rowNo, colNo)),\n\t\t\t\t\t\tselectedDate: isSelectedDate(getCurrentDate(rowNo, colNo)),\n\t\t\t\t\t}\">\n\t\t\t\t\t{{ new Date(getCurrentDate(rowNo, colNo)).getDate() }}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { defaultKeypressHandlers, useKeyboardNav } from '@stonecrop/utilities'\nimport { computed, nextTick, onMounted, ref, watch } from 'vue'\n\nconst numberOfRows = 6\nconst numberOfColumns = 7\n\nconst date = defineModel<number | Date>({ default: new Date() })\nconst selectedDate = ref(new Date(date.value))\nconst currentMonth = ref<number>(selectedDate.value.getMonth())\nconst currentYear = ref<number>(selectedDate.value.getFullYear())\nconst currentDates = ref<number[]>([])\nconst adatepicker = ref<HTMLElement | null>(null)\n\nonMounted(async () => {\n\tpopulateMonth()\n\n\t// required to allow the elements to be focused in the next step\n\tawait nextTick()\n\n\tconst $selectedDate = document.getElementsByClassName('selectedDate')\n\tif ($selectedDate.length > 0) {\n\t\t;($selectedDate[0] as HTMLElement).focus()\n\t} else {\n\t\tconst $todaysDate = document.getElementsByClassName('todaysDate')\n\t\tif ($todaysDate.length > 0) {\n\t\t\t;($todaysDate[0] as HTMLElement).focus()\n\t\t}\n\t}\n})\n\nconst populateMonth = () => {\n\tcurrentDates.value = []\n\tconst firstOfMonth = new Date(currentYear.value, currentMonth.value, 1)\n\tconst monthStartWeekday = firstOfMonth.getDay()\n\tconst calendarStartDay = firstOfMonth.setDate(firstOfMonth.getDate() - monthStartWeekday)\n\n\t// assume midnight for all dates while building the calendar\n\tfor (const dayIndex of Array(43).keys()) {\n\t\tcurrentDates.value.push(calendarStartDay + dayIndex * 86400000)\n\t}\n}\n\nwatch([currentMonth, currentYear], populateMonth)\nconst previousYear = () => (currentYear.value -= 1)\nconst nextYear = () => (currentYear.value += 1)\n\nconst previousMonth = () => {\n\tif (currentMonth.value == 0) {\n\t\tcurrentMonth.value = 11\n\t\tpreviousYear()\n\t} else {\n\t\tcurrentMonth.value -= 1\n\t}\n}\n\nconst nextMonth = () => {\n\tif (currentMonth.value == 11) {\n\t\tcurrentMonth.value = 0\n\t\tnextYear()\n\t} else {\n\t\tcurrentMonth.value += 1\n\t}\n}\n\nconst isTodaysDate = (day: string | number | Date) => {\n\tconst todaysDate = new Date()\n\tif (currentMonth.value !== todaysDate.getMonth()) {\n\t\treturn\n\t}\n\treturn todaysDate.toDateString() === new Date(day).toDateString()\n}\n\nconst isSelectedDate = (day: string | number | Date) => {\n\treturn new Date(day).toDateString() === new Date(selectedDate.value).toDateString()\n}\n\nconst getCurrentCell = (rowNo: number, colNo: number) => {\n\treturn (rowNo - 1) * numberOfColumns + colNo\n}\n\nconst getCurrentDate = (rowNo: number, colNo: number) => {\n\treturn currentDates.value[getCurrentCell(rowNo, colNo)]\n}\n\nconst selectDate = (currentIndex: number) => {\n\tdate.value = selectedDate.value = new Date(currentDates.value[currentIndex])\n}\n\nconst monthAndYear = computed(() => {\n\treturn new Date(currentYear.value, currentMonth.value, 1).toLocaleDateString(undefined, {\n\t\tyear: 'numeric',\n\t\tmonth: 'long',\n\t})\n})\n\n// setup keyboard navigation\nuseKeyboardNav([\n\t{\n\t\tparent: adatepicker,\n\t\tselectors: 'td',\n\t\thandlers: {\n\t\t\t...defaultKeypressHandlers,\n\t\t\t...{\n\t\t\t\t'keydown.pageup': previousMonth,\n\t\t\t\t'keydown.shift.pageup': previousYear,\n\t\t\t\t'keydown.pagedown': nextMonth,\n\t\t\t\t'keydown.shift.pagedown': nextYear,\n\t\t\t\t// TODO: this is a hack to override the stonecrop enter handler;\n\t\t\t\t// store context inside the component so that handlers can be setup consistently\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\t\t\t\t'keydown.enter': () => {}, // select this date\n\t\t\t},\n\t\t},\n\t},\n])\n</script>\n\n<style>\n@import url('@stonecrop/themes/default/default.css');\n@import url('@/theme/adate.css');\n@import url('@/theme/aform.css');\n</style>\n","<template>\n\t<form>\n\t\t<component\n\t\t\tv-for=\"(componentObj, key) in modelValue\"\n\t\t\t:is=\"componentObj.component\"\n\t\t\t:key=\"key\"\n\t\t\t:schema=\"componentObj\"\n\t\t\tv-model=\"childModels[key].value\"\n\t\t\t:data=\"formData[componentObj.fieldname]\"\n\t\t\t:readonly=\"readonly\"\n\t\t\tv-bind=\"componentProps(componentObj)\">\n\t\t</component>\n\t</form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nimport { SchemaTypes } from 'types'\n\nconst props = defineProps<{\n\tmodelValue: SchemaTypes[]\n\tdata: Record<string, any>\n\treadonly?: boolean\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst formData = ref(props.data || {})\n\nconst componentProps = (componentObj: SchemaTypes) => {\n\tlet propsToPass = {}\n\tfor (const [key, value] of Object.entries(componentObj)) {\n\t\tif (!['component', 'fieldtype'].includes(key)) {\n\t\t\tpropsToPass[key] = value\n\t\t}\n\n\t\t// handle ATable data formats in case the table is nested under an AFormm;\n\t\t// TODO: there's probably a better way to do this\n\t\tif (key === 'rows') {\n\t\t\tif (value && (value as any[]).length === 0) {\n\t\t\t\tpropsToPass['rows'] = formData.value[componentObj.fieldname]\n\t\t\t}\n\t\t}\n\t}\n\treturn propsToPass\n}\n\nconst childModels = computed({\n\tget: () => {\n\t\treturn props.modelValue.map((val, i) => {\n\t\t\treturn computed({\n\t\t\t\tget() {\n\t\t\t\t\treturn val.value\n\t\t\t\t},\n\t\t\t\tset: newValue => {\n\t\t\t\t\t// Find the component in modelValue and update it\n\t\t\t\t\tprops.modelValue[i].value = newValue\n\t\t\t\t\temit('update:modelValue', props.modelValue)\n\t\t\t\t},\n\t\t\t})\n\t\t})\n\t},\n\tset: (/* newValue */) => {\n\t\t//emit('update:modelValue', '')\n\t},\n})\n</script>\n\n<style scoped>\nform {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n\talign-items: baseline;\n}\n</style>\n","<template>\n\t<fieldset>\n\t\t<legend @click=\"toggleCollapse\" @submit=\"toggleCollapse\">\n\t\t\t{{ label }}\n\t\t\t<CollapseButton v-if=\"collapsible\" :collapsed=\"collapsed\" />\n\t\t</legend>\n\t\t<slot :collapsed=\"collapsed\">\n\t\t\t<AForm v-show=\"!collapsed\" v-model=\"formSchema\" :data=\"formData\" />\n\t\t</slot>\n\t</fieldset>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nimport CollapseButton from '@/components/base/CollapseButton.vue'\nimport AForm from '@/components/AForm.vue'\nimport { SchemaTypes } from 'types/index'\n\nconst props = defineProps<{\n\tschema: SchemaTypes[]\n\tlabel: string\n\tcollapsible?: boolean\n\tdata?: any\n}>()\n\nconst formData = ref(props.data || [])\nconst collapsed = ref(false)\nconst collapsible = ref(props.collapsible)\n\nconst formSchema = ref(props.schema)\nfunction toggleCollapse(event: Event) {\n\tevent.preventDefault()\n\tif (!collapsible.value) {\n\t\treturn\n\t}\n\tcollapsed.value = !collapsed.value\n}\n</script>\n\n<style scoped>\nfieldset {\n\tmax-width: 100%;\n\twidth: 100%;\n\tmargin-right: 2ch;\n\tborder: 1px solid transparent;\n\tborder-bottom: 1px solid var(--gray-50);\n}\n\nlegend {\n\twidth: 100%;\n\theight: 1.15rem;\n\tborder: 1px solid transparent;\n\tpadding-bottom: 0.5rem;\n\tfont-size: 110%;\n\tfont-weight: 600;\n\tuser-select: none;\n}\n\n.collapse-button {\n\tfloat: right;\n}\n</style>\n","<template>\n\t<div>\n\t\t<input v-model=\"inputNumber\" type=\"number\" :id=\"uuid\" :disabled=\"readonly\" :required=\"required\" />\n\t\t<label :for=\"uuid\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nwithDefaults(\n\tdefineProps<{\n\t\tlabel: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst inputNumber = defineModel<number>()\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","import type { FormSchema } from 'types'\nimport type { DirectiveBinding } from 'vue'\n\nconst NAMED_MASKS = {\n\tdate: '##/##/####',\n\tdatetime: '####/##/## ##:##',\n\ttime: '##:##',\n\tfulltime: '##:##:##',\n\tphone: '(###) ### - ####',\n\tcard: '#### #### #### ####',\n}\n\nfunction extractMaskFn(mask: string): ((args: any) => string) | void {\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\t\treturn Function(`\"use strict\";return (${mask})`)()\n\t} catch (error) {\n\t\tif (error instanceof ReferenceError) {\n\t\t\t// assume mask is a string\n\t\t}\n\t}\n}\n\nfunction getMask(binding: DirectiveBinding<string>) {\n\tlet mask = binding.value\n\n\tif (mask) {\n\t\tconst maskFn = extractMaskFn(mask)\n\t\tif (maskFn) {\n\t\t\t// TODO: (state) replace with state management;\n\t\t\t// pass the entire form/table data to the function\n\t\t\tconst locale = binding.instance['locale']\n\t\t\tmask = maskFn(locale)\n\t\t}\n\t} else {\n\t\t// TODO: (state) handle using state management\n\t\tconst schema: FormSchema = binding.instance['schema']\n\t\tconst fieldType: string | undefined = schema?.fieldtype?.toLowerCase()\n\t\tif (fieldType && NAMED_MASKS[fieldType]) {\n\t\t\tmask = NAMED_MASKS[fieldType]\n\t\t}\n\t}\n\n\treturn mask\n}\n\nfunction unmaskInput(input: string, maskToken?: string) {\n\tif (!maskToken) {\n\t\tmaskToken = '#'\n\t}\n\n\tlet unmaskedInput = input\n\tconst maskChars = [maskToken, '/', '-', '(', ')', ' ']\n\n\tfor (const char of maskChars) {\n\t\tunmaskedInput = unmaskedInput.replaceAll(char, '')\n\t}\n\n\treturn unmaskedInput\n}\n\nfunction fillMask(input: string, mask: string, maskToken?: string) {\n\tif (!maskToken) {\n\t\tmaskToken = '#'\n\t}\n\n\tlet replacement = mask\n\tfor (const inputChar of input) {\n\t\tconst replaceIndex = replacement.indexOf(maskToken)\n\t\tif (replaceIndex !== -1) {\n\t\t\tconst prefix = replacement.substring(0, replaceIndex)\n\t\t\tconst suffix = replacement.substring(replaceIndex + 1)\n\t\t\treplacement = prefix + inputChar + suffix\n\t\t}\n\t}\n\n\treturn replacement.slice(0, mask.length)\n}\n\nexport function useStringMask(el: HTMLInputElement, binding: DirectiveBinding<string>) {\n\tconst mask = getMask(binding)\n\tif (!mask) return\n\n\tconst maskToken = '#'\n\tconst inputText = el.value\n\n\t// process input value with mask\n\tconst unmaskedInput = unmaskInput(inputText, maskToken)\n\tif (unmaskedInput) {\n\t\tconst replacement = fillMask(unmaskedInput, mask, maskToken)\n\n\t\t// TODO: (state) this is very opinionated;\n\t\t// most likely fixed with state management;\n\t\t// a better way could be to emit back to instance;\n\n\t\tif (binding.instance['maskFilled']) {\n\t\t\tbinding.instance['maskFilled'] = !replacement.includes(maskToken)\n\t\t}\n\n\t\tel.value = replacement\n\t} else {\n\t\tel.value = mask\n\t}\n}\n","<template>\n\t<div>\n\t\t<input\n\t\t\tv-model=\"inputText\"\n\t\t\t:id=\"uuid\"\n\t\t\t:disabled=\"readonly\"\n\t\t\t:maxlength=\"mask ? maskFilled && mask.length : undefined\"\n\t\t\t:required=\"required\"\n\t\t\tv-mask=\"mask\" />\n\t\t<label :for=\"uuid\">{{ label }} </label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\n\nimport { FormSchema } from 'types'\nimport { useStringMask as vMask } from '@/directives/mask'\n\nwithDefaults(\n\tdefineProps<{\n\t\tschema: FormSchema\n\t\tlabel: string\n\t\tmask?: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: { errorMessage: string }\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\n// TODO: setup maskFilled as a computed property\nconst maskFilled = ref(true)\n\n// TODO: (state) replace with state management\n// const locale = inject<string>('locale', '')\n\nconst inputText = defineModel<number | string>()\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","import { App } from 'vue'\n\nimport ACheckbox from '@/components/form/ACheckbox.vue'\nimport AComboBox from '@/components/form/AComboBox.vue'\nimport ADate from '@/components/form/ADate.vue'\nimport ADropdown from '@/components/form/ADropdown.vue'\nimport ADatePicker from '@/components/form/ADatePicker.vue'\nimport AFieldset from '@/components/form/AFieldset.vue'\nimport AForm from '@/components/AForm.vue'\nimport ANumericInput from '@/components/form/ANumericInput.vue'\nimport ATextInput from '@/components/form/ATextInput.vue'\n// import { ACurrency } from '@/components/form/ACurrency.vue'\n// import { AQuantity } from '@/components/form/AQuantity.vue'\n\nfunction install(app: App /* options */) {\n\tapp.component('ACheckbox', ACheckbox)\n\tapp.component('ACombobox', AComboBox)\n\tapp.component('ADate', ADate)\n\tapp.component('ADropdown', ADropdown)\n\tapp.component('ADatePicker', ADatePicker)\n\tapp.component('AFieldset', AFieldset)\n\tapp.component('AForm', AForm)\n\tapp.component('ANumericInput', ANumericInput)\n\tapp.component('ATextInput', ATextInput)\n\t// app.component('ACurrency', ACurrency)\n\t// app.component('AQuantity', AQuantity)\n}\n\nexport { ACheckbox, AComboBox, ADate, ADropdown, ADatePicker, AFieldset, AForm, ANumericInput, ATextInput, install }\n"],"names":["checkbox","_useModel","__props","inputDate","dateRef","ref","showPicker","props","emit","__emit","results","search","isLoading","arrowCounter","isOpen","mopInput","onMounted","handleClickOutside","filterResults","onUnmounted","setResult","result","closeResults","item","onChange","event","onArrowDown","onArrowUp","onEnter","B","O","U","_","I","F","q","N","G","y","T","w","l","s","i","o","f","r","u","p","d","c","v","E","a","z","b","J","M","Q","g","m","x","A","n","t","X","S","D","Y","R","k","P","L","K","W","C","Z","ee","ne","$","H","h","j","V","numberOfRows","numberOfColumns","date","selectedDate","currentMonth","currentYear","currentDates","adatepicker","populateMonth","nextTick","$selectedDate","$todaysDate","firstOfMonth","monthStartWeekday","calendarStartDay","dayIndex","watch","previousYear","nextYear","previousMonth","nextMonth","isTodaysDate","day","todaysDate","isSelectedDate","getCurrentCell","rowNo","colNo","getCurrentDate","selectDate","currentIndex","monthAndYear","computed","useKeyboardNav","defaultKeypressHandlers","formData","componentProps","componentObj","propsToPass","key","value","childModels","val","newValue","collapsed","collapsible","formSchema","toggleCollapse","inputNumber","NAMED_MASKS","extractMaskFn","mask","getMask","binding","maskFn","locale","schema","fieldType","_a","unmaskInput","input","maskToken","unmaskedInput","maskChars","char","fillMask","replacement","inputChar","replaceIndex","prefix","suffix","useStringMask","el","inputText","maskFilled","install","app","ACheckbox","AComboBox","ADate","ADropdown","ADatePicker","AFieldset","AForm","ANumericInput","ATextInput"],"mappings":";;;;;;;;;;;;;;;AA2BM,UAAAA,IAAWC,EAA2CC,GAAA,YAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKvD,UAAAC,IAAYF,iBAAoC,GAChDG,IAAUC,EAA6B,IAAI,GAE3CC,IAAa,MAAM;AACxB,MAAIF,EAAQ,SACP,gBAAgB,iBAAiB,aAIpCA,EAAQ,MAAM;IAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,UAAMG,IAAQL,GAMRM,IAAOC,GAEPC,IAAUL,EAAIE,EAAM,KAAK,GACzBI,IAASV,EAAmBC,GAAA,YAAC,GAC7BU,IAAYP,EAAI,EAAK,GACrBQ,IAAeR,EAAI,CAAC,GACpBS,IAAST,EAAI,EAAK,GAClBU,IAAWV,EAAI,IAAI;AAEzB,IAAAW,EAAU,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D,MAAIC,GAAe;AAClB,UAAMI,IAAcD,GAASH,GAAeX,GAAMU,CAAS;AAMvD,IAAAR,EAAQ,SAAS,eACpBA,EAAQ,SAAS,aAAgB,CAACa,EAAY,SAASL,CAAS,IAGjEW,EAAG,QAAQN;AAAA,EAAA;AAEX,IAAAM,EAAG,QAAQrB;AAEb;;;;;;;;;;;;;;;;;ACnEM,UAAAuB,IAAazJ,EAAI,EAAI,GAKrBwJ,IAAY5J,iBAA6B;;;;;;;;;;;;;;;;;;;;;AC3B/C,SAAS8J,GAAQC,GAAwB;AACpC,EAAAA,EAAA,UAAU,aAAaC,EAAS,GAChCD,EAAA,UAAU,aAAaE,EAAS,GAChCF,EAAA,UAAU,SAASG,EAAK,GACxBH,EAAA,UAAU,aAAaI,EAAS,GAChCJ,EAAA,UAAU,eAAeK,EAAW,GACpCL,EAAA,UAAU,aAAaM,EAAS,GAChCN,EAAA,UAAU,SAASO,EAAK,GACxBP,EAAA,UAAU,iBAAiBQ,EAAa,GACxCR,EAAA,UAAU,cAAcS,EAAU;AAGvC;"}
@@ -0,0 +1,2 @@
1
+ (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["@stonecrop/aform"]={},f.Vue))})(this,function(f,e){"use strict";const te={id:"checkbox-container"},ne=["id","readonly","required"],oe={id:"custom-checkbox"},le=["for"],ae=["innerHTML"],re=e.defineComponent({__name:"ACheckbox",props:e.mergeModels({label:{},required:{type:Boolean},readOnly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:"&nbsp;"})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",te,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),type:"checkbox",id:o.uuid,class:"checkbox",readonly:o.readOnly,required:o.required},null,8,ne),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",oe,e.toDisplayString(n.value),1)]),e.createElementVNode("label",{for:o.uuid,id:"checkbox-label"},e.toDisplayString(o.label),9,le),e.withDirectives(e.createElementVNode("p",{innerHTML:o.validation.errorMessage},null,8,ae),[[e.vShow,o.validation.errorMessage]])]))}}),V=(t,n)=>{const o=t.__vccOpts||t;for(const[l,a]of n)o[l]=a;return o},H=V(re,[["__scopeId","data-v-5093f1cb"]]),se=e.createElementVNode("div",null,[e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"})],-1),x=e.defineComponent({__name:"AComboBox",props:["event","cellData","tableID"],setup(t){return(n,o)=>{const l=e.resolveComponent("ATableModal");return e.openBlock(),e.createBlock(l,{event:t.event,cellData:t.cellData,class:"amodal"},{default:e.withCtx(()=>[se]),_:1},8,["event","cellData"])}}}),ie=["id","disabled","required","value"],ce=["for"],de=["innerHTML"],P=V(e.defineComponent({__name:"ADate",props:e.mergeModels({label:{default:"Date"},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:"&nbsp;"})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=e.ref(null),l=()=>{o.value&&"showPicker"in HTMLInputElement.prototype&&o.value.showPicker()};return(a,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("input",{ref_key:"dateRef",ref:o,type:"date",id:a.uuid,disabled:a.readonly,required:a.required,value:n.value,onClick:l},null,8,ie),e.createElementVNode("label",{for:a.uuid},e.toDisplayString(a.label),9,ce),e.withDirectives(e.createElementVNode("p",{innerHTML:a.validation.errorMessage},null,8,de),[[e.vShow,a.validation.errorMessage]])]))}}),[["__scopeId","data-v-69d0f23d"]]),ue={class:"input-wrapper"},me={id:"autocomplete-results",class:"autocomplete-results"},pe={key:0,class:"loading autocomplete-result"},fe=["onClick"],F=e.defineComponent({__name:"ADropdown",props:e.mergeModels({label:{},items:{},isAsync:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["filterChanged"],["update:modelValue"]),setup(t,{emit:n}){const o=t,l=n,a=e.ref(o.items),i=e.useModel(t,"modelValue"),s=e.ref(!1),r=e.ref(0),d=e.ref(!1),c=e.ref(null);e.onMounted(()=>{document.addEventListener("click",g),p()}),e.onUnmounted(()=>{document.removeEventListener("click",g)});const u=m=>{i.value=m,k()},p=()=>{i.value?a.value=o.items.filter(m=>m.toLowerCase().indexOf(i.value.toLowerCase())>-1):a.value=o.items},h=()=>{d.value=!0,o.isAsync?(s.value=!0,l("filterChanged",i.value)):p()},g=m=>{k(),r.value=0},k=()=>{d.value=!1,o.items.includes(i.value)||(i.value="")},M=()=>{r.value<a.value.length&&(r.value=r.value+1)},w=()=>{r.value>0&&(r.value=r.value-1)},C=()=>{i.value=a.value[r.value],k(),r.value=0};return(m,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["autocomplete",{isOpen:d.value}])},[e.createElementVNode("div",ue,[e.withDirectives(e.createElementVNode("input",{ref_key:"mopInput",ref:c,type:"text",onInput:h,onFocus:h,"onUpdate:modelValue":y[0]||(y[0]=E=>i.value=E),onKeydown:[e.withKeys(M,["down"]),e.withKeys(w,["up"]),e.withKeys(C,["enter"])]},null,544),[[e.vModelText,i.value]]),e.withDirectives(e.createElementVNode("ul",me,[s.value?(e.openBlock(),e.createElementBlock("li",pe,"Loading results...")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(E,b)=>(e.openBlock(),e.createElementBlock("li",{key:b,onClick:ee=>u(E),class:e.normalizeClass(["autocomplete-result",{"is-active":b===r.value}])},e.toDisplayString(E),11,fe))),128))],512),[[e.vShow,d.value]]),e.createElementVNode("label",null,e.toDisplayString(m.label),1)])],2))}});function he(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function q(t){return typeof t=="function"?t():e.unref(t)}const ye=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ge=Object.prototype.toString,ke=t=>ge.call(t)==="[object Object]",Ee=()=>{};function A(t){var n;const o=q(t);return(n=o==null?void 0:o.$el)!=null?n:o}const S=ye?window:void 0;function T(...t){let n,o,l,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,l,a]=t,n=S):[n,o,l,a]=t,!n)return Ee;Array.isArray(o)||(o=[o]),Array.isArray(l)||(l=[l]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},r=(u,p,h,g)=>(u.addEventListener(p,h,g),()=>u.removeEventListener(p,h,g)),d=e.watch(()=>[A(n),q(a)],([u,p])=>{if(s(),!u)return;const h=ke(p)?{...p}:p;i.push(...o.flatMap(g=>l.map(k=>r(u,g,k,h))))},{immediate:!0,flush:"post"}),c=()=>{d(),s()};return he(c),c}function we(t={}){var n;const{window:o=S,deep:l=!0}=t,a=(n=t.document)!=null?n:o==null?void 0:o.document,i=()=>{var d;let c=a==null?void 0:a.activeElement;if(l)for(;c!=null&&c.shadowRoot;)c=(d=c==null?void 0:c.shadowRoot)==null?void 0:d.activeElement;return c},s=e.ref(),r=()=>{s.value=i()};return o&&(T(o,"blur",d=>{d.relatedTarget===null&&r()},!0),T(o,"focus",r,!0)),r(),s}function be(t,n={}){const o=we(n),l=e.computed(()=>A(t));return{focused:e.computed(()=>l.value&&o.value?l.value.contains(o.value):!1)}}function _e(t,{window:n=S,scrollTarget:o}={}){const l=e.ref(!1),a=()=>{if(!n)return;const i=n.document,s=A(t);if(!s)l.value=!1;else{const r=s.getBoundingClientRect();l.value=r.top<=(n.innerHeight||i.documentElement.clientHeight)&&r.left<=(n.innerWidth||i.documentElement.clientWidth)&&r.bottom>=0&&r.right>=0}};return e.watch(()=>A(t),()=>a(),{immediate:!0,flush:"post"}),n&&T(o||n,"scroll",a,{capture:!1,passive:!0}),l}const _=t=>{let n=_e(t).value;return n=n&&t.offsetHeight>0,n},D=t=>t.tabIndex>=0,R=t=>{const n=t.target;return L(n)},L=t=>{var n;let o;if(t instanceof HTMLTableCellElement){const l=(n=t.parentElement)==null?void 0:n.previousElementSibling;if(l){const a=Array.from(l.children)[t.cellIndex];a&&(o=a)}}else if(t instanceof HTMLTableRowElement){const l=t.previousElementSibling;l&&(o=l)}return o&&(!D(o)||!_(o))?L(o):o},De=t=>{var n;const o=t.target;let l;if(o instanceof HTMLTableCellElement){const a=(n=o.parentElement)==null?void 0:n.parentElement;if(a){const i=a.firstElementChild.children[o.cellIndex];i&&(l=i)}}else if(o instanceof HTMLTableRowElement){const a=o.parentElement;if(a){const i=a.firstElementChild;i&&(l=i)}}return l&&(!D(l)||!_(l))?$(l):l},U=t=>{const n=t.target;return $(n)},$=t=>{var n;let o;if(t instanceof HTMLTableCellElement){const l=(n=t.parentElement)==null?void 0:n.nextElementSibling;if(l){const a=Array.from(l.children)[t.cellIndex];a&&(o=a)}}else if(t instanceof HTMLTableRowElement){const l=t.nextElementSibling;l&&(o=l)}return o&&(!D(o)||!_(o))?$(o):o},Me=t=>{var n;const o=t.target;let l;if(o instanceof HTMLTableCellElement){const a=(n=o.parentElement)==null?void 0:n.parentElement;if(a){const i=a.lastElementChild.children[o.cellIndex];i&&(l=i)}}else if(o instanceof HTMLTableRowElement){const a=o.parentElement;if(a){const i=a.lastElementChild;i&&(l=i)}}return l&&(!D(l)||!_(l))?L(l):l},O=t=>{const n=t.target;return N(n)},N=t=>{var n;let o;if(t.previousElementSibling)o=t.previousElementSibling;else{const l=(n=t.parentElement)==null?void 0:n.previousElementSibling;o=l==null?void 0:l.lastElementChild}return o&&(!D(o)||!_(o))?N(o):o},K=t=>{const n=t.target;return v(n)},v=t=>{var n;let o;if(t.nextElementSibling)o=t.nextElementSibling;else{const l=(n=t.parentElement)==null?void 0:n.nextElementSibling;o=l==null?void 0:l.firstElementChild}return o&&(!D(o)||!_(o))?v(o):o},W=t=>{const n=t.target.parentElement.firstElementChild;return n&&(!D(n)||!_(n))?v(n):n},Y=t=>{const n=t.target.parentElement.lastElementChild;return n&&(!D(n)||!_(n))?N(n):n},B=["alt","control","shift","meta"],Ve={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},z={"keydown.up":t=>{const n=R(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.down":t=>{const n=U(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.left":t=>{const n=O(t);t.preventDefault(),t.stopPropagation(),n&&n.focus()},"keydown.right":t=>{const n=K(t);t.preventDefault(),t.stopPropagation(),n&&n.focus()},"keydown.control.up":t=>{const n=De(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.control.down":t=>{const n=Me(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.control.left":t=>{const n=W(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.control.right":t=>{const n=Y(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.end":t=>{const n=Y(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const n=U(t);n&&n.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const n=R(t);n&&n.focus()}},"keydown.home":t=>{const n=W(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.tab":t=>{const n=K(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())},"keydown.shift.tab":t=>{const n=O(t);n&&(t.preventDefault(),t.stopPropagation(),n.focus())}};function Ce(t){const n=s=>{let r=null;return s.parent&&(typeof s.parent=="string"?r=document.querySelector(s.parent):s.parent instanceof HTMLElement?r=s.parent:r=s.parent.value),r},o=s=>{const r=n(s);let d=[];if(typeof s.selectors=="string")d=r?Array.from(r.querySelectorAll(s.selectors)):Array.from(document.querySelectorAll(s.selectors));else if(Array.isArray(s.selectors))for(const c of s.selectors)c instanceof HTMLElement?d.push(c):d.push(c.$el);else if(s.selectors instanceof HTMLElement)d.push(s.selectors);else if(Array.isArray(s.selectors.value))for(const c of s.selectors.value)c instanceof HTMLElement?d.push(c):d.push(c.$el);else d.push(s.selectors.value);return d},l=s=>{const r=n(s);let d=[];return s.selectors?d=o(s):r&&(d=Array.from(r.children).filter(c=>D(c)&&_(c))),d},a=s=>r=>{const d=Ve[r.key]||r.key.toLowerCase();if(B.includes(d))return;const c=s.handlers||z;for(const u of Object.keys(c)){const[p,...h]=u.split(".");if(p==="keydown"&&h.includes(d)){const g=c[u],k=h.filter(w=>B.includes(w)),M=B.some(w=>{const C=w.charAt(0).toUpperCase()+w.slice(1);return r.getModifierState(C)});if(k.length>0){if(M){for(const w of B)if(h.includes(w)){const C=w.charAt(0).toUpperCase()+w.slice(1);r.getModifierState(C)&&g(r)}}}else M||g(r)}}},i=[];e.onMounted(()=>{for(const s of t){const r=n(s),d=l(s),c=a(s),u=r?[r]:d;for(const p of u){const{focused:h}=be(e.ref(p)),g=e.watch(h,k=>{k?p.addEventListener("keydown",c):p.removeEventListener("keydown",c)});i.push(g)}}}),e.onBeforeUnmount(()=>{for(const s of i)s()})}const Ae={colspan:"5",tabindex:-1},Be=e.createElementVNode("tr",{class:"days-header"},[e.createElementVNode("td",null,"M"),e.createElementVNode("td",null,"T"),e.createElementVNode("td",null,"W"),e.createElementVNode("td",null,"T"),e.createElementVNode("td",null,"F"),e.createElementVNode("td",null,"S"),e.createElementVNode("td",null,"S")],-1),Se=["onClick","onKeydown"],Te=6,j=7,G=e.defineComponent({__name:"ADatePicker",props:{modelValue:{default:new Date},modelModifiers:{}},emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=e.ref(new Date(n.value)),l=e.ref(o.value.getMonth()),a=e.ref(o.value.getFullYear()),i=e.ref([]),s=e.ref(null);e.onMounted(async()=>{r(),await e.nextTick();const m=document.getElementsByClassName("selectedDate");if(m.length>0)m[0].focus();else{const y=document.getElementsByClassName("todaysDate");y.length>0&&y[0].focus()}});const r=()=>{i.value=[];const m=new Date(a.value,l.value,1),y=m.getDay(),E=m.setDate(m.getDate()-y);for(const b of Array(43).keys())i.value.push(E+b*864e5)};e.watch([l,a],r);const d=()=>a.value-=1,c=()=>a.value+=1,u=()=>{l.value==0?(l.value=11,d()):l.value-=1},p=()=>{l.value==11?(l.value=0,c()):l.value+=1},h=m=>{const y=new Date;if(l.value===y.getMonth())return y.toDateString()===new Date(m).toDateString()},g=m=>new Date(m).toDateString()===new Date(o.value).toDateString(),k=(m,y)=>(m-1)*j+y,M=(m,y)=>i.value[k(m,y)],w=m=>{n.value=o.value=new Date(i.value[m])},C=e.computed(()=>new Date(a.value,l.value,1).toLocaleDateString(void 0,{year:"numeric",month:"long"}));return Ce([{parent:s,selectors:"td",handlers:{...z,"keydown.pageup":u,"keydown.shift.pageup":d,"keydown.pagedown":p,"keydown.shift.pagedown":c,"keydown.enter":()=>{}}}]),(m,y)=>(e.openBlock(),e.createElementBlock("div",{class:"adatepicker",tabindex:"0",ref_key:"adatepicker",ref:s},[e.createElementVNode("table",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",{id:"previous-month-btn",onClick:u,tabindex:-1},"<"),e.createElementVNode("th",Ae,e.toDisplayString(C.value),1),e.createElementVNode("td",{id:"next-month-btn",onClick:p,tabindex:-1},">")]),Be,(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Te,E=>e.createElementVNode("tr",{key:E},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(j,b=>e.createElementVNode("td",{ref_for:!0,ref:"celldate",key:k(E,b),contenteditable:!1,spellcheck:!1,tabindex:0,onClick:e.withModifiers(ee=>w(k(E,b)),["prevent","stop"]),onKeydown:e.withKeys(ee=>w(k(E,b)),["enter"]),class:e.normalizeClass({todaysDate:h(M(E,b)),selectedDate:g(M(E,b))})},e.toDisplayString(new Date(M(E,b)).getDate()),43,Se)),64))])),64))])],512))}}),Le=V(e.defineComponent({__name:"CollapseButton",props:{collapsed:{type:Boolean}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["collapse-button",n.collapsed?"rotated":"unrotated"])},"×",2))}}),[["__scopeId","data-v-6f1c1b45"]]),I=V(e.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,l=n,a=e.ref(o.data||{}),i=r=>{let d={};for(const[c,u]of Object.entries(r))["component","fieldtype"].includes(c)||(d[c]=u),c==="rows"&&u&&u.length===0&&(d.rows=a.value[r.fieldname]);return d},s=e.computed({get:()=>o.modelValue.map((r,d)=>e.computed({get(){return r.value},set:c=>{o.modelValue[d].value=c,l("update:modelValue",o.modelValue)}})),set:()=>{}});return(r,d)=>(e.openBlock(),e.createElementBlock("form",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.modelValue,(c,u)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.component),e.mergeProps({key:u,schema:c,modelValue:s.value[u].value,"onUpdate:modelValue":p=>s.value[u].value=p,data:a.value[c.fieldname],readonly:r.readonly},i(c)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),[["__scopeId","data-v-74d66cf2"]]),J=V(e.defineComponent({__name:"AFieldset",props:{schema:{},label:{},collapsible:{type:Boolean},data:{}},setup(t){const n=t,o=e.ref(n.data||[]),l=e.ref(!1),a=e.ref(n.collapsible),i=e.ref(n.schema);function s(r){r.preventDefault(),a.value&&(l.value=!l.value)}return(r,d)=>(e.openBlock(),e.createElementBlock("fieldset",null,[e.createElementVNode("legend",{onClick:s,onSubmit:s},[e.createTextVNode(e.toDisplayString(r.label)+" ",1),a.value?(e.openBlock(),e.createBlock(Le,{key:0,collapsed:l.value},null,8,["collapsed"])):e.createCommentVNode("",!0)],32),e.renderSlot(r.$slots,"default",{collapsed:l.value},()=>[e.withDirectives(e.createVNode(I,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=c=>i.value=c),data:o.value},null,8,["modelValue","data"]),[[e.vShow,!l.value]])],!0)]))}}),[["__scopeId","data-v-0f671e32"]]),$e=["id","disabled","required"],Ne=["for"],ve=["innerHTML"],Q=V(e.defineComponent({__name:"ANumericInput",props:e.mergeModels({label:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:"&nbsp;"})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),type:"number",id:o.uuid,disabled:o.readonly,required:o.required},null,8,$e),[[e.vModelText,n.value]]),e.createElementVNode("label",{for:o.uuid},e.toDisplayString(o.label),9,Ne),e.withDirectives(e.createElementVNode("p",{innerHTML:o.validation.errorMessage},null,8,ve),[[e.vShow,o.validation.errorMessage]])]))}}),[["__scopeId","data-v-02907cd6"]]),X={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function Ie(t){try{return Function(`"use strict";return (${t})`)()}catch{}}function He(t){var o;let n=t.value;if(n){const l=Ie(n);if(l){const a=t.instance.locale;n=l(a)}}else{const l=t.instance.schema,a=(o=l==null?void 0:l.fieldtype)==null?void 0:o.toLowerCase();a&&X[a]&&(n=X[a])}return n}function xe(t,n){n||(n="#");let o=t;const l=[n,"/","-","(",")"," "];for(const a of l)o=o.replaceAll(a,"");return o}function Pe(t,n,o){o||(o="#");let l=n;for(const a of t){const i=l.indexOf(o);if(i!==-1){const s=l.substring(0,i),r=l.substring(i+1);l=s+a+r}}return l.slice(0,n.length)}function Fe(t,n){const o=He(n);if(!o)return;const l="#",a=t.value,i=xe(a,l);if(i){const s=Pe(i,o,l);n.instance.maskFilled&&(n.instance.maskFilled=!s.includes(l)),t.value=s}else t.value=o}const qe=["id","disabled","maxlength","required"],Re=["for"],Ue=["innerHTML"],Z=V(e.defineComponent({__name:"ATextInput",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:"&nbsp;"})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.ref(!0),o=e.useModel(t,"modelValue");return(l,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=i=>o.value=i),id:l.uuid,disabled:l.readonly,maxlength:l.mask?n.value&&l.mask.length:void 0,required:l.required},null,8,qe),[[e.vModelText,o.value],[e.unref(Fe),l.mask]]),e.createElementVNode("label",{for:l.uuid},e.toDisplayString(l.label),9,Re),e.withDirectives(e.createElementVNode("p",{innerHTML:l.validation.errorMessage},null,8,Ue),[[e.vShow,l.validation.errorMessage]])]))}}),[["__scopeId","data-v-2514e692"]]);function Oe(t){t.component("ACheckbox",H),t.component("ACombobox",x),t.component("ADate",P),t.component("ADropdown",F),t.component("ADatePicker",G),t.component("AFieldset",J),t.component("AForm",I),t.component("ANumericInput",Q),t.component("ATextInput",Z)}f.ACheckbox=H,f.AComboBox=x,f.ADate=P,f.ADatePicker=G,f.ADropdown=F,f.AFieldset=J,f.AForm=I,f.ANumericInput=Q,f.ATextInput=Z,f.install=Oe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
2
+ //# sourceMappingURL=aform.umd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aform.umd.cjs","sources":["../src/components/form/ACheckbox.vue","../src/components/form/ADate.vue","../src/components/form/ADropdown.vue","../../utilities/dist/utilities.js","../src/components/form/ADatePicker.vue","../src/components/AForm.vue","../src/components/form/AFieldset.vue","../src/components/form/ANumericInput.vue","../src/directives/mask.ts","../src/components/form/ATextInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<div>\n\t\t<label id=\"checkbox-container\">\n\t\t\t<input v-model=\"checkbox\" type=\"checkbox\" :id=\"uuid\" class=\"checkbox\" :readonly=\"readOnly\" :required=\"required\" />\n\t\t\t<span id=\"custom-checkbox\">{{ checkbox }}</span>\n\t\t</label>\n\t\t<label :for=\"uuid\" id=\"checkbox-label\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { InputHTMLAttributes } from 'vue'\n\nwithDefaults(\n\tdefineProps<{\n\t\tlabel?: string\n\t\trequired?: boolean\n\t\treadOnly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst checkbox = defineModel<InputHTMLAttributes['checked']>()\n</script>\n\n<style scoped>\ndiv {\n\tdisplay: inline-block;\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\n.checkbox {\n\tvisibility: hidden;\n}\n\n.checkbox + #custom-checkbox:after {\n\tcontent: '⬡';\n\tpadding: 1ch 0 0.5ch 0;\n\tfont-size: 120%;\n\tcursor: pointer;\n\tposition: relative;\n\tleft: -18px;\n}\n\n.checkbox:checked + #custom-checkbox:after {\n\tcontent: '⬣';\n\tpadding: 1ch 0 0.5ch 0;\n\tfont-size: 120%;\n\tcursor: pointer;\n\tposition: relative;\n\tleft: -18px;\n}\n\n#custom-checkbox {\n\tdisplay: inline-block;\n}\n\n#checkbox-container {\n\tdisplay: inline-block;\n\tmin-width: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\theight: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\n#checkbox-container:hover {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\n#checkbox-container:hover + label {\n\tcolor: var(--input-active-label-color);\n}\n\n#checkbox-label {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n</style>\n","<template>\n\t<div>\n\t\t<input\n\t\t\tref=\"dateRef\"\n\t\t\ttype=\"date\"\n\t\t\t:id=\"uuid\"\n\t\t\t:disabled=\"readonly\"\n\t\t\t:required=\"required\"\n\t\t\t:value=\"inputDate\"\n\t\t\t@click=\"showPicker\" />\n\t\t<label :for=\"uuid\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nwithDefaults(\n\tdefineProps<{\n\t\tlabel?: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tlabel: 'Date',\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst inputDate = defineModel<string | number | Date>()\nconst dateRef = ref<HTMLInputElement | null>(null)\n\nconst showPicker = () => {\n\tif (dateRef.value) {\n\t\tif ('showPicker' in HTMLInputElement.prototype) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker\n\t\t\t// TODO: re-check browser support and compatibility; figure out alternative ways\n\t\t\t// to spawn the native datepicker and eventually replace with ADatepicker\n\t\t\tdateRef.value.showPicker()\n\t\t}\n\t}\n}\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","<template>\n\t<div class=\"autocomplete\" :class=\"{ isOpen: isOpen }\">\n\t\t<div class=\"input-wrapper\">\n\t\t\t<input\n\t\t\t\tref=\"mopInput\"\n\t\t\t\ttype=\"text\"\n\t\t\t\t@input=\"onChange\"\n\t\t\t\t@focus=\"onChange\"\n\t\t\t\tv-model=\"search\"\n\t\t\t\t@keydown.down=\"onArrowDown\"\n\t\t\t\t@keydown.up=\"onArrowUp\"\n\t\t\t\t@keydown.enter=\"onEnter\" />\n\n\t\t\t<ul id=\"autocomplete-results\" v-show=\"isOpen\" class=\"autocomplete-results\">\n\t\t\t\t<li class=\"loading autocomplete-result\" v-if=\"isLoading\">Loading results...</li>\n\t\t\t\t<li\n\t\t\t\t\tv-else\n\t\t\t\t\tv-for=\"(result, i) in results\"\n\t\t\t\t\t:key=\"i\"\n\t\t\t\t\t@click=\"setResult(result)\"\n\t\t\t\t\tclass=\"autocomplete-result\"\n\t\t\t\t\t:class=\"{ 'is-active': i === arrowCounter }\">\n\t\t\t\t\t{{ result }}\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<label>{{ label }}</label>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst props = defineProps<{\n\tlabel: string\n\titems?: string[]\n\tisAsync?: boolean\n}>()\n\nconst emit = defineEmits(['filterChanged'])\n\nconst results = ref(props.items)\nconst search = defineModel<string>()\nconst isLoading = ref(false)\nconst arrowCounter = ref(0)\nconst isOpen = ref(false)\nconst mopInput = ref(null)\n\nonMounted(() => {\n\tdocument.addEventListener('click', handleClickOutside)\n\tfilterResults()\n})\n\nonUnmounted(() => {\n\tdocument.removeEventListener('click', handleClickOutside)\n})\n\nconst setResult = result => {\n\tsearch.value = result\n\tcloseResults()\n}\n\nconst filterResults = () => {\n\tif (!search.value) {\n\t\tresults.value = props.items\n\t} else {\n\t\tresults.value = props.items.filter(item => {\n\t\t\treturn item.toLowerCase().indexOf(search.value.toLowerCase()) > -1\n\t\t})\n\t}\n}\n\nconst onChange = () => {\n\tisOpen.value = true\n\tif (props.isAsync) {\n\t\tisLoading.value = true\n\t\temit('filterChanged', search.value)\n\t} else {\n\t\tfilterResults()\n\t}\n}\n\nconst handleClickOutside = (event: MouseEvent) => {\n\tcloseResults()\n\tarrowCounter.value = 0\n}\n\nconst closeResults = () => {\n\tisOpen.value = false\n\n\t// TODO: (test) when would this occur? how should this be tested?\n\tif (!props.items.includes(search.value)) {\n\t\tsearch.value = ''\n\t}\n}\n\nconst onArrowDown = () => {\n\tif (arrowCounter.value < results.value.length) {\n\t\tarrowCounter.value = arrowCounter.value + 1\n\t}\n}\n\nconst onArrowUp = () => {\n\tif (arrowCounter.value > 0) {\n\t\tarrowCounter.value = arrowCounter.value - 1\n\t}\n}\n\nconst onEnter = () => {\n\tsearch.value = results.value[arrowCounter.value]\n\tcloseResults()\n\tarrowCounter.value = 0\n}\n\n// const openWithSearch = () => {\n// \tsearch.value = ''\n// \tonChange()\n// \tmopInput.value.focus()\n// }\n</script>\n\n<style>\n/* variables taken from here: https://github.com/frappe/frappe/blob/version-13/frappe/public/scss/common/awesomeplete.scss */\n.autocomplete {\n\tposition: relative;\n}\n\n.input-wrapper {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n\tborder-radius: 0.25rem 0.25rem 0 0;\n\tborder-bottom: none;\n}\n\nlabel {\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\n.autocomplete-results {\n\tposition: absolute;\n\twidth: calc(100% - 1ch + 1.5px);\n\tz-index: 1;\n\tpadding: 0;\n\tmargin: 0;\n\tcolor: #000000;\n\tborder: 1px solid var(--input-active-border-color);\n\tborder-radius: 0 0 0.25rem 0.25rem;\n\tborder-top: none;\n}\n\n.autocomplete-result {\n\tlist-style: none;\n\ttext-align: left;\n\tpadding: 4px 6px;\n\tcursor: pointer;\n}\n\n.autocomplete-result.is-active,\n.autocomplete-result:hover {\n\tbackground-color: var(--row-color-zebra-light);\n\tcolor: #000000;\n}\n</style>\n","import { unref as I, getCurrentScope as O, onScopeDispose as U, computed as M, ref as b, watch as v, onMounted as j, onBeforeUnmount as V } from \"vue\";\nfunction B(e) {\n return O() ? (U(e), !0) : !1;\n}\nfunction _(e) {\n return typeof e == \"function\" ? e() : I(e);\n}\nconst F = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst q = Object.prototype.toString, N = (e) => q.call(e) === \"[object Object]\", G = () => {\n};\nfunction y(e) {\n var t;\n const n = _(e);\n return (t = n == null ? void 0 : n.$el) != null ? t : n;\n}\nconst T = F ? window : void 0;\nfunction w(...e) {\n let t, n, l, s;\n if (typeof e[0] == \"string\" || Array.isArray(e[0]) ? ([n, l, s] = e, t = T) : [t, n, l, s] = e, !t)\n return G;\n Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);\n const i = [], o = () => {\n i.forEach((f) => f()), i.length = 0;\n }, r = (f, u, p, d) => (f.addEventListener(u, p, d), () => f.removeEventListener(u, p, d)), c = v(\n () => [y(t), _(s)],\n ([f, u]) => {\n if (o(), !f)\n return;\n const p = N(u) ? { ...u } : u;\n i.push(\n ...n.flatMap((d) => l.map((E) => r(f, d, E, p)))\n );\n },\n { immediate: !0, flush: \"post\" }\n ), a = () => {\n c(), o();\n };\n return B(a), a;\n}\nfunction z(e = {}) {\n var t;\n const {\n window: n = T,\n deep: l = !0\n } = e, s = (t = e.document) != null ? t : n == null ? void 0 : n.document, i = () => {\n var c;\n let a = s == null ? void 0 : s.activeElement;\n if (l)\n for (; a != null && a.shadowRoot; )\n a = (c = a == null ? void 0 : a.shadowRoot) == null ? void 0 : c.activeElement;\n return a;\n }, o = b(), r = () => {\n o.value = i();\n };\n return n && (w(n, \"blur\", (c) => {\n c.relatedTarget === null && r();\n }, !0), w(n, \"focus\", r, !0)), r(), o;\n}\nfunction J(e, t = {}) {\n const n = z(t), l = M(() => y(e));\n return { focused: M(() => l.value && n.value ? l.value.contains(n.value) : !1) };\n}\nfunction Q(e, { window: t = T, scrollTarget: n } = {}) {\n const l = b(!1), s = () => {\n if (!t)\n return;\n const i = t.document, o = y(e);\n if (!o)\n l.value = !1;\n else {\n const r = o.getBoundingClientRect();\n l.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;\n }\n };\n return v(\n () => y(e),\n () => s(),\n { immediate: !0, flush: \"post\" }\n ), t && w(n || t, \"scroll\", s, {\n capture: !1,\n passive: !0\n }), l;\n}\nconst g = (e) => {\n let t = Q(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, m = (e) => e.tabIndex >= 0, x = (e) => {\n const t = e.target;\n return A(t);\n}, A = (e) => {\n var n;\n let t;\n if (e instanceof HTMLTableCellElement) {\n const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;\n if (l) {\n const i = Array.from(l.children)[e.cellIndex];\n i && (t = i);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const l = e.previousElementSibling;\n l && (t = l);\n }\n return t && (!m(t) || !g(t)) ? A(t) : t;\n}, X = (e) => {\n var l;\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const s = (l = t.parentElement) == null ? void 0 : l.parentElement;\n if (s) {\n const o = s.firstElementChild.children[t.cellIndex];\n o && (n = o);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const s = t.parentElement;\n if (s) {\n const i = s.firstElementChild;\n i && (n = i);\n }\n }\n return n && (!m(n) || !g(n)) ? S(n) : n;\n}, D = (e) => {\n const t = e.target;\n return S(t);\n}, S = (e) => {\n var n;\n let t;\n if (e instanceof HTMLTableCellElement) {\n const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;\n if (l) {\n const i = Array.from(l.children)[e.cellIndex];\n i && (t = i);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const l = e.nextElementSibling;\n l && (t = l);\n }\n return t && (!m(t) || !g(t)) ? S(t) : t;\n}, Y = (e) => {\n var l;\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const s = (l = t.parentElement) == null ? void 0 : l.parentElement;\n if (s) {\n const o = s.lastElementChild.children[t.cellIndex];\n o && (n = o);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const s = t.parentElement;\n if (s) {\n const i = s.lastElementChild;\n i && (n = i);\n }\n }\n return n && (!m(n) || !g(n)) ? A(n) : n;\n}, R = (e) => {\n const t = e.target;\n return k(t);\n}, k = (e) => {\n var n;\n let t;\n if (e.previousElementSibling)\n t = e.previousElementSibling;\n else {\n const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;\n t = l == null ? void 0 : l.lastElementChild;\n }\n return t && (!m(t) || !g(t)) ? k(t) : t;\n}, P = (e) => {\n const t = e.target;\n return L(t);\n}, L = (e) => {\n var n;\n let t;\n if (e.nextElementSibling)\n t = e.nextElementSibling;\n else {\n const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;\n t = l == null ? void 0 : l.firstElementChild;\n }\n return t && (!m(t) || !g(t)) ? L(t) : t;\n}, K = (e) => {\n const l = e.target.parentElement.firstElementChild;\n return l && (!m(l) || !g(l)) ? L(l) : l;\n}, W = (e) => {\n const l = e.target.parentElement.lastElementChild;\n return l && (!m(l) || !g(l)) ? k(l) : l;\n}, C = [\"alt\", \"control\", \"shift\", \"meta\"], Z = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, ee = {\n \"keydown.up\": (e) => {\n const t = x(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = D(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = R(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = P(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = X(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Y(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = K(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = W(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = W(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const n = D(e);\n n && n.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const n = x(e);\n n && n.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = K(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = P(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = R(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction ne(e) {\n const t = (o) => {\n let r = null;\n return o.parent && (typeof o.parent == \"string\" ? r = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? r = o.parent : r = o.parent.value), r;\n }, n = (o) => {\n const r = t(o);\n let c = [];\n if (typeof o.selectors == \"string\")\n c = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));\n else if (Array.isArray(o.selectors))\n for (const a of o.selectors)\n a instanceof HTMLElement ? c.push(a) : c.push(a.$el);\n else if (o.selectors instanceof HTMLElement)\n c.push(o.selectors);\n else if (Array.isArray(o.selectors.value))\n for (const a of o.selectors.value)\n a instanceof HTMLElement ? c.push(a) : c.push(a.$el);\n else\n c.push(o.selectors.value);\n return c;\n }, l = (o) => {\n const r = t(o);\n let c = [];\n return o.selectors ? c = n(o) : r && (c = Array.from(r.children).filter((f) => m(f) && g(f))), c;\n }, s = (o) => (r) => {\n const c = Z[r.key] || r.key.toLowerCase();\n if (C.includes(c))\n return;\n const a = o.handlers || ee;\n for (const f of Object.keys(a)) {\n const [u, ...p] = f.split(\".\");\n if (u === \"keydown\" && p.includes(c)) {\n const d = a[f], E = p.filter(($) => C.includes($)), H = C.some(($) => {\n const h = $.charAt(0).toUpperCase() + $.slice(1);\n return r.getModifierState(h);\n });\n if (E.length > 0) {\n if (H) {\n for (const $ of C)\n if (p.includes($)) {\n const h = $.charAt(0).toUpperCase() + $.slice(1);\n r.getModifierState(h) && d(r);\n }\n }\n } else\n H || d(r);\n }\n }\n }, i = [];\n j(() => {\n for (const o of e) {\n const r = t(o), c = l(o), a = s(o), f = r ? [r] : c;\n for (const u of f) {\n const { focused: p } = J(b(u)), d = v(p, (E) => {\n E ? u.addEventListener(\"keydown\", a) : u.removeEventListener(\"keydown\", a);\n });\n i.push(d);\n }\n }\n }), V(() => {\n for (const o of i)\n o();\n });\n}\nfunction le(e) {\n}\nexport {\n ee as defaultKeypressHandlers,\n le as install,\n ne as useKeyboardNav\n};\n//# sourceMappingURL=utilities.js.map\n","<template>\n\t<div class=\"adatepicker\" tabindex=\"0\" ref=\"adatepicker\">\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td id=\"previous-month-btn\" @click=\"previousMonth\" :tabindex=\"-1\">&lt;</td>\n\t\t\t\t<th colspan=\"5\" :tabindex=\"-1\">{{ monthAndYear }}</th>\n\t\t\t\t<td id=\"next-month-btn\" @click=\"nextMonth\" :tabindex=\"-1\">&gt;</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"days-header\">\n\t\t\t\t<td>M</td>\n\t\t\t\t<td>T</td>\n\t\t\t\t<td>W</td>\n\t\t\t\t<td>T</td>\n\t\t\t\t<td>F</td>\n\t\t\t\t<td>S</td>\n\t\t\t\t<td>S</td>\n\t\t\t</tr>\n\t\t\t<tr v-for=\"rowNo in numberOfRows\" :key=\"rowNo\">\n\t\t\t\t<td\n\t\t\t\t\tv-for=\"colNo in numberOfColumns\"\n\t\t\t\t\tref=\"celldate\"\n\t\t\t\t\t:key=\"getCurrentCell(rowNo, colNo)\"\n\t\t\t\t\t:contenteditable=\"false\"\n\t\t\t\t\t:spellcheck=\"false\"\n\t\t\t\t\t:tabindex=\"0\"\n\t\t\t\t\t@click.prevent.stop=\"selectDate(getCurrentCell(rowNo, colNo))\"\n\t\t\t\t\t@keydown.enter=\"selectDate(getCurrentCell(rowNo, colNo))\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\ttodaysDate: isTodaysDate(getCurrentDate(rowNo, colNo)),\n\t\t\t\t\t\tselectedDate: isSelectedDate(getCurrentDate(rowNo, colNo)),\n\t\t\t\t\t}\">\n\t\t\t\t\t{{ new Date(getCurrentDate(rowNo, colNo)).getDate() }}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { defaultKeypressHandlers, useKeyboardNav } from '@stonecrop/utilities'\nimport { computed, nextTick, onMounted, ref, watch } from 'vue'\n\nconst numberOfRows = 6\nconst numberOfColumns = 7\n\nconst date = defineModel<number | Date>({ default: new Date() })\nconst selectedDate = ref(new Date(date.value))\nconst currentMonth = ref<number>(selectedDate.value.getMonth())\nconst currentYear = ref<number>(selectedDate.value.getFullYear())\nconst currentDates = ref<number[]>([])\nconst adatepicker = ref<HTMLElement | null>(null)\n\nonMounted(async () => {\n\tpopulateMonth()\n\n\t// required to allow the elements to be focused in the next step\n\tawait nextTick()\n\n\tconst $selectedDate = document.getElementsByClassName('selectedDate')\n\tif ($selectedDate.length > 0) {\n\t\t;($selectedDate[0] as HTMLElement).focus()\n\t} else {\n\t\tconst $todaysDate = document.getElementsByClassName('todaysDate')\n\t\tif ($todaysDate.length > 0) {\n\t\t\t;($todaysDate[0] as HTMLElement).focus()\n\t\t}\n\t}\n})\n\nconst populateMonth = () => {\n\tcurrentDates.value = []\n\tconst firstOfMonth = new Date(currentYear.value, currentMonth.value, 1)\n\tconst monthStartWeekday = firstOfMonth.getDay()\n\tconst calendarStartDay = firstOfMonth.setDate(firstOfMonth.getDate() - monthStartWeekday)\n\n\t// assume midnight for all dates while building the calendar\n\tfor (const dayIndex of Array(43).keys()) {\n\t\tcurrentDates.value.push(calendarStartDay + dayIndex * 86400000)\n\t}\n}\n\nwatch([currentMonth, currentYear], populateMonth)\nconst previousYear = () => (currentYear.value -= 1)\nconst nextYear = () => (currentYear.value += 1)\n\nconst previousMonth = () => {\n\tif (currentMonth.value == 0) {\n\t\tcurrentMonth.value = 11\n\t\tpreviousYear()\n\t} else {\n\t\tcurrentMonth.value -= 1\n\t}\n}\n\nconst nextMonth = () => {\n\tif (currentMonth.value == 11) {\n\t\tcurrentMonth.value = 0\n\t\tnextYear()\n\t} else {\n\t\tcurrentMonth.value += 1\n\t}\n}\n\nconst isTodaysDate = (day: string | number | Date) => {\n\tconst todaysDate = new Date()\n\tif (currentMonth.value !== todaysDate.getMonth()) {\n\t\treturn\n\t}\n\treturn todaysDate.toDateString() === new Date(day).toDateString()\n}\n\nconst isSelectedDate = (day: string | number | Date) => {\n\treturn new Date(day).toDateString() === new Date(selectedDate.value).toDateString()\n}\n\nconst getCurrentCell = (rowNo: number, colNo: number) => {\n\treturn (rowNo - 1) * numberOfColumns + colNo\n}\n\nconst getCurrentDate = (rowNo: number, colNo: number) => {\n\treturn currentDates.value[getCurrentCell(rowNo, colNo)]\n}\n\nconst selectDate = (currentIndex: number) => {\n\tdate.value = selectedDate.value = new Date(currentDates.value[currentIndex])\n}\n\nconst monthAndYear = computed(() => {\n\treturn new Date(currentYear.value, currentMonth.value, 1).toLocaleDateString(undefined, {\n\t\tyear: 'numeric',\n\t\tmonth: 'long',\n\t})\n})\n\n// setup keyboard navigation\nuseKeyboardNav([\n\t{\n\t\tparent: adatepicker,\n\t\tselectors: 'td',\n\t\thandlers: {\n\t\t\t...defaultKeypressHandlers,\n\t\t\t...{\n\t\t\t\t'keydown.pageup': previousMonth,\n\t\t\t\t'keydown.shift.pageup': previousYear,\n\t\t\t\t'keydown.pagedown': nextMonth,\n\t\t\t\t'keydown.shift.pagedown': nextYear,\n\t\t\t\t// TODO: this is a hack to override the stonecrop enter handler;\n\t\t\t\t// store context inside the component so that handlers can be setup consistently\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\t\t\t\t'keydown.enter': () => {}, // select this date\n\t\t\t},\n\t\t},\n\t},\n])\n</script>\n\n<style>\n@import url('@stonecrop/themes/default/default.css');\n@import url('@/theme/adate.css');\n@import url('@/theme/aform.css');\n</style>\n","<template>\n\t<form>\n\t\t<component\n\t\t\tv-for=\"(componentObj, key) in modelValue\"\n\t\t\t:is=\"componentObj.component\"\n\t\t\t:key=\"key\"\n\t\t\t:schema=\"componentObj\"\n\t\t\tv-model=\"childModels[key].value\"\n\t\t\t:data=\"formData[componentObj.fieldname]\"\n\t\t\t:readonly=\"readonly\"\n\t\t\tv-bind=\"componentProps(componentObj)\">\n\t\t</component>\n\t</form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nimport { SchemaTypes } from 'types'\n\nconst props = defineProps<{\n\tmodelValue: SchemaTypes[]\n\tdata: Record<string, any>\n\treadonly?: boolean\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst formData = ref(props.data || {})\n\nconst componentProps = (componentObj: SchemaTypes) => {\n\tlet propsToPass = {}\n\tfor (const [key, value] of Object.entries(componentObj)) {\n\t\tif (!['component', 'fieldtype'].includes(key)) {\n\t\t\tpropsToPass[key] = value\n\t\t}\n\n\t\t// handle ATable data formats in case the table is nested under an AFormm;\n\t\t// TODO: there's probably a better way to do this\n\t\tif (key === 'rows') {\n\t\t\tif (value && (value as any[]).length === 0) {\n\t\t\t\tpropsToPass['rows'] = formData.value[componentObj.fieldname]\n\t\t\t}\n\t\t}\n\t}\n\treturn propsToPass\n}\n\nconst childModels = computed({\n\tget: () => {\n\t\treturn props.modelValue.map((val, i) => {\n\t\t\treturn computed({\n\t\t\t\tget() {\n\t\t\t\t\treturn val.value\n\t\t\t\t},\n\t\t\t\tset: newValue => {\n\t\t\t\t\t// Find the component in modelValue and update it\n\t\t\t\t\tprops.modelValue[i].value = newValue\n\t\t\t\t\temit('update:modelValue', props.modelValue)\n\t\t\t\t},\n\t\t\t})\n\t\t})\n\t},\n\tset: (/* newValue */) => {\n\t\t//emit('update:modelValue', '')\n\t},\n})\n</script>\n\n<style scoped>\nform {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n\talign-items: baseline;\n}\n</style>\n","<template>\n\t<fieldset>\n\t\t<legend @click=\"toggleCollapse\" @submit=\"toggleCollapse\">\n\t\t\t{{ label }}\n\t\t\t<CollapseButton v-if=\"collapsible\" :collapsed=\"collapsed\" />\n\t\t</legend>\n\t\t<slot :collapsed=\"collapsed\">\n\t\t\t<AForm v-show=\"!collapsed\" v-model=\"formSchema\" :data=\"formData\" />\n\t\t</slot>\n\t</fieldset>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nimport CollapseButton from '@/components/base/CollapseButton.vue'\nimport AForm from '@/components/AForm.vue'\nimport { SchemaTypes } from 'types/index'\n\nconst props = defineProps<{\n\tschema: SchemaTypes[]\n\tlabel: string\n\tcollapsible?: boolean\n\tdata?: any\n}>()\n\nconst formData = ref(props.data || [])\nconst collapsed = ref(false)\nconst collapsible = ref(props.collapsible)\n\nconst formSchema = ref(props.schema)\nfunction toggleCollapse(event: Event) {\n\tevent.preventDefault()\n\tif (!collapsible.value) {\n\t\treturn\n\t}\n\tcollapsed.value = !collapsed.value\n}\n</script>\n\n<style scoped>\nfieldset {\n\tmax-width: 100%;\n\twidth: 100%;\n\tmargin-right: 2ch;\n\tborder: 1px solid transparent;\n\tborder-bottom: 1px solid var(--gray-50);\n}\n\nlegend {\n\twidth: 100%;\n\theight: 1.15rem;\n\tborder: 1px solid transparent;\n\tpadding-bottom: 0.5rem;\n\tfont-size: 110%;\n\tfont-weight: 600;\n\tuser-select: none;\n}\n\n.collapse-button {\n\tfloat: right;\n}\n</style>\n","<template>\n\t<div>\n\t\t<input v-model=\"inputNumber\" type=\"number\" :id=\"uuid\" :disabled=\"readonly\" :required=\"required\" />\n\t\t<label :for=\"uuid\">{{ label }}</label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nwithDefaults(\n\tdefineProps<{\n\t\tlabel: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: Record<string, any>\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\nconst inputNumber = defineModel<number>()\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","import type { FormSchema } from 'types'\nimport type { DirectiveBinding } from 'vue'\n\nconst NAMED_MASKS = {\n\tdate: '##/##/####',\n\tdatetime: '####/##/## ##:##',\n\ttime: '##:##',\n\tfulltime: '##:##:##',\n\tphone: '(###) ### - ####',\n\tcard: '#### #### #### ####',\n}\n\nfunction extractMaskFn(mask: string): ((args: any) => string) | void {\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\t\treturn Function(`\"use strict\";return (${mask})`)()\n\t} catch (error) {\n\t\tif (error instanceof ReferenceError) {\n\t\t\t// assume mask is a string\n\t\t}\n\t}\n}\n\nfunction getMask(binding: DirectiveBinding<string>) {\n\tlet mask = binding.value\n\n\tif (mask) {\n\t\tconst maskFn = extractMaskFn(mask)\n\t\tif (maskFn) {\n\t\t\t// TODO: (state) replace with state management;\n\t\t\t// pass the entire form/table data to the function\n\t\t\tconst locale = binding.instance['locale']\n\t\t\tmask = maskFn(locale)\n\t\t}\n\t} else {\n\t\t// TODO: (state) handle using state management\n\t\tconst schema: FormSchema = binding.instance['schema']\n\t\tconst fieldType: string | undefined = schema?.fieldtype?.toLowerCase()\n\t\tif (fieldType && NAMED_MASKS[fieldType]) {\n\t\t\tmask = NAMED_MASKS[fieldType]\n\t\t}\n\t}\n\n\treturn mask\n}\n\nfunction unmaskInput(input: string, maskToken?: string) {\n\tif (!maskToken) {\n\t\tmaskToken = '#'\n\t}\n\n\tlet unmaskedInput = input\n\tconst maskChars = [maskToken, '/', '-', '(', ')', ' ']\n\n\tfor (const char of maskChars) {\n\t\tunmaskedInput = unmaskedInput.replaceAll(char, '')\n\t}\n\n\treturn unmaskedInput\n}\n\nfunction fillMask(input: string, mask: string, maskToken?: string) {\n\tif (!maskToken) {\n\t\tmaskToken = '#'\n\t}\n\n\tlet replacement = mask\n\tfor (const inputChar of input) {\n\t\tconst replaceIndex = replacement.indexOf(maskToken)\n\t\tif (replaceIndex !== -1) {\n\t\t\tconst prefix = replacement.substring(0, replaceIndex)\n\t\t\tconst suffix = replacement.substring(replaceIndex + 1)\n\t\t\treplacement = prefix + inputChar + suffix\n\t\t}\n\t}\n\n\treturn replacement.slice(0, mask.length)\n}\n\nexport function useStringMask(el: HTMLInputElement, binding: DirectiveBinding<string>) {\n\tconst mask = getMask(binding)\n\tif (!mask) return\n\n\tconst maskToken = '#'\n\tconst inputText = el.value\n\n\t// process input value with mask\n\tconst unmaskedInput = unmaskInput(inputText, maskToken)\n\tif (unmaskedInput) {\n\t\tconst replacement = fillMask(unmaskedInput, mask, maskToken)\n\n\t\t// TODO: (state) this is very opinionated;\n\t\t// most likely fixed with state management;\n\t\t// a better way could be to emit back to instance;\n\n\t\tif (binding.instance['maskFilled']) {\n\t\t\tbinding.instance['maskFilled'] = !replacement.includes(maskToken)\n\t\t}\n\n\t\tel.value = replacement\n\t} else {\n\t\tel.value = mask\n\t}\n}\n","<template>\n\t<div>\n\t\t<input\n\t\t\tv-model=\"inputText\"\n\t\t\t:id=\"uuid\"\n\t\t\t:disabled=\"readonly\"\n\t\t\t:maxlength=\"mask ? maskFilled && mask.length : undefined\"\n\t\t\t:required=\"required\"\n\t\t\tv-mask=\"mask\" />\n\t\t<label :for=\"uuid\">{{ label }} </label>\n\t\t<p v-show=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\n\nimport { FormSchema } from 'types'\nimport { useStringMask as vMask } from '@/directives/mask'\n\nwithDefaults(\n\tdefineProps<{\n\t\tschema: FormSchema\n\t\tlabel: string\n\t\tmask?: string\n\t\trequired?: boolean\n\t\treadonly?: boolean\n\t\tuuid?: string\n\t\tvalidation?: { errorMessage: string }\n\t}>(),\n\t{\n\t\tvalidation: () => ({ errorMessage: '&nbsp;' }),\n\t}\n)\n\n// TODO: setup maskFilled as a computed property\nconst maskFilled = ref(true)\n\n// TODO: (state) replace with state management\n// const locale = inject<string>('locale', '')\n\nconst inputText = defineModel<number | string>()\n</script>\n\n<style scoped>\ndiv {\n\tmin-width: 40ch;\n\tborder: 1px solid transparent;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tmargin-right: 1ch;\n}\n\ninput {\n\twidth: calc(100% - 1ch);\n\toutline: 1px solid transparent;\n\tborder: 1px solid var(--input-border-color);\n\tpadding: 1ch 0.5ch 0.5ch 1ch;\n\tmargin: calc(1.15rem / 2) 0 0 0;\n\tmin-height: 1.15rem;\n\tborder-radius: 0.25rem;\n}\n\np,\nlabel {\n\tcolor: var(--input-label-color);\n\tdisplay: block;\n\tmin-height: 1.15rem;\n\tpadding: 0rem;\n\tmargin: 0rem;\n\tborder: 1px solid transparent;\n\tmargin-bottom: 0.25rem;\n}\n\np {\n\twidth: 100%;\n\tcolor: red;\n\tfont-size: 85%;\n}\n\nlabel {\n\tz-index: 2;\n\tfont-size: 80%;\n\tposition: absolute;\n\tbackground: white;\n\tmargin: calc(-1.5rem - calc(2.15rem / 2)) 0 0 1ch;\n\tpadding: 0 0.25ch 0 0.25ch;\n}\n\ninput:focus {\n\tborder: 1px solid var(--input-active-border-color);\n}\n\ninput:focus + label {\n\tcolor: var(--input-active-label-color);\n}\n</style>\n","import { App } from 'vue'\n\nimport ACheckbox from '@/components/form/ACheckbox.vue'\nimport AComboBox from '@/components/form/AComboBox.vue'\nimport ADate from '@/components/form/ADate.vue'\nimport ADropdown from '@/components/form/ADropdown.vue'\nimport ADatePicker from '@/components/form/ADatePicker.vue'\nimport AFieldset from '@/components/form/AFieldset.vue'\nimport AForm from '@/components/AForm.vue'\nimport ANumericInput from '@/components/form/ANumericInput.vue'\nimport ATextInput from '@/components/form/ATextInput.vue'\n// import { ACurrency } from '@/components/form/ACurrency.vue'\n// import { AQuantity } from '@/components/form/AQuantity.vue'\n\nfunction install(app: App /* options */) {\n\tapp.component('ACheckbox', ACheckbox)\n\tapp.component('ACombobox', AComboBox)\n\tapp.component('ADate', ADate)\n\tapp.component('ADropdown', ADropdown)\n\tapp.component('ADatePicker', ADatePicker)\n\tapp.component('AFieldset', AFieldset)\n\tapp.component('AForm', AForm)\n\tapp.component('ANumericInput', ANumericInput)\n\tapp.component('ATextInput', ATextInput)\n\t// app.component('ACurrency', ACurrency)\n\t// app.component('AQuantity', AQuantity)\n}\n\nexport { ACheckbox, AComboBox, ADate, ADropdown, ADatePicker, AFieldset, AForm, ANumericInput, ATextInput, install }\n"],"names":["checkbox","_useModel","__props","inputDate","dateRef","ref","showPicker","props","emit","__emit","results","search","isLoading","arrowCounter","isOpen","mopInput","onMounted","handleClickOutside","filterResults","onUnmounted","setResult","result","closeResults","item","onChange","event","onArrowDown","onArrowUp","onEnter","B","e","O","U","_","I","F","q","N","G","y","t","n","T","w","s","o","f","u","p","d","c","v","E","a","z","b","J","M","Q","g","m","x","A","i","X","l","S","D","Y","R","k","P","L","K","W","C","Z","ee","ne","$","H","h","j","V","numberOfRows","numberOfColumns","date","selectedDate","currentMonth","currentYear","currentDates","adatepicker","populateMonth","nextTick","$selectedDate","$todaysDate","firstOfMonth","monthStartWeekday","calendarStartDay","dayIndex","watch","previousYear","nextYear","previousMonth","nextMonth","isTodaysDate","day","todaysDate","isSelectedDate","getCurrentCell","rowNo","colNo","getCurrentDate","selectDate","currentIndex","monthAndYear","computed","useKeyboardNav","defaultKeypressHandlers","formData","componentProps","componentObj","propsToPass","key","value","childModels","val","newValue","collapsed","collapsible","formSchema","toggleCollapse","inputNumber","NAMED_MASKS","extractMaskFn","mask","getMask","binding","maskFn","locale","schema","fieldType","_a","unmaskInput","input","maskToken","unmaskedInput","maskChars","char","fillMask","replacement","inputChar","replaceIndex","prefix","suffix","useStringMask","el","inputText","maskFilled","install","app","ACheckbox","AComboBox","ADate","ADropdown","ADatePicker","AFieldset","AForm","ANumericInput","ATextInput"],"mappings":"4nBA2BM,MAAAA,EAAWC,EAAAA,SAA2CC,EAAA,YAAC,4+CCKvD,MAAAC,EAAYF,EAAAA,uBAAoC,EAChDG,EAAUC,MAA6B,IAAI,EAE3CC,EAAa,IAAM,CACpBF,EAAQ,O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,EAAY,MAAM,EAAGf,EAAK,MAAM,CACxC,CAEgB,SAAAoB,GAAcC,EAAsBnB,EAAmC,CAChF,MAAAF,EAAOC,GAAQC,CAAO,EAC5B,GAAI,CAACF,EAAM,OAEX,MAAMU,EAAY,IACZY,EAAYD,EAAG,MAGfV,EAAgBH,GAAYc,EAAWZ,CAAS,EACtD,GAAIC,EAAe,CAClB,MAAMI,EAAcD,GAASH,EAAeX,EAAMU,CAAS,EAMvDR,EAAQ,SAAS,aACpBA,EAAQ,SAAS,WAAgB,CAACa,EAAY,SAASL,CAAS,GAGjEW,EAAG,MAAQN,CAAA,MAEXM,EAAG,MAAQrB,CAEb,8VCnEM,MAAAuB,EAAazJ,MAAI,EAAI,EAKrBwJ,EAAY5J,EAAAA,uBAA6B,gjBC3B/C,SAAS8J,GAAQC,EAAwB,CACpCA,EAAA,UAAU,YAAaC,CAAS,EAChCD,EAAA,UAAU,YAAaE,CAAS,EAChCF,EAAA,UAAU,QAASG,CAAK,EACxBH,EAAA,UAAU,YAAaI,CAAS,EAChCJ,EAAA,UAAU,cAAeK,CAAW,EACpCL,EAAA,UAAU,YAAaM,CAAS,EAChCN,EAAA,UAAU,QAASO,CAAK,EACxBP,EAAA,UAAU,gBAAiBQ,CAAa,EACxCR,EAAA,UAAU,aAAcS,CAAU,CAGvC"}
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap";@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap";div[data-v-5093f1cb]{display:inline-block;min-width:40ch;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}p[data-v-5093f1cb],label[data-v-5093f1cb]{color:var(--input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent}p[data-v-5093f1cb]{width:100%;color:red;font-size:85%}.checkbox[data-v-5093f1cb]{visibility:hidden}.checkbox+#custom-checkbox[data-v-5093f1cb]:after{content:"⬡";padding:1ch 0 .5ch;font-size:120%;cursor:pointer;position:relative;left:-18px}.checkbox:checked+#custom-checkbox[data-v-5093f1cb]:after{content:"⬣";padding:1ch 0 .5ch;font-size:120%;cursor:pointer;position:relative;left:-18px}#custom-checkbox[data-v-5093f1cb]{display:inline-block}#checkbox-container[data-v-5093f1cb]{display:inline-block;min-width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;height:1.15rem;border-radius:.25rem}#checkbox-container[data-v-5093f1cb]:hover{border:1px solid var(--input-active-border-color)}#checkbox-container:hover+label[data-v-5093f1cb]{color:var(--input-active-label-color)}#checkbox-label[data-v-5093f1cb]{z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}div[data-v-69d0f23d]{min-width:40ch;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-69d0f23d]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-69d0f23d],label[data-v-69d0f23d]{color:var(--input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent}p[data-v-69d0f23d]{width:100%;color:red;font-size:85%}label[data-v-69d0f23d]{z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}input[data-v-69d0f23d]:focus{border:1px solid var(--input-active-border-color)}input:focus+label[data-v-69d0f23d]{color:var(--input-active-label-color)}.autocomplete{position:relative}.input-wrapper{min-width:40ch;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}input:focus{border:1px solid var(--input-active-border-color);border-radius:.25rem .25rem 0 0;border-bottom:none}label{display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}.autocomplete-results{position:absolute;width:calc(100% - 1ch + 1.5px);z-index:1;padding:0;margin:0;color:#000;border:1px solid var(--input-active-border-color);border-radius:0 0 .25rem .25rem;border-top:none}.autocomplete-result{list-style:none;text-align:left;padding:4px 6px;cursor:pointer}.autocomplete-result.is-active,.autocomplete-result:hover{background-color:var(--row-color-zebra-light);color:#000}:root{--primary-color: #0098c9;--primary-text-color: #ffffff;--brand-color: #202a44;--gray-5: #f2f2f2;--gray-10: #e6e6e6;--gray-20: #cccccc;--gray-50: #808080;--gray-60: #666666;--gray-80: #333333;--brand-danger: #e63c28;--brand-success: #155724;--row-color-zebra-light: #eeeeee;--row-color-zebra-dark: #dddddd;--focus-cell-background: #ffffff;--focus-cell-outline: #000000;--cell-border-color: #ffffff;--cell-text-color: #3a3c41;--active-cell-background: #ffffff;--active-cell-outline: #e6a92d;--row-border-color: var(--gray-20);--header-border-color: #ffffff;--header-text-color: var(--gray-20);--row-number-background-color: #ffffff;--input-border-color: var(--gray-20);--input-label-color: var(--gray-80);--input-active-border-color: #000000;--input-active-label-color: #000000;--required-border: #e63c28;--font-size: 11pt;--font-family: Arimo, Arial, sans-serif;--table-font-size: 11pt;--atable-font-family: "Arimo", sans-serif;--atable-row-padding: 0px;--atable-row-height: 1.5em;--btn-color: white;--btn-border: #cccccc;--btn-hover: #f2f2f2;--btn-label-color: black}.adatepicker{font-size:var(--table-font-size);display:inline-table;color:var(--cell-text-color);outline:none;border-collapse:collapse}.adatepicker tr{height:1.15rem;text-align:center;vertical-align:middle}.adatepicker td{border:2px solid transparent;outline:2px solid transparent;min-width:3ch;max-width:3ch}.adatepicker td:focus,.adatepicker td:focus-within{outline:1px dashed black;box-shadow:none;min-height:1.15em;max-height:1.15em;overflow:hidden}.adatepicker .selectedDate{outline:1px solid black;background:var(--gray-20);font-weight:bolder}.adatepicker .todaysDate{font-weight:bolder;text-decoration:underline;color:#000}.days-header>td{font-weight:700}.prev-date{color:var(--gray-20)}:root{font-family:var(--font-family)}.aform-primary-action{font-size:100%;text-align:center;min-height:2em;padding:.25rem 1rem;border:1px solid var(--primary-color);color:var(--primary-text-color);background-color:var(--primary-color);outline:2px solid var(--primary-text-color);transition:outline-offset .2s ease;font-size:var(--font-size);margin:.5ch}.aform-primary-action:hover,.aform-primary-action:active{outline:2px solid var(--primary-text-color);outline-offset:-4px;transition:outline-offset .2s ease}.collapse-button[data-v-6f1c1b45]{width:2ch;min-width:calc(66px - 4ch);background-color:transparent;font-size:150%;text-align:center;border:none;margin-top:-.5rem}.rotated[data-v-6f1c1b45]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s;transform-origin:center center}.unrotated[data-v-6f1c1b45]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s}form[data-v-74d66cf2]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:baseline}fieldset[data-v-0f671e32]{max-width:100%;width:100%;margin-right:2ch;border:1px solid transparent;border-bottom:1px solid var(--gray-50)}legend[data-v-0f671e32]{width:100%;height:1.15rem;border:1px solid transparent;padding-bottom:.5rem;font-size:110%;font-weight:600;-webkit-user-select:none;user-select:none}.collapse-button[data-v-0f671e32]{float:right}div[data-v-02907cd6]{min-width:40ch;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-02907cd6]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-02907cd6],label[data-v-02907cd6]{color:var(--input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent}p[data-v-02907cd6]{width:100%;color:red;font-size:85%}label[data-v-02907cd6]{z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}input[data-v-02907cd6]:focus{border:1px solid var(--input-active-border-color)}input:focus+label[data-v-02907cd6]{color:var(--input-active-label-color)}div[data-v-2514e692]{min-width:40ch;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-2514e692]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-2514e692],label[data-v-2514e692]{color:var(--input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent}p[data-v-2514e692]{width:100%;color:red;font-size:85%}label[data-v-2514e692]{z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}input[data-v-2514e692]:focus{border:1px solid var(--input-active-border-color)}input:focus+label[data-v-2514e692]{color:var(--input-active-label-color)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/aform",
3
- "version": "0.2.17",
3
+ "version": "0.2.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -33,8 +33,8 @@
33
33
  "dependencies": {
34
34
  "uuid": "^9.0.0",
35
35
  "vue": "^3.4.23",
36
- "@stonecrop/utilities": "0.2.17",
37
- "@stonecrop/themes": "0.2.17"
36
+ "@stonecrop/themes": "0.2.20",
37
+ "@stonecrop/utilities": "0.2.20"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@histoire/plugin-vue": "^0.17.17",
@@ -55,10 +55,10 @@
55
55
  "vite": "^5.2.9",
56
56
  "vitest": "^1.6.0",
57
57
  "vue-router": "^4",
58
- "@stonecrop/atable": "0.2.17"
58
+ "@stonecrop/atable": "0.2.20"
59
59
  },
60
60
  "peerDependencies": {
61
- "@stonecrop/atable": "0.2.17"
61
+ "@stonecrop/atable": "0.2.20"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"
@@ -67,6 +67,7 @@
67
67
  "node": ">=20.11.0"
68
68
  },
69
69
  "scripts": {
70
+ "prepublish": "tsc -b && vite build",
70
71
  "build": "tsc -b && vite build",
71
72
  "dev": "vite",
72
73
  "lint": "eslint . --ext .ts,.vue",