76 lines
65 KiB
JavaScript
76 lines
65 KiB
JavaScript
(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A.eli_vue={},A.Vue,A.VBtn,A.VBadge,A.VCheckbox,A.VIcon,A.VRadio,A.VRadioGroup,A.VSelect,A.VTextField,A.VTextarea,A.VCard,A.VGrid))})(this,(function(A,t,Le,ze,je,Ue,He,Re,Ye,se,Je,ee,Ge){"use strict";const We=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),O=(e,a)=>{const n=e.__vccOpts||e;for(const[i,s]of a)n[i]=s;return n};function Ze(e,a,n,i,s,f){return t.openBlock(),t.createBlock(Le.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"eli-botao text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const pe=O(We,[["render",Ze]]),ge={suave:"4px",pill:"10px"},Xe=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ge?ge[e.radius]:e.radius),n=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),i=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:n,badgeStyle:i}}});function Ke(e,a,n,i,s,f){return e.showBadge?(t.openBlock(),t.createBlock(ze.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle,class:"eli-badge"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const ce=O(Xe,[["render",Ke],["__scopeId","data-v-371c8db4"]]);function Qe(e){return e.replace(/\D+/g,"")}function xe(e){const a=Qe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function et(e){return e.replace(/\D+/g,"")}function tt(e){const a=et(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function fe(e){return e.replace(/\D+/g,"")}function ye(e){const a=e.replace(/[^\d,]/g,""),n=a.split(",");return n.length>2?n[0]+","+n.slice(1).join(""):a}function at(e){return ye(e.replace(/%/g,""))}function ot(e){const a=fe(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function nt(e){const a=fe(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const lt=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:n}){const i=t.ref(!1),s=t.ref(!1),f=t.computed({get:()=>e.modelValue,set:C=>{a("update:modelValue",C),a("change",C)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),l=t.computed(()=>e.type==="password"?s.value?"text":"password":"text"),p=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),r=t.computed(()=>e.error?"error":i.value?e.color:void 0);function u(C){const $=C.target;let b=$.value;switch(e.type){case"numericoInteiro":b=fe(b);break;case"numericoDecimal":b=ye(b);break;case"numericoMoeda":b=ot(b);break;case"porcentagem":b=at(b);break;case"telefone":b=tt(b);break;case"cpfCnpj":b=xe(b);break;case"cep":b=nt(b);break}$.value=b,a("update:modelValue",b),a("change",b)}function y(){s.value=!s.value}const _=t.computed(()=>(e.options||[]).map(C=>{if(C&&typeof C=="object"&&"value"in C){const b=C.value;return{label:C.label??String(b),value:b,disabled:C.disabled}}const $=C;return{label:String($),value:$}}));return{attrs:n,value:f,isTextLike:o,inputHtmlType:l,inputMode:p,internalColor:r,showPassword:s,togglePassword:y,onInput:u,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:_}}}),rt={class:"eli-input"},it={key:4,class:"checkbox-group"};function st(e,a,n,i,s,f){return t.openBlock(),t.createElementBlock("div",rt,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ue.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Je.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value=o),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ye.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value=o),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(Re.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value=o),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(He.VRadio,{key:String(o.value),label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",it,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(je.VCheckbox,{key:String(o.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=l=>e.value=l),label:o.label,value:o.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const be=O(lt,[["render",st],["__scopeId","data-v-756cb549"]]),ct=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:pe,EliBadge:ce,EliInput:be},setup(){const e=t.ref(""),a=t.ref([]),n=t.ref(""),i=t.ref(""),s=t.ref(""),f=t.ref(""),o=t.ref(""),l=t.ref(""),p=t.ref(""),r=t.ref(""),u=t.ref(""),y=t.ref(null),_=t.ref([]);return{nome:e,email:l,documento:u,estado:a,telefone:i,mensagem:p,senha:r,cor:y,habilidades:_,idade:s,altura:f,cep:n,valor:o}}}),dt={class:"grid-example"};function ut(e,a,n,i,s,f){const o=t.resolveComponent("EliBadge"),l=t.resolveComponent("EliInput"),p=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ge.VContainer,null,{default:t.withCtx(()=>[t.createVNode(ee.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(ee.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",dt,[t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=r=>e.nome=r),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=r=>e.cep=r),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(l,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=r=>e.estado=r),multiple:""},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=r=>e.senha=r),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(l,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(l,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=r=>e.cor=r),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(l,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=r=>e.habilidades=r),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=r=>e.nome=r),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(ee.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(p,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const $e=O(ct,[["render",ut]]),mt=t.defineComponent({name:"EliCartao",components:{EliBadge:ce},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const n=t.computed(()=>e.status),i=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),s=t.computed(()=>`eli-cartao--${e.status}`);function f(){a("clicar",e.status)}return{rotuloStatus:n,corStatus:i,classeStatus:s,onClick:f}}}),pt={class:"eli-cartao__titulo-texto"},ft={class:"eli-cartao__status"};function bt(e,a,n,i,s,f){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(ee.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",pt,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",ft,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(ee.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(ee.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const ke=O(mt,[["render",bt],["__scopeId","data-v-6c492bd9"]]);function ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},gt=de.exports,Be;function yt(){return Be||(Be=1,(function(e,a){(function(n,i){e.exports=i()})(gt,(function(){var n=1e3,i=6e4,s=36e5,f="millisecond",o="second",l="minute",p="hour",r="day",u="week",y="month",_="quarter",C="year",$="date",b="Invalid Date",D=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var m=["th","st","nd","rd"],c=B%100;return"["+B+(m[(c-20)%10]||m[c]||m[0])+"]"}},G=function(B,m,c){var g=String(B);return!g||g.length>=m?B:""+Array(m+1-g.length).join(c)+B},K={s:G,z:function(B){var m=-B.utcOffset(),c=Math.abs(m),g=Math.floor(c/60),d=c%60;return(m<=0?"+":"-")+G(g,2,"0")+":"+G(d,2,"0")},m:function B(m,c){if(m.date()<c.date())return-B(c,m);var g=12*(c.year()-m.year())+(c.month()-m.month()),d=m.clone().add(g,y),V=c-d<0,S=m.clone().add(g+(V?-1:1),y);return+(-(g+(c-d)/(V?d-S:S-d))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:y,y:C,w:u,d:r,D:$,h:p,m:l,s:o,ms:f,Q:_}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},Z="en",X={};X[Z]=E;var te="$isDayjsObject",H=function(B){return B instanceof ne||!(!B||!B[te])},oe=function B(m,c,g){var d;if(!m)return Z;if(typeof m=="string"){var V=m.toLowerCase();X[V]&&(d=V),c&&(X[V]=c,d=V);var S=m.split("-");if(!d&&S.length>1)return B(S[0])}else{var M=m.name;X[M]=m,d=M}return!g&&d&&(Z=d),d||!g&&Z},U=function(B,m){if(H(B))return B.clone();var c=typeof m=="object"?m:{};return c.date=B,c.args=arguments,new ne(c)},w=K;w.l=oe,w.i=H,w.w=function(B,m){return U(B,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var ne=(function(){function B(c){this.$L=oe(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[te]=!0}var m=B.prototype;return m.parse=function(c){this.$d=(function(g){var d=g.date,V=g.utc;if(d===null)return new Date(NaN);if(w.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var S=d.match(D);if(S){var M=S[2]-1||0,I=(S[7]||"0").substring(0,3);return V?new Date(Date.UTC(S[1],M,S[3]||1,S[4]||0,S[5]||0,S[6]||0,I)):new Date(S[1],M,S[3]||1,S[4]||0,S[5]||0,S[6]||0,I)}}return new Date(d)})(c),this.init()},m.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},m.$utils=function(){return w},m.isValid=function(){return this.$d.toString()!==b},m.isSame=function(c,g){var d=U(c);return this.startOf(g)<=d&&d<=this.endOf(g)},m.isAfter=function(c,g){return U(c)<this.startOf(g)},m.isBefore=function(c,g){return this.endOf(g)<U(c)},m.$g=function(c,g,d){return w.u(c)?this[g]:this.set(d,c)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(c,g){var d=this,V=!!w.u(g)||g,S=w.p(c),M=function(N,P){var F=w.w(d.$u?Date.UTC(d.$y,P,N):new Date(d.$y,P,N),d);return V?F:F.endOf(r)},I=function(N,P){return w.w(d.toDate()[N].apply(d.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(P)),d)},z=this.$W,J=this.$M,j=this.$D,h="set"+(this.$u?"UTC":"");switch(S){case C:return V?M(1,0):M(31,11);case y:return V?M(1,J):M(0,J+1);case u:var v=this.$locale().weekStart||0,T=(z<v?z+7:z)-v;return M(V?j-T:j+(6-T),J);case r:case $:return I(h+"Hours",0);case p:return I(h+"Minutes",1);case l:return I(h+"Seconds",2);case o:return I(h+"Milliseconds",3);default:return this.clone()}},m.endOf=function(c){return this.startOf(c,!1)},m.$set=function(c,g){var d,V=w.p(c),S="set"+(this.$u?"UTC":""),M=(d={},d[r]=S+"Date",d[$]=S+"Date",d[y]=S+"Month",d[C]=S+"FullYear",d[p]=S+"Hours",d[l]=S+"Minutes",d[o]=S+"Seconds",d[f]=S+"Milliseconds",d)[V],I=V===r?this.$D+(g-this.$W):g;if(V===y||V===C){var z=this.clone().set($,1);z.$d[M](I),z.init(),this.$d=z.set($,Math.min(this.$D,z.daysInMonth())).$d}else M&&this.$d[M](I);return this.init(),this},m.set=function(c,g){return this.clone().$set(c,g)},m.get=function(c){return this[w.p(c)]()},m.add=function(c,g){var d,V=this;c=Number(c);var S=w.p(g),M=function(J){var j=U(V);return w.w(j.date(j.date()+Math.round(J*c)),V)};if(S===y)return this.set(y,this.$M+c);if(S===C)return this.set(C,this.$y+c);if(S===r)return M(1);if(S===u)return M(7);var I=(d={},d[l]=i,d[p]=s,d[o]=n,d)[S]||1,z=this.$d.getTime()+c*I;return w.w(z,this)},m.subtract=function(c,g){return this.add(-1*c,g)},m.format=function(c){var g=this,d=this.$locale();if(!this.isValid())return d.invalidDate||b;var V=c||"YYYY-MM-DDTHH:mm:ssZ",S=w.z(this),M=this.$H,I=this.$m,z=this.$M,J=d.weekdays,j=d.months,h=d.meridiem,v=function(P,F,R,Y){return P&&(P[F]||P(g,V))||R[F].slice(0,Y)},T=function(P){return w.s(M%12||12,P,"0")},N=h||function(P,F,R){var Y=P<12?"AM":"PM";return R?Y.toLowerCase():Y};return V.replace(k,(function(P,F){return F||(function(R){switch(R){case"YY":return String(g.$y).slice(-2);case"YYYY":return w.s(g.$y,4,"0");case"M":return z+1;case"MM":return w.s(z+1,2,"0");case"MMM":return v(d.monthsShort,z,j,3);case"MMMM":return v(j,z);case"D":return g.$D;case"DD":return w.s(g.$D,2,"0");case"d":return String(g.$W);case"dd":return v(d.weekdaysMin,g.$W,J,2);case"ddd":return v(d.weekdaysShort,g.$W,J,3);case"dddd":return J[g.$W];case"H":return String(M);case"HH":return w.s(M,2,"0");case"h":return T(1);case"hh":return T(2);case"a":return N(M,I,!0);case"A":return N(M,I,!1);case"m":return String(I);case"mm":return w.s(I,2,"0");case"s":return String(g.$s);case"ss":return w.s(g.$s,2,"0");case"SSS":return w.s(g.$ms,3,"0");case"Z":return S}return null})(P)||S.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(c,g,d){var V,S=this,M=w.p(g),I=U(c),z=(I.utcOffset()-this.utcOffset())*i,J=this-I,j=function(){return w.m(S,I)};switch(M){case C:V=j()/12;break;case y:V=j();break;case _:V=j()/3;break;case u:V=(J-z)/6048e5;break;case r:V=(J-z)/864e5;break;case p:V=J/s;break;case l:V=J/i;break;case o:V=J/n;break;default:V=J}return d?V:w.a(V)},m.daysInMonth=function(){return this.endOf(y).$D},m.$locale=function(){return X[this.$L]},m.locale=function(c,g){if(!c)return this.$L;var d=this.clone(),V=oe(c,g,!0);return V&&(d.$L=V),d},m.clone=function(){return w.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},B})(),re=ne.prototype;return U.prototype=re,[["$ms",f],["$s",o],["$m",l],["$H",p],["$W",r],["$M",y],["$y",C],["$D",$]].forEach((function(B){re[B[1]]=function(m){return this.$g(m,B[0],B[1])}})),U.extend=function(B,m){return B.$i||(B(m,ne,U),B.$i=!0),U},U.locale=oe,U.isDayjs=H,U.unix=function(B){return U(1e3*B)},U.en=X[Z],U.Ls=X,U.p={},U}))})(de)),de.exports}var $t=yt();const ue=ht($t),kt=t.defineComponent({name:"EliDataHora",inheritAttrs:!1,props:{modelValue:{type:String,default:null},modo:{type:String,default:"dataHora"},rotulo:{type:String,default:"Data e hora"},placeholder:{type:String,default:""},desabilitado:{type:Boolean,default:!1},limpavel:{type:Boolean,default:!1},erro:{type:Boolean,default:!1},mensagensErro:{type:[String,Array],default:()=>[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:n}){const i=t.computed(()=>e.modo==="data"?"date":"datetime-local");function s(r){return e.modo==="data"?ue(r).format("YYYY-MM-DD"):ue(r).format("YYYY-MM-DDTHH:mm")}function f(r){return e.modo==="data"?ue(`${r}T00:00`).format():ue(r).format()}const o=t.computed({get:()=>e.modelValue?s(e.modelValue):"",set:r=>{const u=r&&r.length>0?r:null;if(!u){a("update:modelValue",null),a("alterar",null);return}const y=f(u);a("update:modelValue",y),a("alterar",y)}}),l=t.computed(()=>{if(e.min)return s(e.min)}),p=t.computed(()=>{if(e.max)return s(e.max)});return{attrs:n,valor:o,emit:a,minLocal:l,maxLocal:p,tipoInput:i}}}),Bt={class:"eli-data-hora"};function Et(e,a,n,i,s,f){return t.openBlock(),t.createElementBlock("div",Bt,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=o=>e.emit("foco")),onBlur:a[2]||(a[2]=o=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const Ee=O(kt,[["render",Et],["__scopeId","data-v-71afabb6"]]);var Ce=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(Ce||{});/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ct=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ve=e=>e==="";/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vt=(...e)=>e.filter((a,n,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===n).join(" ").trim();/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Se=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const St=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vt=e=>{const a=St(e);return a.charAt(0).toUpperCase()+a.slice(1)};/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var le={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Dt=({name:e,iconNode:a,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:s,"stroke-width":f,size:o=le.width,color:l=le.stroke,...p},{slots:r})=>t.h("svg",{...le,...p,width:o,height:o,stroke:l,"stroke-width":Ve(n)||Ve(i)||n===!0||i===!0?Number(s||f||le["stroke-width"])*24/Number(o):s||f||le["stroke-width"],class:Vt("lucide",p.class,...e?[`lucide-${Se(vt(e))}-icon`,`lucide-${Se(e)}`]:["lucide-icon"]),...!r.default&&!Ct(p)&&{"aria-hidden":"true"}},[...a.map(u=>t.h(...u)),...r.default?[r.default()]:[]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ae=(e,a)=>(n,{slots:i,attrs:s})=>t.h(Dt,{...s,...n,iconNode:a,name:e},i);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ve=ae("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const De=ae("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _e=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const we=ae("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _t=ae("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
|
||
* @license lucide-vue-next v0.563.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wt=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Nt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:wt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const n=t.ref(e.modelo??"");t.watch(()=>e.modelo,s=>{s!==void 0&&s!==n.value&&(n.value=s)});function i(){a("buscar",n.value.trim())}return{texto:n,emitirBusca:i}}}),Mt={class:"eli-tabela__busca"},At={class:"eli-tabela__busca-input-wrapper"};function Tt(e,a,n,i,s,f){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",Mt,[t.createElementVNode("div",At,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=l=>e.texto=l),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...l)=>e.emitirBusca&&e.emitirBusca(...l),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...l)=>e.emitirBusca&&e.emitirBusca(...l))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const Pt=O(Nt,[["render",Tt],["__scopeId","data-v-341415d1"]]),It=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:Pt},props:{exibirBusca:{type:Boolean,required:!0},exibirBotaoColunas:{type:Boolean,required:!1,default:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"},colunas(){return!0}},setup(e,{emit:a}){const n=t.computed(()=>e.acoesCabecalho.length>0);function i(f){a("buscar",f)}function s(){a("colunas")}return{temAcoesCabecalho:n,emitBuscar:i,emitColunas:s}}}),Ot={class:"eli-tabela__cabecalho"},qt={key:0,class:"eli-tabela__busca-grupo"},Ft={key:1,class:"eli-tabela__acoes-cabecalho"},Lt=["onClick"],zt={class:"eli-tabela__acoes-cabecalho-rotulo"};function jt(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",Ot,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",qt,[e.exibirBotaoColunas?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__acoes-cabecalho-botao eli-tabela__acoes-cabecalho-botao--colunas",onClick:a[0]||(a[0]=(...l)=>e.emitColunas&&e.emitColunas(...l))}," Colunas ")):t.createCommentVNode("",!0),t.createVNode(o,{modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",Ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(l,p)=>(t.openBlock(),t.createElementBlock("button",{key:`${l.rotulo}-${p}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(l.cor?{backgroundColor:l.cor,color:"#fff"}:void 0),onClick:l.acao},[l.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",zt,t.toDisplayString(l.rotulo),1)],12,Lt))),128))])):t.createCommentVNode("",!0)])}const Ut=O(It,[["render",jt],["__scopeId","data-v-42938cb8"]]),Ht=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),Rt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Yt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Jt={class:"eli-tabela__erro-mensagem"},Gt={key:2,class:"eli-tabela eli-tabela--vazio"};function Wt(e,a,n,i,s,f){return e.carregando?(t.openBlock(),t.createElementBlock("div",Rt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Yt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Jt,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Gt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Zt=O(Ht,[["render",Wt]]),Xt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Kt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Qt(e,a,n,i,s,f){return e.isDev?(t.openBlock(),t.createElementBlock("div",Kt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const xt=O(Xt,[["render",Qt]]),ea=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:De,ArrowDown:ve},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function n(s){return(s==null?void 0:s.coluna_ordem)!==void 0&&(s==null?void 0:s.coluna_ordem)!==null}function i(s){a("alternarOrdenacao",s)}return{ArrowUp:De,ArrowDown:ve,isOrdenavel:n,emitAlternarOrdenacao:i}}}),ta={class:"eli-tabela__thead"},aa={class:"eli-tabela__tr eli-tabela__tr--header"},oa={key:0,class:"eli-tabela__th eli-tabela__th--expander",scope:"col"},na=["onClick"],la={class:"eli-tabela__th-texto"},ra={key:1,class:"eli-tabela__th-label"},ia={key:1,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function sa(e,a,n,i,s,f){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",ta,[t.createElementVNode("tr",aa,[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("th",oa)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(l,p)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${p}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(l)?"eli-tabela__th--ordenavel":void 0]]),scope:"col"},[e.isOrdenavel(l)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(l.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:r=>e.emitAlternarOrdenacao(String(l.coluna_ordem))},[t.createElementVNode("span",la,t.toDisplayString(l.rotulo),1),e.colunaOrdenacao===String(l.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,na)):(t.openBlock(),t.createElementBlock("span",ra,t.toDisplayString(l.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",ia," Ações ")):t.createCommentVNode("",!0)])])}const ca=O(ea,[["render",sa]]),da=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),ua={key:1};function ma(e,a,n,i,s,f){var o,l,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(r=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((l=e.dados)==null?void 0:l.texto),1)):(t.openBlock(),t.createElementBlock("span",ua,t.toDisplayString((p=e.dados)==null?void 0:p.texto),1))}const pa=O(da,[["render",ma],["__scopeId","data-v-7a629ffa"]]),fa=t.defineComponent({name:"EliTabelaCelulaTextoTruncado",props:{dados:{type:Object}},setup({dados:e}){return{dados:e}}}),ba=["title"],ha=["title"];function ga(e,a,n,i,s,f){var o,l,p,r,u;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__texto-truncado eli-tabela__celula-link",title:(l=e.dados)==null?void 0:l.texto,onClick:a[0]||(a[0]=t.withModifiers(y=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((p=e.dados)==null?void 0:p.texto),9,ba)):(t.openBlock(),t.createElementBlock("span",{key:1,class:"eli-tabela__texto-truncado",title:(r=e.dados)==null?void 0:r.texto},t.toDisplayString((u=e.dados)==null?void 0:u.texto),9,ha))}const ya=O(fa,[["render",ga],["__scopeId","data-v-74854889"]]),$a=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),ka={key:1};function Ba(e,a,n,i,s,f){var o,l,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(r=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",",")),1)):(t.openBlock(),t.createElementBlock("span",ka,t.toDisplayString(String((p=e.dados)==null?void 0:p.numero).replace(".",",")),1))}const Ea={textoSimples:pa,textoTruncado:ya,numero:O($a,[["render",Ba],["__scopeId","data-v-e7bac7ff"]])},Ca=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),n=t.computed(()=>e.celula[1]),i=t.computed(()=>Ea[a.value]),s=t.computed(()=>n.value);return{Componente:i,dadosParaComponente:s}}});function Va(e,a,n,i,s,f){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Ne=O(Ca,[["render",Va]]),Sa=t.defineComponent({name:"EliTabelaDetalhesLinha",components:{EliTabelaCelula:Ne},props:{linha:{type:null,required:!0},colunasInvisiveis:{type:Array,required:!0}}}),va={class:"eli-tabela__detalhes"},Da={class:"eli-tabela__detalhe-rotulo"},_a={class:"eli-tabela__detalhe-valor"};function wa(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCelula");return t.openBlock(),t.createElementBlock("div",va,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunasInvisiveis,(l,p)=>(t.openBlock(),t.createElementBlock("div",{key:`det-${p}-${l.rotulo}`,class:"eli-tabela__detalhe"},[t.createElementVNode("div",Da,t.toDisplayString(l.rotulo),1),t.createElementVNode("div",_a,[t.createVNode(o,{celula:l.celula(e.linha)},null,8,["celula"])])]))),128))])}const Na=O(Sa,[["render",wa],["__scopeId","data-v-f1ee8d20"]]),Ma=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Ne,EliTabelaDetalhesLinha:Na,MoreVertical:_t,ChevronRight:we,ChevronDown:_e},props:{colunas:{type:Array,required:!0},colunasInvisiveis:{type:Array,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},linhasExpandidas:{type:Object,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0},toggleMenu:{type:Function,required:!0},alternarLinhaExpandida:{type:Function,required:!0}},setup(){return{ChevronRight:we,ChevronDown:_e}}}),Aa={class:"eli-tabela__tbody"},Ta=["aria-expanded","aria-label","title","onClick"],Pa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],Ia=["colspan"];function Oa(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCelula"),l=t.resolveComponent("MoreVertical"),p=t.resolveComponent("EliTabelaDetalhesLinha");return t.openBlock(),t.createElementBlock("tbody",Aa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(r,u)=>{var y,_,C,$,b,D;return t.openBlock(),t.createElementBlock(t.Fragment,{key:`grp-${u}`},[t.createElementVNode("tr",{class:t.normalizeClass(["eli-tabela__tr",[u%2===1?"eli-tabela__tr--zebra":void 0]])},[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--expander",key:`td-${u}-exp`},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["eli-tabela__expander-botao",[(y=e.linhasExpandidas)!=null&&y[u]?"eli-tabela__expander-botao--ativo":void 0]]),"aria-expanded":(_=e.linhasExpandidas)!=null&&_[u]?"true":"false","aria-label":(C=e.linhasExpandidas)!=null&&C[u]?"Ocultar colunas ocultas":"Mostrar colunas ocultas",title:($=e.linhasExpandidas)!=null&&$[u]?"Ocultar detalhes":"Mostrar detalhes",onClick:t.withModifiers(k=>e.alternarLinhaExpandida(u),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent((b=e.linhasExpandidas)!=null&&b[u]?e.ChevronDown:e.ChevronRight),{class:"eli-tabela__expander-icone",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Ta)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(k,E)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${u}-${E}`,class:"eli-tabela__td"},[t.createVNode(o,{celula:k.celula(r)},null,8,["celula"])]))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${u}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===u?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${u}`,disabled:!e.possuiAcoes(u),"aria-haspopup":"menu","aria-expanded":e.menuAberto===u?"true":"false","aria-controls":e.possuiAcoes(u)?`eli-tabela-acoes-menu-${u}`:void 0,"aria-label":e.possuiAcoes(u)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(u)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(k=>e.toggleMenu(u,k),["stop"])},[t.createVNode(l,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,Pa)],2)])):t.createCommentVNode("",!0)],2),e.temColunasInvisiveis&&((D=e.linhasExpandidas)!=null&&D[u])?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["eli-tabela__tr eli-tabela__tr--detalhes",[u%2===1?"eli-tabela__tr--zebra":void 0]])},[t.createElementVNode("td",{class:"eli-tabela__td eli-tabela__td--detalhes",colspan:(e.temColunasInvisiveis?1:0)+e.colunas.length+(e.temAcoes?1:0)},[t.createVNode(p,{linha:r,colunasInvisiveis:e.colunasInvisiveis},null,8,["linha","colunasInvisiveis"])],8,Ia)],2)):t.createCommentVNode("",!0)],64)}),128))])}const qa=O(Ma,[["render",Oa]]),Fa=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:n}){const i=t.ref(null);n({menuEl:i});const s=t.computed(()=>e.acoes.length>0);function f(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:i,possuiAcoes:s,emitExecutar:f}}}),La=["id","aria-labelledby"],za=["aria-label","title","onClick"],ja={class:"eli-tabela__acoes-item-texto"};function Ua(e,a,n,i,s,f){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(l=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ja,t.toDisplayString(o.acao.rotulo),1)],12,za)]))),128))],12,La)):t.createCommentVNode("",!0)])}const Ha=O(Fa,[["render",Ua]]),Ra=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const n=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),i=t.computed(()=>{const r=e.totalPaginas,u=e.pagina,y=n.value,_=[],C=E=>{_.push({label:String(E),pagina:E,ativo:E===u})},$=()=>{_.push({label:"…",ehEllipsis:!0})};if(r<=y){for(let E=1;E<=r;E+=1)C(E);return _}const b=Math.max(3,y-2);let D=Math.max(2,u-Math.floor(b/2)),k=D+b-1;k>=r&&(k=r-1,D=k-b+1),C(1),D>2&&$();for(let E=D;E<=k;E+=1)C(E);return k<r-1&&$(),C(r),_});function s(r){if(!r)return;const u=Math.min(Math.max(1,r),e.totalPaginas);u!==e.pagina&&a("alterar",u)}const f=t.computed(()=>e.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),l=t.computed(()=>e.pagina),p=t.computed(()=>e.totalPaginas);return{botoes:i,irParaPagina:s,anteriorDesabilitado:f,proximaDesabilitada:o,paginaAtual:l,totalPaginasExibidas:p}}}),Ya={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},Ja=["disabled"],Ga={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Wa=["disabled","aria-current","aria-label","onClick"],Za=["disabled"];function Xa(e,a,n,i,s,f){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Ya,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,Ja),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${l}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",Ga,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:p=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,Wa))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,Za)])):t.createCommentVNode("",!0)}const Ka=O(Ra,[["render",Xa],["__scopeId","data-v-5ca7a362"]]),Me="application/x-eli-tabela-coluna",Qa=t.defineComponent({name:"EliTabelaModalColunas",props:{aberto:{type:Boolean,required:!0},rotulosColunas:{type:Array,required:!0},configInicial:{type:Object,required:!0},colunas:{type:Array,required:!0}},emits:{fechar(){return!0},salvar(e){return!0}},setup(e,{emit:a}){const n=t.ref([]),i=t.ref([]);function s(){var X,te;const $=e.rotulosColunas,b=(((X=e.configInicial.visiveis)==null?void 0:X.length)??0)>0||(((te=e.configInicial.invisiveis)==null?void 0:te.length)??0)>0,D=new Set(e.colunas.filter(H=>H.visivel===!1).map(H=>H.rotulo)),k=b?new Set(e.configInicial.invisiveis??[]):D,E=$.filter(H=>!k.has(H)),G=e.configInicial.visiveis??[],K=new Set(E),Z=[];for(const H of G)K.has(H)&&Z.push(H);for(const H of E)Z.includes(H)||Z.push(H);n.value=Z,i.value=$.filter(H=>k.has(H))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial,e.colunas],()=>{e.aberto&&s()},{deep:!0,immediate:!0});function f(){a("fechar")}function o(){a("salvar",{visiveis:[...n.value],invisiveis:[...i.value]})}function l($,b){var D,k;try{(D=$.dataTransfer)==null||D.setData(Me,JSON.stringify(b)),(k=$.dataTransfer)==null||k.setData("text/plain",b.rotulo),$.dataTransfer.effectAllowed="move"}catch{}}function p($){var b;try{const D=(b=$.dataTransfer)==null?void 0:b.getData(Me);if(!D)return null;const k=JSON.parse(D);return!k||typeof k.rotulo!="string"||k.origem!=="visiveis"&&k.origem!=="invisiveis"?null:k}catch{return null}}function r($){const b=$.origem==="visiveis"?n.value:i.value,D=b.indexOf($.rotulo);D>=0&&b.splice(D,1)}function u($,b,D){const k=$==="visiveis"?n.value:i.value,E=k.indexOf(b);E>=0&&k.splice(E,1),D===null||D<0||D>k.length?k.push(b):k.splice(D,0,b)}function y($,b,D,k){l($,{rotulo:b,origem:D,index:k})}function _($,b,D){const k=p($);if(k)if(r(k),u(b,k.rotulo,D),b==="visiveis"){const E=i.value.indexOf(k.rotulo);E>=0&&i.value.splice(E,1)}else{const E=n.value.indexOf(k.rotulo);E>=0&&n.value.splice(E,1)}}function C($,b,D){const k=p($);if(k)if(r(k),u(b,k.rotulo,null),b==="visiveis"){const E=i.value.indexOf(k.rotulo);E>=0&&i.value.splice(E,1)}else{const E=n.value.indexOf(k.rotulo);E>=0&&n.value.splice(E,1)}}return{visiveisLocal:n,invisiveisLocal:i,emitFechar:f,emitSalvar:o,onDragStart:y,onDropItem:_,onDropLista:C}}}),xa={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},eo={class:"eli-tabela-modal-colunas__header"},to={class:"eli-tabela-modal-colunas__conteudo"},ao={class:"eli-tabela-modal-colunas__coluna"},oo=["onDragstart","onDrop"],no={class:"eli-tabela-modal-colunas__item-texto"},lo={class:"eli-tabela-modal-colunas__coluna"},ro=["onDragstart","onDrop"],io={class:"eli-tabela-modal-colunas__item-texto"},so={class:"eli-tabela-modal-colunas__footer"};function co(e,a,n,i,s,f){return e.aberto?(t.openBlock(),t.createElementBlock("div",{key:0,class:"eli-tabela-modal-colunas__overlay",role:"presentation",onClick:a[9]||(a[9]=t.withModifiers((...o)=>e.emitFechar&&e.emitFechar(...o),["self"]))},[t.createElementVNode("div",xa,[t.createElementVNode("header",eo,[a[10]||(a[10]=t.createElementVNode("h3",{class:"eli-tabela-modal-colunas__titulo"},"Colunas",-1)),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__fechar","aria-label":"Fechar",onClick:a[0]||(a[0]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," × ")]),t.createElementVNode("div",to,[t.createElementVNode("div",ao,[a[12]||(a[12]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Visíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[2]||(a[2]=t.withModifiers(()=>{},["prevent"])),onDrop:a[3]||(a[3]=o=>e.onDropLista(o,"visiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`vis-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"visiveis",l),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"visiveis",l)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",no,t.toDisplayString(o),1)],40,oo))),128))],32)]),t.createElementVNode("div",lo,[a[14]||(a[14]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Invisíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[5]||(a[5]=t.withModifiers(()=>{},["prevent"])),onDrop:a[6]||(a[6]=o=>e.onDropLista(o,"invisiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.invisiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`inv-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"invisiveis",l),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"invisiveis",l)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",io,t.toDisplayString(o),1)],40,ro))),128))],32)])]),t.createElementVNode("footer",so,[t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--sec",onClick:a[7]||(a[7]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," Cancelar "),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--prim",onClick:a[8]||(a[8]=(...o)=>e.emitSalvar&&e.emitSalvar(...o))}," Salvar ")])])])):t.createCommentVNode("",!0)}const uo=O(Qa,[["render",co],["__scopeId","data-v-b8f693ef"]]),mo="eli:tabela";function Ae(e){return`${mo}:${e}:colunas`}function Te(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,n=Array.isArray(a.visiveis)?a.visiveis.filter(s=>typeof s=="string"):[],i=Array.isArray(a.invisiveis)?a.invisiveis.filter(s=>typeof s=="string"):[];return{visiveis:n,invisiveis:i}}function Pe(e){try{const a=window.localStorage.getItem(Ae(e));return a?Te(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function po(e,a){try{window.localStorage.setItem(Ae(e),JSON.stringify(Te(a)))}catch{}}const fo=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ut,EliTabelaEstados:Zt,EliTabelaDebug:xt,EliTabelaHead:ca,EliTabelaBody:qa,EliTabelaMenuAcoes:Ha,EliTabelaPaginacao:Ka,EliTabelaModalColunas:uo},props:{tabela:{type:Object,required:!0}},setup(e){const n=t.ref(!1),i=t.ref(null),s=t.ref([]),f=t.ref(0),o=t.ref([]),l=t.ref(null),p=t.ref(null),r=t.ref({top:0,left:0}),u=t.ref(""),y=t.ref(1),_=t.ref(null),C=t.ref("asc"),$=t.computed(()=>e.tabela),b=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),D=t.computed(()=>e.tabela.acoesTabela??[]),k=t.computed(()=>D.value.length>0),E=t.ref(!1),G=t.ref(Pe(e.tabela.nome)),K=t.ref({}),Z=t.computed(()=>e.tabela.colunas.map(h=>h.rotulo)),X=t.computed(()=>{var W,Q;const h=e.tabela.colunas,T=(((W=G.value.visiveis)==null?void 0:W.length)??0)>0||(((Q=G.value.invisiveis)==null?void 0:Q.length)??0)>0?G.value.invisiveis??[]:h.filter(q=>q.visivel===!1).map(q=>q.rotulo),N=new Set(T),P=h.filter(q=>N.has(q.rotulo)),F=T,R=new Map;for(const q of P)R.has(q.rotulo)||R.set(q.rotulo,q);const Y=[];for(const q of F){const x=R.get(q);x&&Y.push(x)}for(const q of P)Y.includes(q)||Y.push(q);return Y}),te=t.computed(()=>X.value.length>0),H=t.computed(()=>{var q,x;const h=e.tabela.colunas,v=Z.value,T=(((q=G.value.visiveis)==null?void 0:q.length)??0)>0||(((x=G.value.invisiveis)==null?void 0:x.length)??0)>0,N=T?G.value.invisiveis??[]:e.tabela.colunas.filter(L=>L.visivel===!1).map(L=>L.rotulo),P=new Set(N),F=v.filter(L=>!P.has(L)),R=new Set(F),Y=T?G.value.visiveis??[]:[],W=[];for(const L of Y)R.has(L)&&W.push(L);for(const L of F)W.includes(L)||W.push(L);const Q=new Map;for(const L of h)Q.has(L.rotulo)||Q.set(L.rotulo,L);return W.map(L=>Q.get(L)).filter(Boolean)});function oe(){E.value=!0}function U(){E.value=!1}function w(h){G.value=h,po(e.tabela.nome,h),E.value=!1,K.value={}}function ne(h){const v=!!K.value[h];K.value={...K.value,[h]:!v}}const re=t.computed(()=>{const h=e.tabela.registros_por_consulta;return typeof h=="number"&&h>0?Math.floor(h):10}),B=t.computed(()=>{const h=re.value;if(!h||h<=0)return 1;const v=f.value;return v?Math.max(1,Math.ceil(v/h)):1}),m=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let c=0;function g(h){var Y,W,Q,q,x,L;const v=h.getBoundingClientRect(),T=8,N=((Q=(W=(Y=p.value)==null?void 0:Y.menuEl)==null?void 0:W.value)==null?void 0:Q.offsetHeight)??0,P=((L=(x=(q=p.value)==null?void 0:q.menuEl)==null?void 0:x.value)==null?void 0:L.offsetWidth)??180;let F=v.bottom+T;const R=v.right-P;N&&F+N>window.innerHeight-T&&(F=v.top-T-N),r.value={top:Math.max(T,Math.round(F)),left:Math.max(T,Math.round(R))}}function d(h){var T,N;if(l.value===null)return;const v=h.target;(N=(T=p.value)==null?void 0:T.menuEl)!=null&&N.value&&p.value.menuEl.value.contains(v)||(l.value=null)}function V(h){if(h){if(_.value===h){C.value=C.value==="asc"?"desc":"asc",j();return}_.value=h,C.value="asc",y.value!==1?y.value=1:j()}}function S(h){u.value!==h&&(u.value=h,y.value!==1?y.value=1:j())}function M(h){const v=Math.min(Math.max(1,h),B.value);v!==y.value&&(y.value=v)}function I(h){const v=e.tabela.acoesLinha??[],T=o.value[h]??[];return v.map((N,P)=>{const F=N.exibir===void 0?!0:typeof N.exibir=="boolean"?N.exibir:!1;return{acao:N,indice:P,visivel:T[P]??F}}).filter(N=>N.visivel)}function z(h){return I(h).length>0}function J(h,v){if(!z(h))return;if(l.value===h){l.value=null;return}l.value=h;const T=(v==null?void 0:v.currentTarget)??null;T&&(g(T),requestAnimationFrame(()=>g(T)))}async function j(){var P,F;const h=++c;n.value=!0,i.value=null,o.value=[],l.value=null,K.value={};const v=Math.max(1,re.value),N={offSet:(y.value-1)*v,limit:v};u.value&&(N.texto_busca=u.value),_.value&&(N.coluna_ordem=_.value,N.direcao_ordem=C.value);try{const R=e.tabela,Y=await R.consulta(N);if(h!==c)return;if(Y.cod!==Ce.sucesso){s.value=[],f.value=0,i.value=Y.mensagem;return}const W=((P=Y.valor)==null?void 0:P.valores)??[],Q=((F=Y.valor)==null?void 0:F.quantidade)??W.length;s.value=W,f.value=Q;const q=Math.max(1,Math.ceil((Q||0)/v));if(y.value>q){y.value=q;return}const x=R.acoesLinha??[];if(!x.length){o.value=[];return}const L=W.map(()=>x.map(ie=>ie.exibir===void 0?!0:typeof ie.exibir=="boolean"?ie.exibir:!1));o.value=L;const No=await Promise.all(W.map(async ie=>Promise.all(x.map(async me=>{if(me.exibir===void 0)return!0;if(typeof me.exibir=="boolean")return me.exibir;try{const Mo=me.exibir(ie);return!!await Promise.resolve(Mo)}catch{return!1}}))));h===c&&(o.value=No)}catch(R){if(h!==c)return;s.value=[],f.value=0,i.value=R instanceof Error?R.message:"Erro ao carregar dados."}finally{h===c&&(n.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",d),j()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",d)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,h=>{!h&&u.value&&(u.value="",y.value!==1?y.value=1:j())}),t.watch(y,(h,v)=>{h!==v&&j()}),t.watch(()=>e.tabela,()=>{l.value=null,_.value=null,C.value="asc",u.value="",E.value=!1,G.value=Pe(e.tabela.nome),K.value={},y.value!==1?y.value=1:j()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{y.value!==1?y.value=1:j()}),t.watch(s,()=>{l.value=null,K.value={}}),{isDev:!1,tabela:$,carregando:n,erro:i,linhas:s,quantidade:f,menuAberto:l,valorBusca:u,paginaAtual:y,colunaOrdenacao:_,direcaoOrdenacao:C,totalPaginas:B,exibirBusca:b,acoesCabecalho:D,temAcoesCabecalho:k,temAcoes:m,colunasEfetivas:H,rotulosColunas:Z,modalColunasAberto:E,configColunas:G,temColunasInvisiveis:te,colunasInvisiveisEfetivas:X,linhasExpandidas:K,abrirModalColunas:oe,fecharModalColunas:U,salvarModalColunas:w,alternarLinhaExpandida:ne,alternarOrdenacao:V,atualizarBusca:S,irParaPagina:M,acoesDisponiveisPorLinha:I,possuiAcoes:z,toggleMenu:J,menuPopup:p,menuPopupPos:r}}}),bo={class:"eli-tabela"},ho={class:"eli-tabela__table"};function go(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaDebug"),l=t.resolveComponent("EliTabelaEstados"),p=t.resolveComponent("EliTabelaCabecalho"),r=t.resolveComponent("EliTabelaModalColunas"),u=t.resolveComponent("EliTabelaHead"),y=t.resolveComponent("EliTabelaBody"),_=t.resolveComponent("EliTabelaMenuAcoes"),C=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",bo,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(l,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(p,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca,onColunas:e.abrirModalColunas},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar","onColunas"])):t.createCommentVNode("",!0),t.createVNode(r,{aberto:e.modalColunasAberto,rotulosColunas:e.rotulosColunas,configInicial:e.configColunas,colunas:e.tabela.colunas,onFechar:e.fecharModalColunas,onSalvar:e.salvarModalColunas},null,8,["aberto","rotulosColunas","configInicial","colunas","onFechar","onSalvar"]),t.createElementVNode("table",ho,[t.createVNode(u,{colunas:e.colunasEfetivas,temAcoes:e.temAcoes,temColunasInvisiveis:e.temColunasInvisiveis,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","temColunasInvisiveis","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(y,{colunas:e.colunasEfetivas,colunasInvisiveis:e.colunasInvisiveisEfetivas,temColunasInvisiveis:e.temColunasInvisiveis,linhasExpandidas:e.linhasExpandidas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu,alternarLinhaExpandida:e.alternarLinhaExpandida},null,8,["colunas","colunasInvisiveis","temColunasInvisiveis","linhasExpandidas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu","alternarLinhaExpandida"])]),t.createVNode(_,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:$,linha:b})=>{e.menuAberto=null,$.acao(b)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(C,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const Ie=O(fo,[["render",go]]),yo=t.defineComponent({name:"EliEntradaTexto",inheritAttrs:!1,props:{value:{type:[String,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const i=t.computed({get:()=>e.value,set:s=>{n("update:value",s),n("input",s),n("change",s)}});return{attrs:a,emit:n,localValue:i}}});function $o(e,a,n,i,s,f){var o,l,p,r;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({modelValue:e.localValue,"onUpdate:modelValue":a[0]||(a[0]=u=>e.localValue=u),label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,counter:(p=e.opcoes)==null?void 0:p.limiteCaracteres,maxlength:(r=e.opcoes)==null?void 0:r.limiteCaracteres},e.attrs,{onFocus:a[1]||(a[1]=()=>e.emit("focus")),onBlur:a[2]||(a[2]=()=>e.emit("blur"))}),null,16,["modelValue","label","placeholder","counter","maxlength"])}const Oe=O(yo,[["render",$o]]);function ko(e){if(!Number.isFinite(e)||e<=0||e>=1)return 0;const a=e.toString();if(a.includes("e-")){const[,s]=a.split("e-"),f=Number(s);return Number.isFinite(f)?f:0}const n=a.indexOf(".");return n===-1?0:a.slice(n+1).replace(/0+$/,"").length}function Bo(e){const a=(e??"").trim().replace(/,/g,".");if(!a)return null;const n=Number(a);return Number.isNaN(n)?null:n}function he(e,a){return e==null?"":a===null?String(e):Number(e).toFixed(Math.max(0,a)).replace(/\./g,",")}function qe(e){return(e??"").replace(/\D+/g,"")}function Eo(e){const a=(e??"").replace(/[^0-9.,]+/g,""),n=a.match(/[.,]/);if(!n)return a;const i=n[0],s=a.indexOf(i),f=a.slice(0,s).replace(/[.,]/g,""),o=a.slice(s+1).replace(/[.,]/g,"");return`${f.length?f:"0"}${i}${o}`}function Co(e,a){if(a===null)return e;if(a<=0)return e.replace(/[.,]/g,"");const n=e.match(/[.,]/);if(!n)return e;const i=n[0],s=e.indexOf(i),f=e.slice(0,s),o=e.slice(s+1);return`${f}${i}${o.slice(0,a)}`}function Vo(e){const a=e.match(/^(\d+)[.,]$/);if(!a)return null;const n=Number(a[1]);return Number.isNaN(n)?null:n}const So=t.defineComponent({name:"EliEntradaNumero",inheritAttrs:!1,props:{value:{type:[Number,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const i=t.computed(()=>{var u;const r=(u=e.opcoes)==null?void 0:u.precisao;return r==null?null:ko(r)}),s=t.computed(()=>i.value===0),f=t.computed(()=>{const r=i.value;return r!==null&&r>0}),o=t.ref(""),l=t.ref(void 0);t.watch(()=>e.value,r=>{r!==l.value&&(o.value=he(r,i.value),l.value=r)},{immediate:!0});function p(r){if(f.value){const C=i.value??0,$=qe(r),b=$?Number($):0,D=Math.pow(10,C),k=$?b/D:null,E=k===null?null:k;l.value=E,n("update:value",E),n("input",E),n("change",E),o.value=he(E,C);return}const u=s.value?qe(r):Eo(r),y=s.value?u:Co(u,i.value);let _=null;if(y){const $=(s.value?null:Vo(y))??Bo(y);_=$===null?null:$}l.value=_,n("update:value",_),n("input",_),n("change",_),o.value=he(_,i.value)}return{attrs:a,emit:n,displayValue:o,isInteiro:s,onUpdateModelValue:p}}}),vo={class:"eli-entrada__prefixo"},Do={class:"eli-entrada__sufixo"};function _o(e,a,n,i,s,f){var o,l,p,r;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({"model-value":e.displayValue,label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,type:e.isInteiro?"number":"text",inputmode:e.isInteiro?"numeric":"decimal",pattern:e.isInteiro?"[0-9]*":"[0-9.,]*"},e.attrs,{"onUpdate:modelValue":e.onUpdateModelValue,onFocus:a[0]||(a[0]=()=>e.emit("focus")),onBlur:a[1]||(a[1]=()=>e.emit("blur"))}),t.createSlots({_:2},[(p=e.opcoes)!=null&&p.prefixo?{name:"prepend-inner",fn:t.withCtx(()=>[t.createElementVNode("span",vo,t.toDisplayString(e.opcoes.prefixo),1)]),key:"0"}:void 0,(r=e.opcoes)!=null&&r.sufixo?{name:"append-inner",fn:t.withCtx(()=>[t.createElementVNode("span",Do,t.toDisplayString(e.opcoes.sufixo),1)]),key:"1"}:void 0]),1040,["model-value","label","placeholder","type","inputmode","pattern","onUpdate:modelValue"])}const Fe=O(So,[["render",_o],["__scopeId","data-v-77cbf216"]]),wo={install(e){e.component("EliOlaMundo",$e),e.component("EliBotao",pe),e.component("EliBadge",ce),e.component("EliInput",be),e.component("EliCartao",ke),e.component("EliDataHora",Ee),e.component("EliTabela",Ie),e.component("EliEntradaTexto",Oe),e.component("EliEntradaNumero",Fe)}};A.EliBadge=ce,A.EliBotao=pe,A.EliCartao=ke,A.EliDataHora=Ee,A.EliEntradaNumero=Fe,A.EliEntradaTexto=Oe,A.EliInput=be,A.EliOlaMundo=$e,A.EliTabela=Ie,A.default=wo,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|