vue-componentes/dist/eli-vue.umd.js
2026-01-29 10:51:13 -03:00

76 lines
66 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(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[r,s]of a)n[r]=s;return n};function Ze(e,a,n,r,s,b){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),r=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:n,badgeStyle:r}}});function Ke(e,a,n,r,s,b){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 r=t.ref(!1),s=t.ref(!1),b=t.computed({get:()=>e.modelValue,set:B=>{a("update:modelValue",B),a("change",B)}}),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"),f=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),i=t.computed(()=>e.error?"error":r.value?e.color:void 0);function m(B){const $=B.target;let d=$.value;switch(e.type){case"numericoInteiro":d=fe(d);break;case"numericoDecimal":d=ye(d);break;case"numericoMoeda":d=ot(d);break;case"porcentagem":d=at(d);break;case"telefone":d=tt(d);break;case"cpfCnpj":d=xe(d);break;case"cep":d=nt(d);break}$.value=d,a("update:modelValue",d),a("change",d)}function k(){s.value=!s.value}const D=t.computed(()=>(e.options||[]).map(B=>{if(B&&typeof B=="object"&&"value"in B){const d=B.value;return{label:B.label??String(d),value:d,disabled:B.disabled}}const $=B;return{label:String($),value:$}}));return{attrs:n,value:b,isTextLike:o,inputHtmlType:l,inputMode:f,internalColor:i,showPassword:s,togglePassword:k,onInput:m,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:D}}}),rt={class:"eli-input"},it={key:4,class:"checkbox-group"};function st(e,a,n,r,s,b){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(""),r=t.ref(""),s=t.ref(""),b=t.ref(""),o=t.ref(""),l=t.ref(""),f=t.ref(""),i=t.ref(""),m=t.ref(""),k=t.ref(null),D=t.ref([]);return{nome:e,email:l,documento:m,estado:a,telefone:r,mensagem:f,senha:i,cor:k,habilidades:D,idade:s,altura:b,cep:n,valor:o}}}),dt={class:"grid-example"};function ut(e,a,n,r,s,b){const o=t.resolveComponent("EliBadge"),l=t.resolveComponent("EliInput"),f=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]=i=>e.nome=i),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=i=>e.idade=i),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=i=>e.altura=i),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=i=>e.valor=i),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=i=>e.telefone=i),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=i=>e.cep=i),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]=i=>e.estado=i),multiple:""},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=i=>e.documento=i),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=i=>e.email=i),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=i=>e.senha=i),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]=i=>e.mensagem=i),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(l,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=i=>e.cor=i),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]=i=>e.habilidades=i),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=i=>e.nome=i),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(ee.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(f,{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),r=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 b(){a("clicar",e.status)}return{rotuloStatus:n,corStatus:r,classeStatus:s,onClick:b}}}),pt={class:"eli-cartao__titulo-texto"},ft={class:"eli-cartao__status"};function bt(e,a,n,r,s,b){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"]]);var Ee=(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))(Ee||{});/**
* @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 ht=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 Be=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 gt=(...e)=>e.filter((a,n,r)=>!!a&&a.trim()!==""&&r.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 Ce=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 yt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,r)=>r?r.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 $t=e=>{const a=yt(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 kt=({name:e,iconNode:a,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":b,size:o=le.width,color:l=le.stroke,...f},{slots:i})=>t.h("svg",{...le,...f,width:o,height:o,stroke:l,"stroke-width":Be(n)||Be(r)||n===!0||r===!0?Number(s||b||le["stroke-width"])*24/Number(o):s||b||le["stroke-width"],class:gt("lucide",f.class,...e?[`lucide-${Ce($t(e))}-icon`,`lucide-${Ce(e)}`]:["lucide-icon"]),...!i.default&&!ht(f)&&{"aria-hidden":"true"}},[...a.map(m=>t.h(...m)),...i.default?[i.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:r,attrs:s})=>t.h(kt,{...s,...n,iconNode:a,name:e},r);/**
* @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 ve=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 Se=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 _e=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 Et=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 Bt=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ct=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:Bt},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 r(){a("buscar",n.value.trim())}return{texto:n,emitirBusca:r}}}),Vt={class:"eli-tabela__busca"},vt={class:"eli-tabela__busca-input-wrapper"};function St(e,a,n,r,s,b){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",Vt,[t.createElementVNode("div",vt,[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 _t=O(Ct,[["render",St],["__scopeId","data-v-341415d1"]]),Dt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:_t},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 r(b){a("buscar",b)}function s(){a("colunas")}return{temAcoesCabecalho:n,emitBuscar:r,emitColunas:s}}}),wt={class:"eli-tabela__cabecalho"},Nt={key:0,class:"eli-tabela__busca-grupo"},Mt={key:1,class:"eli-tabela__acoes-cabecalho"},At=["onClick"],Tt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Pt(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",wt,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",Nt,[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",Mt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(l,f)=>(t.openBlock(),t.createElementBlock("button",{key:`${l.rotulo}-${f}`,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",Tt,t.toDisplayString(l.rotulo),1)],12,At))),128))])):t.createCommentVNode("",!0)])}const It=O(Dt,[["render",Pt],["__scopeId","data-v-42938cb8"]]),Ot=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),qt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Ft={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Lt={class:"eli-tabela__erro-mensagem"},zt={key:2,class:"eli-tabela eli-tabela--vazio"};function jt(e,a,n,r,s,b){return e.carregando?(t.openBlock(),t.createElementBlock("div",qt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Ft,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Lt,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",zt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Ut=O(Ot,[["render",jt]]),Ht=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Rt={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 Yt(e,a,n,r,s,b){return e.isDev?(t.openBlock(),t.createElementBlock("div",Rt,[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 Jt=O(Ht,[["render",Yt]]),Gt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:ve,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 r(s){a("alternarOrdenacao",s)}return{ArrowUp:ve,ArrowDown:Ve,isOrdenavel:n,emitAlternarOrdenacao:r}}}),Wt={class:"eli-tabela__thead"},Zt={class:"eli-tabela__tr eli-tabela__tr--header"},Xt={key:0,class:"eli-tabela__th eli-tabela__th--expander",scope:"col"},Kt=["onClick"],Qt={class:"eli-tabela__th-texto"},xt={key:1,class:"eli-tabela__th-label"},ea={key:1,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function ta(e,a,n,r,s,b){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",Wt,[t.createElementVNode("tr",Zt,[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("th",Xt)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(l,f)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${f}`,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:i=>e.emitAlternarOrdenacao(String(l.coluna_ordem))},[t.createElementVNode("span",Qt,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,Kt)):(t.openBlock(),t.createElementBlock("span",xt,t.toDisplayString(l.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",ea," Ações ")):t.createCommentVNode("",!0)])])}const aa=O(Gt,[["render",ta]]),oa=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),na={key:1};function la(e,a,n,r,s,b){var o,l,f;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(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((l=e.dados)==null?void 0:l.texto),1)):(t.openBlock(),t.createElementBlock("span",na,t.toDisplayString((f=e.dados)==null?void 0:f.texto),1))}const ra=O(oa,[["render",la],["__scopeId","data-v-7a629ffa"]]),ia=t.defineComponent({name:"EliTabelaCelulaTextoTruncado",props:{dados:{type:Object}},setup({dados:e}){return{dados:e}}}),sa=["title"],ca=["title"];function da(e,a,n,r,s,b){var o,l,f,i,m;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(k=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((f=e.dados)==null?void 0:f.texto),9,sa)):(t.openBlock(),t.createElementBlock("span",{key:1,class:"eli-tabela__texto-truncado",title:(i=e.dados)==null?void 0:i.texto},t.toDisplayString((m=e.dados)==null?void 0:m.texto),9,ca))}const ua=O(ia,[["render",da],["__scopeId","data-v-74854889"]]),ma=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),pa={key:1};function fa(e,a,n,r,s,b){var o,l,f;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(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",",")),1)):(t.openBlock(),t.createElementBlock("span",pa,t.toDisplayString(String((f=e.dados)==null?void 0:f.numero).replace(".",",")),1))}const ba={textoSimples:ra,textoTruncado:ua,numero:O(ma,[["render",fa],["__scopeId","data-v-e7bac7ff"]])},ha=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]),r=t.computed(()=>ba[a.value]),s=t.computed(()=>n.value);return{Componente:r,dadosParaComponente:s}}});function ga(e,a,n,r,s,b){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const De=O(ha,[["render",ga]]),ya=t.defineComponent({name:"EliTabelaDetalhesLinha",components:{EliTabelaCelula:De},props:{linha:{type:null,required:!0},colunasInvisiveis:{type:Array,required:!0}}}),$a={class:"eli-tabela__detalhes"},ka={class:"eli-tabela__detalhe-rotulo"},Ea={class:"eli-tabela__detalhe-valor"};function Ba(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCelula");return t.openBlock(),t.createElementBlock("div",$a,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunasInvisiveis,(l,f)=>(t.openBlock(),t.createElementBlock("div",{key:`det-${f}-${l.rotulo}`,class:"eli-tabela__detalhe"},[t.createElementVNode("div",ka,t.toDisplayString(l.rotulo),1),t.createElementVNode("div",Ea,[t.createVNode(o,{celula:l.celula(e.linha)},null,8,["celula"])])]))),128))])}const Ca=O(ya,[["render",Ba],["__scopeId","data-v-f1ee8d20"]]),Va=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:De,EliTabelaDetalhesLinha:Ca,MoreVertical:Et,ChevronRight:_e,ChevronDown:Se},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:_e,ChevronDown:Se}}}),va={class:"eli-tabela__tbody"},Sa=["aria-expanded","aria-label","title","onClick"],_a=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],Da=["colspan"];function wa(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCelula"),l=t.resolveComponent("MoreVertical"),f=t.resolveComponent("EliTabelaDetalhesLinha");return t.openBlock(),t.createElementBlock("tbody",va,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(i,m)=>{var k,D,B,$,d,S;return t.openBlock(),t.createElementBlock(t.Fragment,{key:`grp-${m}`},[t.createElementVNode("tr",{class:t.normalizeClass(["eli-tabela__tr",[m%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-${m}-exp`},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["eli-tabela__expander-botao",[(k=e.linhasExpandidas)!=null&&k[m]?"eli-tabela__expander-botao--ativo":void 0]]),"aria-expanded":(D=e.linhasExpandidas)!=null&&D[m]?"true":"false","aria-label":(B=e.linhasExpandidas)!=null&&B[m]?"Ocultar colunas ocultas":"Mostrar colunas ocultas",title:($=e.linhasExpandidas)!=null&&$[m]?"Ocultar detalhes":"Mostrar detalhes",onClick:t.withModifiers(y=>e.alternarLinhaExpandida(m),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent((d=e.linhasExpandidas)!=null&&d[m]?e.ChevronDown:e.ChevronRight),{class:"eli-tabela__expander-icone",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Sa)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(y,C)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${m}-${C}`,class:"eli-tabela__td"},[t.createVNode(o,{celula:y.celula(i)},null,8,["celula"])]))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${m}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===m?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${m}`,disabled:!e.possuiAcoes(m),"aria-haspopup":"menu","aria-expanded":e.menuAberto===m?"true":"false","aria-controls":e.possuiAcoes(m)?`eli-tabela-acoes-menu-${m}`:void 0,"aria-label":e.possuiAcoes(m)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(m)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(y=>e.toggleMenu(m,y),["stop"])},[t.createVNode(l,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,_a)],2)])):t.createCommentVNode("",!0)],2),e.temColunasInvisiveis&&((S=e.linhasExpandidas)!=null&&S[m])?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["eli-tabela__tr eli-tabela__tr--detalhes",[m%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(f,{linha:i,colunasInvisiveis:e.colunasInvisiveis},null,8,["linha","colunasInvisiveis"])],8,Da)],2)):t.createCommentVNode("",!0)],64)}),128))])}const Na=O(Va,[["render",wa]]),Ma=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 r=t.ref(null);n({menuEl:r});const s=t.computed(()=>e.acoes.length>0);function b(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:r,possuiAcoes:s,emitExecutar:b}}}),Aa=["id","aria-labelledby"],Ta=["aria-label","title","onClick"],Pa={class:"eli-tabela__acoes-item-texto"};function Ia(e,a,n,r,s,b){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",Pa,t.toDisplayString(o.acao.rotulo),1)],12,Ta)]))),128))],12,Aa)):t.createCommentVNode("",!0)])}const Oa=O(Ma,[["render",Ia]]),qa=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 i=e.maximoBotoes;return typeof i=="number"&&i>=5?Math.floor(i):7}),r=t.computed(()=>{const i=e.totalPaginas,m=e.pagina,k=n.value,D=[],B=C=>{D.push({label:String(C),pagina:C,ativo:C===m})},$=()=>{D.push({label:"…",ehEllipsis:!0})};if(i<=k){for(let C=1;C<=i;C+=1)B(C);return D}const d=Math.max(3,k-2);let S=Math.max(2,m-Math.floor(d/2)),y=S+d-1;y>=i&&(y=i-1,S=y-d+1),B(1),S>2&&$();for(let C=S;C<=y;C+=1)B(C);return y<i-1&&$(),B(i),D});function s(i){if(!i)return;const m=Math.min(Math.max(1,i),e.totalPaginas);m!==e.pagina&&a("alterar",m)}const b=t.computed(()=>e.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),l=t.computed(()=>e.pagina),f=t.computed(()=>e.totalPaginas);return{botoes:r,irParaPagina:s,anteriorDesabilitado:b,proximaDesabilitada:o,paginaAtual:l,totalPaginasExibidas:f}}}),Fa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},La=["disabled"],za={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ja=["disabled","aria-current","aria-label","onClick"],Ua=["disabled"];function Ha(e,a,n,r,s,b){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Fa,[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,La),(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",za,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:f=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,ja))],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,Ua)])):t.createCommentVNode("",!0)}const Ra=O(qa,[["render",Ha],["__scopeId","data-v-5ca7a362"]]),we="application/x-eli-tabela-coluna",Ya=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([]),r=t.ref([]);function s(){var X,te;const $=e.rotulosColunas,d=(((X=e.configInicial.visiveis)==null?void 0:X.length)??0)>0||(((te=e.configInicial.invisiveis)==null?void 0:te.length)??0)>0,S=new Set(e.colunas.filter(H=>H.visivel===!1).map(H=>H.rotulo)),y=d?new Set(e.configInicial.invisiveis??[]):S,C=$.filter(H=>!y.has(H)),G=e.configInicial.visiveis??[],K=new Set(C),Z=[];for(const H of G)K.has(H)&&Z.push(H);for(const H of C)Z.includes(H)||Z.push(H);n.value=Z,r.value=$.filter(H=>y.has(H))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial,e.colunas],()=>{e.aberto&&s()},{deep:!0,immediate:!0});function b(){a("fechar")}function o(){a("salvar",{visiveis:[...n.value],invisiveis:[...r.value]})}function l($,d){var S,y;try{(S=$.dataTransfer)==null||S.setData(we,JSON.stringify(d)),(y=$.dataTransfer)==null||y.setData("text/plain",d.rotulo),$.dataTransfer.effectAllowed="move"}catch{}}function f($){var d;try{const S=(d=$.dataTransfer)==null?void 0:d.getData(we);if(!S)return null;const y=JSON.parse(S);return!y||typeof y.rotulo!="string"||y.origem!=="visiveis"&&y.origem!=="invisiveis"?null:y}catch{return null}}function i($){const d=$.origem==="visiveis"?n.value:r.value,S=d.indexOf($.rotulo);S>=0&&d.splice(S,1)}function m($,d,S){const y=$==="visiveis"?n.value:r.value,C=y.indexOf(d);C>=0&&y.splice(C,1),S===null||S<0||S>y.length?y.push(d):y.splice(S,0,d)}function k($,d,S,y){l($,{rotulo:d,origem:S,index:y})}function D($,d,S){const y=f($);if(y)if(i(y),m(d,y.rotulo,S),d==="visiveis"){const C=r.value.indexOf(y.rotulo);C>=0&&r.value.splice(C,1)}else{const C=n.value.indexOf(y.rotulo);C>=0&&n.value.splice(C,1)}}function B($,d,S){const y=f($);if(y)if(i(y),m(d,y.rotulo,null),d==="visiveis"){const C=r.value.indexOf(y.rotulo);C>=0&&r.value.splice(C,1)}else{const C=n.value.indexOf(y.rotulo);C>=0&&n.value.splice(C,1)}}return{visiveisLocal:n,invisiveisLocal:r,emitFechar:b,emitSalvar:o,onDragStart:k,onDropItem:D,onDropLista:B}}}),Ja={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},Ga={class:"eli-tabela-modal-colunas__header"},Wa={class:"eli-tabela-modal-colunas__conteudo"},Za={class:"eli-tabela-modal-colunas__coluna"},Xa=["onDragstart","onDrop"],Ka={class:"eli-tabela-modal-colunas__item-texto"},Qa={class:"eli-tabela-modal-colunas__coluna"},xa=["onDragstart","onDrop"],eo={class:"eli-tabela-modal-colunas__item-texto"},to={class:"eli-tabela-modal-colunas__footer"};function ao(e,a,n,r,s,b){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",Ja,[t.createElementVNode("header",Ga,[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",Wa,[t.createElementVNode("div",Za,[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:f=>e.onDragStart(f,o,"visiveis",l),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:f=>e.onDropItem(f,"visiveis",l)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",Ka,t.toDisplayString(o),1)],40,Xa))),128))],32)]),t.createElementVNode("div",Qa,[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:f=>e.onDragStart(f,o,"invisiveis",l),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:f=>e.onDropItem(f,"invisiveis",l)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",eo,t.toDisplayString(o),1)],40,xa))),128))],32)])]),t.createElementVNode("footer",to,[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 oo=O(Ya,[["render",ao],["__scopeId","data-v-b8f693ef"]]),no="eli:tabela";function Ne(e){return`${no}:${e}:colunas`}function Me(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,n=Array.isArray(a.visiveis)?a.visiveis.filter(s=>typeof s=="string"):[],r=Array.isArray(a.invisiveis)?a.invisiveis.filter(s=>typeof s=="string"):[];return{visiveis:n,invisiveis:r}}function Ae(e){try{const a=window.localStorage.getItem(Ne(e));return a?Me(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function lo(e,a){try{window.localStorage.setItem(Ne(e),JSON.stringify(Me(a)))}catch{}}const ro=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:It,EliTabelaEstados:Ut,EliTabelaDebug:Jt,EliTabelaHead:aa,EliTabelaBody:Na,EliTabelaMenuAcoes:Oa,EliTabelaPaginacao:Ra,EliTabelaModalColunas:oo},props:{tabela:{type:Object,required:!0}},setup(e){const n=t.ref(!1),r=t.ref(null),s=t.ref([]),b=t.ref(0),o=t.ref([]),l=t.ref(null),f=t.ref(null),i=t.ref({top:0,left:0}),m=t.ref(""),k=t.ref(1),D=t.ref(null),B=t.ref("asc"),$=t.computed(()=>e.tabela),d=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),S=t.computed(()=>e.tabela.acoesTabela??[]),y=t.computed(()=>S.value.length>0),C=t.ref(!1),G=t.ref(Ae(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,_=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=_.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(){C.value=!0}function U(){C.value=!1}function w(h){G.value=h,lo(e.tabela.nome,h),C.value=!1,K.value={}}function ne(h){const _=!!K.value[h];K.value={...K.value,[h]:!_}}const re=t.computed(()=>{const h=e.tabela.registros_por_consulta;return typeof h=="number"&&h>0?Math.floor(h):10}),E=t.computed(()=>{const h=re.value;if(!h||h<=0)return 1;const _=b.value;return _?Math.max(1,Math.ceil(_/h)):1}),p=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let c=0;function g(h){var Y,W,Q,q,x,L;const _=h.getBoundingClientRect(),T=8,N=((Q=(W=(Y=f.value)==null?void 0:Y.menuEl)==null?void 0:W.value)==null?void 0:Q.offsetHeight)??0,P=((L=(x=(q=f.value)==null?void 0:q.menuEl)==null?void 0:x.value)==null?void 0:L.offsetWidth)??180;let F=_.bottom+T;const R=_.right-P;N&&F+N>window.innerHeight-T&&(F=_.top-T-N),i.value={top:Math.max(T,Math.round(F)),left:Math.max(T,Math.round(R))}}function u(h){var T,N;if(l.value===null)return;const _=h.target;(N=(T=f.value)==null?void 0:T.menuEl)!=null&&N.value&&f.value.menuEl.value.contains(_)||(l.value=null)}function V(h){if(h){if(D.value===h){B.value=B.value==="asc"?"desc":"asc",j();return}D.value=h,B.value="asc",k.value!==1?k.value=1:j()}}function v(h){m.value!==h&&(m.value=h,k.value!==1?k.value=1:j())}function M(h){const _=Math.min(Math.max(1,h),E.value);_!==k.value&&(k.value=_)}function I(h){const _=e.tabela.acoesLinha??[],T=o.value[h]??[];return _.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,_){if(!z(h))return;if(l.value===h){l.value=null;return}l.value=h;const T=(_==null?void 0:_.currentTarget)??null;T&&(g(T),requestAnimationFrame(()=>g(T)))}async function j(){var P,F;const h=++c;n.value=!0,r.value=null,o.value=[],l.value=null,K.value={};const _=Math.max(1,re.value),N={offSet:(k.value-1)*_,limit:_};m.value&&(N.texto_busca=m.value),D.value&&(N.coluna_ordem=D.value,N.direcao_ordem=B.value);try{const R=e.tabela,Y=await R.consulta(N);if(h!==c)return;if(Y.cod!==Ee.sucesso){s.value=[],b.value=0,r.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,b.value=Q;const q=Math.max(1,Math.ceil((Q||0)/_));if(k.value>q){k.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=[],b.value=0,r.value=R instanceof Error?R.message:"Erro ao carregar dados."}finally{h===c&&(n.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",u),j()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",u)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,h=>{!h&&m.value&&(m.value="",k.value!==1?k.value=1:j())}),t.watch(k,(h,_)=>{h!==_&&j()}),t.watch(()=>e.tabela,()=>{l.value=null,D.value=null,B.value="asc",m.value="",C.value=!1,G.value=Ae(e.tabela.nome),K.value={},k.value!==1?k.value=1:j()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{k.value!==1?k.value=1:j()}),t.watch(s,()=>{l.value=null,K.value={}}),{isDev:!1,tabela:$,carregando:n,erro:r,linhas:s,quantidade:b,menuAberto:l,valorBusca:m,paginaAtual:k,colunaOrdenacao:D,direcaoOrdenacao:B,totalPaginas:E,exibirBusca:d,acoesCabecalho:S,temAcoesCabecalho:y,temAcoes:p,colunasEfetivas:H,rotulosColunas:Z,modalColunasAberto:C,configColunas:G,temColunasInvisiveis:te,colunasInvisiveisEfetivas:X,linhasExpandidas:K,abrirModalColunas:oe,fecharModalColunas:U,salvarModalColunas:w,alternarLinhaExpandida:ne,alternarOrdenacao:V,atualizarBusca:v,irParaPagina:M,acoesDisponiveisPorLinha:I,possuiAcoes:z,toggleMenu:J,menuPopup:f,menuPopupPos:i}}}),io={class:"eli-tabela"},so={class:"eli-tabela__table"};function co(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaDebug"),l=t.resolveComponent("EliTabelaEstados"),f=t.resolveComponent("EliTabelaCabecalho"),i=t.resolveComponent("EliTabelaModalColunas"),m=t.resolveComponent("EliTabelaHead"),k=t.resolveComponent("EliTabelaBody"),D=t.resolveComponent("EliTabelaMenuAcoes"),B=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",io,[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(f,{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(i,{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",so,[t.createVNode(m,{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(k,{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(D,{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:d})=>{e.menuAberto=null,$.acao(d)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(B,{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 Te=O(ro,[["render",co]]),uo=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 r=t.computed({get:()=>e.value,set:s=>{n("update:value",s),n("input",s),n("change",s)}});return{attrs:a,emit:n,localValue:r}}});function mo(e,a,n,r,s,b){var o,l,f,i;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({modelValue:e.localValue,"onUpdate:modelValue":a[0]||(a[0]=m=>e.localValue=m),label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,counter:(f=e.opcoes)==null?void 0:f.limiteCaracteres,maxlength:(i=e.opcoes)==null?void 0:i.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 Pe=O(uo,[["render",mo]]);function po(e){if(!Number.isFinite(e)||e<=0||e>=1)return 0;const a=e.toString();if(a.includes("e-")){const[,s]=a.split("e-"),b=Number(s);return Number.isFinite(b)?b:0}const n=a.indexOf(".");return n===-1?0:a.slice(n+1).replace(/0+$/,"").length}function fo(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 Ie(e){return(e??"").replace(/\D+/g,"")}function bo(e){const a=(e??"").replace(/[^0-9.,]+/g,""),n=a.match(/[.,]/);if(!n)return a;const r=n[0],s=a.indexOf(r),b=a.slice(0,s).replace(/[.,]/g,""),o=a.slice(s+1).replace(/[.,]/g,"");return`${b.length?b:"0"}${r}${o}`}function ho(e,a){if(a===null)return e;if(a<=0)return e.replace(/[.,]/g,"");const n=e.match(/[.,]/);if(!n)return e;const r=n[0],s=e.indexOf(r),b=e.slice(0,s),o=e.slice(s+1);return`${b}${r}${o.slice(0,a)}`}function go(e){const a=e.match(/^(\d+)[.,]$/);if(!a)return null;const n=Number(a[1]);return Number.isNaN(n)?null:n}const yo=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 r=t.computed(()=>{var m;const i=(m=e.opcoes)==null?void 0:m.precisao;return i==null?null:po(i)}),s=t.computed(()=>r.value===0),b=t.computed(()=>{const i=r.value;return i!==null&&i>0}),o=t.ref(""),l=t.ref(void 0);t.watch(()=>e.value,i=>{i!==l.value&&(o.value=he(i,r.value),l.value=i)},{immediate:!0});function f(i){if(b.value){const B=r.value??0,$=Ie(i),d=$?Number($):0,S=Math.pow(10,B),y=$?d/S:null,C=y===null?null:y;l.value=C,n("update:value",C),n("input",C),n("change",C),o.value=he(C,B);return}const m=s.value?Ie(i):bo(i),k=s.value?m:ho(m,r.value);let D=null;if(k){const $=(s.value?null:go(k))??fo(k);D=$===null?null:$}l.value=D,n("update:value",D),n("input",D),n("change",D),o.value=he(D,r.value)}return{attrs:a,emit:n,displayValue:o,isInteiro:s,onUpdateModelValue:f}}}),$o={class:"eli-entrada__prefixo"},ko={class:"eli-entrada__sufixo"};function Eo(e,a,n,r,s,b){var o,l,f,i;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},[(f=e.opcoes)!=null&&f.prefixo?{name:"prepend-inner",fn:t.withCtx(()=>[t.createElementVNode("span",$o,t.toDisplayString(e.opcoes.prefixo),1)]),key:"0"}:void 0,(i=e.opcoes)!=null&&i.sufixo?{name:"append-inner",fn:t.withCtx(()=>[t.createElementVNode("span",ko,t.toDisplayString(e.opcoes.sufixo),1)]),key:"1"}:void 0]),1040,["model-value","label","placeholder","type","inputmode","pattern","onUpdate:modelValue"])}const Oe=O(yo,[["render",Eo],["__scopeId","data-v-77cbf216"]]);function Bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},Co=de.exports,qe;function Vo(){return qe||(qe=1,(function(e,a){(function(n,r){e.exports=r()})(Co,(function(){var n=1e3,r=6e4,s=36e5,b="millisecond",o="second",l="minute",f="hour",i="day",m="week",k="month",D="quarter",B="year",$="date",d="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,C={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(E){var p=["th","st","nd","rd"],c=E%100;return"["+E+(p[(c-20)%10]||p[c]||p[0])+"]"}},G=function(E,p,c){var g=String(E);return!g||g.length>=p?E:""+Array(p+1-g.length).join(c)+E},K={s:G,z:function(E){var p=-E.utcOffset(),c=Math.abs(p),g=Math.floor(c/60),u=c%60;return(p<=0?"+":"-")+G(g,2,"0")+":"+G(u,2,"0")},m:function E(p,c){if(p.date()<c.date())return-E(c,p);var g=12*(c.year()-p.year())+(c.month()-p.month()),u=p.clone().add(g,k),V=c-u<0,v=p.clone().add(g+(V?-1:1),k);return+(-(g+(c-u)/(V?u-v:v-u))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:k,y:B,w:m,d:i,D:$,h:f,m:l,s:o,ms:b,Q:D}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},Z="en",X={};X[Z]=C;var te="$isDayjsObject",H=function(E){return E instanceof ne||!(!E||!E[te])},oe=function E(p,c,g){var u;if(!p)return Z;if(typeof p=="string"){var V=p.toLowerCase();X[V]&&(u=V),c&&(X[V]=c,u=V);var v=p.split("-");if(!u&&v.length>1)return E(v[0])}else{var M=p.name;X[M]=p,u=M}return!g&&u&&(Z=u),u||!g&&Z},U=function(E,p){if(H(E))return E.clone();var c=typeof p=="object"?p:{};return c.date=E,c.args=arguments,new ne(c)},w=K;w.l=oe,w.i=H,w.w=function(E,p){return U(E,{locale:p.$L,utc:p.$u,x:p.$x,$offset:p.$offset})};var ne=(function(){function E(c){this.$L=oe(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[te]=!0}var p=E.prototype;return p.parse=function(c){this.$d=(function(g){var u=g.date,V=g.utc;if(u===null)return new Date(NaN);if(w.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var v=u.match(S);if(v){var M=v[2]-1||0,I=(v[7]||"0").substring(0,3);return V?new Date(Date.UTC(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,I)):new Date(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,I)}}return new Date(u)})(c),this.init()},p.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()},p.$utils=function(){return w},p.isValid=function(){return this.$d.toString()!==d},p.isSame=function(c,g){var u=U(c);return this.startOf(g)<=u&&u<=this.endOf(g)},p.isAfter=function(c,g){return U(c)<this.startOf(g)},p.isBefore=function(c,g){return this.endOf(g)<U(c)},p.$g=function(c,g,u){return w.u(c)?this[g]:this.set(u,c)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(c,g){var u=this,V=!!w.u(g)||g,v=w.p(c),M=function(N,P){var F=w.w(u.$u?Date.UTC(u.$y,P,N):new Date(u.$y,P,N),u);return V?F:F.endOf(i)},I=function(N,P){return w.w(u.toDate()[N].apply(u.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(P)),u)},z=this.$W,J=this.$M,j=this.$D,h="set"+(this.$u?"UTC":"");switch(v){case B:return V?M(1,0):M(31,11);case k:return V?M(1,J):M(0,J+1);case m:var _=this.$locale().weekStart||0,T=(z<_?z+7:z)-_;return M(V?j-T:j+(6-T),J);case i:case $:return I(h+"Hours",0);case f:return I(h+"Minutes",1);case l:return I(h+"Seconds",2);case o:return I(h+"Milliseconds",3);default:return this.clone()}},p.endOf=function(c){return this.startOf(c,!1)},p.$set=function(c,g){var u,V=w.p(c),v="set"+(this.$u?"UTC":""),M=(u={},u[i]=v+"Date",u[$]=v+"Date",u[k]=v+"Month",u[B]=v+"FullYear",u[f]=v+"Hours",u[l]=v+"Minutes",u[o]=v+"Seconds",u[b]=v+"Milliseconds",u)[V],I=V===i?this.$D+(g-this.$W):g;if(V===k||V===B){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},p.set=function(c,g){return this.clone().$set(c,g)},p.get=function(c){return this[w.p(c)]()},p.add=function(c,g){var u,V=this;c=Number(c);var v=w.p(g),M=function(J){var j=U(V);return w.w(j.date(j.date()+Math.round(J*c)),V)};if(v===k)return this.set(k,this.$M+c);if(v===B)return this.set(B,this.$y+c);if(v===i)return M(1);if(v===m)return M(7);var I=(u={},u[l]=r,u[f]=s,u[o]=n,u)[v]||1,z=this.$d.getTime()+c*I;return w.w(z,this)},p.subtract=function(c,g){return this.add(-1*c,g)},p.format=function(c){var g=this,u=this.$locale();if(!this.isValid())return u.invalidDate||d;var V=c||"YYYY-MM-DDTHH:mm:ssZ",v=w.z(this),M=this.$H,I=this.$m,z=this.$M,J=u.weekdays,j=u.months,h=u.meridiem,_=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(y,(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 _(u.monthsShort,z,j,3);case"MMMM":return _(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 _(u.weekdaysMin,g.$W,J,2);case"ddd":return _(u.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 v}return null})(P)||v.replace(":","")}))},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(c,g,u){var V,v=this,M=w.p(g),I=U(c),z=(I.utcOffset()-this.utcOffset())*r,J=this-I,j=function(){return w.m(v,I)};switch(M){case B:V=j()/12;break;case k:V=j();break;case D:V=j()/3;break;case m:V=(J-z)/6048e5;break;case i:V=(J-z)/864e5;break;case f:V=J/s;break;case l:V=J/r;break;case o:V=J/n;break;default:V=J}return u?V:w.a(V)},p.daysInMonth=function(){return this.endOf(k).$D},p.$locale=function(){return X[this.$L]},p.locale=function(c,g){if(!c)return this.$L;var u=this.clone(),V=oe(c,g,!0);return V&&(u.$L=V),u},p.clone=function(){return w.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},E})(),re=ne.prototype;return U.prototype=re,[["$ms",b],["$s",o],["$m",l],["$H",f],["$W",i],["$M",k],["$y",B],["$D",$]].forEach((function(E){re[E[1]]=function(p){return this.$g(p,E[0],E[1])}})),U.extend=function(E,p){return E.$i||(E(p,ne,U),E.$i=!0),U},U.locale=oe,U.isDayjs=H,U.unix=function(E){return U(1e3*E)},U.en=X[Z],U.Ls=X,U.p={},U}))})(de)),de.exports}var vo=Vo();const ue=Bo(vo),So=t.defineComponent({name:"EliEntradaDataHora",inheritAttrs:!1,props:{value:{type:String,default:void 0},opcoes:{type:Object,required:!1,default:void 0},modelValue:{type:String,default:null},modo:{type:String,default:void 0},rotulo:{type:String,default:void 0},placeholder:{type:String,default:void 0},desabilitado:{type:Boolean,default:void 0},limpavel:{type:Boolean,default:void 0},erro:{type:Boolean,default:void 0},mensagensErro:{type:[String,Array],default:void 0},dica:{type:String,default:void 0},dicaPersistente:{type:Boolean,default:void 0},densidade:{type:String,default:void 0},variante:{type:String,default:void 0},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0,focus:()=>!0,blur:()=>!0},setup(e,{emit:a,attrs:n}){const r=t.computed(()=>e.opcoes?e.opcoes:{rotulo:e.rotulo??"Data e hora",placeholder:e.placeholder??"",modo:e.modo??"dataHora",limpavel:e.limpavel,erro:e.erro,mensagensErro:e.mensagensErro,dica:e.dica,dicaPersistente:e.dicaPersistente,densidade:e.densidade,variante:e.variante,min:e.min,max:e.max}),s=t.computed(()=>r.value.modo??"dataHora"),b=t.computed(()=>!!e.desabilitado),o=t.computed(()=>s.value==="data"?"date":"datetime-local");function l(d){return s.value==="data"?ue(d).format("YYYY-MM-DD"):ue(d).format("YYYY-MM-DDTHH:mm")}function f(d){return s.value==="data"?ue(`${d}T00:00`).format():ue(d).format()}const i=t.computed(()=>e.value!==void 0?e.value??null:e.modelValue),m=t.computed({get:()=>i.value?l(i.value):"",set:d=>{const S=d&&d.length>0?d:null;if(!S){a("update:value",null),a("input",null),a("change",null),a("update:modelValue",null),a("alterar",null);return}const y=f(S);a("update:value",y),a("input",y),a("change",y),a("update:modelValue",y),a("alterar",y)}}),k=t.computed(()=>{const d=r.value.min;if(d)return l(d)}),D=t.computed(()=>{const d=r.value.max;if(d)return l(d)});function B(){a("foco"),a("focus")}function $(){a("desfoco"),a("blur")}return{attrs:n,valor:m,tipoInput:o,minLocal:k,maxLocal:D,opcoesEfetivas:r,desabilitadoEfetivo:b,emitCompatFocus:B,emitCompatBlur:$}}}),_o={class:"eli-data-hora"};function Do(e,a,n,r,s,b){return t.openBlock(),t.createElementBlock("div",_o,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.opcoesEfetivas.rotulo,placeholder:e.opcoesEfetivas.placeholder,disabled:e.desabilitadoEfetivo,clearable:!!e.opcoesEfetivas.limpavel,error:!!e.opcoesEfetivas.erro,"error-messages":e.opcoesEfetivas.mensagensErro,hint:e.opcoesEfetivas.dica,"persistent-hint":!!e.opcoesEfetivas.dicaPersistente,density:e.opcoesEfetivas.densidade??"comfortable",variant:e.opcoesEfetivas.variante??"outlined",min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:e.emitCompatFocus,onBlur:e.emitCompatBlur}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max","onFocus","onBlur"])])}const Fe=O(So,[["render",Do],["__scopeId","data-v-1bfd1be8"]]),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("EliTabela",Te),e.component("EliEntradaTexto",Pe),e.component("EliEntradaNumero",Oe),e.component("EliEntradaDataHora",Fe)}};A.EliBadge=ce,A.EliBotao=pe,A.EliCartao=ke,A.EliEntradaDataHora=Fe,A.EliEntradaNumero=Oe,A.EliEntradaTexto=Pe,A.EliInput=be,A.EliOlaMundo=$e,A.EliTabela=Te,A.default=wo,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));