@stonecrop/aform 0.4.30 → 0.4.32
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.d.ts +1087 -0
- package/dist/aform.js +481 -496
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +1 -1
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/tsdoc-metadata.json +1 -1
- package/package.json +17 -13
- package/src/index.ts +2 -2
package/dist/aform.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y["@stonecrop/aform"]={},y.Vue))})(this,function(y,e){"use strict";var G=document.createElement("style");G.textContent=`.aform_checkbox[data-v-9f382ad4]{cursor:pointer;width:auto;margin-top:0;display:block}.aform_checkbox[data-v-9f382ad4]:checked{accent-color:var(--sc-primary-color);border:1px solid black}.aform_checkbox-container[data-v-9f382ad4]{width:100%;display:inline-block;text-align:left}.aform_checkbox-container input[data-v-9f382ad4]{width:auto}.aform_checkbox-container:hover+.aform_field-label[data-v-9f382ad4]{color:var(--sc-input-active-label-color)}div[data-v-280b3d1a]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-280b3d1a]{width:calc(100% - 1ch);box-sizing:border-box;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-280b3d1a],label[data-v-280b3d1a]{color:var(--sc-input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;box-sizing:border-box}p[data-v-280b3d1a]{width:100%;color:red;font-size:85%;box-sizing:border-box}label[data-v-280b3d1a]{z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch;box-sizing:border-box}input[data-v-280b3d1a]:focus{border:1px solid var(--sc-input-active-border-color)}input:focus+label[data-v-280b3d1a]{color:var(--sc-input-active-label-color)}.autocomplete[data-v-16c329d1]{position:relative}.input-wrapper[data-v-16c329d1]{border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-16c329d1]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}input[data-v-16c329d1]:focus{border:1px solid var(--sc-input-active-border-color);border-radius:.25rem .25rem 0 0;border-bottom:none}label[data-v-16c329d1]{display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;z-index:2;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}.autocomplete-results[data-v-16c329d1]{position:absolute;width:calc(100% - 1ch + 1.5px);z-index:999;padding:0;margin:0;color:var(--sc-input-active-border-color);border:1px solid var(--sc-input-active-border-color);border-radius:0 0 .25rem .25rem;border-top:none;background-color:#fff}.autocomplete-result[data-v-16c329d1]{list-style:none;text-align:left;padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-16c329d1],.autocomplete-result[data-v-16c329d1]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}.adatepicker[data-v-f49cfd40]{font-size:var(--sc-table-font-size);display:inline-table;color:var(--sc-cell-text-color);outline:none;border-collapse:collapse}.adatepicker tr[data-v-f49cfd40]{height:1.15rem;text-align:center;vertical-align:middle}.adatepicker td[data-v-f49cfd40]{border:2px solid transparent;outline:2px solid transparent;min-width:3ch;max-width:3ch}.adatepicker td[data-v-f49cfd40]:focus,.adatepicker td[data-v-f49cfd40]:focus-within{outline:1px dashed black;box-shadow:none;min-height:1.15em;max-height:1.15em;overflow:hidden}.adatepicker .selectedDate[data-v-f49cfd40]{outline:1px solid black;background:var(--sc-gray-20);font-weight:bolder}.adatepicker .todaysDate[data-v-f49cfd40]{font-weight:bolder;text-decoration:underline;color:#000}.days-header>td[data-v-f49cfd40]{font-weight:700}.prev-date[data-v-f49cfd40]{color:var(--sc-gray-20)}.collapse-button[data-v-6f1c1b45]{width:2ch;min-width:calc(66px - 4ch);background-color:transparent;font-size:150%;text-align:center;border:none;margin-top:-.5rem}.rotated[data-v-6f1c1b45]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s;transform-origin:center center}.unrotated[data-v-6f1c1b45]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s}.aform_form-element{padding:0;margin:0;position:relative;box-sizing:border-box;flex-grow:1;min-width:20ch;margin-bottom:1rem}.aform_input-field{outline:1px solid var(--sc-input-border-color);outline-offset:-1px;font-size:1rem;padding:.5rem;margin:0;border-radius:0;box-sizing:border-box;width:100%;min-height:auto;position:relative;color:var(--sc-cell-text-color);background:var(--sc-input-field-background)}.aform_input-field:focus{outline:1px solid var(--sc-input-active-border-color)}.aform_input-field:focus+.aform_field-label{color:var(--sc-input-active-label-color)}.aform_field-label{color:var(--sc-input-label-color);display:inline-block;position:absolute;padding:0 .25rem;margin:0rem;z-index:2;font-size:.7rem;font-weight:300;letter-spacing:.05rem;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);width:auto;box-sizing:border-box;background:#fff;margin:0;grid-row:1;top:0;left:10px;border:none;line-height:0;transform:translateY(-50%)}.aform_input-field:disabled{background:var(--sc-input-field-disabled-background)}.aform_input-field:disabled+.aform_field-label{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_input-field:disabled~p.aform_error{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_field-label:after{margin:0;padding:0;box-sizing:border-box;content:"";line-height:normal}p.aform_error{display:block;display:inline-block;display:none;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);padding:0 .25rem;margin:0rem;width:auto;color:var(--sc-brand-danger);font-size:.7rem;position:absolute;right:0;top:0;line-height:0;background:#fff;padding:.25rem;transform:translate(-1rem,-50%);margin:0}.aform[data-v-68845234]{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem;border:1px solid var(--sc-form-border);border-left:4px solid var(--sc-form-border);margin-bottom:1rem;max-width:100%}@media screen and (max-width: 400px){.aform[data-v-68845234]{flex-direction:column}}fieldset[data-v-e7ea7e12]{max-width:100%;width:100%;margin-right:2ch;border:1px solid transparent;border-bottom:1px solid var(--sc-gray-50)}legend[data-v-e7ea7e12]{width:100%;height:1.15rem;border:1px solid transparent;padding-bottom:.5rem;font-size:110%;font-weight:600;-webkit-user-select:none;user-select:none}.collapse-button[data-v-e7ea7e12]{float:right}.aform_file-attach[data-v-0b3a11cc]{padding:1rem;display:flex;flex-wrap:wrap;gap:1rem;flex-direction:row;justify-content:center;align-items:center;border:1px dashed var(--sc-input-border-color);width:100%}@media screen and (max-width: 400px){.aform_file-attach>.aform_form-btn[data-v-0b3a11cc]{width:100%}}.aform_file-attach-feedback[data-v-0b3a11cc]{color:var(--sc-input-label-color);width:100%;padding:.5rem;text-align:center;align-self:center}.aform_file-attach-feedback>li[data-v-0b3a11cc]{list-style:none;font-style:italic}.aform_file-attach-feedback>p[data-v-0b3a11cc]{margin-top:0}.aform_form-btn[data-v-0b3a11cc]{padding:.5rem 2rem;width:auto;border:1px solid var(--sc-input-border-color);color:var(--sc-input-label-color);cursor:pointer;background-color:#fff}.aform_form-btn[data-v-0b3a11cc]:disabled{background-color:var(--sc-gray-5)}.login-container[data-v-6cbd3add]{width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:var(--sc-font-family)}.account-container[data-v-6cbd3add]{width:100%;margin-left:auto;margin-top:.5rem;margin-right:auto;display:flex;flex-direction:column;justify-content:center}.account-header[data-v-6cbd3add]{display:flex;flex-direction:column;text-align:center;margin-top:.5rem}#account-title[data-v-6cbd3add]{font-size:1.5rem;line-height:2rem;font-weight:600;letter-spacing:-.025em;margin:0}#account-subtitle[data-v-6cbd3add]{font-size:.875rem;line-height:1.25rem;margin:1rem}.login-form-container[data-v-6cbd3add]{display:grid;gap:.5rem}.login-form-element[data-v-6cbd3add]{display:grid;margin:.5rem 0;position:relative}.login-field[data-v-6cbd3add]{padding:.5rem .25rem .25rem .5rem;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.login-field[data-v-6cbd3add]:focus{border:1px solid black}.btn[data-v-6cbd3add]{background-color:var(--sc-btn-color);color:var(--sc-btn-label-color);border:1px solid var(--sc-btn-border);margin:.5rem 0;padding:.25rem;position:relative;cursor:pointer}.btn[data-v-6cbd3add]:hover{background-color:var(--sc-btn-hover)}.btn[data-v-6cbd3add]:disabled{background-color:var(--sc-input-field-disabled-background)}.disabled[data-v-6cbd3add]{opacity:.5}.loading-icon[data-v-6cbd3add]{animation:spin-6cbd3add 1s linear infinite forwards;display:inline-block;margin-right:.2rem;line-height:0;font-size:1rem;position:relative;top:.2rem}@keyframes spin-6cbd3add{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(G);const ye={class:"aform_form-element"},ke=["for"],ve={class:"aform_checkbox-container aform_input-field"},Ee=["id","readonly","required"],_e=["innerHTML"],xe=e.defineComponent({__name:"ACheckbox",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue");return(n,a)=>(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("label",{class:"aform_field-label",for:n.uuid},e.toDisplayString(n.label),9,ke),e.createElementVNode("span",ve,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"checkbox",id:n.uuid,class:"aform_checkbox",readonly:n.readonly,required:n.required},null,8,Ee),[[e.vModelCheckbox,o.value]])]),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:n.validation.errorMessage},null,8,_e),[[e.vShow,n.validation.errorMessage]])]))}}),_=(t,o)=>{const n=t.__vccOpts||t;for(const[a,l]of o)n[a]=l;return n},X=_(xe,[["__scopeId","data-v-9f382ad4"]]),J=e.defineComponent({__name:"AComboBox",props:["event","cellData","tableID"],setup(t){return(o,n)=>{const a=e.resolveComponent("ATableModal");return e.openBlock(),e.createBlock(a,{event:t.event,cellData:t.cellData,class:"amodal"},{default:e.withCtx(()=>n[0]||(n[0]=[e.createElementVNode("div",null,[e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"})],-1)])),_:1,__:[0]},8,["event","cellData"])}}}),Ve=["id","disabled","required"],De=["for"],Me=["innerHTML"],Q=_(e.defineComponent({__name:"ADate",props:e.mergeModels({schema:{},label:{default:"Date"},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue",{set:l=>new Date(l).toISOString().split("T")[0]}),n=e.useTemplateRef("date"),a=()=>{n.value&&"showPicker"in HTMLInputElement.prototype&&n.value.showPicker()};return(l,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=i=>o.value=i),ref:"date",type:"date",id:l.uuid,disabled:l.readonly,required:l.required,onClick:a},null,8,Ve),[[e.vModelText,o.value]]),e.createElementVNode("label",{for:l.uuid},e.toDisplayString(l.label),9,De),e.withDirectives(e.createElementVNode("p",{innerHTML:l.validation.errorMessage},null,8,Me),[[e.vShow,l.validation.errorMessage]])]))}}),[["__scopeId","data-v-280b3d1a"]]);function L(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Z(){const t=new Set,o=s=>{t.delete(s)};return{on:s=>{t.add(s);const i=()=>o(s);return L(i),{off:i}},off:o,trigger:(...s)=>Promise.all(Array.from(t).map(i=>i(...s))),clear:()=>{t.clear()}}}const F=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ce=Object.prototype.toString,Ae=t=>Ce.call(t)==="[object Object]",C=()=>{},Se=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),P=Te();function Te(){var t,o;return F&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window==null?void 0:window.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ie(...t){if(t.length!==1)return e.toRef(...t);const o=t[0];return typeof o=="function"?e.readonly(e.customRef(()=>({get:o,set:C}))):e.ref(o)}function z(t){return Array.isArray(t)?t:[t]}function Ne(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const Be=F?window.document:void 0;function $e(t){var o;const n=e.toValue(t);return(o=n==null?void 0:n.$el)!=null?o:n}const Le={multiple:!0,accept:"*",reset:!1,directory:!1};function Fe(t){if(!t)return null;if(t instanceof FileList)return t;const o=new DataTransfer;for(const n of t)o.items.add(n);return o.files}function Pe(t={}){const{document:o=Be}=t,n=e.ref(Fe(t.initialFiles)),{on:a,trigger:l}=Z(),{on:s,trigger:i}=Z();let r;o&&(r=$e(t.input)||o.createElement("input"),r.type="file",r.onchange=u=>{const g=u.target;n.value=g.files,l(n.value)},r.oncancel=()=>{i()});const c=()=>{n.value=null,r&&r.value&&(r.value="",l(null))},d=u=>{if(!r)return;const g={...Le,...t,...u};r.multiple=g.multiple,r.accept=g.accept,r.webkitdirectory=g.directory,Se(g,"capture")&&(r.capture=g.capture),g.reset&&c(),r.click()};return{files:e.readonly(n),open:d,reset:c,onCancel:s,onChange:a}}const ee=F?window:void 0;function T(t){var o;const n=e.toValue(t);return(o=n==null?void 0:n.$el)!=null?o:n}function N(...t){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,c,d,u)=>(r.addEventListener(c,d,u),()=>r.removeEventListener(c,d,u)),l=e.computed(()=>{const r=z(e.toValue(t[0])).filter(c=>c!=null);return r.every(c=>typeof c!="string")?r:void 0}),s=Ne(()=>{var r,c;return[(c=(r=l.value)==null?void 0:r.map(d=>T(d)))!=null?c:[ee].filter(d=>d!=null),z(e.toValue(l.value?t[1]:t[0])),z(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([r,c,d,u])=>{if(n(),!(r!=null&&r.length)||!(c!=null&&c.length)||!(d!=null&&d.length))return;const g=Ae(u)?{...u}:u;o.push(...r.flatMap(f=>c.flatMap(p=>d.map(h=>a(f,p,h,g)))))},{flush:"post"}),i=()=>{s(),n()};return L(n),i}let te=!1;function oe(t,o,n={}){const{window:a=ee,ignore:l=[],capture:s=!0,detectIframe:i=!1,controls:r=!1}=n;if(!a)return r?{stop:C,cancel:C,trigger:C}:C;if(P&&!te){te=!0;const m={passive:!0};Array.from(a.document.body.children).forEach(b=>b.addEventListener("click",C,m)),a.document.documentElement.addEventListener("click",C,m)}let c=!0;const d=m=>e.toValue(l).some(b=>{if(typeof b=="string")return Array.from(a.document.querySelectorAll(b)).some(v=>v===m.target||m.composedPath().includes(v));{const v=T(b);return v&&(m.target===v||m.composedPath().includes(v))}});function u(m){const b=e.toValue(m);return b&&b.$.subTree.shapeFlag===16}function g(m,b){const v=e.toValue(m),w=v.$.subTree&&v.$.subTree.children;return w==null||!Array.isArray(w)?!1:w.some(k=>k.el===b.target||b.composedPath().includes(k.el))}const f=m=>{const b=T(t);if(m.target!=null&&!(!(b instanceof Element)&&u(t)&&g(t,m))&&!(!b||b===m.target||m.composedPath().includes(b))){if("detail"in m&&m.detail===0&&(c=!d(m)),!c){c=!0;return}o(m)}};let p=!1;const h=[N(a,"click",m=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(m))},{passive:!0,capture:s}),N(a,"pointerdown",m=>{const b=T(t);c=!d(m)&&!!(b&&!m.composedPath().includes(b))},{passive:!0}),i&&N(a,"blur",m=>{setTimeout(()=>{var b;const v=T(t);((b=a.document.activeElement)==null?void 0:b.tagName)==="IFRAME"&&!(v!=null&&v.contains(a.document.activeElement))&&o(m)},0)},{passive:!0})].filter(Boolean),E=()=>h.forEach(m=>m());return r?{stop:E,cancel:()=>{c=!1},trigger:m=>{c=!0,f(m),c=!1}}:E}const O=new WeakMap,ze={mounted(t,o){const n=!o.modifiers.bubble;let a;if(typeof o.value=="function")a=oe(t,o.value,{capture:n});else{const[l,s]=o.value;a=oe(t,l,Object.assign({capture:n},s))}O.set(t,a)},unmounted(t){const o=O.get(t);o&&typeof o=="function"?o():o==null||o.stop(),O.delete(t)}};function R(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ne(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth<t.scrollWidth||o.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ne(n)}}function Oe(t){const o=t||window.event,n=o.target;return ne(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)}const H=new WeakMap;function Re(t,o=!1){const n=e.shallowRef(o);let a=null,l="";e.watch(Ie(t),r=>{const c=R(e.toValue(r));if(c){const d=c;if(H.get(d)||H.set(d,d.style.overflow),d.style.overflow!=="hidden"&&(l=d.style.overflow),d.style.overflow==="hidden")return n.value=!0;if(n.value)return d.style.overflow="hidden"}},{immediate:!0});const s=()=>{const r=R(e.toValue(t));!r||n.value||(P&&(a=N(r,"touchmove",c=>{Oe(c)},{passive:!1})),r.style.overflow="hidden",n.value=!0)},i=()=>{const r=R(e.toValue(t));!r||!n.value||(P&&(a==null||a()),r.style.overflow=l,H.delete(r),n.value=!1)};return L(i),e.computed({get(){return n.value},set(r){r?s():i()}})}function He(){let t=!1;const o=e.shallowRef(!1);return(n,a)=>{if(o.value=a.value,t)return;t=!0;const l=Re(n,a.value);e.watch(o,s=>l.value=s)}}He();const qe={class:"input-wrapper"},We={id:"autocomplete-results",class:"autocomplete-results"},Ue={key:0,class:"loading autocomplete-result"},je=["onClick"],ae=_(e.defineComponent({__name:"ADropdown",props:e.mergeModels({label:{},items:{},isAsync:{type:Boolean},filterFunction:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=e.reactive({activeItemIndex:null,open:!1,loading:!1,results:t.items}),a=()=>r(),l=async()=>{if(n.open=!0,t.filterFunction){t.isAsync&&(n.loading=!0);try{const f=await t.filterFunction(o.value||"");n.results=f}catch{n.results=[]}finally{t.isAsync&&(n.loading=!1)}}else c()},s=f=>{o.value=f,r(f)},i=()=>{var f;n.activeItemIndex=t.isAsync?null:o.value&&((f=t.items)==null?void 0:f.indexOf(o.value))||null,n.open=!0,n.results=t.isAsync?[]:t.items},r=f=>{var p;n.activeItemIndex=null,n.open=!1,(p=t.items)!=null&&p.includes(f||o.value||"")||(o.value="")},c=()=>{var f;o.value?n.results=(f=t.items)==null?void 0:f.filter(p=>p.toLowerCase().includes((o.value??"").toLowerCase())):n.results=t.items},d=()=>{var p;const f=((p=n.results)==null?void 0:p.length)||0;if(n.activeItemIndex!=null){const h=isNaN(n.activeItemIndex)?0:n.activeItemIndex;n.activeItemIndex=(h+1)%f}else n.activeItemIndex=0},u=()=>{var p;const f=((p=n.results)==null?void 0:p.length)||0;if(n.activeItemIndex!=null){const h=isNaN(n.activeItemIndex)?0:n.activeItemIndex;n.activeItemIndex=(h-1+f)%f}else n.activeItemIndex=f-1},g=()=>{if(n.results){const f=n.activeItemIndex||0,p=n.results[f];s(p)}n.activeItemIndex=0};return(f,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["autocomplete",{isOpen:n.open}])},[e.createElementVNode("div",qe,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=h=>o.value=h),type:"text",onInput:l,onFocus:i,onKeydown:[e.withKeys(d,["down"]),e.withKeys(u,["up"]),e.withKeys(g,["enter"]),e.withKeys(a,["esc"]),e.withKeys(a,["tab"])]},null,544),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("ul",We,[n.loading?(e.openBlock(),e.createElementBlock("li",Ue,"Loading results...")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.results,(h,E)=>(e.openBlock(),e.createElementBlock("li",{key:h,onClick:e.withModifiers(m=>s(h),["stop"]),class:e.normalizeClass(["autocomplete-result",{"is-active":E===n.activeItemIndex}])},e.toDisplayString(h),11,je))),128))],512),[[e.vShow,n.open]]),e.createElementVNode("label",null,e.toDisplayString(f.label),1)])],2)),[[e.unref(ze),a]])}}),[["__scopeId","data-v-16c329d1"]]);function q(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}const Ye=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ke=t=>t!=null,Ge=Object.prototype.toString,Xe=t=>Ge.call(t)==="[object Object]",Je=()=>{};function B(t){return Array.isArray(t)?t:[t]}function Qe(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const A=Ye?window:void 0;function S(t){var o;const n=e.toValue(t);return(o=n==null?void 0:n.$el)!=null?o:n}function I(...t){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,c,d,u)=>(r.addEventListener(c,d,u),()=>r.removeEventListener(c,d,u)),l=e.computed(()=>{const r=B(e.toValue(t[0])).filter(c=>c!=null);return r.every(c=>typeof c!="string")?r:void 0}),s=Qe(()=>{var r,c;return[(c=(r=l.value)==null?void 0:r.map(d=>S(d)))!=null?c:[A].filter(d=>d!=null),B(e.toValue(l.value?t[1]:t[0])),B(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([r,c,d,u])=>{if(n(),!(r!=null&&r.length)||!(c!=null&&c.length)||!(d!=null&&d.length))return;const g=Xe(u)?{...u}:u;o.push(...r.flatMap(f=>c.flatMap(p=>d.map(h=>a(f,p,h,g)))))},{flush:"post"}),i=()=>{s(),n()};return q(n),i}function Ze(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function et(t){const o=Ze();return e.computed(()=>(o.value,!!t()))}function tt(t,o,n={}){const{window:a=A,...l}=n;let s;const i=et(()=>a&&"MutationObserver"in a),r=()=>{s&&(s.disconnect(),s=void 0)},c=e.computed(()=>{const f=e.toValue(t),p=B(f).map(S).filter(Ke);return new Set(p)}),d=e.watch(()=>c.value,f=>{r(),i.value&&f.size&&(s=new MutationObserver(o),f.forEach(p=>s.observe(p,l)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),g=()=>{d(),r()};return q(g),{isSupported:i,stop:g,takeRecords:u}}function ot(t,o,n={}){const{window:a=A,document:l=a==null?void 0:a.document,flush:s="sync"}=n;if(!a||!l)return Je;let i;const r=u=>{i==null||i(),i=u},c=e.watchEffect(()=>{const u=S(t);if(u){const{stop:g}=tt(l,f=>{f.map(p=>[...p.removedNodes]).flat().some(p=>p===u||p.contains(u))&&o(f)},{window:a,childList:!0,subtree:!0});r(g)}},{flush:s}),d=()=>{c(),r()};return q(d),d}function nt(t={}){var o;const{window:n=A,deep:a=!0,triggerOnRemoval:l=!1}=t,s=(o=t.document)!=null?o:n==null?void 0:n.document,i=()=>{var d;let u=s==null?void 0:s.activeElement;if(a)for(;u!=null&&u.shadowRoot;)u=(d=u==null?void 0:u.shadowRoot)==null?void 0:d.activeElement;return u},r=e.shallowRef(),c=()=>{r.value=i()};if(n){const d={capture:!0,passive:!0};I(n,"blur",u=>{u.relatedTarget===null&&c()},d),I(n,"focus",c,d)}return l&&ot(r,c,{document:s}),c(),r}const at="focusin",rt="focusout",lt=":focus-within";function it(t,o={}){const{window:n=A}=o,a=e.computed(()=>S(t)),l=e.shallowRef(!1),s=e.computed(()=>l.value),i=nt(o);if(!n||!i.value)return{focused:s};const r={passive:!0};return I(a,at,()=>l.value=!0,r),I(a,rt,()=>{var c,d,u;return l.value=(u=(d=(c=a.value)==null?void 0:c.matches)==null?void 0:d.call(c,lt))!=null?u:!1},r),{focused:s}}function st(t,{window:o=A,scrollTarget:n}={}){const a=e.ref(!1),l=()=>{if(!o)return;const s=o.document,i=S(t);if(!i)a.value=!1;else{const r=i.getBoundingClientRect();a.value=r.top<=(o.innerHeight||s.documentElement.clientHeight)&&r.left<=(o.innerWidth||s.documentElement.clientWidth)&&r.bottom>=0&&r.right>=0}};return e.watch(()=>S(t),()=>l(),{immediate:!0,flush:"post"}),o&&I(n||o,"scroll",l,{capture:!1,passive:!0}),a}const x=t=>{let o=st(t).value;return o=o&&t.offsetHeight>0,o},V=t=>t.tabIndex>=0,re=t=>{const o=t.target;return W(o)},W=t=>{var o;let n;if(t instanceof HTMLTableCellElement){const a=(o=t.parentElement)==null?void 0:o.previousElementSibling;if(a){const l=Array.from(a.children)[t.cellIndex];l&&(n=l)}}else if(t instanceof HTMLTableRowElement){const a=t.previousElementSibling;a&&(n=a)}return n&&(!V(n)||!x(n))?W(n):n},ct=t=>{var o;const n=t.target;let a;if(n instanceof HTMLTableCellElement){const l=(o=n.parentElement)==null?void 0:o.parentElement;if(l){const s=l.firstElementChild,i=s==null?void 0:s.children[n.cellIndex];i&&(a=i)}}else if(n instanceof HTMLTableRowElement){const l=n.parentElement;if(l){const s=l.firstElementChild;s&&(a=s)}}return a&&(!V(a)||!x(a))?U(a):a},le=t=>{const o=t.target;return U(o)},U=t=>{var o;let n;if(t instanceof HTMLTableCellElement){const a=(o=t.parentElement)==null?void 0:o.nextElementSibling;if(a){const l=Array.from(a.children)[t.cellIndex];l&&(n=l)}}else if(t instanceof HTMLTableRowElement){const a=t.nextElementSibling;a&&(n=a)}return n&&(!V(n)||!x(n))?U(n):n},dt=t=>{var o;const n=t.target;let a;if(n instanceof HTMLTableCellElement){const l=(o=n.parentElement)==null?void 0:o.parentElement;if(l){const s=l.lastElementChild,i=s==null?void 0:s.children[n.cellIndex];i&&(a=i)}}else if(n instanceof HTMLTableRowElement){const l=n.parentElement;if(l){const s=l.lastElementChild;s&&(a=s)}}return a&&(!V(a)||!x(a))?W(a):a},ie=t=>{const o=t.target;return j(o)},j=t=>{var o;let n;if(t.previousElementSibling)n=t.previousElementSibling;else{const a=(o=t.parentElement)==null?void 0:o.previousElementSibling;n=a==null?void 0:a.lastElementChild}return n&&(!V(n)||!x(n))?j(n):n},se=t=>{const o=t.target;return Y(o)},Y=t=>{var o;let n;if(t.nextElementSibling)n=t.nextElementSibling;else{const a=(o=t.parentElement)==null?void 0:o.nextElementSibling;n=a==null?void 0:a.firstElementChild}return n&&(!V(n)||!x(n))?Y(n):n},ce=t=>{const o=t.target.parentElement,n=o==null?void 0:o.firstElementChild;return n&&(!V(n)||!x(n))?Y(n):n},de=t=>{const o=t.target.parentElement,n=o==null?void 0:o.lastElementChild;return n&&(!V(n)||!x(n))?j(n):n},$=["alt","control","shift","meta"],ut={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const o=re(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.down":t=>{const o=le(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.left":t=>{const o=ie(t);t.preventDefault(),t.stopPropagation(),o&&o.focus()},"keydown.right":t=>{const o=se(t);t.preventDefault(),t.stopPropagation(),o&&o.focus()},"keydown.control.up":t=>{const o=ct(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.down":t=>{const o=dt(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.left":t=>{const o=ce(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.right":t=>{const o=de(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.end":t=>{const o=de(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const o=le(t);o&&o.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const o=re(t);o&&o.focus()}},"keydown.home":t=>{const o=ce(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.tab":t=>{const o=se(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.shift.tab":t=>{const o=ie(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())}};function ft(t){const o=i=>{let r=null;return i.parent&&(typeof i.parent=="string"?r=document.querySelector(i.parent):i.parent instanceof HTMLElement?r=i.parent:r=i.parent.value),r},n=i=>{var r;const c=o(i);let d=[];if(typeof i.selectors=="string")d=c?Array.from(c.querySelectorAll(i.selectors)):Array.from(document.querySelectorAll(i.selectors));else if(Array.isArray(i.selectors))for(const u of i.selectors)u instanceof HTMLElement?d.push(u):d.push(u.$el);else if(i.selectors instanceof HTMLElement)d.push(i.selectors);else if((r=i.selectors)!=null&&r.value)if(Array.isArray(i.selectors.value))for(const u of i.selectors.value)u instanceof HTMLElement?d.push(u):d.push(u.$el);else d.push(i.selectors.value);return d},a=i=>{const r=o(i);let c=[];return i.selectors?c=n(i):r&&(c=Array.from(r.children).filter(d=>V(d)&&x(d))),c},l=i=>r=>{const c=ut[r.key]||r.key.toLowerCase();if($.includes(c))return;const d=i.handlers||ue;for(const u of Object.keys(d)){const[g,...f]=u.split(".");if(g==="keydown"&&f.includes(c)){const p=d[u],h=f.filter(m=>$.includes(m)),E=$.some(m=>{const b=m.charAt(0).toUpperCase()+m.slice(1);return r.getModifierState(b)});if(h.length>0){if(E){for(const m of $)if(f.includes(m)){const b=m.charAt(0).toUpperCase()+m.slice(1);r.getModifierState(b)&&p(r)}}}else E||p(r)}}},s=[];e.onMounted(()=>{for(const i of t){const r=o(i),c=a(i),d=l(i),u=r?[r]:c;for(const g of u){const{focused:f}=it(e.ref(g)),p=e.watch(f,h=>{h?g.addEventListener("keydown",d):g.removeEventListener("keydown",d)});s.push(p)}}}),e.onBeforeUnmount(()=>{for(const i of s)i()})}const mt={class:"adatepicker",tabindex:"0",ref:"datepicker"},pt={colspan:"5",tabindex:-1},gt=["onClick","onKeydown"],bt=6,fe=7,me=_(e.defineComponent({__name:"ADatePicker",props:{modelValue:{default:new Date},modelModifiers:{}},emits:["update:modelValue"],setup(t,{expose:o}){const n=e.useModel(t,"modelValue"),a=e.ref(new Date(n.value)),l=e.ref(a.value.getMonth()),s=e.ref(a.value.getFullYear()),i=e.ref([]),r=e.useTemplateRef("datepicker");e.onMounted(async()=>{c(),await e.nextTick();const w=document.getElementsByClassName("selectedDate");if(w.length>0)w[0].focus();else{const k=document.getElementsByClassName("todaysDate");k.length>0&&k[0].focus()}});const c=()=>{i.value=[];const w=new Date(s.value,l.value,1),k=w.getDay(),D=w.setDate(w.getDate()-k);for(const M of Array(43).keys())i.value.push(D+M*864e5)};e.watch([l,s],c);const d=()=>s.value-=1,u=()=>s.value+=1,g=()=>{l.value==0?(l.value=11,d()):l.value-=1},f=()=>{l.value==11?(l.value=0,u()):l.value+=1},p=w=>{const k=new Date;if(l.value===k.getMonth())return k.toDateString()===new Date(w).toDateString()},h=w=>new Date(w).toDateString()===new Date(a.value).toDateString(),E=(w,k)=>(w-1)*fe+k,m=(w,k)=>i.value[E(w,k)],b=w=>{n.value=a.value=new Date(i.value[w])},v=e.computed(()=>new Date(s.value,l.value,1).toLocaleDateString(void 0,{year:"numeric",month:"long"}));return ft([{parent:r,selectors:"td",handlers:{...ue,"keydown.pageup":g,"keydown.shift.pageup":d,"keydown.pagedown":f,"keydown.shift.pagedown":u,"keydown.enter":()=>{}}}]),o({currentMonth:l,currentYear:s,selectedDate:a}),(w,k)=>(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("table",null,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",{id:"previous-month-btn",onClick:g,tabindex:-1},"<"),e.createElementVNode("th",pt,e.toDisplayString(v.value),1),e.createElementVNode("td",{id:"next-month-btn",onClick:f,tabindex:-1},">")]),k[0]||(k[0]=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)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(bt,D=>e.createElementVNode("tr",{key:D},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(fe,M=>e.createElementVNode("td",{ref_for:!0,ref:"celldate",key:E(D,M),contenteditable:!1,spellcheck:!1,tabindex:0,onClick:e.withModifiers(Gt=>b(E(D,M)),["prevent","stop"]),onKeydown:e.withKeys(Gt=>b(E(D,M)),["enter"]),class:e.normalizeClass({todaysDate:p(m(D,M)),selectedDate:h(m(D,M))})},e.toDisplayString(new Date(m(D,M)).getDate()),43,gt)),64))])),64))])])],512))}}),[["__scopeId","data-v-f49cfd40"]]),ht=_(e.defineComponent({__name:"CollapseButton",props:{collapsed:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["collapse-button",o.collapsed?"rotated":"unrotated"])},"×",2))}}),[["__scopeId","data-v-6f1c1b45"]]),wt={class:"aform"},K=_(e.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:o}){const n=o,a=e.ref(t.data||{}),l=i=>{let r={};for(const[c,d]of Object.entries(i))["component","fieldtype"].includes(c)||(r[c]=d),c==="rows"&&d&&d.length===0&&(r.rows=a.value[i.fieldname]);return r},s=e.computed({get:()=>t.modelValue.map((i,r)=>e.computed({get(){return i.value},set:c=>{t.modelValue[r].value=c,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(i,r)=>(e.openBlock(),e.createElementBlock("form",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.modelValue,(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.component),e.mergeProps({key:d,schema:c,modelValue:s.value[d].value,"onUpdate:modelValue":u=>s.value[d].value=u,data:a.value[c.fieldname],readonly:i.readonly},{ref_for:!0},l(c)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),[["__scopeId","data-v-68845234"]]),pe=_(e.defineComponent({__name:"AFieldset",props:{schema:{},label:{},collapsible:{type:Boolean},data:{}},setup(t,{expose:o}){const n=e.ref(!1),a=e.ref(t.data||[]),l=e.ref(t.schema),s=i=>{i.preventDefault(),t.collapsible&&(n.value=!n.value)};return o({collapsed:n}),(i,r)=>(e.openBlock(),e.createElementBlock("fieldset",null,[e.createElementVNode("legend",{onClick:s,onSubmit:s},[e.createTextVNode(e.toDisplayString(i.label)+" ",1),i.collapsible?(e.openBlock(),e.createBlock(ht,{key:0,collapsed:n.value},null,8,["collapsed"])):e.createCommentVNode("",!0)],32),e.renderSlot(i.$slots,"default",{collapsed:n.value},()=>[e.withDirectives(e.createVNode(K,{modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=c=>l.value=c),data:a.value},null,8,["modelValue","data"]),[[e.vShow,!n.value]])],!0)]))}}),[["__scopeId","data-v-e7ea7e12"]]),yt={class:"aform_form-element aform_file-attach aform__grid--full"},kt={key:0,class:"aform_file-attach-feedback"},vt=["disabled"],ge=_(e.defineComponent({__name:"AFileAttach",props:{label:{}},setup(t){const{files:o,open:n,reset:a,onChange:l}=Pe(),s=e.computed(()=>`${o.value.length} ${o.value.length===1?"file":"files"}`);return l(i=>i),(i,r)=>(e.openBlock(),e.createElementBlock("div",yt,[e.unref(o)?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("p",null,[r[2]||(r[2]=e.createTextVNode(" You have selected: ")),e.createElementVNode("b",null,e.toDisplayString(s.value),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),c=>(e.openBlock(),e.createElementBlock("li",{key:c.name},e.toDisplayString(c.name),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=c=>e.unref(n)()),class:"aform_form-btn"},e.toDisplayString(i.label),1),e.createElementVNode("button",{type:"button",disabled:!e.unref(o),onClick:r[1]||(r[1]=c=>e.unref(a)()),class:"aform_form-btn"},"Reset",8,vt)]))}}),[["__scopeId","data-v-0b3a11cc"]]),Et={class:"aform_form-element"},_t=["id","disabled","required"],xt=["for"],Vt=["innerHTML"],be=e.defineComponent({__name:"ANumericInput",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue");return(n,a)=>(e.openBlock(),e.createElementBlock("div",Et,[e.withDirectives(e.createElementVNode("input",{class:"aform_input-field","onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"number",id:n.uuid,disabled:n.readonly,required:n.required},null,8,_t),[[e.vModelText,o.value]]),e.createElementVNode("label",{class:"aform_field-label",for:n.uuid},e.toDisplayString(n.label),9,xt),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:n.validation.errorMessage},null,8,Vt),[[e.vShow,n.validation.errorMessage]])]))}}),he={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function Dt(t){try{return Function(`"use strict";return (${t})`)()}catch{}}function Mt(t){var n,a,l;let o=t.value;if(o){const s=Dt(o);if(s){const i=(n=t.instance)==null?void 0:n.locale;o=s(i)}}else{const s=(a=t.instance)==null?void 0:a.schema,i=(l=s==null?void 0:s.fieldtype)==null?void 0:l.toLowerCase();i&&he[i]&&(o=he[i])}return o}function Ct(t,o){let n=t;const a=[o,"/","-","(",")"," "];for(const l of a)n=n.replaceAll(l,"");return n}function At(t,o,n){let a=o;for(const l of t){const s=a.indexOf(n);if(s!==-1){const i=a.substring(0,s),r=a.substring(s+1);a=i+l+r}}return a.slice(0,o.length)}function St(t,o){var i;const n=Mt(o);if(!n)return;const a="#",l=t.value,s=Ct(l,a);if(s){const r=At(s,n,a);(i=o.instance)!=null&&i.maskFilled&&(o.instance.maskFilled=!r.includes(a)),t.value=r}else t.value=n}const Tt={class:"aform_form-element"},It=["id","disabled","maxlength","required"],Nt=["for"],Bt=["innerHTML"],we=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 o=e.ref(!0),n=e.useModel(t,"modelValue");return(a,l)=>(e.openBlock(),e.createElementBlock("div",Tt,[e.withDirectives(e.createElementVNode("input",{class:"aform_input-field","onUpdate:modelValue":l[0]||(l[0]=s=>n.value=s),id:a.uuid,disabled:a.readonly,maxlength:a.mask?o.value&&a.mask.length:void 0,required:a.required},null,8,It),[[e.vModelText,n.value],[e.unref(St),a.mask]]),e.createElementVNode("label",{class:"aform_field-label",for:a.uuid},e.toDisplayString(a.label),9,Nt),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:a.validation.errorMessage},null,8,Bt),[[e.vShow,a.validation.errorMessage]])]))}}),$t={class:"login-container"},Lt={class:"account-container"},Ft={class:"account-header"},Pt={id:"account-title"},zt={id:"account-subtitle"},Ot={class:"login-form-container"},Rt={class:"login-form-email aform_form-element"},Ht=["disabled"],qt={class:"login-form-password aform_form-element"},Wt=["disabled"],Ut=["disabled"],jt={key:0,class:"material-symbols-outlined loading-icon"},Yt=_(e.defineComponent({__name:"Login",props:{headerTitle:{default:"Login"},headerSubtitle:{default:"Enter your email and password to login"}},emits:["loginFailed","loginSuccess"],setup(t,{emit:o}){const n=o,a=e.ref(""),l=e.ref(""),s=e.ref(!1),i=e.ref(!1);function r(c){if(c.preventDefault(),s.value=!0,i.value){s.value=!1,n("loginFailed");return}s.value=!1,n("loginSuccess")}return(c,d)=>(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("div",null,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ft,[e.createElementVNode("h1",Pt,e.toDisplayString(c.headerTitle),1),e.createElementVNode("p",zt,e.toDisplayString(c.headerSubtitle),1)]),e.createElementVNode("form",{onSubmit:r},[e.createElementVNode("div",Ot,[e.createElementVNode("div",Rt,[d[2]||(d[2]=e.createElementVNode("label",{id:"login-email",for:"email",class:"aform_field-label"},"Email",-1)),e.withDirectives(e.createElementVNode("input",{id:"email",class:"aform_input-field",name:"email",placeholder:"name@example.com",type:"email","onUpdate:modelValue":d[0]||(d[0]=u=>a.value=u),"auto-capitalize":"none","auto-complete":"email","auto-correct":"off",disabled:s.value},null,8,Ht),[[e.vModelText,a.value]])]),e.createElementVNode("div",qt,[d[3]||(d[3]=e.createElementVNode("label",{id:"login-password",for:"password",class:"aform_field-label"},"Password",-1)),e.withDirectives(e.createElementVNode("input",{id:"password",class:"aform_input-field",name:"password",type:"password","onUpdate:modelValue":d[1]||(d[1]=u=>l.value=u),disabled:s.value},null,8,Wt),[[e.vModelText,l.value]])]),e.createElementVNode("button",{class:"btn",onClick:r,disabled:s.value||!a.value||!l.value},[s.value?(e.openBlock(),e.createElementBlock("span",jt,"progress_activity")):e.createCommentVNode("",!0),d[4]||(d[4]=e.createElementVNode("span",{id:"login-form-button"},"Login",-1))],8,Ut)])],32),d[5]||(d[5]=e.createElementVNode("button",{class:"btn"},[e.createElementVNode("span",{id:"forgot-password-button"},"Forgot password?")],-1))])])]))}}),[["__scopeId","data-v-6cbd3add"]]);function Kt(t){t.component("ACheckbox",X),t.component("ACombobox",J),t.component("ADate",Q),t.component("ADropdown",ae),t.component("ADatePicker",me),t.component("AFieldset",pe),t.component("AFileAttach",ge),t.component("AForm",K),t.component("ANumericInput",be),t.component("ATextInput",we)}y.ACheckbox=X,y.AComboBox=J,y.ADate=Q,y.ADatePicker=me,y.ADropdown=ae,y.AFieldset=pe,y.AFileAttach=ge,y.AForm=K,y.ANumericInput=be,y.ATextInput=we,y.Login=Yt,y.install=Kt,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(G);const ye={class:"aform_form-element"},ke=["for"],ve={class:"aform_checkbox-container aform_input-field"},Ee=["id","readonly","required"],_e=["innerHTML"],xe=e.defineComponent({__name:"ACheckbox",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue");return(n,a)=>(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("label",{class:"aform_field-label",for:n.uuid},e.toDisplayString(n.label),9,ke),e.createElementVNode("span",ve,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"checkbox",id:n.uuid,class:"aform_checkbox",readonly:n.readonly,required:n.required},null,8,Ee),[[e.vModelCheckbox,o.value]])]),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:n.validation.errorMessage},null,8,_e),[[e.vShow,n.validation.errorMessage]])]))}}),_=(t,o)=>{const n=t.__vccOpts||t;for(const[a,l]of o)n[a]=l;return n},X=_(xe,[["__scopeId","data-v-9f382ad4"]]),J=e.defineComponent({__name:"AComboBox",props:["event","cellData","tableID"],setup(t){return(o,n)=>{const a=e.resolveComponent("ATableModal");return e.openBlock(),e.createBlock(a,{event:t.event,cellData:t.cellData,class:"amodal"},{default:e.withCtx(()=>n[0]||(n[0]=[e.createElementVNode("div",null,[e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"}),e.createElementVNode("input",{type:"text"})],-1)])),_:1,__:[0]},8,["event","cellData"])}}}),Ve=["id","disabled","required"],De=["for"],Me=["innerHTML"],Q=_(e.defineComponent({__name:"ADate",props:e.mergeModels({schema:{},label:{default:"Date"},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue",{set:l=>new Date(l).toISOString().split("T")[0]}),n=e.useTemplateRef("date"),a=()=>{n.value&&"showPicker"in HTMLInputElement.prototype&&n.value.showPicker()};return(l,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=s=>o.value=s),ref:"date",type:"date",id:l.uuid,disabled:l.readonly,required:l.required,onClick:a},null,8,Ve),[[e.vModelText,o.value]]),e.createElementVNode("label",{for:l.uuid},e.toDisplayString(l.label),9,De),e.withDirectives(e.createElementVNode("p",{innerHTML:l.validation.errorMessage},null,8,Me),[[e.vShow,l.validation.errorMessage]])]))}}),[["__scopeId","data-v-280b3d1a"]]);function L(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Z(){const t=new Set,o=d=>{t.delete(d)};return{on:d=>{t.add(d);const s=()=>o(d);return L(s),{off:s}},off:o,trigger:(...d)=>Promise.all(Array.from(t).map(s=>s(...d))),clear:()=>{t.clear()}}}const F=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ce=Object.prototype.toString,Ae=t=>Ce.call(t)==="[object Object]",C=()=>{},Se=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),P=Te();function Te(){var t,o;return F&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window?.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ie(...t){if(t.length!==1)return e.toRef(...t);const o=t[0];return typeof o=="function"?e.readonly(e.customRef(()=>({get:o,set:C}))):e.ref(o)}function O(t){return Array.isArray(t)?t:[t]}function Ne(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const Be=F?window.document:void 0;function $e(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}const Le={multiple:!0,accept:"*",reset:!1,directory:!1};function Fe(t){if(!t)return null;if(t instanceof FileList)return t;const o=new DataTransfer;for(const n of t)o.items.add(n);return o.files}function Pe(t={}){const{document:o=Be}=t,n=e.ref(Fe(t.initialFiles)),{on:a,trigger:l}=Z(),{on:d,trigger:s}=Z(),r=e.computed(()=>{var g;const u=(g=$e(t.input))!=null?g:o?o.createElement("input"):void 0;return u&&(u.type="file",u.onchange=p=>{const w=p.target;n.value=w.files,l(n.value)},u.oncancel=()=>{s()}),u}),i=()=>{n.value=null,r.value&&r.value.value&&(r.value.value="",l(null))},c=g=>{const u=r.value;u&&(u.multiple=e.toValue(g.multiple),u.accept=e.toValue(g.accept),u.webkitdirectory=e.toValue(g.directory),Se(g,"capture")&&(u.capture=e.toValue(g.capture)))},f=g=>{const u=r.value;if(!u)return;const p={...Le,...t,...g};c(p),e.toValue(p.reset)&&i(),u.click()};return e.watchEffect(()=>{c(t)}),{files:e.readonly(n),open:f,reset:i,onCancel:d,onChange:a}}const ee=F?window:void 0;function T(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}function N(...t){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,i,c,f)=>(r.addEventListener(i,c,f),()=>r.removeEventListener(i,c,f)),l=e.computed(()=>{const r=O(e.toValue(t[0])).filter(i=>i!=null);return r.every(i=>typeof i!="string")?r:void 0}),d=Ne(()=>{var r,i;return[(i=(r=l.value)==null?void 0:r.map(c=>T(c)))!=null?i:[ee].filter(c=>c!=null),O(e.toValue(l.value?t[1]:t[0])),O(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([r,i,c,f])=>{if(n(),!r?.length||!i?.length||!c?.length)return;const g=Ae(f)?{...f}:f;o.push(...r.flatMap(u=>i.flatMap(p=>c.map(w=>a(u,p,w,g)))))},{flush:"post"}),s=()=>{d(),n()};return L(n),s}let te=!1;function oe(t,o,n={}){const{window:a=ee,ignore:l=[],capture:d=!0,detectIframe:s=!1,controls:r=!1}=n;if(!a)return r?{stop:C,cancel:C,trigger:C}:C;if(P&&!te){te=!0;const m={passive:!0};Array.from(a.document.body.children).forEach(b=>b.addEventListener("click",C,m)),a.document.documentElement.addEventListener("click",C,m)}let i=!0;const c=m=>e.toValue(l).some(b=>{if(typeof b=="string")return Array.from(a.document.querySelectorAll(b)).some(v=>v===m.target||m.composedPath().includes(v));{const v=T(b);return v&&(m.target===v||m.composedPath().includes(v))}});function f(m){const b=e.toValue(m);return b&&b.$.subTree.shapeFlag===16}function g(m,b){const v=e.toValue(m),h=v.$.subTree&&v.$.subTree.children;return h==null||!Array.isArray(h)?!1:h.some(k=>k.el===b.target||b.composedPath().includes(k.el))}const u=m=>{const b=T(t);if(m.target!=null&&!(!(b instanceof Element)&&f(t)&&g(t,m))&&!(!b||b===m.target||m.composedPath().includes(b))){if("detail"in m&&m.detail===0&&(i=!c(m)),!i){i=!0;return}o(m)}};let p=!1;const w=[N(a,"click",m=>{p||(p=!0,setTimeout(()=>{p=!1},0),u(m))},{passive:!0,capture:d}),N(a,"pointerdown",m=>{const b=T(t);i=!c(m)&&!!(b&&!m.composedPath().includes(b))},{passive:!0}),s&&N(a,"blur",m=>{setTimeout(()=>{var b;const v=T(t);((b=a.document.activeElement)==null?void 0:b.tagName)==="IFRAME"&&!v?.contains(a.document.activeElement)&&o(m)},0)},{passive:!0})].filter(Boolean),E=()=>w.forEach(m=>m());return r?{stop:E,cancel:()=>{i=!1},trigger:m=>{i=!0,u(m),i=!1}}:E}const z=new WeakMap,Oe={mounted(t,o){const n=!o.modifiers.bubble;let a;if(typeof o.value=="function")a=oe(t,o.value,{capture:n});else{const[l,d]=o.value;a=oe(t,l,Object.assign({capture:n},d))}z.set(t,a)},unmounted(t){const o=z.get(t);o&&typeof o=="function"?o():o?.stop(),z.delete(t)}};function R(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ne(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth<t.scrollWidth||o.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ne(n)}}function ze(t){const o=t||window.event,n=o.target;return ne(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)}const H=new WeakMap;function Re(t,o=!1){const n=e.shallowRef(o);let a=null,l="";e.watch(Ie(t),r=>{const i=R(e.toValue(r));if(i){const c=i;if(H.get(c)||H.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(l=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const d=()=>{const r=R(e.toValue(t));!r||n.value||(P&&(a=N(r,"touchmove",i=>{ze(i)},{passive:!1})),r.style.overflow="hidden",n.value=!0)},s=()=>{const r=R(e.toValue(t));!r||!n.value||(P&&a?.(),r.style.overflow=l,H.delete(r),n.value=!1)};return L(s),e.computed({get(){return n.value},set(r){r?d():s()}})}function He(){let t=!1;const o=e.shallowRef(!1);return(n,a)=>{if(o.value=a.value,t)return;t=!0;const l=Re(n,a.value);e.watch(o,d=>l.value=d)}}He();const qe={class:"input-wrapper"},We={id:"autocomplete-results",class:"autocomplete-results"},Ue={key:0,class:"loading autocomplete-result"},je=["onClick"],ae=_(e.defineComponent({__name:"ADropdown",props:e.mergeModels({label:{},items:{},isAsync:{type:Boolean},filterFunction:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=e.reactive({activeItemIndex:null,open:!1,loading:!1,results:t.items}),a=()=>r(),l=async()=>{if(n.open=!0,t.filterFunction){t.isAsync&&(n.loading=!0);try{const u=await t.filterFunction(o.value||"");n.results=u}catch{n.results=[]}finally{t.isAsync&&(n.loading=!1)}}else i()},d=u=>{o.value=u,r(u)},s=()=>{n.activeItemIndex=t.isAsync?null:o.value&&t.items?.indexOf(o.value)||null,n.open=!0,n.results=t.isAsync?[]:t.items},r=u=>{n.activeItemIndex=null,n.open=!1,t.items?.includes(u||o.value||"")||(o.value="")},i=()=>{o.value?n.results=t.items?.filter(u=>u.toLowerCase().includes((o.value??"").toLowerCase())):n.results=t.items},c=()=>{const u=n.results?.length||0;if(n.activeItemIndex!=null){const p=isNaN(n.activeItemIndex)?0:n.activeItemIndex;n.activeItemIndex=(p+1)%u}else n.activeItemIndex=0},f=()=>{const u=n.results?.length||0;if(n.activeItemIndex!=null){const p=isNaN(n.activeItemIndex)?0:n.activeItemIndex;n.activeItemIndex=(p-1+u)%u}else n.activeItemIndex=u-1},g=()=>{if(n.results){const u=n.activeItemIndex||0,p=n.results[u];d(p)}n.activeItemIndex=0};return(u,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["autocomplete",{isOpen:n.open}])},[e.createElementVNode("div",qe,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=w=>o.value=w),type:"text",onInput:l,onFocus:s,onKeydown:[e.withKeys(c,["down"]),e.withKeys(f,["up"]),e.withKeys(g,["enter"]),e.withKeys(a,["esc"]),e.withKeys(a,["tab"])]},null,544),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("ul",We,[n.loading?(e.openBlock(),e.createElementBlock("li",Ue,"Loading results...")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.results,(w,E)=>(e.openBlock(),e.createElementBlock("li",{key:w,onClick:e.withModifiers(m=>d(w),["stop"]),class:e.normalizeClass(["autocomplete-result",{"is-active":E===n.activeItemIndex}])},e.toDisplayString(w),11,je))),128))],512),[[e.vShow,n.open]]),e.createElementVNode("label",null,e.toDisplayString(u.label),1)])],2)),[[e.unref(Oe),a]])}}),[["__scopeId","data-v-16c329d1"]]);function q(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}const Ye=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ke=t=>t!=null,Ge=Object.prototype.toString,Xe=t=>Ge.call(t)==="[object Object]",Je=()=>{};function B(t){return Array.isArray(t)?t:[t]}function Qe(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const A=Ye?window:void 0;function S(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}function I(...t){const o=[],n=()=>{o.forEach(r=>r()),o.length=0},a=(r,i,c,f)=>(r.addEventListener(i,c,f),()=>r.removeEventListener(i,c,f)),l=e.computed(()=>{const r=B(e.toValue(t[0])).filter(i=>i!=null);return r.every(i=>typeof i!="string")?r:void 0}),d=Qe(()=>{var r,i;return[(i=(r=l.value)==null?void 0:r.map(c=>S(c)))!=null?i:[A].filter(c=>c!=null),B(e.toValue(l.value?t[1]:t[0])),B(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([r,i,c,f])=>{if(n(),!r?.length||!i?.length||!c?.length)return;const g=Xe(f)?{...f}:f;o.push(...r.flatMap(u=>i.flatMap(p=>c.map(w=>a(u,p,w,g)))))},{flush:"post"}),s=()=>{d(),n()};return q(n),s}function Ze(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function et(t){const o=Ze();return e.computed(()=>(o.value,!!t()))}function tt(t,o,n={}){const{window:a=A,...l}=n;let d;const s=et(()=>a&&"MutationObserver"in a),r=()=>{d&&(d.disconnect(),d=void 0)},i=e.computed(()=>{const u=e.toValue(t),p=B(u).map(S).filter(Ke);return new Set(p)}),c=e.watch(()=>i.value,u=>{r(),s.value&&u.size&&(d=new MutationObserver(o),u.forEach(p=>d.observe(p,l)))},{immediate:!0,flush:"post"}),f=()=>d?.takeRecords(),g=()=>{c(),r()};return q(g),{isSupported:s,stop:g,takeRecords:f}}function ot(t,o,n={}){const{window:a=A,document:l=a?.document,flush:d="sync"}=n;if(!a||!l)return Je;let s;const r=f=>{s?.(),s=f},i=e.watchEffect(()=>{const f=S(t);if(f){const{stop:g}=tt(l,u=>{u.map(p=>[...p.removedNodes]).flat().some(p=>p===f||p.contains(f))&&o(u)},{window:a,childList:!0,subtree:!0});r(g)}},{flush:d}),c=()=>{i(),r()};return q(c),c}function nt(t={}){var o;const{window:n=A,deep:a=!0,triggerOnRemoval:l=!1}=t,d=(o=t.document)!=null?o:n?.document,s=()=>{var c;let f=d?.activeElement;if(a)for(;f?.shadowRoot;)f=(c=f?.shadowRoot)==null?void 0:c.activeElement;return f},r=e.shallowRef(),i=()=>{r.value=s()};if(n){const c={capture:!0,passive:!0};I(n,"blur",f=>{f.relatedTarget===null&&i()},c),I(n,"focus",i,c)}return l&&ot(r,i,{document:d}),i(),r}const at="focusin",rt="focusout",lt=":focus-within";function it(t,o={}){const{window:n=A}=o,a=e.computed(()=>S(t)),l=e.shallowRef(!1),d=e.computed(()=>l.value);if(!n||!nt(o).value)return{focused:d};const s={passive:!0};return I(a,at,()=>l.value=!0,s),I(a,rt,()=>{var r,i,c;return l.value=(c=(i=(r=a.value)==null?void 0:r.matches)==null?void 0:i.call(r,lt))!=null?c:!1},s),{focused:d}}function st(t,{window:o=A,scrollTarget:n}={}){const a=e.ref(!1),l=()=>{if(!o)return;const d=o.document,s=S(t);if(!s)a.value=!1;else{const r=s.getBoundingClientRect();a.value=r.top<=(o.innerHeight||d.documentElement.clientHeight)&&r.left<=(o.innerWidth||d.documentElement.clientWidth)&&r.bottom>=0&&r.right>=0}};return e.watch(()=>S(t),()=>l(),{immediate:!0,flush:"post"}),o&&I(n||o,"scroll",l,{capture:!1,passive:!0}),a}const x=t=>{let o=st(t).value;return o=o&&t.offsetHeight>0,o},V=t=>t.tabIndex>=0,re=t=>{const o=t.target;return W(o)},W=t=>{let o;if(t instanceof HTMLTableCellElement){const n=t.parentElement?.previousElementSibling;if(n){const a=Array.from(n.children)[t.cellIndex];a&&(o=a)}}else if(t instanceof HTMLTableRowElement){const n=t.previousElementSibling;n&&(o=n)}return o&&(!V(o)||!x(o))?W(o):o},ct=t=>{const o=t.target;let n;if(o instanceof HTMLTableCellElement){const a=o.parentElement?.parentElement;if(a){const l=a.firstElementChild?.children[o.cellIndex];l&&(n=l)}}else if(o instanceof HTMLTableRowElement){const a=o.parentElement;if(a){const l=a.firstElementChild;l&&(n=l)}}return n&&(!V(n)||!x(n))?U(n):n},le=t=>{const o=t.target;return U(o)},U=t=>{let o;if(t instanceof HTMLTableCellElement){const n=t.parentElement?.nextElementSibling;if(n){const a=Array.from(n.children)[t.cellIndex];a&&(o=a)}}else if(t instanceof HTMLTableRowElement){const n=t.nextElementSibling;n&&(o=n)}return o&&(!V(o)||!x(o))?U(o):o},dt=t=>{const o=t.target;let n;if(o instanceof HTMLTableCellElement){const a=o.parentElement?.parentElement;if(a){const l=a.lastElementChild?.children[o.cellIndex];l&&(n=l)}}else if(o instanceof HTMLTableRowElement){const a=o.parentElement;if(a){const l=a.lastElementChild;l&&(n=l)}}return n&&(!V(n)||!x(n))?W(n):n},ie=t=>{const o=t.target;return j(o)},j=t=>{let o;return t.previousElementSibling?o=t.previousElementSibling:o=t.parentElement?.previousElementSibling?.lastElementChild,o&&(!V(o)||!x(o))?j(o):o},se=t=>{const o=t.target;return Y(o)},Y=t=>{let o;return t.nextElementSibling?o=t.nextElementSibling:o=t.parentElement?.nextElementSibling?.firstElementChild,o&&(!V(o)||!x(o))?Y(o):o},ce=t=>{const o=t.target.parentElement?.firstElementChild;return o&&(!V(o)||!x(o))?Y(o):o},de=t=>{const o=t.target.parentElement?.lastElementChild;return o&&(!V(o)||!x(o))?j(o):o},$=["alt","control","shift","meta"],ut={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const o=re(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.down":t=>{const o=le(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.left":t=>{const o=ie(t);t.preventDefault(),t.stopPropagation(),o&&o.focus()},"keydown.right":t=>{const o=se(t);t.preventDefault(),t.stopPropagation(),o&&o.focus()},"keydown.control.up":t=>{const o=ct(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.down":t=>{const o=dt(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.left":t=>{const o=ce(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.control.right":t=>{const o=de(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.end":t=>{const o=de(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const o=le(t);o&&o.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const o=re(t);o&&o.focus()}},"keydown.home":t=>{const o=ce(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.tab":t=>{const o=se(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())},"keydown.shift.tab":t=>{const o=ie(t);o&&(t.preventDefault(),t.stopPropagation(),o.focus())}};function ft(t){const o=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},n=s=>{const r=o(s);let i=[];if(typeof s.selectors=="string")i=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?i.push(c):i.push(c.$el);else if(s.selectors instanceof HTMLElement)i.push(s.selectors);else if(s.selectors?.value)if(Array.isArray(s.selectors.value))for(const c of s.selectors.value)c instanceof HTMLElement?i.push(c):i.push(c.$el);else i.push(s.selectors.value);return i},a=s=>{const r=o(s);let i=[];return s.selectors?i=n(s):r&&(i=Array.from(r.children).filter(c=>V(c)&&x(c))),i},l=s=>r=>{const i=ut[r.key]||r.key.toLowerCase();if($.includes(i))return;const c=s.handlers||ue;for(const f of Object.keys(c)){const[g,...u]=f.split(".");if(g==="keydown"&&u.includes(i)){const p=c[f],w=u.filter(m=>$.includes(m)),E=$.some(m=>{const b=m.charAt(0).toUpperCase()+m.slice(1);return r.getModifierState(b)});if(w.length>0){if(E){for(const m of $)if(u.includes(m)){const b=m.charAt(0).toUpperCase()+m.slice(1);r.getModifierState(b)&&p(r)}}}else E||p(r)}}},d=[];e.onMounted(()=>{for(const s of t){const r=o(s),i=a(s),c=l(s),f=r?[r]:i;for(const g of f){const{focused:u}=it(e.ref(g)),p=e.watch(u,w=>{w?g.addEventListener("keydown",c):g.removeEventListener("keydown",c)});d.push(p)}}}),e.onBeforeUnmount(()=>{for(const s of d)s()})}const mt={class:"adatepicker",tabindex:"0",ref:"datepicker"},pt={colspan:"5",tabindex:-1},gt=["onClick","onKeydown"],bt=6,fe=7,me=_(e.defineComponent({__name:"ADatePicker",props:{modelValue:{default:new Date},modelModifiers:{}},emits:["update:modelValue"],setup(t,{expose:o}){const n=e.useModel(t,"modelValue"),a=e.ref(new Date(n.value)),l=e.ref(a.value.getMonth()),d=e.ref(a.value.getFullYear()),s=e.ref([]),r=e.useTemplateRef("datepicker");e.onMounted(async()=>{i(),await e.nextTick();const h=document.getElementsByClassName("selectedDate");if(h.length>0)h[0].focus();else{const k=document.getElementsByClassName("todaysDate");k.length>0&&k[0].focus()}});const i=()=>{s.value=[];const h=new Date(d.value,l.value,1),k=h.getDay(),D=h.setDate(h.getDate()-k);for(const M of Array(43).keys())s.value.push(D+M*864e5)};e.watch([l,d],i);const c=()=>d.value-=1,f=()=>d.value+=1,g=()=>{l.value==0?(l.value=11,c()):l.value-=1},u=()=>{l.value==11?(l.value=0,f()):l.value+=1},p=h=>{const k=new Date;if(l.value===k.getMonth())return k.toDateString()===new Date(h).toDateString()},w=h=>new Date(h).toDateString()===new Date(a.value).toDateString(),E=(h,k)=>(h-1)*fe+k,m=(h,k)=>s.value[E(h,k)],b=h=>{n.value=a.value=new Date(s.value[h])},v=e.computed(()=>new Date(d.value,l.value,1).toLocaleDateString(void 0,{year:"numeric",month:"long"}));return ft([{parent:r,selectors:"td",handlers:{...ue,"keydown.pageup":g,"keydown.shift.pageup":c,"keydown.pagedown":u,"keydown.shift.pagedown":f,"keydown.enter":()=>{}}}]),o({currentMonth:l,currentYear:d,selectedDate:a}),(h,k)=>(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("table",null,[e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",{id:"previous-month-btn",onClick:g,tabindex:-1},"<"),e.createElementVNode("th",pt,e.toDisplayString(v.value),1),e.createElementVNode("td",{id:"next-month-btn",onClick:u,tabindex:-1},">")]),k[0]||(k[0]=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)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(bt,D=>e.createElementVNode("tr",{key:D},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(fe,M=>e.createElementVNode("td",{ref_for:!0,ref:"celldate",key:E(D,M),contenteditable:!1,spellcheck:!1,tabindex:0,onClick:e.withModifiers(Gt=>b(E(D,M)),["prevent","stop"]),onKeydown:e.withKeys(Gt=>b(E(D,M)),["enter"]),class:e.normalizeClass({todaysDate:p(m(D,M)),selectedDate:w(m(D,M))})},e.toDisplayString(new Date(m(D,M)).getDate()),43,gt)),64))])),64))])])],512))}}),[["__scopeId","data-v-f49cfd40"]]),ht=_(e.defineComponent({__name:"CollapseButton",props:{collapsed:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["collapse-button",o.collapsed?"rotated":"unrotated"])},"×",2))}}),[["__scopeId","data-v-6f1c1b45"]]),wt={class:"aform"},K=_(e.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:o}){const n=o,a=e.ref(t.data||{}),l=s=>{let r={};for(const[i,c]of Object.entries(s))["component","fieldtype"].includes(i)||(r[i]=c),i==="rows"&&c&&c.length===0&&(r.rows=a.value[s.fieldname]);return r},d=e.computed({get:()=>t.modelValue.map((s,r)=>e.computed({get(){return s.value},set:i=>{t.modelValue[r].value=i,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(s,r)=>(e.openBlock(),e.createElementBlock("form",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.modelValue,(i,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.mergeProps({key:c,schema:i,modelValue:d.value[c].value,"onUpdate:modelValue":f=>d.value[c].value=f,data:a.value[i.fieldname],readonly:s.readonly},{ref_for:!0},l(i)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),[["__scopeId","data-v-68845234"]]),pe=_(e.defineComponent({__name:"AFieldset",props:{schema:{},label:{},collapsible:{type:Boolean},data:{}},setup(t,{expose:o}){const n=e.ref(!1),a=e.ref(t.data||[]),l=e.ref(t.schema),d=s=>{s.preventDefault(),t.collapsible&&(n.value=!n.value)};return o({collapsed:n}),(s,r)=>(e.openBlock(),e.createElementBlock("fieldset",null,[e.createElementVNode("legend",{onClick:d,onSubmit:d},[e.createTextVNode(e.toDisplayString(s.label)+" ",1),s.collapsible?(e.openBlock(),e.createBlock(ht,{key:0,collapsed:n.value},null,8,["collapsed"])):e.createCommentVNode("",!0)],32),e.renderSlot(s.$slots,"default",{collapsed:n.value},()=>[e.withDirectives(e.createVNode(K,{modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=i=>l.value=i),data:a.value},null,8,["modelValue","data"]),[[e.vShow,!n.value]])],!0)]))}}),[["__scopeId","data-v-e7ea7e12"]]),yt={class:"aform_form-element aform_file-attach aform__grid--full"},kt={key:0,class:"aform_file-attach-feedback"},vt=["disabled"],ge=_(e.defineComponent({__name:"AFileAttach",props:{label:{}},setup(t){const{files:o,open:n,reset:a,onChange:l}=Pe(),d=e.computed(()=>`${o.value.length} ${o.value.length===1?"file":"files"}`);return l(s=>s),(s,r)=>(e.openBlock(),e.createElementBlock("div",yt,[e.unref(o)?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("p",null,[r[2]||(r[2]=e.createTextVNode(" You have selected: ",-1)),e.createElementVNode("b",null,e.toDisplayString(d.value),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),i=>(e.openBlock(),e.createElementBlock("li",{key:i.name},e.toDisplayString(i.name),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=i=>e.unref(n)()),class:"aform_form-btn"},e.toDisplayString(s.label),1),e.createElementVNode("button",{type:"button",disabled:!e.unref(o),onClick:r[1]||(r[1]=i=>e.unref(a)()),class:"aform_form-btn"},"Reset",8,vt)]))}}),[["__scopeId","data-v-0b3a11cc"]]),Et={class:"aform_form-element"},_t=["id","disabled","required"],xt=["for"],Vt=["innerHTML"],be=e.defineComponent({__name:"ANumericInput",props:e.mergeModels({schema:{},label:{},mask:{},required:{type:Boolean},readonly:{type:Boolean},uuid:{},validation:{default:()=>({errorMessage:" "})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue");return(n,a)=>(e.openBlock(),e.createElementBlock("div",Et,[e.withDirectives(e.createElementVNode("input",{class:"aform_input-field","onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l),type:"number",id:n.uuid,disabled:n.readonly,required:n.required},null,8,_t),[[e.vModelText,o.value]]),e.createElementVNode("label",{class:"aform_field-label",for:n.uuid},e.toDisplayString(n.label),9,xt),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:n.validation.errorMessage},null,8,Vt),[[e.vShow,n.validation.errorMessage]])]))}}),he={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function Dt(t){try{return Function(`"use strict";return (${t})`)()}catch{}}function Mt(t){let o=t.value;if(o){const n=Dt(o);if(n){const a=t.instance?.locale;o=n(a)}}else{const a=t.instance?.schema?.fieldtype?.toLowerCase();a&&he[a]&&(o=he[a])}return o}function Ct(t,o){let n=t;const a=[o,"/","-","(",")"," "];for(const l of a)n=n.replaceAll(l,"");return n}function At(t,o,n){let a=o;for(const l of t){const d=a.indexOf(n);if(d!==-1){const s=a.substring(0,d),r=a.substring(d+1);a=s+l+r}}return a.slice(0,o.length)}function St(t,o){const n=Mt(o);if(!n)return;const a="#",l=t.value,d=Ct(l,a);if(d){const s=At(d,n,a);o.instance?.maskFilled&&(o.instance.maskFilled=!s.includes(a)),t.value=s}else t.value=n}const Tt={class:"aform_form-element"},It=["id","disabled","maxlength","required"],Nt=["for"],Bt=["innerHTML"],we=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 o=e.ref(!0),n=e.useModel(t,"modelValue");return(a,l)=>(e.openBlock(),e.createElementBlock("div",Tt,[e.withDirectives(e.createElementVNode("input",{class:"aform_input-field","onUpdate:modelValue":l[0]||(l[0]=d=>n.value=d),id:a.uuid,disabled:a.readonly,maxlength:a.mask?o.value&&a.mask.length:void 0,required:a.required},null,8,It),[[e.vModelText,n.value],[e.unref(St),a.mask]]),e.createElementVNode("label",{class:"aform_field-label",for:a.uuid},e.toDisplayString(a.label),9,Nt),e.withDirectives(e.createElementVNode("p",{class:"aform_error",innerHTML:a.validation.errorMessage},null,8,Bt),[[e.vShow,a.validation.errorMessage]])]))}}),$t={class:"login-container"},Lt={class:"account-container"},Ft={class:"account-header"},Pt={id:"account-title"},Ot={id:"account-subtitle"},zt={class:"login-form-container"},Rt={class:"login-form-email aform_form-element"},Ht=["disabled"],qt={class:"login-form-password aform_form-element"},Wt=["disabled"],Ut=["disabled"],jt={key:0,class:"material-symbols-outlined loading-icon"},Yt=_(e.defineComponent({__name:"Login",props:{headerTitle:{default:"Login"},headerSubtitle:{default:"Enter your email and password to login"}},emits:["loginFailed","loginSuccess"],setup(t,{emit:o}){const n=o,a=e.ref(""),l=e.ref(""),d=e.ref(!1),s=e.ref(!1);function r(i){if(i.preventDefault(),d.value=!0,s.value){d.value=!1,n("loginFailed");return}d.value=!1,n("loginSuccess")}return(i,c)=>(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("div",null,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Ft,[e.createElementVNode("h1",Pt,e.toDisplayString(i.headerTitle),1),e.createElementVNode("p",Ot,e.toDisplayString(i.headerSubtitle),1)]),e.createElementVNode("form",{onSubmit:r},[e.createElementVNode("div",zt,[e.createElementVNode("div",Rt,[c[2]||(c[2]=e.createElementVNode("label",{id:"login-email",for:"email",class:"aform_field-label"},"Email",-1)),e.withDirectives(e.createElementVNode("input",{id:"email",class:"aform_input-field",name:"email",placeholder:"name@example.com",type:"email","onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),"auto-capitalize":"none","auto-complete":"email","auto-correct":"off",disabled:d.value},null,8,Ht),[[e.vModelText,a.value]])]),e.createElementVNode("div",qt,[c[3]||(c[3]=e.createElementVNode("label",{id:"login-password",for:"password",class:"aform_field-label"},"Password",-1)),e.withDirectives(e.createElementVNode("input",{id:"password",class:"aform_input-field",name:"password",type:"password","onUpdate:modelValue":c[1]||(c[1]=f=>l.value=f),disabled:d.value},null,8,Wt),[[e.vModelText,l.value]])]),e.createElementVNode("button",{class:"btn",onClick:r,disabled:d.value||!a.value||!l.value},[d.value?(e.openBlock(),e.createElementBlock("span",jt,"progress_activity")):e.createCommentVNode("",!0),c[4]||(c[4]=e.createElementVNode("span",{id:"login-form-button"},"Login",-1))],8,Ut)])],32),c[5]||(c[5]=e.createElementVNode("button",{class:"btn"},[e.createElementVNode("span",{id:"forgot-password-button"},"Forgot password?")],-1))])])]))}}),[["__scopeId","data-v-6cbd3add"]]);function Kt(t){t.component("ACheckbox",X),t.component("ACombobox",J),t.component("ADate",Q),t.component("ADropdown",ae),t.component("ADatePicker",me),t.component("AFieldset",pe),t.component("AFileAttach",ge),t.component("AForm",K),t.component("ANumericInput",be),t.component("ATextInput",we)}y.ACheckbox=X,y.AComboBox=J,y.ADate=Q,y.ADatePicker=me,y.ADropdown=ae,y.AFieldset=pe,y.AFileAttach=ge,y.AForm=K,y.ANumericInput=be,y.ATextInput=we,y.Login=Yt,y.install=Kt,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
|
3
3
|
//# sourceMappingURL=aform.umd.cjs.map
|