@stonecrop/aform 0.2.21 → 0.2.23
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 +182 -172
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +1 -1
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/components/AForm.vue +2 -8
- package/src/components/form/ACheckbox.vue +6 -89
- package/src/components/form/ANumericInput.vue +4 -58
- package/src/components/form/ATextInput.vue +4 -57
- package/src/components/utilities/Login.vue +3 -3
- package/src/theme/aform.css +1 -28
- package/src/theme/fields.css +85 -0
- package/src/theme/login.css +0 -128
package/dist/aform.js.map
CHANGED
|
@@ -1 +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: ' ' }),\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: ' ' }),\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\"><</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\">></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: ' ' }),\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: ' ' }),\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,MAAM;AACN,eAAA,iBAAiB,SAASC,CAAkB,GACvCC;IAAA,CACd,GAEDC,GAAY,MAAM;AACR,eAA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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;"}
|
|
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 class=\"aform__form-element\">\n\t\t<label class=\"aform__field-label\" :for=\"uuid\">{{ label }}</label>\n\t\t<span class=\"aform__checkbox-container aform__input-field\">\n\t\t\t<input v-model=\"checkbox\" type=\"checkbox\" :id=\"uuid\" class=\"aform__checkbox\" :readonly=\"readOnly\" :required=\"required\" />\n\t\t</span>\n\t\t<p class=\"error\" 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: ' ' }),\n\t}\n)\n\nconst checkbox = defineModel<InputHTMLAttributes['checked']>()\n</script>\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: ' ' }),\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\"><</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\">></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 class=\"aform\">\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>\n@import url('@/theme/aform.css');\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 class=\"aform__form-element\">\n\t\t<label class=\"aform__field-label\" :for=\"uuid\">{{ label }}</label>\n\t\t<input class=\"aform__input-field\" v-model=\"inputNumber\" type=\"number\" :id=\"uuid\" :disabled=\"readonly\" :required=\"required\" />\n\t\t<p class=\"error\" 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: ' ' }),\n\t}\n)\n\nconst inputNumber = defineModel<number>()\n</script>\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 class=\"aform__form-element\">\n\t\t<label class=\"aform__field-label\" :for=\"uuid\">{{ label }} </label>\n\t\t<input\n\t\t\tclass=\"aform__input-field\"\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<p class=\"error\" 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: ' ' }),\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","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":";;;;;;;;;;;;;;;AA0BM,UAAAA,IAAWC,EAA2CC,GAAA,YAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACMvD,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,MAAM;AACN,eAAA,iBAAiB,SA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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;;;;;;;;;;;;;;;;;AClEM,UAAAuB,IAAazJ,EAAI,EAAI,GAKrBwJ,IAAY5J,iBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;AC5B/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;"}
|
package/dist/aform.umd.cjs
CHANGED
|
@@ -1,2 +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:" "})}},{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:" "})}},{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:" "})}},{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:" "})}},{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"})});
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p["@stonecrop/aform"]={},p.Vue))})(this,function(p,e){"use strict";const te={class:"aform__form-element"},ne=["for"],oe={class:"aform__checkbox-container aform__input-field"},le=["id","readonly","required"],ae=["innerHTML"],I=e.defineComponent({__name:"ACheckbox",props:e.mergeModels({label:{},required:{type:Boolean},readOnly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("label",{class:"aform__field-label",for:o.uuid},e.toDisplayString(o.label),9,ne),e.createElementVNode("span",oe,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),type:"checkbox",id:o.uuid,class:"aform__checkbox",readonly:o.readOnly,required:o.required},null,8,le),[[e.vModelCheckbox,n.value]])]),e.withDirectives(e.createElementVNode("p",{class:"error",innerHTML:o.validation.errorMessage},null,8,ae),[[e.vShow,o.validation.errorMessage]])]))}}),re=e.createElementVNode("div",null,[e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"})],-1),P=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(()=>[re]),_:1},8,["event","cellData"])}}}),se=["id","disabled","required","value"],ie=["for"],ce=["innerHTML"],de=e.defineComponent({__name:"ADate",props:e.mergeModels({label:{default:"Date"},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{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,se),e.createElementVNode("label",{for:a.uuid},e.toDisplayString(a.label),9,ie),e.withDirectives(e.createElementVNode("p",{innerHTML:a.validation.errorMessage},null,8,ce),[[e.vShow,a.validation.errorMessage]])]))}}),C=(t,n)=>{const o=t.__vccOpts||t;for(const[l,a]of n)o[l]=a;return o},F=C(de,[["__scopeId","data-v-69d0f23d"]]),ue={class:"input-wrapper"},me={id:"autocomplete-results",class:"autocomplete-results"},fe={key:0,class:"loading autocomplete-result"},pe=["onClick"],q=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),f()}),e.onUnmounted(()=>{document.removeEventListener("click",g)});const u=m=>{i.value=m,k()},f=()=>{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)):f()},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)},_=()=>{r.value>0&&(r.value=r.value-1)},V=()=>{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(_,["up"]),e.withKeys(V,["enter"])]},null,544),[[e.vModelText,i.value]]),e.withDirectives(e.createElementVNode("ul",me,[s.value?(e.openBlock(),e.createElementBlock("li",fe,"Loading results...")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(E,w)=>(e.openBlock(),e.createElementBlock("li",{key:w,onClick:ee=>u(E),class:e.normalizeClass(["autocomplete-result",{"is-active":w===r.value}])},e.toDisplayString(E),11,pe))),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 x(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=x(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,f,h,g)=>(u.addEventListener(f,h,g),()=>u.removeEventListener(f,h,g)),d=e.watch(()=>[A(n),x(a)],([u,f])=>{if(s(),!u)return;const h=ke(f)?{...f}:f;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 _e(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 we(t,n={}){const o=_e(n),l=e.computed(()=>A(t));return{focused:e.computed(()=>l.value&&o.value?l.value.contains(o.value):!1)}}function be(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 b=t=>{let n=be(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)||!b(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)||!b(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)||!b(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)||!b(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)||!b(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)||!b(o))?v(o):o},W=t=>{const n=t.target.parentElement.firstElementChild;return n&&(!D(n)||!b(n))?v(n):n},Y=t=>{const n=t.target.parentElement.lastElementChild;return n&&(!D(n)||!b(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)&&b(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[f,...h]=u.split(".");if(f==="keydown"&&h.includes(d)){const g=c[u],k=h.filter(_=>B.includes(_)),M=B.some(_=>{const V=_.charAt(0).toUpperCase()+_.slice(1);return r.getModifierState(V)});if(k.length>0){if(M){for(const _ of B)if(h.includes(_)){const V=_.charAt(0).toUpperCase()+_.slice(1);r.getModifierState(V)&&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 f of u){const{focused:h}=we(e.ref(f)),g=e.watch(h,k=>{k?f.addEventListener("keydown",c):f.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 w of Array(43).keys())i.value.push(E+w*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},f=()=>{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)],_=m=>{n.value=o.value=new Date(i.value[m])},V=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":f,"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(V.value),1),e.createElementVNode("td",{id:"next-month-btn",onClick:f,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,w=>e.createElementVNode("td",{ref_for:!0,ref:"celldate",key:k(E,w),contenteditable:!1,spellcheck:!1,tabindex:0,onClick:e.withModifiers(ee=>_(k(E,w)),["prevent","stop"]),onKeydown:e.withKeys(ee=>_(k(E,w)),["enter"]),class:e.normalizeClass({todaysDate:h(M(E,w)),selectedDate:g(M(E,w))})},e.toDisplayString(new Date(M(E,w)).getDate()),43,Se)),64))])),64))])],512))}}),Le=C(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"]]),$e={class:"aform"},H=C(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",$e,[(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":f=>s.value[u].value=f,data:a.value[c.fieldname],readonly:r.readonly},i(c)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),[["__scopeId","data-v-88047a70"]]),J=C(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(H,{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"]]),Ne={class:"aform__form-element"},ve=["for"],He=["id","disabled","required"],Ie=["innerHTML"],Q=e.defineComponent({__name:"ANumericInput",props:e.mergeModels({label:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("label",{class:"aform__field-label",for:o.uuid},e.toDisplayString(o.label),9,ve),e.withDirectives(e.createElementVNode("input",{class:"aform__input-field","onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),type:"number",id:o.uuid,disabled:o.readonly,required:o.required},null,8,He),[[e.vModelText,n.value]]),e.withDirectives(e.createElementVNode("p",{class:"error",innerHTML:o.validation.errorMessage},null,8,Ie),[[e.vShow,o.validation.errorMessage]])]))}}),X={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function Pe(t){try{return Function(`"use strict";return (${t})`)()}catch{}}function Fe(t){var o;let n=t.value;if(n){const l=Pe(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 qe(t,n){n||(n="#");let o=t;const l=[n,"/","-","(",")"," "];for(const a of l)o=o.replaceAll(a,"");return o}function xe(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 Re(t,n){const o=Fe(n);if(!o)return;const l="#",a=t.value,i=qe(a,l);if(i){const s=xe(i,o,l);n.instance.maskFilled&&(n.instance.maskFilled=!s.includes(l)),t.value=s}else t.value=o}const Ue={class:"aform__form-element"},Oe=["for"],Ke=["id","disabled","maxlength","required"],We=["innerHTML"],Z=e.defineComponent({__name:"ATextInput",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{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",Ue,[e.createElementVNode("label",{class:"aform__field-label",for:l.uuid},e.toDisplayString(l.label),9,Oe),e.withDirectives(e.createElementVNode("input",{class:"aform__input-field","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,Ke),[[e.vModelText,o.value],[e.unref(Re),l.mask]]),e.withDirectives(e.createElementVNode("p",{class:"error",innerHTML:l.validation.errorMessage},null,8,We),[[e.vShow,l.validation.errorMessage]])]))}});function Ye(t){t.component("ACheckbox",I),t.component("ACombobox",P),t.component("ADate",F),t.component("ADropdown",q),t.component("ADatePicker",G),t.component("AFieldset",J),t.component("AForm",H),t.component("ANumericInput",Q),t.component("ATextInput",Z)}p.ACheckbox=I,p.AComboBox=P,p.ADate=F,p.ADatePicker=G,p.ADropdown=q,p.AFieldset=J,p.AForm=H,p.ANumericInput=Q,p.ATextInput=Z,p.install=Ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=aform.umd.cjs.map
|