From 92662a0b13cec50b87fe20704d3124cec09fdc7d Mon Sep 17 00:00:00 2001 From: Luiz Silva Date: Tue, 27 Jan 2026 17:11:13 -0300 Subject: [PATCH] bkp --- dist/eli-vue.css | 2 +- dist/eli-vue.es.js | 1432 +++++++++-------- dist/eli-vue.umd.js | 24 +- .../celulas/EliCelulaTextoSimples.d.ts | 6 - .../celulas/EliTabelaCelula.vue.d.ts | 25 + .../celulas/EliTabelaCelulaNumero.vue.d.ts | 18 + .../EliTabelaCelulaTextoSimples.vue.d.ts | 18 + .../celulas/registryTabelaCelulas.d.ts | 30 + .../EliTabela/celulas/tiposTabelaCelulas.d.ts | 14 + .../types/components/eli/EliTabela/index.d.ts | 3 +- .../eli/EliTabela/types-eli-tabela.d.ts | 9 +- package.json | 2 +- src/components/eli/EliTabela/EliTabela.vue | 97 +- .../eli/EliTabela/celulas/EliTabelaCelula.vue | 39 + .../celulas/EliTabelaCelulaNumero.vue | 4 +- .../celulas/EliTabelaCelulaTextoSimples.vue | 4 +- .../celulas/registryTabelaCelulas.ts | 10 + .../EliTabela/celulas/tiposTabelaCelulas.ts | 21 +- src/components/eli/EliTabela/index.ts | 5 +- .../eli/EliTabela/types-eli-tabela.ts | 16 +- 20 files changed, 1005 insertions(+), 774 deletions(-) delete mode 100644 dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts create mode 100644 dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts create mode 100644 src/components/eli/EliTabela/celulas/EliTabelaCelula.vue create mode 100644 src/components/eli/EliTabela/celulas/registryTabelaCelulas.ts diff --git a/dist/eli-vue.css b/dist/eli-vue.css index c00fa32..8483f99 100644 --- a/dist/eli-vue.css +++ b/dist/eli-vue.css @@ -1 +1 @@ -[data-v-de2fbf2f] .v-badge__badge,[data-v-de2fbf2f] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.eli-input[data-v-756cb549]{width:100%}.checkbox-group[data-v-756cb549]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-756cb549]{cursor:pointer}.eli-cartao[data-v-6c492bd9]{border-radius:12px}.eli-cartao__titulo[data-v-6c492bd9]{display:flex;align-items:center;justify-content:space-between;gap:12px}.eli-cartao__titulo-texto[data-v-6c492bd9]{min-width:0}.eli-cartao__conteudo[data-v-6c492bd9]{padding-top:8px}.eli-cartao__acoes[data-v-6c492bd9]{padding-top:0}.eli-cartao--cancelado[data-v-6c492bd9]{opacity:.85}.eli-data-hora[data-v-71afabb6]{width:100%}.eli-tabela__busca[data-v-0fd1ad15]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-0fd1ad15]{display:inline-flex;align-items:stretch;border-radius:9999px;border:1px solid rgba(15,23,42,.15);overflow:hidden;background:#fff}.eli-tabela__busca-input[data-v-0fd1ad15]{padding:6px 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-0fd1ad15]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-0fd1ad15]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-0fd1ad15]{display:block}.eli-tabela__busca-botao[data-v-0fd1ad15]:hover,.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__paginacao[data-v-59d12455]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;border-radius:9999px;border:1px solid rgba(15,23,42,.12);background:#fff;font-size:.875rem;font-weight:500;color:#0f172ad1;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.eli-tabela__pagina-botao[data-v-59d12455]:hover,.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-59d12455]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-59d12455]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela[data-v-40942745]{width:100%}.eli-tabela__table[data-v-40942745]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td[data-v-40942745]{background:#0f172a05}.eli-tabela__th[data-v-40942745],.eli-tabela__td[data-v-40942745]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-40942745]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel[data-v-40942745]{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao[data-v-40942745]{padding:10px 12px}.eli-tabela__th-botao[data-v-40942745]{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;background:transparent;border:none;font:inherit;color:inherit;cursor:pointer;text-align:left;transition:color .2s ease}.eli-tabela__th-botao[data-v-40942745]:hover,.eli-tabela__th-botao[data-v-40942745]:focus-visible{color:#0f172ad9}.eli-tabela__th-botao[data-v-40942745]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo[data-v-40942745]{color:#2563ebf2}.eli-tabela__th-texto[data-v-40942745]{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone[data-v-40942745]{flex-shrink:0}.eli-tabela__th-icone--oculto[data-v-40942745]{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td[data-v-40942745]{border-bottom:none}.eli-tabela__td--clicavel[data-v-40942745]{cursor:pointer}.eli-tabela__td--clicavel[data-v-40942745]:hover{background:#00000008}.eli-tabela__celula--esquerda[data-v-40942745]{text-align:left}.eli-tabela__celula--centro[data-v-40942745]{text-align:center}.eli-tabela__celula--direita[data-v-40942745]{text-align:right}.eli-tabela__celula-conteudo[data-v-40942745]{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela--erro[data-v-40942745]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-40942745]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-40942745]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-40942745]{opacity:.9}.eli-tabela--vazio[data-v-40942745]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes[data-v-40942745]{text-align:right;white-space:nowrap}.eli-tabela__td--acoes[data-v-40942745]{white-space:nowrap}.eli-tabela__acoes-container[data-v-40942745]{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto[data-v-40942745]{z-index:200}.eli-tabela__cabecalho[data-v-40942745]{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-bottom:12px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho[data-v-40942745]{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao[data-v-40942745]{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:9999px;border:none;background:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao[data-v-40942745]:hover,.eli-tabela__acoes-cabecalho-botao[data-v-40942745]:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao[data-v-40942745]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone[data-v-40942745]{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo[data-v-40942745]{line-height:1}.eli-tabela__acoes-toggle[data-v-40942745]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9999px;border:none;background:transparent;color:#0f172ab8;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-toggle-icone[data-v-40942745]{display:block}.eli-tabela__acoes-toggle[data-v-40942745]:hover,.eli-tabela__acoes-toggle[data-v-40942745]:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle[data-v-40942745]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle[data-v-40942745]:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu[data-v-40942745]{position:absolute;top:100%;right:0;min-width:180px;padding:6px 0;margin:0;list-style:none;background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:10px;box-shadow:0 12px 30px #0f172a2e;z-index:1000}.eli-tabela__acoes-item[data-v-40942745]{margin:0}.eli-tabela__acoes-item-botao[data-v-40942745]{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;font-size:.9rem;cursor:pointer;transition:background-color .2s ease}.eli-tabela__acoes-item-botao[data-v-40942745]:hover,.eli-tabela__acoes-item-botao[data-v-40942745]:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao[data-v-40942745]:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone[data-v-40942745]{flex-shrink:0}.eli-tabela__acoes-item-texto[data-v-40942745]{flex:1;text-align:left} +[data-v-de2fbf2f] .v-badge__badge,[data-v-de2fbf2f] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.eli-input[data-v-756cb549]{width:100%}.checkbox-group[data-v-756cb549]{display:flex;gap:8px;flex-wrap:wrap}.cursor-pointer[data-v-756cb549]{cursor:pointer}.eli-cartao[data-v-6c492bd9]{border-radius:12px}.eli-cartao__titulo[data-v-6c492bd9]{display:flex;align-items:center;justify-content:space-between;gap:12px}.eli-cartao__titulo-texto[data-v-6c492bd9]{min-width:0}.eli-cartao__conteudo[data-v-6c492bd9]{padding-top:8px}.eli-cartao__acoes[data-v-6c492bd9]{padding-top:0}.eli-cartao--cancelado[data-v-6c492bd9]{opacity:.85}.eli-data-hora[data-v-71afabb6]{width:100%}.eli-tabela__busca[data-v-0fd1ad15]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-0fd1ad15]{display:inline-flex;align-items:stretch;border-radius:9999px;border:1px solid rgba(15,23,42,.15);overflow:hidden;background:#fff}.eli-tabela__busca-input[data-v-0fd1ad15]{padding:6px 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-0fd1ad15]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-0fd1ad15]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-0fd1ad15]{display:block}.eli-tabela__busca-botao[data-v-0fd1ad15]:hover,.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-0fd1ad15]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__paginacao[data-v-59d12455]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;border-radius:9999px;border:1px solid rgba(15,23,42,.12);background:#fff;font-size:.875rem;font-weight:500;color:#0f172ad1;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.eli-tabela__pagina-botao[data-v-59d12455]:hover,.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-59d12455]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-59d12455]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela[data-v-cfac9b47]{width:100%}.eli-tabela__table[data-v-cfac9b47]{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td[data-v-cfac9b47]{background:#0f172a05}.eli-tabela__th[data-v-cfac9b47],.eli-tabela__td[data-v-cfac9b47]{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th[data-v-cfac9b47]{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel[data-v-cfac9b47]{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao[data-v-cfac9b47]{padding:10px 12px}.eli-tabela__th-botao[data-v-cfac9b47]{display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;background:transparent;border:none;font:inherit;color:inherit;cursor:pointer;text-align:left;transition:color .2s ease}.eli-tabela__th-botao[data-v-cfac9b47]:hover,.eli-tabela__th-botao[data-v-cfac9b47]:focus-visible{color:#0f172ad9}.eli-tabela__th-botao[data-v-cfac9b47]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo[data-v-cfac9b47]{color:#2563ebf2}.eli-tabela__th-texto[data-v-cfac9b47]{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone[data-v-cfac9b47]{flex-shrink:0}.eli-tabela__th-icone--oculto[data-v-cfac9b47]{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td[data-v-cfac9b47]{border-bottom:none}.eli-tabela__td--clicavel[data-v-cfac9b47]{cursor:pointer}.eli-tabela__td--clicavel[data-v-cfac9b47]:hover{background:#00000008}.eli-tabela__celula--esquerda[data-v-cfac9b47]{text-align:left}.eli-tabela__celula--centro[data-v-cfac9b47]{text-align:center}.eli-tabela__celula--direita[data-v-cfac9b47]{text-align:right}.eli-tabela__celula-conteudo[data-v-cfac9b47]{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela--erro[data-v-cfac9b47]{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando[data-v-cfac9b47]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo[data-v-cfac9b47]{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem[data-v-cfac9b47]{opacity:.9}.eli-tabela--vazio[data-v-cfac9b47]{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes[data-v-cfac9b47]{text-align:right;white-space:nowrap}.eli-tabela__td--acoes[data-v-cfac9b47]{white-space:nowrap}.eli-tabela__acoes-container[data-v-cfac9b47]{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto[data-v-cfac9b47]{z-index:200}.eli-tabela__cabecalho[data-v-cfac9b47]{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-bottom:12px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho[data-v-cfac9b47]{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao[data-v-cfac9b47]{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:9999px;border:none;background:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao[data-v-cfac9b47]:hover,.eli-tabela__acoes-cabecalho-botao[data-v-cfac9b47]:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao[data-v-cfac9b47]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone[data-v-cfac9b47]{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo[data-v-cfac9b47]{line-height:1}.eli-tabela__acoes-toggle[data-v-cfac9b47]{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9999px;border:none;background:transparent;color:#0f172ab8;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-toggle-icone[data-v-cfac9b47]{display:block}.eli-tabela__acoes-toggle[data-v-cfac9b47]:hover,.eli-tabela__acoes-toggle[data-v-cfac9b47]:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle[data-v-cfac9b47]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle[data-v-cfac9b47]:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu[data-v-cfac9b47]{position:absolute;top:100%;right:0;min-width:180px;padding:6px 0;margin:0;list-style:none;background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:10px;box-shadow:0 12px 30px #0f172a2e;z-index:1000}.eli-tabela__acoes-item[data-v-cfac9b47]{margin:0}.eli-tabela__acoes-item-botao[data-v-cfac9b47]{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;background:transparent;font-size:.9rem;cursor:pointer;transition:background-color .2s ease}.eli-tabela__acoes-item-botao[data-v-cfac9b47]:hover,.eli-tabela__acoes-item-botao[data-v-cfac9b47]:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao[data-v-cfac9b47]:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone[data-v-cfac9b47]{flex-shrink:0}.eli-tabela__acoes-item-texto[data-v-cfac9b47]{flex:1;text-align:left} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index 5670475..d74b8f4 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,4 +1,4 @@ -import { defineComponent as K, createBlock as R, openBlock as T, mergeProps as te, withCtx as U, renderSlot as re, computed as D, ref as E, createElementBlock as W, createCommentVNode as we, createSlots as je, createVNode as B, createTextVNode as de, toDisplayString as be, Fragment as he, renderList as Ve, resolveComponent as ce, createElementVNode as G, h, watch as le, withDirectives as ze, withKeys as He, vModelText as Ye, normalizeClass as Fe, onMounted as qe, onBeforeUnmount as We } from "vue"; +import { defineComponent as J, createBlock as W, openBlock as E, mergeProps as ee, withCtx as L, renderSlot as le, computed as V, ref as B, createElementBlock as R, createCommentVNode as Ve, createSlots as je, createVNode as D, createTextVNode as de, toDisplayString as ne, Fragment as be, renderList as $e, resolveComponent as ce, createElementVNode as K, h, watch as re, withDirectives as Le, withKeys as He, vModelText as Ye, normalizeClass as ze, resolveDynamicComponent as Fe, onMounted as qe, onBeforeUnmount as We } from "vue"; import { VBtn as Re } from "vuetify/components/VBtn"; import { VBadge as Je } from "vuetify/components/VBadge"; import { VCheckbox as Ze } from "vuetify/components/VCheckbox"; @@ -6,11 +6,11 @@ import { VIcon as Xe } from "vuetify/components/VIcon"; import { VRadio as Ge } from "vuetify/components/VRadio"; import { VRadioGroup as Ke } from "vuetify/components/VRadioGroup"; import { VSelect as Qe } from "vuetify/components/VSelect"; -import { VTextField as Ee } from "vuetify/components/VTextField"; +import { VTextField as Be } from "vuetify/components/VTextField"; import { VTextarea as xe } from "vuetify/components/VTextarea"; -import { VCard as Pe, VCardTitle as Ae, VCardText as Te, VCardActions as Ie } from "vuetify/components/VCard"; +import { VCard as Ee, VCardTitle as Pe, VCardText as Te, VCardActions as Ae } from "vuetify/components/VCard"; import { VContainer as ea } from "vuetify/components/VGrid"; -const aa = K({ +const aa = J({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const aa = K({ default: !1 } } -}), Q = (e, a) => { +}), Z = (e, a) => { const s = e.__vccOpts || e; - for (const [f, v] of a) - s[f] = v; + for (const [d, p] of a) + s[d] = p; return s; }; -function ta(e, a, s, f, v, y) { - return T(), R(Re, te({ +function ta(e, a, s, d, p, y) { + return E(), W(Re, ee({ color: e.color, variant: e.variant, size: e.size, disabled: e.disabled, loading: e.loading }, e.$attrs, { class: "text-none pt-1" }), { - default: U(() => [ - re(e.$slots, "default") + default: L(() => [ + le(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Oe = /* @__PURE__ */ Q(aa, [["render", ta]]), Me = { +const Oe = /* @__PURE__ */ Z(aa, [["render", ta]]), ke = { suave: "4px", pill: "10px" -}, oa = K({ +}, oa = J({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const Oe = /* @__PURE__ */ Q(aa, [["render", ta]]), Me = { } }, setup(e) { - const a = D(() => e.radius in Me ? Me[e.radius] : e.radius), s = D(() => e.dot || e.badge !== void 0 ? e.visible : !1), f = D(() => ({ + const a = V(() => e.radius in ke ? ke[e.radius] : e.radius), s = V(() => e.dot || e.badge !== void 0 ? e.visible : !1), d = V(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: s, badgeStyle: f }; + return { showBadge: s, badgeStyle: d }; } }); -function la(e, a, s, f, v, y) { - return e.showBadge ? (T(), R(Je, te({ +function ra(e, a, s, d, p, y) { + return e.showBadge ? (E(), W(Je, ee({ key: 0, color: e.color }, e.$attrs, { @@ -115,18 +115,18 @@ function la(e, a, s, f, v, y) { content: e.badge, style: e.badgeStyle }), { - default: U(() => [ - re(e.$slots, "default", {}, void 0, !0) + default: L(() => [ + le(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : re(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : le(e.$slots, "default", { key: 1 }, void 0, !0); } -const ke = /* @__PURE__ */ Q(oa, [["render", la], ["__scopeId", "data-v-de2fbf2f"]]); -function ra(e) { +const Se = /* @__PURE__ */ Z(oa, [["render", ra], ["__scopeId", "data-v-de2fbf2f"]]); +function la(e) { return e.replace(/\D+/g, ""); } function na(e) { - const a = ra(e); + const a = la(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 ia(e) { @@ -136,25 +136,25 @@ function sa(e) { const a = ia(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 Se(e) { +function we(e) { return e.replace(/\D+/g, ""); } -function Ue(e) { +function Ie(e) { const a = e.replace(/[^\d,]/g, ""), s = a.split(","); return s.length > 2 ? s[0] + "," + s.slice(1).join("") : a; } function ua(e) { - return Ue(e.replace(/%/g, "")); + return Ie(e.replace(/%/g, "")); } function da(e) { - const a = Se(e); + const a = we(e); return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } function ca(e) { - const a = Se(e).slice(0, 8); + const a = we(e).slice(0, 8); return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const fa = K({ +const fa = J({ name: "EliInput", inheritAttrs: !1, props: { @@ -197,12 +197,12 @@ const fa = K({ }, emits: ["update:modelValue", "change", "focus", "blur"], setup(e, { emit: a, attrs: s }) { - const f = E(!1), v = E(!1), y = D({ + const d = B(!1), p = B(!1), y = V({ get: () => e.modelValue, - set: (S) => { - a("update:modelValue", S), a("change", S); + set: (M) => { + a("update:modelValue", M), a("change", M); } - }), i = D( + }), l = V( () => [ "text", "password", @@ -217,24 +217,24 @@ const fa = K({ "porcentagem", "cep" ].includes(e.type) - ), c = D( - () => e.type === "password" ? v.value ? "text" : "password" : "text" - ), V = D(() => { + ), f = V( + () => e.type === "password" ? p.value ? "text" : "password" : "text" + ), S = V(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), o = D( - () => e.error ? "error" : f.value ? e.color : void 0 + }), r = V( + () => e.error ? "error" : d.value ? e.color : void 0 ); - function _(S) { - const O = S.target; - let w = O.value; + function _(M) { + const N = M.target; + let w = N.value; switch (e.type) { case "numericoInteiro": - w = Se(w); + w = we(w); break; case "numericoDecimal": - w = Ue(w); + w = Ie(w); break; case "numericoMoeda": w = da(w); @@ -252,48 +252,48 @@ const fa = K({ w = ca(w); break; } - O.value = w, a("update:modelValue", w), a("change", w); + N.value = w, a("update:modelValue", w), a("change", w); } function C() { - v.value = !v.value; + p.value = !p.value; } - const H = D(() => (e.options || []).map((S) => { - if (S && typeof S == "object" && "value" in S) { - const w = S.value; + const z = V(() => (e.options || []).map((M) => { + if (M && typeof M == "object" && "value" in M) { + const w = M.value; return { - label: S.label ?? String(w), + label: M.label ?? String(w), value: w, - disabled: S.disabled + disabled: M.disabled }; } - const O = S; - return { label: String(O), value: O }; + const N = M; + return { label: String(N), value: N }; })); return { attrs: s, value: y, - isTextLike: i, - inputHtmlType: c, - inputMode: V, - internalColor: o, - showPassword: v, + isTextLike: l, + inputHtmlType: f, + inputMode: S, + internalColor: r, + showPassword: p, togglePassword: C, onInput: _, onFocus: () => a("focus"), onBlur: () => a("blur"), - computedItems: H + computedItems: z }; } }), ma = { class: "eli-input" }, pa = { key: 4, class: "checkbox-group" }; -function va(e, a, s, f, v, y) { - return T(), W("div", ma, [ - e.isTextLike ? (T(), R(Ee, te({ +function va(e, a, s, d, p, y) { + return E(), R("div", ma, [ + e.isTextLike ? (E(), W(Be, ee({ key: 0, modelValue: e.value, - "onUpdate:modelValue": a[0] || (a[0] = (i) => e.value = i), + "onUpdate:modelValue": a[0] || (a[0] = (l) => e.value = l), type: e.inputHtmlType, label: e.label, placeholder: e.placeholder, @@ -315,31 +315,31 @@ function va(e, a, s, f, v, y) { }), je({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: U(() => [ - B(Xe, { + fn: L(() => [ + D(Xe, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: U(() => [ - de(be(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + default: L(() => [ + de(ne(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(), R(xe, te({ + ]), 1040, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "color", "inputmode", "suffix", "onFocus", "onBlur", "onInput"])) : e.type === "textarea" ? (E(), W(xe, ee({ key: 1, modelValue: e.value, - "onUpdate:modelValue": a[1] || (a[1] = (i) => e.value = i), + "onUpdate:modelValue": a[1] || (a[1] = (l) => e.value = l), 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(), R(Qe, te({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (E(), W(Qe, ee({ key: 2, modelValue: e.value, - "onUpdate:modelValue": a[2] || (a[2] = (i) => e.value = i), + "onUpdate:modelValue": a[2] || (a[2] = (l) => e.value = l), items: e.computedItems, label: e.label, placeholder: e.placeholder, @@ -356,75 +356,75 @@ function va(e, a, s, f, v, y) { }, 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(), R(Ke, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (E(), W(Ke, { key: 3, modelValue: e.value, - "onUpdate:modelValue": a[3] || (a[3] = (i) => e.value = i), + "onUpdate:modelValue": a[3] || (a[3] = (l) => e.value = l), row: e.row }, { - default: U(() => [ - (T(!0), W(he, null, Ve(e.computedItems, (i) => (T(), R(Ge, { - key: String(i.value), - label: i.label, - value: i.value + default: L(() => [ + (E(!0), R(be, null, $e(e.computedItems, (l) => (E(), W(Ge, { + key: String(l.value), + label: l.label, + value: l.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (T(), W("div", pa, [ - (T(!0), W(he, null, Ve(e.computedItems, (i) => (T(), R(Ze, { - key: String(i.value), + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (E(), R("div", pa, [ + (E(!0), R(be, null, $e(e.computedItems, (l) => (E(), W(Ze, { + key: String(l.value), modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (c) => e.value = c), - label: i.label, - value: i.value, + "onUpdate:modelValue": a[4] || (a[4] = (f) => e.value = f), + label: l.label, + value: l.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : we("", !0) + ])) : Ve("", !0) ]); } -const Le = /* @__PURE__ */ Q(fa, [["render", va], ["__scopeId", "data-v-756cb549"]]), ba = K({ +const Ue = /* @__PURE__ */ Z(fa, [["render", va], ["__scopeId", "data-v-756cb549"]]), ba = J({ name: "EliOlaMundo", components: { EliBotao: Oe, - EliBadge: ke, - EliInput: Le + EliBadge: Se, + EliInput: Ue }, setup() { - const e = E(""), a = E([]), s = E(""), f = E(""), v = E(""), y = E(""), i = E(""), c = E(""), V = E(""), o = E(""), _ = E(""), C = E(null), H = E([]); + const e = B(""), a = B([]), s = B(""), d = B(""), p = B(""), y = B(""), l = B(""), f = B(""), S = B(""), r = B(""), _ = B(""), C = B(null), z = B([]); return { nome: e, - email: c, + email: f, documento: _, estado: a, - telefone: f, - mensagem: V, - senha: o, + telefone: d, + mensagem: S, + senha: r, cor: C, - habilidades: H, - idade: v, + habilidades: z, + idade: p, altura: y, cep: s, - valor: i + valor: l }; } }), ha = { class: "grid-example" }; -function ga(e, a, s, f, v, y) { - const i = ce("EliBadge"), c = ce("EliInput"), V = ce("EliBotao"); - return T(), R(ea, null, { - default: U(() => [ - B(Pe, { +function ga(e, a, s, d, p, y) { + const l = ce("EliBadge"), f = ce("EliInput"), S = ce("EliBotao"); + return E(), W(ea, null, { + default: L(() => [ + D(Ee, { class: "mx-auto", max_width: "400" }, { - default: U(() => [ - B(Ae, null, { - default: U(() => [ - B(i, { + default: L(() => [ + D(Pe, null, { + default: L(() => [ + D(l, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: U(() => [...a[14] || (a[14] = [ + default: L(() => [...a[14] || (a[14] = [ de(" Olá Mundo! ", -1) ])]), _: 1 @@ -432,51 +432,51 @@ function ga(e, a, s, f, v, y) { ]), _: 1 }), - B(Te, null, { - default: U(() => [ + D(Te, null, { + default: L(() => [ a[15] || (a[15] = de(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - G("div", ha, [ - B(c, { + K("div", ha, [ + D(f, { modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (o) => e.nome = o), + "onUpdate:modelValue": a[0] || (a[0] = (r) => e.nome = r), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (o) => e.idade = o), + "onUpdate:modelValue": a[1] || (a[1] = (r) => e.idade = r), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (o) => e.altura = o), + "onUpdate:modelValue": a[2] || (a[2] = (r) => e.altura = r), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (o) => e.valor = o), + "onUpdate:modelValue": a[3] || (a[3] = (r) => e.valor = r), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (o) => e.telefone = o), + "onUpdate:modelValue": a[4] || (a[4] = (r) => e.telefone = r), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (o) => e.cep = o), + "onUpdate:modelValue": a[5] || (a[5] = (r) => e.cep = r), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - B(c, { + D(f, { type: "select", label: "Estado", options: [ @@ -484,58 +484,58 @@ function ga(e, a, s, f, v, y) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": a[6] || (a[6] = (o) => e.estado = o), + "onUpdate:modelValue": a[6] || (a[6] = (r) => e.estado = r), multiple: "" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (o) => e.documento = o), + "onUpdate:modelValue": a[7] || (a[7] = (r) => e.documento = r), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (o) => e.email = o), + "onUpdate:modelValue": a[8] || (a[8] = (r) => e.email = r), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.senha, - "onUpdate:modelValue": a[9] || (a[9] = (o) => e.senha = o), + "onUpdate:modelValue": a[9] || (a[9] = (r) => e.senha = r), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - B(c, { + D(f, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (o) => e.mensagem = o), + "onUpdate:modelValue": a[10] || (a[10] = (r) => e.mensagem = r), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - B(c, { + D(f, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": a[11] || (a[11] = (o) => e.cor = o), + "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"]), - B(c, { + D(f, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": a[12] || (a[12] = (o) => e.habilidades = o), + "onUpdate:modelValue": a[12] || (a[12] = (r) => e.habilidades = r), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - B(c, { + D(f, { modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (o) => e.nome = o), + "onUpdate:modelValue": a[13] || (a[13] = (r) => e.nome = r), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -544,14 +544,14 @@ function ga(e, a, s, f, v, y) { ]), _: 1 }), - B(Ie, null, { - default: U(() => [ - B(V, { + D(Ae, null, { + default: L(() => [ + D(S, { color: "primary", variant: "elevated", block: "" }, { - default: U(() => [...a[16] || (a[16] = [ + default: L(() => [...a[16] || (a[16] = [ de(" Botão Vuetify ", -1) ])]), _: 1 @@ -566,9 +566,9 @@ function ga(e, a, s, f, v, y) { _: 1 }); } -const ya = /* @__PURE__ */ Q(ba, [["render", ga]]), $a = K({ +const ya = /* @__PURE__ */ Z(ba, [["render", ga]]), $a = J({ name: "EliCartao", - components: { EliBadge: ke }, + components: { EliBadge: Se }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -595,7 +595,7 @@ const ya = /* @__PURE__ */ Q(ba, [["render", ga]]), $a = K({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const s = D(() => e.status), f = D(() => { + const s = V(() => e.status), d = V(() => { switch (e.status) { case "novo": return "primary"; @@ -606,40 +606,40 @@ const ya = /* @__PURE__ */ Q(ba, [["render", ga]]), $a = K({ case "cancelado": return "error"; } - }), v = D(() => `eli-cartao--${e.status}`); + }), p = V(() => `eli-cartao--${e.status}`); function y() { a("clicar", e.status); } return { rotuloStatus: s, - corStatus: f, - classeStatus: v, + corStatus: d, + classeStatus: p, onClick: y }; } -}), Va = { class: "eli-cartao__titulo-texto" }, wa = { class: "eli-cartao__status" }; -function ka(e, a, s, f, v, y) { - const i = ce("EliBadge"); - return T(), R(Pe, te({ +}), Va = { class: "eli-cartao__titulo-texto" }, Sa = { class: "eli-cartao__status" }; +function wa(e, a, s, d, p, y) { + const l = ce("EliBadge"); + return E(), W(Ee, ee({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: U(() => [ - B(Ae, { class: "eli-cartao__titulo" }, { - default: U(() => [ - G("div", Va, [ - re(e.$slots, "titulo", {}, () => [ - de(be(e.titulo), 1) + default: L(() => [ + D(Pe, { class: "eli-cartao__titulo" }, { + default: L(() => [ + K("div", Va, [ + le(e.$slots, "titulo", {}, () => [ + de(ne(e.titulo), 1) ], !0) ]), - G("div", wa, [ - B(i, { + K("div", Sa, [ + D(l, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: U(() => [...a[0] || (a[0] = [ - G("span", null, null, -1) + default: L(() => [...a[0] || (a[0] = [ + K("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -647,309 +647,309 @@ function ka(e, a, s, f, v, y) { ]), _: 3 }), - B(Te, { class: "eli-cartao__conteudo" }, { - default: U(() => [ - re(e.$slots, "default", {}, void 0, !0) + D(Te, { class: "eli-cartao__conteudo" }, { + default: L(() => [ + le(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (T(), R(Ie, { + e.$slots.acoes ? (E(), W(Ae, { key: 0, class: "eli-cartao__acoes" }, { - default: U(() => [ - re(e.$slots, "acoes", {}, void 0, !0) + default: L(() => [ + le(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : we("", !0) + })) : Ve("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const Sa = /* @__PURE__ */ Q($a, [["render", ka], ["__scopeId", "data-v-6c492bd9"]]); +const ka = /* @__PURE__ */ Z($a, [["render", wa], ["__scopeId", "data-v-6c492bd9"]]); function Ma(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var ve = { exports: {} }, Ca = ve.exports, Ce; -function Da() { - return Ce || (Ce = 1, (function(e, a) { - (function(s, f) { - e.exports = f(); +var ve = { exports: {} }, Ca = ve.exports, Me; +function _a() { + return Me || (Me = 1, (function(e, a) { + (function(s, d) { + e.exports = d(); })(Ca, (function() { - var s = 1e3, f = 6e4, v = 36e5, y = "millisecond", i = "second", c = "minute", V = "hour", o = "day", _ = "week", C = "month", H = "quarter", S = "year", O = "date", w = "Invalid Date", J = /^(\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, L = { 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(p) { - var n = ["th", "st", "nd", "rd"], t = p % 100; - return "[" + p + (n[(t - 20) % 10] || n[t] || n[0]) + "]"; - } }, ne = function(p, n, t) { - var l = String(p); - return !l || l.length >= n ? p : "" + Array(n + 1 - l.length).join(t) + p; - }, ye = { s: ne, z: function(p) { - var n = -p.utcOffset(), t = Math.abs(n), l = Math.floor(t / 60), r = t % 60; - return (n <= 0 ? "+" : "-") + ne(l, 2, "0") + ":" + ne(r, 2, "0"); - }, m: function p(n, t) { - if (n.date() < t.date()) return -p(t, n); - var l = 12 * (t.year() - n.year()) + (t.month() - n.month()), r = n.clone().add(l, C), u = t - r < 0, d = n.clone().add(l + (u ? -1 : 1), C); - return +(-(l + (t - r) / (u ? r - d : d - r)) || 0); - }, a: function(p) { - return p < 0 ? Math.ceil(p) || 0 : Math.floor(p); - }, p: function(p) { - return { M: C, y: S, w: _, d: o, D: O, h: V, m: c, s: i, ms: y, Q: H }[p] || String(p || "").toLowerCase().replace(/s$/, ""); - }, u: function(p) { - return p === void 0; - } }, x = "en", Z = {}; - Z[x] = L; - var ie = "$isDayjsObject", se = function(p) { - return p instanceof oe || !(!p || !p[ie]); - }, ee = function p(n, t, l) { - var r; - if (!n) return x; - if (typeof n == "string") { - var u = n.toLowerCase(); - Z[u] && (r = u), t && (Z[u] = t, r = u); - var d = n.split("-"); - if (!r && d.length > 1) return p(d[0]); + var s = 1e3, d = 6e4, p = 36e5, y = "millisecond", l = "second", f = "minute", S = "hour", r = "day", _ = "week", C = "month", z = "quarter", M = "year", N = "date", w = "Invalid Date", X = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, F = /\[([^\]]+)]|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, H = { 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(u) { + var t = ["th", "st", "nd", "rd"], o = u % 100; + return "[" + u + (t[(o - 20) % 10] || t[o] || t[0]) + "]"; + } }, ie = function(u, t, o) { + var i = String(u); + return !i || i.length >= t ? u : "" + Array(t + 1 - i.length).join(o) + u; + }, ge = { s: ie, z: function(u) { + var t = -u.utcOffset(), o = Math.abs(t), i = Math.floor(o / 60), n = o % 60; + return (t <= 0 ? "+" : "-") + ie(i, 2, "0") + ":" + ie(n, 2, "0"); + }, m: function u(t, o) { + if (t.date() < o.date()) return -u(o, t); + var i = 12 * (o.year() - t.year()) + (o.month() - t.month()), n = t.clone().add(i, C), v = o - n < 0, m = t.clone().add(i + (v ? -1 : 1), C); + return +(-(i + (o - n) / (v ? n - m : m - n)) || 0); + }, a: function(u) { + return u < 0 ? Math.ceil(u) || 0 : Math.floor(u); + }, p: function(u) { + return { M: C, y: M, w: _, d: r, D: N, h: S, m: f, s: l, ms: y, Q: z }[u] || String(u || "").toLowerCase().replace(/s$/, ""); + }, u: function(u) { + return u === void 0; + } }, x = "en", G = {}; + G[x] = H; + var se = "$isDayjsObject", ae = function(u) { + return u instanceof oe || !(!u || !u[se]); + }, te = function u(t, o, i) { + var n; + if (!t) return x; + if (typeof t == "string") { + var v = t.toLowerCase(); + G[v] && (n = v), o && (G[v] = o, n = v); + var m = t.split("-"); + if (!n && m.length > 1) return u(m[0]); } else { - var g = n.name; - Z[g] = n, r = g; + var b = t.name; + G[b] = t, n = b; } - return !l && r && (x = r), r || !l && x; - }, I = function(p, n) { - if (se(p)) return p.clone(); - var t = typeof n == "object" ? n : {}; - return t.date = p, t.args = arguments, new oe(t); - }, k = ye; - k.l = ee, k.i = se, k.w = function(p, n) { - return I(p, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset }); + return !i && n && (x = n), n || !i && x; + }, O = function(u, t) { + if (ae(u)) return u.clone(); + var o = typeof t == "object" ? t : {}; + return o.date = u, o.args = arguments, new oe(o); + }, k = ge; + k.l = te, k.i = ae, k.w = function(u, t) { + return O(u, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset }); }; var oe = (function() { - function p(t) { - this.$L = ee(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[ie] = !0; + function u(o) { + this.$L = te(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[se] = !0; } - var n = p.prototype; - return n.parse = function(t) { - this.$d = (function(l) { - var r = l.date, u = l.utc; - if (r === null) return /* @__PURE__ */ new Date(NaN); - if (k.u(r)) return /* @__PURE__ */ new Date(); - if (r instanceof Date) return new Date(r); - if (typeof r == "string" && !/Z$/i.test(r)) { - var d = r.match(J); - if (d) { - var g = d[2] - 1 || 0, b = (d[7] || "0").substring(0, 3); - return u ? new Date(Date.UTC(d[1], g, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, b)) : new Date(d[1], g, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, b); + var t = u.prototype; + return t.parse = function(o) { + this.$d = (function(i) { + var n = i.date, v = i.utc; + if (n === null) return /* @__PURE__ */ new Date(NaN); + if (k.u(n)) return /* @__PURE__ */ new Date(); + if (n instanceof Date) return new Date(n); + if (typeof n == "string" && !/Z$/i.test(n)) { + var m = n.match(X); + if (m) { + var b = m[2] - 1 || 0, c = (m[7] || "0").substring(0, 3); + return v ? new Date(Date.UTC(m[1], b, m[3] || 1, m[4] || 0, m[5] || 0, m[6] || 0, c)) : new Date(m[1], b, m[3] || 1, m[4] || 0, m[5] || 0, m[6] || 0, c); } } - return new Date(r); - })(t), this.init(); - }, n.init = function() { - var t = this.$d; - this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds(); - }, n.$utils = function() { + return new Date(n); + })(o), this.init(); + }, t.init = function() { + var o = this.$d; + this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds(); + }, t.$utils = function() { return k; - }, n.isValid = function() { + }, t.isValid = function() { return this.$d.toString() !== w; - }, n.isSame = function(t, l) { - var r = I(t); - return this.startOf(l) <= r && r <= this.endOf(l); - }, n.isAfter = function(t, l) { - return I(t) < this.startOf(l); - }, n.isBefore = function(t, l) { - return this.endOf(l) < I(t); - }, n.$g = function(t, l, r) { - return k.u(t) ? this[l] : this.set(r, t); - }, n.unix = function() { + }, t.isSame = function(o, i) { + var n = O(o); + return this.startOf(i) <= n && n <= this.endOf(i); + }, t.isAfter = function(o, i) { + return O(o) < this.startOf(i); + }, t.isBefore = function(o, i) { + return this.endOf(i) < O(o); + }, t.$g = function(o, i, n) { + return k.u(o) ? this[i] : this.set(n, o); + }, t.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, n.valueOf = function() { + }, t.valueOf = function() { return this.$d.getTime(); - }, n.startOf = function(t, l) { - var r = this, u = !!k.u(l) || l, d = k.p(t), g = function(q, A) { - var j = k.w(r.$u ? Date.UTC(r.$y, A, q) : new Date(r.$y, A, q), r); - return u ? j : j.endOf(o); - }, b = function(q, A) { - return k.w(r.toDate()[q].apply(r.toDate("s"), (u ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(A)), r); - }, m = this.$W, $ = this.$M, M = this.$D, N = "set" + (this.$u ? "UTC" : ""); - switch (d) { - case S: - return u ? g(1, 0) : g(31, 11); + }, t.startOf = function(o, i) { + var n = this, v = !!k.u(i) || i, m = k.p(o), b = function(U, T) { + var Y = k.w(n.$u ? Date.UTC(n.$y, T, U) : new Date(n.$y, T, U), n); + return v ? Y : Y.endOf(r); + }, c = function(U, T) { + return k.w(n.toDate()[U].apply(n.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(T)), n); + }, $ = this.$W, g = this.$M, A = this.$D, P = "set" + (this.$u ? "UTC" : ""); + switch (m) { + case M: + return v ? b(1, 0) : b(31, 11); case C: - return u ? g(1, $) : g(0, $ + 1); + return v ? b(1, g) : b(0, g + 1); case _: - var P = this.$locale().weekStart || 0, F = (m < P ? m + 7 : m) - P; - return g(u ? M - F : M + (6 - F), $); - case o: - case O: - return b(N + "Hours", 0); - case V: - return b(N + "Minutes", 1); - case c: - return b(N + "Seconds", 2); - case i: - return b(N + "Milliseconds", 3); + var j = this.$locale().weekStart || 0, q = ($ < j ? $ + 7 : $) - j; + return b(v ? A - q : A + (6 - q), g); + case r: + case N: + return c(P + "Hours", 0); + case S: + return c(P + "Minutes", 1); + case f: + return c(P + "Seconds", 2); + case l: + return c(P + "Milliseconds", 3); default: return this.clone(); } - }, n.endOf = function(t) { - return this.startOf(t, !1); - }, n.$set = function(t, l) { - var r, u = k.p(t), d = "set" + (this.$u ? "UTC" : ""), g = (r = {}, r[o] = d + "Date", r[O] = d + "Date", r[C] = d + "Month", r[S] = d + "FullYear", r[V] = d + "Hours", r[c] = d + "Minutes", r[i] = d + "Seconds", r[y] = d + "Milliseconds", r)[u], b = u === o ? this.$D + (l - this.$W) : l; - if (u === C || u === S) { - var m = this.clone().set(O, 1); - m.$d[g](b), m.init(), this.$d = m.set(O, Math.min(this.$D, m.daysInMonth())).$d; - } else g && this.$d[g](b); + }, t.endOf = function(o) { + return this.startOf(o, !1); + }, t.$set = function(o, i) { + var n, v = k.p(o), m = "set" + (this.$u ? "UTC" : ""), b = (n = {}, n[r] = m + "Date", n[N] = m + "Date", n[C] = m + "Month", n[M] = m + "FullYear", n[S] = m + "Hours", n[f] = m + "Minutes", n[l] = m + "Seconds", n[y] = m + "Milliseconds", n)[v], c = v === r ? this.$D + (i - this.$W) : i; + if (v === C || v === M) { + var $ = this.clone().set(N, 1); + $.$d[b](c), $.init(), this.$d = $.set(N, Math.min(this.$D, $.daysInMonth())).$d; + } else b && this.$d[b](c); return this.init(), this; - }, n.set = function(t, l) { - return this.clone().$set(t, l); - }, n.get = function(t) { - return this[k.p(t)](); - }, n.add = function(t, l) { - var r, u = this; - t = Number(t); - var d = k.p(l), g = function($) { - var M = I(u); - return k.w(M.date(M.date() + Math.round($ * t)), u); + }, t.set = function(o, i) { + return this.clone().$set(o, i); + }, t.get = function(o) { + return this[k.p(o)](); + }, t.add = function(o, i) { + var n, v = this; + o = Number(o); + var m = k.p(i), b = function(g) { + var A = O(v); + return k.w(A.date(A.date() + Math.round(g * o)), v); }; - if (d === C) return this.set(C, this.$M + t); - if (d === S) return this.set(S, this.$y + t); - if (d === o) return g(1); - if (d === _) return g(7); - var b = (r = {}, r[c] = f, r[V] = v, r[i] = s, r)[d] || 1, m = this.$d.getTime() + t * b; - return k.w(m, this); - }, n.subtract = function(t, l) { - return this.add(-1 * t, l); - }, n.format = function(t) { - var l = this, r = this.$locale(); - if (!this.isValid()) return r.invalidDate || w; - var u = t || "YYYY-MM-DDTHH:mm:ssZ", d = k.z(this), g = this.$H, b = this.$m, m = this.$M, $ = r.weekdays, M = r.months, N = r.meridiem, P = function(A, j, X, ae) { - return A && (A[j] || A(l, u)) || X[j].slice(0, ae); - }, F = function(A) { - return k.s(g % 12 || 12, A, "0"); - }, q = N || function(A, j, X) { - var ae = A < 12 ? "AM" : "PM"; - return X ? ae.toLowerCase() : ae; + if (m === C) return this.set(C, this.$M + o); + if (m === M) return this.set(M, this.$y + o); + if (m === r) return b(1); + if (m === _) return b(7); + var c = (n = {}, n[f] = d, n[S] = p, n[l] = s, n)[m] || 1, $ = this.$d.getTime() + o * c; + return k.w($, this); + }, t.subtract = function(o, i) { + return this.add(-1 * o, i); + }, t.format = function(o) { + var i = this, n = this.$locale(); + if (!this.isValid()) return n.invalidDate || w; + var v = o || "YYYY-MM-DDTHH:mm:ssZ", m = k.z(this), b = this.$H, c = this.$m, $ = this.$M, g = n.weekdays, A = n.months, P = n.meridiem, j = function(T, Y, Q, I) { + return T && (T[Y] || T(i, v)) || Q[Y].slice(0, I); + }, q = function(T) { + return k.s(b % 12 || 12, T, "0"); + }, U = P || function(T, Y, Q) { + var I = T < 12 ? "AM" : "PM"; + return Q ? I.toLowerCase() : I; }; - return u.replace(Y, (function(A, j) { - return j || (function(X) { - switch (X) { + return v.replace(F, (function(T, Y) { + return Y || (function(Q) { + switch (Q) { case "YY": - return String(l.$y).slice(-2); + return String(i.$y).slice(-2); case "YYYY": - return k.s(l.$y, 4, "0"); + return k.s(i.$y, 4, "0"); case "M": - return m + 1; + return $ + 1; case "MM": - return k.s(m + 1, 2, "0"); + return k.s($ + 1, 2, "0"); case "MMM": - return P(r.monthsShort, m, M, 3); + return j(n.monthsShort, $, A, 3); case "MMMM": - return P(M, m); + return j(A, $); case "D": - return l.$D; + return i.$D; case "DD": - return k.s(l.$D, 2, "0"); + return k.s(i.$D, 2, "0"); case "d": - return String(l.$W); + return String(i.$W); case "dd": - return P(r.weekdaysMin, l.$W, $, 2); + return j(n.weekdaysMin, i.$W, g, 2); case "ddd": - return P(r.weekdaysShort, l.$W, $, 3); + return j(n.weekdaysShort, i.$W, g, 3); case "dddd": - return $[l.$W]; + return g[i.$W]; case "H": - return String(g); - case "HH": - return k.s(g, 2, "0"); - case "h": - return F(1); - case "hh": - return F(2); - case "a": - return q(g, b, !0); - case "A": - return q(g, b, !1); - case "m": return String(b); - case "mm": + case "HH": return k.s(b, 2, "0"); + case "h": + return q(1); + case "hh": + return q(2); + case "a": + return U(b, c, !0); + case "A": + return U(b, c, !1); + case "m": + return String(c); + case "mm": + return k.s(c, 2, "0"); case "s": - return String(l.$s); + return String(i.$s); case "ss": - return k.s(l.$s, 2, "0"); + return k.s(i.$s, 2, "0"); case "SSS": - return k.s(l.$ms, 3, "0"); + return k.s(i.$ms, 3, "0"); case "Z": - return d; + return m; } return null; - })(A) || d.replace(":", ""); + })(T) || m.replace(":", ""); })); - }, n.utcOffset = function() { + }, t.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, n.diff = function(t, l, r) { - var u, d = this, g = k.p(l), b = I(t), m = (b.utcOffset() - this.utcOffset()) * f, $ = this - b, M = function() { - return k.m(d, b); + }, t.diff = function(o, i, n) { + var v, m = this, b = k.p(i), c = O(o), $ = (c.utcOffset() - this.utcOffset()) * d, g = this - c, A = function() { + return k.m(m, c); }; - switch (g) { - case S: - u = M() / 12; + switch (b) { + case M: + v = A() / 12; break; case C: - u = M(); + v = A(); break; - case H: - u = M() / 3; + case z: + v = A() / 3; break; case _: - u = ($ - m) / 6048e5; + v = (g - $) / 6048e5; break; - case o: - u = ($ - m) / 864e5; + case r: + v = (g - $) / 864e5; break; - case V: - u = $ / v; + case S: + v = g / p; break; - case c: - u = $ / f; + case f: + v = g / d; break; - case i: - u = $ / s; + case l: + v = g / s; break; default: - u = $; + v = g; } - return r ? u : k.a(u); - }, n.daysInMonth = function() { + return n ? v : k.a(v); + }, t.daysInMonth = function() { return this.endOf(C).$D; - }, n.$locale = function() { - return Z[this.$L]; - }, n.locale = function(t, l) { - if (!t) return this.$L; - var r = this.clone(), u = ee(t, l, !0); - return u && (r.$L = u), r; - }, n.clone = function() { + }, t.$locale = function() { + return G[this.$L]; + }, t.locale = function(o, i) { + if (!o) return this.$L; + var n = this.clone(), v = te(o, i, !0); + return v && (n.$L = v), n; + }, t.clone = function() { return k.w(this.$d, this); - }, n.toDate = function() { + }, t.toDate = function() { return new Date(this.valueOf()); - }, n.toJSON = function() { + }, t.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, n.toISOString = function() { + }, t.toISOString = function() { return this.$d.toISOString(); - }, n.toString = function() { + }, t.toString = function() { return this.$d.toUTCString(); - }, p; + }, u; })(), fe = oe.prototype; - return I.prototype = fe, [["$ms", y], ["$s", i], ["$m", c], ["$H", V], ["$W", o], ["$M", C], ["$y", S], ["$D", O]].forEach((function(p) { - fe[p[1]] = function(n) { - return this.$g(n, p[0], p[1]); + return O.prototype = fe, [["$ms", y], ["$s", l], ["$m", f], ["$H", S], ["$W", r], ["$M", C], ["$y", M], ["$D", N]].forEach((function(u) { + fe[u[1]] = function(t) { + return this.$g(t, u[0], u[1]); }; - })), I.extend = function(p, n) { - return p.$i || (p(n, oe, I), p.$i = !0), I; - }, I.locale = ee, I.isDayjs = se, I.unix = function(p) { - return I(1e3 * p); - }, I.en = Z[x], I.Ls = Z, I.p = {}, I; + })), O.extend = function(u, t) { + return u.$i || (u(t, oe, O), u.$i = !0), O; + }, O.locale = te, O.isDayjs = ae, O.unix = function(u) { + return O(1e3 * u); + }, O.en = G[x], O.Ls = G, O.p = {}, O; })); })(ve)), ve.exports; } -var _a = Da(); -const pe = /* @__PURE__ */ Ma(_a), Ba = K({ +var Da = _a(); +const pe = /* @__PURE__ */ Ma(Da), Ba = J({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1049,19 +1049,19 @@ const pe = /* @__PURE__ */ Ma(_a), Ba = K({ desfoco: () => !0 }, setup(e, { emit: a, attrs: s }) { - const f = D( + const d = V( () => e.modo === "data" ? "date" : "datetime-local" ); - function v(o) { - return e.modo === "data" ? pe(o).format("YYYY-MM-DD") : pe(o).format("YYYY-MM-DDTHH:mm"); + function p(r) { + return e.modo === "data" ? pe(r).format("YYYY-MM-DD") : pe(r).format("YYYY-MM-DDTHH:mm"); } - function y(o) { - return e.modo === "data" ? pe(`${o}T00:00`).format() : pe(o).format(); + function y(r) { + return e.modo === "data" ? pe(`${r}T00:00`).format() : pe(r).format(); } - const i = D({ - get: () => e.modelValue ? v(e.modelValue) : "", - set: (o) => { - const _ = o && o.length > 0 ? o : null; + const l = V({ + get: () => e.modelValue ? p(e.modelValue) : "", + set: (r) => { + const _ = r && r.length > 0 ? r : null; if (!_) { a("update:modelValue", null), a("alterar", null); return; @@ -1069,21 +1069,21 @@ const pe = /* @__PURE__ */ Ma(_a), Ba = K({ const C = y(_); a("update:modelValue", C), a("alterar", C); } - }), c = D(() => { + }), f = V(() => { if (e.min) - return v(e.min); - }), V = D(() => { + return p(e.min); + }), S = V(() => { if (e.max) - return v(e.max); + return p(e.max); }); - return { attrs: s, valor: i, emit: a, minLocal: c, maxLocal: V, tipoInput: f }; + return { attrs: s, valor: l, emit: a, minLocal: f, maxLocal: S, tipoInput: d }; } }), Ea = { class: "eli-data-hora" }; -function Pa(e, a, s, f, v, y) { - return T(), W("div", Ea, [ - B(Ee, te({ +function Pa(e, a, s, d, p, y) { + return E(), R("div", Ea, [ + D(Be, ee({ modelValue: e.valor, - "onUpdate:modelValue": a[0] || (a[0] = (i) => e.valor = i), + "onUpdate:modelValue": a[0] || (a[0] = (l) => e.valor = l), type: e.tipoInput, label: e.rotulo, placeholder: e.placeholder, @@ -1098,19 +1098,19 @@ function Pa(e, a, s, f, v, y) { min: e.minLocal, max: e.maxLocal }, e.attrs, { - onFocus: a[1] || (a[1] = (i) => e.emit("foco")), - onBlur: a[2] || (a[2] = (i) => e.emit("desfoco")) + onFocus: a[1] || (a[1] = (l) => e.emit("foco")), + onBlur: a[2] || (a[2] = (l) => e.emit("desfoco")) }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const Aa = /* @__PURE__ */ Q(Ba, [["render", Pa], ["__scopeId", "data-v-71afabb6"]]); +const Ta = /* @__PURE__ */ Z(Ba, [["render", Pa], ["__scopeId", "data-v-71afabb6"]]); /** * @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 Ta = (e) => { +const Aa = (e) => { for (const a in e) if (a.startsWith("aria-") || a === "role" || a === "title") return !0; @@ -1122,14 +1122,14 @@ const Ta = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const De = (e) => e === ""; +const Ce = (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 Ia = (...e) => e.filter((a, s, f) => !!a && a.trim() !== "" && f.indexOf(a) === s).join(" ").trim(); +const Oa = (...e) => e.filter((a, s, d) => !!a && a.trim() !== "" && d.indexOf(a) === s).join(" ").trim(); /** * @license lucide-vue-next v0.563.0 - ISC * @@ -1143,9 +1143,9 @@ const _e = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Oa = (e) => e.replace( +const Ia = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, s, f) => f ? f.toUpperCase() : s.toLowerCase() + (a, s, d) => d ? d.toUpperCase() : s.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1154,7 +1154,7 @@ const Oa = (e) => e.replace( * See the LICENSE file in the root directory of this source tree. */ const Ua = (e) => { - const a = Oa(e); + const a = Ia(e); return a.charAt(0).toUpperCase() + a.slice(1); }; /** @@ -1180,33 +1180,33 @@ var ue = { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const La = ({ +const Na = ({ name: e, iconNode: a, absoluteStrokeWidth: s, - "absolute-stroke-width": f, - strokeWidth: v, + "absolute-stroke-width": d, + strokeWidth: p, "stroke-width": y, - size: i = ue.width, - color: c = ue.stroke, - ...V -}, { slots: o }) => h( + size: l = ue.width, + color: f = ue.stroke, + ...S +}, { slots: r }) => h( "svg", { ...ue, - ...V, - width: i, - height: i, - stroke: c, - "stroke-width": De(s) || De(f) || s === !0 || f === !0 ? Number(v || y || ue["stroke-width"]) * 24 / Number(i) : v || y || ue["stroke-width"], - class: Ia( + ...S, + width: l, + height: l, + stroke: f, + "stroke-width": Ce(s) || Ce(d) || s === !0 || d === !0 ? Number(p || y || ue["stroke-width"]) * 24 / Number(l) : p || y || ue["stroke-width"], + class: Oa( "lucide", - V.class, + S.class, ...e ? [`lucide-${_e(Ua(e))}-icon`, `lucide-${_e(e)}`] : ["lucide-icon"] ), - ...!o.default && !Ta(V) && { "aria-hidden": "true" } + ...!r.default && !Aa(S) && { "aria-hidden": "true" } }, - [...a.map((_) => h(..._)), ...o.default ? [o.default()] : []] + [...a.map((_) => h(..._)), ...r.default ? [r.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1214,15 +1214,15 @@ const La = ({ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const ge = (e, a) => (s, { slots: f, attrs: v }) => h( - La, +const he = (e, a) => (s, { slots: d, attrs: p }) => h( + Na, { - ...v, + ...p, ...s, iconNode: a, name: e }, - f + d ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1230,7 +1230,7 @@ const ge = (e, a) => (s, { slots: f, attrs: v }) => h( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Na = ge("arrow-down", [ +const ja = he("arrow-down", [ ["path", { d: "M12 5v14", key: "s699le" }], ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] ]); @@ -1240,7 +1240,7 @@ const Na = ge("arrow-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Be = ge("arrow-up", [ +const De = he("arrow-up", [ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], ["path", { d: "M12 19V5", key: "x0mq9r" }] ]); @@ -1250,7 +1250,7 @@ const Be = ge("arrow-up", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const ja = ge("ellipsis-vertical", [ +const La = he("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" }] @@ -1261,14 +1261,14 @@ const ja = ge("ellipsis-vertical", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const za = ge("search", [ +const Ha = he("search", [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] ]); var Ne = ((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))(Ne || {}); -const Ha = K({ +const Ya = J({ name: "EliTabelaCaixaDeBusca", - components: { Search: za }, + components: { Search: Ha }, props: { modelo: { type: String, @@ -1282,41 +1282,41 @@ const Ha = K({ } }, setup(e, { emit: a }) { - const s = E(e.modelo ?? ""); - le( + const s = B(e.modelo ?? ""); + re( () => e.modelo, - (v) => { - v !== void 0 && v !== s.value && (s.value = v); + (p) => { + p !== void 0 && p !== s.value && (s.value = p); } ); - function f() { + function d() { a("buscar", s.value.trim()); } - return { texto: s, emitirBusca: f }; + return { texto: s, emitirBusca: d }; } -}), Ya = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; -function qa(e, a, s, f, v, y) { - const i = ce("Search"); - return T(), W("div", Ya, [ - G("div", Fa, [ - ze(G("input", { +}), za = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; +function qa(e, a, s, d, p, y) { + const l = ce("Search"); + return E(), R("div", za, [ + K("div", Fa, [ + Le(K("input", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (c) => e.texto = c), + "onUpdate:modelValue": a[0] || (a[0] = (f) => e.texto = f), type: "search", class: "eli-tabela__busca-input", placeholder: "Digite termos para filtrar", - onKeyup: a[1] || (a[1] = He((...c) => e.emitirBusca && e.emitirBusca(...c), ["enter"])) + onKeyup: a[1] || (a[1] = He((...f) => e.emitirBusca && e.emitirBusca(...f), ["enter"])) }, null, 544), [ [Ye, e.texto] ]), - G("button", { + K("button", { type: "button", class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...c) => e.emitirBusca && e.emitirBusca(...c)) + onClick: a[2] || (a[2] = (...f) => e.emitirBusca && e.emitirBusca(...f)) }, [ - B(i, { + D(l, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -1326,7 +1326,7 @@ function qa(e, a, s, f, v, y) { ]) ]); } -const Wa = /* @__PURE__ */ Q(Ha, [["render", qa], ["__scopeId", "data-v-0fd1ad15"]]), Ra = K({ +const Wa = /* @__PURE__ */ Z(Ya, [["render", qa], ["__scopeId", "data-v-0fd1ad15"]]), Ra = J({ name: "EliTabelaPaginacao", props: { pagina: { @@ -1348,45 +1348,45 @@ const Wa = /* @__PURE__ */ Q(Ha, [["render", qa], ["__scopeId", "data-v-0fd1ad15 } }, setup(e, { emit: a }) { - const s = D(() => { - const o = e.maximoBotoes; - return typeof o == "number" && o >= 5 ? Math.floor(o) : 7; - }), f = D(() => { - const o = e.totalPaginas, _ = e.pagina, C = s.value, H = [], S = (L) => { - H.push({ - label: String(L), - pagina: L, - ativo: L === _ + const s = V(() => { + const r = e.maximoBotoes; + return typeof r == "number" && r >= 5 ? Math.floor(r) : 7; + }), d = V(() => { + const r = e.totalPaginas, _ = e.pagina, C = s.value, z = [], M = (H) => { + z.push({ + label: String(H), + pagina: H, + ativo: H === _ }); - }, O = () => { - H.push({ label: "…", ehEllipsis: !0 }); + }, N = () => { + z.push({ label: "…", ehEllipsis: !0 }); }; - if (o <= C) { - for (let L = 1; L <= o; L += 1) - S(L); - return H; + if (r <= C) { + for (let H = 1; H <= r; H += 1) + M(H); + return z; } const w = Math.max(3, C - 2); - let J = Math.max(2, _ - Math.floor(w / 2)), Y = J + w - 1; - Y >= o && (Y = o - 1, J = Y - w + 1), S(1), J > 2 && O(); - for (let L = J; L <= Y; L += 1) - S(L); - return Y < o - 1 && O(), S(o), H; + let X = Math.max(2, _ - Math.floor(w / 2)), F = X + w - 1; + F >= r && (F = r - 1, X = F - w + 1), M(1), X > 2 && N(); + for (let H = X; H <= F; H += 1) + M(H); + return F < r - 1 && N(), M(r), z; }); - function v(o) { - if (!o) + function p(r) { + if (!r) return; - const _ = Math.min(Math.max(1, o), e.totalPaginas); + const _ = Math.min(Math.max(1, r), e.totalPaginas); _ !== e.pagina && a("alterar", _); } - const y = D(() => e.pagina <= 1), i = D(() => e.pagina >= e.totalPaginas), c = D(() => e.pagina), V = D(() => e.totalPaginas); + const y = V(() => e.pagina <= 1), l = V(() => e.pagina >= e.totalPaginas), f = V(() => e.pagina), S = V(() => e.totalPaginas); return { - botoes: f, - irParaPagina: v, + botoes: d, + irParaPagina: p, anteriorDesabilitado: y, - proximaDesabilitada: i, - paginaAtual: c, - totalPaginasExibidas: V + proximaDesabilitada: l, + paginaAtual: f, + totalPaginasExibidas: S }; } }), Ja = { @@ -1399,38 +1399,98 @@ const Wa = /* @__PURE__ */ Q(Ha, [["render", qa], ["__scopeId", "data-v-0fd1ad15 class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" }, Ga = ["disabled", "aria-current", "aria-label", "onClick"], Ka = ["disabled"]; -function Qa(e, a, s, f, v, y) { - return e.totalPaginasExibidas > 1 ? (T(), W("nav", Ja, [ - G("button", { +function Qa(e, a, s, d, p, y) { + return e.totalPaginasExibidas > 1 ? (E(), R("nav", Ja, [ + K("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.anteriorDesabilitado, "aria-label": "Página anterior", - onClick: a[0] || (a[0] = (i) => e.irParaPagina(e.paginaAtual - 1)) + onClick: a[0] || (a[0] = (l) => e.irParaPagina(e.paginaAtual - 1)) }, " << ", 8, Za), - (T(!0), W(he, null, Ve(e.botoes, (i, c) => (T(), W(he, { - key: `${i.label}-${c}` + (E(!0), R(be, null, $e(e.botoes, (l, f) => (E(), R(be, { + key: `${l.label}-${f}` }, [ - i.ehEllipsis ? (T(), W("span", Xa, be(i.label), 1)) : (T(), W("button", { + l.ehEllipsis ? (E(), R("span", Xa, ne(l.label), 1)) : (E(), R("button", { key: 1, type: "button", - class: Fe(["eli-tabela__pagina-botao", i.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), - disabled: i.ativo, - "aria-current": i.ativo ? "page" : void 0, - "aria-label": `Ir para página ${i.label}`, - onClick: (V) => e.irParaPagina(i.pagina) - }, be(i.label), 11, Ga)) + class: ze(["eli-tabela__pagina-botao", l.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + disabled: l.ativo, + "aria-current": l.ativo ? "page" : void 0, + "aria-label": `Ir para página ${l.label}`, + onClick: (S) => e.irParaPagina(l.pagina) + }, ne(l.label), 11, Ga)) ], 64))), 128)), - G("button", { + K("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.proximaDesabilitada, "aria-label": "Próxima página", - onClick: a[1] || (a[1] = (i) => e.irParaPagina(e.paginaAtual + 1)) + onClick: a[1] || (a[1] = (l) => e.irParaPagina(e.paginaAtual + 1)) }, " >> ", 8, Ka) - ])) : we("", !0); + ])) : Ve("", !0); } -const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455"]]), et = K({ +const xa = /* @__PURE__ */ Z(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455"]]), et = J({ + name: "EliTabelaCelulaTextoSimples", + components: {}, + props: { + dados: { + type: Object + } + }, + data() { + return {}; + }, + methods: {}, + setup({ dados: e }) { + return { dados: e }; + } +}); +function at(e, a, s, d, p, y) { + var l; + return ne((l = e.dados) == null ? void 0 : l.texto); +} +const tt = /* @__PURE__ */ Z(et, [["render", at]]), ot = J({ + name: "EliTabelaCelulaNumero", + components: {}, + props: { + dados: { + type: Object + } + }, + data() { + return {}; + }, + methods: {}, + setup({ dados: e }) { + return { dados: e }; + } +}); +function rt(e, a, s, d, p, y) { + var l; + return ne(String((l = e.dados) == null ? void 0 : l.numero).replace(".", ",")); +} +const lt = /* @__PURE__ */ Z(ot, [["render", rt]]), nt = { + textoSimples: tt, + numero: lt +}, it = J({ + name: "EliTabelaCelula", + props: { + celula: { + // `ComponenteCelula` é uma tupla `readonly [tipo, dados]`. + type: Array, + required: !0 + } + }, + setup(e) { + const a = V(() => e.celula[0]), s = V(() => e.celula[1]), d = V(() => nt[a.value]), p = V(() => s.value); + return { Componente: d, dadosParaComponente: p }; + } +}); +function st(e, a, s, d, p, y) { + return E(), W(Fe(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +} +const ut = /* @__PURE__ */ Z(it, [["render", st]]), dt = J({ name: "EliTabela", inheritAttrs: !1, props: { @@ -1443,69 +1503,58 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 } }, setup(e) { - const a = E(!1), s = E(null), f = E([]), v = E(0), y = E([]), i = E(null), c = /* @__PURE__ */ new Map(), V = E(""), o = E(1), _ = E(null), C = E("asc"), H = D(() => !!e.tabela.mostrarCaixaDeBusca), S = D(() => e.tabela.acoesTabela ?? []), O = D(() => S.value.length > 0), w = D(() => { + const a = B(!1), s = B(null), d = B([]), p = B(0), y = B([]), l = B(null), f = /* @__PURE__ */ new Map(), S = B(""), r = B(1), _ = B(null), C = B("asc"), z = V(() => !!e.tabela.mostrarCaixaDeBusca), M = V(() => e.tabela.acoesTabela ?? []), N = V(() => M.value.length > 0), w = V(() => { const t = e.tabela.registros_por_consulta; return typeof t == "number" && t > 0 ? Math.floor(t) : 10; - }), J = D(() => { + }), X = V(() => { const t = w.value; if (!t || t <= 0) return 1; - const l = v.value; - return l ? Math.max(1, Math.ceil(l / t)) : 1; + const o = p.value; + return o ? Math.max(1, Math.ceil(o / t)) : 1; }); - let Y = 0; - function L(t, l) { - l ? c.set(t, l) : c.delete(t); - } - function ne(t) { - return (l) => { - l instanceof HTMLElement ? L(t, l) : L(t, null); - }; - } - function ye(t) { - t && (_.value === t ? (C.value = C.value === "asc" ? "desc" : "asc", n()) : (_.value = t, C.value = "asc", o.value !== 1 ? o.value = 1 : n())); - } - function x(t) { - V.value !== t && (V.value = t, o.value !== 1 ? o.value = 1 : n()); - } - function Z(t) { - const l = Math.min(Math.max(1, t), J.value); - l !== o.value && (o.value = l); + let F = 0; + function H(t, o) { + o ? f.set(t, o) : f.delete(t); } function ie(t) { - if (i.value === null) - return; - const l = c.get(i.value); - l && l.contains(t.target) || (i.value = null); + return (o) => { + o instanceof HTMLElement ? H(t, o) : H(t, null); + }; + } + function ge(t) { + t && (_.value === t ? (C.value = C.value === "asc" ? "desc" : "asc", u()) : (_.value = t, C.value = "asc", r.value !== 1 ? r.value = 1 : u())); + } + function x(t) { + S.value !== t && (S.value = t, r.value !== 1 ? r.value = 1 : u()); + } + function G(t) { + const o = Math.min(Math.max(1, t), X.value); + o !== r.value && (r.value = o); } function se(t) { - return t == null || t === !1 ? "" : t; + if (l.value === null) + return; + const o = f.get(l.value); + o && o.contains(t.target) || (l.value = null); } - function ee(t) { + function ae(t) { return t === "direita" ? "eli-tabela__celula--direita" : t === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; } - function I(t) { + function te(t) { if (t != null) return typeof t == "number" ? `${t}px` : String(t); } - function k(t, l) { - const r = se(t); - if (!!!l.truncar || typeof r != "string" && typeof r != "number") - return r; - const d = String(r); - return h( - "span", - { - class: "eli-tabela__celula-conteudo", - style: l.largura_maxima ? { - maxWidth: I(l.largura_maxima) - } : void 0, - title: d - }, - d - ); + function O(t) { + if (!Array.isArray(t)) + return; + const o = t[0], i = t[1]; + if (o === "textoSimples") + return typeof (i == null ? void 0 : i.texto) == "string" ? i.texto : void 0; + if (o === "numero") + return typeof (i == null ? void 0 : i.numero) == "number" ? String(i.numero) : void 0; } - function oe(t) { + function k(t) { return h( "div", { @@ -1518,7 +1567,7 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 ] ); } - function fe(t) { + function oe(t) { return h( "div", { @@ -1527,7 +1576,7 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 t ?? "Nenhum registro encontrado." ); } - function p() { + function fe() { return h( "div", { @@ -1537,31 +1586,31 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 "Carregando..." ); } - async function n() { - var d, g; - const t = ++Y; - a.value = !0, s.value = null, y.value = [], i.value = null, c.clear(); - const l = Math.max(1, w.value), u = { - offSet: (o.value - 1) * l, - limit: l + async function u() { + var v, m; + const t = ++F; + a.value = !0, s.value = null, y.value = [], l.value = null, f.clear(); + const o = Math.max(1, w.value), n = { + offSet: (r.value - 1) * o, + limit: o }; - V.value && (u.texto_busca = V.value), _.value && (u.coluna_ordem = _.value, u.direcao_ordem = C.value); + S.value && (n.texto_busca = S.value), _.value && (n.coluna_ordem = _.value, n.direcao_ordem = C.value); try { - const b = e.tabela, m = await b.consulta(u); - if (t !== Y) + const b = e.tabela, c = await b.consulta(n); + if (t !== F) return; - if (m.cod !== Ne.sucesso) { - f.value = [], v.value = 0, s.value = m.mensagem; + if (c.cod !== Ne.sucesso) { + d.value = [], p.value = 0, s.value = c.mensagem; return; } - const $ = ((d = m.valor) == null ? void 0 : d.valores) ?? [], M = ((g = m.valor) == null ? void 0 : g.quantidade) ?? $.length; - f.value = $, v.value = M; - const N = Math.max( + const $ = ((v = c.valor) == null ? void 0 : v.valores) ?? [], g = ((m = c.valor) == null ? void 0 : m.quantidade) ?? $.length; + d.value = $, p.value = g; + const A = Math.max( 1, - Math.ceil((M || 0) / l) + Math.ceil((g || 0) / o) ); - if (o.value > N) { - o.value = N; + if (r.value > A) { + r.value = A; return; } const P = b.acoesLinha ?? []; @@ -1569,21 +1618,21 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 y.value = []; return; } - const F = $.map( - () => P.map((A) => A.exibir === void 0 ? !0 : typeof A.exibir == "boolean" ? A.exibir : !1) + const j = $.map( + () => P.map((U) => U.exibir === void 0 ? !0 : typeof U.exibir == "boolean" ? U.exibir : !1) ); - y.value = F; + y.value = j; const q = await Promise.all( $.map( - async (A) => Promise.all( - P.map(async (j) => { - if (j.exibir === void 0) + async (U) => Promise.all( + P.map(async (T) => { + if (T.exibir === void 0) return !0; - if (typeof j.exibir == "boolean") - return j.exibir; + if (typeof T.exibir == "boolean") + return T.exibir; try { - const X = j.exibir(A); - return !!await Promise.resolve(X); + const Y = T.exibir(U); + return !!await Promise.resolve(Y); } catch { return !1; } @@ -1591,54 +1640,54 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 ) ) ); - t === Y && (y.value = q); + t === F && (y.value = q); } catch (b) { - if (t !== Y) + if (t !== F) return; - f.value = [], v.value = 0, s.value = b instanceof Error ? b.message : "Erro ao carregar dados."; + d.value = [], p.value = 0, s.value = b instanceof Error ? b.message : "Erro ao carregar dados."; } finally { - t === Y && (a.value = !1); + t === F && (a.value = !1); } } return qe(() => { - document.addEventListener("click", ie), n(); - }), le( + document.addEventListener("click", se), u(); + }), re( () => e.tabela.mostrarCaixaDeBusca, (t) => { - !t && V.value && (V.value = "", o.value !== 1 ? o.value = 1 : n()); + !t && S.value && (S.value = "", r.value !== 1 ? r.value = 1 : u()); } - ), le(o, (t, l) => { - t !== l && n(); + ), re(r, (t, o) => { + t !== o && u(); }), We(() => { - document.removeEventListener("click", ie), c.clear(); - }), le( + document.removeEventListener("click", se), f.clear(); + }), re( () => e.tabela, () => { - i.value = null, c.clear(), _.value = null, C.value = "asc", V.value = "", o.value !== 1 ? o.value = 1 : n(); + l.value = null, f.clear(), _.value = null, C.value = "asc", S.value = "", r.value !== 1 ? r.value = 1 : u(); } - ), le( + ), re( () => e.tabela.registros_por_consulta, () => { - o.value !== 1 ? o.value = 1 : n(); + r.value !== 1 ? r.value = 1 : u(); } - ), le(f, () => { - i.value = null, c.clear(); + ), re(d, () => { + l.value = null, f.clear(); }), () => { const t = e.tabela; if (a.value) - return p(); + return fe(); if (s.value) - return oe(s.value); - const l = t.colunas, r = t.acoesLinha ?? [], u = r.length > 0; - if (!f.value.length) - return fe(t.mensagemVazio); - const d = l.map((b) => { - const m = b.coluna_ordem !== void 0 ? b.coluna_ordem : void 0, $ = !!m, M = $ && _.value === m, N = $ ? M ? h(C.value === "asc" ? Be : Na, { + return k(s.value); + const o = t.colunas, i = t.acoesLinha ?? [], n = i.length > 0; + if (!d.value.length) + return oe(t.mensagemVazio); + const v = o.map((b) => { + const c = b.coluna_ordem !== void 0 ? b.coluna_ordem : void 0, $ = !!c, g = $ && _.value === c, A = $ ? g ? h(C.value === "asc" ? De : ja, { class: "eli-tabela__th-icone", size: 16, strokeWidth: 2, "aria-hidden": "true" - }) : h(Be, { + }) : h(De, { class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", size: 16, strokeWidth: 2, @@ -1649,13 +1698,13 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 type: "button", class: [ "eli-tabela__th-botao", - M ? "eli-tabela__th-botao--ativo" : void 0 + g ? "eli-tabela__th-botao--ativo" : void 0 ], - onClick: () => ye(m) + onClick: () => ge(c) }, [ h("span", { class: "eli-tabela__th-texto" }, b.rotulo), - N + A ] ) : h("span", { class: "eli-tabela__th-label" }, b.rotulo); return h( @@ -1664,58 +1713,58 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 class: [ "eli-tabela__th", $ ? "eli-tabela__th--ordenavel" : void 0, - ee(b.alinhamento) + ae(b.alinhamento) ], scope: "col" }, P ); }); - u && d.push( + n && v.push( h( "th", { class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }, "Ações" ) ); - const g = []; - if (H.value || O.value) { - const b = S.value.map( - (m, $) => h( + const m = []; + if (z.value || N.value) { + const b = M.value.map( + (c, $) => h( "button", { - key: `${m.rotulo}-${$}`, + key: `${c.rotulo}-${$}`, type: "button", class: "eli-tabela__acoes-cabecalho-botao", // Quando `cor` for informada, tratamos como cor de destaque do botão. // Também ajustamos o texto/ícone para branco para manter contraste. - style: m.cor ? { - backgroundColor: m.cor, + style: c.cor ? { + backgroundColor: c.cor, color: "#fff" } : void 0, - onClick: m.acao + onClick: c.acao }, [ - m.icone ? h(m.icone, { + c.icone ? h(c.icone, { class: "eli-tabela__acoes-cabecalho-icone", size: 16, strokeWidth: 2 }) : null, - h("span", { class: "eli-tabela__acoes-cabecalho-rotulo" }, m.rotulo) + h("span", { class: "eli-tabela__acoes-cabecalho-rotulo" }, c.rotulo) ] ) ); - g.push( + m.push( h("div", { class: "eli-tabela__cabecalho" }, [ - H.value ? h(Wa, { - modelo: V.value, + z.value ? h(Wa, { + modelo: S.value, onBuscar: x }) : null, - O.value ? h("div", { class: "eli-tabela__acoes-cabecalho" }, b) : null + N.value ? h("div", { class: "eli-tabela__acoes-cabecalho" }, b) : null ]) ); } - return g.push( + return m.push( h("table", { class: "eli-tabela__table" }, [ h( "thead", @@ -1723,74 +1772,89 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 h( "tr", { class: "eli-tabela__tr eli-tabela__tr--header" }, - d + v ) ), h( "tbody", { class: "eli-tabela__tbody" }, - f.value.map((b, m) => { - const $ = l.map( - (M, N) => h( - "td", - { - class: [ - "eli-tabela__td", - M.acao ? "eli-tabela__td--clicavel" : void 0, - ee(M.alinhamento) - ], - key: `${m}-${N}`, - onClick: M.acao ? () => { - var P; - return (P = M.acao) == null ? void 0 : P.call(M); - } : void 0 - }, - k(M.celula(b), M) - ) + d.value.map((b, c) => { + const $ = o.map( + (g, A) => (() => { + const P = g.celula(b), j = !!g.truncar, q = j ? O(P) : void 0, U = h(ut, { + celula: P + }), T = j ? h( + "span", + { + class: "eli-tabela__celula-conteudo", + style: g.largura_maxima ? { + maxWidth: te(g.largura_maxima) + } : void 0, + title: q + }, + U + ) : U; + return h( + "td", + { + class: [ + "eli-tabela__td", + g.acao ? "eli-tabela__td--clicavel" : void 0, + ae(g.alinhamento) + ], + key: `${c}-${A}`, + onClick: g.acao ? () => { + var Y; + return (Y = g.acao) == null ? void 0 : Y.call(g); + } : void 0 + }, + T + ); + })() ); - if (u) { - const M = y.value[m] ?? [], N = r.map((z, me) => { - const $e = z.exibir === void 0 ? !0 : typeof z.exibir == "boolean" ? z.exibir : !1; + if (n) { + const g = y.value[c] ?? [], A = i.map((I, me) => { + const ye = I.exibir === void 0 ? !0 : typeof I.exibir == "boolean" ? I.exibir : !1; return { - acao: z, + acao: I, indice: me, - visivel: M[me] ?? $e + visivel: g[me] ?? ye }; - }).filter((z) => z.visivel), P = N.length > 0; - !P && i.value === m && (i.value = null); - const F = i.value === m, q = `eli-tabela-acoes-toggle-${m}`, A = `eli-tabela-acoes-menu-${m}`, j = h( + }).filter((I) => I.visivel), P = A.length > 0; + !P && l.value === c && (l.value = null); + const j = l.value === c, q = `eli-tabela-acoes-toggle-${c}`, U = `eli-tabela-acoes-menu-${c}`, T = h( "button", { id: q, class: "eli-tabela__acoes-toggle", type: "button", disabled: !P, - onClick: (z) => { - z.stopPropagation(), P && (i.value = F ? null : m); + onClick: (I) => { + I.stopPropagation(), P && (l.value = j ? null : c); }, "aria-haspopup": "menu", - "aria-expanded": F ? "true" : "false", - "aria-controls": P ? A : void 0, + "aria-expanded": j ? "true" : "false", + "aria-controls": P ? U : void 0, "aria-label": P ? "Ações da linha" : "Nenhuma ação disponível", title: P ? "Ações" : "Nenhuma ação disponível" }, [ - h(ja, { + h(La, { class: "eli-tabela__acoes-toggle-icone", size: 18, strokeWidth: 2 }) ] - ), X = F && P ? h( + ), Y = j && P ? h( "ul", { - id: A, + id: U, class: "eli-tabela__acoes-menu", role: "menu", "aria-labelledby": q }, - N.map( - ({ acao: z, indice: me }) => h( + A.map( + ({ acao: I, indice: me }) => h( "li", { key: `acao-${me}`, @@ -1803,17 +1867,17 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 type: "button", class: "eli-tabela__acoes-item-botao", style: { - color: z.cor + color: I.cor }, - onClick: ($e) => { - $e.stopPropagation(), i.value = null, z.acao(b); + onClick: (ye) => { + ye.stopPropagation(), l.value = null, I.acao(b); }, role: "menuitem", - "aria-label": z.rotulo, - title: z.rotulo + "aria-label": I.rotulo, + title: I.rotulo }, [ - h(z.icone, { + h(I.icone, { class: "eli-tabela__acoes-item-icone", size: 16, strokeWidth: 2 @@ -1821,27 +1885,27 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 h( "span", { class: "eli-tabela__acoes-item-texto" }, - z.rotulo + I.rotulo ) ] ) ) ) - ) : null, ae = ["eli-tabela__acoes-container"]; - F && ae.push("eli-tabela__acoes-container--aberto"), $.push( + ) : null, Q = ["eli-tabela__acoes-container"]; + j && Q.push("eli-tabela__acoes-container--aberto"), $.push( h( "td", { class: ["eli-tabela__td", "eli-tabela__td--acoes"], - key: `${m}-acoes` + key: `${c}-acoes` }, h( "div", { - class: ae, - ref: ne(m) + class: Q, + ref: ie(c) }, - [j, X] + [T, Y] ) ) ); @@ -1849,21 +1913,21 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 return h( "tr", { - class: ["eli-tabela__tr", m % 2 === 1 ? "eli-tabela__tr--zebra" : void 0], - key: m + class: ["eli-tabela__tr", c % 2 === 1 ? "eli-tabela__tr--zebra" : void 0], + key: c }, $ ); }) ) ]) - ), J.value > 1 && v.value > 0 && g.push( + ), X.value > 1 && p.value > 0 && m.push( h(xa, { - pagina: o.value, - totalPaginas: J.value, + pagina: r.value, + totalPaginas: X.value, maximoBotoes: e.tabela.maximo_botoes_paginacao, onAlterar: (b) => { - Z(b); + G(b); } }) ), h( @@ -1871,26 +1935,26 @@ const xa = /* @__PURE__ */ Q(Ra, [["render", Qa], ["__scopeId", "data-v-59d12455 { class: "eli-tabela" }, - g + m ); }; } }); -function at(e, a, s, f, v, y) { - return T(), W("div"); +function ct(e, a, s, d, p, y) { + return E(), R("div"); } -const tt = /* @__PURE__ */ Q(et, [["render", at], ["__scopeId", "data-v-40942745"]]), vt = { +const ft = /* @__PURE__ */ Z(dt, [["render", ct], ["__scopeId", "data-v-cfac9b47"]]), Mt = { install(e) { - e.component("EliOlaMundo", ya), e.component("EliBotao", Oe), e.component("EliBadge", ke), e.component("EliInput", Le), e.component("EliCartao", Sa), e.component("EliDataHora", Aa), e.component("EliTabela", tt); + e.component("EliOlaMundo", ya), e.component("EliBotao", Oe), e.component("EliBadge", Se), e.component("EliInput", Ue), e.component("EliCartao", ka), e.component("EliDataHora", Ta), e.component("EliTabela", ft); } }; export { - ke as EliBadge, + Se as EliBadge, Oe as EliBotao, - Sa as EliCartao, - Aa as EliDataHora, - Le as EliInput, + ka as EliCartao, + Ta as EliDataHora, + Ue as EliInput, ya as EliOlaMundo, - tt as EliTabela, - vt as default + ft as EliTabela, + Mt as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index 663c02c..e3a9ddb 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,9 +1,9 @@ -(function(E,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):(E=typeof globalThis<"u"?globalThis:E||self,t(E.eli_vue={},E.Vue,E.VBtn,E.VBadge,E.VCheckbox,E.VIcon,E.VRadio,E.VRadioGroup,E.VSelect,E.VTextField,E.VTextarea,E.VCard,E.VGrid))})(this,(function(E,t,ve,we,Ce,Se,Me,Ee,De,ce,_e,R,Ne){"use strict";const Pe=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}}}),H=(e,a)=>{const d=e.__vccOpts||e;for(const[m,b]of a)d[m]=b;return d};function Te(e,a,d,m,b,$){return t.openBlock(),t.createBlock(ve.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const le=H(Pe,[["render",Te]]),fe={suave:"4px",pill:"10px"},Ae=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 fe?fe[e.radius]:e.radius),d=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),m=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:d,badgeStyle:m}}});function Ie(e,a,d,m,b,$){return e.showBadge?(t.openBlock(),t.createBlock(we.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}),{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 ee=H(Ae,[["render",Ie],["__scopeId","data-v-de2fbf2f"]]);function Oe(e){return e.replace(/\D+/g,"")}function Ue(e){const a=Oe(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 Le(e){return e.replace(/\D+/g,"")}function je(e){const a=Le(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 ie(e){return e.replace(/\D+/g,"")}function me(e){const a=e.replace(/[^\d,]/g,""),d=a.split(",");return d.length>2?d[0]+","+d.slice(1).join(""):a}function qe(e){return me(e.replace(/%/g,""))}function Fe(e){const a=ie(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function He(e){const a=ie(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const ze=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:d}){const m=t.ref(!1),b=t.ref(!1),$=t.computed({get:()=>e.modelValue,set:w=>{a("update:modelValue",w),a("change",w)}}),s=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),f=t.computed(()=>e.type==="password"?b.value?"text":"password":"text"),k=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),n=t.computed(()=>e.error?"error":m.value?e.color:void 0);function M(w){const P=w.target;let B=P.value;switch(e.type){case"numericoInteiro":B=ie(B);break;case"numericoDecimal":B=me(B);break;case"numericoMoeda":B=Fe(B);break;case"porcentagem":B=qe(B);break;case"telefone":B=je(B);break;case"cpfCnpj":B=Ue(B);break;case"cep":B=He(B);break}P.value=B,a("update:modelValue",B),a("change",B)}function S(){b.value=!b.value}const U=t.computed(()=>(e.options||[]).map(w=>{if(w&&typeof w=="object"&&"value"in w){const B=w.value;return{label:w.label??String(B),value:B,disabled:w.disabled}}const P=w;return{label:String(P),value:P}}));return{attrs:d,value:$,isTextLike:s,inputHtmlType:f,inputMode:k,internalColor:n,showPassword:b,togglePassword:S,onInput:M,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:U}}}),Ye={class:"eli-input"},Re={key:4,class:"checkbox-group"};function We(e,a,d,m,b,$){return t.openBlock(),t.createElementBlock("div",Ye,[e.isTextLike?(t.openBlock(),t.createBlock(ce.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=s=>e.value=s),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(Se.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(_e.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=s=>e.value=s),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(De.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=s=>e.value=s),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(Ee.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=s=>e.value=s),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,s=>(t.openBlock(),t.createBlock(Me.VRadio,{key:String(s.value),label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Re,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,s=>(t.openBlock(),t.createBlock(Ce.VCheckbox,{key:String(s.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=f=>e.value=f),label:s.label,value:s.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const se=H(ze,[["render",We],["__scopeId","data-v-756cb549"]]),Ge=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:le,EliBadge:ee,EliInput:se},setup(){const e=t.ref(""),a=t.ref([]),d=t.ref(""),m=t.ref(""),b=t.ref(""),$=t.ref(""),s=t.ref(""),f=t.ref(""),k=t.ref(""),n=t.ref(""),M=t.ref(""),S=t.ref(null),U=t.ref([]);return{nome:e,email:f,documento:M,estado:a,telefone:m,mensagem:k,senha:n,cor:S,habilidades:U,idade:b,altura:$,cep:d,valor:s}}}),Je={class:"grid-example"};function Ze(e,a,d,m,b,$){const s=t.resolveComponent("EliBadge"),f=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ne.VContainer,null,{default:t.withCtx(()=>[t.createVNode(R.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(R.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(s,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(R.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Je,[t.createVNode(f,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=n=>e.nome=n),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=n=>e.idade=n),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=n=>e.altura=n),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=n=>e.valor=n),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=n=>e.telefone=n),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=n=>e.cep=n),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(f,{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]=n=>e.estado=n),multiple:""},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=n=>e.documento=n),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=n=>e.email=n),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=n=>e.senha=n),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(f,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=n=>e.mensagem=n),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(f,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=n=>e.cor=n),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(f,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=n=>e.habilidades=n),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=n=>e.nome=n),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(R.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const pe=H(Ge,[["render",Ze]]),Xe=t.defineComponent({name:"EliCartao",components:{EliBadge:ee},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 d=t.computed(()=>e.status),m=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),b=t.computed(()=>`eli-cartao--${e.status}`);function $(){a("clicar",e.status)}return{rotuloStatus:d,corStatus:m,classeStatus:b,onClick:$}}}),Ke={class:"eli-cartao__titulo-texto"},Qe={class:"eli-cartao__status"};function xe(e,a,d,m,b,$){const s=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(R.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(R.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ke,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Qe,[t.createVNode(s,{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(R.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(R.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 he=H(Xe,[["render",xe],["__scopeId","data-v-6c492bd9"]]);function et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},tt=te.exports,be;function at(){return be||(be=1,(function(e,a){(function(d,m){e.exports=m()})(tt,(function(){var d=1e3,m=6e4,b=36e5,$="millisecond",s="second",f="minute",k="hour",n="day",M="week",S="month",U="quarter",w="year",P="date",B="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,L=/\[([^\]]+)]|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,T={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(h){var i=["th","st","nd","rd"],o=h%100;return"["+h+(i[(o-20)%10]||i[o]||i[0])+"]"}},K=function(h,i,o){var r=String(h);return!r||r.length>=i?h:""+Array(i+1-r.length).join(o)+h},de={s:K,z:function(h){var i=-h.utcOffset(),o=Math.abs(i),r=Math.floor(o/60),l=o%60;return(i<=0?"+":"-")+K(r,2,"0")+":"+K(l,2,"0")},m:function h(i,o){if(i.date()1)return h(c[0])}else{var y=i.name;z[y]=i,l=y}return!r&&l&&(W=l),l||!r&&W},N=function(h,i){if(x(h))return h.clone();var o=typeof i=="object"?i:{};return o.date=h,o.args=arguments,new Z(o)},v=de;v.l=G,v.i=x,v.w=function(h,i){return N(h,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Z=(function(){function h(o){this.$L=G(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[Q]=!0}var i=h.prototype;return i.parse=function(o){this.$d=(function(r){var l=r.date,u=r.utc;if(l===null)return new Date(NaN);if(v.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var c=l.match(F);if(c){var y=c[2]-1||0,g=(c[7]||"0").substring(0,3);return u?new Date(Date.UTC(c[1],y,c[3]||1,c[4]||0,c[5]||0,c[6]||0,g)):new Date(c[1],y,c[3]||1,c[4]||0,c[5]||0,c[6]||0,g)}}return new Date(l)})(o),this.init()},i.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},i.$utils=function(){return v},i.isValid=function(){return this.$d.toString()!==B},i.isSame=function(o,r){var l=N(o);return this.startOf(r)<=l&&l<=this.endOf(r)},i.isAfter=function(o,r){return N(o)[]},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:d}){const m=t.computed(()=>e.modo==="data"?"date":"datetime-local");function b(n){return e.modo==="data"?ae(n).format("YYYY-MM-DD"):ae(n).format("YYYY-MM-DDTHH:mm")}function $(n){return e.modo==="data"?ae(`${n}T00:00`).format():ae(n).format()}const s=t.computed({get:()=>e.modelValue?b(e.modelValue):"",set:n=>{const M=n&&n.length>0?n:null;if(!M){a("update:modelValue",null),a("alterar",null);return}const S=$(M);a("update:modelValue",S),a("alterar",S)}}),f=t.computed(()=>{if(e.min)return b(e.min)}),k=t.computed(()=>{if(e.max)return b(e.max)});return{attrs:d,valor:s,emit:a,minLocal:f,maxLocal:k,tipoInput:m}}}),rt={class:"eli-data-hora"};function lt(e,a,d,m,b,$){return t.openBlock(),t.createElementBlock("div",rt,[t.createVNode(ce.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=s=>e.valor=s),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]=s=>e.emit("foco")),onBlur:a[2]||(a[2]=s=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const ge=H(nt,[["render",lt],["__scopeId","data-v-71afabb6"]]);/** +(function(E,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):(E=typeof globalThis<"u"?globalThis:E||self,t(E.eli_vue={},E.Vue,E.VBtn,E.VBadge,E.VCheckbox,E.VIcon,E.VRadio,E.VRadioGroup,E.VSelect,E.VTextField,E.VTextarea,E.VCard,E.VGrid))})(this,(function(E,t,Ce,Be,we,ve,Se,Ee,Me,ue,_e,z,De){"use strict";const Ne=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}}}),q=(e,a)=>{const d=e.__vccOpts||e;for(const[c,h]of a)d[c]=h;return d};function Te(e,a,d,c,h,$){return t.openBlock(),t.createBlock(Ce.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const re=q(Ne,[["render",Te]]),ce={suave:"4px",pill:"10px"},Pe=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 ce?ce[e.radius]:e.radius),d=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),c=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:d,badgeStyle:c}}});function Ae(e,a,d,c,h,$){return e.showBadge?(t.openBlock(),t.createBlock(Be.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}),{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 x=q(Pe,[["render",Ae],["__scopeId","data-v-de2fbf2f"]]);function Ie(e){return e.replace(/\D+/g,"")}function Oe(e){const a=Ie(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 Ue(e){return e.replace(/\D+/g,"")}function je(e){const a=Ue(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 le(e){return e.replace(/\D+/g,"")}function me(e){const a=e.replace(/[^\d,]/g,""),d=a.split(",");return d.length>2?d[0]+","+d.slice(1).join(""):a}function Le(e){return me(e.replace(/%/g,""))}function qe(e){const a=le(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Fe(e){const a=le(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const He=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:d}){const c=t.ref(!1),h=t.ref(!1),$=t.computed({get:()=>e.modelValue,set:w=>{a("update:modelValue",w),a("change",w)}}),l=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),f=t.computed(()=>e.type==="password"?h.value?"text":"password":"text"),k=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":c.value?e.color:void 0);function S(w){const A=w.target;let C=A.value;switch(e.type){case"numericoInteiro":C=le(C);break;case"numericoDecimal":C=me(C);break;case"numericoMoeda":C=qe(C);break;case"porcentagem":C=Le(C);break;case"telefone":C=je(C);break;case"cpfCnpj":C=Oe(C);break;case"cep":C=Fe(C);break}A.value=C,a("update:modelValue",C),a("change",C)}function v(){h.value=!h.value}const j=t.computed(()=>(e.options||[]).map(w=>{if(w&&typeof w=="object"&&"value"in w){const C=w.value;return{label:w.label??String(C),value:C,disabled:w.disabled}}const A=w;return{label:String(A),value:A}}));return{attrs:d,value:$,isTextLike:l,inputHtmlType:f,inputMode:k,internalColor:r,showPassword:h,togglePassword:v,onInput:S,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:j}}}),Ye={class:"eli-input"},ze={key:4,class:"checkbox-group"};function Re(e,a,d,c,h,$){return t.openBlock(),t.createElementBlock("div",Ye,[e.isTextLike?(t.openBlock(),t.createBlock(ue.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),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(ve.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(_e.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=l=>e.value=l),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(Me.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=l=>e.value=l),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(Ee.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=l=>e.value=l),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(l.value),label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",ze,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(we.VCheckbox,{key:String(l.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=f=>e.value=f),label:l.label,value:l.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const ie=q(He,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:re,EliBadge:x,EliInput:ie},setup(){const e=t.ref(""),a=t.ref([]),d=t.ref(""),c=t.ref(""),h=t.ref(""),$=t.ref(""),l=t.ref(""),f=t.ref(""),k=t.ref(""),r=t.ref(""),S=t.ref(""),v=t.ref(null),j=t.ref([]);return{nome:e,email:f,documento:S,estado:a,telefone:c,mensagem:k,senha:r,cor:v,habilidades:j,idade:h,altura:$,cep:d,valor:l}}}),Ge={class:"grid-example"};function Je(e,a,d,c,h,$){const l=t.resolveComponent("EliBadge"),f=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(De.VContainer,null,{default:t.withCtx(()=>[t.createVNode(z.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(z.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(l,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(z.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Ge,[t.createVNode(f,{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(f,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(f,{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(f,{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(f,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(f,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(f,{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(f,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(f,{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(f,{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(f,{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(z.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const fe=q(We,[["render",Je]]),Ze=t.defineComponent({name:"EliCartao",components:{EliBadge:x},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 d=t.computed(()=>e.status),c=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),h=t.computed(()=>`eli-cartao--${e.status}`);function $(){a("clicar",e.status)}return{rotuloStatus:d,corStatus:c,classeStatus:h,onClick:$}}}),Xe={class:"eli-cartao__titulo-texto"},Ke={class:"eli-cartao__status"};function Qe(e,a,d,c,h,$){const l=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(z.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(z.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Xe,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Ke,[t.createVNode(l,{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(z.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(z.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 pe=q(Ze,[["render",Qe],["__scopeId","data-v-6c492bd9"]]);function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ee={exports:{}},et=ee.exports,he;function tt(){return he||(he=1,(function(e,a){(function(d,c){e.exports=c()})(et,(function(){var d=1e3,c=6e4,h=36e5,$="millisecond",l="second",f="minute",k="hour",r="day",S="week",v="month",j="quarter",w="year",A="date",C="Invalid Date",H=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,L=/\[([^\]]+)]|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,O={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(u){var o=["th","st","nd","rd"],n=u%100;return"["+u+(o[(n-20)%10]||o[n]||o[0])+"]"}},K=function(u,o,n){var s=String(u);return!s||s.length>=o?u:""+Array(o+1-s.length).join(n)+u},se={s:K,z:function(u){var o=-u.utcOffset(),n=Math.abs(o),s=Math.floor(n/60),i=n%60;return(o<=0?"+":"-")+K(s,2,"0")+":"+K(i,2,"0")},m:function u(o,n){if(o.date()1)return u(p[0])}else{var y=o.name;Y[y]=o,i=y}return!s&&i&&(W=i),i||!s&&W},N=function(u,o){if(G(u))return u.clone();var n=typeof o=="object"?o:{};return n.date=u,n.args=arguments,new Z(n)},B=se;B.l=J,B.i=G,B.w=function(u,o){return N(u,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var Z=(function(){function u(n){this.$L=J(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[Q]=!0}var o=u.prototype;return o.parse=function(n){this.$d=(function(s){var i=s.date,b=s.utc;if(i===null)return new Date(NaN);if(B.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var p=i.match(H);if(p){var y=p[2]-1||0,m=(p[7]||"0").substring(0,3);return b?new Date(Date.UTC(p[1],y,p[3]||1,p[4]||0,p[5]||0,p[6]||0,m)):new Date(p[1],y,p[3]||1,p[4]||0,p[5]||0,p[6]||0,m)}}return new Date(i)})(n),this.init()},o.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},o.$utils=function(){return B},o.isValid=function(){return this.$d.toString()!==C},o.isSame=function(n,s){var i=N(n);return this.startOf(s)<=i&&i<=this.endOf(s)},o.isAfter=function(n,s){return N(n)[]},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:d}){const c=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(r){return e.modo==="data"?te(r).format("YYYY-MM-DD"):te(r).format("YYYY-MM-DDTHH:mm")}function $(r){return e.modo==="data"?te(`${r}T00:00`).format():te(r).format()}const l=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:r=>{const S=r&&r.length>0?r:null;if(!S){a("update:modelValue",null),a("alterar",null);return}const v=$(S);a("update:modelValue",v),a("alterar",v)}}),f=t.computed(()=>{if(e.min)return h(e.min)}),k=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:d,valor:l,emit:a,minLocal:f,maxLocal:k,tipoInput:c}}}),nt={class:"eli-data-hora"};function rt(e,a,d,c,h,$){return t.openBlock(),t.createElementBlock("div",nt,[t.createVNode(ue.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=l=>e.valor=l),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]=l=>e.emit("foco")),onBlur:a[2]||(a[2]=l=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const be=q(ot,[["render",rt],["__scopeId","data-v-71afabb6"]]);/** * @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 it=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + */const lt=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. @@ -13,22 +13,22 @@ * * 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.filter((a,d,m)=>!!a&&a.trim()!==""&&m.indexOf(a)===d).join(" ").trim();/** + */const it=(...e)=>e.filter((a,d,c)=>!!a&&a.trim()!==""&&c.indexOf(a)===d).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 $e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const ge=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 dt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,d,m)=>m?m.toUpperCase():d.toLowerCase());/** + */const st=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,d,c)=>c?c.toUpperCase():d.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 ut=e=>{const a=dt(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + */const dt=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. @@ -38,29 +38,29 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ct=({name:e,iconNode:a,absoluteStrokeWidth:d,"absolute-stroke-width":m,strokeWidth:b,"stroke-width":$,size:s=X.width,color:f=X.stroke,...k},{slots:n})=>t.h("svg",{...X,...k,width:s,height:s,stroke:f,"stroke-width":ye(d)||ye(m)||d===!0||m===!0?Number(b||$||X["stroke-width"])*24/Number(s):b||$||X["stroke-width"],class:st("lucide",k.class,...e?[`lucide-${$e(ut(e))}-icon`,`lucide-${$e(e)}`]:["lucide-icon"]),...!n.default&&!it(k)&&{"aria-hidden":"true"}},[...a.map(M=>t.h(...M)),...n.default?[n.default()]:[]]);/** + */const ut=({name:e,iconNode:a,absoluteStrokeWidth:d,"absolute-stroke-width":c,strokeWidth:h,"stroke-width":$,size:l=X.width,color:f=X.stroke,...k},{slots:r})=>t.h("svg",{...X,...k,width:l,height:l,stroke:f,"stroke-width":ye(d)||ye(c)||d===!0||c===!0?Number(h||$||X["stroke-width"])*24/Number(l):h||$||X["stroke-width"],class:it("lucide",k.class,...e?[`lucide-${ge(dt(e))}-icon`,`lucide-${ge(e)}`]:["lucide-icon"]),...!r.default&&!lt(k)&&{"aria-hidden":"true"}},[...a.map(S=>t.h(...S)),...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 oe=(e,a)=>(d,{slots:m,attrs:b})=>t.h(ct,{...b,...d,iconNode:a,name:e},m);/** + */const ae=(e,a)=>(d,{slots:c,attrs:h})=>t.h(ut,{...h,...d,iconNode:a,name:e},c);/** * @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 ft=oe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const ct=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=oe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const $e=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 mt=oe("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"}]]);/** + */const mt=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 pt=oe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var ke=(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))(ke||{});const ht=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:pt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.ref(e.modelo??"");t.watch(()=>e.modelo,b=>{b!==void 0&&b!==d.value&&(d.value=b)});function m(){a("buscar",d.value.trim())}return{texto:d,emitirBusca:m}}}),bt={class:"eli-tabela__busca"},gt={class:"eli-tabela__busca-input-wrapper"};function yt(e,a,d,m,b,$){const s=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",bt,[t.createElementVNode("div",gt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=f=>e.texto=f),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...f)=>e.emitirBusca&&e.emitirBusca(...f),["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]=(...f)=>e.emitirBusca&&e.emitirBusca(...f))},[t.createVNode(s,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const $t=H(ht,[["render",yt],["__scopeId","data-v-0fd1ad15"]]),Vt=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 d=t.computed(()=>{const n=e.maximoBotoes;return typeof n=="number"&&n>=5?Math.floor(n):7}),m=t.computed(()=>{const n=e.totalPaginas,M=e.pagina,S=d.value,U=[],w=T=>{U.push({label:String(T),pagina:T,ativo:T===M})},P=()=>{U.push({label:"…",ehEllipsis:!0})};if(n<=S){for(let T=1;T<=n;T+=1)w(T);return U}const B=Math.max(3,S-2);let F=Math.max(2,M-Math.floor(B/2)),L=F+B-1;L>=n&&(L=n-1,F=L-B+1),w(1),F>2&&P();for(let T=F;T<=L;T+=1)w(T);return Le.pagina<=1),s=t.computed(()=>e.pagina>=e.totalPaginas),f=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:m,irParaPagina:b,anteriorDesabilitado:$,proximaDesabilitada:s,paginaAtual:f,totalPaginasExibidas:k}}}),kt={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},Bt=["disabled"],vt={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},wt=["disabled","aria-current","aria-label","onClick"],Ct=["disabled"];function St(e,a,d,m,b,$){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",kt,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=s=>e.irParaPagina(e.paginaAtual-1))}," << ",8,Bt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(s,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${s.label}-${f}`},[s.ehEllipsis?(t.openBlock(),t.createElementBlock("span",vt,t.toDisplayString(s.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",s.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:s.ativo,"aria-current":s.ativo?"page":void 0,"aria-label":`Ir para página ${s.label}`,onClick:k=>e.irParaPagina(s.pagina)},t.toDisplayString(s.label),11,wt))],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]=s=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,Ct)])):t.createCommentVNode("",!0)}const Mt=H(Vt,[["render",St],["__scopeId","data-v-59d12455"]]),Et=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),d=t.ref(null),m=t.ref([]),b=t.ref(0),$=t.ref([]),s=t.ref(null),f=new Map,k=t.ref(""),n=t.ref(1),M=t.ref(null),S=t.ref("asc"),U=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),w=t.computed(()=>e.tabela.acoesTabela??[]),P=t.computed(()=>w.value.length>0),B=t.computed(()=>{const o=e.tabela.registros_por_consulta;return typeof o=="number"&&o>0?Math.floor(o):10}),F=t.computed(()=>{const o=B.value;if(!o||o<=0)return 1;const r=b.value;return r?Math.max(1,Math.ceil(r/o)):1});let L=0;function T(o,r){r?f.set(o,r):f.delete(o)}function K(o){return r=>{r instanceof HTMLElement?T(o,r):T(o,null)}}function de(o){o&&(M.value===o?(S.value=S.value==="asc"?"desc":"asc",i()):(M.value=o,S.value="asc",n.value!==1?n.value=1:i()))}function W(o){k.value!==o&&(k.value=o,n.value!==1?n.value=1:i())}function z(o){const r=Math.min(Math.max(1,o),F.value);r!==n.value&&(n.value=r)}function Q(o){if(s.value===null)return;const r=f.get(s.value);r&&r.contains(o.target)||(s.value=null)}function x(o){return o==null||o===!1?"":o}function G(o){return o==="direita"?"eli-tabela__celula--direita":o==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function N(o){if(o!=null)return typeof o=="number"?`${o}px`:String(o)}function v(o,r){const l=x(o);if(!!!r.truncar||typeof l!="string"&&typeof l!="number")return l;const c=String(l);return t.h("span",{class:"eli-tabela__celula-conteudo",style:r.largura_maxima?{maxWidth:N(r.largura_maxima)}:void 0,title:c},c)}function Z(o){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},o)])}function ne(o){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},o??"Nenhum registro encontrado.")}function h(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function i(){var c,y;const o=++L;a.value=!0,d.value=null,$.value=[],s.value=null,f.clear();const r=Math.max(1,B.value),u={offSet:(n.value-1)*r,limit:r};k.value&&(u.texto_busca=k.value),M.value&&(u.coluna_ordem=M.value,u.direcao_ordem=S.value);try{const g=e.tabela,p=await g.consulta(u);if(o!==L)return;if(p.cod!==ke.sucesso){m.value=[],b.value=0,d.value=p.mensagem;return}const V=((c=p.valor)==null?void 0:c.valores)??[],C=((y=p.valor)==null?void 0:y.quantidade)??V.length;m.value=V,b.value=C;const A=Math.max(1,Math.ceil((C||0)/r));if(n.value>A){n.value=A;return}const D=g.acoesLinha??[];if(!D.length){$.value=[];return}const j=V.map(()=>D.map(_=>_.exibir===void 0?!0:typeof _.exibir=="boolean"?_.exibir:!1));$.value=j;const q=await Promise.all(V.map(async _=>Promise.all(D.map(async I=>{if(I.exibir===void 0)return!0;if(typeof I.exibir=="boolean")return I.exibir;try{const Y=I.exibir(_);return!!await Promise.resolve(Y)}catch{return!1}}))));o===L&&($.value=q)}catch(g){if(o!==L)return;m.value=[],b.value=0,d.value=g instanceof Error?g.message:"Erro ao carregar dados."}finally{o===L&&(a.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Q),i()}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,o=>{!o&&k.value&&(k.value="",n.value!==1?n.value=1:i())}),t.watch(n,(o,r)=>{o!==r&&i()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Q),f.clear()}),t.watch(()=>e.tabela,()=>{s.value=null,f.clear(),M.value=null,S.value="asc",k.value="",n.value!==1?n.value=1:i()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{n.value!==1?n.value=1:i()}),t.watch(m,()=>{s.value=null,f.clear()}),()=>{const o=e.tabela;if(a.value)return h();if(d.value)return Z(d.value);const r=o.colunas,l=o.acoesLinha??[],u=l.length>0;if(!m.value.length)return ne(o.mensagemVazio);const c=r.map(g=>{const p=g.coluna_ordem!==void 0?g.coluna_ordem:void 0,V=!!p,C=V&&M.value===p,A=V?C?t.h(S.value==="asc"?Ve:ft,{class:"eli-tabela__th-icone",size:16,strokeWidth:2,"aria-hidden":"true"}):t.h(Ve,{class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,strokeWidth:2,"aria-hidden":"true"}):null,D=V?t.h("button",{type:"button",class:["eli-tabela__th-botao",C?"eli-tabela__th-botao--ativo":void 0],onClick:()=>de(p)},[t.h("span",{class:"eli-tabela__th-texto"},g.rotulo),A]):t.h("span",{class:"eli-tabela__th-label"},g.rotulo);return t.h("th",{class:["eli-tabela__th",V?"eli-tabela__th--ordenavel":void 0,G(g.alinhamento)],scope:"col"},D)});u&&c.push(t.h("th",{class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"},"Ações"));const y=[];if(U.value||P.value){const g=w.value.map((p,V)=>t.h("button",{key:`${p.rotulo}-${V}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:p.cor?{backgroundColor:p.cor,color:"#fff"}:void 0,onClick:p.acao},[p.icone?t.h(p.icone,{class:"eli-tabela__acoes-cabecalho-icone",size:16,strokeWidth:2}):null,t.h("span",{class:"eli-tabela__acoes-cabecalho-rotulo"},p.rotulo)]));y.push(t.h("div",{class:"eli-tabela__cabecalho"},[U.value?t.h($t,{modelo:k.value,onBuscar:W}):null,P.value?t.h("div",{class:"eli-tabela__acoes-cabecalho"},g):null]))}return y.push(t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},c)),t.h("tbody",{class:"eli-tabela__tbody"},m.value.map((g,p)=>{const V=r.map((C,A)=>t.h("td",{class:["eli-tabela__td",C.acao?"eli-tabela__td--clicavel":void 0,G(C.alinhamento)],key:`${p}-${A}`,onClick:C.acao?()=>{var D;return(D=C.acao)==null?void 0:D.call(C)}:void 0},v(C.celula(g),C)));if(u){const C=$.value[p]??[],A=l.map((O,re)=>{const ue=O.exibir===void 0?!0:typeof O.exibir=="boolean"?O.exibir:!1;return{acao:O,indice:re,visivel:C[re]??ue}}).filter(O=>O.visivel),D=A.length>0;!D&&s.value===p&&(s.value=null);const j=s.value===p,q=`eli-tabela-acoes-toggle-${p}`,_=`eli-tabela-acoes-menu-${p}`,I=t.h("button",{id:q,class:"eli-tabela__acoes-toggle",type:"button",disabled:!D,onClick:O=>{O.stopPropagation(),D&&(s.value=j?null:p)},"aria-haspopup":"menu","aria-expanded":j?"true":"false","aria-controls":D?_:void 0,"aria-label":D?"Ações da linha":"Nenhuma ação disponível",title:D?"Ações":"Nenhuma ação disponível"},[t.h(mt,{class:"eli-tabela__acoes-toggle-icone",size:18,strokeWidth:2})]),Y=j&&D?t.h("ul",{id:_,class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":q},A.map(({acao:O,indice:re})=>t.h("li",{key:`acao-${re}`,class:"eli-tabela__acoes-item",role:"none"},t.h("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:{color:O.cor},onClick:ue=>{ue.stopPropagation(),s.value=null,O.acao(g)},role:"menuitem","aria-label":O.rotulo,title:O.rotulo},[t.h(O.icone,{class:"eli-tabela__acoes-item-icone",size:16,strokeWidth:2}),t.h("span",{class:"eli-tabela__acoes-item-texto"},O.rotulo)])))):null,J=["eli-tabela__acoes-container"];j&&J.push("eli-tabela__acoes-container--aberto"),V.push(t.h("td",{class:["eli-tabela__td","eli-tabela__td--acoes"],key:`${p}-acoes`},t.h("div",{class:J,ref:K(p)},[I,Y])))}return t.h("tr",{class:["eli-tabela__tr",p%2===1?"eli-tabela__tr--zebra":void 0],key:p},V)}))])),F.value>1&&b.value>0&&y.push(t.h(Mt,{pagina:n.value,totalPaginas:F.value,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:g=>{z(g)}})),t.h("div",{class:"eli-tabela"},y)}}});function Dt(e,a,d,m,b,$){return t.openBlock(),t.createElementBlock("div")}const Be=H(Et,[["render",Dt],["__scopeId","data-v-40942745"]]),_t={install(e){e.component("EliOlaMundo",pe),e.component("EliBotao",le),e.component("EliBadge",ee),e.component("EliInput",se),e.component("EliCartao",he),e.component("EliDataHora",ge),e.component("EliTabela",Be)}};E.EliBadge=ee,E.EliBotao=le,E.EliCartao=he,E.EliDataHora=ge,E.EliInput=se,E.EliOlaMundo=pe,E.EliTabela=Be,E.default=_t,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */const ft=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var Ve=(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))(Ve||{});const pt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ft},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.ref(e.modelo??"");t.watch(()=>e.modelo,h=>{h!==void 0&&h!==d.value&&(d.value=h)});function c(){a("buscar",d.value.trim())}return{texto:d,emitirBusca:c}}}),ht={class:"eli-tabela__busca"},bt={class:"eli-tabela__busca-input-wrapper"};function yt(e,a,d,c,h,$){const l=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",ht,[t.createElementVNode("div",bt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=f=>e.texto=f),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...f)=>e.emitirBusca&&e.emitirBusca(...f),["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]=(...f)=>e.emitirBusca&&e.emitirBusca(...f))},[t.createVNode(l,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const gt=q(pt,[["render",yt],["__scopeId","data-v-0fd1ad15"]]),$t=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 d=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),c=t.computed(()=>{const r=e.totalPaginas,S=e.pagina,v=d.value,j=[],w=O=>{j.push({label:String(O),pagina:O,ativo:O===S})},A=()=>{j.push({label:"…",ehEllipsis:!0})};if(r<=v){for(let O=1;O<=r;O+=1)w(O);return j}const C=Math.max(3,v-2);let H=Math.max(2,S-Math.floor(C/2)),L=H+C-1;L>=r&&(L=r-1,H=L-C+1),w(1),H>2&&A();for(let O=H;O<=L;O+=1)w(O);return Le.pagina<=1),l=t.computed(()=>e.pagina>=e.totalPaginas),f=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:c,irParaPagina:h,anteriorDesabilitado:$,proximaDesabilitada:l,paginaAtual:f,totalPaginasExibidas:k}}}),Vt={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},kt=["disabled"],Ct={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Bt=["disabled","aria-current","aria-label","onClick"],wt=["disabled"];function vt(e,a,d,c,h,$){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Vt,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=l=>e.irParaPagina(e.paginaAtual-1))}," << ",8,kt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(l,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${l.label}-${f}`},[l.ehEllipsis?(t.openBlock(),t.createElementBlock("span",Ct,t.toDisplayString(l.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",l.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:l.ativo,"aria-current":l.ativo?"page":void 0,"aria-label":`Ir para página ${l.label}`,onClick:k=>e.irParaPagina(l.pagina)},t.toDisplayString(l.label),11,Bt))],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]=l=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,wt)])):t.createCommentVNode("",!0)}const St=q($t,[["render",vt],["__scopeId","data-v-59d12455"]]),Et=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Mt(e,a,d,c,h,$){var l;return t.toDisplayString((l=e.dados)==null?void 0:l.texto)}const _t=q(Et,[["render",Mt]]),Dt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Nt(e,a,d,c,h,$){var l;return t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",","))}const Tt={textoSimples:_t,numero:q(Dt,[["render",Nt]])},Pt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),d=t.computed(()=>e.celula[1]),c=t.computed(()=>Tt[a.value]),h=t.computed(()=>d.value);return{Componente:c,dadosParaComponente:h}}});function At(e,a,d,c,h,$){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const It=q(Pt,[["render",At]]),Ot=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),d=t.ref(null),c=t.ref([]),h=t.ref(0),$=t.ref([]),l=t.ref(null),f=new Map,k=t.ref(""),r=t.ref(1),S=t.ref(null),v=t.ref("asc"),j=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),w=t.computed(()=>e.tabela.acoesTabela??[]),A=t.computed(()=>w.value.length>0),C=t.computed(()=>{const o=e.tabela.registros_por_consulta;return typeof o=="number"&&o>0?Math.floor(o):10}),H=t.computed(()=>{const o=C.value;if(!o||o<=0)return 1;const n=h.value;return n?Math.max(1,Math.ceil(n/o)):1});let L=0;function O(o,n){n?f.set(o,n):f.delete(o)}function K(o){return n=>{n instanceof HTMLElement?O(o,n):O(o,null)}}function se(o){o&&(S.value===o?(v.value=v.value==="asc"?"desc":"asc",u()):(S.value=o,v.value="asc",r.value!==1?r.value=1:u()))}function W(o){k.value!==o&&(k.value=o,r.value!==1?r.value=1:u())}function Y(o){const n=Math.min(Math.max(1,o),H.value);n!==r.value&&(r.value=n)}function Q(o){if(l.value===null)return;const n=f.get(l.value);n&&n.contains(o.target)||(l.value=null)}function G(o){return o==="direita"?"eli-tabela__celula--direita":o==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function J(o){if(o!=null)return typeof o=="number"?`${o}px`:String(o)}function N(o){if(!Array.isArray(o))return;const n=o[0],s=o[1];if(n==="textoSimples")return typeof(s==null?void 0:s.texto)=="string"?s.texto:void 0;if(n==="numero")return typeof(s==null?void 0:s.numero)=="number"?String(s.numero):void 0}function B(o){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},o)])}function Z(o){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},o??"Nenhum registro encontrado.")}function oe(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function u(){var b,p;const o=++L;a.value=!0,d.value=null,$.value=[],l.value=null,f.clear();const n=Math.max(1,C.value),i={offSet:(r.value-1)*n,limit:n};k.value&&(i.texto_busca=k.value),S.value&&(i.coluna_ordem=S.value,i.direcao_ordem=v.value);try{const y=e.tabela,m=await y.consulta(i);if(o!==L)return;if(m.cod!==Ve.sucesso){c.value=[],h.value=0,d.value=m.mensagem;return}const V=((b=m.valor)==null?void 0:b.valores)??[],g=((p=m.valor)==null?void 0:p.quantidade)??V.length;c.value=V,h.value=g;const D=Math.max(1,Math.ceil((g||0)/n));if(r.value>D){r.value=D;return}const M=y.acoesLinha??[];if(!M.length){$.value=[];return}const I=V.map(()=>M.map(P=>P.exibir===void 0?!0:typeof P.exibir=="boolean"?P.exibir:!1));$.value=I;const F=await Promise.all(V.map(async P=>Promise.all(M.map(async _=>{if(_.exibir===void 0)return!0;if(typeof _.exibir=="boolean")return _.exibir;try{const U=_.exibir(P);return!!await Promise.resolve(U)}catch{return!1}}))));o===L&&($.value=F)}catch(y){if(o!==L)return;c.value=[],h.value=0,d.value=y instanceof Error?y.message:"Erro ao carregar dados."}finally{o===L&&(a.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Q),u()}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,o=>{!o&&k.value&&(k.value="",r.value!==1?r.value=1:u())}),t.watch(r,(o,n)=>{o!==n&&u()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Q),f.clear()}),t.watch(()=>e.tabela,()=>{l.value=null,f.clear(),S.value=null,v.value="asc",k.value="",r.value!==1?r.value=1:u()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{r.value!==1?r.value=1:u()}),t.watch(c,()=>{l.value=null,f.clear()}),()=>{const o=e.tabela;if(a.value)return oe();if(d.value)return B(d.value);const n=o.colunas,s=o.acoesLinha??[],i=s.length>0;if(!c.value.length)return Z(o.mensagemVazio);const b=n.map(y=>{const m=y.coluna_ordem!==void 0?y.coluna_ordem:void 0,V=!!m,g=V&&S.value===m,D=V?g?t.h(v.value==="asc"?$e:ct,{class:"eli-tabela__th-icone",size:16,strokeWidth:2,"aria-hidden":"true"}):t.h($e,{class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,strokeWidth:2,"aria-hidden":"true"}):null,M=V?t.h("button",{type:"button",class:["eli-tabela__th-botao",g?"eli-tabela__th-botao--ativo":void 0],onClick:()=>se(m)},[t.h("span",{class:"eli-tabela__th-texto"},y.rotulo),D]):t.h("span",{class:"eli-tabela__th-label"},y.rotulo);return t.h("th",{class:["eli-tabela__th",V?"eli-tabela__th--ordenavel":void 0,G(y.alinhamento)],scope:"col"},M)});i&&b.push(t.h("th",{class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"},"Ações"));const p=[];if(j.value||A.value){const y=w.value.map((m,V)=>t.h("button",{key:`${m.rotulo}-${V}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:m.cor?{backgroundColor:m.cor,color:"#fff"}:void 0,onClick:m.acao},[m.icone?t.h(m.icone,{class:"eli-tabela__acoes-cabecalho-icone",size:16,strokeWidth:2}):null,t.h("span",{class:"eli-tabela__acoes-cabecalho-rotulo"},m.rotulo)]));p.push(t.h("div",{class:"eli-tabela__cabecalho"},[j.value?t.h(gt,{modelo:k.value,onBuscar:W}):null,A.value?t.h("div",{class:"eli-tabela__acoes-cabecalho"},y):null]))}return p.push(t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},b)),t.h("tbody",{class:"eli-tabela__tbody"},c.value.map((y,m)=>{const V=n.map((g,D)=>(()=>{const M=g.celula(y),I=!!g.truncar,F=I?N(M):void 0,P=t.h(It,{celula:M}),_=I?t.h("span",{class:"eli-tabela__celula-conteudo",style:g.largura_maxima?{maxWidth:J(g.largura_maxima)}:void 0,title:F},P):P;return t.h("td",{class:["eli-tabela__td",g.acao?"eli-tabela__td--clicavel":void 0,G(g.alinhamento)],key:`${m}-${D}`,onClick:g.acao?()=>{var U;return(U=g.acao)==null?void 0:U.call(g)}:void 0},_)})());if(i){const g=$.value[m]??[],D=s.map((T,ne)=>{const de=T.exibir===void 0?!0:typeof T.exibir=="boolean"?T.exibir:!1;return{acao:T,indice:ne,visivel:g[ne]??de}}).filter(T=>T.visivel),M=D.length>0;!M&&l.value===m&&(l.value=null);const I=l.value===m,F=`eli-tabela-acoes-toggle-${m}`,P=`eli-tabela-acoes-menu-${m}`,_=t.h("button",{id:F,class:"eli-tabela__acoes-toggle",type:"button",disabled:!M,onClick:T=>{T.stopPropagation(),M&&(l.value=I?null:m)},"aria-haspopup":"menu","aria-expanded":I?"true":"false","aria-controls":M?P:void 0,"aria-label":M?"Ações da linha":"Nenhuma ação disponível",title:M?"Ações":"Nenhuma ação disponível"},[t.h(mt,{class:"eli-tabela__acoes-toggle-icone",size:18,strokeWidth:2})]),U=I&&M?t.h("ul",{id:P,class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":F},D.map(({acao:T,indice:ne})=>t.h("li",{key:`acao-${ne}`,class:"eli-tabela__acoes-item",role:"none"},t.h("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:{color:T.cor},onClick:de=>{de.stopPropagation(),l.value=null,T.acao(y)},role:"menuitem","aria-label":T.rotulo,title:T.rotulo},[t.h(T.icone,{class:"eli-tabela__acoes-item-icone",size:16,strokeWidth:2}),t.h("span",{class:"eli-tabela__acoes-item-texto"},T.rotulo)])))):null,R=["eli-tabela__acoes-container"];I&&R.push("eli-tabela__acoes-container--aberto"),V.push(t.h("td",{class:["eli-tabela__td","eli-tabela__td--acoes"],key:`${m}-acoes`},t.h("div",{class:R,ref:K(m)},[_,U])))}return t.h("tr",{class:["eli-tabela__tr",m%2===1?"eli-tabela__tr--zebra":void 0],key:m},V)}))])),H.value>1&&h.value>0&&p.push(t.h(St,{pagina:r.value,totalPaginas:H.value,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:y=>{Y(y)}})),t.h("div",{class:"eli-tabela"},p)}}});function Ut(e,a,d,c,h,$){return t.openBlock(),t.createElementBlock("div")}const ke=q(Ot,[["render",Ut],["__scopeId","data-v-cfac9b47"]]),jt={install(e){e.component("EliOlaMundo",fe),e.component("EliBotao",re),e.component("EliBadge",x),e.component("EliInput",ie),e.component("EliCartao",pe),e.component("EliDataHora",be),e.component("EliTabela",ke)}};E.EliBadge=x,E.EliBotao=re,E.EliCartao=pe,E.EliDataHora=be,E.EliInput=ie,E.EliOlaMundo=fe,E.EliTabela=ke,E.default=jt,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts b/dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts deleted file mode 100644 index 6bcdeaa..0000000 --- a/dist/types/components/eli/EliTabela/celulas/EliCelulaTextoSimples.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { VNodeChild } from "vue"; -export type EliCelulaTextoSimples = { - tipo: "texto-simples"; - texto: string; -}; -export declare const renderEliCelulaTextoSimples: (celula: EliCelulaTextoSimples) => VNodeChild; diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts new file mode 100644 index 0000000..ed608c8 --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts @@ -0,0 +1,25 @@ +import type { Component } from "vue"; +import { PropType } from "vue"; +import type { ComponenteCelula } from "../types-eli-tabela"; +declare const __VLS_export: import("vue").DefineComponent; + required: true; + }; +}>, { + Componente: import("vue").ComputedRef; + dadosParaComponente: import("vue").ComputedRef<{ + texto: string; + acao?: () => void; + } | { + numero: number; + acao?: () => void; + }>; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + required: true; + }; +}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts new file mode 100644 index 0000000..3e49230 --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts @@ -0,0 +1,18 @@ +import { PropType } from "vue"; +import type { TiposTabelaCelulas } from "./tiposTabelaCelulas"; +declare const __VLS_export: import("vue").DefineComponent; + }; +}>, { + dados: { + numero: number; + acao?: () => void; + } | undefined; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + }; +}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts new file mode 100644 index 0000000..d5dffc5 --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts @@ -0,0 +1,18 @@ +import { PropType } from "vue"; +import type { TiposTabelaCelulas } from "./tiposTabelaCelulas"; +declare const __VLS_export: import("vue").DefineComponent; + }; +}>, { + dados: { + texto: string; + acao?: () => void; + } | undefined; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + }; +}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts b/dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts new file mode 100644 index 0000000..8787c2e --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts @@ -0,0 +1,30 @@ +export declare const registryTabelaCelulas: { + readonly textoSimples: import("vue").DefineComponent; + }; + }>, { + dados: { + texto: string; + acao?: () => void; + } | undefined; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + }; + }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + readonly numero: import("vue").DefineComponent; + }; + }>, { + dados: { + numero: number; + acao?: () => void; + } | undefined; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly; + }; + }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +}; diff --git a/dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts b/dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts new file mode 100644 index 0000000..d761d91 --- /dev/null +++ b/dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts @@ -0,0 +1,14 @@ +/** + * Tipagem dos dados de entrada dos componentes de celulas + */ +export type TiposTabelaCelulas = { + textoSimples: { + texto: string; + acao?: () => void; + }; + numero: { + numero: number; + acao?: () => void; + }; +}; +export type TipoTabelaCelula = keyof TiposTabelaCelulas; diff --git a/dist/types/components/eli/EliTabela/index.d.ts b/dist/types/components/eli/EliTabela/index.d.ts index c22de3a..31f6545 100644 --- a/dist/types/components/eli/EliTabela/index.d.ts +++ b/dist/types/components/eli/EliTabela/index.d.ts @@ -1,3 +1,4 @@ export { default as EliTabela } from "./EliTabela.vue"; export * from "./types-eli-tabela"; -export * from "./celulas/EliCelulaTextoSimples"; +export * from "./celulas/tiposTabelaCelulas"; +export { celulaTabela } from "./types-eli-tabela"; diff --git a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts index aaceff5..14f7774 100644 --- a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts +++ b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts @@ -1,7 +1,12 @@ import type { tipoResposta } from "p-respostas"; import type { LucideIcon } from "lucide-vue-next"; -import type { VNodeChild } from "vue"; -export type ComponenteCelula = VNodeChild; +import type { TipoTabelaCelula, TiposTabelaCelulas } from "./celulas/tiposTabelaCelulas"; +export type ComponenteCelulaBase = readonly [T, TiposTabelaCelulas[T]]; +export type ComponenteCelula = { + [K in TipoTabelaCelula]: ComponenteCelulaBase; +}[TipoTabelaCelula]; +export declare const celulaTabela: (tipo: T, dados: TiposTabelaCelulas[T]) => ComponenteCelulaBase; +export type { TipoTabelaCelula, TiposTabelaCelulas }; export type EliAlinhamentoColuna = "esquerda" | "centro" | "direita"; export type EliColuna = { /** Texto exibido no cabeçalho da coluna. */ diff --git a/package.json b/package.json index 06e62f4..2fdb0d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.33", + "version": "0.1.37", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue index 6e23e36..dc3fb42 100644 --- a/src/components/eli/EliTabela/EliTabela.vue +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -10,6 +10,7 @@ import { ArrowDown, ArrowUp, MoreVertical } from "lucide-vue-next"; import { codigosResposta } from "p-respostas"; import EliTabelaCaixaDeBusca from "./EliTabelaCaixaDeBusca.vue"; import EliTabelaPaginacao from "./EliTabelaPaginacao.vue"; +import EliTabelaCelula from "./celulas/EliTabelaCelula.vue"; import type { EliTabelaConsulta } from "./types-eli-tabela"; export default defineComponent({ @@ -131,15 +132,6 @@ export default defineComponent({ menuAberto.value = null; } - function normalizarFilhos(filhos: unknown) { - // `VNodeChild` pode ser null/undefined/boolean. - // Para a assinatura de `h()`, normalizamos para string vazia. - if (filhos === null || filhos === undefined || filhos === false) { - return ""; - } - return filhos as never; - } - function obterClasseAlinhamento(alinhamento?: string) { if (alinhamento === "direita") { return "eli-tabela__celula--direita"; @@ -157,34 +149,23 @@ export default defineComponent({ return typeof largura === "number" ? `${largura}px` : String(largura); } - function renderConteudoCelula(valor: unknown, coluna: (typeof props.tabela.colunas)[number]) { - const filhos = normalizarFilhos(valor); - const truncar = Boolean(coluna.truncar); - - if (!truncar) { - return filhos; + function obterTooltipCelula(celula: unknown) { + if (!Array.isArray(celula)) { + return undefined; } - // Só truncamos de forma segura quando o conteúdo é textual. - if (typeof filhos !== "string" && typeof filhos !== "number") { - return filhos; + const tipo = celula[0]; + const dados = celula[1] as any; + + if (tipo === "textoSimples") { + return typeof dados?.texto === "string" ? dados.texto : undefined; } - const tooltip = String(filhos); + if (tipo === "numero") { + return typeof dados?.numero === "number" ? String(dados.numero) : undefined; + } - return h( - "span", - { - class: "eli-tabela__celula-conteudo", - style: coluna.largura_maxima - ? { - maxWidth: obterMaxWidth(coluna.largura_maxima), - } - : undefined, - title: tooltip, - }, - tooltip - ); + return undefined; } function renderErro(mensagem: string) { @@ -557,19 +538,45 @@ export default defineComponent({ { class: "eli-tabela__tbody" }, linhas.value.map((linha, i) => { const celulas = colunas.map((coluna, j) => - h( - "td", - { - class: [ - "eli-tabela__td", - coluna.acao ? "eli-tabela__td--clicavel" : undefined, - obterClasseAlinhamento(coluna.alinhamento), - ], - key: `${i}-${j}`, - onClick: coluna.acao ? () => coluna.acao?.() : undefined, - }, - renderConteudoCelula(coluna.celula(linha as never), coluna) - ) + (() => { + const celula = coluna.celula(linha as never); + const truncar = Boolean(coluna.truncar); + const tooltip = truncar ? obterTooltipCelula(celula) : undefined; + + const conteudo = h(EliTabelaCelula, { + celula: celula as never, + }); + + const conteudoFinal = truncar + ? h( + "span", + { + class: "eli-tabela__celula-conteudo", + style: coluna.largura_maxima + ? { + maxWidth: obterMaxWidth(coluna.largura_maxima), + } + : undefined, + title: tooltip, + }, + conteudo + ) + : conteudo; + + return h( + "td", + { + class: [ + "eli-tabela__td", + coluna.acao ? "eli-tabela__td--clicavel" : undefined, + obterClasseAlinhamento(coluna.alinhamento), + ], + key: `${i}-${j}`, + onClick: coluna.acao ? () => coluna.acao?.() : undefined, + }, + conteudoFinal + ); + })() ); if (temAcoes) { diff --git a/src/components/eli/EliTabela/celulas/EliTabelaCelula.vue b/src/components/eli/EliTabela/celulas/EliTabelaCelula.vue new file mode 100644 index 0000000..16521c7 --- /dev/null +++ b/src/components/eli/EliTabela/celulas/EliTabelaCelula.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue b/src/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue index 6cd0d94..5fa9afd 100644 --- a/src/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue +++ b/src/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue @@ -4,14 +4,14 @@