From 27c9e4d5e282f3bba3dd067c4fd6fb18a155d4cd Mon Sep 17 00:00:00 2001 From: Luiz Silva Date: Thu, 29 Jan 2026 11:27:08 -0300 Subject: [PATCH] =?UTF-8?q?rafatora=C3=A7=C3=A3o=20de=20componentes=20de?= =?UTF-8?q?=20entrada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/eli-vue.css | 2 +- dist/eli-vue.es.js | 2407 +++++++---------- dist/eli-vue.umd.js | 30 +- .../EliEntrada/EliEntradaDataHora.vue.d.ts | 20 +- .../EliEntrada/EliEntradaNumero.vue.d.ts | 6 +- .../EliEntrada/EliEntradaTexto.vue.d.ts | 9 +- .../EliEntrada/registryEliEntradas.d.ts | 65 +- .../componentes/EliEntrada/tiposEntradas.d.ts | 5 + .../componentes/EliEntrada/utils/cep.d.ts | 2 + .../{campo => EliEntrada}/utils/cpfCnpj.d.ts | 0 .../{campo => EliEntrada}/utils/telefone.d.ts | 0 .../types/componentes/campo/EliInput.vue.d.ts | 146 - dist/types/componentes/campo/index.d.ts | 1 - dist/types/componentes/campo/utils/cep.d.ts | 1 - .../componentes/campo/utils/numerico.d.ts | 9 - .../componentes/cartao/EliCartao.vue.d.ts | 2 +- dist/types/componentes/data_hora/index.d.ts | 1 - .../ola_mundo/EliOlaMundo.vue.d.ts | 165 +- dist/types/index.d.ts | 2 - dist/types/tipos/campo.d.ts | 19 - dist/types/tipos/entrada.d.ts | 9 + dist/types/tipos/index.d.ts | 2 +- package.json | 2 +- .../EliEntrada/EliEntradaTexto.vue | 46 +- src/componentes/EliEntrada/tiposEntradas.ts | 12 +- src/componentes/EliEntrada/utils/cep.ts | 10 + .../{campo => EliEntrada}/utils/cpfCnpj.ts | 0 .../{campo => EliEntrada}/utils/telefone.ts | 2 - src/componentes/campo/EliInput.vue | 304 --- src/componentes/campo/README.md | 118 - src/componentes/campo/index.ts | 1 - src/componentes/campo/utils/cep.ts | 9 - src/componentes/campo/utils/numerico.ts | 26 - src/componentes/data_hora/README.md | 108 - src/componentes/data_hora/index.ts | 1 - src/componentes/ola_mundo/EliOlaMundo.vue | 123 +- src/componentes/ola_mundo/README.md | 13 +- src/index.ts | 3 - src/playground/App.vue | 7 - src/playground/campo.playground.vue | 127 - src/playground/cartao.playground.vue | 11 +- src/playground/ola_mundo.playground.vue | 2 +- src/tipos/campo.ts | 52 - src/tipos/entrada.ts | 18 + src/tipos/index.ts | 2 +- 45 files changed, 1295 insertions(+), 2605 deletions(-) create mode 100644 dist/types/componentes/EliEntrada/utils/cep.d.ts rename dist/types/componentes/{campo => EliEntrada}/utils/cpfCnpj.d.ts (100%) rename dist/types/componentes/{campo => EliEntrada}/utils/telefone.d.ts (100%) delete mode 100644 dist/types/componentes/campo/EliInput.vue.d.ts delete mode 100644 dist/types/componentes/campo/index.d.ts delete mode 100644 dist/types/componentes/campo/utils/cep.d.ts delete mode 100644 dist/types/componentes/campo/utils/numerico.d.ts delete mode 100644 dist/types/componentes/data_hora/index.d.ts delete mode 100644 dist/types/tipos/campo.d.ts create mode 100644 dist/types/tipos/entrada.d.ts create mode 100644 src/componentes/EliEntrada/utils/cep.ts rename src/componentes/{campo => EliEntrada}/utils/cpfCnpj.ts (100%) rename src/componentes/{campo => EliEntrada}/utils/telefone.ts (96%) delete mode 100644 src/componentes/campo/EliInput.vue delete mode 100644 src/componentes/campo/README.md delete mode 100644 src/componentes/campo/index.ts delete mode 100644 src/componentes/campo/utils/cep.ts delete mode 100644 src/componentes/campo/utils/numerico.ts delete mode 100644 src/componentes/data_hora/README.md delete mode 100644 src/componentes/data_hora/index.ts delete mode 100644 src/playground/campo.playground.vue delete mode 100644 src/tipos/campo.ts create mode 100644 src/tipos/entrada.ts diff --git a/dist/eli-vue.css b/dist/eli-vue.css index a0a49e1..44b750e 100644 --- a/dist/eli-vue.css +++ b/dist/eli-vue.css @@ -1 +1 @@ -@font-face{font-family:Google Sans;font-style:normal;font-weight:100 900;font-display:swap;src:url(https://paiol.idz.one/estaticos/GoogleSans/GoogleSans-VariableFont_GRAD,opsz,wght.ttf) format("truetype")}@font-face{font-family:Google Sans;font-style:italic;font-weight:100 900;font-display:swap;src:url(https://paiol.idz.one/estaticos/GoogleSans/GoogleSans-Italic-VariableFont_GRAD,opsz,wght.ttf) format("truetype")}:root{--eli-font-family: "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;--v-font-family: var(--eli-font-family)}html,body{font-family:var(--eli-font-family)}:where([class^=eli-],[class*=" eli-"]){font-family:var(--eli-font-family);--v-font-family: var(--eli-font-family)}button,input,select,textarea{font-family:inherit}[data-v-371c8db4] .v-badge__badge,[data-v-371c8db4] .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-tabela__busca[data-v-341415d1]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-341415d1]{display:inline-flex;align-items:stretch;border-radius:var(--eli-tabela-cabecalho-controle-radius, 8px);border:1px solid rgba(15,23,42,.15);overflow:hidden;background:#fff;height:var(--eli-tabela-cabecalho-controle-altura, 34px)}.eli-tabela__busca-input[data-v-341415d1]{height:100%;padding:0 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-341415d1]::-webkit-search-cancel-button,.eli-tabela__busca-input[data-v-341415d1]::-webkit-search-decoration{-webkit-appearance:none}.eli-tabela__busca-input[data-v-341415d1]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-341415d1]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;height:100%;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-341415d1]{display:block}.eli-tabela__busca-botao[data-v-341415d1]:hover,.eli-tabela__busca-botao[data-v-341415d1]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-341415d1]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__busca-grupo[data-v-42938cb8]{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.eli-tabela__celula-link[data-v-7a629ffa]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-7a629ffa]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-7a629ffa]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__texto-truncado[data-v-74854889]{display:inline-block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela__celula-link[data-v-74854889]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-74854889]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-74854889]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__celula-link[data-v-e7bac7ff]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-e7bac7ff]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-e7bac7ff]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__paginacao[data-v-5ca7a362]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-5ca7a362]{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-5ca7a362]:hover,.eli-tabela__pagina-botao[data-v-5ca7a362]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-5ca7a362]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-5ca7a362]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-5ca7a362]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-5ca7a362]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela-modal-colunas__overlay[data-v-b8f693ef]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a59;z-index:4000;display:flex;align-items:center;justify-content:center;padding:16px}.eli-tabela-modal-colunas__modal[data-v-b8f693ef]{width:min(860px,100%);background:#fff;border-radius:14px;border:1px solid rgba(15,23,42,.1);box-shadow:0 18px 60px #0f172a40;overflow:hidden}.eli-tabela-modal-colunas__header[data-v-b8f693ef]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(15,23,42,.08)}.eli-tabela-modal-colunas__titulo[data-v-b8f693ef]{font-size:1rem;margin:0}.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]{width:34px;height:34px;border-radius:10px;border:none;background:transparent;cursor:pointer;font-size:22px;line-height:1;color:#0f172acc}.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__conteudo[data-v-b8f693ef]{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px}.eli-tabela-modal-colunas__coluna-titulo[data-v-b8f693ef]{font-weight:600;margin-bottom:8px}.eli-tabela-modal-colunas__lista[data-v-b8f693ef]{min-height:260px;border:1px solid rgba(15,23,42,.12);border-radius:12px;padding:10px;background:#0f172a03}.eli-tabela-modal-colunas__item[data-v-b8f693ef]{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;border:1px solid rgba(15,23,42,.08);background:#fff;cursor:grab;-webkit-user-select:none;user-select:none}.eli-tabela-modal-colunas__item+.eli-tabela-modal-colunas__item[data-v-b8f693ef]{margin-top:8px}.eli-tabela-modal-colunas__item[data-v-b8f693ef]:active{cursor:grabbing}.eli-tabela-modal-colunas__item-handle[data-v-b8f693ef]{color:#0f172a8c;font-size:14px}.eli-tabela-modal-colunas__item-texto[data-v-b8f693ef]{flex:1;min-width:0}.eli-tabela-modal-colunas__footer[data-v-b8f693ef]{display:flex;justify-content:flex-end;gap:8px;padding:14px 16px;border-top:1px solid rgba(15,23,42,.08)}.eli-tabela-modal-colunas__botao[data-v-b8f693ef]{height:34px;padding:0 14px;border-radius:10px;border:1px solid rgba(15,23,42,.12);background:#fff;cursor:pointer;font-size:.9rem}.eli-tabela-modal-colunas__botao--sec[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__botao--sec[data-v-b8f693ef]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]{border:none;background:#2563ebf2;color:#fff}.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]:focus-visible{background:#2563eb}@media(max-width:720px){.eli-tabela-modal-colunas__conteudo[data-v-b8f693ef]{grid-template-columns:1fr}}.eli-tabela{width:100%}.eli-tabela__table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody{overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td{background:#0f172a05}.eli-tabela__th,.eli-tabela__td{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao{padding:10px 12px}.eli-tabela__th-botao{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:hover,.eli-tabela__th-botao:focus-visible{color:#0f172ad9}.eli-tabela__th-botao:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo{color:#2563ebf2}.eli-tabela__th-texto{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone{flex-shrink:0}.eli-tabela__th-icone--oculto{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td{border-bottom:none}.eli-tabela__td--clicavel{cursor:pointer}.eli-tabela__td--clicavel:hover{background:#00000008}.eli-tabela--erro{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem{opacity:.9}.eli-tabela--vazio{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes{text-align:right;white-space:nowrap}.eli-tabela__td--acoes{white-space:nowrap;overflow:visible}.eli-tabela__acoes-container{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto{z-index:200}.eli-tabela__cabecalho{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-cabecalho-controle-altura: 34px;--eli-tabela-cabecalho-controle-radius: 8px}.eli-tabela__acoes-cabecalho{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao{display:inline-flex;align-items:center;gap:6px;height:var(--eli-tabela-cabecalho-controle-altura);padding:0 14px;border-radius:var(--eli-tabela-cabecalho-controle-radius);border:none;background:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao:hover,.eli-tabela__acoes-cabecalho-botao:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo{line-height:1}.eli-tabela__acoes-toggle{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{display:block}.eli-tabela__acoes-toggle:hover,.eli-tabela__acoes-toggle:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu{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{margin:0}.eli-tabela__acoes-item-botao{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:hover,.eli-tabela__acoes-item-botao:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone{flex-shrink:0}.eli-tabela__acoes-item-texto{flex:1;text-align:left}.eli-tabela__th--expander,.eli-tabela__td--expander{width:42px;padding:6px 8px;text-align:center;vertical-align:middle}.eli-tabela__expander-botao{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:9999px;border:none;background:transparent;color:#0f172ab8;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__expander-botao:hover,.eli-tabela__expander-botao:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__expander-botao:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__expander-botao--ativo{background-color:#0f172a0f;color:#0f172af2}.eli-tabela__td--detalhes{padding:12px}.eli-tabela__tr--detalhes .eli-tabela__td{border-bottom:1px solid rgba(0,0,0,.08)}.eli-tabela__detalhes{display:grid;gap:10px;padding-left:4px}.eli-tabela__detalhe{display:grid;grid-template-columns:180px 1fr;gap:10px;align-items:start}.eli-tabela__detalhe-rotulo{font-weight:600;color:#0f172ad9}.eli-tabela__detalhe-valor{min-width:0}@media(max-width:720px){.eli-tabela__detalhe{grid-template-columns:1fr}}.eli-entrada__prefixo[data-v-77cbf216],.eli-entrada__sufixo[data-v-77cbf216]{opacity:.75;font-size:.9em;white-space:nowrap}.eli-entrada__prefixo[data-v-77cbf216]{margin-right:6px}.eli-entrada__sufixo[data-v-77cbf216]{margin-left:6px}.eli-data-hora[data-v-1bfd1be8]{width:100%} +@font-face{font-family:Google Sans;font-style:normal;font-weight:100 900;font-display:swap;src:url(https://paiol.idz.one/estaticos/GoogleSans/GoogleSans-VariableFont_GRAD,opsz,wght.ttf) format("truetype")}@font-face{font-family:Google Sans;font-style:italic;font-weight:100 900;font-display:swap;src:url(https://paiol.idz.one/estaticos/GoogleSans/GoogleSans-Italic-VariableFont_GRAD,opsz,wght.ttf) format("truetype")}:root{--eli-font-family: "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;--v-font-family: var(--eli-font-family)}html,body{font-family:var(--eli-font-family)}:where([class^=eli-],[class*=" eli-"]){font-family:var(--eli-font-family);--v-font-family: var(--eli-font-family)}button,input,select,textarea{font-family:inherit}[data-v-371c8db4] .v-badge__badge,[data-v-371c8db4] .v-badge__content{border-radius:var(--eli-badge-radius)!important}.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-tabela__busca[data-v-341415d1]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-341415d1]{display:inline-flex;align-items:stretch;border-radius:var(--eli-tabela-cabecalho-controle-radius, 8px);border:1px solid rgba(15,23,42,.15);overflow:hidden;background:#fff;height:var(--eli-tabela-cabecalho-controle-altura, 34px)}.eli-tabela__busca-input[data-v-341415d1]{height:100%;padding:0 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-341415d1]::-webkit-search-cancel-button,.eli-tabela__busca-input[data-v-341415d1]::-webkit-search-decoration{-webkit-appearance:none}.eli-tabela__busca-input[data-v-341415d1]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-341415d1]{display:inline-flex;align-items:center;justify-content:center;border:none;background:#2563eb1f;color:#2563ebf2;height:100%;padding:0 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__busca-botao-icone[data-v-341415d1]{display:block}.eli-tabela__busca-botao[data-v-341415d1]:hover,.eli-tabela__busca-botao[data-v-341415d1]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-341415d1]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__busca-grupo[data-v-42938cb8]{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.eli-tabela__celula-link[data-v-7a629ffa]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-7a629ffa]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-7a629ffa]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__texto-truncado[data-v-74854889]{display:inline-block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.eli-tabela__celula-link[data-v-74854889]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-74854889]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-74854889]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__celula-link[data-v-e7bac7ff]{all:unset;display:inline;color:#2563eb;cursor:pointer;text-decoration:underline;text-decoration-color:#2563eb8c;text-underline-offset:2px}.eli-tabela__celula-link[data-v-e7bac7ff]:hover{color:#1d4ed8;text-decoration-color:#1d4ed8bf}.eli-tabela__celula-link[data-v-e7bac7ff]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:4px}.eli-tabela__paginacao[data-v-5ca7a362]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-5ca7a362]{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-5ca7a362]:hover,.eli-tabela__pagina-botao[data-v-5ca7a362]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-5ca7a362]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-5ca7a362]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-5ca7a362]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-5ca7a362]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela-modal-colunas__overlay[data-v-b8f693ef]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a59;z-index:4000;display:flex;align-items:center;justify-content:center;padding:16px}.eli-tabela-modal-colunas__modal[data-v-b8f693ef]{width:min(860px,100%);background:#fff;border-radius:14px;border:1px solid rgba(15,23,42,.1);box-shadow:0 18px 60px #0f172a40;overflow:hidden}.eli-tabela-modal-colunas__header[data-v-b8f693ef]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid rgba(15,23,42,.08)}.eli-tabela-modal-colunas__titulo[data-v-b8f693ef]{font-size:1rem;margin:0}.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]{width:34px;height:34px;border-radius:10px;border:none;background:transparent;cursor:pointer;font-size:22px;line-height:1;color:#0f172acc}.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__fechar[data-v-b8f693ef]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__conteudo[data-v-b8f693ef]{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px}.eli-tabela-modal-colunas__coluna-titulo[data-v-b8f693ef]{font-weight:600;margin-bottom:8px}.eli-tabela-modal-colunas__lista[data-v-b8f693ef]{min-height:260px;border:1px solid rgba(15,23,42,.12);border-radius:12px;padding:10px;background:#0f172a03}.eli-tabela-modal-colunas__item[data-v-b8f693ef]{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;border:1px solid rgba(15,23,42,.08);background:#fff;cursor:grab;-webkit-user-select:none;user-select:none}.eli-tabela-modal-colunas__item+.eli-tabela-modal-colunas__item[data-v-b8f693ef]{margin-top:8px}.eli-tabela-modal-colunas__item[data-v-b8f693ef]:active{cursor:grabbing}.eli-tabela-modal-colunas__item-handle[data-v-b8f693ef]{color:#0f172a8c;font-size:14px}.eli-tabela-modal-colunas__item-texto[data-v-b8f693ef]{flex:1;min-width:0}.eli-tabela-modal-colunas__footer[data-v-b8f693ef]{display:flex;justify-content:flex-end;gap:8px;padding:14px 16px;border-top:1px solid rgba(15,23,42,.08)}.eli-tabela-modal-colunas__botao[data-v-b8f693ef]{height:34px;padding:0 14px;border-radius:10px;border:1px solid rgba(15,23,42,.12);background:#fff;cursor:pointer;font-size:.9rem}.eli-tabela-modal-colunas__botao--sec[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__botao--sec[data-v-b8f693ef]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]{border:none;background:#2563ebf2;color:#fff}.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]:hover,.eli-tabela-modal-colunas__botao--prim[data-v-b8f693ef]:focus-visible{background:#2563eb}@media(max-width:720px){.eli-tabela-modal-colunas__conteudo[data-v-b8f693ef]{grid-template-columns:1fr}}.eli-tabela{width:100%}.eli-tabela__table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:visible}.eli-tabela__tbody{overflow:visible}.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td{background:#0f172a05}.eli-tabela__th,.eli-tabela__td{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);vertical-align:top}.eli-tabela__th{text-align:left;font-weight:600;background:#00000008}.eli-tabela__th--ordenavel{padding:0}.eli-tabela__th--ordenavel .eli-tabela__th-botao{padding:10px 12px}.eli-tabela__th-botao{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:hover,.eli-tabela__th-botao:focus-visible{color:#0f172ad9}.eli-tabela__th-botao:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__th-botao--ativo{color:#2563ebf2}.eli-tabela__th-texto{flex:1;min-width:0;white-space:nowrap}.eli-tabela__th-icone{flex-shrink:0}.eli-tabela__th-icone--oculto{opacity:0}.eli-tabela__tr:last-child .eli-tabela__td{border-bottom:none}.eli-tabela__td--clicavel{cursor:pointer}.eli-tabela__td--clicavel:hover{background:#00000008}.eli-tabela--erro{border:1px solid rgba(220,53,69,.35);border-radius:12px;padding:12px}.eli-tabela--carregando{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__erro-titulo{font-weight:700;margin-bottom:4px}.eli-tabela__erro-mensagem{opacity:.9}.eli-tabela--vazio{border:1px dashed rgba(0,0,0,.25);border-radius:12px;padding:12px;opacity:.8}.eli-tabela__th--acoes{text-align:right;white-space:nowrap}.eli-tabela__td--acoes{white-space:nowrap;overflow:visible}.eli-tabela__acoes-container{display:flex;justify-content:flex-end;position:relative;z-index:1}.eli-tabela__acoes-container--aberto{z-index:200}.eli-tabela__cabecalho{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-cabecalho-controle-altura: 34px;--eli-tabela-cabecalho-controle-radius: 8px}.eli-tabela__acoes-cabecalho{display:inline-flex;gap:8px;flex-wrap:wrap}.eli-tabela__acoes-cabecalho-botao{display:inline-flex;align-items:center;gap:6px;height:var(--eli-tabela-cabecalho-controle-altura);padding:0 14px;border-radius:var(--eli-tabela-cabecalho-controle-radius);border:none;background:#2563eb1f;color:#2563ebf2;font-size:.875rem;font-weight:500;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__acoes-cabecalho-botao:hover,.eli-tabela__acoes-cabecalho-botao:focus-visible{background:#2563eb33}.eli-tabela__acoes-cabecalho-botao:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__acoes-cabecalho-icone{display:inline-block}.eli-tabela__acoes-cabecalho-rotulo{line-height:1}.eli-tabela__acoes-toggle{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{display:block}.eli-tabela__acoes-toggle:hover,.eli-tabela__acoes-toggle:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__acoes-toggle:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__acoes-toggle:disabled{cursor:default;color:#94a3b8cc;background:transparent}.eli-tabela__acoes-menu{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{margin:0}.eli-tabela__acoes-item-botao{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:hover,.eli-tabela__acoes-item-botao:focus-visible{background-color:#0f172a0f}.eli-tabela__acoes-item-botao:focus-visible{outline:2px solid currentColor;outline-offset:-2px}.eli-tabela__acoes-item-icone{flex-shrink:0}.eli-tabela__acoes-item-texto{flex:1;text-align:left}.eli-tabela__th--expander,.eli-tabela__td--expander{width:42px;padding:6px 8px;text-align:center;vertical-align:middle}.eli-tabela__expander-botao{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:9999px;border:none;background:transparent;color:#0f172ab8;cursor:pointer;transition:background-color .2s ease,color .2s ease}.eli-tabela__expander-botao:hover,.eli-tabela__expander-botao:focus-visible{background-color:#0f172a14;color:#0f172af2}.eli-tabela__expander-botao:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__expander-botao--ativo{background-color:#0f172a0f;color:#0f172af2}.eli-tabela__td--detalhes{padding:12px}.eli-tabela__tr--detalhes .eli-tabela__td{border-bottom:1px solid rgba(0,0,0,.08)}.eli-tabela__detalhes{display:grid;gap:10px;padding-left:4px}.eli-tabela__detalhe{display:grid;grid-template-columns:180px 1fr;gap:10px;align-items:start}.eli-tabela__detalhe-rotulo{font-weight:600;color:#0f172ad9}.eli-tabela__detalhe-valor{min-width:0}@media(max-width:720px){.eli-tabela__detalhe{grid-template-columns:1fr}}.eli-entrada__prefixo[data-v-77cbf216],.eli-entrada__sufixo[data-v-77cbf216]{opacity:.75;font-size:.9em;white-space:nowrap}.eli-entrada__prefixo[data-v-77cbf216]{margin-right:6px}.eli-entrada__sufixo[data-v-77cbf216]{margin-left:6px}.eli-data-hora[data-v-1bfd1be8]{width:100%} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index c6fc228..b17c464 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,16 +1,10 @@ -import { defineComponent as H, createBlock as z, openBlock as i, mergeProps as me, withCtx as ee, renderSlot as ye, computed as k, ref as T, createElementBlock as y, createCommentVNode as te, createSlots as Je, createVNode as B, createTextVNode as ke, toDisplayString as j, Fragment as le, renderList as pe, resolveComponent as x, createElementVNode as E, h as Be, watch as fe, withDirectives as ra, withKeys as sa, vModelText as ia, normalizeStyle as Te, resolveDynamicComponent as De, normalizeClass as be, withModifiers as ce, Teleport as ua, onMounted as da, onBeforeUnmount as ca } from "vue"; -import { VBtn as pa } from "vuetify/components/VBtn"; -import { VBadge as ma } from "vuetify/components/VBadge"; -import { VCheckbox as fa } from "vuetify/components/VCheckbox"; -import { VIcon as va } from "vuetify/components/VIcon"; -import { VRadio as ba } from "vuetify/components/VRadio"; -import { VRadioGroup as ha } from "vuetify/components/VRadioGroup"; -import { VSelect as ga } from "vuetify/components/VSelect"; -import { VTextField as Me } from "vuetify/components/VTextField"; -import { VTextarea as ya } from "vuetify/components/VTextarea"; -import { VCard as We, VCardTitle as Ze, VCardText as Ge, VCardActions as Xe } from "vuetify/components/VCard"; -import { VContainer as $a } from "vuetify/components/VGrid"; -const Ca = H({ +import { defineComponent as Y, createBlock as ee, openBlock as c, mergeProps as $e, withCtx as te, renderSlot as ge, computed as k, ref as N, resolveComponent as Q, createVNode as L, createTextVNode as Ae, createElementVNode as _, createCommentVNode as oe, toDisplayString as z, h as Te, watch as pe, createElementBlock as $, withDirectives as oa, withKeys as na, vModelText as ia, Fragment as ce, renderList as fe, normalizeStyle as we, resolveDynamicComponent as De, normalizeClass as me, withModifiers as de, Teleport as ra, onMounted as la, onBeforeUnmount as sa, createSlots as ua } from "vue"; +import { VBtn as ca } from "vuetify/components/VBtn"; +import { VBadge as da } from "vuetify/components/VBadge"; +import { VTextField as Oe } from "vuetify/components/VTextField"; +import { VCard as Re, VCardTitle as Je, VCardText as We, VCardActions as Ze } from "vuetify/components/VCard"; +import { VContainer as fa } from "vuetify/components/VGrid"; +const pa = Y({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +29,30 @@ const Ca = H({ default: !1 } } -}), Y = (e, a) => { +}), R = (e, a) => { const o = e.__vccOpts || e; - for (const [l, s] of a) - o[l] = s; + for (const [n, l] of a) + o[n] = l; return o; }; -function Ea(e, a, o, l, s, v) { - return i(), z(pa, me({ +function va(e, a, o, n, l, v) { + return c(), ee(ca, $e({ color: e.color, variant: e.variant, size: e.size, disabled: e.disabled, loading: e.loading }, e.$attrs, { class: "eli-botao text-none pt-1" }), { - default: ee(() => [ - ye(e.$slots, "default") + default: te(() => [ + ge(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Ke = /* @__PURE__ */ Y(Ca, [["render", Ea]]), Oe = { +const Xe = /* @__PURE__ */ R(pa, [["render", va]]), Ie = { suave: "4px", pill: "10px" -}, _a = H({ +}, ma = Y({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +91,14 @@ const Ke = /* @__PURE__ */ Y(Ca, [["render", Ea]]), Oe = { } }, setup(e) { - const a = k(() => e.radius in Oe ? Oe[e.radius] : e.radius), o = k(() => e.dot || e.badge !== void 0 ? e.visible : !1), l = k(() => ({ + const a = k(() => e.radius in Ie ? Ie[e.radius] : e.radius), o = k(() => e.dot || e.badge !== void 0 ? e.visible : !1), n = k(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: o, badgeStyle: l }; + return { showBadge: o, badgeStyle: n }; } }); -function ka(e, a, o, l, s, v) { - return e.showBadge ? (i(), z(ma, me({ +function ba(e, a, o, n, l, v) { + return e.showBadge ? (c(), ee(da, $e({ key: 0, color: e.color }, e.$attrs, { @@ -116,444 +110,190 @@ function ka(e, a, o, l, s, v) { style: e.badgeStyle, class: "eli-badge" }), { - default: ee(() => [ - ye(e.$slots, "default", {}, void 0, !0) + default: te(() => [ + ge(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ye(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ge(e.$slots, "default", { key: 1 }, void 0, !0); } -const Pe = /* @__PURE__ */ Y(_a, [["render", ka], ["__scopeId", "data-v-371c8db4"]]); -function Da(e) { +const Pe = /* @__PURE__ */ R(ma, [["render", ba], ["__scopeId", "data-v-371c8db4"]]); +function ha(e) { return e.replace(/\D+/g, ""); } -function Sa(e) { - const a = Da(e); +function ga(e) { + const a = ha(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 wa(e) { +function $a(e) { return e.replace(/\D+/g, ""); } -function Va(e) { - const a = wa(e); +function ya(e) { + const a = $a(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) { +function _a(e) { return e.replace(/\D+/g, ""); } -function Qe(e) { - const a = e.replace(/[^\d,]/g, ""), o = a.split(","); - return o.length > 2 ? o[0] + "," + o.slice(1).join("") : a; +function Ea(e) { + const a = _a(e); + return a ? a.replace(/^(\d{5})(\d)/, "$1-$2").slice(0, 9) : ""; } -function Ma(e) { - return Qe(e.replace(/%/g, "")); -} -function Aa(e) { - const a = Ie(e); - return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; -} -function Ba(e) { - const a = Ie(e).slice(0, 8); - return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); -} -const Ta = H({ - name: "EliInput", +const Ca = Y({ + name: "EliEntradaTexto", inheritAttrs: !1, props: { - /** - * Aceita valor simples (text-like) ou lista de valores (checkbox/select multiple). - * O componente não converte tipos automaticamente: mantém o que receber. - */ - modelValue: { - type: [String, Number, Boolean, Array], - default: "" + /** Interface padrão (EliEntrada): value + opcoes. */ + value: { + type: [String, null], + default: void 0 }, - 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 }, - /** - * Para select/radio/checkbox. - * Aceita lista já normalizada ({ label, value }) ou valores primitivos. - */ - 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 + opcoes: { + type: Object, + required: !0 + } }, - emits: ["update:modelValue", "change", "focus", "blur"], - setup(e, { emit: a, attrs: o }) { - const l = T(!1), s = T(!1), v = k({ - get: () => e.modelValue, - set: (D) => { - a("update:modelValue", D), a("change", D); + emits: { + "update:value": (e) => !0, + /** Compat Vue2 (v-model padrão: value + input) */ + input: (e) => !0, + change: (e) => !0, + focus: () => !0, + blur: () => !0 + }, + setup(e, { attrs: a, emit: o }) { + const n = k(() => { + var r; + return ((r = e.opcoes) == null ? void 0 : r.formato) ?? "texto"; + }), l = k({ + get: () => e.value, + set: (r) => { + o("update:value", r), o("input", r), o("change", r); } - }), t = k( - () => [ - "text", - "password", - "email", - "search", - "url", - "telefone", - "cpfCnpj", - "numericoInteiro", - "numericoDecimal", - "numericoMoeda", - "porcentagem", - "cep" - ].includes(e.type) - ), n = k( - () => e.type === "password" ? s.value ? "text" : "password" : "text" - ), f = k(() => { - if (e.type === "telefone") return "tel"; - if (e.type === "porcentagem") return "decimal"; - if (e.type.startsWith("numerico")) return "numeric"; - }), r = k( - () => e.error ? "error" : l.value ? e.color : void 0 - ); - function p(D) { - const $ = D.target; - let d = $.value; - switch (e.type) { - case "numericoInteiro": - d = Ie(d); - break; - case "numericoDecimal": - d = Qe(d); - break; - case "numericoMoeda": - d = Aa(d); - break; - case "porcentagem": - d = Ma(d); - break; + }), v = k(() => n.value === "email" ? "email" : n.value === "url" ? "url" : "text"), t = k(() => { + if (n.value === "telefone") return "tel"; + if (n.value === "cpfCnpj" || n.value === "cep") return "numeric"; + }); + function i(r) { + switch (n.value) { case "telefone": - d = Va(d); - break; + return ya(r); case "cpfCnpj": - d = Sa(d); - break; + return ga(r); case "cep": - d = Ba(d); - break; + return Ea(r); + default: + return r; } - $.value = d, a("update:modelValue", d), a("change", d); } - function C() { - s.value = !s.value; + function p(r) { + const f = r.target, y = i(f.value); + f.value = y, l.value = y; } - const P = k(() => (e.options || []).map((D) => { - if (D && typeof D == "object" && "value" in D) { - const d = D.value; - return { - label: D.label ?? String(d), - value: d, - disabled: D.disabled - }; - } - const $ = D; - return { label: String($), value: $ }; - })); - return { - attrs: o, - value: v, - isTextLike: t, - inputHtmlType: n, - inputMode: f, - internalColor: r, - showPassword: s, - togglePassword: C, - onInput: p, - onFocus: () => a("focus"), - onBlur: () => a("blur"), - computedItems: P - }; + return { attrs: a, emit: o, localValue: l, inputHtmlType: v, inputMode: t, onInput: p }; } -}), Pa = { class: "eli-input" }, Ia = { - key: 4, - class: "checkbox-group" -}; -function Oa(e, a, o, l, s, v) { - return i(), y("div", Pa, [ - e.isTextLike ? (i(), z(Me, me({ - key: 0, - modelValue: e.value, - "onUpdate:modelValue": a[0] || (a[0] = (t) => e.value = t), - 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 - }), Je({ _: 2 }, [ - e.type === "password" && e.showPasswordToggle ? { - name: "append-inner", - fn: ee(() => [ - B(va, { - class: "cursor-pointer", - onClick: e.togglePassword - }, { - default: ee(() => [ - ke(j(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" ? (i(), z(ya, me({ - key: 1, - modelValue: e.value, - "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), - label: e.label, - rows: e.rows, - density: e.density, - variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (i(), z(ga, me({ - key: 2, - modelValue: e.value, - "onUpdate:modelValue": a[2] || (a[2] = (t) => e.value = t), - 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" ? (i(), z(ha, { - key: 3, - modelValue: e.value, - "onUpdate:modelValue": a[3] || (a[3] = (t) => e.value = t), - row: e.row - }, { - default: ee(() => [ - (i(!0), y(le, null, pe(e.computedItems, (t) => (i(), z(ba, { - key: String(t.value), - label: t.label, - value: t.value - }, null, 8, ["label", "value"]))), 128)) - ]), - _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (i(), y("div", Ia, [ - (i(!0), y(le, null, pe(e.computedItems, (t) => (i(), z(fa, { - key: String(t.value), - modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (n) => e.value = n), - label: t.label, - value: t.value, - density: e.density - }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : te("", !0) - ]); +}); +function Da(e, a, o, n, l, v) { + var t, i, p, r; + return c(), ee(Oe, $e({ + modelValue: e.localValue, + "onUpdate:modelValue": a[0] || (a[0] = (f) => e.localValue = f), + type: e.inputHtmlType, + inputmode: e.inputMode, + label: (t = e.opcoes) == null ? void 0 : t.rotulo, + placeholder: (i = e.opcoes) == null ? void 0 : i.placeholder, + counter: (p = e.opcoes) == null ? void 0 : p.limiteCaracteres, + maxlength: (r = e.opcoes) == null ? void 0 : r.limiteCaracteres + }, e.attrs, { + onFocus: a[1] || (a[1] = () => e.emit("focus")), + onBlur: a[2] || (a[2] = () => e.emit("blur")), + onInput: e.onInput + }), null, 16, ["modelValue", "type", "inputmode", "label", "placeholder", "counter", "maxlength", "onInput"]); } -const xe = /* @__PURE__ */ Y(Ta, [["render", Oa], ["__scopeId", "data-v-756cb549"]]), Na = H({ +const Ge = /* @__PURE__ */ R(Ca, [["render", Da]]), ka = Y({ name: "EliOlaMundo", components: { - EliBotao: Ke, + EliBotao: Xe, EliBadge: Pe, - EliInput: xe + EliEntradaTexto: Ge }, setup() { - const e = T(""), a = T([]), o = T(""), l = T(""), s = T(""), v = T(""), t = T(""), n = T(""), f = T(""), r = T(""), p = T(""), C = T(null), P = T([]); + const e = N(""), a = N(""), o = N(""), n = N(""), l = N(""); return { nome: e, email: n, - documento: p, - estado: a, - telefone: l, - mensagem: f, - senha: r, - cor: C, - habilidades: P, - idade: s, - altura: v, - cep: o, - valor: t + documento: l, + telefone: o, + cep: a }; } -}), qa = { class: "grid-example" }; -function Fa(e, a, o, l, s, v) { - const t = x("EliBadge"), n = x("EliInput"), f = x("EliBotao"); - return i(), z($a, null, { - default: ee(() => [ - B(We, { +}), Sa = { class: "grid-example" }; +function Aa(e, a, o, n, l, v) { + const t = Q("EliBadge"), i = Q("EliEntradaTexto"), p = Q("EliBotao"); + return c(), ee(fa, null, { + default: te(() => [ + L(Re, { class: "mx-auto", max_width: "400" }, { - default: ee(() => [ - B(Ze, null, { - default: ee(() => [ - B(t, { + default: te(() => [ + L(Je, null, { + default: te(() => [ + L(t, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: ee(() => [...a[14] || (a[14] = [ - ke(" Olá Mundo! ", -1) + default: te(() => [...a[5] || (a[5] = [ + Ae(" Olá Mundo! ", -1) ])]), _: 1 }) ]), _: 1 }), - B(Ge, null, { - default: ee(() => [ - a[15] || (a[15] = ke(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - E("div", qa, [ - B(n, { - modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (r) => e.nome = r), - label: "Nome", - placeholder: "Digite o nome", + L(We, null, { + default: te(() => [ + a[6] || (a[6] = Ae(" Este é um componente de exemplo integrado com Vuetify. ", -1)), + _("div", Sa, [ + L(i, { + value: e.nome, + "onUpdate:value": a[0] || (a[0] = (r) => e.nome = r), + opcoes: { rotulo: "Nome", placeholder: "Digite o nome" }, density: "compact" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (r) => e.idade = r), - type: "numericoInteiro", - label: "Idade", - density: "default" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (r) => e.altura = r), - type: "numericoDecimal", - label: "Altura", - density: "comfortable" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (r) => e.valor = r), - type: "numericoMoeda", - label: "Valor" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (r) => e.telefone = r), - type: "telefone", - label: "Telefone" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (r) => e.cep = r), - type: "cep", - label: "CEP", - placeholder: "00000-000" - }, null, 8, ["modelValue"]), - B(n, { - 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"]), - B(n, { - modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (r) => e.documento = r), - type: "cpfCnpj", - label: "CPF / CNPJ" - }, null, 8, ["modelValue"]), - B(n, { - modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (r) => e.email = r), - label: "Email", - placeholder: "email@exemplo.com" - }, null, 8, ["modelValue"]), - B(n, { - 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"]), - B(n, { - type: "textarea", - modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (r) => e.mensagem = r), - label: "Mensagem", - rows: 5 - }, null, 8, ["modelValue"]), - B(n, { - 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"]), - B(n, { - 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"]), - B(n, { - modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (r) => e.nome = r), - label: "Nome", - error: !0, - "error-messages": ["Obrigatório"] - }, null, 8, ["modelValue"]) + }, null, 8, ["value"]), + L(i, { + value: e.telefone, + "onUpdate:value": a[1] || (a[1] = (r) => e.telefone = r), + opcoes: { rotulo: "Telefone", formato: "telefone" } + }, null, 8, ["value"]), + L(i, { + value: e.cep, + "onUpdate:value": a[2] || (a[2] = (r) => e.cep = r), + opcoes: { rotulo: "CEP", placeholder: "00000-000", formato: "cep" } + }, null, 8, ["value"]), + L(i, { + value: e.documento, + "onUpdate:value": a[3] || (a[3] = (r) => e.documento = r), + opcoes: { rotulo: "CPF / CNPJ", formato: "cpfCnpj" } + }, null, 8, ["value"]), + L(i, { + value: e.email, + "onUpdate:value": a[4] || (a[4] = (r) => e.email = r), + opcoes: { rotulo: "Email", placeholder: "email@exemplo.com", formato: "email" } + }, null, 8, ["value"]) ]) ]), _: 1 }), - B(Xe, null, { - default: ee(() => [ - B(f, { + L(Ze, null, { + default: te(() => [ + L(p, { color: "primary", variant: "elevated", block: "" }, { - default: ee(() => [...a[16] || (a[16] = [ - ke(" Botão Vuetify ", -1) + default: te(() => [...a[7] || (a[7] = [ + Ae(" Botão Vuetify ", -1) ])]), _: 1 }) @@ -567,7 +307,7 @@ function Fa(e, a, o, l, s, v) { _: 1 }); } -const La = /* @__PURE__ */ Y(Na, [["render", Fa]]), ja = H({ +const Ma = /* @__PURE__ */ R(ka, [["render", Aa]]), Ba = Y({ name: "EliCartao", components: { EliBadge: Pe }, inheritAttrs: !1, @@ -596,7 +336,7 @@ const La = /* @__PURE__ */ Y(Na, [["render", Fa]]), ja = H({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const o = k(() => e.status), l = k(() => { + const o = k(() => e.status), n = k(() => { switch (e.status) { case "novo": return "primary"; @@ -607,40 +347,40 @@ const La = /* @__PURE__ */ Y(Na, [["render", Fa]]), ja = H({ case "cancelado": return "error"; } - }), s = k(() => `eli-cartao--${e.status}`); + }), l = k(() => `eli-cartao--${e.status}`); function v() { a("clicar", e.status); } return { rotuloStatus: o, - corStatus: l, - classeStatus: s, + corStatus: n, + classeStatus: l, onClick: v }; } -}), Ua = { class: "eli-cartao__titulo-texto" }, za = { class: "eli-cartao__status" }; -function Ha(e, a, o, l, s, v) { - const t = x("EliBadge"); - return i(), z(We, me({ +}), Ta = { class: "eli-cartao__titulo-texto" }, wa = { class: "eli-cartao__status" }; +function Oa(e, a, o, n, l, v) { + const t = Q("EliBadge"); + return c(), ee(Re, $e({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: ee(() => [ - B(Ze, { class: "eli-cartao__titulo" }, { - default: ee(() => [ - E("div", Ua, [ - ye(e.$slots, "titulo", {}, () => [ - ke(j(e.titulo), 1) + default: te(() => [ + L(Je, { class: "eli-cartao__titulo" }, { + default: te(() => [ + _("div", Ta, [ + ge(e.$slots, "titulo", {}, () => [ + Ae(z(e.titulo), 1) ], !0) ]), - E("div", za, [ - B(t, { + _("div", wa, [ + L(t, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: ee(() => [...a[0] || (a[0] = [ - E("span", null, null, -1) + default: te(() => [...a[0] || (a[0] = [ + _("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -648,34 +388,34 @@ function Ha(e, a, o, l, s, v) { ]), _: 3 }), - B(Ge, { class: "eli-cartao__conteudo" }, { - default: ee(() => [ - ye(e.$slots, "default", {}, void 0, !0) + L(We, { class: "eli-cartao__conteudo" }, { + default: te(() => [ + ge(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (i(), z(Xe, { + e.$slots.acoes ? (c(), ee(Ze, { key: 0, class: "eli-cartao__acoes" }, { - default: ee(() => [ - ye(e.$slots, "acoes", {}, void 0, !0) + default: te(() => [ + ge(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : te("", !0) + })) : oe("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const Ya = /* @__PURE__ */ Y(ja, [["render", Ha], ["__scopeId", "data-v-6c492bd9"]]); -var ea = ((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))(ea || {}); +const Pa = /* @__PURE__ */ R(Ba, [["render", Oa], ["__scopeId", "data-v-6c492bd9"]]); +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 || {}); /** * @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 Ra = (e) => { +const Ia = (e) => { for (const a in e) if (a.startsWith("aria-") || a === "role" || a === "title") return !0; @@ -687,14 +427,14 @@ const Ra = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ne = (e) => e === ""; +const Ve = (e) => e === ""; /** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ja = (...e) => e.filter((a, o, l) => !!a && a.trim() !== "" && l.indexOf(a) === o).join(" ").trim(); +const Va = (...e) => e.filter((a, o, n) => !!a && a.trim() !== "" && n.indexOf(a) === o).join(" ").trim(); /** * @license lucide-vue-next v0.563.0 - ISC * @@ -708,9 +448,9 @@ const qe = (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 Wa = (e) => e.replace( +const qa = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, o, l) => l ? l.toUpperCase() : o.toLowerCase() + (a, o, n) => n ? n.toUpperCase() : o.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -718,8 +458,8 @@ const Wa = (e) => e.replace( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Za = (e) => { - const a = Wa(e); +const Na = (e) => { + const a = qa(e); return a.charAt(0).toUpperCase() + a.slice(1); }; /** @@ -728,7 +468,7 @@ const Za = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -var _e = { +var Ce = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, @@ -745,33 +485,33 @@ var _e = { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ga = ({ +const La = ({ name: e, iconNode: a, absoluteStrokeWidth: o, - "absolute-stroke-width": l, - strokeWidth: s, + "absolute-stroke-width": n, + strokeWidth: l, "stroke-width": v, - size: t = _e.width, - color: n = _e.stroke, - ...f -}, { slots: r }) => Be( + size: t = Ce.width, + color: i = Ce.stroke, + ...p +}, { slots: r }) => Te( "svg", { - ..._e, - ...f, + ...Ce, + ...p, width: t, height: t, - stroke: n, - "stroke-width": Ne(o) || Ne(l) || o === !0 || l === !0 ? Number(s || v || _e["stroke-width"]) * 24 / Number(t) : s || v || _e["stroke-width"], - class: Ja( + stroke: i, + "stroke-width": Ve(o) || Ve(n) || o === !0 || n === !0 ? Number(l || v || Ce["stroke-width"]) * 24 / Number(t) : l || v || Ce["stroke-width"], + class: Va( "lucide", - f.class, - ...e ? [`lucide-${qe(Za(e))}-icon`, `lucide-${qe(e)}`] : ["lucide-icon"] + p.class, + ...e ? [`lucide-${qe(Na(e))}-icon`, `lucide-${qe(e)}`] : ["lucide-icon"] ), - ...!r.default && !Ra(f) && { "aria-hidden": "true" } + ...!r.default && !Ia(p) && { "aria-hidden": "true" } }, - [...a.map((p) => Be(...p)), ...r.default ? [r.default()] : []] + [...a.map((f) => Te(...f)), ...r.default ? [r.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -779,15 +519,15 @@ const Ga = ({ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const $e = (e, a) => (o, { slots: l, attrs: s }) => Be( - Ga, +const ye = (e, a) => (o, { slots: n, attrs: l }) => Te( + La, { - ...s, + ...l, ...o, iconNode: a, name: e }, - l + n ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -795,7 +535,7 @@ const $e = (e, a) => (o, { slots: l, attrs: s }) => Be( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Fe = $e("arrow-down", [ +const Ne = ye("arrow-down", [ ["path", { d: "M12 5v14", key: "s699le" }], ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] ]); @@ -805,7 +545,7 @@ const Fe = $e("arrow-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Le = $e("arrow-up", [ +const Le = ye("arrow-up", [ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], ["path", { d: "M12 19V5", key: "x0mq9r" }] ]); @@ -815,7 +555,7 @@ const Le = $e("arrow-up", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const je = $e("chevron-down", [ +const Fe = ye("chevron-down", [ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }] ]); /** @@ -824,7 +564,7 @@ const je = $e("chevron-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ue = $e("chevron-right", [ +const je = ye("chevron-right", [ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }] ]); /** @@ -833,7 +573,7 @@ const Ue = $e("chevron-right", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Xa = $e("ellipsis-vertical", [ +const Fa = ye("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" }] @@ -844,12 +584,12 @@ const Xa = $e("ellipsis-vertical", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ka = $e("search", [ +const ja = ye("search", [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] -]), Qa = H({ +]), za = Y({ name: "EliTabelaCaixaDeBusca", - components: { Search: Ka }, + components: { Search: ja }, props: { modelo: { type: String, @@ -863,41 +603,41 @@ const Ka = $e("search", [ } }, setup(e, { emit: a }) { - const o = T(e.modelo ?? ""); - fe( + const o = N(e.modelo ?? ""); + pe( () => e.modelo, - (s) => { - s !== void 0 && s !== o.value && (o.value = s); + (l) => { + l !== void 0 && l !== o.value && (o.value = l); } ); - function l() { + function n() { a("buscar", o.value.trim()); } - return { texto: o, emitirBusca: l }; + return { texto: o, emitirBusca: n }; } -}), xa = { class: "eli-tabela__busca" }, et = { class: "eli-tabela__busca-input-wrapper" }; -function at(e, a, o, l, s, v) { - const t = x("Search"); - return i(), y("div", xa, [ - E("div", et, [ - ra(E("input", { +}), Ha = { class: "eli-tabela__busca" }, Ua = { class: "eli-tabela__busca-input-wrapper" }; +function Ya(e, a, o, n, l, v) { + const t = Q("Search"); + return c(), $("div", Ha, [ + _("div", Ua, [ + oa(_("input", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.texto = n), + "onUpdate:modelValue": a[0] || (a[0] = (i) => e.texto = i), type: "search", class: "eli-tabela__busca-input", placeholder: "Digite termos para filtrar", - onKeyup: a[1] || (a[1] = sa((...n) => e.emitirBusca && e.emitirBusca(...n), ["enter"])) + onKeyup: a[1] || (a[1] = na((...i) => e.emitirBusca && e.emitirBusca(...i), ["enter"])) }, null, 544), [ [ia, e.texto] ]), - E("button", { + _("button", { type: "button", class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...n) => e.emitirBusca && e.emitirBusca(...n)) + onClick: a[2] || (a[2] = (...i) => e.emitirBusca && e.emitirBusca(...i)) }, [ - B(t, { + L(t, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -907,9 +647,9 @@ function at(e, a, o, l, s, v) { ]) ]); } -const tt = /* @__PURE__ */ Y(Qa, [["render", at], ["__scopeId", "data-v-341415d1"]]), ot = H({ +const Ra = /* @__PURE__ */ R(za, [["render", Ya], ["__scopeId", "data-v-341415d1"]]), Ja = Y({ name: "EliTabelaCabecalho", - components: { EliTabelaCaixaDeBusca: tt }, + components: { EliTabelaCaixaDeBusca: Ra }, props: { exibirBusca: { type: Boolean, @@ -939,56 +679,56 @@ const tt = /* @__PURE__ */ Y(Qa, [["render", at], ["__scopeId", "data-v-341415d1 }, setup(e, { emit: a }) { const o = k(() => e.acoesCabecalho.length > 0); - function l(v) { + function n(v) { a("buscar", v); } - function s() { + function l() { a("colunas"); } - return { temAcoesCabecalho: o, emitBuscar: l, emitColunas: s }; + return { temAcoesCabecalho: o, emitBuscar: n, emitColunas: l }; } -}), nt = { class: "eli-tabela__cabecalho" }, lt = { +}), Wa = { class: "eli-tabela__cabecalho" }, Za = { key: 0, class: "eli-tabela__busca-grupo" -}, rt = { +}, Xa = { key: 1, class: "eli-tabela__acoes-cabecalho" -}, st = ["onClick"], it = { class: "eli-tabela__acoes-cabecalho-rotulo" }; -function ut(e, a, o, l, s, v) { - const t = x("EliTabelaCaixaDeBusca"); - return i(), y("div", nt, [ - e.exibirBusca ? (i(), y("div", lt, [ - e.exibirBotaoColunas ? (i(), y("button", { +}, Ga = ["onClick"], Ka = { class: "eli-tabela__acoes-cabecalho-rotulo" }; +function Qa(e, a, o, n, l, v) { + const t = Q("EliTabelaCaixaDeBusca"); + return c(), $("div", Wa, [ + e.exibirBusca ? (c(), $("div", Za, [ + e.exibirBotaoColunas ? (c(), $("button", { key: 0, type: "button", class: "eli-tabela__acoes-cabecalho-botao eli-tabela__acoes-cabecalho-botao--colunas", - onClick: a[0] || (a[0] = (...n) => e.emitColunas && e.emitColunas(...n)) - }, " Colunas ")) : te("", !0), - B(t, { + onClick: a[0] || (a[0] = (...i) => e.emitColunas && e.emitColunas(...i)) + }, " Colunas ")) : oe("", !0), + L(t, { modelo: e.valorBusca, onBuscar: e.emitBuscar }, null, 8, ["modelo", "onBuscar"]) - ])) : te("", !0), - e.temAcoesCabecalho ? (i(), y("div", rt, [ - (i(!0), y(le, null, pe(e.acoesCabecalho, (n, f) => (i(), y("button", { - key: `${n.rotulo}-${f}`, + ])) : oe("", !0), + e.temAcoesCabecalho ? (c(), $("div", Xa, [ + (c(!0), $(ce, null, fe(e.acoesCabecalho, (i, p) => (c(), $("button", { + key: `${i.rotulo}-${p}`, type: "button", class: "eli-tabela__acoes-cabecalho-botao", - style: Te(n.cor ? { backgroundColor: n.cor, color: "#fff" } : void 0), - onClick: n.acao + style: we(i.cor ? { backgroundColor: i.cor, color: "#fff" } : void 0), + onClick: i.acao }, [ - n.icone ? (i(), z(De(n.icone), { + i.icone ? (c(), ee(De(i.icone), { key: 0, class: "eli-tabela__acoes-cabecalho-icone", size: 16, "stroke-width": 2 - })) : te("", !0), - E("span", it, j(n.rotulo), 1) - ], 12, st))), 128)) - ])) : te("", !0) + })) : oe("", !0), + _("span", Ka, z(i.rotulo), 1) + ], 12, Ga))), 128)) + ])) : oe("", !0) ]); } -const dt = /* @__PURE__ */ Y(ot, [["render", ut], ["__scopeId", "data-v-42938cb8"]]), ct = H({ +const xa = /* @__PURE__ */ R(Ja, [["render", Qa], ["__scopeId", "data-v-42938cb8"]]), et = Y({ name: "EliTabelaEstados", props: { carregando: { @@ -1005,25 +745,25 @@ const dt = /* @__PURE__ */ Y(ot, [["render", ut], ["__scopeId", "data-v-42938cb8 default: void 0 } } -}), pt = { +}), at = { key: 0, class: "eli-tabela eli-tabela--carregando", "aria-busy": "true" -}, mt = { +}, tt = { key: 1, class: "eli-tabela eli-tabela--erro", role: "alert" -}, ft = { class: "eli-tabela__erro-mensagem" }, vt = { +}, ot = { class: "eli-tabela__erro-mensagem" }, nt = { key: 2, class: "eli-tabela eli-tabela--vazio" }; -function bt(e, a, o, l, s, v) { - return e.carregando ? (i(), y("div", pt, " Carregando... ")) : e.erro ? (i(), y("div", mt, [ - a[0] || (a[0] = E("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), - E("div", ft, j(e.erro), 1) - ])) : (i(), y("div", vt, j(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); +function it(e, a, o, n, l, v) { + return e.carregando ? (c(), $("div", at, " Carregando... ")) : e.erro ? (c(), $("div", tt, [ + a[0] || (a[0] = _("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), + _("div", ot, z(e.erro), 1) + ])) : (c(), $("div", nt, z(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); } -const ht = /* @__PURE__ */ Y(ct, [["render", bt]]), gt = H({ +const rt = /* @__PURE__ */ R(et, [["render", it]]), lt = Y({ name: "EliTabelaDebug", props: { isDev: { @@ -1039,22 +779,22 @@ const ht = /* @__PURE__ */ Y(ct, [["render", bt]]), gt = H({ required: !0 } } -}), yt = { +}), st = { key: 0, style: { position: "fixed", left: "8px", bottom: "8px", "z-index": "999999", background: "rgba(185,28,28,0.9)", color: "#fff", padding: "6px 10px", "border-radius": "8px", "font-size": "12px", "max-width": "500px" } }; -function $t(e, a, o, l, s, v) { - return e.isDev ? (i(), y("div", yt, [ - a[0] || (a[0] = E("div", null, [ - E("b", null, "EliTabela debug") +function ut(e, a, o, n, l, v) { + return e.isDev ? (c(), $("div", st, [ + a[0] || (a[0] = _("div", null, [ + _("b", null, "EliTabela debug") ], -1)), - E("div", null, "menuAberto: " + j(e.menuAberto), 1), - E("div", null, "menuPos: top=" + j(e.menuPopupPos.top) + ", left=" + j(e.menuPopupPos.left), 1) - ])) : te("", !0); + _("div", null, "menuAberto: " + z(e.menuAberto), 1), + _("div", null, "menuPos: top=" + z(e.menuPopupPos.top) + ", left=" + z(e.menuPopupPos.left), 1) + ])) : oe("", !0); } -const Ct = /* @__PURE__ */ Y(gt, [["render", $t]]), Et = H({ +const ct = /* @__PURE__ */ R(lt, [["render", ut]]), dt = Y({ name: "EliTabelaHead", - components: { ArrowUp: Le, ArrowDown: Fe }, + components: { ArrowUp: Le, ArrowDown: Ne }, props: { colunas: { type: Array, @@ -1083,70 +823,70 @@ const Ct = /* @__PURE__ */ Y(gt, [["render", $t]]), Et = H({ } }, setup(e, { emit: a }) { - function o(s) { - return (s == null ? void 0 : s.coluna_ordem) !== void 0 && (s == null ? void 0 : s.coluna_ordem) !== null; + function o(l) { + return (l == null ? void 0 : l.coluna_ordem) !== void 0 && (l == null ? void 0 : l.coluna_ordem) !== null; } - function l(s) { - a("alternarOrdenacao", s); + function n(l) { + a("alternarOrdenacao", l); } return { ArrowUp: Le, - ArrowDown: Fe, + ArrowDown: Ne, isOrdenavel: o, - emitAlternarOrdenacao: l + emitAlternarOrdenacao: n }; } -}), _t = { class: "eli-tabela__thead" }, kt = { class: "eli-tabela__tr eli-tabela__tr--header" }, Dt = { +}), ft = { class: "eli-tabela__thead" }, pt = { class: "eli-tabela__tr eli-tabela__tr--header" }, vt = { key: 0, class: "eli-tabela__th eli-tabela__th--expander", scope: "col" -}, St = ["onClick"], wt = { class: "eli-tabela__th-texto" }, Vt = { +}, mt = ["onClick"], bt = { class: "eli-tabela__th-texto" }, ht = { key: 1, class: "eli-tabela__th-label" -}, Mt = { +}, gt = { key: 1, class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }; -function At(e, a, o, l, s, v) { - const t = x("ArrowUp"); - return i(), y("thead", _t, [ - E("tr", kt, [ - e.temColunasInvisiveis ? (i(), y("th", Dt)) : te("", !0), - (i(!0), y(le, null, pe(e.colunas, (n, f) => (i(), y("th", { - key: `th-${f}`, - class: be(["eli-tabela__th", [e.isOrdenavel(n) ? "eli-tabela__th--ordenavel" : void 0]]), +function $t(e, a, o, n, l, v) { + const t = Q("ArrowUp"); + return c(), $("thead", ft, [ + _("tr", pt, [ + e.temColunasInvisiveis ? (c(), $("th", vt)) : oe("", !0), + (c(!0), $(ce, null, fe(e.colunas, (i, p) => (c(), $("th", { + key: `th-${p}`, + class: me(["eli-tabela__th", [e.isOrdenavel(i) ? "eli-tabela__th--ordenavel" : void 0]]), scope: "col" }, [ - e.isOrdenavel(n) ? (i(), y("button", { + e.isOrdenavel(i) ? (c(), $("button", { key: 0, type: "button", - class: be(["eli-tabela__th-botao", [ - e.colunaOrdenacao === String(n.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 + class: me(["eli-tabela__th-botao", [ + e.colunaOrdenacao === String(i.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 ]]), - onClick: (r) => e.emitAlternarOrdenacao(String(n.coluna_ordem)) + onClick: (r) => e.emitAlternarOrdenacao(String(i.coluna_ordem)) }, [ - E("span", wt, j(n.rotulo), 1), - e.colunaOrdenacao === String(n.coluna_ordem) ? (i(), z(De(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { + _("span", bt, z(i.rotulo), 1), + e.colunaOrdenacao === String(i.coluna_ordem) ? (c(), ee(De(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { key: 0, class: "eli-tabela__th-icone", size: 16, "stroke-width": 2, "aria-hidden": "true" - })) : (i(), z(t, { + })) : (c(), ee(t, { key: 1, class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", size: 16, "stroke-width": 2, "aria-hidden": "true" })) - ], 10, St)) : (i(), y("span", Vt, j(n.rotulo), 1)) + ], 10, mt)) : (c(), $("span", ht, z(i.rotulo), 1)) ], 2))), 128)), - e.temAcoes ? (i(), y("th", Mt, " Ações ")) : te("", !0) + e.temAcoes ? (c(), $("th", gt, " Ações ")) : oe("", !0) ]) ]); } -const Bt = /* @__PURE__ */ Y(Et, [["render", At]]), Tt = H({ +const yt = /* @__PURE__ */ R(dt, [["render", $t]]), _t = Y({ name: "EliTabelaCelulaTextoSimples", components: {}, props: { @@ -1161,17 +901,17 @@ const Bt = /* @__PURE__ */ Y(Et, [["render", At]]), Tt = H({ setup({ dados: e }) { return { dados: e }; } -}), Pt = { key: 1 }; -function It(e, a, o, l, s, v) { - var t, n, f; - return (t = e.dados) != null && t.acao ? (i(), y("button", { +}), Et = { key: 1 }; +function Ct(e, a, o, n, l, v) { + var t, i, p; + return (t = e.dados) != null && t.acao ? (c(), $("button", { key: 0, type: "button", class: "eli-tabela__celula-link", - onClick: a[0] || (a[0] = ce((r) => e.dados.acao(), ["stop", "prevent"])) - }, j((n = e.dados) == null ? void 0 : n.texto), 1)) : (i(), y("span", Pt, j((f = e.dados) == null ? void 0 : f.texto), 1)); + onClick: a[0] || (a[0] = de((r) => e.dados.acao(), ["stop", "prevent"])) + }, z((i = e.dados) == null ? void 0 : i.texto), 1)) : (c(), $("span", Et, z((p = e.dados) == null ? void 0 : p.texto), 1)); } -const Ot = /* @__PURE__ */ Y(Tt, [["render", It], ["__scopeId", "data-v-7a629ffa"]]), Nt = H({ +const Dt = /* @__PURE__ */ R(_t, [["render", Ct], ["__scopeId", "data-v-7a629ffa"]]), kt = Y({ name: "EliTabelaCelulaTextoTruncado", props: { dados: { @@ -1181,22 +921,22 @@ const Ot = /* @__PURE__ */ Y(Tt, [["render", It], ["__scopeId", "data-v-7a629ffa setup({ dados: e }) { return { dados: e }; } -}), qt = ["title"], Ft = ["title"]; -function Lt(e, a, o, l, s, v) { - var t, n, f, r, p; - return (t = e.dados) != null && t.acao ? (i(), y("button", { +}), St = ["title"], At = ["title"]; +function Mt(e, a, o, n, l, v) { + var t, i, p, r, f; + return (t = e.dados) != null && t.acao ? (c(), $("button", { key: 0, type: "button", class: "eli-tabela__texto-truncado eli-tabela__celula-link", - title: (n = e.dados) == null ? void 0 : n.texto, - onClick: a[0] || (a[0] = ce((C) => e.dados.acao(), ["stop", "prevent"])) - }, j((f = e.dados) == null ? void 0 : f.texto), 9, qt)) : (i(), y("span", { + title: (i = e.dados) == null ? void 0 : i.texto, + onClick: a[0] || (a[0] = de((y) => e.dados.acao(), ["stop", "prevent"])) + }, z((p = e.dados) == null ? void 0 : p.texto), 9, St)) : (c(), $("span", { key: 1, class: "eli-tabela__texto-truncado", title: (r = e.dados) == null ? void 0 : r.texto - }, j((p = e.dados) == null ? void 0 : p.texto), 9, Ft)); + }, z((f = e.dados) == null ? void 0 : f.texto), 9, At)); } -const jt = /* @__PURE__ */ Y(Nt, [["render", Lt], ["__scopeId", "data-v-74854889"]]), Ut = H({ +const Bt = /* @__PURE__ */ R(kt, [["render", Mt], ["__scopeId", "data-v-74854889"]]), Tt = Y({ name: "EliTabelaCelulaNumero", components: {}, props: { @@ -1211,21 +951,21 @@ const jt = /* @__PURE__ */ Y(Nt, [["render", Lt], ["__scopeId", "data-v-74854889 setup({ dados: e }) { return { dados: e }; } -}), zt = { key: 1 }; -function Ht(e, a, o, l, s, v) { - var t, n, f; - return (t = e.dados) != null && t.acao ? (i(), y("button", { +}), wt = { key: 1 }; +function Ot(e, a, o, n, l, v) { + var t, i, p; + return (t = e.dados) != null && t.acao ? (c(), $("button", { key: 0, type: "button", class: "eli-tabela__celula-link", - onClick: a[0] || (a[0] = ce((r) => e.dados.acao(), ["stop", "prevent"])) - }, j(String((n = e.dados) == null ? void 0 : n.numero).replace(".", ",")), 1)) : (i(), y("span", zt, j(String((f = e.dados) == null ? void 0 : f.numero).replace(".", ",")), 1)); + onClick: a[0] || (a[0] = de((r) => e.dados.acao(), ["stop", "prevent"])) + }, z(String((i = e.dados) == null ? void 0 : i.numero).replace(".", ",")), 1)) : (c(), $("span", wt, z(String((p = e.dados) == null ? void 0 : p.numero).replace(".", ",")), 1)); } -const Yt = /* @__PURE__ */ Y(Ut, [["render", Ht], ["__scopeId", "data-v-e7bac7ff"]]), Rt = { - textoSimples: Ot, - textoTruncado: jt, - numero: Yt -}, Jt = H({ +const Pt = /* @__PURE__ */ R(Tt, [["render", Ot], ["__scopeId", "data-v-e7bac7ff"]]), It = { + textoSimples: Dt, + textoTruncado: Bt, + numero: Pt +}, Vt = Y({ name: "EliTabelaCelula", props: { celula: { @@ -1235,16 +975,16 @@ const Yt = /* @__PURE__ */ Y(Ut, [["render", Ht], ["__scopeId", "data-v-e7bac7ff } }, setup(e) { - const a = k(() => e.celula[0]), o = k(() => e.celula[1]), l = k(() => Rt[a.value]), s = k(() => o.value); - return { Componente: l, dadosParaComponente: s }; + const a = k(() => e.celula[0]), o = k(() => e.celula[1]), n = k(() => It[a.value]), l = k(() => o.value); + return { Componente: n, dadosParaComponente: l }; } }); -function Wt(e, a, o, l, s, v) { - return i(), z(De(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +function qt(e, a, o, n, l, v) { + return c(), ee(De(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); } -const aa = /* @__PURE__ */ Y(Jt, [["render", Wt]]), Zt = H({ +const Qe = /* @__PURE__ */ R(Vt, [["render", qt]]), Nt = Y({ name: "EliTabelaDetalhesLinha", - components: { EliTabelaCelula: aa }, + components: { EliTabelaCelula: Qe }, props: { linha: { type: null, @@ -1255,31 +995,31 @@ const aa = /* @__PURE__ */ Y(Jt, [["render", Wt]]), Zt = H({ required: !0 } } -}), Gt = { class: "eli-tabela__detalhes" }, Xt = { class: "eli-tabela__detalhe-rotulo" }, Kt = { class: "eli-tabela__detalhe-valor" }; -function Qt(e, a, o, l, s, v) { - const t = x("EliTabelaCelula"); - return i(), y("div", Gt, [ - (i(!0), y(le, null, pe(e.colunasInvisiveis, (n, f) => (i(), y("div", { - key: `det-${f}-${n.rotulo}`, +}), Lt = { class: "eli-tabela__detalhes" }, Ft = { class: "eli-tabela__detalhe-rotulo" }, jt = { class: "eli-tabela__detalhe-valor" }; +function zt(e, a, o, n, l, v) { + const t = Q("EliTabelaCelula"); + return c(), $("div", Lt, [ + (c(!0), $(ce, null, fe(e.colunasInvisiveis, (i, p) => (c(), $("div", { + key: `det-${p}-${i.rotulo}`, class: "eli-tabela__detalhe" }, [ - E("div", Xt, j(n.rotulo), 1), - E("div", Kt, [ - B(t, { - celula: n.celula(e.linha) + _("div", Ft, z(i.rotulo), 1), + _("div", jt, [ + L(t, { + celula: i.celula(e.linha) }, null, 8, ["celula"]) ]) ]))), 128)) ]); } -const xt = /* @__PURE__ */ Y(Zt, [["render", Qt], ["__scopeId", "data-v-f1ee8d20"]]), eo = H({ +const Ht = /* @__PURE__ */ R(Nt, [["render", zt], ["__scopeId", "data-v-f1ee8d20"]]), Ut = Y({ name: "EliTabelaBody", components: { - EliTabelaCelula: aa, - EliTabelaDetalhesLinha: xt, - MoreVertical: Xa, - ChevronRight: Ue, - ChevronDown: je + EliTabelaCelula: Qe, + EliTabelaDetalhesLinha: Ht, + MoreVertical: Fa, + ChevronRight: je, + ChevronDown: Fe }, props: { colunas: { @@ -1325,97 +1065,97 @@ const xt = /* @__PURE__ */ Y(Zt, [["render", Qt], ["__scopeId", "data-v-f1ee8d20 }, setup() { return { - ChevronRight: Ue, - ChevronDown: je + ChevronRight: je, + ChevronDown: Fe }; } -}), ao = { class: "eli-tabela__tbody" }, to = ["aria-expanded", "aria-label", "title", "onClick"], oo = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"], no = ["colspan"]; -function lo(e, a, o, l, s, v) { - const t = x("EliTabelaCelula"), n = x("MoreVertical"), f = x("EliTabelaDetalhesLinha"); - return i(), y("tbody", ao, [ - (i(!0), y(le, null, pe(e.linhas, (r, p) => { - var C, P, D, $, d, M; - return i(), y(le, { - key: `grp-${p}` +}), Yt = { class: "eli-tabela__tbody" }, Rt = ["aria-expanded", "aria-label", "title", "onClick"], Jt = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"], Wt = ["colspan"]; +function Zt(e, a, o, n, l, v) { + const t = Q("EliTabelaCelula"), i = Q("MoreVertical"), p = Q("EliTabelaDetalhesLinha"); + return c(), $("tbody", Yt, [ + (c(!0), $(ce, null, fe(e.linhas, (r, f) => { + var y, w, T, C, g, M; + return c(), $(ce, { + key: `grp-${f}` }, [ - E("tr", { - class: be(["eli-tabela__tr", [p % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) + _("tr", { + class: me(["eli-tabela__tr", [f % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) }, [ - e.temColunasInvisiveis ? (i(), y("td", { + e.temColunasInvisiveis ? (c(), $("td", { class: "eli-tabela__td eli-tabela__td--expander", - key: `td-${p}-exp` + key: `td-${f}-exp` }, [ - E("button", { + _("button", { type: "button", - class: be(["eli-tabela__expander-botao", [(C = e.linhasExpandidas) != null && C[p] ? "eli-tabela__expander-botao--ativo" : void 0]]), - "aria-expanded": (P = e.linhasExpandidas) != null && P[p] ? "true" : "false", - "aria-label": (D = e.linhasExpandidas) != null && D[p] ? "Ocultar colunas ocultas" : "Mostrar colunas ocultas", - title: ($ = e.linhasExpandidas) != null && $[p] ? "Ocultar detalhes" : "Mostrar detalhes", - onClick: ce((g) => e.alternarLinhaExpandida(p), ["stop"]) + class: me(["eli-tabela__expander-botao", [(y = e.linhasExpandidas) != null && y[f] ? "eli-tabela__expander-botao--ativo" : void 0]]), + "aria-expanded": (w = e.linhasExpandidas) != null && w[f] ? "true" : "false", + "aria-label": (T = e.linhasExpandidas) != null && T[f] ? "Ocultar colunas ocultas" : "Mostrar colunas ocultas", + title: (C = e.linhasExpandidas) != null && C[f] ? "Ocultar detalhes" : "Mostrar detalhes", + onClick: de((h) => e.alternarLinhaExpandida(f), ["stop"]) }, [ - (i(), z(De((d = e.linhasExpandidas) != null && d[p] ? e.ChevronDown : e.ChevronRight), { + (c(), ee(De((g = e.linhasExpandidas) != null && g[f] ? e.ChevronDown : e.ChevronRight), { class: "eli-tabela__expander-icone", size: 16, "stroke-width": 2, "aria-hidden": "true" })) - ], 10, to) - ])) : te("", !0), - (i(!0), y(le, null, pe(e.colunas, (g, S) => (i(), y("td", { - key: `td-${p}-${S}`, + ], 10, Rt) + ])) : oe("", !0), + (c(!0), $(ce, null, fe(e.colunas, (h, D) => (c(), $("td", { + key: `td-${f}-${D}`, class: "eli-tabela__td" }, [ - B(t, { - celula: g.celula(r) + L(t, { + celula: h.celula(r) }, null, 8, ["celula"]) ]))), 128)), - e.temAcoes ? (i(), y("td", { + e.temAcoes ? (c(), $("td", { class: "eli-tabela__td eli-tabela__td--acoes", - key: `td-${p}-acoes` + key: `td-${f}-acoes` }, [ - E("div", { - class: be(["eli-tabela__acoes-container", [e.menuAberto === p ? "eli-tabela__acoes-container--aberto" : void 0]]) + _("div", { + class: me(["eli-tabela__acoes-container", [e.menuAberto === f ? "eli-tabela__acoes-container--aberto" : void 0]]) }, [ - E("button", { + _("button", { class: "eli-tabela__acoes-toggle", type: "button", - id: `eli-tabela-acoes-toggle-${p}`, - disabled: !e.possuiAcoes(p), + id: `eli-tabela-acoes-toggle-${f}`, + disabled: !e.possuiAcoes(f), "aria-haspopup": "menu", - "aria-expanded": e.menuAberto === p ? "true" : "false", - "aria-controls": e.possuiAcoes(p) ? `eli-tabela-acoes-menu-${p}` : void 0, - "aria-label": e.possuiAcoes(p) ? "Ações da linha" : "Nenhuma ação disponível", - title: e.possuiAcoes(p) ? "Ações" : "Nenhuma ação disponível", - onClick: ce((g) => e.toggleMenu(p, g), ["stop"]) + "aria-expanded": e.menuAberto === f ? "true" : "false", + "aria-controls": e.possuiAcoes(f) ? `eli-tabela-acoes-menu-${f}` : void 0, + "aria-label": e.possuiAcoes(f) ? "Ações da linha" : "Nenhuma ação disponível", + title: e.possuiAcoes(f) ? "Ações" : "Nenhuma ação disponível", + onClick: de((h) => e.toggleMenu(f, h), ["stop"]) }, [ - B(n, { + L(i, { class: "eli-tabela__acoes-toggle-icone", size: 18, "stroke-width": 2 }) - ], 8, oo) + ], 8, Jt) ], 2) - ])) : te("", !0) + ])) : oe("", !0) ], 2), - e.temColunasInvisiveis && ((M = e.linhasExpandidas) != null && M[p]) ? (i(), y("tr", { + e.temColunasInvisiveis && ((M = e.linhasExpandidas) != null && M[f]) ? (c(), $("tr", { key: 0, - class: be(["eli-tabela__tr eli-tabela__tr--detalhes", [p % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) + class: me(["eli-tabela__tr eli-tabela__tr--detalhes", [f % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) }, [ - E("td", { + _("td", { class: "eli-tabela__td eli-tabela__td--detalhes", colspan: (e.temColunasInvisiveis ? 1 : 0) + e.colunas.length + (e.temAcoes ? 1 : 0) }, [ - B(f, { + L(p, { linha: r, colunasInvisiveis: e.colunasInvisiveis }, null, 8, ["linha", "colunasInvisiveis"]) - ], 8, no) - ], 2)) : te("", !0) + ], 8, Wt) + ], 2)) : oe("", !0) ], 64); }), 128)) ]); } -const ro = /* @__PURE__ */ Y(eo, [["render", lo]]), so = H({ +const Xt = /* @__PURE__ */ R(Ut, [["render", Zt]]), Gt = Y({ name: "EliTabelaMenuAcoes", props: { menuAberto: { @@ -1442,57 +1182,57 @@ const ro = /* @__PURE__ */ Y(eo, [["render", lo]]), so = H({ } }, setup(e, { emit: a, expose: o }) { - const l = T(null); - o({ menuEl: l }); - const s = k(() => e.acoes.length > 0); + const n = N(null); + o({ menuEl: n }); + const l = k(() => e.acoes.length > 0); function v(t) { e.linha && a("executar", { acao: t.acao, linha: e.linha }); } - return { menuEl: l, possuiAcoes: s, emitExecutar: v }; + return { menuEl: n, possuiAcoes: l, emitExecutar: v }; } -}), io = ["id", "aria-labelledby"], uo = ["aria-label", "title", "onClick"], co = { class: "eli-tabela__acoes-item-texto" }; -function po(e, a, o, l, s, v) { - return i(), z(ua, { to: "body" }, [ - e.menuAberto !== null && e.possuiAcoes ? (i(), y("ul", { +}), Kt = ["id", "aria-labelledby"], Qt = ["aria-label", "title", "onClick"], xt = { class: "eli-tabela__acoes-item-texto" }; +function eo(e, a, o, n, l, v) { + return c(), ee(ra, { to: "body" }, [ + e.menuAberto !== null && e.possuiAcoes ? (c(), $("ul", { key: 0, id: `eli-tabela-acoes-menu-${e.menuAberto}`, ref: "menuEl", class: "eli-tabela__acoes-menu", role: "menu", "aria-labelledby": `eli-tabela-acoes-toggle-${e.menuAberto}`, - style: Te({ + style: we({ position: "fixed", top: `${e.posicao.top}px`, left: `${e.posicao.left}px`, zIndex: 999999 }) }, [ - (i(!0), y(le, null, pe(e.acoes, (t) => (i(), y("li", { + (c(!0), $(ce, null, fe(e.acoes, (t) => (c(), $("li", { key: `acao-${e.menuAberto}-${t.indice}`, class: "eli-tabela__acoes-item", role: "none" }, [ - E("button", { + _("button", { type: "button", class: "eli-tabela__acoes-item-botao", - style: Te({ color: t.acao.cor }), + style: we({ color: t.acao.cor }), role: "menuitem", "aria-label": t.acao.rotulo, title: t.acao.rotulo, - onClick: ce((n) => e.emitExecutar(t), ["stop"]) + onClick: de((i) => e.emitExecutar(t), ["stop"]) }, [ - (i(), z(De(t.acao.icone), { + (c(), ee(De(t.acao.icone), { class: "eli-tabela__acoes-item-icone", size: 16, "stroke-width": 2 })), - E("span", co, j(t.acao.rotulo), 1) - ], 12, uo) + _("span", xt, z(t.acao.rotulo), 1) + ], 12, Qt) ]))), 128)) - ], 12, io)) : te("", !0) + ], 12, Kt)) : oe("", !0) ]); } -const mo = /* @__PURE__ */ Y(so, [["render", po]]), fo = H({ +const ao = /* @__PURE__ */ R(Gt, [["render", eo]]), to = Y({ name: "EliTabelaPaginacao", props: { pagina: { @@ -1517,86 +1257,86 @@ const mo = /* @__PURE__ */ Y(so, [["render", po]]), fo = H({ const o = k(() => { const r = e.maximoBotoes; return typeof r == "number" && r >= 5 ? Math.floor(r) : 7; - }), l = k(() => { - const r = e.totalPaginas, p = e.pagina, C = o.value, P = [], D = (S) => { - P.push({ - label: String(S), - pagina: S, - ativo: S === p + }), n = k(() => { + const r = e.totalPaginas, f = e.pagina, y = o.value, w = [], T = (D) => { + w.push({ + label: String(D), + pagina: D, + ativo: D === f }); - }, $ = () => { - P.push({ label: "…", ehEllipsis: !0 }); + }, C = () => { + w.push({ label: "…", ehEllipsis: !0 }); }; - if (r <= C) { - for (let S = 1; S <= r; S += 1) - D(S); - return P; + if (r <= y) { + for (let D = 1; D <= r; D += 1) + T(D); + return w; } - const d = Math.max(3, C - 2); - let M = Math.max(2, p - Math.floor(d / 2)), g = M + d - 1; - g >= r && (g = r - 1, M = g - d + 1), D(1), M > 2 && $(); - for (let S = M; S <= g; S += 1) - D(S); - return g < r - 1 && $(), D(r), P; + const g = Math.max(3, y - 2); + let M = Math.max(2, f - Math.floor(g / 2)), h = M + g - 1; + h >= r && (h = r - 1, M = h - g + 1), T(1), M > 2 && C(); + for (let D = M; D <= h; D += 1) + T(D); + return h < r - 1 && C(), T(r), w; }); - function s(r) { + function l(r) { if (!r) return; - const p = Math.min(Math.max(1, r), e.totalPaginas); - p !== e.pagina && a("alterar", p); + const f = Math.min(Math.max(1, r), e.totalPaginas); + f !== e.pagina && a("alterar", f); } - const v = k(() => e.pagina <= 1), t = k(() => e.pagina >= e.totalPaginas), n = k(() => e.pagina), f = k(() => e.totalPaginas); + const v = k(() => e.pagina <= 1), t = k(() => e.pagina >= e.totalPaginas), i = k(() => e.pagina), p = k(() => e.totalPaginas); return { - botoes: l, - irParaPagina: s, + botoes: n, + irParaPagina: l, anteriorDesabilitado: v, proximaDesabilitada: t, - paginaAtual: n, - totalPaginasExibidas: f + paginaAtual: i, + totalPaginasExibidas: p }; } -}), vo = { +}), oo = { key: 0, class: "eli-tabela__paginacao", role: "navigation", "aria-label": "Paginação de resultados" -}, bo = ["disabled"], ho = { +}, no = ["disabled"], io = { key: 0, class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" -}, go = ["disabled", "aria-current", "aria-label", "onClick"], yo = ["disabled"]; -function $o(e, a, o, l, s, v) { - return e.totalPaginasExibidas > 1 ? (i(), y("nav", vo, [ - E("button", { +}, ro = ["disabled", "aria-current", "aria-label", "onClick"], lo = ["disabled"]; +function so(e, a, o, n, l, v) { + return e.totalPaginasExibidas > 1 ? (c(), $("nav", oo, [ + _("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.anteriorDesabilitado, "aria-label": "Página anterior", onClick: a[0] || (a[0] = (t) => e.irParaPagina(e.paginaAtual - 1)) - }, " << ", 8, bo), - (i(!0), y(le, null, pe(e.botoes, (t, n) => (i(), y(le, { - key: `${t.label}-${n}` + }, " << ", 8, no), + (c(!0), $(ce, null, fe(e.botoes, (t, i) => (c(), $(ce, { + key: `${t.label}-${i}` }, [ - t.ehEllipsis ? (i(), y("span", ho, j(t.label), 1)) : (i(), y("button", { + t.ehEllipsis ? (c(), $("span", io, z(t.label), 1)) : (c(), $("button", { key: 1, type: "button", - class: be(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + class: me(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), disabled: t.ativo, "aria-current": t.ativo ? "page" : void 0, "aria-label": `Ir para página ${t.label}`, - onClick: (f) => e.irParaPagina(t.pagina) - }, j(t.label), 11, go)) + onClick: (p) => e.irParaPagina(t.pagina) + }, z(t.label), 11, ro)) ], 64))), 128)), - E("button", { + _("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.proximaDesabilitada, "aria-label": "Próxima página", onClick: a[1] || (a[1] = (t) => e.irParaPagina(e.paginaAtual + 1)) - }, " >> ", 8, yo) - ])) : te("", !0); + }, " >> ", 8, lo) + ])) : oe("", !0); } -const Co = /* @__PURE__ */ Y(fo, [["render", $o], ["__scopeId", "data-v-5ca7a362"]]), ze = "application/x-eli-tabela-coluna", Eo = H({ +const uo = /* @__PURE__ */ R(to, [["render", so], ["__scopeId", "data-v-5ca7a362"]]), ze = "application/x-eli-tabela-coluna", co = Y({ name: "EliTabelaModalColunas", props: { aberto: { @@ -1625,22 +1365,22 @@ const Co = /* @__PURE__ */ Y(fo, [["render", $o], ["__scopeId", "data-v-5ca7a362 } }, setup(e, { emit: a }) { - const o = T([]), l = T([]); - function s() { - var se, ve; - const $ = e.rotulosColunas, d = (((se = e.configInicial.visiveis) == null ? void 0 : se.length) ?? 0) > 0 || (((ve = e.configInicial.invisiveis) == null ? void 0 : ve.length) ?? 0) > 0, M = new Set( + const o = N([]), n = N([]); + function l() { + var re, ve; + const C = e.rotulosColunas, g = (((re = e.configInicial.visiveis) == null ? void 0 : re.length) ?? 0) > 0 || (((ve = e.configInicial.invisiveis) == null ? void 0 : ve.length) ?? 0) > 0, M = new Set( e.colunas.filter((X) => X.visivel === !1).map((X) => X.rotulo) - ), g = d ? new Set(e.configInicial.invisiveis ?? []) : M, S = $.filter((X) => !g.has(X)), oe = e.configInicial.visiveis ?? [], ie = new Set(S), re = []; - for (const X of oe) - ie.has(X) && re.push(X); - for (const X of S) - re.includes(X) || re.push(X); - o.value = re, l.value = $.filter((X) => g.has(X)); + ), h = g ? new Set(e.configInicial.invisiveis ?? []) : M, D = C.filter((X) => !h.has(X)), ae = e.configInicial.visiveis ?? [], le = new Set(D), ie = []; + for (const X of ae) + le.has(X) && ie.push(X); + for (const X of D) + ie.includes(X) || ie.push(X); + o.value = ie, n.value = C.filter((X) => h.has(X)); } - fe( + pe( () => [e.aberto, e.rotulosColunas, e.configInicial, e.colunas], () => { - e.aberto && s(); + e.aberto && l(); }, { deep: !0, immediate: !0 } ); @@ -1650,196 +1390,196 @@ const Co = /* @__PURE__ */ Y(fo, [["render", $o], ["__scopeId", "data-v-5ca7a362 function t() { a("salvar", { visiveis: [...o.value], - invisiveis: [...l.value] + invisiveis: [...n.value] }); } - function n($, d) { - var M, g; + function i(C, g) { + var M, h; try { - (M = $.dataTransfer) == null || M.setData(ze, JSON.stringify(d)), (g = $.dataTransfer) == null || g.setData("text/plain", d.rotulo), $.dataTransfer.effectAllowed = "move"; + (M = C.dataTransfer) == null || M.setData(ze, JSON.stringify(g)), (h = C.dataTransfer) == null || h.setData("text/plain", g.rotulo), C.dataTransfer.effectAllowed = "move"; } catch { } } - function f($) { - var d; + function p(C) { + var g; try { - const M = (d = $.dataTransfer) == null ? void 0 : d.getData(ze); + const M = (g = C.dataTransfer) == null ? void 0 : g.getData(ze); if (!M) return null; - const g = JSON.parse(M); - return !g || typeof g.rotulo != "string" || g.origem !== "visiveis" && g.origem !== "invisiveis" ? null : g; + const h = JSON.parse(M); + return !h || typeof h.rotulo != "string" || h.origem !== "visiveis" && h.origem !== "invisiveis" ? null : h; } catch { return null; } } - function r($) { - const d = $.origem === "visiveis" ? o.value : l.value, M = d.indexOf($.rotulo); - M >= 0 && d.splice(M, 1); + function r(C) { + const g = C.origem === "visiveis" ? o.value : n.value, M = g.indexOf(C.rotulo); + M >= 0 && g.splice(M, 1); } - function p($, d, M) { - const g = $ === "visiveis" ? o.value : l.value, S = g.indexOf(d); - S >= 0 && g.splice(S, 1), M === null || M < 0 || M > g.length ? g.push(d) : g.splice(M, 0, d); + function f(C, g, M) { + const h = C === "visiveis" ? o.value : n.value, D = h.indexOf(g); + D >= 0 && h.splice(D, 1), M === null || M < 0 || M > h.length ? h.push(g) : h.splice(M, 0, g); } - function C($, d, M, g) { - n($, { rotulo: d, origem: M, index: g }); + function y(C, g, M, h) { + i(C, { rotulo: g, origem: M, index: h }); } - function P($, d, M) { - const g = f($); - if (g) - if (r(g), p(d, g.rotulo, M), d === "visiveis") { - const S = l.value.indexOf(g.rotulo); - S >= 0 && l.value.splice(S, 1); + function w(C, g, M) { + const h = p(C); + if (h) + if (r(h), f(g, h.rotulo, M), g === "visiveis") { + const D = n.value.indexOf(h.rotulo); + D >= 0 && n.value.splice(D, 1); } else { - const S = o.value.indexOf(g.rotulo); - S >= 0 && o.value.splice(S, 1); + const D = o.value.indexOf(h.rotulo); + D >= 0 && o.value.splice(D, 1); } } - function D($, d, M) { - const g = f($); - if (g) - if (r(g), p(d, g.rotulo, null), d === "visiveis") { - const S = l.value.indexOf(g.rotulo); - S >= 0 && l.value.splice(S, 1); + function T(C, g, M) { + const h = p(C); + if (h) + if (r(h), f(g, h.rotulo, null), g === "visiveis") { + const D = n.value.indexOf(h.rotulo); + D >= 0 && n.value.splice(D, 1); } else { - const S = o.value.indexOf(g.rotulo); - S >= 0 && o.value.splice(S, 1); + const D = o.value.indexOf(h.rotulo); + D >= 0 && o.value.splice(D, 1); } } return { visiveisLocal: o, - invisiveisLocal: l, + invisiveisLocal: n, emitFechar: v, emitSalvar: t, - onDragStart: C, - onDropItem: P, - onDropLista: D + onDragStart: y, + onDropItem: w, + onDropLista: T }; } -}), _o = { +}), fo = { class: "eli-tabela-modal-colunas__modal", role: "dialog", "aria-modal": "true", "aria-label": "Configurar colunas" -}, ko = { class: "eli-tabela-modal-colunas__header" }, Do = { class: "eli-tabela-modal-colunas__conteudo" }, So = { class: "eli-tabela-modal-colunas__coluna" }, wo = ["onDragstart", "onDrop"], Vo = { class: "eli-tabela-modal-colunas__item-texto" }, Mo = { class: "eli-tabela-modal-colunas__coluna" }, Ao = ["onDragstart", "onDrop"], Bo = { class: "eli-tabela-modal-colunas__item-texto" }, To = { class: "eli-tabela-modal-colunas__footer" }; -function Po(e, a, o, l, s, v) { - return e.aberto ? (i(), y("div", { +}, po = { class: "eli-tabela-modal-colunas__header" }, vo = { class: "eli-tabela-modal-colunas__conteudo" }, mo = { class: "eli-tabela-modal-colunas__coluna" }, bo = ["onDragstart", "onDrop"], ho = { class: "eli-tabela-modal-colunas__item-texto" }, go = { class: "eli-tabela-modal-colunas__coluna" }, $o = ["onDragstart", "onDrop"], yo = { class: "eli-tabela-modal-colunas__item-texto" }, _o = { class: "eli-tabela-modal-colunas__footer" }; +function Eo(e, a, o, n, l, v) { + return e.aberto ? (c(), $("div", { key: 0, class: "eli-tabela-modal-colunas__overlay", role: "presentation", - onClick: a[9] || (a[9] = ce((...t) => e.emitFechar && e.emitFechar(...t), ["self"])) + onClick: a[9] || (a[9] = de((...t) => e.emitFechar && e.emitFechar(...t), ["self"])) }, [ - E("div", _o, [ - E("header", ko, [ - a[10] || (a[10] = E("h3", { class: "eli-tabela-modal-colunas__titulo" }, "Colunas", -1)), - E("button", { + _("div", fo, [ + _("header", po, [ + a[10] || (a[10] = _("h3", { class: "eli-tabela-modal-colunas__titulo" }, "Colunas", -1)), + _("button", { type: "button", class: "eli-tabela-modal-colunas__fechar", "aria-label": "Fechar", onClick: a[0] || (a[0] = (...t) => e.emitFechar && e.emitFechar(...t)) }, " × ") ]), - E("div", Do, [ - E("div", So, [ - a[12] || (a[12] = E("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Visíveis", -1)), - E("div", { + _("div", vo, [ + _("div", mo, [ + a[12] || (a[12] = _("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Visíveis", -1)), + _("div", { class: "eli-tabela-modal-colunas__lista", - onDragover: a[2] || (a[2] = ce(() => { + onDragover: a[2] || (a[2] = de(() => { }, ["prevent"])), onDrop: a[3] || (a[3] = (t) => e.onDropLista(t, "visiveis", null)) }, [ - (i(!0), y(le, null, pe(e.visiveisLocal, (t, n) => (i(), y("div", { + (c(!0), $(ce, null, fe(e.visiveisLocal, (t, i) => (c(), $("div", { key: `vis-${t}`, class: "eli-tabela-modal-colunas__item", draggable: "true", - onDragstart: (f) => e.onDragStart(f, t, "visiveis", n), - onDragover: a[1] || (a[1] = ce(() => { + onDragstart: (p) => e.onDragStart(p, t, "visiveis", i), + onDragover: a[1] || (a[1] = de(() => { }, ["prevent"])), - onDrop: (f) => e.onDropItem(f, "visiveis", n) + onDrop: (p) => e.onDropItem(p, "visiveis", i) }, [ - a[11] || (a[11] = E("span", { + a[11] || (a[11] = _("span", { class: "eli-tabela-modal-colunas__item-handle", "aria-hidden": "true" }, "⋮⋮", -1)), - E("span", Vo, j(t), 1) - ], 40, wo))), 128)) + _("span", ho, z(t), 1) + ], 40, bo))), 128)) ], 32) ]), - E("div", Mo, [ - a[14] || (a[14] = E("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Invisíveis", -1)), - E("div", { + _("div", go, [ + a[14] || (a[14] = _("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Invisíveis", -1)), + _("div", { class: "eli-tabela-modal-colunas__lista", - onDragover: a[5] || (a[5] = ce(() => { + onDragover: a[5] || (a[5] = de(() => { }, ["prevent"])), onDrop: a[6] || (a[6] = (t) => e.onDropLista(t, "invisiveis", null)) }, [ - (i(!0), y(le, null, pe(e.invisiveisLocal, (t, n) => (i(), y("div", { + (c(!0), $(ce, null, fe(e.invisiveisLocal, (t, i) => (c(), $("div", { key: `inv-${t}`, class: "eli-tabela-modal-colunas__item", draggable: "true", - onDragstart: (f) => e.onDragStart(f, t, "invisiveis", n), - onDragover: a[4] || (a[4] = ce(() => { + onDragstart: (p) => e.onDragStart(p, t, "invisiveis", i), + onDragover: a[4] || (a[4] = de(() => { }, ["prevent"])), - onDrop: (f) => e.onDropItem(f, "invisiveis", n) + onDrop: (p) => e.onDropItem(p, "invisiveis", i) }, [ - a[13] || (a[13] = E("span", { + a[13] || (a[13] = _("span", { class: "eli-tabela-modal-colunas__item-handle", "aria-hidden": "true" }, "⋮⋮", -1)), - E("span", Bo, j(t), 1) - ], 40, Ao))), 128)) + _("span", yo, z(t), 1) + ], 40, $o))), 128)) ], 32) ]) ]), - E("footer", To, [ - E("button", { + _("footer", _o, [ + _("button", { type: "button", class: "eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--sec", onClick: a[7] || (a[7] = (...t) => e.emitFechar && e.emitFechar(...t)) }, " Cancelar "), - E("button", { + _("button", { type: "button", class: "eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--prim", onClick: a[8] || (a[8] = (...t) => e.emitSalvar && e.emitSalvar(...t)) }, " Salvar ") ]) ]) - ])) : te("", !0); + ])) : oe("", !0); } -const Io = /* @__PURE__ */ Y(Eo, [["render", Po], ["__scopeId", "data-v-b8f693ef"]]), Oo = "eli:tabela"; -function ta(e) { - return `${Oo}:${e}:colunas`; +const Co = /* @__PURE__ */ R(co, [["render", Eo], ["__scopeId", "data-v-b8f693ef"]]), Do = "eli:tabela"; +function xe(e) { + return `${Do}:${e}:colunas`; } -function oa(e) { +function ea(e) { if (!e || typeof e != "object") return { visiveis: [], invisiveis: [] }; - const a = e, o = Array.isArray(a.visiveis) ? a.visiveis.filter((s) => typeof s == "string") : [], l = Array.isArray(a.invisiveis) ? a.invisiveis.filter((s) => typeof s == "string") : []; - return { visiveis: o, invisiveis: l }; + const a = e, o = Array.isArray(a.visiveis) ? a.visiveis.filter((l) => typeof l == "string") : [], n = Array.isArray(a.invisiveis) ? a.invisiveis.filter((l) => typeof l == "string") : []; + return { visiveis: o, invisiveis: n }; } function He(e) { try { - const a = window.localStorage.getItem(ta(e)); - return a ? oa(JSON.parse(a)) : { visiveis: [], invisiveis: [] }; + const a = window.localStorage.getItem(xe(e)); + return a ? ea(JSON.parse(a)) : { visiveis: [], invisiveis: [] }; } catch { return { visiveis: [], invisiveis: [] }; } } -function No(e, a) { +function ko(e, a) { try { - window.localStorage.setItem(ta(e), JSON.stringify(oa(a))); + window.localStorage.setItem(xe(e), JSON.stringify(ea(a))); } catch { } } -const qo = H({ +const So = Y({ name: "EliTabela", inheritAttrs: !1, components: { - EliTabelaCabecalho: dt, - EliTabelaEstados: ht, - EliTabelaDebug: Ct, - EliTabelaHead: Bt, - EliTabelaBody: ro, - EliTabelaMenuAcoes: mo, - EliTabelaPaginacao: Co, - EliTabelaModalColunas: Io + EliTabelaCabecalho: xa, + EliTabelaEstados: rt, + EliTabelaDebug: ct, + EliTabelaHead: yt, + EliTabelaBody: Xt, + EliTabelaMenuAcoes: ao, + EliTabelaPaginacao: uo, + EliTabelaModalColunas: Co }, props: { /** Configuração principal da tabela (colunas, consulta e ações) */ @@ -1849,156 +1589,156 @@ const qo = H({ } }, setup(e) { - const o = T(!1), l = T(null), s = T([]), v = T(0), t = T([]), n = T(null), f = T(null), r = T({ top: 0, left: 0 }), p = T(""), C = T(1), P = T(null), D = T("asc"), $ = k(() => e.tabela), d = k(() => !!e.tabela.mostrarCaixaDeBusca), M = k(() => e.tabela.acoesTabela ?? []), g = k(() => M.value.length > 0), S = T(!1), oe = T( + const o = N(!1), n = N(null), l = N([]), v = N(0), t = N([]), i = N(null), p = N(null), r = N({ top: 0, left: 0 }), f = N(""), y = N(1), w = N(null), T = N("asc"), C = k(() => e.tabela), g = k(() => !!e.tabela.mostrarCaixaDeBusca), M = k(() => e.tabela.acoesTabela ?? []), h = k(() => M.value.length > 0), D = N(!1), ae = N( He(e.tabela.nome) - ), ie = T({}), re = k(() => e.tabela.colunas.map((b) => b.rotulo)), se = k(() => { - var ne, ue; - const b = e.tabela.colunas, q = (((ne = oe.value.visiveis) == null ? void 0 : ne.length) ?? 0) > 0 || (((ue = oe.value.invisiveis) == null ? void 0 : ue.length) ?? 0) > 0 ? oe.value.invisiveis ?? [] : b.filter((U) => U.visivel === !1).map((U) => U.rotulo), O = new Set(q), F = b.filter((U) => O.has(U.rotulo)), R = q, K = /* @__PURE__ */ new Map(); - for (const U of F) - K.has(U.rotulo) || K.set(U.rotulo, U); - const Q = []; - for (const U of R) { - const de = K.get(U); - de && Q.push(de); + ), le = N({}), ie = k(() => e.tabela.colunas.map((m) => m.rotulo)), re = k(() => { + var ne, se; + const m = e.tabela.colunas, V = (((ne = ae.value.visiveis) == null ? void 0 : ne.length) ?? 0) > 0 || (((se = ae.value.invisiveis) == null ? void 0 : se.length) ?? 0) > 0 ? ae.value.invisiveis ?? [] : m.filter((j) => j.visivel === !1).map((j) => j.rotulo), P = new Set(V), q = m.filter((j) => P.has(j.rotulo)), H = V, G = /* @__PURE__ */ new Map(); + for (const j of q) + G.has(j.rotulo) || G.set(j.rotulo, j); + const K = []; + for (const j of H) { + const ue = G.get(j); + ue && K.push(ue); } - for (const U of F) - Q.includes(U) || Q.push(U); - return Q; - }), ve = k(() => se.value.length > 0), X = k(() => { - var U, de; - const b = e.tabela.colunas, A = re.value, q = (((U = oe.value.visiveis) == null ? void 0 : U.length) ?? 0) > 0 || (((de = oe.value.invisiveis) == null ? void 0 : de.length) ?? 0) > 0, O = q ? oe.value.invisiveis ?? [] : e.tabela.colunas.filter((J) => J.visivel === !1).map((J) => J.rotulo), F = new Set(O), R = A.filter((J) => !F.has(J)), K = new Set(R), Q = q ? oe.value.visiveis ?? [] : [], ne = []; - for (const J of Q) - K.has(J) && ne.push(J); - for (const J of R) - ne.includes(J) || ne.push(J); - const ue = /* @__PURE__ */ new Map(); - for (const J of b) - ue.has(J.rotulo) || ue.set(J.rotulo, J); - return ne.map((J) => ue.get(J)).filter(Boolean); + for (const j of q) + K.includes(j) || K.push(j); + return K; + }), ve = k(() => re.value.length > 0), X = k(() => { + var j, ue; + const m = e.tabela.colunas, B = ie.value, V = (((j = ae.value.visiveis) == null ? void 0 : j.length) ?? 0) > 0 || (((ue = ae.value.invisiveis) == null ? void 0 : ue.length) ?? 0) > 0, P = V ? ae.value.invisiveis ?? [] : e.tabela.colunas.filter((U) => U.visivel === !1).map((U) => U.rotulo), q = new Set(P), H = B.filter((U) => !q.has(U)), G = new Set(H), K = V ? ae.value.visiveis ?? [] : [], ne = []; + for (const U of K) + G.has(U) && ne.push(U); + for (const U of H) + ne.includes(U) || ne.push(U); + const se = /* @__PURE__ */ new Map(); + for (const U of m) + se.has(U.rotulo) || se.set(U.rotulo, U); + return ne.map((U) => se.get(U)).filter(Boolean); }); - function he() { - S.value = !0; + function be() { + D.value = !0; } - function G() { - S.value = !1; + function Z() { + D.value = !1; } - function I(b) { - oe.value = b, No(e.tabela.nome, b), S.value = !1, ie.value = {}; + function O(m) { + ae.value = m, ko(e.tabela.nome, m), D.value = !1, le.value = {}; } - function ge(b) { - const A = !!ie.value[b]; - ie.value = { - ...ie.value, - [b]: !A + function he(m) { + const B = !!le.value[m]; + le.value = { + ...le.value, + [m]: !B }; } - const Ce = k(() => { - const b = e.tabela.registros_por_consulta; - return typeof b == "number" && b > 0 ? Math.floor(b) : 10; - }), _ = k(() => { - const b = Ce.value; - if (!b || b <= 0) return 1; - const A = v.value; - return A ? Math.max(1, Math.ceil(A / b)) : 1; - }), m = k(() => (e.tabela.acoesLinha ?? []).length > 0); - let u = 0; - function h(b) { - var Q, ne, ue, U, de, J; - const A = b.getBoundingClientRect(), q = 8, O = ((ue = (ne = (Q = f.value) == null ? void 0 : Q.menuEl) == null ? void 0 : ne.value) == null ? void 0 : ue.offsetHeight) ?? 0, F = ((J = (de = (U = f.value) == null ? void 0 : U.menuEl) == null ? void 0 : de.value) == null ? void 0 : J.offsetWidth) ?? 180; - let R = A.bottom + q; - const K = A.right - F; - O && R + O > window.innerHeight - q && (R = A.top - q - O), r.value = { - top: Math.max(q, Math.round(R)), - left: Math.max(q, Math.round(K)) + const _e = k(() => { + const m = e.tabela.registros_por_consulta; + return typeof m == "number" && m > 0 ? Math.floor(m) : 10; + }), E = k(() => { + const m = _e.value; + if (!m || m <= 0) return 1; + const B = v.value; + return B ? Math.max(1, Math.ceil(B / m)) : 1; + }), d = k(() => (e.tabela.acoesLinha ?? []).length > 0); + let s = 0; + function b(m) { + var K, ne, se, j, ue, U; + const B = m.getBoundingClientRect(), V = 8, P = ((se = (ne = (K = p.value) == null ? void 0 : K.menuEl) == null ? void 0 : ne.value) == null ? void 0 : se.offsetHeight) ?? 0, q = ((U = (ue = (j = p.value) == null ? void 0 : j.menuEl) == null ? void 0 : ue.value) == null ? void 0 : U.offsetWidth) ?? 180; + let H = B.bottom + V; + const G = B.right - q; + P && H + P > window.innerHeight - V && (H = B.top - V - P), r.value = { + top: Math.max(V, Math.round(H)), + left: Math.max(V, Math.round(G)) }; } - function c(b) { - var q, O; - if (n.value === null) return; - const A = b.target; - (O = (q = f.value) == null ? void 0 : q.menuEl) != null && O.value && f.value.menuEl.value.contains(A) || (n.value = null); + function u(m) { + var V, P; + if (i.value === null) return; + const B = m.target; + (P = (V = p.value) == null ? void 0 : V.menuEl) != null && P.value && p.value.menuEl.value.contains(B) || (i.value = null); } - function w(b) { - if (b) { - if (P.value === b) { - D.value = D.value === "asc" ? "desc" : "asc", Z(); + function S(m) { + if (m) { + if (w.value === m) { + T.value = T.value === "asc" ? "desc" : "asc", W(); return; } - P.value = b, D.value = "asc", C.value !== 1 ? C.value = 1 : Z(); + w.value = m, T.value = "asc", y.value !== 1 ? y.value = 1 : W(); } } - function V(b) { - p.value !== b && (p.value = b, C.value !== 1 ? C.value = 1 : Z()); + function A(m) { + f.value !== m && (f.value = m, y.value !== 1 ? y.value = 1 : W()); } - function N(b) { - const A = Math.min(Math.max(1, b), _.value); - A !== C.value && (C.value = A); + function I(m) { + const B = Math.min(Math.max(1, m), E.value); + B !== y.value && (y.value = B); } - function L(b) { - const A = e.tabela.acoesLinha ?? [], q = t.value[b] ?? []; - return A.map((O, F) => { - const R = O.exibir === void 0 ? !0 : typeof O.exibir == "boolean" ? O.exibir : !1; + function F(m) { + const B = e.tabela.acoesLinha ?? [], V = t.value[m] ?? []; + return B.map((P, q) => { + const H = P.exibir === void 0 ? !0 : typeof P.exibir == "boolean" ? P.exibir : !1; return { - acao: O, - indice: F, - visivel: q[F] ?? R + acao: P, + indice: q, + visivel: V[q] ?? H }; - }).filter((O) => O.visivel); + }).filter((P) => P.visivel); } - function W(b) { - return L(b).length > 0; + function J(m) { + return F(m).length > 0; } - function ae(b, A) { - if (!W(b)) return; - if (n.value === b) { - n.value = null; + function x(m, B) { + if (!J(m)) return; + if (i.value === m) { + i.value = null; return; } - n.value = b; - const q = (A == null ? void 0 : A.currentTarget) ?? null; - q && (h(q), requestAnimationFrame(() => h(q))); + i.value = m; + const V = (B == null ? void 0 : B.currentTarget) ?? null; + V && (b(V), requestAnimationFrame(() => b(V))); } - async function Z() { - var F, R; - const b = ++u; - o.value = !0, l.value = null, t.value = [], n.value = null, ie.value = {}; - const A = Math.max(1, Ce.value), O = { - offSet: (C.value - 1) * A, - limit: A + async function W() { + var q, H; + const m = ++s; + o.value = !0, n.value = null, t.value = [], i.value = null, le.value = {}; + const B = Math.max(1, _e.value), P = { + offSet: (y.value - 1) * B, + limit: B }; - p.value && (O.texto_busca = p.value), P.value && (O.coluna_ordem = P.value, O.direcao_ordem = D.value); + f.value && (P.texto_busca = f.value), w.value && (P.coluna_ordem = w.value, P.direcao_ordem = T.value); try { - const K = e.tabela, Q = await K.consulta(O); - if (b !== u) return; - if (Q.cod !== ea.sucesso) { - s.value = [], v.value = 0, l.value = Q.mensagem; + const G = e.tabela, K = await G.consulta(P); + if (m !== s) return; + if (K.cod !== Ke.sucesso) { + l.value = [], v.value = 0, n.value = K.mensagem; return; } - const ne = ((F = Q.valor) == null ? void 0 : F.valores) ?? [], ue = ((R = Q.valor) == null ? void 0 : R.quantidade) ?? ne.length; - s.value = ne, v.value = ue; - const U = Math.max(1, Math.ceil((ue || 0) / A)); - if (C.value > U) { - C.value = U; + const ne = ((q = K.valor) == null ? void 0 : q.valores) ?? [], se = ((H = K.valor) == null ? void 0 : H.quantidade) ?? ne.length; + l.value = ne, v.value = se; + const j = Math.max(1, Math.ceil((se || 0) / B)); + if (y.value > j) { + y.value = j; return; } - const de = K.acoesLinha ?? []; - if (!de.length) { + const ue = G.acoesLinha ?? []; + if (!ue.length) { t.value = []; return; } - const J = ne.map( - () => de.map((Ee) => Ee.exibir === void 0 ? !0 : typeof Ee.exibir == "boolean" ? Ee.exibir : !1) + const U = ne.map( + () => ue.map((Ee) => Ee.exibir === void 0 ? !0 : typeof Ee.exibir == "boolean" ? Ee.exibir : !1) ); - t.value = J; - const na = await Promise.all( + t.value = U; + const aa = await Promise.all( ne.map( async (Ee) => Promise.all( - de.map(async (Se) => { - if (Se.exibir === void 0) return !0; - if (typeof Se.exibir == "boolean") return Se.exibir; + ue.map(async (ke) => { + if (ke.exibir === void 0) return !0; + if (typeof ke.exibir == "boolean") return ke.exibir; try { - const la = Se.exibir(Ee); - return !!await Promise.resolve(la); + const ta = ke.exibir(Ee); + return !!await Promise.resolve(ta); } catch { return !1; } @@ -2006,103 +1746,103 @@ const qo = H({ ) ) ); - b === u && (t.value = na); - } catch (K) { - if (b !== u) return; - s.value = [], v.value = 0, l.value = K instanceof Error ? K.message : "Erro ao carregar dados."; + m === s && (t.value = aa); + } catch (G) { + if (m !== s) return; + l.value = [], v.value = 0, n.value = G instanceof Error ? G.message : "Erro ao carregar dados."; } finally { - b === u && (o.value = !1); + m === s && (o.value = !1); } } - return da(() => { - document.addEventListener("click", c), Z(); - }), ca(() => { - document.removeEventListener("click", c); - }), fe( + return la(() => { + document.addEventListener("click", u), W(); + }), sa(() => { + document.removeEventListener("click", u); + }), pe( () => e.tabela.mostrarCaixaDeBusca, - (b) => { - !b && p.value && (p.value = "", C.value !== 1 ? C.value = 1 : Z()); + (m) => { + !m && f.value && (f.value = "", y.value !== 1 ? y.value = 1 : W()); } - ), fe(C, (b, A) => { - b !== A && Z(); - }), fe( + ), pe(y, (m, B) => { + m !== B && W(); + }), pe( () => e.tabela, () => { - n.value = null, P.value = null, D.value = "asc", p.value = "", S.value = !1, oe.value = He(e.tabela.nome), ie.value = {}, C.value !== 1 ? C.value = 1 : Z(); + i.value = null, w.value = null, T.value = "asc", f.value = "", D.value = !1, ae.value = He(e.tabela.nome), le.value = {}, y.value !== 1 ? y.value = 1 : W(); } - ), fe( + ), pe( () => e.tabela.registros_por_consulta, () => { - C.value !== 1 ? C.value = 1 : Z(); + y.value !== 1 ? y.value = 1 : W(); } - ), fe(s, () => { - n.value = null, ie.value = {}; + ), pe(l, () => { + i.value = null, le.value = {}; }), { // state isDev: !1, - tabela: $, + tabela: C, carregando: o, - erro: l, - linhas: s, + erro: n, + linhas: l, quantidade: v, - menuAberto: n, - valorBusca: p, - paginaAtual: C, - colunaOrdenacao: P, - direcaoOrdenacao: D, - totalPaginas: _, + menuAberto: i, + valorBusca: f, + paginaAtual: y, + colunaOrdenacao: w, + direcaoOrdenacao: T, + totalPaginas: E, // computed - exibirBusca: d, + exibirBusca: g, acoesCabecalho: M, - temAcoesCabecalho: g, - temAcoes: m, + temAcoesCabecalho: h, + temAcoes: d, colunasEfetivas: X, - rotulosColunas: re, - modalColunasAberto: S, - configColunas: oe, + rotulosColunas: ie, + modalColunasAberto: D, + configColunas: ae, temColunasInvisiveis: ve, - colunasInvisiveisEfetivas: se, - linhasExpandidas: ie, - abrirModalColunas: he, - fecharModalColunas: G, - salvarModalColunas: I, - alternarLinhaExpandida: ge, + colunasInvisiveisEfetivas: re, + linhasExpandidas: le, + abrirModalColunas: be, + fecharModalColunas: Z, + salvarModalColunas: O, + alternarLinhaExpandida: he, // actions - alternarOrdenacao: w, - atualizarBusca: V, - irParaPagina: N, - acoesDisponiveisPorLinha: L, - possuiAcoes: W, - toggleMenu: ae, + alternarOrdenacao: S, + atualizarBusca: A, + irParaPagina: I, + acoesDisponiveisPorLinha: F, + possuiAcoes: J, + toggleMenu: x, // popup - menuPopup: f, + menuPopup: p, menuPopupPos: r }; } -}), Fo = { class: "eli-tabela" }, Lo = { class: "eli-tabela__table" }; -function jo(e, a, o, l, s, v) { - const t = x("EliTabelaDebug"), n = x("EliTabelaEstados"), f = x("EliTabelaCabecalho"), r = x("EliTabelaModalColunas"), p = x("EliTabelaHead"), C = x("EliTabelaBody"), P = x("EliTabelaMenuAcoes"), D = x("EliTabelaPaginacao"); - return i(), y("div", Fo, [ - B(t, { +}), Ao = { class: "eli-tabela" }, Mo = { class: "eli-tabela__table" }; +function Bo(e, a, o, n, l, v) { + const t = Q("EliTabelaDebug"), i = Q("EliTabelaEstados"), p = Q("EliTabelaCabecalho"), r = Q("EliTabelaModalColunas"), f = Q("EliTabelaHead"), y = Q("EliTabelaBody"), w = Q("EliTabelaMenuAcoes"), T = Q("EliTabelaPaginacao"); + return c(), $("div", Ao, [ + L(t, { isDev: e.isDev, menuAberto: e.menuAberto, menuPopupPos: e.menuPopupPos }, null, 8, ["isDev", "menuAberto", "menuPopupPos"]), - e.carregando || e.erro || !e.linhas.length ? (i(), z(n, { + e.carregando || e.erro || !e.linhas.length ? (c(), ee(i, { key: 0, carregando: e.carregando, erro: e.erro, mensagemVazio: e.tabela.mensagemVazio - }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (i(), y(le, { key: 1 }, [ - e.exibirBusca || e.temAcoesCabecalho ? (i(), z(f, { + }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (c(), $(ce, { key: 1 }, [ + e.exibirBusca || e.temAcoesCabecalho ? (c(), ee(p, { key: 0, exibirBusca: e.exibirBusca, valorBusca: e.valorBusca, acoesCabecalho: e.acoesCabecalho, onBuscar: e.atualizarBusca, onColunas: e.abrirModalColunas - }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar", "onColunas"])) : te("", !0), - B(r, { + }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar", "onColunas"])) : oe("", !0), + L(r, { aberto: e.modalColunasAberto, rotulosColunas: e.rotulosColunas, configInicial: e.configColunas, @@ -2110,8 +1850,8 @@ function jo(e, a, o, l, s, v) { onFechar: e.fecharModalColunas, onSalvar: e.salvarModalColunas }, null, 8, ["aberto", "rotulosColunas", "configInicial", "colunas", "onFechar", "onSalvar"]), - E("table", Lo, [ - B(p, { + _("table", Mo, [ + L(f, { colunas: e.colunasEfetivas, temAcoes: e.temAcoes, temColunasInvisiveis: e.temColunasInvisiveis, @@ -2119,7 +1859,7 @@ function jo(e, a, o, l, s, v) { direcaoOrdenacao: e.direcaoOrdenacao, onAlternarOrdenacao: e.alternarOrdenacao }, null, 8, ["colunas", "temAcoes", "temColunasInvisiveis", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), - B(C, { + L(y, { colunas: e.colunasEfetivas, colunasInvisiveis: e.colunasInvisiveisEfetivas, temColunasInvisiveis: e.temColunasInvisiveis, @@ -2132,116 +1872,70 @@ function jo(e, a, o, l, s, v) { alternarLinhaExpandida: e.alternarLinhaExpandida }, null, 8, ["colunas", "colunasInvisiveis", "temColunasInvisiveis", "linhasExpandidas", "linhas", "temAcoes", "menuAberto", "possuiAcoes", "toggleMenu", "alternarLinhaExpandida"]) ]), - B(P, { + L(w, { ref: "menuPopup", menuAberto: e.menuAberto, posicao: e.menuPopupPos, acoes: e.menuAberto === null ? [] : e.acoesDisponiveisPorLinha(e.menuAberto), linha: e.menuAberto === null ? null : e.linhas[e.menuAberto], - onExecutar: a[0] || (a[0] = ({ acao: $, linha: d }) => { - e.menuAberto = null, $.acao(d); + onExecutar: a[0] || (a[0] = ({ acao: C, linha: g }) => { + e.menuAberto = null, C.acao(g); }) }, null, 8, ["menuAberto", "posicao", "acoes", "linha"]), - e.totalPaginas > 1 && e.quantidade > 0 ? (i(), z(D, { + e.totalPaginas > 1 && e.quantidade > 0 ? (c(), ee(T, { key: 1, pagina: e.paginaAtual, totalPaginas: e.totalPaginas, maximoBotoes: e.tabela.maximo_botoes_paginacao, onAlterar: e.irParaPagina - }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : te("", !0) + }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : oe("", !0) ], 64)) ]); } -const Uo = /* @__PURE__ */ Y(qo, [["render", jo]]), zo = H({ - name: "EliEntradaTexto", - inheritAttrs: !1, - props: { - /** Interface padrão (EliEntrada): value + opcoes. */ - value: { - type: [String, null], - default: void 0 - }, - opcoes: { - type: Object, - required: !0 - } - }, - emits: { - "update:value": (e) => !0, - /** Compat Vue2 (v-model padrão: value + input) */ - input: (e) => !0, - change: (e) => !0, - focus: () => !0, - blur: () => !0 - }, - setup(e, { attrs: a, emit: o }) { - const l = k({ - get: () => e.value, - set: (s) => { - o("update:value", s), o("input", s), o("change", s); - } - }); - return { attrs: a, emit: o, localValue: l }; - } -}); -function Ho(e, a, o, l, s, v) { - var t, n, f, r; - return i(), z(Me, me({ - modelValue: e.localValue, - "onUpdate:modelValue": a[0] || (a[0] = (p) => e.localValue = p), - label: (t = e.opcoes) == null ? void 0 : t.rotulo, - placeholder: (n = e.opcoes) == null ? void 0 : n.placeholder, - counter: (f = e.opcoes) == null ? void 0 : f.limiteCaracteres, - maxlength: (r = e.opcoes) == null ? void 0 : r.limiteCaracteres - }, e.attrs, { - onFocus: a[1] || (a[1] = () => e.emit("focus")), - onBlur: a[2] || (a[2] = () => e.emit("blur")) - }), null, 16, ["modelValue", "label", "placeholder", "counter", "maxlength"]); -} -const Yo = /* @__PURE__ */ Y(zo, [["render", Ho]]); -function Ro(e) { +const To = /* @__PURE__ */ R(So, [["render", Bo]]); +function wo(e) { if (!Number.isFinite(e) || e <= 0 || e >= 1) return 0; const a = e.toString(); if (a.includes("e-")) { - const [, s] = a.split("e-"), v = Number(s); + const [, l] = a.split("e-"), v = Number(l); return Number.isFinite(v) ? v : 0; } const o = a.indexOf("."); return o === -1 ? 0 : a.slice(o + 1).replace(/0+$/, "").length; } -function Jo(e) { +function Oo(e) { const a = (e ?? "").trim().replace(/,/g, "."); if (!a) return null; const o = Number(a); return Number.isNaN(o) ? null : o; } -function Ae(e, a) { +function Be(e, a) { return e == null ? "" : a === null ? String(e) : Number(e).toFixed(Math.max(0, a)).replace(/\./g, ","); } -function Ye(e) { +function Ue(e) { return (e ?? "").replace(/\D+/g, ""); } -function Wo(e) { +function Po(e) { const a = (e ?? "").replace(/[^0-9.,]+/g, ""), o = a.match(/[.,]/); if (!o) return a; - const l = o[0], s = a.indexOf(l), v = a.slice(0, s).replace(/[.,]/g, ""), t = a.slice(s + 1).replace(/[.,]/g, ""); - return `${v.length ? v : "0"}${l}${t}`; + const n = o[0], l = a.indexOf(n), v = a.slice(0, l).replace(/[.,]/g, ""), t = a.slice(l + 1).replace(/[.,]/g, ""); + return `${v.length ? v : "0"}${n}${t}`; } -function Zo(e, a) { +function Io(e, a) { if (a === null) return e; if (a <= 0) return e.replace(/[.,]/g, ""); const o = e.match(/[.,]/); if (!o) return e; - const l = o[0], s = e.indexOf(l), v = e.slice(0, s), t = e.slice(s + 1); - return `${v}${l}${t.slice(0, a)}`; + const n = o[0], l = e.indexOf(n), v = e.slice(0, l), t = e.slice(l + 1); + return `${v}${n}${t.slice(0, a)}`; } -function Go(e) { +function Vo(e) { const a = e.match(/^(\d+)[.,]$/); if (!a) return null; const o = Number(a[1]); return Number.isNaN(o) ? null : o; } -const Xo = H({ +const qo = Y({ name: "EliEntradaNumero", inheritAttrs: !1, props: { @@ -2264,44 +1958,44 @@ const Xo = H({ blur: () => !0 }, setup(e, { attrs: a, emit: o }) { - const l = k(() => { - var p; - const r = (p = e.opcoes) == null ? void 0 : p.precisao; - return r == null ? null : Ro(r); - }), s = k(() => l.value === 0), v = k(() => { - const r = l.value; + const n = k(() => { + var f; + const r = (f = e.opcoes) == null ? void 0 : f.precisao; + return r == null ? null : wo(r); + }), l = k(() => n.value === 0), v = k(() => { + const r = n.value; return r !== null && r > 0; - }), t = T(""), n = T(void 0); - fe( + }), t = N(""), i = N(void 0); + pe( () => e.value, (r) => { - r !== n.value && (t.value = Ae(r, l.value), n.value = r); + r !== i.value && (t.value = Be(r, n.value), i.value = r); }, { immediate: !0 } ); - function f(r) { + function p(r) { if (v.value) { - const D = l.value ?? 0, $ = Ye(r), d = $ ? Number($) : 0, M = Math.pow(10, D), g = $ ? d / M : null, S = g === null ? null : g; - n.value = S, o("update:value", S), o("input", S), o("change", S), t.value = Ae(S, D); + const T = n.value ?? 0, C = Ue(r), g = C ? Number(C) : 0, M = Math.pow(10, T), h = C ? g / M : null, D = h === null ? null : h; + i.value = D, o("update:value", D), o("input", D), o("change", D), t.value = Be(D, T); return; } - const p = s.value ? Ye(r) : Wo(r), C = s.value ? p : Zo(p, l.value); - let P = null; - if (C) { - const $ = (s.value ? null : Go(C)) ?? Jo(C); - P = $ === null ? null : $; + const f = l.value ? Ue(r) : Po(r), y = l.value ? f : Io(f, n.value); + let w = null; + if (y) { + const C = (l.value ? null : Vo(y)) ?? Oo(y); + w = C === null ? null : C; } - n.value = P, o("update:value", P), o("input", P), o("change", P), t.value = Ae(P, l.value); + i.value = w, o("update:value", w), o("input", w), o("change", w), t.value = Be(w, n.value); } - return { attrs: a, emit: o, displayValue: t, isInteiro: s, onUpdateModelValue: f }; + return { attrs: a, emit: o, displayValue: t, isInteiro: l, onUpdateModelValue: p }; } -}), Ko = { class: "eli-entrada__prefixo" }, Qo = { class: "eli-entrada__sufixo" }; -function xo(e, a, o, l, s, v) { - var t, n, f, r; - return i(), z(Me, me({ +}), No = { class: "eli-entrada__prefixo" }, Lo = { class: "eli-entrada__sufixo" }; +function Fo(e, a, o, n, l, v) { + var t, i, p, r; + return c(), ee(Oe, $e({ "model-value": e.displayValue, label: (t = e.opcoes) == null ? void 0 : t.rotulo, - placeholder: (n = e.opcoes) == null ? void 0 : n.placeholder, + placeholder: (i = e.opcoes) == null ? void 0 : i.placeholder, type: e.isInteiro ? "number" : "text", inputmode: e.isInteiro ? "numeric" : "decimal", pattern: e.isInteiro ? "[0-9]*" : "[0-9.,]*" @@ -2309,307 +2003,307 @@ function xo(e, a, o, l, s, v) { "onUpdate:modelValue": e.onUpdateModelValue, onFocus: a[0] || (a[0] = () => e.emit("focus")), onBlur: a[1] || (a[1] = () => e.emit("blur")) - }), Je({ _: 2 }, [ - (f = e.opcoes) != null && f.prefixo ? { + }), ua({ _: 2 }, [ + (p = e.opcoes) != null && p.prefixo ? { name: "prepend-inner", - fn: ee(() => [ - E("span", Ko, j(e.opcoes.prefixo), 1) + fn: te(() => [ + _("span", No, z(e.opcoes.prefixo), 1) ]), key: "0" } : void 0, (r = e.opcoes) != null && r.sufixo ? { name: "append-inner", - fn: ee(() => [ - E("span", Qo, j(e.opcoes.sufixo), 1) + fn: te(() => [ + _("span", Lo, z(e.opcoes.sufixo), 1) ]), key: "1" } : void 0 ]), 1040, ["model-value", "label", "placeholder", "type", "inputmode", "pattern", "onUpdate:modelValue"]); } -const en = /* @__PURE__ */ Y(Xo, [["render", xo], ["__scopeId", "data-v-77cbf216"]]); -function an(e) { +const jo = /* @__PURE__ */ R(qo, [["render", Fo], ["__scopeId", "data-v-77cbf216"]]); +function zo(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var Ve = { exports: {} }, tn = Ve.exports, Re; -function on() { - return Re || (Re = 1, (function(e, a) { - (function(o, l) { - e.exports = l(); - })(tn, (function() { - var o = 1e3, l = 6e4, s = 36e5, v = "millisecond", t = "second", n = "minute", f = "hour", r = "day", p = "week", C = "month", P = "quarter", D = "year", $ = "date", d = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, g = /\[([^\]]+)]|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, S = { 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(_) { - var m = ["th", "st", "nd", "rd"], u = _ % 100; - return "[" + _ + (m[(u - 20) % 10] || m[u] || m[0]) + "]"; - } }, oe = function(_, m, u) { - var h = String(_); - return !h || h.length >= m ? _ : "" + Array(m + 1 - h.length).join(u) + _; - }, ie = { s: oe, z: function(_) { - var m = -_.utcOffset(), u = Math.abs(m), h = Math.floor(u / 60), c = u % 60; - return (m <= 0 ? "+" : "-") + oe(h, 2, "0") + ":" + oe(c, 2, "0"); - }, m: function _(m, u) { - if (m.date() < u.date()) return -_(u, m); - var h = 12 * (u.year() - m.year()) + (u.month() - m.month()), c = m.clone().add(h, C), w = u - c < 0, V = m.clone().add(h + (w ? -1 : 1), C); - return +(-(h + (u - c) / (w ? c - V : V - c)) || 0); - }, a: function(_) { - return _ < 0 ? Math.ceil(_) || 0 : Math.floor(_); - }, p: function(_) { - return { M: C, y: D, w: p, d: r, D: $, h: f, m: n, s: t, ms: v, Q: P }[_] || String(_ || "").toLowerCase().replace(/s$/, ""); - }, u: function(_) { - return _ === void 0; - } }, re = "en", se = {}; - se[re] = S; - var ve = "$isDayjsObject", X = function(_) { - return _ instanceof ge || !(!_ || !_[ve]); - }, he = function _(m, u, h) { - var c; - if (!m) return re; - if (typeof m == "string") { - var w = m.toLowerCase(); - se[w] && (c = w), u && (se[w] = u, c = w); - var V = m.split("-"); - if (!c && V.length > 1) return _(V[0]); +var Me = { exports: {} }, Ho = Me.exports, Ye; +function Uo() { + return Ye || (Ye = 1, (function(e, a) { + (function(o, n) { + e.exports = n(); + })(Ho, (function() { + var o = 1e3, n = 6e4, l = 36e5, v = "millisecond", t = "second", i = "minute", p = "hour", r = "day", f = "week", y = "month", w = "quarter", T = "year", C = "date", g = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|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, D = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) { + var d = ["th", "st", "nd", "rd"], s = E % 100; + return "[" + E + (d[(s - 20) % 10] || d[s] || d[0]) + "]"; + } }, ae = function(E, d, s) { + var b = String(E); + return !b || b.length >= d ? E : "" + Array(d + 1 - b.length).join(s) + E; + }, le = { s: ae, z: function(E) { + var d = -E.utcOffset(), s = Math.abs(d), b = Math.floor(s / 60), u = s % 60; + return (d <= 0 ? "+" : "-") + ae(b, 2, "0") + ":" + ae(u, 2, "0"); + }, m: function E(d, s) { + if (d.date() < s.date()) return -E(s, d); + var b = 12 * (s.year() - d.year()) + (s.month() - d.month()), u = d.clone().add(b, y), S = s - u < 0, A = d.clone().add(b + (S ? -1 : 1), y); + return +(-(b + (s - u) / (S ? u - A : A - u)) || 0); + }, a: function(E) { + return E < 0 ? Math.ceil(E) || 0 : Math.floor(E); + }, p: function(E) { + return { M: y, y: T, w: f, d: r, D: C, h: p, m: i, s: t, ms: v, Q: w }[E] || String(E || "").toLowerCase().replace(/s$/, ""); + }, u: function(E) { + return E === void 0; + } }, ie = "en", re = {}; + re[ie] = D; + var ve = "$isDayjsObject", X = function(E) { + return E instanceof he || !(!E || !E[ve]); + }, be = function E(d, s, b) { + var u; + if (!d) return ie; + if (typeof d == "string") { + var S = d.toLowerCase(); + re[S] && (u = S), s && (re[S] = s, u = S); + var A = d.split("-"); + if (!u && A.length > 1) return E(A[0]); } else { - var N = m.name; - se[N] = m, c = N; + var I = d.name; + re[I] = d, u = I; } - return !h && c && (re = c), c || !h && re; - }, G = function(_, m) { - if (X(_)) return _.clone(); - var u = typeof m == "object" ? m : {}; - return u.date = _, u.args = arguments, new ge(u); - }, I = ie; - I.l = he, I.i = X, I.w = function(_, m) { - return G(_, { locale: m.$L, utc: m.$u, x: m.$x, $offset: m.$offset }); + return !b && u && (ie = u), u || !b && ie; + }, Z = function(E, d) { + if (X(E)) return E.clone(); + var s = typeof d == "object" ? d : {}; + return s.date = E, s.args = arguments, new he(s); + }, O = le; + O.l = be, O.i = X, O.w = function(E, d) { + return Z(E, { locale: d.$L, utc: d.$u, x: d.$x, $offset: d.$offset }); }; - var ge = (function() { - function _(u) { - this.$L = he(u.locale, null, !0), this.parse(u), this.$x = this.$x || u.x || {}, this[ve] = !0; + var he = (function() { + function E(s) { + this.$L = be(s.locale, null, !0), this.parse(s), this.$x = this.$x || s.x || {}, this[ve] = !0; } - var m = _.prototype; - return m.parse = function(u) { - this.$d = (function(h) { - var c = h.date, w = h.utc; - if (c === null) return /* @__PURE__ */ new Date(NaN); - if (I.u(c)) return /* @__PURE__ */ new Date(); - if (c instanceof Date) return new Date(c); - if (typeof c == "string" && !/Z$/i.test(c)) { - var V = c.match(M); - if (V) { - var N = V[2] - 1 || 0, L = (V[7] || "0").substring(0, 3); - return w ? new Date(Date.UTC(V[1], N, V[3] || 1, V[4] || 0, V[5] || 0, V[6] || 0, L)) : new Date(V[1], N, V[3] || 1, V[4] || 0, V[5] || 0, V[6] || 0, L); + var d = E.prototype; + return d.parse = function(s) { + this.$d = (function(b) { + var u = b.date, S = b.utc; + if (u === null) return /* @__PURE__ */ new Date(NaN); + if (O.u(u)) return /* @__PURE__ */ new Date(); + if (u instanceof Date) return new Date(u); + if (typeof u == "string" && !/Z$/i.test(u)) { + var A = u.match(M); + if (A) { + var I = A[2] - 1 || 0, F = (A[7] || "0").substring(0, 3); + return S ? new Date(Date.UTC(A[1], I, A[3] || 1, A[4] || 0, A[5] || 0, A[6] || 0, F)) : new Date(A[1], I, A[3] || 1, A[4] || 0, A[5] || 0, A[6] || 0, F); } } - return new Date(c); - })(u), this.init(); - }, m.init = function() { - var u = this.$d; - this.$y = u.getFullYear(), this.$M = u.getMonth(), this.$D = u.getDate(), this.$W = u.getDay(), this.$H = u.getHours(), this.$m = u.getMinutes(), this.$s = u.getSeconds(), this.$ms = u.getMilliseconds(); - }, m.$utils = function() { - return I; - }, m.isValid = function() { - return this.$d.toString() !== d; - }, m.isSame = function(u, h) { - var c = G(u); - return this.startOf(h) <= c && c <= this.endOf(h); - }, m.isAfter = function(u, h) { - return G(u) < this.startOf(h); - }, m.isBefore = function(u, h) { - return this.endOf(h) < G(u); - }, m.$g = function(u, h, c) { - return I.u(u) ? this[h] : this.set(c, u); - }, m.unix = function() { + return new Date(u); + })(s), this.init(); + }, d.init = function() { + var s = this.$d; + this.$y = s.getFullYear(), this.$M = s.getMonth(), this.$D = s.getDate(), this.$W = s.getDay(), this.$H = s.getHours(), this.$m = s.getMinutes(), this.$s = s.getSeconds(), this.$ms = s.getMilliseconds(); + }, d.$utils = function() { + return O; + }, d.isValid = function() { + return this.$d.toString() !== g; + }, d.isSame = function(s, b) { + var u = Z(s); + return this.startOf(b) <= u && u <= this.endOf(b); + }, d.isAfter = function(s, b) { + return Z(s) < this.startOf(b); + }, d.isBefore = function(s, b) { + return this.endOf(b) < Z(s); + }, d.$g = function(s, b, u) { + return O.u(s) ? this[b] : this.set(u, s); + }, d.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, m.valueOf = function() { + }, d.valueOf = function() { return this.$d.getTime(); - }, m.startOf = function(u, h) { - var c = this, w = !!I.u(h) || h, V = I.p(u), N = function(O, F) { - var R = I.w(c.$u ? Date.UTC(c.$y, F, O) : new Date(c.$y, F, O), c); - return w ? R : R.endOf(r); - }, L = function(O, F) { - return I.w(c.toDate()[O].apply(c.toDate("s"), (w ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(F)), c); - }, W = this.$W, ae = this.$M, Z = this.$D, b = "set" + (this.$u ? "UTC" : ""); - switch (V) { - case D: - return w ? N(1, 0) : N(31, 11); - case C: - return w ? N(1, ae) : N(0, ae + 1); - case p: - var A = this.$locale().weekStart || 0, q = (W < A ? W + 7 : W) - A; - return N(w ? Z - q : Z + (6 - q), ae); - case r: - case $: - return L(b + "Hours", 0); + }, d.startOf = function(s, b) { + var u = this, S = !!O.u(b) || b, A = O.p(s), I = function(P, q) { + var H = O.w(u.$u ? Date.UTC(u.$y, q, P) : new Date(u.$y, q, P), u); + return S ? H : H.endOf(r); + }, F = function(P, q) { + return O.w(u.toDate()[P].apply(u.toDate("s"), (S ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(q)), u); + }, J = this.$W, x = this.$M, W = this.$D, m = "set" + (this.$u ? "UTC" : ""); + switch (A) { + case T: + return S ? I(1, 0) : I(31, 11); + case y: + return S ? I(1, x) : I(0, x + 1); case f: - return L(b + "Minutes", 1); - case n: - return L(b + "Seconds", 2); + var B = this.$locale().weekStart || 0, V = (J < B ? J + 7 : J) - B; + return I(S ? W - V : W + (6 - V), x); + case r: + case C: + return F(m + "Hours", 0); + case p: + return F(m + "Minutes", 1); + case i: + return F(m + "Seconds", 2); case t: - return L(b + "Milliseconds", 3); + return F(m + "Milliseconds", 3); default: return this.clone(); } - }, m.endOf = function(u) { - return this.startOf(u, !1); - }, m.$set = function(u, h) { - var c, w = I.p(u), V = "set" + (this.$u ? "UTC" : ""), N = (c = {}, c[r] = V + "Date", c[$] = V + "Date", c[C] = V + "Month", c[D] = V + "FullYear", c[f] = V + "Hours", c[n] = V + "Minutes", c[t] = V + "Seconds", c[v] = V + "Milliseconds", c)[w], L = w === r ? this.$D + (h - this.$W) : h; - if (w === C || w === D) { - var W = this.clone().set($, 1); - W.$d[N](L), W.init(), this.$d = W.set($, Math.min(this.$D, W.daysInMonth())).$d; - } else N && this.$d[N](L); + }, d.endOf = function(s) { + return this.startOf(s, !1); + }, d.$set = function(s, b) { + var u, S = O.p(s), A = "set" + (this.$u ? "UTC" : ""), I = (u = {}, u[r] = A + "Date", u[C] = A + "Date", u[y] = A + "Month", u[T] = A + "FullYear", u[p] = A + "Hours", u[i] = A + "Minutes", u[t] = A + "Seconds", u[v] = A + "Milliseconds", u)[S], F = S === r ? this.$D + (b - this.$W) : b; + if (S === y || S === T) { + var J = this.clone().set(C, 1); + J.$d[I](F), J.init(), this.$d = J.set(C, Math.min(this.$D, J.daysInMonth())).$d; + } else I && this.$d[I](F); return this.init(), this; - }, m.set = function(u, h) { - return this.clone().$set(u, h); - }, m.get = function(u) { - return this[I.p(u)](); - }, m.add = function(u, h) { - var c, w = this; - u = Number(u); - var V = I.p(h), N = function(ae) { - var Z = G(w); - return I.w(Z.date(Z.date() + Math.round(ae * u)), w); + }, d.set = function(s, b) { + return this.clone().$set(s, b); + }, d.get = function(s) { + return this[O.p(s)](); + }, d.add = function(s, b) { + var u, S = this; + s = Number(s); + var A = O.p(b), I = function(x) { + var W = Z(S); + return O.w(W.date(W.date() + Math.round(x * s)), S); }; - if (V === C) return this.set(C, this.$M + u); - if (V === D) return this.set(D, this.$y + u); - if (V === r) return N(1); - if (V === p) return N(7); - var L = (c = {}, c[n] = l, c[f] = s, c[t] = o, c)[V] || 1, W = this.$d.getTime() + u * L; - return I.w(W, this); - }, m.subtract = function(u, h) { - return this.add(-1 * u, h); - }, m.format = function(u) { - var h = this, c = this.$locale(); - if (!this.isValid()) return c.invalidDate || d; - var w = u || "YYYY-MM-DDTHH:mm:ssZ", V = I.z(this), N = this.$H, L = this.$m, W = this.$M, ae = c.weekdays, Z = c.months, b = c.meridiem, A = function(F, R, K, Q) { - return F && (F[R] || F(h, w)) || K[R].slice(0, Q); - }, q = function(F) { - return I.s(N % 12 || 12, F, "0"); - }, O = b || function(F, R, K) { - var Q = F < 12 ? "AM" : "PM"; - return K ? Q.toLowerCase() : Q; + if (A === y) return this.set(y, this.$M + s); + if (A === T) return this.set(T, this.$y + s); + if (A === r) return I(1); + if (A === f) return I(7); + var F = (u = {}, u[i] = n, u[p] = l, u[t] = o, u)[A] || 1, J = this.$d.getTime() + s * F; + return O.w(J, this); + }, d.subtract = function(s, b) { + return this.add(-1 * s, b); + }, d.format = function(s) { + var b = this, u = this.$locale(); + if (!this.isValid()) return u.invalidDate || g; + var S = s || "YYYY-MM-DDTHH:mm:ssZ", A = O.z(this), I = this.$H, F = this.$m, J = this.$M, x = u.weekdays, W = u.months, m = u.meridiem, B = function(q, H, G, K) { + return q && (q[H] || q(b, S)) || G[H].slice(0, K); + }, V = function(q) { + return O.s(I % 12 || 12, q, "0"); + }, P = m || function(q, H, G) { + var K = q < 12 ? "AM" : "PM"; + return G ? K.toLowerCase() : K; }; - return w.replace(g, (function(F, R) { - return R || (function(K) { - switch (K) { + return S.replace(h, (function(q, H) { + return H || (function(G) { + switch (G) { case "YY": - return String(h.$y).slice(-2); + return String(b.$y).slice(-2); case "YYYY": - return I.s(h.$y, 4, "0"); + return O.s(b.$y, 4, "0"); case "M": - return W + 1; + return J + 1; case "MM": - return I.s(W + 1, 2, "0"); + return O.s(J + 1, 2, "0"); case "MMM": - return A(c.monthsShort, W, Z, 3); + return B(u.monthsShort, J, W, 3); case "MMMM": - return A(Z, W); + return B(W, J); case "D": - return h.$D; + return b.$D; case "DD": - return I.s(h.$D, 2, "0"); + return O.s(b.$D, 2, "0"); case "d": - return String(h.$W); + return String(b.$W); case "dd": - return A(c.weekdaysMin, h.$W, ae, 2); + return B(u.weekdaysMin, b.$W, x, 2); case "ddd": - return A(c.weekdaysShort, h.$W, ae, 3); + return B(u.weekdaysShort, b.$W, x, 3); case "dddd": - return ae[h.$W]; + return x[b.$W]; case "H": - return String(N); + return String(I); case "HH": - return I.s(N, 2, "0"); + return O.s(I, 2, "0"); case "h": - return q(1); + return V(1); case "hh": - return q(2); + return V(2); case "a": - return O(N, L, !0); + return P(I, F, !0); case "A": - return O(N, L, !1); + return P(I, F, !1); case "m": - return String(L); + return String(F); case "mm": - return I.s(L, 2, "0"); + return O.s(F, 2, "0"); case "s": - return String(h.$s); + return String(b.$s); case "ss": - return I.s(h.$s, 2, "0"); + return O.s(b.$s, 2, "0"); case "SSS": - return I.s(h.$ms, 3, "0"); + return O.s(b.$ms, 3, "0"); case "Z": - return V; + return A; } return null; - })(F) || V.replace(":", ""); + })(q) || A.replace(":", ""); })); - }, m.utcOffset = function() { + }, d.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, m.diff = function(u, h, c) { - var w, V = this, N = I.p(h), L = G(u), W = (L.utcOffset() - this.utcOffset()) * l, ae = this - L, Z = function() { - return I.m(V, L); + }, d.diff = function(s, b, u) { + var S, A = this, I = O.p(b), F = Z(s), J = (F.utcOffset() - this.utcOffset()) * n, x = this - F, W = function() { + return O.m(A, F); }; - switch (N) { - case D: - w = Z() / 12; + switch (I) { + case T: + S = W() / 12; break; - case C: - w = Z(); + case y: + S = W(); break; - case P: - w = Z() / 3; - break; - case p: - w = (ae - W) / 6048e5; - break; - case r: - w = (ae - W) / 864e5; + case w: + S = W() / 3; break; case f: - w = ae / s; + S = (x - J) / 6048e5; break; - case n: - w = ae / l; + case r: + S = (x - J) / 864e5; + break; + case p: + S = x / l; + break; + case i: + S = x / n; break; case t: - w = ae / o; + S = x / o; break; default: - w = ae; + S = x; } - return c ? w : I.a(w); - }, m.daysInMonth = function() { - return this.endOf(C).$D; - }, m.$locale = function() { - return se[this.$L]; - }, m.locale = function(u, h) { - if (!u) return this.$L; - var c = this.clone(), w = he(u, h, !0); - return w && (c.$L = w), c; - }, m.clone = function() { - return I.w(this.$d, this); - }, m.toDate = function() { + return u ? S : O.a(S); + }, d.daysInMonth = function() { + return this.endOf(y).$D; + }, d.$locale = function() { + return re[this.$L]; + }, d.locale = function(s, b) { + if (!s) return this.$L; + var u = this.clone(), S = be(s, b, !0); + return S && (u.$L = S), u; + }, d.clone = function() { + return O.w(this.$d, this); + }, d.toDate = function() { return new Date(this.valueOf()); - }, m.toJSON = function() { + }, d.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, m.toISOString = function() { + }, d.toISOString = function() { return this.$d.toISOString(); - }, m.toString = function() { + }, d.toString = function() { return this.$d.toUTCString(); - }, _; - })(), Ce = ge.prototype; - return G.prototype = Ce, [["$ms", v], ["$s", t], ["$m", n], ["$H", f], ["$W", r], ["$M", C], ["$y", D], ["$D", $]].forEach((function(_) { - Ce[_[1]] = function(m) { - return this.$g(m, _[0], _[1]); + }, E; + })(), _e = he.prototype; + return Z.prototype = _e, [["$ms", v], ["$s", t], ["$m", i], ["$H", p], ["$W", r], ["$M", y], ["$y", T], ["$D", C]].forEach((function(E) { + _e[E[1]] = function(d) { + return this.$g(d, E[0], E[1]); }; - })), G.extend = function(_, m) { - return _.$i || (_(m, ge, G), _.$i = !0), G; - }, G.locale = he, G.isDayjs = X, G.unix = function(_) { - return G(1e3 * _); - }, G.en = se[re], G.Ls = se, G.p = {}, G; + })), Z.extend = function(E, d) { + return E.$i || (E(d, he, Z), E.$i = !0), Z; + }, Z.locale = be, Z.isDayjs = X, Z.unix = function(E) { + return Z(1e3 * E); + }, Z.en = re[ie], Z.Ls = re, Z.p = {}, Z; })); - })(Ve)), Ve.exports; + })(Me)), Me.exports; } -var nn = on(); -const we = /* @__PURE__ */ an(nn), ln = H({ +var Yo = Uo(); +const Se = /* @__PURE__ */ zo(Yo), Ro = Y({ name: "EliEntradaDataHora", inheritAttrs: !1, props: { @@ -2660,7 +2354,7 @@ const we = /* @__PURE__ */ an(nn), ln = H({ blur: () => !0 }, setup(e, { emit: a, attrs: o }) { - const l = k(() => e.opcoes ? e.opcoes : { + const n = k(() => e.opcoes ? e.opcoes : { rotulo: e.rotulo ?? "Data e hora", placeholder: e.placeholder ?? "", modo: e.modo ?? "dataHora", @@ -2673,59 +2367,59 @@ const we = /* @__PURE__ */ an(nn), ln = H({ variante: e.variante, min: e.min, max: e.max - }), s = k( - () => l.value.modo ?? "dataHora" + }), l = k( + () => n.value.modo ?? "dataHora" ), v = k(() => !!e.desabilitado), t = k( - () => s.value === "data" ? "date" : "datetime-local" + () => l.value === "data" ? "date" : "datetime-local" ); - function n(d) { - return s.value === "data" ? we(d).format("YYYY-MM-DD") : we(d).format("YYYY-MM-DDTHH:mm"); + function i(g) { + return l.value === "data" ? Se(g).format("YYYY-MM-DD") : Se(g).format("YYYY-MM-DDTHH:mm"); } - function f(d) { - return s.value === "data" ? we(`${d}T00:00`).format() : we(d).format(); + function p(g) { + return l.value === "data" ? Se(`${g}T00:00`).format() : Se(g).format(); } - const r = k(() => e.value !== void 0 ? e.value ?? null : e.modelValue), p = k({ - get: () => r.value ? n(r.value) : "", - set: (d) => { - const M = d && d.length > 0 ? d : null; + const r = k(() => e.value !== void 0 ? e.value ?? null : e.modelValue), f = k({ + get: () => r.value ? i(r.value) : "", + set: (g) => { + const M = g && g.length > 0 ? g : null; if (!M) { a("update:value", null), a("input", null), a("change", null), a("update:modelValue", null), a("alterar", null); return; } - const g = f(M); - a("update:value", g), a("input", g), a("change", g), a("update:modelValue", g), a("alterar", g); + const h = p(M); + a("update:value", h), a("input", h), a("change", h), a("update:modelValue", h), a("alterar", h); } - }), C = k(() => { - const d = l.value.min; - if (d) - return n(d); - }), P = k(() => { - const d = l.value.max; - if (d) - return n(d); + }), y = k(() => { + const g = n.value.min; + if (g) + return i(g); + }), w = k(() => { + const g = n.value.max; + if (g) + return i(g); }); - function D() { + function T() { a("foco"), a("focus"); } - function $() { + function C() { a("desfoco"), a("blur"); } return { attrs: o, - valor: p, + valor: f, tipoInput: t, - minLocal: C, - maxLocal: P, - opcoesEfetivas: l, + minLocal: y, + maxLocal: w, + opcoesEfetivas: n, desabilitadoEfetivo: v, - emitCompatFocus: D, - emitCompatBlur: $ + emitCompatFocus: T, + emitCompatBlur: C }; } -}), rn = { class: "eli-data-hora" }; -function sn(e, a, o, l, s, v) { - return i(), y("div", rn, [ - B(Me, me({ +}), Jo = { class: "eli-data-hora" }; +function Wo(e, a, o, n, l, v) { + return c(), $("div", Jo, [ + L(Oe, $e({ modelValue: e.valor, "onUpdate:modelValue": a[0] || (a[0] = (t) => e.valor = t), type: e.tipoInput, @@ -2747,20 +2441,19 @@ function sn(e, a, o, l, s, v) { }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max", "onFocus", "onBlur"]) ]); } -const un = /* @__PURE__ */ Y(ln, [["render", sn], ["__scopeId", "data-v-1bfd1be8"]]), En = { +const Zo = /* @__PURE__ */ R(Ro, [["render", Wo], ["__scopeId", "data-v-1bfd1be8"]]), an = { install(e) { - e.component("EliOlaMundo", La), e.component("EliBotao", Ke), e.component("EliBadge", Pe), e.component("EliInput", xe), e.component("EliCartao", Ya), e.component("EliTabela", Uo), e.component("EliEntradaTexto", Yo), e.component("EliEntradaNumero", en), e.component("EliEntradaDataHora", un); + e.component("EliOlaMundo", Ma), e.component("EliBotao", Xe), e.component("EliBadge", Pe), e.component("EliCartao", Pa), e.component("EliTabela", To), e.component("EliEntradaTexto", Ge), e.component("EliEntradaNumero", jo), e.component("EliEntradaDataHora", Zo); } }; export { Pe as EliBadge, - Ke as EliBotao, - Ya as EliCartao, - un as EliEntradaDataHora, - en as EliEntradaNumero, - Yo as EliEntradaTexto, - xe as EliInput, - La as EliOlaMundo, - Uo as EliTabela, - En as default + Xe as EliBotao, + Pa as EliCartao, + Zo as EliEntradaDataHora, + jo as EliEntradaNumero, + Ge as EliEntradaTexto, + Ma as EliOlaMundo, + To as EliTabela, + an as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index c7a1581..e76668b 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,34 +1,34 @@ -(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A.eli_vue={},A.Vue,A.VBtn,A.VBadge,A.VCheckbox,A.VIcon,A.VRadio,A.VRadioGroup,A.VSelect,A.VTextField,A.VTextarea,A.VCard,A.VGrid))})(this,(function(A,t,Le,ze,je,Ue,He,Re,Ye,se,Je,ee,Ge){"use strict";const We=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),O=(e,a)=>{const n=e.__vccOpts||e;for(const[r,s]of a)n[r]=s;return n};function Ze(e,a,n,r,s,b){return t.openBlock(),t.createBlock(Le.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"eli-botao text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const pe=O(We,[["render",Ze]]),ge={suave:"4px",pill:"10px"},Xe=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ge?ge[e.radius]:e.radius),n=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),r=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:n,badgeStyle:r}}});function Ke(e,a,n,r,s,b){return e.showBadge?(t.openBlock(),t.createBlock(ze.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle,class:"eli-badge"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const ce=O(Xe,[["render",Ke],["__scopeId","data-v-371c8db4"]]);function Qe(e){return e.replace(/\D+/g,"")}function xe(e){const a=Qe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function et(e){return e.replace(/\D+/g,"")}function tt(e){const a=et(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function fe(e){return e.replace(/\D+/g,"")}function ye(e){const a=e.replace(/[^\d,]/g,""),n=a.split(",");return n.length>2?n[0]+","+n.slice(1).join(""):a}function at(e){return ye(e.replace(/%/g,""))}function ot(e){const a=fe(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function nt(e){const a=fe(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const lt=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:n}){const r=t.ref(!1),s=t.ref(!1),b=t.computed({get:()=>e.modelValue,set:B=>{a("update:modelValue",B),a("change",B)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),l=t.computed(()=>e.type==="password"?s.value?"text":"password":"text"),f=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),i=t.computed(()=>e.error?"error":r.value?e.color:void 0);function m(B){const $=B.target;let d=$.value;switch(e.type){case"numericoInteiro":d=fe(d);break;case"numericoDecimal":d=ye(d);break;case"numericoMoeda":d=ot(d);break;case"porcentagem":d=at(d);break;case"telefone":d=tt(d);break;case"cpfCnpj":d=xe(d);break;case"cep":d=nt(d);break}$.value=d,a("update:modelValue",d),a("change",d)}function k(){s.value=!s.value}const D=t.computed(()=>(e.options||[]).map(B=>{if(B&&typeof B=="object"&&"value"in B){const d=B.value;return{label:B.label??String(d),value:d,disabled:B.disabled}}const $=B;return{label:String($),value:$}}));return{attrs:n,value:b,isTextLike:o,inputHtmlType:l,inputMode:f,internalColor:i,showPassword:s,togglePassword:k,onInput:m,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:D}}}),rt={class:"eli-input"},it={key:4,class:"checkbox-group"};function st(e,a,n,r,s,b){return t.openBlock(),t.createElementBlock("div",rt,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ue.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Je.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value=o),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ye.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value=o),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(Re.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value=o),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(He.VRadio,{key:String(o.value),label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",it,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(je.VCheckbox,{key:String(o.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=l=>e.value=l),label:o.label,value:o.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const be=O(lt,[["render",st],["__scopeId","data-v-756cb549"]]),ct=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:pe,EliBadge:ce,EliInput:be},setup(){const e=t.ref(""),a=t.ref([]),n=t.ref(""),r=t.ref(""),s=t.ref(""),b=t.ref(""),o=t.ref(""),l=t.ref(""),f=t.ref(""),i=t.ref(""),m=t.ref(""),k=t.ref(null),D=t.ref([]);return{nome:e,email:l,documento:m,estado:a,telefone:r,mensagem:f,senha:i,cor:k,habilidades:D,idade:s,altura:b,cep:n,valor:o}}}),dt={class:"grid-example"};function ut(e,a,n,r,s,b){const o=t.resolveComponent("EliBadge"),l=t.resolveComponent("EliInput"),f=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ge.VContainer,null,{default:t.withCtx(()=>[t.createVNode(ee.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(ee.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",dt,[t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=i=>e.nome=i),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=i=>e.idade=i),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=i=>e.altura=i),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=i=>e.valor=i),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=i=>e.telefone=i),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=i=>e.cep=i),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(l,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=i=>e.estado=i),multiple:""},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=i=>e.documento=i),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=i=>e.email=i),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=i=>e.senha=i),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(l,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=i=>e.mensagem=i),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(l,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=i=>e.cor=i),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(l,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=i=>e.habilidades=i),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=i=>e.nome=i),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(ee.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(f,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const $e=O(ct,[["render",ut]]),mt=t.defineComponent({name:"EliCartao",components:{EliBadge:ce},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const n=t.computed(()=>e.status),r=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),s=t.computed(()=>`eli-cartao--${e.status}`);function b(){a("clicar",e.status)}return{rotuloStatus:n,corStatus:r,classeStatus:s,onClick:b}}}),pt={class:"eli-cartao__titulo-texto"},ft={class:"eli-cartao__status"};function bt(e,a,n,r,s,b){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(ee.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",pt,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",ft,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(ee.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(ee.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const ke=O(mt,[["render",bt],["__scopeId","data-v-6c492bd9"]]);var Ee=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(Ee||{});/** +(function(j,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VTextField"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VTextField","vuetify/components/VCard","vuetify/components/VGrid"],t):(j=typeof globalThis<"u"?globalThis:j||self,t(j.eli_vue={},j.Vue,j.VBtn,j.VBadge,j.VTextField,j.VCard,j.VGrid))})(this,(function(j,t,Ie,qe,me,ee,Fe){"use strict";const Le=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}}}),I=(e,a)=>{const n=e.__vccOpts||e;for(const[l,s]of a)n[l]=s;return n};function ze(e,a,n,l,s,f){return t.openBlock(),t.createBlock(Ie.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"eli-botao text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const pe=I(Le,[["render",ze]]),he={suave:"4px",pill:"10px"},je=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 he?he[e.radius]:e.radius),n=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),l=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:n,badgeStyle:l}}});function He(e,a,n,l,s,f){return e.showBadge?(t.openBlock(),t.createBlock(qe.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle,class:"eli-badge"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const se=I(je,[["render",He],["__scopeId","data-v-371c8db4"]]);function Ue(e){return e.replace(/\D+/g,"")}function Ye(e){const a=Ue(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 Re(e){return e.replace(/\D+/g,"")}function Je(e){const a=Re(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 We(e){return e.replace(/\D+/g,"")}function Ze(e){const a=We(e);return a?a.replace(/^(\d{5})(\d)/,"$1-$2").slice(0,9):""}const Ge=t.defineComponent({name:"EliEntradaTexto",inheritAttrs:!1,props:{value:{type:[String,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const l=t.computed(()=>{var i;return((i=e.opcoes)==null?void 0:i.formato)??"texto"}),s=t.computed({get:()=>e.value,set:i=>{n("update:value",i),n("input",i),n("change",i)}}),f=t.computed(()=>l.value==="email"?"email":l.value==="url"?"url":"text"),o=t.computed(()=>{if(l.value==="telefone")return"tel";if(l.value==="cpfCnpj"||l.value==="cep")return"numeric"});function r(i){switch(l.value){case"telefone":return Je(i);case"cpfCnpj":return Ye(i);case"cep":return Ze(i);default:return i}}function p(i){const m=i.target,y=r(m.value);m.value=y,s.value=y}return{attrs:a,emit:n,localValue:s,inputHtmlType:f,inputMode:o,onInput:p}}});function Xe(e,a,n,l,s,f){var o,r,p,i;return t.openBlock(),t.createBlock(me.VTextField,t.mergeProps({modelValue:e.localValue,"onUpdate:modelValue":a[0]||(a[0]=m=>e.localValue=m),type:e.inputHtmlType,inputmode:e.inputMode,label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(r=e.opcoes)==null?void 0:r.placeholder,counter:(p=e.opcoes)==null?void 0:p.limiteCaracteres,maxlength:(i=e.opcoes)==null?void 0:i.limiteCaracteres},e.attrs,{onFocus:a[1]||(a[1]=()=>e.emit("focus")),onBlur:a[2]||(a[2]=()=>e.emit("blur")),onInput:e.onInput}),null,16,["modelValue","type","inputmode","label","placeholder","counter","maxlength","onInput"])}const fe=I(Ge,[["render",Xe]]),Ke=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:pe,EliBadge:se,EliEntradaTexto:fe},setup(){const e=t.ref(""),a=t.ref(""),n=t.ref(""),l=t.ref(""),s=t.ref("");return{nome:e,email:l,documento:s,telefone:n,cep:a}}}),Qe={class:"grid-example"};function xe(e,a,n,l,s,f){const o=t.resolveComponent("EliBadge"),r=t.resolveComponent("EliEntradaTexto"),p=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Fe.VContainer,null,{default:t.withCtx(()=>[t.createVNode(ee.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[5]||(a[5]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(ee.VCardText,null,{default:t.withCtx(()=>[a[6]||(a[6]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Qe,[t.createVNode(r,{value:e.nome,"onUpdate:value":a[0]||(a[0]=i=>e.nome=i),opcoes:{rotulo:"Nome",placeholder:"Digite o nome"},density:"compact"},null,8,["value"]),t.createVNode(r,{value:e.telefone,"onUpdate:value":a[1]||(a[1]=i=>e.telefone=i),opcoes:{rotulo:"Telefone",formato:"telefone"}},null,8,["value"]),t.createVNode(r,{value:e.cep,"onUpdate:value":a[2]||(a[2]=i=>e.cep=i),opcoes:{rotulo:"CEP",placeholder:"00000-000",formato:"cep"}},null,8,["value"]),t.createVNode(r,{value:e.documento,"onUpdate:value":a[3]||(a[3]=i=>e.documento=i),opcoes:{rotulo:"CPF / CNPJ",formato:"cpfCnpj"}},null,8,["value"]),t.createVNode(r,{value:e.email,"onUpdate:value":a[4]||(a[4]=i=>e.email=i),opcoes:{rotulo:"Email",placeholder:"email@exemplo.com",formato:"email"}},null,8,["value"])])]),_:1}),t.createVNode(ee.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(p,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[7]||(a[7]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ge=I(Ke,[["render",xe]]),et=t.defineComponent({name:"EliCartao",components:{EliBadge:se},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const n=t.computed(()=>e.status),l=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),s=t.computed(()=>`eli-cartao--${e.status}`);function f(){a("clicar",e.status)}return{rotuloStatus:n,corStatus:l,classeStatus:s,onClick:f}}}),tt={class:"eli-cartao__titulo-texto"},at={class:"eli-cartao__status"};function ot(e,a,n,l,s,f){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(ee.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",tt,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",at,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(ee.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(ee.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const $e=I(et,[["render",ot],["__scopeId","data-v-6c492bd9"]]);var ye=(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))(ye||{});/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ht=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + */const nt=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Be=e=>e==="";/** + */const Ee=e=>e==="";/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gt=(...e)=>e.filter((a,n,r)=>!!a&&a.trim()!==""&&r.indexOf(a)===n).join(" ").trim();/** + */const lt=(...e)=>e.filter((a,n,l)=>!!a&&a.trim()!==""&&l.indexOf(a)===n).join(" ").trim();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ce=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const _e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + */const rt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,l)=>l?l.toUpperCase():n.toLowerCase());/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $t=e=>{const a=yt(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + */const it=e=>{const a=rt(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,39 +38,39 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kt=({name:e,iconNode:a,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":b,size:o=le.width,color:l=le.stroke,...f},{slots:i})=>t.h("svg",{...le,...f,width:o,height:o,stroke:l,"stroke-width":Be(n)||Be(r)||n===!0||r===!0?Number(s||b||le["stroke-width"])*24/Number(o):s||b||le["stroke-width"],class:gt("lucide",f.class,...e?[`lucide-${Ce($t(e))}-icon`,`lucide-${Ce(e)}`]:["lucide-icon"]),...!i.default&&!ht(f)&&{"aria-hidden":"true"}},[...a.map(m=>t.h(...m)),...i.default?[i.default()]:[]]);/** + */const st=({name:e,iconNode:a,absoluteStrokeWidth:n,"absolute-stroke-width":l,strokeWidth:s,"stroke-width":f,size:o=le.width,color:r=le.stroke,...p},{slots:i})=>t.h("svg",{...le,...p,width:o,height:o,stroke:r,"stroke-width":Ee(n)||Ee(l)||n===!0||l===!0?Number(s||f||le["stroke-width"])*24/Number(o):s||f||le["stroke-width"],class:lt("lucide",p.class,...e?[`lucide-${_e(it(e))}-icon`,`lucide-${_e(e)}`]:["lucide-icon"]),...!i.default&&!nt(p)&&{"aria-hidden":"true"}},[...a.map(m=>t.h(...m)),...i.default?[i.default()]:[]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ae=(e,a)=>(n,{slots:r,attrs:s})=>t.h(kt,{...s,...n,iconNode:a,name:e},r);/** + */const ae=(e,a)=>(n,{slots:l,attrs:s})=>t.h(st,{...s,...n,iconNode:a,name:e},l);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ve=ae("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const ke=ae("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ve=ae("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Ce=ae("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Se=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Be=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _e=ae("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const ve=ae("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Et=ae("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** + */const ct=ae("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bt=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ct=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:Bt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const n=t.ref(e.modelo??"");t.watch(()=>e.modelo,s=>{s!==void 0&&s!==n.value&&(n.value=s)});function r(){a("buscar",n.value.trim())}return{texto:n,emitirBusca:r}}}),Vt={class:"eli-tabela__busca"},vt={class:"eli-tabela__busca-input-wrapper"};function St(e,a,n,r,s,b){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",Vt,[t.createElementVNode("div",vt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=l=>e.texto=l),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...l)=>e.emitirBusca&&e.emitirBusca(...l),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...l)=>e.emitirBusca&&e.emitirBusca(...l))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const _t=O(Ct,[["render",St],["__scopeId","data-v-341415d1"]]),Dt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:_t},props:{exibirBusca:{type:Boolean,required:!0},exibirBotaoColunas:{type:Boolean,required:!1,default:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"},colunas(){return!0}},setup(e,{emit:a}){const n=t.computed(()=>e.acoesCabecalho.length>0);function r(b){a("buscar",b)}function s(){a("colunas")}return{temAcoesCabecalho:n,emitBuscar:r,emitColunas:s}}}),wt={class:"eli-tabela__cabecalho"},Nt={key:0,class:"eli-tabela__busca-grupo"},Mt={key:1,class:"eli-tabela__acoes-cabecalho"},At=["onClick"],Tt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Pt(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",wt,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",Nt,[e.exibirBotaoColunas?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__acoes-cabecalho-botao eli-tabela__acoes-cabecalho-botao--colunas",onClick:a[0]||(a[0]=(...l)=>e.emitColunas&&e.emitColunas(...l))}," Colunas ")):t.createCommentVNode("",!0),t.createVNode(o,{modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",Mt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(l,f)=>(t.openBlock(),t.createElementBlock("button",{key:`${l.rotulo}-${f}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(l.cor?{backgroundColor:l.cor,color:"#fff"}:void 0),onClick:l.acao},[l.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Tt,t.toDisplayString(l.rotulo),1)],12,At))),128))])):t.createCommentVNode("",!0)])}const It=O(Dt,[["render",Pt],["__scopeId","data-v-42938cb8"]]),Ot=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),qt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Ft={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Lt={class:"eli-tabela__erro-mensagem"},zt={key:2,class:"eli-tabela eli-tabela--vazio"};function jt(e,a,n,r,s,b){return e.carregando?(t.openBlock(),t.createElementBlock("div",qt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Ft,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Lt,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",zt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Ut=O(Ot,[["render",jt]]),Ht=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Rt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Yt(e,a,n,r,s,b){return e.isDev?(t.openBlock(),t.createElementBlock("div",Rt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const Jt=O(Ht,[["render",Yt]]),Gt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:ve,ArrowDown:Ve},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function n(s){return(s==null?void 0:s.coluna_ordem)!==void 0&&(s==null?void 0:s.coluna_ordem)!==null}function r(s){a("alternarOrdenacao",s)}return{ArrowUp:ve,ArrowDown:Ve,isOrdenavel:n,emitAlternarOrdenacao:r}}}),Wt={class:"eli-tabela__thead"},Zt={class:"eli-tabela__tr eli-tabela__tr--header"},Xt={key:0,class:"eli-tabela__th eli-tabela__th--expander",scope:"col"},Kt=["onClick"],Qt={class:"eli-tabela__th-texto"},xt={key:1,class:"eli-tabela__th-label"},ea={key:1,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function ta(e,a,n,r,s,b){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",Wt,[t.createElementVNode("tr",Zt,[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("th",Xt)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(l,f)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${f}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(l)?"eli-tabela__th--ordenavel":void 0]]),scope:"col"},[e.isOrdenavel(l)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(l.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:i=>e.emitAlternarOrdenacao(String(l.coluna_ordem))},[t.createElementVNode("span",Qt,t.toDisplayString(l.rotulo),1),e.colunaOrdenacao===String(l.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Kt)):(t.openBlock(),t.createElementBlock("span",xt,t.toDisplayString(l.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",ea," Ações ")):t.createCommentVNode("",!0)])])}const aa=O(Gt,[["render",ta]]),oa=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),na={key:1};function la(e,a,n,r,s,b){var o,l,f;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((l=e.dados)==null?void 0:l.texto),1)):(t.openBlock(),t.createElementBlock("span",na,t.toDisplayString((f=e.dados)==null?void 0:f.texto),1))}const ra=O(oa,[["render",la],["__scopeId","data-v-7a629ffa"]]),ia=t.defineComponent({name:"EliTabelaCelulaTextoTruncado",props:{dados:{type:Object}},setup({dados:e}){return{dados:e}}}),sa=["title"],ca=["title"];function da(e,a,n,r,s,b){var o,l,f,i,m;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__texto-truncado eli-tabela__celula-link",title:(l=e.dados)==null?void 0:l.texto,onClick:a[0]||(a[0]=t.withModifiers(k=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((f=e.dados)==null?void 0:f.texto),9,sa)):(t.openBlock(),t.createElementBlock("span",{key:1,class:"eli-tabela__texto-truncado",title:(i=e.dados)==null?void 0:i.texto},t.toDisplayString((m=e.dados)==null?void 0:m.texto),9,ca))}const ua=O(ia,[["render",da],["__scopeId","data-v-74854889"]]),ma=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),pa={key:1};function fa(e,a,n,r,s,b){var o,l,f;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",",")),1)):(t.openBlock(),t.createElementBlock("span",pa,t.toDisplayString(String((f=e.dados)==null?void 0:f.numero).replace(".",",")),1))}const ba={textoSimples:ra,textoTruncado:ua,numero:O(ma,[["render",fa],["__scopeId","data-v-e7bac7ff"]])},ha=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),n=t.computed(()=>e.celula[1]),r=t.computed(()=>ba[a.value]),s=t.computed(()=>n.value);return{Componente:r,dadosParaComponente:s}}});function ga(e,a,n,r,s,b){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const De=O(ha,[["render",ga]]),ya=t.defineComponent({name:"EliTabelaDetalhesLinha",components:{EliTabelaCelula:De},props:{linha:{type:null,required:!0},colunasInvisiveis:{type:Array,required:!0}}}),$a={class:"eli-tabela__detalhes"},ka={class:"eli-tabela__detalhe-rotulo"},Ea={class:"eli-tabela__detalhe-valor"};function Ba(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCelula");return t.openBlock(),t.createElementBlock("div",$a,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunasInvisiveis,(l,f)=>(t.openBlock(),t.createElementBlock("div",{key:`det-${f}-${l.rotulo}`,class:"eli-tabela__detalhe"},[t.createElementVNode("div",ka,t.toDisplayString(l.rotulo),1),t.createElementVNode("div",Ea,[t.createVNode(o,{celula:l.celula(e.linha)},null,8,["celula"])])]))),128))])}const Ca=O(ya,[["render",Ba],["__scopeId","data-v-f1ee8d20"]]),Va=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:De,EliTabelaDetalhesLinha:Ca,MoreVertical:Et,ChevronRight:_e,ChevronDown:Se},props:{colunas:{type:Array,required:!0},colunasInvisiveis:{type:Array,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},linhasExpandidas:{type:Object,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0},toggleMenu:{type:Function,required:!0},alternarLinhaExpandida:{type:Function,required:!0}},setup(){return{ChevronRight:_e,ChevronDown:Se}}}),va={class:"eli-tabela__tbody"},Sa=["aria-expanded","aria-label","title","onClick"],_a=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],Da=["colspan"];function wa(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaCelula"),l=t.resolveComponent("MoreVertical"),f=t.resolveComponent("EliTabelaDetalhesLinha");return t.openBlock(),t.createElementBlock("tbody",va,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(i,m)=>{var k,D,B,$,d,S;return t.openBlock(),t.createElementBlock(t.Fragment,{key:`grp-${m}`},[t.createElementVNode("tr",{class:t.normalizeClass(["eli-tabela__tr",[m%2===1?"eli-tabela__tr--zebra":void 0]])},[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--expander",key:`td-${m}-exp`},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["eli-tabela__expander-botao",[(k=e.linhasExpandidas)!=null&&k[m]?"eli-tabela__expander-botao--ativo":void 0]]),"aria-expanded":(D=e.linhasExpandidas)!=null&&D[m]?"true":"false","aria-label":(B=e.linhasExpandidas)!=null&&B[m]?"Ocultar colunas ocultas":"Mostrar colunas ocultas",title:($=e.linhasExpandidas)!=null&&$[m]?"Ocultar detalhes":"Mostrar detalhes",onClick:t.withModifiers(y=>e.alternarLinhaExpandida(m),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent((d=e.linhasExpandidas)!=null&&d[m]?e.ChevronDown:e.ChevronRight),{class:"eli-tabela__expander-icone",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Sa)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(y,C)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${m}-${C}`,class:"eli-tabela__td"},[t.createVNode(o,{celula:y.celula(i)},null,8,["celula"])]))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${m}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===m?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${m}`,disabled:!e.possuiAcoes(m),"aria-haspopup":"menu","aria-expanded":e.menuAberto===m?"true":"false","aria-controls":e.possuiAcoes(m)?`eli-tabela-acoes-menu-${m}`:void 0,"aria-label":e.possuiAcoes(m)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(m)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(y=>e.toggleMenu(m,y),["stop"])},[t.createVNode(l,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,_a)],2)])):t.createCommentVNode("",!0)],2),e.temColunasInvisiveis&&((S=e.linhasExpandidas)!=null&&S[m])?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["eli-tabela__tr eli-tabela__tr--detalhes",[m%2===1?"eli-tabela__tr--zebra":void 0]])},[t.createElementVNode("td",{class:"eli-tabela__td eli-tabela__td--detalhes",colspan:(e.temColunasInvisiveis?1:0)+e.colunas.length+(e.temAcoes?1:0)},[t.createVNode(f,{linha:i,colunasInvisiveis:e.colunasInvisiveis},null,8,["linha","colunasInvisiveis"])],8,Da)],2)):t.createCommentVNode("",!0)],64)}),128))])}const Na=O(Va,[["render",wa]]),Ma=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:n}){const r=t.ref(null);n({menuEl:r});const s=t.computed(()=>e.acoes.length>0);function b(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:r,possuiAcoes:s,emitExecutar:b}}}),Aa=["id","aria-labelledby"],Ta=["aria-label","title","onClick"],Pa={class:"eli-tabela__acoes-item-texto"};function Ia(e,a,n,r,s,b){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(l=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",Pa,t.toDisplayString(o.acao.rotulo),1)],12,Ta)]))),128))],12,Aa)):t.createCommentVNode("",!0)])}const Oa=O(Ma,[["render",Ia]]),qa=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const n=t.computed(()=>{const i=e.maximoBotoes;return typeof i=="number"&&i>=5?Math.floor(i):7}),r=t.computed(()=>{const i=e.totalPaginas,m=e.pagina,k=n.value,D=[],B=C=>{D.push({label:String(C),pagina:C,ativo:C===m})},$=()=>{D.push({label:"…",ehEllipsis:!0})};if(i<=k){for(let C=1;C<=i;C+=1)B(C);return D}const d=Math.max(3,k-2);let S=Math.max(2,m-Math.floor(d/2)),y=S+d-1;y>=i&&(y=i-1,S=y-d+1),B(1),S>2&&$();for(let C=S;C<=y;C+=1)B(C);return ye.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),l=t.computed(()=>e.pagina),f=t.computed(()=>e.totalPaginas);return{botoes:r,irParaPagina:s,anteriorDesabilitado:b,proximaDesabilitada:o,paginaAtual:l,totalPaginasExibidas:f}}}),Fa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},La=["disabled"],za={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ja=["disabled","aria-current","aria-label","onClick"],Ua=["disabled"];function Ha(e,a,n,r,s,b){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Fa,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,La),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${l}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",za,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:f=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,ja))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,Ua)])):t.createCommentVNode("",!0)}const Ra=O(qa,[["render",Ha],["__scopeId","data-v-5ca7a362"]]),we="application/x-eli-tabela-coluna",Ya=t.defineComponent({name:"EliTabelaModalColunas",props:{aberto:{type:Boolean,required:!0},rotulosColunas:{type:Array,required:!0},configInicial:{type:Object,required:!0},colunas:{type:Array,required:!0}},emits:{fechar(){return!0},salvar(e){return!0}},setup(e,{emit:a}){const n=t.ref([]),r=t.ref([]);function s(){var X,te;const $=e.rotulosColunas,d=(((X=e.configInicial.visiveis)==null?void 0:X.length)??0)>0||(((te=e.configInicial.invisiveis)==null?void 0:te.length)??0)>0,S=new Set(e.colunas.filter(H=>H.visivel===!1).map(H=>H.rotulo)),y=d?new Set(e.configInicial.invisiveis??[]):S,C=$.filter(H=>!y.has(H)),G=e.configInicial.visiveis??[],K=new Set(C),Z=[];for(const H of G)K.has(H)&&Z.push(H);for(const H of C)Z.includes(H)||Z.push(H);n.value=Z,r.value=$.filter(H=>y.has(H))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial,e.colunas],()=>{e.aberto&&s()},{deep:!0,immediate:!0});function b(){a("fechar")}function o(){a("salvar",{visiveis:[...n.value],invisiveis:[...r.value]})}function l($,d){var S,y;try{(S=$.dataTransfer)==null||S.setData(we,JSON.stringify(d)),(y=$.dataTransfer)==null||y.setData("text/plain",d.rotulo),$.dataTransfer.effectAllowed="move"}catch{}}function f($){var d;try{const S=(d=$.dataTransfer)==null?void 0:d.getData(we);if(!S)return null;const y=JSON.parse(S);return!y||typeof y.rotulo!="string"||y.origem!=="visiveis"&&y.origem!=="invisiveis"?null:y}catch{return null}}function i($){const d=$.origem==="visiveis"?n.value:r.value,S=d.indexOf($.rotulo);S>=0&&d.splice(S,1)}function m($,d,S){const y=$==="visiveis"?n.value:r.value,C=y.indexOf(d);C>=0&&y.splice(C,1),S===null||S<0||S>y.length?y.push(d):y.splice(S,0,d)}function k($,d,S,y){l($,{rotulo:d,origem:S,index:y})}function D($,d,S){const y=f($);if(y)if(i(y),m(d,y.rotulo,S),d==="visiveis"){const C=r.value.indexOf(y.rotulo);C>=0&&r.value.splice(C,1)}else{const C=n.value.indexOf(y.rotulo);C>=0&&n.value.splice(C,1)}}function B($,d,S){const y=f($);if(y)if(i(y),m(d,y.rotulo,null),d==="visiveis"){const C=r.value.indexOf(y.rotulo);C>=0&&r.value.splice(C,1)}else{const C=n.value.indexOf(y.rotulo);C>=0&&n.value.splice(C,1)}}return{visiveisLocal:n,invisiveisLocal:r,emitFechar:b,emitSalvar:o,onDragStart:k,onDropItem:D,onDropLista:B}}}),Ja={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},Ga={class:"eli-tabela-modal-colunas__header"},Wa={class:"eli-tabela-modal-colunas__conteudo"},Za={class:"eli-tabela-modal-colunas__coluna"},Xa=["onDragstart","onDrop"],Ka={class:"eli-tabela-modal-colunas__item-texto"},Qa={class:"eli-tabela-modal-colunas__coluna"},xa=["onDragstart","onDrop"],eo={class:"eli-tabela-modal-colunas__item-texto"},to={class:"eli-tabela-modal-colunas__footer"};function ao(e,a,n,r,s,b){return e.aberto?(t.openBlock(),t.createElementBlock("div",{key:0,class:"eli-tabela-modal-colunas__overlay",role:"presentation",onClick:a[9]||(a[9]=t.withModifiers((...o)=>e.emitFechar&&e.emitFechar(...o),["self"]))},[t.createElementVNode("div",Ja,[t.createElementVNode("header",Ga,[a[10]||(a[10]=t.createElementVNode("h3",{class:"eli-tabela-modal-colunas__titulo"},"Colunas",-1)),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__fechar","aria-label":"Fechar",onClick:a[0]||(a[0]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," × ")]),t.createElementVNode("div",Wa,[t.createElementVNode("div",Za,[a[12]||(a[12]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Visíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[2]||(a[2]=t.withModifiers(()=>{},["prevent"])),onDrop:a[3]||(a[3]=o=>e.onDropLista(o,"visiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`vis-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:f=>e.onDragStart(f,o,"visiveis",l),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:f=>e.onDropItem(f,"visiveis",l)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",Ka,t.toDisplayString(o),1)],40,Xa))),128))],32)]),t.createElementVNode("div",Qa,[a[14]||(a[14]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Invisíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[5]||(a[5]=t.withModifiers(()=>{},["prevent"])),onDrop:a[6]||(a[6]=o=>e.onDropLista(o,"invisiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.invisiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`inv-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:f=>e.onDragStart(f,o,"invisiveis",l),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:f=>e.onDropItem(f,"invisiveis",l)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",eo,t.toDisplayString(o),1)],40,xa))),128))],32)])]),t.createElementVNode("footer",to,[t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--sec",onClick:a[7]||(a[7]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," Cancelar "),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--prim",onClick:a[8]||(a[8]=(...o)=>e.emitSalvar&&e.emitSalvar(...o))}," Salvar ")])])])):t.createCommentVNode("",!0)}const oo=O(Ya,[["render",ao],["__scopeId","data-v-b8f693ef"]]),no="eli:tabela";function Ne(e){return`${no}:${e}:colunas`}function Me(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,n=Array.isArray(a.visiveis)?a.visiveis.filter(s=>typeof s=="string"):[],r=Array.isArray(a.invisiveis)?a.invisiveis.filter(s=>typeof s=="string"):[];return{visiveis:n,invisiveis:r}}function Ae(e){try{const a=window.localStorage.getItem(Ne(e));return a?Me(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function lo(e,a){try{window.localStorage.setItem(Ne(e),JSON.stringify(Me(a)))}catch{}}const ro=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:It,EliTabelaEstados:Ut,EliTabelaDebug:Jt,EliTabelaHead:aa,EliTabelaBody:Na,EliTabelaMenuAcoes:Oa,EliTabelaPaginacao:Ra,EliTabelaModalColunas:oo},props:{tabela:{type:Object,required:!0}},setup(e){const n=t.ref(!1),r=t.ref(null),s=t.ref([]),b=t.ref(0),o=t.ref([]),l=t.ref(null),f=t.ref(null),i=t.ref({top:0,left:0}),m=t.ref(""),k=t.ref(1),D=t.ref(null),B=t.ref("asc"),$=t.computed(()=>e.tabela),d=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),S=t.computed(()=>e.tabela.acoesTabela??[]),y=t.computed(()=>S.value.length>0),C=t.ref(!1),G=t.ref(Ae(e.tabela.nome)),K=t.ref({}),Z=t.computed(()=>e.tabela.colunas.map(h=>h.rotulo)),X=t.computed(()=>{var W,Q;const h=e.tabela.colunas,T=(((W=G.value.visiveis)==null?void 0:W.length)??0)>0||(((Q=G.value.invisiveis)==null?void 0:Q.length)??0)>0?G.value.invisiveis??[]:h.filter(q=>q.visivel===!1).map(q=>q.rotulo),N=new Set(T),P=h.filter(q=>N.has(q.rotulo)),F=T,R=new Map;for(const q of P)R.has(q.rotulo)||R.set(q.rotulo,q);const Y=[];for(const q of F){const x=R.get(q);x&&Y.push(x)}for(const q of P)Y.includes(q)||Y.push(q);return Y}),te=t.computed(()=>X.value.length>0),H=t.computed(()=>{var q,x;const h=e.tabela.colunas,_=Z.value,T=(((q=G.value.visiveis)==null?void 0:q.length)??0)>0||(((x=G.value.invisiveis)==null?void 0:x.length)??0)>0,N=T?G.value.invisiveis??[]:e.tabela.colunas.filter(L=>L.visivel===!1).map(L=>L.rotulo),P=new Set(N),F=_.filter(L=>!P.has(L)),R=new Set(F),Y=T?G.value.visiveis??[]:[],W=[];for(const L of Y)R.has(L)&&W.push(L);for(const L of F)W.includes(L)||W.push(L);const Q=new Map;for(const L of h)Q.has(L.rotulo)||Q.set(L.rotulo,L);return W.map(L=>Q.get(L)).filter(Boolean)});function oe(){C.value=!0}function U(){C.value=!1}function w(h){G.value=h,lo(e.tabela.nome,h),C.value=!1,K.value={}}function ne(h){const _=!!K.value[h];K.value={...K.value,[h]:!_}}const re=t.computed(()=>{const h=e.tabela.registros_por_consulta;return typeof h=="number"&&h>0?Math.floor(h):10}),E=t.computed(()=>{const h=re.value;if(!h||h<=0)return 1;const _=b.value;return _?Math.max(1,Math.ceil(_/h)):1}),p=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let c=0;function g(h){var Y,W,Q,q,x,L;const _=h.getBoundingClientRect(),T=8,N=((Q=(W=(Y=f.value)==null?void 0:Y.menuEl)==null?void 0:W.value)==null?void 0:Q.offsetHeight)??0,P=((L=(x=(q=f.value)==null?void 0:q.menuEl)==null?void 0:x.value)==null?void 0:L.offsetWidth)??180;let F=_.bottom+T;const R=_.right-P;N&&F+N>window.innerHeight-T&&(F=_.top-T-N),i.value={top:Math.max(T,Math.round(F)),left:Math.max(T,Math.round(R))}}function u(h){var T,N;if(l.value===null)return;const _=h.target;(N=(T=f.value)==null?void 0:T.menuEl)!=null&&N.value&&f.value.menuEl.value.contains(_)||(l.value=null)}function V(h){if(h){if(D.value===h){B.value=B.value==="asc"?"desc":"asc",j();return}D.value=h,B.value="asc",k.value!==1?k.value=1:j()}}function v(h){m.value!==h&&(m.value=h,k.value!==1?k.value=1:j())}function M(h){const _=Math.min(Math.max(1,h),E.value);_!==k.value&&(k.value=_)}function I(h){const _=e.tabela.acoesLinha??[],T=o.value[h]??[];return _.map((N,P)=>{const F=N.exibir===void 0?!0:typeof N.exibir=="boolean"?N.exibir:!1;return{acao:N,indice:P,visivel:T[P]??F}}).filter(N=>N.visivel)}function z(h){return I(h).length>0}function J(h,_){if(!z(h))return;if(l.value===h){l.value=null;return}l.value=h;const T=(_==null?void 0:_.currentTarget)??null;T&&(g(T),requestAnimationFrame(()=>g(T)))}async function j(){var P,F;const h=++c;n.value=!0,r.value=null,o.value=[],l.value=null,K.value={};const _=Math.max(1,re.value),N={offSet:(k.value-1)*_,limit:_};m.value&&(N.texto_busca=m.value),D.value&&(N.coluna_ordem=D.value,N.direcao_ordem=B.value);try{const R=e.tabela,Y=await R.consulta(N);if(h!==c)return;if(Y.cod!==Ee.sucesso){s.value=[],b.value=0,r.value=Y.mensagem;return}const W=((P=Y.valor)==null?void 0:P.valores)??[],Q=((F=Y.valor)==null?void 0:F.quantidade)??W.length;s.value=W,b.value=Q;const q=Math.max(1,Math.ceil((Q||0)/_));if(k.value>q){k.value=q;return}const x=R.acoesLinha??[];if(!x.length){o.value=[];return}const L=W.map(()=>x.map(ie=>ie.exibir===void 0?!0:typeof ie.exibir=="boolean"?ie.exibir:!1));o.value=L;const No=await Promise.all(W.map(async ie=>Promise.all(x.map(async me=>{if(me.exibir===void 0)return!0;if(typeof me.exibir=="boolean")return me.exibir;try{const Mo=me.exibir(ie);return!!await Promise.resolve(Mo)}catch{return!1}}))));h===c&&(o.value=No)}catch(R){if(h!==c)return;s.value=[],b.value=0,r.value=R instanceof Error?R.message:"Erro ao carregar dados."}finally{h===c&&(n.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",u),j()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",u)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,h=>{!h&&m.value&&(m.value="",k.value!==1?k.value=1:j())}),t.watch(k,(h,_)=>{h!==_&&j()}),t.watch(()=>e.tabela,()=>{l.value=null,D.value=null,B.value="asc",m.value="",C.value=!1,G.value=Ae(e.tabela.nome),K.value={},k.value!==1?k.value=1:j()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{k.value!==1?k.value=1:j()}),t.watch(s,()=>{l.value=null,K.value={}}),{isDev:!1,tabela:$,carregando:n,erro:r,linhas:s,quantidade:b,menuAberto:l,valorBusca:m,paginaAtual:k,colunaOrdenacao:D,direcaoOrdenacao:B,totalPaginas:E,exibirBusca:d,acoesCabecalho:S,temAcoesCabecalho:y,temAcoes:p,colunasEfetivas:H,rotulosColunas:Z,modalColunasAberto:C,configColunas:G,temColunasInvisiveis:te,colunasInvisiveisEfetivas:X,linhasExpandidas:K,abrirModalColunas:oe,fecharModalColunas:U,salvarModalColunas:w,alternarLinhaExpandida:ne,alternarOrdenacao:V,atualizarBusca:v,irParaPagina:M,acoesDisponiveisPorLinha:I,possuiAcoes:z,toggleMenu:J,menuPopup:f,menuPopupPos:i}}}),io={class:"eli-tabela"},so={class:"eli-tabela__table"};function co(e,a,n,r,s,b){const o=t.resolveComponent("EliTabelaDebug"),l=t.resolveComponent("EliTabelaEstados"),f=t.resolveComponent("EliTabelaCabecalho"),i=t.resolveComponent("EliTabelaModalColunas"),m=t.resolveComponent("EliTabelaHead"),k=t.resolveComponent("EliTabelaBody"),D=t.resolveComponent("EliTabelaMenuAcoes"),B=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",io,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(l,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(f,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca,onColunas:e.abrirModalColunas},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar","onColunas"])):t.createCommentVNode("",!0),t.createVNode(i,{aberto:e.modalColunasAberto,rotulosColunas:e.rotulosColunas,configInicial:e.configColunas,colunas:e.tabela.colunas,onFechar:e.fecharModalColunas,onSalvar:e.salvarModalColunas},null,8,["aberto","rotulosColunas","configInicial","colunas","onFechar","onSalvar"]),t.createElementVNode("table",so,[t.createVNode(m,{colunas:e.colunasEfetivas,temAcoes:e.temAcoes,temColunasInvisiveis:e.temColunasInvisiveis,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","temColunasInvisiveis","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(k,{colunas:e.colunasEfetivas,colunasInvisiveis:e.colunasInvisiveisEfetivas,temColunasInvisiveis:e.temColunasInvisiveis,linhasExpandidas:e.linhasExpandidas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu,alternarLinhaExpandida:e.alternarLinhaExpandida},null,8,["colunas","colunasInvisiveis","temColunasInvisiveis","linhasExpandidas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu","alternarLinhaExpandida"])]),t.createVNode(D,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:$,linha:d})=>{e.menuAberto=null,$.acao(d)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(B,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const Te=O(ro,[["render",co]]),uo=t.defineComponent({name:"EliEntradaTexto",inheritAttrs:!1,props:{value:{type:[String,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const r=t.computed({get:()=>e.value,set:s=>{n("update:value",s),n("input",s),n("change",s)}});return{attrs:a,emit:n,localValue:r}}});function mo(e,a,n,r,s,b){var o,l,f,i;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({modelValue:e.localValue,"onUpdate:modelValue":a[0]||(a[0]=m=>e.localValue=m),label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,counter:(f=e.opcoes)==null?void 0:f.limiteCaracteres,maxlength:(i=e.opcoes)==null?void 0:i.limiteCaracteres},e.attrs,{onFocus:a[1]||(a[1]=()=>e.emit("focus")),onBlur:a[2]||(a[2]=()=>e.emit("blur"))}),null,16,["modelValue","label","placeholder","counter","maxlength"])}const Pe=O(uo,[["render",mo]]);function po(e){if(!Number.isFinite(e)||e<=0||e>=1)return 0;const a=e.toString();if(a.includes("e-")){const[,s]=a.split("e-"),b=Number(s);return Number.isFinite(b)?b:0}const n=a.indexOf(".");return n===-1?0:a.slice(n+1).replace(/0+$/,"").length}function fo(e){const a=(e??"").trim().replace(/,/g,".");if(!a)return null;const n=Number(a);return Number.isNaN(n)?null:n}function he(e,a){return e==null?"":a===null?String(e):Number(e).toFixed(Math.max(0,a)).replace(/\./g,",")}function Ie(e){return(e??"").replace(/\D+/g,"")}function bo(e){const a=(e??"").replace(/[^0-9.,]+/g,""),n=a.match(/[.,]/);if(!n)return a;const r=n[0],s=a.indexOf(r),b=a.slice(0,s).replace(/[.,]/g,""),o=a.slice(s+1).replace(/[.,]/g,"");return`${b.length?b:"0"}${r}${o}`}function ho(e,a){if(a===null)return e;if(a<=0)return e.replace(/[.,]/g,"");const n=e.match(/[.,]/);if(!n)return e;const r=n[0],s=e.indexOf(r),b=e.slice(0,s),o=e.slice(s+1);return`${b}${r}${o.slice(0,a)}`}function go(e){const a=e.match(/^(\d+)[.,]$/);if(!a)return null;const n=Number(a[1]);return Number.isNaN(n)?null:n}const yo=t.defineComponent({name:"EliEntradaNumero",inheritAttrs:!1,props:{value:{type:[Number,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const r=t.computed(()=>{var m;const i=(m=e.opcoes)==null?void 0:m.precisao;return i==null?null:po(i)}),s=t.computed(()=>r.value===0),b=t.computed(()=>{const i=r.value;return i!==null&&i>0}),o=t.ref(""),l=t.ref(void 0);t.watch(()=>e.value,i=>{i!==l.value&&(o.value=he(i,r.value),l.value=i)},{immediate:!0});function f(i){if(b.value){const B=r.value??0,$=Ie(i),d=$?Number($):0,S=Math.pow(10,B),y=$?d/S:null,C=y===null?null:y;l.value=C,n("update:value",C),n("input",C),n("change",C),o.value=he(C,B);return}const m=s.value?Ie(i):bo(i),k=s.value?m:ho(m,r.value);let D=null;if(k){const $=(s.value?null:go(k))??fo(k);D=$===null?null:$}l.value=D,n("update:value",D),n("input",D),n("change",D),o.value=he(D,r.value)}return{attrs:a,emit:n,displayValue:o,isInteiro:s,onUpdateModelValue:f}}}),$o={class:"eli-entrada__prefixo"},ko={class:"eli-entrada__sufixo"};function Eo(e,a,n,r,s,b){var o,l,f,i;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({"model-value":e.displayValue,label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,type:e.isInteiro?"number":"text",inputmode:e.isInteiro?"numeric":"decimal",pattern:e.isInteiro?"[0-9]*":"[0-9.,]*"},e.attrs,{"onUpdate:modelValue":e.onUpdateModelValue,onFocus:a[0]||(a[0]=()=>e.emit("focus")),onBlur:a[1]||(a[1]=()=>e.emit("blur"))}),t.createSlots({_:2},[(f=e.opcoes)!=null&&f.prefixo?{name:"prepend-inner",fn:t.withCtx(()=>[t.createElementVNode("span",$o,t.toDisplayString(e.opcoes.prefixo),1)]),key:"0"}:void 0,(i=e.opcoes)!=null&&i.sufixo?{name:"append-inner",fn:t.withCtx(()=>[t.createElementVNode("span",ko,t.toDisplayString(e.opcoes.sufixo),1)]),key:"1"}:void 0]),1040,["model-value","label","placeholder","type","inputmode","pattern","onUpdate:modelValue"])}const Oe=O(yo,[["render",Eo],["__scopeId","data-v-77cbf216"]]);function Bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},Co=de.exports,qe;function Vo(){return qe||(qe=1,(function(e,a){(function(n,r){e.exports=r()})(Co,(function(){var n=1e3,r=6e4,s=36e5,b="millisecond",o="second",l="minute",f="hour",i="day",m="week",k="month",D="quarter",B="year",$="date",d="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var p=["th","st","nd","rd"],c=E%100;return"["+E+(p[(c-20)%10]||p[c]||p[0])+"]"}},G=function(E,p,c){var g=String(E);return!g||g.length>=p?E:""+Array(p+1-g.length).join(c)+E},K={s:G,z:function(E){var p=-E.utcOffset(),c=Math.abs(p),g=Math.floor(c/60),u=c%60;return(p<=0?"+":"-")+G(g,2,"0")+":"+G(u,2,"0")},m:function E(p,c){if(p.date()1)return E(v[0])}else{var M=p.name;X[M]=p,u=M}return!g&&u&&(Z=u),u||!g&&Z},U=function(E,p){if(H(E))return E.clone();var c=typeof p=="object"?p:{};return c.date=E,c.args=arguments,new ne(c)},w=K;w.l=oe,w.i=H,w.w=function(E,p){return U(E,{locale:p.$L,utc:p.$u,x:p.$x,$offset:p.$offset})};var ne=(function(){function E(c){this.$L=oe(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[te]=!0}var p=E.prototype;return p.parse=function(c){this.$d=(function(g){var u=g.date,V=g.utc;if(u===null)return new Date(NaN);if(w.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var v=u.match(S);if(v){var M=v[2]-1||0,I=(v[7]||"0").substring(0,3);return V?new Date(Date.UTC(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,I)):new Date(v[1],M,v[3]||1,v[4]||0,v[5]||0,v[6]||0,I)}}return new Date(u)})(c),this.init()},p.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},p.$utils=function(){return w},p.isValid=function(){return this.$d.toString()!==d},p.isSame=function(c,g){var u=U(c);return this.startOf(g)<=u&&u<=this.endOf(g)},p.isAfter=function(c,g){return U(c)!0,input:e=>!0,change:e=>!0,"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0,focus:()=>!0,blur:()=>!0},setup(e,{emit:a,attrs:n}){const r=t.computed(()=>e.opcoes?e.opcoes:{rotulo:e.rotulo??"Data e hora",placeholder:e.placeholder??"",modo:e.modo??"dataHora",limpavel:e.limpavel,erro:e.erro,mensagensErro:e.mensagensErro,dica:e.dica,dicaPersistente:e.dicaPersistente,densidade:e.densidade,variante:e.variante,min:e.min,max:e.max}),s=t.computed(()=>r.value.modo??"dataHora"),b=t.computed(()=>!!e.desabilitado),o=t.computed(()=>s.value==="data"?"date":"datetime-local");function l(d){return s.value==="data"?ue(d).format("YYYY-MM-DD"):ue(d).format("YYYY-MM-DDTHH:mm")}function f(d){return s.value==="data"?ue(`${d}T00:00`).format():ue(d).format()}const i=t.computed(()=>e.value!==void 0?e.value??null:e.modelValue),m=t.computed({get:()=>i.value?l(i.value):"",set:d=>{const S=d&&d.length>0?d:null;if(!S){a("update:value",null),a("input",null),a("change",null),a("update:modelValue",null),a("alterar",null);return}const y=f(S);a("update:value",y),a("input",y),a("change",y),a("update:modelValue",y),a("alterar",y)}}),k=t.computed(()=>{const d=r.value.min;if(d)return l(d)}),D=t.computed(()=>{const d=r.value.max;if(d)return l(d)});function B(){a("foco"),a("focus")}function $(){a("desfoco"),a("blur")}return{attrs:n,valor:m,tipoInput:o,minLocal:k,maxLocal:D,opcoesEfetivas:r,desabilitadoEfetivo:b,emitCompatFocus:B,emitCompatBlur:$}}}),_o={class:"eli-data-hora"};function Do(e,a,n,r,s,b){return t.openBlock(),t.createElementBlock("div",_o,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.opcoesEfetivas.rotulo,placeholder:e.opcoesEfetivas.placeholder,disabled:e.desabilitadoEfetivo,clearable:!!e.opcoesEfetivas.limpavel,error:!!e.opcoesEfetivas.erro,"error-messages":e.opcoesEfetivas.mensagensErro,hint:e.opcoesEfetivas.dica,"persistent-hint":!!e.opcoesEfetivas.dicaPersistente,density:e.opcoesEfetivas.densidade??"comfortable",variant:e.opcoesEfetivas.variante??"outlined",min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:e.emitCompatFocus,onBlur:e.emitCompatBlur}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max","onFocus","onBlur"])])}const Fe=O(So,[["render",Do],["__scopeId","data-v-1bfd1be8"]]),wo={install(e){e.component("EliOlaMundo",$e),e.component("EliBotao",pe),e.component("EliBadge",ce),e.component("EliInput",be),e.component("EliCartao",ke),e.component("EliTabela",Te),e.component("EliEntradaTexto",Pe),e.component("EliEntradaNumero",Oe),e.component("EliEntradaDataHora",Fe)}};A.EliBadge=ce,A.EliBotao=pe,A.EliCartao=ke,A.EliEntradaDataHora=Fe,A.EliEntradaNumero=Oe,A.EliEntradaTexto=Pe,A.EliInput=be,A.EliOlaMundo=$e,A.EliTabela=Te,A.default=wo,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */const dt=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ut=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:dt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const n=t.ref(e.modelo??"");t.watch(()=>e.modelo,s=>{s!==void 0&&s!==n.value&&(n.value=s)});function l(){a("buscar",n.value.trim())}return{texto:n,emitirBusca:l}}}),mt={class:"eli-tabela__busca"},pt={class:"eli-tabela__busca-input-wrapper"};function ft(e,a,n,l,s,f){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",mt,[t.createElementVNode("div",pt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=r=>e.texto=r),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...r)=>e.emitirBusca&&e.emitirBusca(...r),["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]=(...r)=>e.emitirBusca&&e.emitirBusca(...r))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const bt=I(ut,[["render",ft],["__scopeId","data-v-341415d1"]]),ht=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:bt},props:{exibirBusca:{type:Boolean,required:!0},exibirBotaoColunas:{type:Boolean,required:!1,default:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"},colunas(){return!0}},setup(e,{emit:a}){const n=t.computed(()=>e.acoesCabecalho.length>0);function l(f){a("buscar",f)}function s(){a("colunas")}return{temAcoesCabecalho:n,emitBuscar:l,emitColunas:s}}}),gt={class:"eli-tabela__cabecalho"},$t={key:0,class:"eli-tabela__busca-grupo"},yt={key:1,class:"eli-tabela__acoes-cabecalho"},Et=["onClick"],_t={class:"eli-tabela__acoes-cabecalho-rotulo"};function kt(e,a,n,l,s,f){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",gt,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",$t,[e.exibirBotaoColunas?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__acoes-cabecalho-botao eli-tabela__acoes-cabecalho-botao--colunas",onClick:a[0]||(a[0]=(...r)=>e.emitColunas&&e.emitColunas(...r))}," Colunas ")):t.createCommentVNode("",!0),t.createVNode(o,{modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",yt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(r,p)=>(t.openBlock(),t.createElementBlock("button",{key:`${r.rotulo}-${p}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(r.cor?{backgroundColor:r.cor,color:"#fff"}:void 0),onClick:r.acao},[r.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",_t,t.toDisplayString(r.rotulo),1)],12,Et))),128))])):t.createCommentVNode("",!0)])}const Ct=I(ht,[["render",kt],["__scopeId","data-v-42938cb8"]]),Bt=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),vt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Dt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Vt={class:"eli-tabela__erro-mensagem"},St={key:2,class:"eli-tabela eli-tabela--vazio"};function Nt(e,a,n,l,s,f){return e.carregando?(t.openBlock(),t.createElementBlock("div",vt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Dt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Vt,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",St,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const wt=I(Bt,[["render",Nt]]),Mt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),At={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Tt(e,a,n,l,s,f){return e.isDev?(t.openBlock(),t.createElementBlock("div",At,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const Pt=I(Mt,[["render",Tt]]),Ot=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:Ce,ArrowDown:ke},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function n(s){return(s==null?void 0:s.coluna_ordem)!==void 0&&(s==null?void 0:s.coluna_ordem)!==null}function l(s){a("alternarOrdenacao",s)}return{ArrowUp:Ce,ArrowDown:ke,isOrdenavel:n,emitAlternarOrdenacao:l}}}),It={class:"eli-tabela__thead"},qt={class:"eli-tabela__tr eli-tabela__tr--header"},Ft={key:0,class:"eli-tabela__th eli-tabela__th--expander",scope:"col"},Lt=["onClick"],zt={class:"eli-tabela__th-texto"},jt={key:1,class:"eli-tabela__th-label"},Ht={key:1,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Ut(e,a,n,l,s,f){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",It,[t.createElementVNode("tr",qt,[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("th",Ft)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(r,p)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${p}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(r)?"eli-tabela__th--ordenavel":void 0]]),scope:"col"},[e.isOrdenavel(r)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(r.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:i=>e.emitAlternarOrdenacao(String(r.coluna_ordem))},[t.createElementVNode("span",zt,t.toDisplayString(r.rotulo),1),e.colunaOrdenacao===String(r.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Lt)):(t.openBlock(),t.createElementBlock("span",jt,t.toDisplayString(r.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",Ht," Ações ")):t.createCommentVNode("",!0)])])}const Yt=I(Ot,[["render",Ut]]),Rt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),Jt={key:1};function Wt(e,a,n,l,s,f){var o,r,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((r=e.dados)==null?void 0:r.texto),1)):(t.openBlock(),t.createElementBlock("span",Jt,t.toDisplayString((p=e.dados)==null?void 0:p.texto),1))}const Zt=I(Rt,[["render",Wt],["__scopeId","data-v-7a629ffa"]]),Gt=t.defineComponent({name:"EliTabelaCelulaTextoTruncado",props:{dados:{type:Object}},setup({dados:e}){return{dados:e}}}),Xt=["title"],Kt=["title"];function Qt(e,a,n,l,s,f){var o,r,p,i,m;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__texto-truncado eli-tabela__celula-link",title:(r=e.dados)==null?void 0:r.texto,onClick:a[0]||(a[0]=t.withModifiers(y=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((p=e.dados)==null?void 0:p.texto),9,Xt)):(t.openBlock(),t.createElementBlock("span",{key:1,class:"eli-tabela__texto-truncado",title:(i=e.dados)==null?void 0:i.texto},t.toDisplayString((m=e.dados)==null?void 0:m.texto),9,Kt))}const xt=I(Gt,[["render",Qt],["__scopeId","data-v-74854889"]]),ea=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),ta={key:1};function aa(e,a,n,l,s,f){var o,r,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(i=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString(String((r=e.dados)==null?void 0:r.numero).replace(".",",")),1)):(t.openBlock(),t.createElementBlock("span",ta,t.toDisplayString(String((p=e.dados)==null?void 0:p.numero).replace(".",",")),1))}const oa={textoSimples:Zt,textoTruncado:xt,numero:I(ea,[["render",aa],["__scopeId","data-v-e7bac7ff"]])},na=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),n=t.computed(()=>e.celula[1]),l=t.computed(()=>oa[a.value]),s=t.computed(()=>n.value);return{Componente:l,dadosParaComponente:s}}});function la(e,a,n,l,s,f){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const De=I(na,[["render",la]]),ra=t.defineComponent({name:"EliTabelaDetalhesLinha",components:{EliTabelaCelula:De},props:{linha:{type:null,required:!0},colunasInvisiveis:{type:Array,required:!0}}}),ia={class:"eli-tabela__detalhes"},sa={class:"eli-tabela__detalhe-rotulo"},ca={class:"eli-tabela__detalhe-valor"};function da(e,a,n,l,s,f){const o=t.resolveComponent("EliTabelaCelula");return t.openBlock(),t.createElementBlock("div",ia,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunasInvisiveis,(r,p)=>(t.openBlock(),t.createElementBlock("div",{key:`det-${p}-${r.rotulo}`,class:"eli-tabela__detalhe"},[t.createElementVNode("div",sa,t.toDisplayString(r.rotulo),1),t.createElementVNode("div",ca,[t.createVNode(o,{celula:r.celula(e.linha)},null,8,["celula"])])]))),128))])}const ua=I(ra,[["render",da],["__scopeId","data-v-f1ee8d20"]]),ma=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:De,EliTabelaDetalhesLinha:ua,MoreVertical:ct,ChevronRight:ve,ChevronDown:Be},props:{colunas:{type:Array,required:!0},colunasInvisiveis:{type:Array,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},linhasExpandidas:{type:Object,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0},toggleMenu:{type:Function,required:!0},alternarLinhaExpandida:{type:Function,required:!0}},setup(){return{ChevronRight:ve,ChevronDown:Be}}}),pa={class:"eli-tabela__tbody"},fa=["aria-expanded","aria-label","title","onClick"],ba=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],ha=["colspan"];function ga(e,a,n,l,s,f){const o=t.resolveComponent("EliTabelaCelula"),r=t.resolveComponent("MoreVertical"),p=t.resolveComponent("EliTabelaDetalhesLinha");return t.openBlock(),t.createElementBlock("tbody",pa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(i,m)=>{var y,S,V,_,$,v;return t.openBlock(),t.createElementBlock(t.Fragment,{key:`grp-${m}`},[t.createElementVNode("tr",{class:t.normalizeClass(["eli-tabela__tr",[m%2===1?"eli-tabela__tr--zebra":void 0]])},[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--expander",key:`td-${m}-exp`},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["eli-tabela__expander-botao",[(y=e.linhasExpandidas)!=null&&y[m]?"eli-tabela__expander-botao--ativo":void 0]]),"aria-expanded":(S=e.linhasExpandidas)!=null&&S[m]?"true":"false","aria-label":(V=e.linhasExpandidas)!=null&&V[m]?"Ocultar colunas ocultas":"Mostrar colunas ocultas",title:(_=e.linhasExpandidas)!=null&&_[m]?"Ocultar detalhes":"Mostrar detalhes",onClick:t.withModifiers(g=>e.alternarLinhaExpandida(m),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(($=e.linhasExpandidas)!=null&&$[m]?e.ChevronDown:e.ChevronRight),{class:"eli-tabela__expander-icone",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,fa)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(g,k)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${m}-${k}`,class:"eli-tabela__td"},[t.createVNode(o,{celula:g.celula(i)},null,8,["celula"])]))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${m}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===m?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${m}`,disabled:!e.possuiAcoes(m),"aria-haspopup":"menu","aria-expanded":e.menuAberto===m?"true":"false","aria-controls":e.possuiAcoes(m)?`eli-tabela-acoes-menu-${m}`:void 0,"aria-label":e.possuiAcoes(m)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(m)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(g=>e.toggleMenu(m,g),["stop"])},[t.createVNode(r,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,ba)],2)])):t.createCommentVNode("",!0)],2),e.temColunasInvisiveis&&((v=e.linhasExpandidas)!=null&&v[m])?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["eli-tabela__tr eli-tabela__tr--detalhes",[m%2===1?"eli-tabela__tr--zebra":void 0]])},[t.createElementVNode("td",{class:"eli-tabela__td eli-tabela__td--detalhes",colspan:(e.temColunasInvisiveis?1:0)+e.colunas.length+(e.temAcoes?1:0)},[t.createVNode(p,{linha:i,colunasInvisiveis:e.colunasInvisiveis},null,8,["linha","colunasInvisiveis"])],8,ha)],2)):t.createCommentVNode("",!0)],64)}),128))])}const $a=I(ma,[["render",ga]]),ya=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:n}){const l=t.ref(null);n({menuEl:l});const s=t.computed(()=>e.acoes.length>0);function f(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:l,possuiAcoes:s,emitExecutar:f}}}),Ea=["id","aria-labelledby"],_a=["aria-label","title","onClick"],ka={class:"eli-tabela__acoes-item-texto"};function Ca(e,a,n,l,s,f){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(r=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ka,t.toDisplayString(o.acao.rotulo),1)],12,_a)]))),128))],12,Ea)):t.createCommentVNode("",!0)])}const Ba=I(ya,[["render",Ca]]),va=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const n=t.computed(()=>{const i=e.maximoBotoes;return typeof i=="number"&&i>=5?Math.floor(i):7}),l=t.computed(()=>{const i=e.totalPaginas,m=e.pagina,y=n.value,S=[],V=k=>{S.push({label:String(k),pagina:k,ativo:k===m})},_=()=>{S.push({label:"…",ehEllipsis:!0})};if(i<=y){for(let k=1;k<=i;k+=1)V(k);return S}const $=Math.max(3,y-2);let v=Math.max(2,m-Math.floor($/2)),g=v+$-1;g>=i&&(g=i-1,v=g-$+1),V(1),v>2&&_();for(let k=v;k<=g;k+=1)V(k);return ge.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),r=t.computed(()=>e.pagina),p=t.computed(()=>e.totalPaginas);return{botoes:l,irParaPagina:s,anteriorDesabilitado:f,proximaDesabilitada:o,paginaAtual:r,totalPaginasExibidas:p}}}),Da={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},Va=["disabled"],Sa={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Na=["disabled","aria-current","aria-label","onClick"],wa=["disabled"];function Ma(e,a,n,l,s,f){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Da,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,Va),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${r}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",Sa,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:p=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,Na))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,wa)])):t.createCommentVNode("",!0)}const Aa=I(va,[["render",Ma],["__scopeId","data-v-5ca7a362"]]),Ve="application/x-eli-tabela-coluna",Ta=t.defineComponent({name:"EliTabelaModalColunas",props:{aberto:{type:Boolean,required:!0},rotulosColunas:{type:Array,required:!0},configInicial:{type:Object,required:!0},colunas:{type:Array,required:!0}},emits:{fechar(){return!0},salvar(e){return!0}},setup(e,{emit:a}){const n=t.ref([]),l=t.ref([]);function s(){var X,te;const _=e.rotulosColunas,$=(((X=e.configInicial.visiveis)==null?void 0:X.length)??0)>0||(((te=e.configInicial.invisiveis)==null?void 0:te.length)??0)>0,v=new Set(e.colunas.filter(U=>U.visivel===!1).map(U=>U.rotulo)),g=$?new Set(e.configInicial.invisiveis??[]):v,k=_.filter(U=>!g.has(U)),W=e.configInicial.visiveis??[],K=new Set(k),G=[];for(const U of W)K.has(U)&&G.push(U);for(const U of k)G.includes(U)||G.push(U);n.value=G,l.value=_.filter(U=>g.has(U))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial,e.colunas],()=>{e.aberto&&s()},{deep:!0,immediate:!0});function f(){a("fechar")}function o(){a("salvar",{visiveis:[...n.value],invisiveis:[...l.value]})}function r(_,$){var v,g;try{(v=_.dataTransfer)==null||v.setData(Ve,JSON.stringify($)),(g=_.dataTransfer)==null||g.setData("text/plain",$.rotulo),_.dataTransfer.effectAllowed="move"}catch{}}function p(_){var $;try{const v=($=_.dataTransfer)==null?void 0:$.getData(Ve);if(!v)return null;const g=JSON.parse(v);return!g||typeof g.rotulo!="string"||g.origem!=="visiveis"&&g.origem!=="invisiveis"?null:g}catch{return null}}function i(_){const $=_.origem==="visiveis"?n.value:l.value,v=$.indexOf(_.rotulo);v>=0&&$.splice(v,1)}function m(_,$,v){const g=_==="visiveis"?n.value:l.value,k=g.indexOf($);k>=0&&g.splice(k,1),v===null||v<0||v>g.length?g.push($):g.splice(v,0,$)}function y(_,$,v,g){r(_,{rotulo:$,origem:v,index:g})}function S(_,$,v){const g=p(_);if(g)if(i(g),m($,g.rotulo,v),$==="visiveis"){const k=l.value.indexOf(g.rotulo);k>=0&&l.value.splice(k,1)}else{const k=n.value.indexOf(g.rotulo);k>=0&&n.value.splice(k,1)}}function V(_,$,v){const g=p(_);if(g)if(i(g),m($,g.rotulo,null),$==="visiveis"){const k=l.value.indexOf(g.rotulo);k>=0&&l.value.splice(k,1)}else{const k=n.value.indexOf(g.rotulo);k>=0&&n.value.splice(k,1)}}return{visiveisLocal:n,invisiveisLocal:l,emitFechar:f,emitSalvar:o,onDragStart:y,onDropItem:S,onDropLista:V}}}),Pa={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},Oa={class:"eli-tabela-modal-colunas__header"},Ia={class:"eli-tabela-modal-colunas__conteudo"},qa={class:"eli-tabela-modal-colunas__coluna"},Fa=["onDragstart","onDrop"],La={class:"eli-tabela-modal-colunas__item-texto"},za={class:"eli-tabela-modal-colunas__coluna"},ja=["onDragstart","onDrop"],Ha={class:"eli-tabela-modal-colunas__item-texto"},Ua={class:"eli-tabela-modal-colunas__footer"};function Ya(e,a,n,l,s,f){return e.aberto?(t.openBlock(),t.createElementBlock("div",{key:0,class:"eli-tabela-modal-colunas__overlay",role:"presentation",onClick:a[9]||(a[9]=t.withModifiers((...o)=>e.emitFechar&&e.emitFechar(...o),["self"]))},[t.createElementVNode("div",Pa,[t.createElementVNode("header",Oa,[a[10]||(a[10]=t.createElementVNode("h3",{class:"eli-tabela-modal-colunas__titulo"},"Colunas",-1)),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__fechar","aria-label":"Fechar",onClick:a[0]||(a[0]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," × ")]),t.createElementVNode("div",Ia,[t.createElementVNode("div",qa,[a[12]||(a[12]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Visíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[2]||(a[2]=t.withModifiers(()=>{},["prevent"])),onDrop:a[3]||(a[3]=o=>e.onDropLista(o,"visiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visiveisLocal,(o,r)=>(t.openBlock(),t.createElementBlock("div",{key:`vis-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"visiveis",r),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"visiveis",r)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",La,t.toDisplayString(o),1)],40,Fa))),128))],32)]),t.createElementVNode("div",za,[a[14]||(a[14]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Invisíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[5]||(a[5]=t.withModifiers(()=>{},["prevent"])),onDrop:a[6]||(a[6]=o=>e.onDropLista(o,"invisiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.invisiveisLocal,(o,r)=>(t.openBlock(),t.createElementBlock("div",{key:`inv-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"invisiveis",r),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"invisiveis",r)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",Ha,t.toDisplayString(o),1)],40,ja))),128))],32)])]),t.createElementVNode("footer",Ua,[t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--sec",onClick:a[7]||(a[7]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," Cancelar "),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--prim",onClick:a[8]||(a[8]=(...o)=>e.emitSalvar&&e.emitSalvar(...o))}," Salvar ")])])])):t.createCommentVNode("",!0)}const Ra=I(Ta,[["render",Ya],["__scopeId","data-v-b8f693ef"]]),Ja="eli:tabela";function Se(e){return`${Ja}:${e}:colunas`}function Ne(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,n=Array.isArray(a.visiveis)?a.visiveis.filter(s=>typeof s=="string"):[],l=Array.isArray(a.invisiveis)?a.invisiveis.filter(s=>typeof s=="string"):[];return{visiveis:n,invisiveis:l}}function we(e){try{const a=window.localStorage.getItem(Se(e));return a?Ne(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function Wa(e,a){try{window.localStorage.setItem(Se(e),JSON.stringify(Ne(a)))}catch{}}const Za=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ct,EliTabelaEstados:wt,EliTabelaDebug:Pt,EliTabelaHead:Yt,EliTabelaBody:$a,EliTabelaMenuAcoes:Ba,EliTabelaPaginacao:Aa,EliTabelaModalColunas:Ra},props:{tabela:{type:Object,required:!0}},setup(e){const n=t.ref(!1),l=t.ref(null),s=t.ref([]),f=t.ref(0),o=t.ref([]),r=t.ref(null),p=t.ref(null),i=t.ref({top:0,left:0}),m=t.ref(""),y=t.ref(1),S=t.ref(null),V=t.ref("asc"),_=t.computed(()=>e.tabela),$=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),v=t.computed(()=>e.tabela.acoesTabela??[]),g=t.computed(()=>v.value.length>0),k=t.ref(!1),W=t.ref(we(e.tabela.nome)),K=t.ref({}),G=t.computed(()=>e.tabela.colunas.map(b=>b.rotulo)),X=t.computed(()=>{var Z,Q;const b=e.tabela.colunas,A=(((Z=W.value.visiveis)==null?void 0:Z.length)??0)>0||(((Q=W.value.invisiveis)==null?void 0:Q.length)??0)>0?W.value.invisiveis??[]:b.filter(O=>O.visivel===!1).map(O=>O.rotulo),w=new Set(A),T=b.filter(O=>w.has(O.rotulo)),q=A,Y=new Map;for(const O of T)Y.has(O.rotulo)||Y.set(O.rotulo,O);const R=[];for(const O of q){const x=Y.get(O);x&&R.push(x)}for(const O of T)R.includes(O)||R.push(O);return R}),te=t.computed(()=>X.value.length>0),U=t.computed(()=>{var O,x;const b=e.tabela.colunas,D=G.value,A=(((O=W.value.visiveis)==null?void 0:O.length)??0)>0||(((x=W.value.invisiveis)==null?void 0:x.length)??0)>0,w=A?W.value.invisiveis??[]:e.tabela.colunas.filter(F=>F.visivel===!1).map(F=>F.rotulo),T=new Set(w),q=D.filter(F=>!T.has(F)),Y=new Set(q),R=A?W.value.visiveis??[]:[],Z=[];for(const F of R)Y.has(F)&&Z.push(F);for(const F of q)Z.includes(F)||Z.push(F);const Q=new Map;for(const F of b)Q.has(F.rotulo)||Q.set(F.rotulo,F);return Z.map(F=>Q.get(F)).filter(Boolean)});function oe(){k.value=!0}function H(){k.value=!1}function N(b){W.value=b,Wa(e.tabela.nome,b),k.value=!1,K.value={}}function ne(b){const D=!!K.value[b];K.value={...K.value,[b]:!D}}const re=t.computed(()=>{const b=e.tabela.registros_por_consulta;return typeof b=="number"&&b>0?Math.floor(b):10}),E=t.computed(()=>{const b=re.value;if(!b||b<=0)return 1;const D=f.value;return D?Math.max(1,Math.ceil(D/b)):1}),u=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let c=0;function h(b){var R,Z,Q,O,x,F;const D=b.getBoundingClientRect(),A=8,w=((Q=(Z=(R=p.value)==null?void 0:R.menuEl)==null?void 0:Z.value)==null?void 0:Q.offsetHeight)??0,T=((F=(x=(O=p.value)==null?void 0:O.menuEl)==null?void 0:x.value)==null?void 0:F.offsetWidth)??180;let q=D.bottom+A;const Y=D.right-T;w&&q+w>window.innerHeight-A&&(q=D.top-A-w),i.value={top:Math.max(A,Math.round(q)),left:Math.max(A,Math.round(Y))}}function d(b){var A,w;if(r.value===null)return;const D=b.target;(w=(A=p.value)==null?void 0:A.menuEl)!=null&&w.value&&p.value.menuEl.value.contains(D)||(r.value=null)}function C(b){if(b){if(S.value===b){V.value=V.value==="asc"?"desc":"asc",z();return}S.value=b,V.value="asc",y.value!==1?y.value=1:z()}}function B(b){m.value!==b&&(m.value=b,y.value!==1?y.value=1:z())}function M(b){const D=Math.min(Math.max(1,b),E.value);D!==y.value&&(y.value=D)}function P(b){const D=e.tabela.acoesLinha??[],A=o.value[b]??[];return D.map((w,T)=>{const q=w.exibir===void 0?!0:typeof w.exibir=="boolean"?w.exibir:!1;return{acao:w,indice:T,visivel:A[T]??q}}).filter(w=>w.visivel)}function L(b){return P(b).length>0}function J(b,D){if(!L(b))return;if(r.value===b){r.value=null;return}r.value=b;const A=(D==null?void 0:D.currentTarget)??null;A&&(h(A),requestAnimationFrame(()=>h(A)))}async function z(){var T,q;const b=++c;n.value=!0,l.value=null,o.value=[],r.value=null,K.value={};const D=Math.max(1,re.value),w={offSet:(y.value-1)*D,limit:D};m.value&&(w.texto_busca=m.value),S.value&&(w.coluna_ordem=S.value,w.direcao_ordem=V.value);try{const Y=e.tabela,R=await Y.consulta(w);if(b!==c)return;if(R.cod!==ye.sucesso){s.value=[],f.value=0,l.value=R.mensagem;return}const Z=((T=R.valor)==null?void 0:T.valores)??[],Q=((q=R.valor)==null?void 0:q.quantidade)??Z.length;s.value=Z,f.value=Q;const O=Math.max(1,Math.ceil((Q||0)/D));if(y.value>O){y.value=O;return}const x=Y.acoesLinha??[];if(!x.length){o.value=[];return}const F=Z.map(()=>x.map(ie=>ie.exibir===void 0?!0:typeof ie.exibir=="boolean"?ie.exibir:!1));o.value=F;const ho=await Promise.all(Z.map(async ie=>Promise.all(x.map(async ue=>{if(ue.exibir===void 0)return!0;if(typeof ue.exibir=="boolean")return ue.exibir;try{const go=ue.exibir(ie);return!!await Promise.resolve(go)}catch{return!1}}))));b===c&&(o.value=ho)}catch(Y){if(b!==c)return;s.value=[],f.value=0,l.value=Y instanceof Error?Y.message:"Erro ao carregar dados."}finally{b===c&&(n.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",d),z()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",d)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,b=>{!b&&m.value&&(m.value="",y.value!==1?y.value=1:z())}),t.watch(y,(b,D)=>{b!==D&&z()}),t.watch(()=>e.tabela,()=>{r.value=null,S.value=null,V.value="asc",m.value="",k.value=!1,W.value=we(e.tabela.nome),K.value={},y.value!==1?y.value=1:z()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{y.value!==1?y.value=1:z()}),t.watch(s,()=>{r.value=null,K.value={}}),{isDev:!1,tabela:_,carregando:n,erro:l,linhas:s,quantidade:f,menuAberto:r,valorBusca:m,paginaAtual:y,colunaOrdenacao:S,direcaoOrdenacao:V,totalPaginas:E,exibirBusca:$,acoesCabecalho:v,temAcoesCabecalho:g,temAcoes:u,colunasEfetivas:U,rotulosColunas:G,modalColunasAberto:k,configColunas:W,temColunasInvisiveis:te,colunasInvisiveisEfetivas:X,linhasExpandidas:K,abrirModalColunas:oe,fecharModalColunas:H,salvarModalColunas:N,alternarLinhaExpandida:ne,alternarOrdenacao:C,atualizarBusca:B,irParaPagina:M,acoesDisponiveisPorLinha:P,possuiAcoes:L,toggleMenu:J,menuPopup:p,menuPopupPos:i}}}),Ga={class:"eli-tabela"},Xa={class:"eli-tabela__table"};function Ka(e,a,n,l,s,f){const o=t.resolveComponent("EliTabelaDebug"),r=t.resolveComponent("EliTabelaEstados"),p=t.resolveComponent("EliTabelaCabecalho"),i=t.resolveComponent("EliTabelaModalColunas"),m=t.resolveComponent("EliTabelaHead"),y=t.resolveComponent("EliTabelaBody"),S=t.resolveComponent("EliTabelaMenuAcoes"),V=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ga,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(r,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(p,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca,onColunas:e.abrirModalColunas},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar","onColunas"])):t.createCommentVNode("",!0),t.createVNode(i,{aberto:e.modalColunasAberto,rotulosColunas:e.rotulosColunas,configInicial:e.configColunas,colunas:e.tabela.colunas,onFechar:e.fecharModalColunas,onSalvar:e.salvarModalColunas},null,8,["aberto","rotulosColunas","configInicial","colunas","onFechar","onSalvar"]),t.createElementVNode("table",Xa,[t.createVNode(m,{colunas:e.colunasEfetivas,temAcoes:e.temAcoes,temColunasInvisiveis:e.temColunasInvisiveis,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","temColunasInvisiveis","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(y,{colunas:e.colunasEfetivas,colunasInvisiveis:e.colunasInvisiveisEfetivas,temColunasInvisiveis:e.temColunasInvisiveis,linhasExpandidas:e.linhasExpandidas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu,alternarLinhaExpandida:e.alternarLinhaExpandida},null,8,["colunas","colunasInvisiveis","temColunasInvisiveis","linhasExpandidas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu","alternarLinhaExpandida"])]),t.createVNode(S,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:_,linha:$})=>{e.menuAberto=null,_.acao($)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(V,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const Me=I(Za,[["render",Ka]]);function Qa(e){if(!Number.isFinite(e)||e<=0||e>=1)return 0;const a=e.toString();if(a.includes("e-")){const[,s]=a.split("e-"),f=Number(s);return Number.isFinite(f)?f:0}const n=a.indexOf(".");return n===-1?0:a.slice(n+1).replace(/0+$/,"").length}function xa(e){const a=(e??"").trim().replace(/,/g,".");if(!a)return null;const n=Number(a);return Number.isNaN(n)?null:n}function be(e,a){return e==null?"":a===null?String(e):Number(e).toFixed(Math.max(0,a)).replace(/\./g,",")}function Ae(e){return(e??"").replace(/\D+/g,"")}function eo(e){const a=(e??"").replace(/[^0-9.,]+/g,""),n=a.match(/[.,]/);if(!n)return a;const l=n[0],s=a.indexOf(l),f=a.slice(0,s).replace(/[.,]/g,""),o=a.slice(s+1).replace(/[.,]/g,"");return`${f.length?f:"0"}${l}${o}`}function to(e,a){if(a===null)return e;if(a<=0)return e.replace(/[.,]/g,"");const n=e.match(/[.,]/);if(!n)return e;const l=n[0],s=e.indexOf(l),f=e.slice(0,s),o=e.slice(s+1);return`${f}${l}${o.slice(0,a)}`}function ao(e){const a=e.match(/^(\d+)[.,]$/);if(!a)return null;const n=Number(a[1]);return Number.isNaN(n)?null:n}const oo=t.defineComponent({name:"EliEntradaNumero",inheritAttrs:!1,props:{value:{type:[Number,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const l=t.computed(()=>{var m;const i=(m=e.opcoes)==null?void 0:m.precisao;return i==null?null:Qa(i)}),s=t.computed(()=>l.value===0),f=t.computed(()=>{const i=l.value;return i!==null&&i>0}),o=t.ref(""),r=t.ref(void 0);t.watch(()=>e.value,i=>{i!==r.value&&(o.value=be(i,l.value),r.value=i)},{immediate:!0});function p(i){if(f.value){const V=l.value??0,_=Ae(i),$=_?Number(_):0,v=Math.pow(10,V),g=_?$/v:null,k=g===null?null:g;r.value=k,n("update:value",k),n("input",k),n("change",k),o.value=be(k,V);return}const m=s.value?Ae(i):eo(i),y=s.value?m:to(m,l.value);let S=null;if(y){const _=(s.value?null:ao(y))??xa(y);S=_===null?null:_}r.value=S,n("update:value",S),n("input",S),n("change",S),o.value=be(S,l.value)}return{attrs:a,emit:n,displayValue:o,isInteiro:s,onUpdateModelValue:p}}}),no={class:"eli-entrada__prefixo"},lo={class:"eli-entrada__sufixo"};function ro(e,a,n,l,s,f){var o,r,p,i;return t.openBlock(),t.createBlock(me.VTextField,t.mergeProps({"model-value":e.displayValue,label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(r=e.opcoes)==null?void 0:r.placeholder,type:e.isInteiro?"number":"text",inputmode:e.isInteiro?"numeric":"decimal",pattern:e.isInteiro?"[0-9]*":"[0-9.,]*"},e.attrs,{"onUpdate:modelValue":e.onUpdateModelValue,onFocus:a[0]||(a[0]=()=>e.emit("focus")),onBlur:a[1]||(a[1]=()=>e.emit("blur"))}),t.createSlots({_:2},[(p=e.opcoes)!=null&&p.prefixo?{name:"prepend-inner",fn:t.withCtx(()=>[t.createElementVNode("span",no,t.toDisplayString(e.opcoes.prefixo),1)]),key:"0"}:void 0,(i=e.opcoes)!=null&&i.sufixo?{name:"append-inner",fn:t.withCtx(()=>[t.createElementVNode("span",lo,t.toDisplayString(e.opcoes.sufixo),1)]),key:"1"}:void 0]),1040,["model-value","label","placeholder","type","inputmode","pattern","onUpdate:modelValue"])}const Te=I(oo,[["render",ro],["__scopeId","data-v-77cbf216"]]);function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce={exports:{}},so=ce.exports,Pe;function co(){return Pe||(Pe=1,(function(e,a){(function(n,l){e.exports=l()})(so,(function(){var n=1e3,l=6e4,s=36e5,f="millisecond",o="second",r="minute",p="hour",i="day",m="week",y="month",S="quarter",V="year",_="date",$="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var u=["th","st","nd","rd"],c=E%100;return"["+E+(u[(c-20)%10]||u[c]||u[0])+"]"}},W=function(E,u,c){var h=String(E);return!h||h.length>=u?E:""+Array(u+1-h.length).join(c)+E},K={s:W,z:function(E){var u=-E.utcOffset(),c=Math.abs(u),h=Math.floor(c/60),d=c%60;return(u<=0?"+":"-")+W(h,2,"0")+":"+W(d,2,"0")},m:function E(u,c){if(u.date()1)return E(B[0])}else{var M=u.name;X[M]=u,d=M}return!h&&d&&(G=d),d||!h&&G},H=function(E,u){if(U(E))return E.clone();var c=typeof u=="object"?u:{};return c.date=E,c.args=arguments,new ne(c)},N=K;N.l=oe,N.i=U,N.w=function(E,u){return H(E,{locale:u.$L,utc:u.$u,x:u.$x,$offset:u.$offset})};var ne=(function(){function E(c){this.$L=oe(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[te]=!0}var u=E.prototype;return u.parse=function(c){this.$d=(function(h){var d=h.date,C=h.utc;if(d===null)return new Date(NaN);if(N.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var B=d.match(v);if(B){var M=B[2]-1||0,P=(B[7]||"0").substring(0,3);return C?new Date(Date.UTC(B[1],M,B[3]||1,B[4]||0,B[5]||0,B[6]||0,P)):new Date(B[1],M,B[3]||1,B[4]||0,B[5]||0,B[6]||0,P)}}return new Date(d)})(c),this.init()},u.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},u.$utils=function(){return N},u.isValid=function(){return this.$d.toString()!==$},u.isSame=function(c,h){var d=H(c);return this.startOf(h)<=d&&d<=this.endOf(h)},u.isAfter=function(c,h){return H(c)!0,input:e=>!0,change:e=>!0,"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0,focus:()=>!0,blur:()=>!0},setup(e,{emit:a,attrs:n}){const l=t.computed(()=>e.opcoes?e.opcoes:{rotulo:e.rotulo??"Data e hora",placeholder:e.placeholder??"",modo:e.modo??"dataHora",limpavel:e.limpavel,erro:e.erro,mensagensErro:e.mensagensErro,dica:e.dica,dicaPersistente:e.dicaPersistente,densidade:e.densidade,variante:e.variante,min:e.min,max:e.max}),s=t.computed(()=>l.value.modo??"dataHora"),f=t.computed(()=>!!e.desabilitado),o=t.computed(()=>s.value==="data"?"date":"datetime-local");function r($){return s.value==="data"?de($).format("YYYY-MM-DD"):de($).format("YYYY-MM-DDTHH:mm")}function p($){return s.value==="data"?de(`${$}T00:00`).format():de($).format()}const i=t.computed(()=>e.value!==void 0?e.value??null:e.modelValue),m=t.computed({get:()=>i.value?r(i.value):"",set:$=>{const v=$&&$.length>0?$:null;if(!v){a("update:value",null),a("input",null),a("change",null),a("update:modelValue",null),a("alterar",null);return}const g=p(v);a("update:value",g),a("input",g),a("change",g),a("update:modelValue",g),a("alterar",g)}}),y=t.computed(()=>{const $=l.value.min;if($)return r($)}),S=t.computed(()=>{const $=l.value.max;if($)return r($)});function V(){a("foco"),a("focus")}function _(){a("desfoco"),a("blur")}return{attrs:n,valor:m,tipoInput:o,minLocal:y,maxLocal:S,opcoesEfetivas:l,desabilitadoEfetivo:f,emitCompatFocus:V,emitCompatBlur:_}}}),po={class:"eli-data-hora"};function fo(e,a,n,l,s,f){return t.openBlock(),t.createElementBlock("div",po,[t.createVNode(me.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.opcoesEfetivas.rotulo,placeholder:e.opcoesEfetivas.placeholder,disabled:e.desabilitadoEfetivo,clearable:!!e.opcoesEfetivas.limpavel,error:!!e.opcoesEfetivas.erro,"error-messages":e.opcoesEfetivas.mensagensErro,hint:e.opcoesEfetivas.dica,"persistent-hint":!!e.opcoesEfetivas.dicaPersistente,density:e.opcoesEfetivas.densidade??"comfortable",variant:e.opcoesEfetivas.variante??"outlined",min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:e.emitCompatFocus,onBlur:e.emitCompatBlur}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max","onFocus","onBlur"])])}const Oe=I(mo,[["render",fo],["__scopeId","data-v-1bfd1be8"]]),bo={install(e){e.component("EliOlaMundo",ge),e.component("EliBotao",pe),e.component("EliBadge",se),e.component("EliCartao",$e),e.component("EliTabela",Me),e.component("EliEntradaTexto",fe),e.component("EliEntradaNumero",Te),e.component("EliEntradaDataHora",Oe)}};j.EliBadge=se,j.EliBotao=pe,j.EliCartao=$e,j.EliEntradaDataHora=Oe,j.EliEntradaNumero=Te,j.EliEntradaTexto=fe,j.EliOlaMundo=ge,j.EliTabela=Me,j.default=bo,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/componentes/EliEntrada/EliEntradaDataHora.vue.d.ts b/dist/types/componentes/EliEntrada/EliEntradaDataHora.vue.d.ts index 6ce886d..06e4399 100644 --- a/dist/types/componentes/EliEntrada/EliEntradaDataHora.vue.d.ts +++ b/dist/types/componentes/EliEntrada/EliEntradaDataHora.vue.d.ts @@ -186,30 +186,27 @@ declare const __VLS_export: import("vue").DefineComponent> & Readonly<{ - "onUpdate:modelValue"?: ((_v: string | null) => any) | undefined; + "onUpdate:value"?: ((_v: string | null) => any) | undefined; + onInput?: ((_v: string | null) => any) | undefined; onChange?: ((_v: string | null) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: string | null) => any) | undefined; onAlterar?: ((_v: string | null) => any) | undefined; - "onUpdate:value"?: ((_v: string | null) => any) | undefined; + "onUpdate:modelValue"?: ((_v: string | null) => any) | undefined; onFoco?: (() => any) | undefined; onDesfoco?: (() => any) | undefined; }>, { - placeholder: string; - modelValue: string | null; - value: string | null | undefined; - max: string | undefined; - min: string | undefined; - erro: boolean; - rotulo: string; modo: "data" | "dataHora" | undefined; limpavel: boolean; + erro: boolean; mensagensErro: string | string[]; dica: string; dicaPersistente: boolean; + min: string | undefined; + max: string | undefined; densidade: CampoDensidade; variante: CampoVariante; + value: string | null | undefined; opcoes: { rotulo: string; placeholder?: string; @@ -225,6 +222,9 @@ declare const __VLS_export: import("vue").DefineComponent; declare const _default: typeof __VLS_export; diff --git a/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts b/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts index c611096..c59ef14 100644 --- a/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts +++ b/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts @@ -15,7 +15,7 @@ declare const __VLS_export: import("vue").DefineComponent void) & ((event: "focus") => void) & ((event: "blur") => void) & ((event: "input", _v: number | null | undefined) => void) & ((event: "update:value", _v: number | null | undefined) => void); + emit: ((event: "update:value", _v: number | null | undefined) => void) & ((event: "input", _v: number | null | undefined) => void) & ((event: "change", _v: number | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void); displayValue: import("vue").Ref; isInteiro: import("vue").ComputedRef; onUpdateModelValue: (texto: string) => void; @@ -37,11 +37,11 @@ declare const __VLS_export: import("vue").DefineComponent> & Readonly<{ + "onUpdate:value"?: ((_v: number | null | undefined) => any) | undefined; + onInput?: ((_v: number | null | undefined) => any) | undefined; onChange?: ((_v: number | null | undefined) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: number | null | undefined) => any) | undefined; - "onUpdate:value"?: ((_v: number | null | undefined) => any) | undefined; }>, { value: number | null | undefined; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; diff --git a/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts b/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts index 1ee2e87..ee69f8d 100644 --- a/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts +++ b/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts @@ -15,8 +15,11 @@ declare const __VLS_export: import("vue").DefineComponent void) & ((event: "focus") => void) & ((event: "blur") => void) & ((event: "input", _v: string | null | undefined) => void) & ((event: "update:value", _v: string | null | undefined) => void); + emit: ((event: "update:value", _v: string | null | undefined) => void) & ((event: "input", _v: string | null | undefined) => void) & ((event: "change", _v: string | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void); localValue: import("vue").WritableComputedRef; + inputHtmlType: import("vue").ComputedRef<"text" | "email" | "url">; + inputMode: import("vue").ComputedRef; + onInput: (e: Event) => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { "update:value": (_v: EntradaTexto["value"]) => true; /** Compat Vue2 (v-model padrão: value + input) */ @@ -35,11 +38,11 @@ declare const __VLS_export: import("vue").DefineComponent> & Readonly<{ + "onUpdate:value"?: ((_v: string | null | undefined) => any) | undefined; + onInput?: ((_v: string | null | undefined) => any) | undefined; onChange?: ((_v: string | null | undefined) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: string | null | undefined) => any) | undefined; - "onUpdate:value"?: ((_v: string | null | undefined) => any) | undefined; }>, { value: string | null | undefined; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; diff --git a/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts b/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts index f2ae029..37a7d7b 100644 --- a/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts +++ b/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts @@ -10,6 +10,7 @@ export declare const registryTabelaCelulas: { placeholder?: string; } & { limiteCaracteres?: number; + formato?: "texto" | "email" | "url" | "telefone" | "cpfCnpj" | "cep"; }>; required: true; }; @@ -17,8 +18,11 @@ export declare const registryTabelaCelulas: { attrs: { [x: string]: unknown; }; - emit: ((event: "change", _v: string | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void) & ((event: "input", _v: string | null | undefined) => void) & ((event: "update:value", _v: string | null | undefined) => void); + emit: ((event: "update:value", _v: string | null | undefined) => void) & ((event: "input", _v: string | null | undefined) => void) & ((event: "change", _v: string | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void); localValue: import("vue").WritableComputedRef; + inputHtmlType: import("vue").ComputedRef<"text" | "email" | "url">; + inputMode: import("vue").ComputedRef; + onInput: (e: Event) => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { "update:value": (_v: string | null | undefined) => true; input: (_v: string | null | undefined) => true; @@ -36,15 +40,16 @@ export declare const registryTabelaCelulas: { placeholder?: string; } & { limiteCaracteres?: number; + formato?: "texto" | "email" | "url" | "telefone" | "cpfCnpj" | "cep"; }>; required: true; }; }>> & Readonly<{ + "onUpdate:value"?: ((_v: string | null | undefined) => any) | undefined; + onInput?: ((_v: string | null | undefined) => any) | undefined; onChange?: ((_v: string | null | undefined) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: string | null | undefined) => any) | undefined; - "onUpdate:value"?: ((_v: string | null | undefined) => any) | undefined; }>, { value: string | null | undefined; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; @@ -68,7 +73,7 @@ export declare const registryTabelaCelulas: { attrs: { [x: string]: unknown; }; - emit: ((event: "change", _v: number | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void) & ((event: "input", _v: number | null | undefined) => void) & ((event: "update:value", _v: number | null | undefined) => void); + emit: ((event: "update:value", _v: number | null | undefined) => void) & ((event: "input", _v: number | null | undefined) => void) & ((event: "change", _v: number | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void); displayValue: import("vue").Ref; isInteiro: import("vue").ComputedRef; onUpdateModelValue: (texto: string) => void; @@ -95,11 +100,11 @@ export declare const registryTabelaCelulas: { required: true; }; }>> & Readonly<{ + "onUpdate:value"?: ((_v: number | null | undefined) => any) | undefined; + onInput?: ((_v: number | null | undefined) => any) | undefined; onChange?: ((_v: number | null | undefined) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: number | null | undefined) => any) | undefined; - "onUpdate:value"?: ((_v: number | null | undefined) => any) | undefined; }>, { value: number | null | undefined; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; @@ -121,8 +126,8 @@ export declare const registryTabelaCelulas: { dicaPersistente?: boolean; min?: string; max?: string; - densidade?: import("../../tipos/campo.js").CampoDensidade; - variante?: import("../../tipos/campo.js").CampoVariante; + densidade?: import("../../tipos/entrada.js").CampoDensidade; + variante?: import("../../tipos/entrada.js").CampoVariante; }>; required: false; default: undefined; @@ -168,11 +173,11 @@ export declare const registryTabelaCelulas: { default: undefined; }; densidade: { - type: import("vue").PropType; + type: import("vue").PropType; default: undefined; }; variante: { - type: import("vue").PropType; + type: import("vue").PropType; default: undefined; }; min: { @@ -203,8 +208,8 @@ export declare const registryTabelaCelulas: { dicaPersistente?: boolean; min?: string; max?: string; - densidade?: import("../../tipos/campo.js").CampoDensidade; - variante?: import("../../tipos/campo.js").CampoVariante; + densidade?: import("../../tipos/entrada.js").CampoDensidade; + variante?: import("../../tipos/entrada.js").CampoVariante; }>; desabilitadoEfetivo: import("vue").ComputedRef; emitCompatFocus: () => void; @@ -237,8 +242,8 @@ export declare const registryTabelaCelulas: { dicaPersistente?: boolean; min?: string; max?: string; - densidade?: import("../../tipos/campo.js").CampoDensidade; - variante?: import("../../tipos/campo.js").CampoVariante; + densidade?: import("../../tipos/entrada.js").CampoDensidade; + variante?: import("../../tipos/entrada.js").CampoVariante; }>; required: false; default: undefined; @@ -284,11 +289,11 @@ export declare const registryTabelaCelulas: { default: undefined; }; densidade: { - type: import("vue").PropType; + type: import("vue").PropType; default: undefined; }; variante: { - type: import("vue").PropType; + type: import("vue").PropType; default: undefined; }; min: { @@ -300,30 +305,27 @@ export declare const registryTabelaCelulas: { default: undefined; }; }>> & Readonly<{ - "onUpdate:modelValue"?: ((_v: string | null) => any) | undefined; + "onUpdate:value"?: ((_v: string | null) => any) | undefined; + onInput?: ((_v: string | null) => any) | undefined; onChange?: ((_v: string | null) => any) | undefined; onFocus?: (() => any) | undefined; onBlur?: (() => any) | undefined; - onInput?: ((_v: string | null) => any) | undefined; onAlterar?: ((_v: string | null) => any) | undefined; - "onUpdate:value"?: ((_v: string | null) => any) | undefined; + "onUpdate:modelValue"?: ((_v: string | null) => any) | undefined; onFoco?: (() => any) | undefined; onDesfoco?: (() => any) | undefined; }>, { - placeholder: string; - modelValue: string | null; - value: string | null | undefined; - max: string | undefined; - min: string | undefined; - erro: boolean; - rotulo: string; modo: "data" | "dataHora" | undefined; limpavel: boolean; + erro: boolean; mensagensErro: string | string[]; dica: string; dicaPersistente: boolean; - densidade: import("../../tipos/campo.js").CampoDensidade; - variante: import("../../tipos/campo.js").CampoVariante; + min: string | undefined; + max: string | undefined; + densidade: import("../../tipos/entrada.js").CampoDensidade; + variante: import("../../tipos/entrada.js").CampoVariante; + value: string | null | undefined; opcoes: { rotulo: string; placeholder?: string; @@ -336,9 +338,12 @@ export declare const registryTabelaCelulas: { dicaPersistente?: boolean; min?: string; max?: string; - densidade?: import("../../tipos/campo.js").CampoDensidade; - variante?: import("../../tipos/campo.js").CampoVariante; + densidade?: import("../../tipos/entrada.js").CampoDensidade; + variante?: import("../../tipos/entrada.js").CampoVariante; }; + placeholder: string; + rotulo: string; + modelValue: string | null; desabilitado: boolean; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }; diff --git a/dist/types/componentes/EliEntrada/tiposEntradas.d.ts b/dist/types/componentes/EliEntrada/tiposEntradas.d.ts index 4bc9ff7..4bd5654 100644 --- a/dist/types/componentes/EliEntrada/tiposEntradas.d.ts +++ b/dist/types/componentes/EliEntrada/tiposEntradas.d.ts @@ -41,6 +41,11 @@ export type PadroesEntradas = { texto: tipoPadraoEntrada; numero: tipoPadraoEntrada; - default: string; - }; - type: { - type: PropType; - default: string; - }; - label: StringConstructor; - placeholder: StringConstructor; - disabled: BooleanConstructor; - error: BooleanConstructor; - errorMessages: { - type: PropType; - default: () => never[]; - }; - hint: StringConstructor; - persistentHint: BooleanConstructor; - rows: { - type: NumberConstructor; - default: number; - }; - /** - * Para select/radio/checkbox. - * Aceita lista já normalizada ({ label, value }) ou valores primitivos. - */ - options: { - type: PropType>; - default: () => never[]; - }; - clearable: BooleanConstructor; - variant: { - type: PropType; - default: string; - }; - density: { - type: PropType; - default: string; - }; - color: { - type: StringConstructor; - default: string; - }; - row: BooleanConstructor; - showPasswordToggle: BooleanConstructor; - multiple: BooleanConstructor; - chips: BooleanConstructor; -}>, { - attrs: { - [x: string]: unknown; - }; - value: import("vue").WritableComputedRef; - isTextLike: import("vue").ComputedRef; - inputHtmlType: import("vue").ComputedRef<"text" | "password">; - inputMode: import("vue").ComputedRef<"tel" | "decimal" | "numeric" | undefined>; - internalColor: import("vue").ComputedRef; - showPassword: import("vue").Ref; - togglePassword: () => void; - onInput: (e: Event) => void; - onFocus: () => void; - onBlur: () => void; - computedItems: import("vue").ComputedRef; -}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "focus" | "blur")[], "update:modelValue" | "change" | "focus" | "blur", import("vue").PublicProps, Readonly; - default: string; - }; - type: { - type: PropType; - default: string; - }; - label: StringConstructor; - placeholder: StringConstructor; - disabled: BooleanConstructor; - error: BooleanConstructor; - errorMessages: { - type: PropType; - default: () => never[]; - }; - hint: StringConstructor; - persistentHint: BooleanConstructor; - rows: { - type: NumberConstructor; - default: number; - }; - /** - * Para select/radio/checkbox. - * Aceita lista já normalizada ({ label, value }) ou valores primitivos. - */ - options: { - type: PropType>; - default: () => never[]; - }; - clearable: BooleanConstructor; - variant: { - type: PropType; - default: string; - }; - density: { - type: PropType; - default: string; - }; - color: { - type: StringConstructor; - default: string; - }; - row: BooleanConstructor; - showPasswordToggle: BooleanConstructor; - multiple: BooleanConstructor; - chips: BooleanConstructor; -}>> & Readonly<{ - "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; - onChange?: ((...args: any[]) => any) | undefined; - onFocus?: ((...args: any[]) => any) | undefined; - onBlur?: ((...args: any[]) => any) | undefined; -}>, { - color: string; - type: CampoTipo; - variant: CampoVariante; - disabled: boolean; - error: boolean; - persistentHint: boolean; - clearable: boolean; - row: boolean; - showPasswordToggle: boolean; - multiple: boolean; - chips: boolean; - modelValue: CampoValor | CampoValorMultiplo; - errorMessages: string | string[]; - rows: number; - options: CampoOpcaoBruta[]; - density: CampoDensidade; -}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; -declare const _default: typeof __VLS_export; -export default _default; diff --git a/dist/types/componentes/campo/index.d.ts b/dist/types/componentes/campo/index.d.ts deleted file mode 100644 index 890a77a..0000000 --- a/dist/types/componentes/campo/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as EliInput } from "./EliInput.vue"; diff --git a/dist/types/componentes/campo/utils/cep.d.ts b/dist/types/componentes/campo/utils/cep.d.ts deleted file mode 100644 index e0e9732..0000000 --- a/dist/types/componentes/campo/utils/cep.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function formatarCep(v: string): string; diff --git a/dist/types/componentes/campo/utils/numerico.d.ts b/dist/types/componentes/campo/utils/numerico.d.ts deleted file mode 100644 index 34762f0..0000000 --- a/dist/types/componentes/campo/utils/numerico.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare function somenteNumeros(valor: string): string; -export declare function formatarDecimal(valor: string): string; -/** - * Formatação para percentual: - * - remove '%' caso venha junto (ex: colar "10%") - * - mantém apenas dígitos e vírgula (no máximo uma) - */ -export declare function formatarPorcentagem(valor: string): string; -export declare function formatarMoeda(valor: string): string; diff --git a/dist/types/componentes/cartao/EliCartao.vue.d.ts b/dist/types/componentes/cartao/EliCartao.vue.d.ts index d0a82c1..dad2251 100644 --- a/dist/types/componentes/cartao/EliCartao.vue.d.ts +++ b/dist/types/componentes/cartao/EliCartao.vue.d.ts @@ -22,7 +22,7 @@ declare const __VLS_export: import("vue").DefineComponent, { rotuloStatus: import("vue").ComputedRef; - corStatus: import("vue").ComputedRef<"primary" | "error" | "secondary" | "success">; + corStatus: import("vue").ComputedRef<"primary" | "secondary" | "success" | "error">; classeStatus: import("vue").ComputedRef; onClick: () => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { diff --git a/dist/types/componentes/data_hora/index.d.ts b/dist/types/componentes/data_hora/index.d.ts deleted file mode 100644 index aa5dde0..0000000 --- a/dist/types/componentes/data_hora/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as EliEntradaDataHora } from "../EliEntrada/EliEntradaDataHora.vue"; diff --git a/dist/types/componentes/ola_mundo/EliOlaMundo.vue.d.ts b/dist/types/componentes/ola_mundo/EliOlaMundo.vue.d.ts index bf4a466..4b0d59a 100644 --- a/dist/types/componentes/ola_mundo/EliOlaMundo.vue.d.ts +++ b/dist/types/componentes/ola_mundo/EliOlaMundo.vue.d.ts @@ -1,18 +1,9 @@ -type Habilidade = "vue" | "react"; declare const __VLS_export: import("vue").DefineComponent<{}, { nome: import("vue").Ref; email: import("vue").Ref; documento: import("vue").Ref; - estado: import("vue").Ref; telefone: import("vue").Ref; - mensagem: import("vue").Ref; - senha: import("vue").Ref; - cor: import("vue").Ref<"azul" | "verde" | null, "azul" | "verde" | null>; - habilidades: import("vue").Ref; - idade: import("vue").Ref; - altura: import("vue").Ref; cep: import("vue").Ref; - valor: import("vue").Ref; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, { EliBotao: import("vue").DefineComponent; - EliInput: import("vue").DefineComponent; - default: string; + EliEntradaTexto: import("vue").DefineComponent; + default: undefined; }; - type: { - type: import("vue").PropType; - default: string; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + limiteCaracteres?: number; + formato?: "texto" | "email" | "url" | "telefone" | "cpfCnpj" | "cep"; + }>; + required: true; }; - label: StringConstructor; - placeholder: StringConstructor; - disabled: BooleanConstructor; - error: BooleanConstructor; - errorMessages: { - type: import("vue").PropType; - default: () => never[]; - }; - hint: StringConstructor; - persistentHint: BooleanConstructor; - rows: { - type: NumberConstructor; - default: number; - }; - options: { - type: import("vue").PropType>; - default: () => never[]; - }; - clearable: BooleanConstructor; - variant: { - type: import("vue").PropType; - default: string; - }; - density: { - type: import("vue").PropType; - default: string; - }; - color: { - type: StringConstructor; - default: string; - }; - row: BooleanConstructor; - showPasswordToggle: BooleanConstructor; - multiple: BooleanConstructor; - chips: BooleanConstructor; }>, { attrs: { [x: string]: unknown; }; - value: import("vue").WritableComputedRef; - isTextLike: import("vue").ComputedRef; - inputHtmlType: import("vue").ComputedRef<"text" | "password">; - inputMode: import("vue").ComputedRef<"tel" | "decimal" | "numeric" | undefined>; - internalColor: import("vue").ComputedRef; - showPassword: import("vue").Ref; - togglePassword: () => void; + emit: ((event: "update:value", _v: string | null | undefined) => void) & ((event: "input", _v: string | null | undefined) => void) & ((event: "change", _v: string | null | undefined) => void) & ((event: "focus") => void) & ((event: "blur") => void); + localValue: import("vue").WritableComputedRef; + inputHtmlType: import("vue").ComputedRef<"text" | "email" | "url">; + inputMode: import("vue").ComputedRef; onInput: (e: Event) => void; - onFocus: () => void; - onBlur: () => void; - computedItems: import("vue").ComputedRef; - }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "focus" | "blur")[], "update:modelValue" | "change" | "focus" | "blur", import("vue").PublicProps, Readonly; - default: string; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + "update:value": (_v: string | null | undefined) => true; + input: (_v: string | null | undefined) => true; + change: (_v: string | null | undefined) => true; + focus: () => true; + blur: () => true; + }, string, import("vue").PublicProps, Readonly; + default: undefined; }; - type: { - type: import("vue").PropType; - default: string; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + limiteCaracteres?: number; + formato?: "texto" | "email" | "url" | "telefone" | "cpfCnpj" | "cep"; + }>; + required: true; }; - label: StringConstructor; - placeholder: StringConstructor; - disabled: BooleanConstructor; - error: BooleanConstructor; - errorMessages: { - type: import("vue").PropType; - default: () => never[]; - }; - hint: StringConstructor; - persistentHint: BooleanConstructor; - rows: { - type: NumberConstructor; - default: number; - }; - options: { - type: import("vue").PropType>; - default: () => never[]; - }; - clearable: BooleanConstructor; - variant: { - type: import("vue").PropType; - default: string; - }; - density: { - type: import("vue").PropType; - default: string; - }; - color: { - type: StringConstructor; - default: string; - }; - row: BooleanConstructor; - showPasswordToggle: BooleanConstructor; - multiple: BooleanConstructor; - chips: BooleanConstructor; }>> & Readonly<{ - "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined; - onChange?: ((...args: any[]) => any) | undefined; - onFocus?: ((...args: any[]) => any) | undefined; - onBlur?: ((...args: any[]) => any) | undefined; + "onUpdate:value"?: ((_v: string | null | undefined) => any) | undefined; + onInput?: ((_v: string | null | undefined) => any) | undefined; + onChange?: ((_v: string | null | undefined) => any) | undefined; + onFocus?: (() => any) | undefined; + onBlur?: (() => any) | undefined; }>, { - color: string; - type: import("../../tipos/campo.js").CampoTipo; - variant: import("../../tipos/campo.js").CampoVariante; - disabled: boolean; - error: boolean; - persistentHint: boolean; - clearable: boolean; - row: boolean; - showPasswordToggle: boolean; - multiple: boolean; - chips: boolean; - modelValue: import("../../tipos/campo.js").CampoValor | import("../../tipos/campo.js").CampoValorMultiplo; - errorMessages: string | string[]; - rows: number; - options: import("../../tipos/campo.js").CampoOpcaoBruta[]; - density: import("../../tipos/campo.js").CampoDensidade; + value: string | null | undefined; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: typeof __VLS_export; diff --git a/dist/types/index.d.ts b/dist/types/index.d.ts index 362f068..1b245ef 100644 --- a/dist/types/index.d.ts +++ b/dist/types/index.d.ts @@ -3,14 +3,12 @@ import "./styles/eli-vue-fonts.css"; import { EliOlaMundo } from "./componentes/ola_mundo"; import { EliBotao } from "./componentes/botao"; import { EliBadge } from "./componentes/indicador"; -import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliTabela } from "./componentes/EliTabela"; import { EliEntradaTexto, EliEntradaNumero, EliEntradaDataHora } from "./componentes/EliEntrada"; export { EliOlaMundo }; export { EliBotao }; export { EliBadge }; -export { EliInput }; export { EliCartao }; export { EliTabela }; export { EliEntradaTexto, EliEntradaNumero, EliEntradaDataHora }; diff --git a/dist/types/tipos/campo.d.ts b/dist/types/tipos/campo.d.ts deleted file mode 100644 index 6f2ff8a..0000000 --- a/dist/types/tipos/campo.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Tipos do componente EliInput (campo). - */ -export type CampoValor = string | number | boolean | null; -export type CampoValorMultiplo = CampoValor[]; -export type CampoOpcao = { - label: string; - value: TValor; - disabled?: boolean; -}; -export type CampoOpcaoBruta = TValor | { - label?: string; - value: TValor; - disabled?: boolean; -}; -export type CampoVariante = "outlined" | "filled" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined"; -export type CampoDensidade = "default" | "comfortable" | "compact"; -export type CampoTipoNumerico = "numericoInteiro" | "numericoDecimal" | "numericoMoeda" | "porcentagem"; -export type CampoTipo = "text" | "password" | "email" | "search" | "url" | "textarea" | "radio" | "checkbox" | "telefone" | "cpfCnpj" | "cep" | "select" | CampoTipoNumerico; diff --git a/dist/types/tipos/entrada.d.ts b/dist/types/tipos/entrada.d.ts new file mode 100644 index 0000000..e2685e1 --- /dev/null +++ b/dist/types/tipos/entrada.d.ts @@ -0,0 +1,9 @@ +/** + * Tipos compartilhados para componentes de entrada (EliEntrada*). + * + * OBS: Estes tipos existiam anteriormente em `tipos/campo.ts` junto do componente + * `EliInput`. Como o `EliInput` foi removido, mantemos aqui apenas o que ainda + * é relevante para padronização visual/props do Vuetify. + */ +export type CampoVariante = "outlined" | "filled" | "plain" | "solo" | "solo-filled" | "solo-inverted" | "underlined"; +export type CampoDensidade = "default" | "comfortable" | "compact"; diff --git a/dist/types/tipos/index.d.ts b/dist/types/tipos/index.d.ts index 36c849e..759056b 100644 --- a/dist/types/tipos/index.d.ts +++ b/dist/types/tipos/index.d.ts @@ -1,4 +1,4 @@ export * from "./botao"; export * from "./cartao"; -export * from "./campo"; +export * from "./entrada"; export * from "./indicador"; diff --git a/package.json b/package.json index 8ea93a6..7a67ee1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.60", + "version": "0.1.62", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/componentes/EliEntrada/EliEntradaTexto.vue b/src/componentes/EliEntrada/EliEntradaTexto.vue index 5e95854..9235593 100644 --- a/src/componentes/EliEntrada/EliEntradaTexto.vue +++ b/src/componentes/EliEntrada/EliEntradaTexto.vue @@ -1,6 +1,8 @@ diff --git a/src/componentes/EliEntrada/tiposEntradas.ts b/src/componentes/EliEntrada/tiposEntradas.ts index 66abe9e..647f724 100644 --- a/src/componentes/EliEntrada/tiposEntradas.ts +++ b/src/componentes/EliEntrada/tiposEntradas.ts @@ -47,18 +47,24 @@ export type PadroesEntradas = { { /** Limite máximo de caracteres permitidos (se definido) */ limiteCaracteres?: number + + /** + * Formato/máscara aplicada ao texto. + * Obs: o `value` SEMPRE será o texto formatado (o que aparece no input). + */ + formato?: "texto" | "email" | "url" | "telefone" | "cpfCnpj" | "cep" } > numero: tipoPadraoEntrada< number | null | undefined, { - - /** Unidade de medida (ex.: "kg", "m³") */ + + /** Unidade de medida (ex.: "kg", "m³") */ sufixo?: string - /** Moéda (ex.: "R$") */ + /** Moéda (ex.: "R$") */ prefixo?: string /** diff --git a/src/componentes/EliEntrada/utils/cep.ts b/src/componentes/EliEntrada/utils/cep.ts new file mode 100644 index 0000000..9eb4cb6 --- /dev/null +++ b/src/componentes/EliEntrada/utils/cep.ts @@ -0,0 +1,10 @@ +function somenteNumeros(valor: string) { + return valor.replace(/\D+/g, ""); +} + +/** Formata CEP no padrão 00000-000 */ +export function formatarCep(valor: string) { + const digitos = somenteNumeros(valor); + if (!digitos) return ""; + return digitos.replace(/^(\d{5})(\d)/, "$1-$2").slice(0, 9); +} diff --git a/src/componentes/campo/utils/cpfCnpj.ts b/src/componentes/EliEntrada/utils/cpfCnpj.ts similarity index 100% rename from src/componentes/campo/utils/cpfCnpj.ts rename to src/componentes/EliEntrada/utils/cpfCnpj.ts diff --git a/src/componentes/campo/utils/telefone.ts b/src/componentes/EliEntrada/utils/telefone.ts similarity index 96% rename from src/componentes/campo/utils/telefone.ts rename to src/componentes/EliEntrada/utils/telefone.ts index 66fbd46..dcd7d04 100644 --- a/src/componentes/campo/utils/telefone.ts +++ b/src/componentes/EliEntrada/utils/telefone.ts @@ -1,5 +1,3 @@ -// utils/telefone.ts - /** * Remove tudo que não é número */ diff --git a/src/componentes/campo/EliInput.vue b/src/componentes/campo/EliInput.vue deleted file mode 100644 index 59ca01f..0000000 --- a/src/componentes/campo/EliInput.vue +++ /dev/null @@ -1,304 +0,0 @@ - - - - - diff --git a/src/componentes/campo/README.md b/src/componentes/campo/README.md deleted file mode 100644 index 6acd0a3..0000000 --- a/src/componentes/campo/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# EliInput - -**Componente base de input do design system** - -O EliInput unifica vários tipos de campo (v-text-field, v-textarea, v-select, v-radio-group, v-checkbox) em uma única API consistente. Ele encapsula comportamentos, máscaras e regras comuns (CPF/CNPJ, telefone, CEP, numéricos, formatação de moeda etc.) para manter coerência visual e de lógica em toda a aplicação. - -> ⚠️ Nunca use os componentes Vuetify diretamente fora do design system para esses casos. -> Utilize sempre EliInput para garantir formatação, tipagem e repasse de atributos padronizados. - ---- - -## Visão geral - -EliInput foi projetado para: - -* Centralizar formatação (máscaras) para tipos de entrada comuns (telefone, CPF/CNPJ, CEP, numéricos). -* Fornecer uma API única (type) que representa diferentes controles (text, textarea, select, radio, checkbox, etc.). -* Repassar atributos/props do pai para o componente Vuetify interno (v-bind="$attrs") mantendo inheritAttrs: false. -* Emitir eventos padronizados: update:modelValue, change, focus, blur. - ---- - -## Principais decisões de implementação - -* inheritAttrs: false — o componente controla explicitamente para onde os atributos são passados (v-bind="attrs" no elemento interno). -* Uso de um computed value que faz emit("update:modelValue", v) e emit("change", v) — assim qualquer v-model no pai funciona como esperado. -* Normalização de props.options para aceitar objetos { label, value, disabled } ou primitivos ('A', 1). -* Separação clara entre lógica de formatação (aplicada em onInput) e componentes que não devem ser formatados (ex.: v-select). - ---- - -## Tipagem (TypeScript) - -```ts -type ValorCampo = string | number | boolean | null; -type Option = { label: string; value: ValorCampo; disabled?: boolean }; - -type InputVariant = 'outlined' | 'filled' | 'plain' | 'solo' | 'solo-filled' | 'solo-inverted' | 'underlined'; -type Density = 'default' | 'comfortable' | 'compact'; -type TipoNumerico = 'numericoInteiro' | 'numericoDecimal' | 'numericoMoeda' | 'porcentagem'; - -type InputType = - | 'text' | 'password' | 'email' | 'search' | 'url' | 'textarea' - | 'radio' | 'checkbox' | 'telefone' | 'cpfCnpj' | 'cep' | 'select' - | TipoNumerico; -``` - ---- - -## Props - -| Prop | Tipo | Default | Descrição | -| ---------------- | --------------------------- | --------------- | ------------------------------------------------------ | -| `modelValue` | `string \| number \| boolean \| (string \| number \| boolean \| null)[]` | `""` | Valor controlado (use com `v-model`). | -| `type` | `InputType` | `"text"` | Tipo do controle (ver `InputType`). | -| `label` | `string` | `-` | Rótulo do campo. | -| `placeholder` | `string` | `-` | Texto exibido quando o campo está vazio. | -| `disabled` | `boolean` | `false` | Desabilita o campo. | -| `error` | `boolean` | `false` | Força estado visual de erro. | -| `errorMessages` | `string \| string[]` | `[]` | Mensagem ou lista de mensagens de erro. | -| `hint` | `string` | `-` | Texto de ajuda exibido abaixo do campo. | -| `persistentHint` | `boolean` | `false` | Mantém o hint sempre visível. | -| `variant` | `InputVariant` | `"outlined"` | Variante visual do Vuetify. | -| `density` | `Density` | `"comfortable"` | Densidade visual do campo. | -| `color` | `string` | `"primary"` | Cor do campo quando focado (ou `error`, se aplicável). | -| `clearable` | `boolean` | `false` | Permite limpar o valor do campo. | - - -## Notas sobre props - -* options: aceita arrays como ['Frontend','Backend'] ou { label:'São Paulo', value:'SP' }. O componente normaliza para { label, value, disabled? }. -* type determina quais comportamentos internos são aplicados. Tipos numéricos e máscara (telefone, cpfCnpj, cep) passam por formatação em onInput. -* multiple/chips: úteis para type="select". O v-select interno recebe item-title="label" e item-value="value" para compatibilidade com objetos. - ---- - -## Emissões (events) - -* update:modelValue — padrão v-model. -* change — emitido sempre que o valor muda (alinha com update:modelValue). -* focus — quando o campo interno recebe foco. -* blur — quando perde o foco. -* Observação: como value é um computed com getter/setter que emite ambos, v-model e listeners de mudança no pai funcionarão normalmente. - ---- - -## Repasso de atributos e listeners - -* O componente define inheritAttrs: false e usa v-bind="attrs" nos componentes internos (v-text-field, v-select, etc.). Isso implica que: -* Atributos HTML (ex.: type, aria-label, class, style) passados para são aplicados ao componente Vuetify interno apropriado. -* Listeners (ex.: @click, @keydown) também fazem parte de $attrs e serão repassados para o componente interno — use o EliInput como se estivesse ouvindo eventos diretamente no input. - -## Exemplo: - -```vue - -``` - ---- - -## Comportamentos de formatação importantes - -* numericoInteiro — remove tudo que não for dígito. -* numericoDecimal — mantém separador decimal (aplica formatarDecimal). -* numericoMoeda — formata para moeda conforme util (formatarMoeda). -* porcentagem — aplica formatação decimal e exibe sufixo `%` automaticamente. -* telefone — aplica máscara/format formatTelefone. -* cpfCnpj — aplica formatarCpfCnpj. -* cep — aplica formatarCep. - -**Importante: a formatação ocorre no onInput (campos text-like). O v-select não passa por onInput — ele usa v-model="value" e o computed que emite o update. Se desejar formatação específica para itens do select (por exemplo, mostrar label formatado), trate nos options antes de passar.** - ---- - -## Slot - -* O componente não expõe slots customizados diretamente. Ele controla internamente o append para toggle de senha quando type === 'password' && showPasswordToggle (ícone de olho). -* Se você precisa de slots específicos do v-text-field/v-select, considere estender o componente ou criar uma variação que exponha os slots desejados. diff --git a/src/componentes/campo/index.ts b/src/componentes/campo/index.ts deleted file mode 100644 index 890a77a..0000000 --- a/src/componentes/campo/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as EliInput } from "./EliInput.vue"; diff --git a/src/componentes/campo/utils/cep.ts b/src/componentes/campo/utils/cep.ts deleted file mode 100644 index 701fd34..0000000 --- a/src/componentes/campo/utils/cep.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { somenteNumeros } from "./numerico"; - -export function formatarCep(v: string): string { - const d = somenteNumeros(v).slice(0, 8); - - if (d.length <= 5) return d; - - return d.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); -} diff --git a/src/componentes/campo/utils/numerico.ts b/src/componentes/campo/utils/numerico.ts deleted file mode 100644 index 5c2a3a6..0000000 --- a/src/componentes/campo/utils/numerico.ts +++ /dev/null @@ -1,26 +0,0 @@ -export function somenteNumeros(valor: string) { - return valor.replace(/\D+/g, ""); -} - -export function formatarDecimal(valor: string) { - const limpo = valor.replace(/[^\d,]/g, ""); - const partes = limpo.split(","); - return partes.length > 2 ? partes[0] + "," + partes.slice(1).join("") : limpo; -} - -/** - * Formatação para percentual: - * - remove '%' caso venha junto (ex: colar "10%") - * - mantém apenas dígitos e vírgula (no máximo uma) - */ -export function formatarPorcentagem(valor: string) { - return formatarDecimal(valor.replace(/%/g, "")); -} - -export function formatarMoeda(valor: string) { - const numero = somenteNumeros(valor); - if (!numero) return ""; - - const inteiro = (parseInt(numero, 10) / 100).toFixed(2); - return inteiro.replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, "."); -} diff --git a/src/componentes/data_hora/README.md b/src/componentes/data_hora/README.md deleted file mode 100644 index 693b91a..0000000 --- a/src/componentes/data_hora/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# EliDataHora - -O `EliDataHora` é um componente de **entrada de data e hora** baseado em `v-text-field` (Vuetify), usando o tipo nativo do HTML `datetime-local`. - -Ele foi criado para oferecer uma solução **estável e leve** sem depender de componentes experimentais do Vuetify. - -## Objetivo - -- Permitir o usuário selecionar **data + hora** com UX nativa do navegador. -- Padronizar a API em português (props/eventos) no Design System. - -## API - -### Props - -| Prop | Tipo | Padrão | Descrição | -|------|------|--------|-----------| -| `modelValue` | `string \| null` | `null` | **Sempre em ISO 8601**, aceitando UTC absoluto (`Z`) ou com offset (ex.: `2026-01-09T16:15:00Z`, `2026-01-09T13:15:00-03:00`). O componente converte para horário **local** antes de exibir. | -| `modo` | `"data" \| "dataHora"` | `"dataHora"` | Define se o campo permite selecionar apenas data (`date`) ou data+hora (`datetime-local`). | -| `rotulo` | `string` | `"Data e hora"` | Label do campo. | -| `placeholder` | `string` | `""` | Placeholder do campo. | -| `desabilitado` | `boolean` | `false` | Desabilita o campo. | -| `limpavel` | `boolean` | `false` | Habilita botão de limpar (Vuetify `clearable`). | -| `erro` | `boolean` | `false` | Estado de erro visual. | -| `mensagensErro` | `string \| string[]` | `[]` | Mensagens de erro. | -| `dica` | `string` | `""` | Hint/ajuda abaixo do campo. | -| `dicaPersistente` | `boolean` | `false` | Mantém dica sempre visível. | -| `densidade` | `CampoDensidade` | `"comfortable"` | Densidade (Vuetify). | -| `variante` | `CampoVariante` | `"outlined"` | Variante (Vuetify). | -| `min` | `string \| undefined` | `undefined` | Mínimo permitido em ISO 8601 (offset ou `Z`). | -| `max` | `string \| undefined` | `undefined` | Máximo permitido em ISO 8601 (offset ou `Z`). | - -> Observação: o atributo HTML `datetime-local` **não inclui timezone**. -> Este componente resolve isso convertendo: -> -> - **entrada**: ISO 8601 (UTC/offset) → **exibição** em horário local -> - **saída**: valor selecionado → ISO 8601 com **offset local** - -### Emits - -| Evento | Payload | Quando dispara | -|--------|---------|---------------| -| `update:modelValue` | `string \| null` | Sempre que o valor muda (padrão do v-model). O payload é ISO 8601 com **offset local**. | -| `alterar` | `string \| null` | Alias semântico para mudanças de valor (mesmo payload do v-model). | -| `foco` | `void` | Ao focar o campo. | -| `desfoco` | `void` | Ao sair do foco. | - -### Slots - -Este componente não define slots próprios. Você pode usar slots do `v-text-field` via `v-bind="$attrs"` caso precise (ver exemplos abaixo). - -## Exemplos - -### 1) Uso básico com v-model - -```vue - - - -``` - -### 2) Com limites (min/max) e validação visual - -```vue - -``` - -## Casos de borda / comportamento esperado - -- Ao limpar o campo, o componente emite `null` (não string vazia). -- O navegador pode variar a UI do seletor (isso é esperado do `datetime-local`). -- `min/max` devem ser strings em ISO 8601 (offset ou `Z`). -- Em `modo="data"`, o componente emite ISO no **início do dia** (`00:00:00`) no fuso local. - -## Acessibilidade - -- O `v-text-field` do Vuetify já oferece base de acessibilidade. -- Sempre prefira passar `rotulo` significativo. - -## Decisões de implementação - -- Usamos `datetime-local` por ser amplamente suportado e não depender de APIs experimentais. -- O componente usa `dayjs` para converter entradas UTC/offset para local antes de exibir e para emitir ISO 8601 com offset local. -- Mantemos o valor como `string | null` para evitar conversões implícitas e permitir que cada projeto decida como persistir (UTC/local). diff --git a/src/componentes/data_hora/index.ts b/src/componentes/data_hora/index.ts deleted file mode 100644 index 1243467..0000000 --- a/src/componentes/data_hora/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as EliEntradaDataHora } from "../EliEntrada/EliEntradaDataHora.vue"; \ No newline at end of file diff --git a/src/componentes/ola_mundo/EliOlaMundo.vue b/src/componentes/ola_mundo/EliOlaMundo.vue index 7289172..04a0cec 100644 --- a/src/componentes/ola_mundo/EliOlaMundo.vue +++ b/src/componentes/ola_mundo/EliOlaMundo.vue @@ -11,100 +11,31 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -121,45 +52,27 @@ import { defineComponent, ref } from "vue"; import EliBotao from "../botao/EliBotao.vue"; import EliBadge from "../indicador/EliBadge.vue"; -import EliInput from "../campo/EliInput.vue"; - -type Habilidade = "vue" | "react"; +import EliEntradaTexto from "../EliEntrada/EliEntradaTexto.vue"; export default defineComponent({ name: "EliOlaMundo", components: { EliBotao, EliBadge, - EliInput, + EliEntradaTexto, }, setup() { const nome = ref(""); - const estado = ref([]); const cep = ref(""); const telefone = ref(""); - const idade = ref(""); - const altura = ref(""); - const valor = ref(""); const email = ref(""); - const mensagem = ref(""); - const senha = ref(""); const documento = ref(""); - const cor = ref<"azul" | "verde" | null>(null); - const habilidades = ref([]); return { nome, email, documento, - estado, telefone, - mensagem, - senha, - cor, - habilidades, - idade, - altura, cep, - valor, }; }, }); diff --git a/src/componentes/ola_mundo/README.md b/src/componentes/ola_mundo/README.md index 7c057d9..a4de0bb 100644 --- a/src/componentes/ola_mundo/README.md +++ b/src/componentes/ola_mundo/README.md @@ -2,14 +2,14 @@ O `EliOlaMundo` é um componente **de exemplo** usado para validar rapidamente o Design System no playground. -> Ele não é um componente “de produto”; ele existe para demonstrar integração com Vuetify e mostrar variações de uso de `EliInput`, `EliBotao` e `EliBadge`. +> Ele não é um componente “de produto”; ele existe para demonstrar integração com Vuetify e mostrar variações de uso de `EliEntradaTexto`, `EliEntradaNumero`, `EliBotao` e `EliBadge`. ## Estrutura do repositório (padrão) Neste Design System: -- **Pastas e arquivos** (quando aplicável) preferem português: `botao/`, `campo/`, `indicador/`, etc. -- **Componentes** mantêm prefixo técnico `Eli` (PascalCase): `EliBotao`, `EliInput`. +- **Pastas e arquivos** (quando aplicável) preferem português: `botao/`, `EliEntrada/`, `indicador/`, etc. +- **Componentes** mantêm prefixo técnico `Eli` (PascalCase): `EliBotao`, `EliEntradaTexto`. Exemplo: @@ -19,9 +19,10 @@ src/componentes/ EliBotao.vue index.ts README.md - campo/ - EliInput.vue - index.ts + EliEntrada/ + EliEntradaTexto.vue + EliEntradaNumero.vue + EliEntradaDataHora.vue README.md ``` diff --git a/src/index.ts b/src/index.ts index 9ff27ed..14a0ec7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ import "./styles/eli-vue-fonts.css"; import { EliOlaMundo } from "./componentes/ola_mundo"; import { EliBotao } from "./componentes/botao"; import { EliBadge } from "./componentes/indicador"; -import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliTabela } from "./componentes/EliTabela"; import { EliEntradaTexto, EliEntradaNumero, EliEntradaDataHora } from "./componentes/EliEntrada"; @@ -11,7 +10,6 @@ import { EliEntradaTexto, EliEntradaNumero, EliEntradaDataHora } from "./compone export { EliOlaMundo }; export { EliBotao }; export { EliBadge }; -export { EliInput }; export { EliCartao }; export { EliTabela }; export { EliEntradaTexto, EliEntradaNumero, EliEntradaDataHora }; @@ -21,7 +19,6 @@ const EliVue: Plugin = { app.component("EliOlaMundo", EliOlaMundo); app.component("EliBotao", EliBotao); app.component("EliBadge", EliBadge); - app.component("EliInput", EliInput); app.component("EliCartao", EliCartao); app.component("EliTabela", EliTabela); app.component("EliEntradaTexto", EliEntradaTexto); diff --git a/src/playground/App.vue b/src/playground/App.vue index 4dfe8d3..4ff5fa4 100644 --- a/src/playground/App.vue +++ b/src/playground/App.vue @@ -8,7 +8,6 @@ Botão Indicador Cartão - Campo Entradas Data e hora Tabela @@ -20,7 +19,6 @@ - @@ -33,7 +31,6 @@ import { defineComponent } from "vue"; import BotaoPlayground from "./botao.playground.vue"; import IndicadorPlayground from "./indicador.playground.vue"; import CartaoPlayground from "./cartao.playground.vue"; -import CampoPlayground from "./campo.playground.vue"; import EntradasPlayground from "./entradas.playground.vue"; import DataHoraPlayground from "./data_hora.playground.vue"; import TabelaPlayground from "./tabela.playground.vue"; @@ -43,7 +40,6 @@ type AbaPlayground = | "botao" | "indicador" | "cartao" - | "campo" | "entradas" | "data_hora" | "tabela" @@ -53,7 +49,6 @@ const mapaHashParaAba: Record = { botao: "botao", indicador: "indicador", cartao: "cartao", - campo: "campo", entradas: "entradas", "data-hora": "data_hora", tabela: "tabela", @@ -64,7 +59,6 @@ const mapaAbaParaHash: Record = { botao: "botao", indicador: "indicador", cartao: "cartao", - campo: "campo", entradas: "entradas", data_hora: "data-hora", tabela: "tabela", @@ -77,7 +71,6 @@ export default defineComponent({ BotaoPlayground, IndicadorPlayground, CartaoPlayground, - CampoPlayground, EntradasPlayground, DataHoraPlayground, TabelaPlayground, diff --git a/src/playground/campo.playground.vue b/src/playground/campo.playground.vue deleted file mode 100644 index 9a3c9a5..0000000 --- a/src/playground/campo.playground.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/src/playground/cartao.playground.vue b/src/playground/cartao.playground.vue index 3a9cb17..ab2c883 100644 --- a/src/playground/cartao.playground.vue +++ b/src/playground/cartao.playground.vue @@ -3,10 +3,9 @@

EliCartao (pipeline)

- @@ -48,7 +47,7 @@ import { defineComponent, ref } from "vue"; import { EliBadge } from "@/componentes/indicador"; import { EliBotao } from "@/componentes/botao"; -import { EliInput } from "@/componentes/campo"; +import { EliEntradaTexto } from "@/componentes/EliEntrada"; import { EliCartao } from "@/componentes/cartao"; import type { CartaoStatus } from "@/tipos"; @@ -68,7 +67,7 @@ type Coluna = { export default defineComponent({ name: "CartaoPlayground", - components: { EliBadge, EliBotao, EliInput, EliCartao }, + components: { EliBadge, EliBotao, EliEntradaTexto, EliCartao }, setup() { const filtro = ref(""); diff --git a/src/playground/ola_mundo.playground.vue b/src/playground/ola_mundo.playground.vue index de82078..80b3ac1 100644 --- a/src/playground/ola_mundo.playground.vue +++ b/src/playground/ola_mundo.playground.vue @@ -3,7 +3,7 @@

EliOlaMundo

Demo integrada (útil para smoke-test visual). Para testes específicos, - prefira os playgrounds de EliBotao, EliInput e + prefira os playgrounds de EliBotao, EliEntradas e EliBadge.

diff --git a/src/tipos/campo.ts b/src/tipos/campo.ts deleted file mode 100644 index ea274b5..0000000 --- a/src/tipos/campo.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Tipos do componente EliInput (campo). - */ - -export type CampoValor = string | number | boolean | null; -export type CampoValorMultiplo = CampoValor[]; - -export type CampoOpcao = { - label: string; - value: TValor; - disabled?: boolean; -}; - -export type CampoOpcaoBruta = - | TValor - | { - label?: string; - value: TValor; - disabled?: boolean; - }; - -export type CampoVariante = - | "outlined" - | "filled" - | "plain" - | "solo" - | "solo-filled" - | "solo-inverted" - | "underlined"; - -export type CampoDensidade = "default" | "comfortable" | "compact"; - -export type CampoTipoNumerico = - | "numericoInteiro" - | "numericoDecimal" - | "numericoMoeda" - | "porcentagem"; - -export type CampoTipo = - | "text" - | "password" - | "email" - | "search" - | "url" - | "textarea" - | "radio" - | "checkbox" - | "telefone" - | "cpfCnpj" - | "cep" - | "select" - | CampoTipoNumerico; diff --git a/src/tipos/entrada.ts b/src/tipos/entrada.ts new file mode 100644 index 0000000..3c25f15 --- /dev/null +++ b/src/tipos/entrada.ts @@ -0,0 +1,18 @@ +/** + * Tipos compartilhados para componentes de entrada (EliEntrada*). + * + * OBS: Estes tipos existiam anteriormente em `tipos/campo.ts` junto do componente + * `EliInput`. Como o `EliInput` foi removido, mantemos aqui apenas o que ainda + * é relevante para padronização visual/props do Vuetify. + */ + +export type CampoVariante = + | "outlined" + | "filled" + | "plain" + | "solo" + | "solo-filled" + | "solo-inverted" + | "underlined"; + +export type CampoDensidade = "default" | "comfortable" | "compact"; diff --git a/src/tipos/index.ts b/src/tipos/index.ts index 36c849e..759056b 100644 --- a/src/tipos/index.ts +++ b/src/tipos/index.ts @@ -1,4 +1,4 @@ export * from "./botao"; export * from "./cartao"; -export * from "./campo"; +export * from "./entrada"; export * from "./indicador";