@luizleon/sf.prefeiturasp.vuecomponents 0.0.3 → 0.0.4

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/lib.umd.js CHANGED
@@ -77,3 +77,4 @@ https://sweetalert2.github.io/#ajax-request`),Ln(e),typeof e.title=="string"&&(e
77
77
  `).join("<br />")),qt(e)}class Un{constructor(t,n){this.callback=t,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Mn=()=>{we.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(we.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(we.previousBodyPadding+Kt(),"px"))},On=()=>{we.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(we.previousBodyPadding,"px"),we.previousBodyPadding=null)},Nn=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!ue(document.body,d.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),F(document.body,d.iosfix),Dn(),Vn()}},Vn=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&I().scrollHeight>window.innerHeight-44&&(N().style.paddingBottom="".concat(44,"px"))},Dn=()=>{const e=N();let t;e.ontouchstart=n=>{t=jn(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},jn=e=>{const t=e.target,n=N();return $n(e)||Xn(e)?!1:t===n||!nt(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(nt(be())&&be().contains(t))},$n=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",Xn=e=>e.touches&&e.touches.length>1,qn=()=>{if(ue(document.body,d.iosfix)){const e=parseInt(document.body.style.top,10);se(document.body,d.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},ht=10,zn=e=>{const t=N(),n=I();typeof e.willOpen=="function"&&e.willOpen(n);const p=window.getComputedStyle(document.body).overflowY;Jn(t,n,e),setTimeout(()=>{Wn(t,n)},ht),ne()&&(Kn(t,e.scrollbarPadding,p),Sn()),!$()&&!P.previousActiveElement&&(P.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),se(t,d["no-transition"])},pt=e=>{const t=I();if(e.target!==t)return;const n=N();t.removeEventListener(Be,pt),n.style.overflowY="auto"},Wn=(e,t)=>{Be&&ot(t)?(e.style.overflowY="hidden",t.addEventListener(Be,pt)):e.style.overflowY="auto"},Kn=(e,t,n)=>{Nn(),t&&n!=="hidden"&&Mn(),setTimeout(()=>{e.scrollTop=0})},Jn=(e,t,n)=>{F(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),X(t,"grid"),setTimeout(()=>{F(t,n.showClass.popup),t.style.removeProperty("opacity")},ht),F([document.documentElement,document.body],d.shown),n.heightAuto&&n.backdrop&&!n.toast&&F([document.documentElement,document.body],d["height-auto"])},ke=e=>{let t=I();t||new Me,t=I();const n=C();$()?z(le()):Yn(t,e),X(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Yn=(e,t)=>{const n=b(),r=C();!t&&ee(g())&&(t=g()),X(n),t&&(z(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),F([e,n],d.loading)},Gn=(e,t)=>{t.input==="select"||t.input==="radio"?no(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(V(t.inputValue)||J(t.inputValue))&&(ke(g()),oo(e,t))},Zn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Qn(n);case"radio":return eo(n);case"file":return to(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Qn=e=>e.checked?1:0,eo=e=>e.checked?e.value:null,to=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,no=(e,t)=>{const n=I(),r=p=>ro[t.input](n,Xe(p),t);V(t.inputOptions)||J(t.inputOptions)?(ke(g()),T(t.inputOptions).then(p=>{e.hideLoading(),r(p)})):typeof t.inputOptions=="object"?r(t.inputOptions):h("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},oo=(e,t)=>{const n=e.getInput();z(n),T(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),X(n),n.focus(),e.hideLoading()}).catch(r=>{h("Error in inputValue promise: ".concat(r)),n.value="",X(n),n.focus(),e.hideLoading()})},ro={select:(e,t,n)=>{const r=fe(e,d.select),p=(A,O,te)=>{const W=document.createElement("option");W.value=te,q(W,O),W.selected=mt(te,n.inputValue),A.appendChild(W)};t.forEach(A=>{const O=A[0],te=A[1];if(Array.isArray(te)){const W=document.createElement("optgroup");W.label=O,W.disabled=!1,r.appendChild(W),te.forEach(xe=>p(W,xe[1],xe[0]))}else p(r,te,O)}),r.focus()},radio:(e,t,n)=>{const r=fe(e,d.radio);t.forEach(A=>{const O=A[0],te=A[1],W=document.createElement("input"),xe=document.createElement("label");W.type="radio",W.name=d.radio,W.value=O,mt(O,n.inputValue)&&(W.checked=!0);const Ge=document.createElement("span");q(Ge,te),Ge.className=d.label,xe.appendChild(W),xe.appendChild(Ge),r.appendChild(xe)});const p=r.querySelectorAll("input");p.length&&p[0].focus()}},Xe=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let p=n;typeof p=="object"&&(p=Xe(p)),t.push([r,p])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=Xe(r)),t.push([n,r])}),t},mt=(e,t)=>t&&t.toString()===e.toString();function gt(){const e=H.innerParams.get(this);if(!e)return;const t=H.domCache.get(this);z(t.loader),$()?e.icon&&X(le()):so(t),se([t.popup,t.actions],d.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const so=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?X(t[0],"inline-block"):Lt()&&z(e.actions)};function io(e){const t=H.innerParams.get(e||this),n=H.domCache.get(e||this);return n?Ne(n.popup,t.input):null}var Pe={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const ao=()=>ee(I()),vt=()=>g()&&g().click(),co=()=>w()&&w().click(),lo=()=>v()&&v().click(),bt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},uo=(e,t,n,r)=>{bt(t),n.toast||(t.keydownHandler=p=>ho(e,p,r),t.keydownTarget=n.keydownListenerCapture?window:I(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},qe=(e,t,n)=>{const r=G();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();I().focus()},wt=["ArrowRight","ArrowDown"],fo=["ArrowLeft","ArrowUp"],ho=(e,t,n)=>{const r=H.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?po(e,t,r):t.key==="Tab"?mo(t,r):[...wt,...fo].includes(t.key)?go(t.key):t.key==="Escape"&&vo(t,r,n)))},po=(e,t,n)=>{if(R(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;vt(),t.preventDefault()}},mo=(e,t)=>{const n=e.target,r=G();let p=-1;for(let A=0;A<r.length;A++)if(n===r[A]){p=A;break}e.shiftKey?qe(t,p,-1):qe(t,p,1),e.stopPropagation(),e.preventDefault()},go=e=>{const t=g(),n=w(),r=v();if(![t,n,r].includes(document.activeElement))return;const p=wt.includes(e)?"nextElementSibling":"previousElementSibling";let A=document.activeElement;for(let O=0;O<b().children.length;O++){if(A=A[p],!A)return;if(ee(A)&&A instanceof HTMLButtonElement)break}A instanceof HTMLButtonElement&&A.focus()},vo=(e,t,n)=>{R(t.allowEscapeKey)&&(e.preventDefault(),n(ye.esc))};function yt(e,t,n,r){$()?kt(e,r):(Ot(n).then(()=>kt(e,r)),bt(P)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(On(),qn(),ut()),bo()}function bo(){se([document.documentElement,document.body],[d.shown,d["height-auto"],d["no-backdrop"],d["toast-shown"]])}function Re(e){e=Co(e);const t=Pe.swalPromiseResolve.get(this),n=yo(this);this.isAwaitingPromise()?e.isDismissed||(He(this),t(e)):n&&t(e)}function wo(){return!!H.awaitingPromise.get(this)}const yo=e=>{const t=I();if(!t)return!1;const n=H.innerParams.get(e);if(!n||ue(t,n.hideClass.popup))return!1;se(t,n.showClass.popup),F(t,n.hideClass.popup);const r=N();return se(r,n.showClass.backdrop),F(r,n.hideClass.backdrop),xo(e,t,n),!0};function ko(e){const t=Pe.swalPromiseReject.get(this);He(this),t&&t(e)}const He=e=>{e.isAwaitingPromise()&&(H.awaitingPromise.delete(e),H.innerParams.get(e)||e._destroy())},Co=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),xo=(e,t,n)=>{const r=N(),p=Be&&ot(t);typeof n.willClose=="function"&&n.willClose(t),p?So(e,t,r,n.returnFocus,n.didClose):yt(e,r,n.returnFocus,n.didClose)},So=(e,t,n,r,p)=>{P.swalCloseEventFinishedCallback=yt.bind(null,e,n,r,p),t.addEventListener(Be,function(A){A.target===t&&(P.swalCloseEventFinishedCallback(),delete P.swalCloseEventFinishedCallback)})},kt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Ct(e,t,n){const r=H.domCache.get(e);t.forEach(p=>{r[p].disabled=n})}function xt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let p=0;p<r.length;p++)r[p].disabled=t}else e.disabled=t}function _o(){Ct(this,["confirmButton","denyButton","cancelButton"],!1)}function Ao(){Ct(this,["confirmButton","denyButton","cancelButton"],!0)}function Eo(){return xt(this.getInput(),!1)}function Bo(){return xt(this.getInput(),!0)}function To(e){const t=H.domCache.get(this),n=H.innerParams.get(this);q(t.validationMessage,e),t.validationMessage.className=d["validation-message"],n.customClass&&n.customClass.validationMessage&&F(t.validationMessage,n.customClass.validationMessage),X(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",d["validation-message"]),Qe(r),F(r,d.inputerror))}function Po(){const e=H.domCache.get(this);e.validationMessage&&z(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),se(t,d.inputerror))}function Ho(){return H.domCache.get(this).progressSteps}function Io(e){const t=I(),n=H.innerParams.get(this);if(!t||ue(t,n.hideClass.popup))return y("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=Fo(e),p=Object.assign({},n,r);lt(this,p),H.innerParams.set(this,p),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Fo=e=>{const t={};return Object.keys(e).forEach(n=>{Se(n)?t[n]=e[n]:y('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
78
78
 
79
79
  If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function Lo(){const e=H.domCache.get(this),t=H.innerParams.get(this);if(!t){St(this);return}e.popup&&P.swalCloseEventFinishedCallback&&(P.swalCloseEventFinishedCallback(),delete P.swalCloseEventFinishedCallback),P.deferDisposalTimer&&(clearTimeout(P.deferDisposalTimer),delete P.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),Ro(this)}const Ro=e=>{St(e),delete e.params,delete P.keydownHandler,delete P.keydownTarget,delete P.currentInstance},St=e=>{e.isAwaitingPromise()?(ze(H,e),H.awaitingPromise.set(e,!0)):(ze(Pe,e),ze(H,e))},ze=(e,t)=>{for(const n in e)e[n].delete(t)};var _t=Object.freeze({hideLoading:gt,disableLoading:gt,getInput:io,close:Re,isAwaitingPromise:wo,rejectPromise:ko,handleAwaitingPromise:He,closePopup:Re,closeModal:Re,closeToast:Re,enableButtons:_o,disableButtons:Ao,enableInput:Eo,disableInput:Bo,showValidationMessage:To,resetValidationMessage:Po,getProgressSteps:Ho,update:Io,_destroy:Lo});const Uo=e=>{const t=H.innerParams.get(e);e.disableButtons(),t.input?At(e,"confirm"):Ke(e,!0)},Mo=e=>{const t=H.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?At(e,"deny"):We(e,!1)},Oo=(e,t)=>{e.disableButtons(),t(ye.cancel)},At=(e,t)=>{const n=H.innerParams.get(e);if(!n.input)return h('The "input" parameter is needed to be set when using returnInputValueOn'.concat(k(t)));const r=Zn(e,n);n.inputValidator?No(e,r,t):e.getInput().checkValidity()?t==="deny"?We(e,r):Ke(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},No=(e,t,n)=>{const r=H.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>T(r.inputValidator(t,r.validationMessage))).then(A=>{e.enableButtons(),e.enableInput(),A?e.showValidationMessage(A):n==="deny"?We(e,t):Ke(e,t)})},We=(e,t)=>{const n=H.innerParams.get(e||void 0);n.showLoaderOnDeny&&ke(w()),n.preDeny?(H.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>T(n.preDeny(t,n.validationMessage))).then(p=>{p===!1?(e.hideLoading(),He(e)):e.closePopup({isDenied:!0,value:typeof p>"u"?t:p})}).catch(p=>Bt(e||void 0,p))):e.closePopup({isDenied:!0,value:t})},Et=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Bt=(e,t)=>{e.rejectPromise(t)},Ke=(e,t)=>{const n=H.innerParams.get(e||void 0);n.showLoaderOnConfirm&&ke(),n.preConfirm?(e.resetValidationMessage(),H.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>T(n.preConfirm(t,n.validationMessage))).then(p=>{ee(c())||p===!1?(e.hideLoading(),He(e)):Et(e,typeof p>"u"?t:p)}).catch(p=>Bt(e||void 0,p))):Et(e,t)},Vo=(e,t,n)=>{H.innerParams.get(e).toast?Do(e,t,n):($o(t),Xo(t),qo(e,t,n))},Do=(e,t,n)=>{t.popup.onclick=()=>{const r=H.innerParams.get(e);r&&(jo(r)||r.timer||r.input)||n(ye.close)}},jo=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Ue=!1;const $o=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Ue=!0)}}},Xo=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Ue=!0)}}},qo=(e,t,n)=>{t.container.onclick=r=>{const p=H.innerParams.get(e);if(Ue){Ue=!1;return}r.target===t.container&&R(p.allowOutsideClick)&&n(ye.backdrop)}},zo=e=>typeof e=="object"&&e.jquery,Tt=e=>e instanceof Element||zo(e),Wo=e=>{const t={};return typeof e[0]=="object"&&!Tt(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const p=e[r];typeof p=="string"||Tt(p)?t[n]=p:p!==void 0&&h("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof p))}),t};function Ko(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function Jo(e){class t extends this{_main(r,p){return super._main(r,Object.assign({},e,p))}}return t}const Yo=()=>P.timeout&&P.timeout.getTimerLeft(),Pt=()=>{if(P.timeout)return Rt(),P.timeout.stop()},Ht=()=>{if(P.timeout){const e=P.timeout.start();return Ve(e),e}},Go=()=>{const e=P.timeout;return e&&(e.running?Pt():Ht())},Zo=e=>{if(P.timeout){const t=P.timeout.increase(e);return Ve(t,!0),t}},Qo=()=>P.timeout&&P.timeout.isRunning();let It=!1;const Je={};function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";Je[e]=this,It||(document.body.addEventListener("click",tr),It=!0)}const tr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in Je){const r=t.getAttribute(n);if(r){Je[n].fire({template:r});return}}};var nr=Object.freeze({isValidParameter:ie,isUpdatableParameter:Se,isDeprecatedParameter:de,argsToParams:Wo,isVisible:ao,clickConfirm:vt,clickDeny:co,clickCancel:lo,getContainer:N,getPopup:I,getTitle:ve,getHtmlContainer:be,getImage:Ae,getIcon:le,getInputLabel:m,getCloseButton:E,getActions:b,getConfirmButton:g,getDenyButton:w,getCancelButton:v,getLoader:C,getFooter:_,getTimerProgressBar:S,getFocusableElements:G,getValidationMessage:c,isLoading:pe,fire:Ko,mixin:Jo,showLoading:ke,enableLoading:ke,getTimerLeft:Yo,stopTimer:Pt,resumeTimer:Ht,toggleTimer:Go,increaseTimer:Zo,isTimerRunning:Qo,bindClickHandler:er});let Ye;class Ce{constructor(){if(typeof window>"u")return;Ye=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const p=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:p,writable:!1,enumerable:!0,configurable:!0}});const A=this._main(this.params);H.promise.set(this,A)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oe(Object.assign({},n,t)),P.currentInstance&&(P.currentInstance._destroy(),ne()&&ut()),P.currentInstance=this;const r=rr(t,n);Rn(r),Object.freeze(r),P.timeout&&(P.timeout.stop(),delete P.timeout),clearTimeout(P.restoreFocusTimeout);const p=sr(this);return lt(this,r),H.innerParams.set(this,r),or(this,p,r)}then(t){return H.promise.get(this).then(t)}finally(t){return H.promise.get(this).finally(t)}}const or=(e,t,n)=>new Promise((r,p)=>{const A=O=>{e.closePopup({isDismissed:!0,dismiss:O})};Pe.swalPromiseResolve.set(e,r),Pe.swalPromiseReject.set(e,p),t.confirmButton.onclick=()=>Uo(e),t.denyButton.onclick=()=>Mo(e),t.cancelButton.onclick=()=>Oo(e,A),t.closeButton.onclick=()=>A(ye.close),Vo(e,t,A),uo(e,P,n,A),Gn(e,n),zn(n),ir(P,n,A),ar(t,n),setTimeout(()=>{t.container.scrollTop=0})}),rr=(e,t)=>{const n=_n(e),r=Object.assign({},D,t,n,e);return r.showClass=Object.assign({},D.showClass,r.showClass),r.hideClass=Object.assign({},D.hideClass,r.hideClass),r},sr=e=>{const t={popup:I(),container:N(),actions:b(),confirmButton:g(),denyButton:w(),cancelButton:v(),loader:C(),closeButton:E(),validationMessage:c(),progressSteps:a()};return H.domCache.set(e,t),t},ir=(e,t,n)=>{const r=S();z(r),t.timer&&(e.timeout=new Un(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(X(r),oe(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&Ve(t.timer)})))},ar=(e,t)=>{if(!t.toast){if(!R(t.allowEnterKey))return lr();cr(e,t)||qe(t,-1,1)}},cr=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&ee(e.confirmButton)?(e.confirmButton.focus(),!0):!1,lr=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ce.prototype,_t),Object.assign(Ce,nr),Object.keys(_t).forEach(e=>{Ce[e]=function(){if(Ye)return Ye[e](...arguments)}}),Ce.DismissReason=ye,Ce.version="11.4.8";const Me=Ce;return Me.default=Me,Me}),typeof commonjsGlobal<"u"&&commonjsGlobal.Sweetalert2&&(commonjsGlobal.swal=commonjsGlobal.sweetAlert=commonjsGlobal.Swal=commonjsGlobal.SweetAlert=commonjsGlobal.Sweetalert2)})(sweetalert2);var sweetalert2Exports=sweetalert2.exports;const Swal=getDefaultExportFromCjs(sweetalert2Exports);class DialogService{get IsVisible(){return Swal.isVisible()}async ConfirmAsync(o){return new Promise(u=>{Swal.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(f=>{u(f.isConfirmed===!0)})})}}const service=new DialogService,UseDialogService=()=>service,_hoisted_1$5=["data-cor"],_sfc_main$7=vue.defineComponent({__name:"HeaderAvatar",setup(s){const o=UseDialogService(),u=k();async function f(){await o.ConfirmAsync({message:`${AuthService.User.username} - ${AuthService.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&AuthService.CallLogout()}function k(){const y=AuthService.User.name;let h="?";if(!y)return h;const x=y.split(" ").filter(U=>U.length>0).map(U=>U[0].toUpperCase()),B=Math.min(2,x.length);return h=x.slice(0,B).join(""),h.length>0?h:"?"}function l(){const y=u[0],h=y==="?"?0:(y.charCodeAt(0)-64)%19;return Math.max(h,0)}return(y,h)=>(vue.openBlock(),vue.createElementBlock("div",{id:"sf-header-avatar","data-cor":l(),onClick:f},vue.toDisplayString(vue.unref(u)),9,_hoisted_1$5))}}),_sfc_main$6={},_hoisted_1$4={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},_hoisted_2$4=vue.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1),_hoisted_3$2=[_hoisted_2$4];function _sfc_render(s,o){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$4,_hoisted_3$2)}const MenuIcon=_export_sfc(_sfc_main$6,[["render",_sfc_render]]);class ThemeToggle{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const ThemeToggleBase=(()=>new ThemeToggle)(),_hoisted_1$3=vue.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1),_hoisted_2$3=[_hoisted_1$3],_sfc_main$5=vue.defineComponent({__name:"ThemeToggle",setup(s){return(o,u)=>(vue.openBlock(),vue.createElementBlock("button",{id:"sf-theme-toggle",onClick:u[0]||(u[0]=(...f)=>vue.unref(ThemeToggleBase).Toggle&&vue.unref(ThemeToggleBase).Toggle(...f))},_hoisted_2$3))}}),_hoisted_1$2={id:"sf-layout"},_hoisted_2$2=vue.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),_hoisted_3$1={class:"title"},_hoisted_4$1={class:"sf-layout-nav-header"},_hoisted_5$1=vue.createElementVNode("span",null,"Menu",-1),_hoisted_6$1={class:"sf-layout-nav-content"},_hoisted_7=vue.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),_hoisted_8={id:"sf-layout-content"},_sfc_main$4=vue.defineComponent({__name:"Layout",setup(s){const o=UseNavMenuService();return(u,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("header",null,[vue.createElementVNode("div",{class:vue.normalizeClass(["sf-layout-menu-toggler",{invert:vue.unref(o).IsVisible}]),onClick:f[0]||(f[0]=k=>vue.unref(o).Toggle())},[_hoisted_2$2,vue.createVNode(MenuIcon)],2),vue.createElementVNode("div",_hoisted_3$1,[vue.renderSlot(u.$slots,"title")]),vue.renderSlot(u.$slots,"action"),vue.createVNode(_sfc_main$5),vue.createVNode(_sfc_main$7)]),vue.createElementVNode("nav",{class:vue.normalizeClass({visible:vue.unref(o).IsVisible})},[vue.createElementVNode("div",_hoisted_4$1,[_hoisted_5$1,vue.createVNode(_sfc_main$8,{icone:"close",button:"",onClick:f[1]||(f[1]=k=>vue.unref(o).Close())})]),vue.createElementVNode("div",_hoisted_6$1,[vue.renderSlot(u.$slots,"menu")])],2),vue.createElementVNode("main",{class:vue.normalizeClass({"menu-visible":vue.unref(o).IsVisible})},[_hoisted_7,vue.createElementVNode("section",_hoisted_8,[vue.renderSlot(u.$slots,"content")])],2)]))}}),_hoisted_1$1=["href","data-active","onClick"],_hoisted_2$1={class:"sf-navmenulink-text"},_sfc_main$3=vue.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{}},setup(s){const o=s,u=UseNavMenuService();function f(k,l){k.preventDefault();const h=k.target.closest(".sf-layout-nav-content");l(),h&&h.clientWidth+10>document.body.clientWidth&&u.Close()}return(k,l)=>{const y=vue.resolveComponent("router-link");return vue.openBlock(),vue.createBlock(y,{to:o.href,custom:""},{default:vue.withCtx(({href:h,navigate:x,isExactActive:B})=>[vue.createElementVNode("a",{class:"sf-navmenulink",href:h,"data-active":B,onClick:U=>f(U,x)},[o.icon?(vue.openBlock(),vue.createBlock(_sfc_main$8,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):vue.createCommentVNode("",!0),vue.createElementVNode("span",_hoisted_2$1,vue.toDisplayString(o.text),1)],8,_hoisted_1$1)]),_:1},8,["to"])}}}),_sfc_main$2=vue.defineComponent({__name:"ScrollToTop",setup(s){const o=vue.ref(!1),u=`--${+new Date}`;let f=null;function k(){f==null||f.scrollTo(0,0)}return vue.onMounted(()=>{var l;f=((l=document.getElementById(u))==null?void 0:l.parentElement)??null,f&&f.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(l,y)=>(vue.openBlock(),vue.createElementBlock("button",{id:u,class:vue.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:k},null,2))}}),_sfc_main$1=vue.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(s){const o=s;function u(){return new CssClassBuilder("sf-content").AddClass(o.class,!!o.class).Build()}function f(){return new CssClassBuilder("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function k(){return new CssClassBuilder("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function l(){return new CssClassBuilder("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(y,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(u()),style:vue.normalizeStyle(o.style)},[vue.createElementVNode("div",{class:vue.normalizeClass(k())},[vue.renderSlot(y.$slots,"header")],2),vue.createElementVNode("div",{class:vue.normalizeClass(f())},[vue.renderSlot(y.$slots,"default"),vue.createVNode(_sfc_main$2)],2),vue.createElementVNode("div",{class:vue.normalizeClass(l())},[vue.renderSlot(y.$slots,"footer")],2)],6))}}),_hoisted_1={class:"sf-tab-navigation"},_hoisted_2=vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1),_hoisted_3=[_hoisted_2],_hoisted_4=["href","onClick"],_hoisted_5=vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1),_hoisted_6=[_hoisted_5],_sfc_main=vue.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(s){const o=s,u=vue.ref(null),f=new ResizeObserver(x=>{h()}),k=vue.ref(!1),l=vue.ref(!1);function y(x=!1){const B=u.value.clientWidth;u.value.scrollLeft+=x?-B:B}function h(){const x=u.value.scrollWidth-u.value.clientWidth;k.value=u.value.scrollLeft>10,l.value=u.value.scrollLeft<x-10}return vue.onMounted(()=>{u.value.addEventListener("scroll",h),f.observe(u.value)}),vue.onBeforeUnmount(()=>{u.value.removeEventListener("scroll",h),f.unobserve(u.value),f.disconnect()}),(x,B)=>{const U=vue.resolveComponent("RouterLink");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",{class:vue.normalizeClass(["left-arrow",{active:k.value}]),onClick:B[0]||(B[0]=R=>y(!0))},_hoisted_3,2),vue.createElementVNode("ul",{ref_key:"trackerContainer",ref:u},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.tabs,R=>(vue.openBlock(),vue.createBlock(U,{to:R.route,custom:!0},{default:vue.withCtx(({navigate:V,isActive:T})=>[vue.createElementVNode("li",null,[vue.renderSlot(x.$slots,"item",{item:R,navigate:V,isActive:T},()=>[vue.createElementVNode("a",{href:R.route,class:vue.normalizeClass({active:T}),onClick:V},vue.toDisplayString(R.text),11,_hoisted_4)])])]),_:2},1032,["to"]))),256))],512),vue.createElementVNode("div",{class:vue.normalizeClass(["right-arrow",{active:l.value}]),onClick:B[1]||(B[1]=R=>y())},_hoisted_6,2)])}}}),tema="",componentes="";(()=>{function s(){vue.nextTick(()=>{setTimeout(()=>{var u;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((u=window.visualViewport)==null?void 0:u.height)??window.innerHeight}px`)},1)})}s(),window.addEventListener("resize",s)})(),ThemeToggleBase.SetInitialTheme(),exports.AuthService=AuthService,exports.Cor=Cor,exports.SfContent=_sfc_main$1,exports.SfIcon=_sfc_main$8,exports.SfLayout=_sfc_main$4,exports.SfNavMenuLink=_sfc_main$3,exports.SfTabNavigation=_sfc_main,exports.Tamanho=Tamanho,exports.UseDialogService=UseDialogService,exports.UseNavMenuService=UseNavMenuService,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
80
+ //# sourceMappingURL=lib.umd.js.map