From de7c19be24147028ee5fd85f5b2fec037d07ebbf Mon Sep 17 00:00:00 2001 From: Luiz Silva Date: Thu, 29 Jan 2026 10:35:35 -0300 Subject: [PATCH] emplementado entrada numero e entrada texto --- dist/eli-vue.css | 2 +- dist/eli-vue.es.js | 2404 ++++++++++------- dist/eli-vue.umd.js | 38 +- .../EliEntrada/EliEntradaNumero.vue.d.ts | 49 + .../EliEntrada/EliEntradaTexto.vue.d.ts | 47 + dist/types/componentes/EliEntrada/index.d.ts | 4 + .../EliEntrada/registryEliEntradas.d.ts | 106 + .../componentes/EliEntrada/tiposEntradas.d.ts | 65 + .../EliTabela/EliTabela.vue.d.ts | 0 .../EliTabela/EliTabelaBody.vue.d.ts | 0 .../EliTabela/EliTabelaCabecalho.vue.d.ts | 0 .../EliTabela/EliTabelaCaixaDeBusca.vue.d.ts | 0 .../EliTabela/EliTabelaDebug.vue.d.ts | 0 .../EliTabela/EliTabelaDetalhesLinha.vue.d.ts | 0 .../EliTabela/EliTabelaEstados.vue.d.ts | 0 .../EliTabela/EliTabelaHead.vue.d.ts | 0 .../EliTabela/EliTabelaMenuAcoes.vue.d.ts | 0 .../EliTabela/EliTabelaModalColunas.vue.d.ts | 0 .../EliTabela/EliTabelaPaginacao.vue.d.ts | 0 .../celulas/EliTabelaCelula.vue.d.ts | 0 .../celulas/EliTabelaCelulaNumero.vue.d.ts | 0 .../EliTabelaCelulaTextoSimples.vue.d.ts | 0 .../EliTabelaCelulaTextoTruncado.vue.d.ts | 0 .../celulas/registryTabelaCelulas.d.ts | 0 .../EliTabela/celulas/tiposTabelaCelulas.d.ts | 0 .../EliTabela/colunasStorage.d.ts | 0 .../eli => componentes}/EliTabela/index.d.ts | 0 .../EliTabela/types-eli-tabela.d.ts | 1 - dist/types/index.d.ts | 4 +- package.json | 2 +- .../EliEntrada/EliEntradaNumero.vue | 236 ++ .../EliEntrada/EliEntradaTexto.vue | 57 + src/componentes/EliEntrada/index.ts | 5 + .../EliEntrada/registryEliEntradas.ts | 11 + src/componentes/EliEntrada/tiposEntradas.ts | 81 + src/index.ts | 4 + src/playground/App.vue | 7 + src/playground/entradas.playground.vue | 88 + tsconfig.json | 2 +- 39 files changed, 2155 insertions(+), 1058 deletions(-) create mode 100644 dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts create mode 100644 dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts create mode 100644 dist/types/componentes/EliEntrada/index.d.ts create mode 100644 dist/types/componentes/EliEntrada/registryEliEntradas.d.ts create mode 100644 dist/types/componentes/EliEntrada/tiposEntradas.d.ts rename dist/types/{components/eli => componentes}/EliTabela/EliTabela.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaBody.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaCabecalho.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaDebug.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaDetalhesLinha.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaEstados.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaHead.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaMenuAcoes.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaModalColunas.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/EliTabelaPaginacao.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/EliTabelaCelula.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/EliTabelaCelulaTextoTruncado.vue.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/registryTabelaCelulas.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/celulas/tiposTabelaCelulas.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/colunasStorage.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/index.d.ts (100%) rename dist/types/{components/eli => componentes}/EliTabela/types-eli-tabela.d.ts (99%) create mode 100644 src/componentes/EliEntrada/EliEntradaNumero.vue create mode 100644 src/componentes/EliEntrada/EliEntradaTexto.vue create mode 100644 src/componentes/EliEntrada/index.ts create mode 100644 src/componentes/EliEntrada/registryEliEntradas.ts create mode 100644 src/componentes/EliEntrada/tiposEntradas.ts create mode 100644 src/playground/entradas.playground.vue diff --git a/dist/eli-vue.css b/dist/eli-vue.css index b08a164..87be6e7 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-data-hora[data-v-71afabb6]{width:100%}.eli-tabela__busca[data-v-f7b534c8]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.eli-tabela__busca-input-wrapper[data-v-f7b534c8]{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-f7b534c8]{height:100%;padding:0 12px;border:none;outline:none;font-size:.875rem;color:#0f172ad9}.eli-tabela__busca-input[data-v-f7b534c8]::-webkit-search-cancel-button,.eli-tabela__busca-input[data-v-f7b534c8]::-webkit-search-decoration{-webkit-appearance:none}.eli-tabela__busca-input[data-v-f7b534c8]::placeholder{color:#6b7280d9}.eli-tabela__busca-botao[data-v-f7b534c8]{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-f7b534c8]{display:block}.eli-tabela__busca-botao[data-v-f7b534c8]:hover,.eli-tabela__busca-botao[data-v-f7b534c8]:focus-visible{background:#2563eb33;color:#2563eb}.eli-tabela__busca-botao[data-v-f7b534c8]:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}.eli-tabela__busca-grupo[data-v-5b4ab3b9]{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.eli-tabela__paginacao[data-v-59d12455]{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px;flex-wrap:wrap}.eli-tabela__pagina-botao[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;border-radius:9999px;border:1px solid rgba(15,23,42,.12);background:#fff;font-size:.875rem;font-weight:500;color:#0f172ad1;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.eli-tabela__pagina-botao[data-v-59d12455]:hover,.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{background-color:#2563eb14;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-botao[data-v-59d12455]:focus-visible{outline:2px solid rgba(37,99,235,.45);outline-offset:2px}.eli-tabela__pagina-botao[data-v-59d12455]:disabled{cursor:default;opacity:.5;background:#94a3b814;border-color:#94a3b82e;color:#475569bf}.eli-tabela__pagina-botao--ativo[data-v-59d12455]{background:#2563eb1f;border-color:#2563eb66;color:#2563ebf2}.eli-tabela__pagina-ellipsis[data-v-59d12455]{display:inline-flex;align-items:center;justify-content:center;width:32px;color:#6b7280d9;font-size:.9rem}.eli-tabela-modal-colunas__overlay[data-v-c7d1b6d2]{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-c7d1b6d2]{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-c7d1b6d2]{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-c7d1b6d2]{font-size:1rem;margin:0}.eli-tabela-modal-colunas__fechar[data-v-c7d1b6d2]{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-c7d1b6d2]:hover,.eli-tabela-modal-colunas__fechar[data-v-c7d1b6d2]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__conteudo[data-v-c7d1b6d2]{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px}.eli-tabela-modal-colunas__coluna-titulo[data-v-c7d1b6d2]{font-weight:600;margin-bottom:8px}.eli-tabela-modal-colunas__lista[data-v-c7d1b6d2]{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-c7d1b6d2]{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-c7d1b6d2]{margin-top:8px}.eli-tabela-modal-colunas__item[data-v-c7d1b6d2]:active{cursor:grabbing}.eli-tabela-modal-colunas__item-handle[data-v-c7d1b6d2]{color:#0f172a8c;font-size:14px}.eli-tabela-modal-colunas__item-texto[data-v-c7d1b6d2]{flex:1;min-width:0}.eli-tabela-modal-colunas__footer[data-v-c7d1b6d2]{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-c7d1b6d2]{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-c7d1b6d2]:hover,.eli-tabela-modal-colunas__botao--sec[data-v-c7d1b6d2]:focus-visible{background:#0f172a0f}.eli-tabela-modal-colunas__botao--prim[data-v-c7d1b6d2]{border:none;background:#2563ebf2;color:#fff}.eli-tabela-modal-colunas__botao--prim[data-v-c7d1b6d2]:hover,.eli-tabela-modal-colunas__botao--prim[data-v-c7d1b6d2]:focus-visible{background:#2563eb}@media(max-width:720px){.eli-tabela-modal-colunas__conteudo[data-v-c7d1b6d2]{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__celula--esquerda{text-align:left}.eli-tabela__celula--centro{text-align:center}.eli-tabela__celula--direita{text-align:right}.eli-tabela__celula-conteudo{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:top}.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} +@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-data-hora[data-v-71afabb6]{width:100%}.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} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index 6264923..12f8629 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,16 +1,16 @@ -import { defineComponent as z, createBlock as U, openBlock as f, mergeProps as de, withCtx as W, renderSlot as ce, computed as M, ref as I, createElementBlock as _, createCommentVNode as x, createSlots as Xe, createVNode as O, createTextVNode as ge, toDisplayString as Z, Fragment as ee, renderList as ne, resolveComponent as J, createElementVNode as k, h as De, watch as se, withDirectives as Ke, withKeys as Qe, vModelText as xe, normalizeStyle as Se, resolveDynamicComponent as ke, normalizeClass as me, withModifiers as ue, Teleport as ea, onMounted as aa, onBeforeUnmount as ta } from "vue"; -import { VBtn as oa } from "vuetify/components/VBtn"; -import { VBadge as na } from "vuetify/components/VBadge"; -import { VCheckbox as la } from "vuetify/components/VCheckbox"; -import { VIcon as ra } from "vuetify/components/VIcon"; -import { VRadio as ia } from "vuetify/components/VRadio"; -import { VRadioGroup as sa } from "vuetify/components/VRadioGroup"; -import { VSelect as ua } from "vuetify/components/VSelect"; -import { VTextField as Ne } from "vuetify/components/VTextField"; -import { VTextarea as da } from "vuetify/components/VTextarea"; -import { VCard as Le, VCardTitle as Fe, VCardText as Ue, VCardActions as je } from "vuetify/components/VCard"; -import { VContainer as ca } from "vuetify/components/VGrid"; -const ma = z({ +import { defineComponent as H, createBlock as z, openBlock as i, mergeProps as me, withCtx as ee, renderSlot as $e, computed as V, ref as B, createElementBlock as g, createCommentVNode as te, createSlots as Je, createVNode as M, createTextVNode as ke, toDisplayString as j, Fragment as le, renderList as pe, resolveComponent as x, createElementVNode as _, 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 Ae } from "vuetify/components/VTextField"; +import { VTextarea as $a } from "vuetify/components/VTextarea"; +import { VCard as We, VCardTitle as Ze, VCardText as Ge, VCardActions as Xe } from "vuetify/components/VCard"; +import { VContainer as ya } from "vuetify/components/VGrid"; +const Ca = H({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const ma = z({ default: !1 } } -}), H = (e, a) => { - const r = e.__vccOpts || e; - for (const [n, s] of a) - r[n] = s; - return r; +}), Y = (e, a) => { + const o = e.__vccOpts || e; + for (const [r, s] of a) + o[r] = s; + return o; }; -function fa(e, a, r, n, s, d) { - return f(), U(oa, de({ +function _a(e, a, o, r, s, f) { + return i(), z(pa, me({ 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: W(() => [ - ce(e.$slots, "default") + default: ee(() => [ + $e(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const ze = /* @__PURE__ */ H(ma, [["render", fa]]), we = { +const Ke = /* @__PURE__ */ Y(Ca, [["render", _a]]), Oe = { suave: "4px", pill: "10px" -}, pa = z({ +}, Ea = H({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const ze = /* @__PURE__ */ H(ma, [["render", fa]]), we = { } }, setup(e) { - const a = M(() => e.radius in we ? we[e.radius] : e.radius), r = M(() => e.dot || e.badge !== void 0 ? e.visible : !1), n = M(() => ({ + const a = V(() => e.radius in Oe ? Oe[e.radius] : e.radius), o = V(() => e.dot || e.badge !== void 0 ? e.visible : !1), r = V(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: r, badgeStyle: n }; + return { showBadge: o, badgeStyle: r }; } }); -function ba(e, a, r, n, s, d) { - return e.showBadge ? (f(), U(na, de({ +function ka(e, a, o, r, s, f) { + return e.showBadge ? (i(), z(ma, me({ key: 0, color: e.color }, e.$attrs, { @@ -116,46 +116,46 @@ function ba(e, a, r, n, s, d) { style: e.badgeStyle, class: "eli-badge" }), { - default: W(() => [ - ce(e.$slots, "default", {}, void 0, !0) + default: ee(() => [ + $e(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ce(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : $e(e.$slots, "default", { key: 1 }, void 0, !0); } -const Ee = /* @__PURE__ */ H(pa, [["render", ba], ["__scopeId", "data-v-371c8db4"]]); -function va(e) { +const Ie = /* @__PURE__ */ Y(Ea, [["render", ka], ["__scopeId", "data-v-371c8db4"]]); +function Da(e) { return e.replace(/\D+/g, ""); } -function ga(e) { - const a = va(e); +function Sa(e) { + const a = Da(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 ha(e) { +function wa(e) { return e.replace(/\D+/g, ""); } -function ya(e) { - const a = ha(e); +function Va(e) { + const a = wa(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 Me(e) { +function Pe(e) { return e.replace(/\D+/g, ""); } -function He(e) { - const a = e.replace(/[^\d,]/g, ""), r = a.split(","); - return r.length > 2 ? r[0] + "," + r.slice(1).join("") : a; +function Qe(e) { + const a = e.replace(/[^\d,]/g, ""), o = a.split(","); + return o.length > 2 ? o[0] + "," + o.slice(1).join("") : a; } -function $a(e) { - return He(e.replace(/%/g, "")); +function Aa(e) { + return Qe(e.replace(/%/g, "")); } -function Ca(e) { - const a = Me(e); +function Ma(e) { + const a = Pe(e); return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } -function _a(e) { - const a = Me(e).slice(0, 8); +function Ba(e) { + const a = Pe(e).slice(0, 8); return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const Sa = z({ +const Ta = H({ name: "EliInput", inheritAttrs: !1, props: { @@ -197,13 +197,13 @@ const Sa = z({ chips: Boolean }, emits: ["update:modelValue", "change", "focus", "blur"], - setup(e, { emit: a, attrs: r }) { - const n = I(!1), s = I(!1), d = M({ + setup(e, { emit: a, attrs: o }) { + const r = B(!1), s = B(!1), f = V({ get: () => e.modelValue, - set: (A) => { - a("update:modelValue", A), a("change", A); + set: (D) => { + a("update:modelValue", D), a("change", D); } - }), t = M( + }), t = V( () => [ "text", "password", @@ -218,80 +218,80 @@ const Sa = z({ "porcentagem", "cep" ].includes(e.type) - ), l = M( + ), n = V( () => e.type === "password" ? s.value ? "text" : "password" : "text" - ), v = M(() => { + ), m = V(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), o = M( - () => e.error ? "error" : n.value ? e.color : void 0 + }), l = V( + () => e.error ? "error" : r.value ? e.color : void 0 ); - function g(A) { - const E = A.target; - let p = E.value; + function c(D) { + const y = D.target; + let v = y.value; switch (e.type) { case "numericoInteiro": - p = Me(p); + v = Pe(v); break; case "numericoDecimal": - p = He(p); + v = Qe(v); break; case "numericoMoeda": - p = Ca(p); + v = Ma(v); break; case "porcentagem": - p = $a(p); + v = Aa(v); break; case "telefone": - p = ya(p); + v = Va(v); break; case "cpfCnpj": - p = ga(p); + v = Sa(v); break; case "cep": - p = _a(p); + v = Ba(v); break; } - E.value = p, a("update:modelValue", p), a("change", p); + y.value = v, a("update:modelValue", v), a("change", v); } - function y() { + function $() { s.value = !s.value; } - const L = M(() => (e.options || []).map((A) => { - if (A && typeof A == "object" && "value" in A) { - const p = A.value; + const I = V(() => (e.options || []).map((D) => { + if (D && typeof D == "object" && "value" in D) { + const v = D.value; return { - label: A.label ?? String(p), - value: p, - disabled: A.disabled + label: D.label ?? String(v), + value: v, + disabled: D.disabled }; } - const E = A; - return { label: String(E), value: E }; + const y = D; + return { label: String(y), value: y }; })); return { - attrs: r, - value: d, + attrs: o, + value: f, isTextLike: t, - inputHtmlType: l, - inputMode: v, - internalColor: o, + inputHtmlType: n, + inputMode: m, + internalColor: l, showPassword: s, - togglePassword: y, - onInput: g, + togglePassword: $, + onInput: c, onFocus: () => a("focus"), onBlur: () => a("blur"), - computedItems: L + computedItems: I }; } -}), ka = { class: "eli-input" }, Aa = { +}), Ia = { class: "eli-input" }, Pa = { key: 4, class: "checkbox-group" }; -function Da(e, a, r, n, s, d) { - return f(), _("div", ka, [ - e.isTextLike ? (f(), U(Ne, de({ +function Oa(e, a, o, r, s, f) { + return i(), g("div", Ia, [ + e.isTextLike ? (i(), z(Ae, me({ key: 0, modelValue: e.value, "onUpdate:modelValue": a[0] || (a[0] = (t) => e.value = t), @@ -313,23 +313,23 @@ function Da(e, a, r, n, s, d) { onFocus: e.onFocus, onBlur: e.onBlur, onInput: e.onInput - }), Xe({ _: 2 }, [ + }), Je({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: W(() => [ - O(ra, { + fn: ee(() => [ + M(va, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: W(() => [ - ge(Z(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + 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" ? (f(), U(da, de({ + ]), 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($a, me({ key: 1, modelValue: e.value, "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), @@ -337,7 +337,7 @@ function Da(e, a, r, n, s, d) { rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (f(), U(ua, de({ + }, 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), @@ -357,127 +357,127 @@ function Da(e, a, r, n, s, d) { }, 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" ? (f(), U(sa, { + }), 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: W(() => [ - (f(!0), _(ee, null, ne(e.computedItems, (t) => (f(), U(ia, { + default: ee(() => [ + (i(!0), g(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" ? (f(), _("div", Aa, [ - (f(!0), _(ee, null, ne(e.computedItems, (t) => (f(), U(la, { + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (i(), g("div", Pa, [ + (i(!0), g(le, null, pe(e.computedItems, (t) => (i(), z(fa, { key: String(t.value), modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (l) => e.value = l), + "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)) - ])) : x("", !0) + ])) : te("", !0) ]); } -const Ye = /* @__PURE__ */ H(Sa, [["render", Da], ["__scopeId", "data-v-756cb549"]]), Ea = z({ +const xe = /* @__PURE__ */ Y(Ta, [["render", Oa], ["__scopeId", "data-v-756cb549"]]), Na = H({ name: "EliOlaMundo", components: { - EliBotao: ze, - EliBadge: Ee, - EliInput: Ye + EliBotao: Ke, + EliBadge: Ie, + EliInput: xe }, setup() { - const e = I(""), a = I([]), r = I(""), n = I(""), s = I(""), d = I(""), t = I(""), l = I(""), v = I(""), o = I(""), g = I(""), y = I(null), L = I([]); + const e = B(""), a = B([]), o = B(""), r = B(""), s = B(""), f = B(""), t = B(""), n = B(""), m = B(""), l = B(""), c = B(""), $ = B(null), I = B([]); return { nome: e, - email: l, - documento: g, + email: n, + documento: c, estado: a, - telefone: n, - mensagem: v, - senha: o, - cor: y, - habilidades: L, + telefone: r, + mensagem: m, + senha: l, + cor: $, + habilidades: I, idade: s, - altura: d, - cep: r, + altura: f, + cep: o, valor: t }; } -}), Ma = { class: "grid-example" }; -function wa(e, a, r, n, s, d) { - const t = J("EliBadge"), l = J("EliInput"), v = J("EliBotao"); - return f(), U(ca, null, { - default: W(() => [ - O(Le, { +}), qa = { class: "grid-example" }; +function La(e, a, o, r, s, f) { + const t = x("EliBadge"), n = x("EliInput"), m = x("EliBotao"); + return i(), z(ya, null, { + default: ee(() => [ + M(We, { class: "mx-auto", max_width: "400" }, { - default: W(() => [ - O(Fe, null, { - default: W(() => [ - O(t, { + default: ee(() => [ + M(Ze, null, { + default: ee(() => [ + M(t, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: W(() => [...a[14] || (a[14] = [ - ge(" Olá Mundo! ", -1) + default: ee(() => [...a[14] || (a[14] = [ + ke(" Olá Mundo! ", -1) ])]), _: 1 }) ]), _: 1 }), - O(Ue, null, { - default: W(() => [ - a[15] || (a[15] = ge(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - k("div", Ma, [ - O(l, { + M(Ge, null, { + default: ee(() => [ + a[15] || (a[15] = ke(" Este é um componente de exemplo integrado com Vuetify. ", -1)), + _("div", qa, [ + M(n, { modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (o) => e.nome = o), + "onUpdate:modelValue": a[0] || (a[0] = (l) => e.nome = l), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (o) => e.idade = o), + "onUpdate:modelValue": a[1] || (a[1] = (l) => e.idade = l), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (o) => e.altura = o), + "onUpdate:modelValue": a[2] || (a[2] = (l) => e.altura = l), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (o) => e.valor = o), + "onUpdate:modelValue": a[3] || (a[3] = (l) => e.valor = l), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (o) => e.telefone = o), + "onUpdate:modelValue": a[4] || (a[4] = (l) => e.telefone = l), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (o) => e.cep = o), + "onUpdate:modelValue": a[5] || (a[5] = (l) => e.cep = l), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - O(l, { + M(n, { type: "select", label: "Estado", options: [ @@ -485,58 +485,58 @@ function wa(e, a, r, n, s, d) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": a[6] || (a[6] = (o) => e.estado = o), + "onUpdate:modelValue": a[6] || (a[6] = (l) => e.estado = l), multiple: "" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (o) => e.documento = o), + "onUpdate:modelValue": a[7] || (a[7] = (l) => e.documento = l), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (o) => e.email = o), + "onUpdate:modelValue": a[8] || (a[8] = (l) => e.email = l), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.senha, - "onUpdate:modelValue": a[9] || (a[9] = (o) => e.senha = o), + "onUpdate:modelValue": a[9] || (a[9] = (l) => e.senha = l), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - O(l, { + M(n, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (o) => e.mensagem = o), + "onUpdate:modelValue": a[10] || (a[10] = (l) => e.mensagem = l), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - O(l, { + M(n, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": a[11] || (a[11] = (o) => e.cor = o), + "onUpdate:modelValue": a[11] || (a[11] = (l) => e.cor = l), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - O(l, { + M(n, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": a[12] || (a[12] = (o) => e.habilidades = o), + "onUpdate:modelValue": a[12] || (a[12] = (l) => e.habilidades = l), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - O(l, { + M(n, { modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (o) => e.nome = o), + "onUpdate:modelValue": a[13] || (a[13] = (l) => e.nome = l), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -545,15 +545,15 @@ function wa(e, a, r, n, s, d) { ]), _: 1 }), - O(je, null, { - default: W(() => [ - O(v, { + M(Xe, null, { + default: ee(() => [ + M(m, { color: "primary", variant: "elevated", block: "" }, { - default: W(() => [...a[16] || (a[16] = [ - ge(" Botão Vuetify ", -1) + default: ee(() => [...a[16] || (a[16] = [ + ke(" Botão Vuetify ", -1) ])]), _: 1 }) @@ -567,9 +567,9 @@ function wa(e, a, r, n, s, d) { _: 1 }); } -const Va = /* @__PURE__ */ H(Ea, [["render", wa]]), Ba = z({ +const Fa = /* @__PURE__ */ Y(Na, [["render", La]]), ja = H({ name: "EliCartao", - components: { EliBadge: Ee }, + components: { EliBadge: Ie }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -596,7 +596,7 @@ const Va = /* @__PURE__ */ H(Ea, [["render", wa]]), Ba = z({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const r = M(() => e.status), n = M(() => { + const o = V(() => e.status), r = V(() => { switch (e.status) { case "novo": return "primary"; @@ -607,40 +607,40 @@ const Va = /* @__PURE__ */ H(Ea, [["render", wa]]), Ba = z({ case "cancelado": return "error"; } - }), s = M(() => `eli-cartao--${e.status}`); - function d() { + }), s = V(() => `eli-cartao--${e.status}`); + function f() { a("clicar", e.status); } return { - rotuloStatus: r, - corStatus: n, + rotuloStatus: o, + corStatus: r, classeStatus: s, - onClick: d + onClick: f }; } -}), Ta = { class: "eli-cartao__titulo-texto" }, Pa = { class: "eli-cartao__status" }; -function Oa(e, a, r, n, s, d) { - const t = J("EliBadge"); - return f(), U(Le, de({ +}), Ua = { class: "eli-cartao__titulo-texto" }, za = { class: "eli-cartao__status" }; +function Ha(e, a, o, r, s, f) { + const t = x("EliBadge"); + return i(), z(We, me({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: W(() => [ - O(Fe, { class: "eli-cartao__titulo" }, { - default: W(() => [ - k("div", Ta, [ - ce(e.$slots, "titulo", {}, () => [ - ge(Z(e.titulo), 1) + default: ee(() => [ + M(Ze, { class: "eli-cartao__titulo" }, { + default: ee(() => [ + _("div", Ua, [ + $e(e.$slots, "titulo", {}, () => [ + ke(j(e.titulo), 1) ], !0) ]), - k("div", Pa, [ - O(t, { + _("div", za, [ + M(t, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: W(() => [...a[0] || (a[0] = [ - k("span", null, null, -1) + default: ee(() => [...a[0] || (a[0] = [ + _("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -648,309 +648,309 @@ function Oa(e, a, r, n, s, d) { ]), _: 3 }), - O(Ue, { class: "eli-cartao__conteudo" }, { - default: W(() => [ - ce(e.$slots, "default", {}, void 0, !0) + M(Ge, { class: "eli-cartao__conteudo" }, { + default: ee(() => [ + $e(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (f(), U(je, { + e.$slots.acoes ? (i(), z(Xe, { key: 0, class: "eli-cartao__acoes" }, { - default: W(() => [ - ce(e.$slots, "acoes", {}, void 0, !0) + default: ee(() => [ + $e(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : x("", !0) + })) : te("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const Ia = /* @__PURE__ */ H(Ba, [["render", Oa], ["__scopeId", "data-v-6c492bd9"]]); -function qa(e) { +const Ya = /* @__PURE__ */ Y(ja, [["render", Ha], ["__scopeId", "data-v-6c492bd9"]]); +function Ra(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var _e = { exports: {} }, Na = _e.exports, Ve; -function La() { - return Ve || (Ve = 1, (function(e, a) { - (function(r, n) { - e.exports = n(); - })(Na, (function() { - var r = 1e3, n = 6e4, s = 36e5, d = "millisecond", t = "second", l = "minute", v = "hour", o = "day", g = "week", y = "month", L = "quarter", A = "year", E = "date", p = "Invalid Date", q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|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, w = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(h) { - var c = ["th", "st", "nd", "rd"], i = h % 100; - return "[" + h + (c[(i - 20) % 10] || c[i] || c[0]) + "]"; - } }, X = function(h, c, i) { - var b = String(h); - return !b || b.length >= c ? h : "" + Array(c + 1 - b.length).join(i) + h; - }, K = { s: X, z: function(h) { - var c = -h.utcOffset(), i = Math.abs(c), b = Math.floor(i / 60), u = i % 60; - return (c <= 0 ? "+" : "-") + X(b, 2, "0") + ":" + X(u, 2, "0"); - }, m: function h(c, i) { - if (c.date() < i.date()) return -h(i, c); - var b = 12 * (i.year() - c.year()) + (i.month() - c.month()), u = c.clone().add(b, y), $ = i - u < 0, S = c.clone().add(b + ($ ? -1 : 1), y); - return +(-(b + (i - u) / ($ ? u - S : S - u)) || 0); - }, a: function(h) { - return h < 0 ? Math.ceil(h) || 0 : Math.floor(h); - }, p: function(h) { - return { M: y, y: A, w: g, d: o, D: E, h: v, m: l, s: t, ms: d, Q: L }[h] || String(h || "").toLowerCase().replace(/s$/, ""); - }, u: function(h) { - return h === void 0; - } }, re = "en", le = {}; - le[re] = w; - var he = "$isDayjsObject", fe = function(h) { - return h instanceof oe || !(!h || !h[he]); - }, ie = function h(c, i, b) { - var u; - if (!c) return re; - if (typeof c == "string") { - var $ = c.toLowerCase(); - le[$] && (u = $), i && (le[$] = i, u = $); - var S = c.split("-"); - if (!u && S.length > 1) return h(S[0]); +var Ve = { exports: {} }, Ja = Ve.exports, Ne; +function Wa() { + return Ne || (Ne = 1, (function(e, a) { + (function(o, r) { + e.exports = r(); + })(Ja, (function() { + var o = 1e3, r = 6e4, s = 36e5, f = "millisecond", t = "second", n = "minute", m = "hour", l = "day", c = "week", $ = "month", I = "quarter", D = "year", y = "date", v = "Invalid Date", T = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, C = /\[([^\]]+)]|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 p = ["th", "st", "nd", "rd"], u = E % 100; + return "[" + E + (p[(u - 20) % 10] || p[u] || p[0]) + "]"; + } }, oe = function(E, p, u) { + var h = String(E); + return !h || h.length >= p ? E : "" + Array(p + 1 - h.length).join(u) + E; + }, ie = { s: oe, z: function(E) { + var p = -E.utcOffset(), u = Math.abs(p), h = Math.floor(u / 60), d = u % 60; + return (p <= 0 ? "+" : "-") + oe(h, 2, "0") + ":" + oe(d, 2, "0"); + }, m: function E(p, u) { + if (p.date() < u.date()) return -E(u, p); + var h = 12 * (u.year() - p.year()) + (u.month() - p.month()), d = p.clone().add(h, $), S = u - d < 0, w = p.clone().add(h + (S ? -1 : 1), $); + return +(-(h + (u - d) / (S ? d - w : w - d)) || 0); + }, a: function(E) { + return E < 0 ? Math.ceil(E) || 0 : Math.floor(E); + }, p: function(E) { + return { M: $, y: D, w: c, d: l, D: y, h: m, m: n, s: t, ms: f, Q: I }[E] || String(E || "").toLowerCase().replace(/s$/, ""); + }, u: function(E) { + return E === void 0; + } }, re = "en", se = {}; + se[re] = k; + var ve = "$isDayjsObject", X = function(E) { + return E instanceof ge || !(!E || !E[ve]); + }, he = function E(p, u, h) { + var d; + if (!p) return re; + if (typeof p == "string") { + var S = p.toLowerCase(); + se[S] && (d = S), u && (se[S] = u, d = S); + var w = p.split("-"); + if (!d && w.length > 1) return E(w[0]); } else { - var B = c.name; - le[B] = c, u = B; + var N = p.name; + se[N] = p, d = N; } - return !b && u && (re = u), u || !b && re; - }, F = function(h, c) { - if (fe(h)) return h.clone(); - var i = typeof c == "object" ? c : {}; - return i.date = h, i.args = arguments, new oe(i); - }, N = K; - N.l = ie, N.i = fe, N.w = function(h, c) { - return F(h, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset }); + return !h && d && (re = d), d || !h && re; + }, G = function(E, p) { + if (X(E)) return E.clone(); + var u = typeof p == "object" ? p : {}; + return u.date = E, u.args = arguments, new ge(u); + }, P = ie; + P.l = he, P.i = X, P.w = function(E, p) { + return G(E, { locale: p.$L, utc: p.$u, x: p.$x, $offset: p.$offset }); }; - var oe = (function() { - function h(i) { - this.$L = ie(i.locale, null, !0), this.parse(i), this.$x = this.$x || i.x || {}, this[he] = !0; + var ge = (function() { + function E(u) { + this.$L = he(u.locale, null, !0), this.parse(u), this.$x = this.$x || u.x || {}, this[ve] = !0; } - var c = h.prototype; - return c.parse = function(i) { - this.$d = (function(b) { - var u = b.date, $ = b.utc; - if (u === null) return /* @__PURE__ */ new Date(NaN); - if (N.u(u)) return /* @__PURE__ */ new Date(); - if (u instanceof Date) return new Date(u); - if (typeof u == "string" && !/Z$/i.test(u)) { - var S = u.match(q); - if (S) { - var B = S[2] - 1 || 0, m = (S[7] || "0").substring(0, 3); - return $ ? new Date(Date.UTC(S[1], B, S[3] || 1, S[4] || 0, S[5] || 0, S[6] || 0, m)) : new Date(S[1], B, S[3] || 1, S[4] || 0, S[5] || 0, S[6] || 0, m); + var p = E.prototype; + return p.parse = function(u) { + this.$d = (function(h) { + var d = h.date, S = h.utc; + if (d === null) return /* @__PURE__ */ new Date(NaN); + if (P.u(d)) return /* @__PURE__ */ new Date(); + if (d instanceof Date) return new Date(d); + if (typeof d == "string" && !/Z$/i.test(d)) { + var w = d.match(T); + if (w) { + var N = w[2] - 1 || 0, F = (w[7] || "0").substring(0, 3); + return S ? new Date(Date.UTC(w[1], N, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, F)) : new Date(w[1], N, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, F); } } - return new Date(u); - })(i), this.init(); - }, c.init = function() { - var i = this.$d; - this.$y = i.getFullYear(), this.$M = i.getMonth(), this.$D = i.getDate(), this.$W = i.getDay(), this.$H = i.getHours(), this.$m = i.getMinutes(), this.$s = i.getSeconds(), this.$ms = i.getMilliseconds(); - }, c.$utils = function() { - return N; - }, c.isValid = function() { - return this.$d.toString() !== p; - }, c.isSame = function(i, b) { - var u = F(i); - return this.startOf(b) <= u && u <= this.endOf(b); - }, c.isAfter = function(i, b) { - return F(i) < this.startOf(b); - }, c.isBefore = function(i, b) { - return this.endOf(b) < F(i); - }, c.$g = function(i, b, u) { - return N.u(i) ? this[b] : this.set(u, i); - }, c.unix = function() { + return new Date(d); + })(u), this.init(); + }, p.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(); + }, p.$utils = function() { + return P; + }, p.isValid = function() { + return this.$d.toString() !== v; + }, p.isSame = function(u, h) { + var d = G(u); + return this.startOf(h) <= d && d <= this.endOf(h); + }, p.isAfter = function(u, h) { + return G(u) < this.startOf(h); + }, p.isBefore = function(u, h) { + return this.endOf(h) < G(u); + }, p.$g = function(u, h, d) { + return P.u(u) ? this[h] : this.set(d, u); + }, p.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, c.valueOf = function() { + }, p.valueOf = function() { return this.$d.getTime(); - }, c.startOf = function(i, b) { - var u = this, $ = !!N.u(b) || b, S = N.p(i), B = function(j, V) { - var Q = N.w(u.$u ? Date.UTC(u.$y, V, j) : new Date(u.$y, V, j), u); - return $ ? Q : Q.endOf(o); - }, m = function(j, V) { - return N.w(u.toDate()[j].apply(u.toDate("s"), ($ ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(V)), u); - }, C = this.$W, T = this.$M, P = this.$D, G = "set" + (this.$u ? "UTC" : ""); - switch (S) { - case A: - return $ ? B(1, 0) : B(31, 11); - case y: - return $ ? B(1, T) : B(0, T + 1); - case g: - var Y = this.$locale().weekStart || 0, R = (C < Y ? C + 7 : C) - Y; - return B($ ? P - R : P + (6 - R), T); - case o: - case E: - return m(G + "Hours", 0); - case v: - return m(G + "Minutes", 1); + }, p.startOf = function(u, h) { + var d = this, S = !!P.u(h) || h, w = P.p(u), N = function(O, L) { + var R = P.w(d.$u ? Date.UTC(d.$y, L, O) : new Date(d.$y, L, O), d); + return S ? R : R.endOf(l); + }, F = function(O, L) { + return P.w(d.toDate()[O].apply(d.toDate("s"), (S ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(L)), d); + }, W = this.$W, ae = this.$M, Z = this.$D, b = "set" + (this.$u ? "UTC" : ""); + switch (w) { + case D: + return S ? N(1, 0) : N(31, 11); + case $: + return S ? N(1, ae) : N(0, ae + 1); + case c: + var A = this.$locale().weekStart || 0, q = (W < A ? W + 7 : W) - A; + return N(S ? Z - q : Z + (6 - q), ae); case l: - return m(G + "Seconds", 2); + case y: + return F(b + "Hours", 0); + case m: + return F(b + "Minutes", 1); + case n: + return F(b + "Seconds", 2); case t: - return m(G + "Milliseconds", 3); + return F(b + "Milliseconds", 3); default: return this.clone(); } - }, c.endOf = function(i) { - return this.startOf(i, !1); - }, c.$set = function(i, b) { - var u, $ = N.p(i), S = "set" + (this.$u ? "UTC" : ""), B = (u = {}, u[o] = S + "Date", u[E] = S + "Date", u[y] = S + "Month", u[A] = S + "FullYear", u[v] = S + "Hours", u[l] = S + "Minutes", u[t] = S + "Seconds", u[d] = S + "Milliseconds", u)[$], m = $ === o ? this.$D + (b - this.$W) : b; - if ($ === y || $ === A) { - var C = this.clone().set(E, 1); - C.$d[B](m), C.init(), this.$d = C.set(E, Math.min(this.$D, C.daysInMonth())).$d; - } else B && this.$d[B](m); + }, p.endOf = function(u) { + return this.startOf(u, !1); + }, p.$set = function(u, h) { + var d, S = P.p(u), w = "set" + (this.$u ? "UTC" : ""), N = (d = {}, d[l] = w + "Date", d[y] = w + "Date", d[$] = w + "Month", d[D] = w + "FullYear", d[m] = w + "Hours", d[n] = w + "Minutes", d[t] = w + "Seconds", d[f] = w + "Milliseconds", d)[S], F = S === l ? this.$D + (h - this.$W) : h; + if (S === $ || S === D) { + var W = this.clone().set(y, 1); + W.$d[N](F), W.init(), this.$d = W.set(y, Math.min(this.$D, W.daysInMonth())).$d; + } else N && this.$d[N](F); return this.init(), this; - }, c.set = function(i, b) { - return this.clone().$set(i, b); - }, c.get = function(i) { - return this[N.p(i)](); - }, c.add = function(i, b) { - var u, $ = this; - i = Number(i); - var S = N.p(b), B = function(T) { - var P = F($); - return N.w(P.date(P.date() + Math.round(T * i)), $); + }, p.set = function(u, h) { + return this.clone().$set(u, h); + }, p.get = function(u) { + return this[P.p(u)](); + }, p.add = function(u, h) { + var d, S = this; + u = Number(u); + var w = P.p(h), N = function(ae) { + var Z = G(S); + return P.w(Z.date(Z.date() + Math.round(ae * u)), S); }; - if (S === y) return this.set(y, this.$M + i); - if (S === A) return this.set(A, this.$y + i); - if (S === o) return B(1); - if (S === g) return B(7); - var m = (u = {}, u[l] = n, u[v] = s, u[t] = r, u)[S] || 1, C = this.$d.getTime() + i * m; - return N.w(C, this); - }, c.subtract = function(i, b) { - return this.add(-1 * i, b); - }, c.format = function(i) { - var b = this, u = this.$locale(); - if (!this.isValid()) return u.invalidDate || p; - var $ = i || "YYYY-MM-DDTHH:mm:ssZ", S = N.z(this), B = this.$H, m = this.$m, C = this.$M, T = u.weekdays, P = u.months, G = u.meridiem, Y = function(V, Q, ae, te) { - return V && (V[Q] || V(b, $)) || ae[Q].slice(0, te); - }, R = function(V) { - return N.s(B % 12 || 12, V, "0"); - }, j = G || function(V, Q, ae) { - var te = V < 12 ? "AM" : "PM"; - return ae ? te.toLowerCase() : te; + if (w === $) return this.set($, this.$M + u); + if (w === D) return this.set(D, this.$y + u); + if (w === l) return N(1); + if (w === c) return N(7); + var F = (d = {}, d[n] = r, d[m] = s, d[t] = o, d)[w] || 1, W = this.$d.getTime() + u * F; + return P.w(W, this); + }, p.subtract = function(u, h) { + return this.add(-1 * u, h); + }, p.format = function(u) { + var h = this, d = this.$locale(); + if (!this.isValid()) return d.invalidDate || v; + var S = u || "YYYY-MM-DDTHH:mm:ssZ", w = P.z(this), N = this.$H, F = this.$m, W = this.$M, ae = d.weekdays, Z = d.months, b = d.meridiem, A = function(L, R, K, Q) { + return L && (L[R] || L(h, S)) || K[R].slice(0, Q); + }, q = function(L) { + return P.s(N % 12 || 12, L, "0"); + }, O = b || function(L, R, K) { + var Q = L < 12 ? "AM" : "PM"; + return K ? Q.toLowerCase() : Q; }; - return $.replace(D, (function(V, Q) { - return Q || (function(ae) { - switch (ae) { + return S.replace(C, (function(L, R) { + return R || (function(K) { + switch (K) { case "YY": - return String(b.$y).slice(-2); + return String(h.$y).slice(-2); case "YYYY": - return N.s(b.$y, 4, "0"); + return P.s(h.$y, 4, "0"); case "M": - return C + 1; + return W + 1; case "MM": - return N.s(C + 1, 2, "0"); + return P.s(W + 1, 2, "0"); case "MMM": - return Y(u.monthsShort, C, P, 3); + return A(d.monthsShort, W, Z, 3); case "MMMM": - return Y(P, C); + return A(Z, W); case "D": - return b.$D; + return h.$D; case "DD": - return N.s(b.$D, 2, "0"); + return P.s(h.$D, 2, "0"); case "d": - return String(b.$W); + return String(h.$W); case "dd": - return Y(u.weekdaysMin, b.$W, T, 2); + return A(d.weekdaysMin, h.$W, ae, 2); case "ddd": - return Y(u.weekdaysShort, b.$W, T, 3); + return A(d.weekdaysShort, h.$W, ae, 3); case "dddd": - return T[b.$W]; + return ae[h.$W]; case "H": - return String(B); + return String(N); case "HH": - return N.s(B, 2, "0"); + return P.s(N, 2, "0"); case "h": - return R(1); + return q(1); case "hh": - return R(2); + return q(2); case "a": - return j(B, m, !0); + return O(N, F, !0); case "A": - return j(B, m, !1); + return O(N, F, !1); case "m": - return String(m); + return String(F); case "mm": - return N.s(m, 2, "0"); + return P.s(F, 2, "0"); case "s": - return String(b.$s); + return String(h.$s); case "ss": - return N.s(b.$s, 2, "0"); + return P.s(h.$s, 2, "0"); case "SSS": - return N.s(b.$ms, 3, "0"); + return P.s(h.$ms, 3, "0"); case "Z": - return S; + return w; } return null; - })(V) || S.replace(":", ""); + })(L) || w.replace(":", ""); })); - }, c.utcOffset = function() { + }, p.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, c.diff = function(i, b, u) { - var $, S = this, B = N.p(b), m = F(i), C = (m.utcOffset() - this.utcOffset()) * n, T = this - m, P = function() { - return N.m(S, m); + }, p.diff = function(u, h, d) { + var S, w = this, N = P.p(h), F = G(u), W = (F.utcOffset() - this.utcOffset()) * r, ae = this - F, Z = function() { + return P.m(w, F); }; - switch (B) { - case A: - $ = P() / 12; + switch (N) { + case D: + S = Z() / 12; break; - case y: - $ = P(); + case $: + S = Z(); break; - case L: - $ = P() / 3; + case I: + S = Z() / 3; break; - case g: - $ = (T - C) / 6048e5; - break; - case o: - $ = (T - C) / 864e5; - break; - case v: - $ = T / s; + case c: + S = (ae - W) / 6048e5; break; case l: - $ = T / n; + S = (ae - W) / 864e5; + break; + case m: + S = ae / s; + break; + case n: + S = ae / r; break; case t: - $ = T / r; + S = ae / o; break; default: - $ = T; + S = ae; } - return u ? $ : N.a($); - }, c.daysInMonth = function() { - return this.endOf(y).$D; - }, c.$locale = function() { - return le[this.$L]; - }, c.locale = function(i, b) { - if (!i) return this.$L; - var u = this.clone(), $ = ie(i, b, !0); - return $ && (u.$L = $), u; - }, c.clone = function() { - return N.w(this.$d, this); - }, c.toDate = function() { + return d ? S : P.a(S); + }, p.daysInMonth = function() { + return this.endOf($).$D; + }, p.$locale = function() { + return se[this.$L]; + }, p.locale = function(u, h) { + if (!u) return this.$L; + var d = this.clone(), S = he(u, h, !0); + return S && (d.$L = S), d; + }, p.clone = function() { + return P.w(this.$d, this); + }, p.toDate = function() { return new Date(this.valueOf()); - }, c.toJSON = function() { + }, p.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, c.toISOString = function() { + }, p.toISOString = function() { return this.$d.toISOString(); - }, c.toString = function() { + }, p.toString = function() { return this.$d.toUTCString(); - }, h; - })(), pe = oe.prototype; - return F.prototype = pe, [["$ms", d], ["$s", t], ["$m", l], ["$H", v], ["$W", o], ["$M", y], ["$y", A], ["$D", E]].forEach((function(h) { - pe[h[1]] = function(c) { - return this.$g(c, h[0], h[1]); + }, E; + })(), Ce = ge.prototype; + return G.prototype = Ce, [["$ms", f], ["$s", t], ["$m", n], ["$H", m], ["$W", l], ["$M", $], ["$y", D], ["$D", y]].forEach((function(E) { + Ce[E[1]] = function(p) { + return this.$g(p, E[0], E[1]); }; - })), F.extend = function(h, c) { - return h.$i || (h(c, oe, F), h.$i = !0), F; - }, F.locale = ie, F.isDayjs = fe, F.unix = function(h) { - return F(1e3 * h); - }, F.en = le[re], F.Ls = le, F.p = {}, F; + })), G.extend = function(E, p) { + return E.$i || (E(p, ge, G), E.$i = !0), G; + }, G.locale = he, G.isDayjs = X, G.unix = function(E) { + return G(1e3 * E); + }, G.en = se[re], G.Ls = se, G.p = {}, G; })); - })(_e)), _e.exports; + })(Ve)), Ve.exports; } -var Fa = La(); -const Ce = /* @__PURE__ */ qa(Fa), Ua = z({ +var Za = Wa(); +const we = /* @__PURE__ */ Ra(Za), Ga = H({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1049,40 +1049,40 @@ const Ce = /* @__PURE__ */ qa(Fa), Ua = z({ foco: () => !0, desfoco: () => !0 }, - setup(e, { emit: a, attrs: r }) { - const n = M( + setup(e, { emit: a, attrs: o }) { + const r = V( () => e.modo === "data" ? "date" : "datetime-local" ); - function s(o) { - return e.modo === "data" ? Ce(o).format("YYYY-MM-DD") : Ce(o).format("YYYY-MM-DDTHH:mm"); + function s(l) { + return e.modo === "data" ? we(l).format("YYYY-MM-DD") : we(l).format("YYYY-MM-DDTHH:mm"); } - function d(o) { - return e.modo === "data" ? Ce(`${o}T00:00`).format() : Ce(o).format(); + function f(l) { + return e.modo === "data" ? we(`${l}T00:00`).format() : we(l).format(); } - const t = M({ + const t = V({ get: () => e.modelValue ? s(e.modelValue) : "", - set: (o) => { - const g = o && o.length > 0 ? o : null; - if (!g) { + set: (l) => { + const c = l && l.length > 0 ? l : null; + if (!c) { a("update:modelValue", null), a("alterar", null); return; } - const y = d(g); - a("update:modelValue", y), a("alterar", y); + const $ = f(c); + a("update:modelValue", $), a("alterar", $); } - }), l = M(() => { + }), n = V(() => { if (e.min) return s(e.min); - }), v = M(() => { + }), m = V(() => { if (e.max) return s(e.max); }); - return { attrs: r, valor: t, emit: a, minLocal: l, maxLocal: v, tipoInput: n }; + return { attrs: o, valor: t, emit: a, minLocal: n, maxLocal: m, tipoInput: r }; } -}), ja = { class: "eli-data-hora" }; -function za(e, a, r, n, s, d) { - return f(), _("div", ja, [ - O(Ne, de({ +}), Xa = { class: "eli-data-hora" }; +function Ka(e, a, o, r, s, f) { + return i(), g("div", Xa, [ + M(Ae, me({ modelValue: e.valor, "onUpdate:modelValue": a[0] || (a[0] = (t) => e.valor = t), type: e.tipoInput, @@ -1104,15 +1104,15 @@ function za(e, a, r, n, s, d) { }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const Ha = /* @__PURE__ */ H(Ua, [["render", za], ["__scopeId", "data-v-71afabb6"]]); -var Re = ((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))(Re || {}); +const Qa = /* @__PURE__ */ Y(Ga, [["render", Ka], ["__scopeId", "data-v-71afabb6"]]); +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 || {}); /** * @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 Ya = (e) => { +const xa = (e) => { for (const a in e) if (a.startsWith("aria-") || a === "role" || a === "title") return !0; @@ -1124,30 +1124,30 @@ const Ya = (e) => { * 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 qe = (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 Ra = (...e) => e.filter((a, r, n) => !!a && a.trim() !== "" && n.indexOf(a) === r).join(" ").trim(); +const et = (...e) => e.filter((a, o, r) => !!a && a.trim() !== "" && r.indexOf(a) === o).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 Te = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); +const Le = (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 Ja = (e) => e.replace( +const at = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, r, n) => n ? n.toUpperCase() : r.toLowerCase() + (a, o, r) => r ? r.toUpperCase() : o.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1155,8 +1155,8 @@ const Ja = (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 Wa = (e) => { - const a = Ja(e); +const tt = (e) => { + const a = at(e); return a.charAt(0).toUpperCase() + a.slice(1); }; /** @@ -1165,7 +1165,7 @@ const Wa = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -var ve = { +var Ee = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, @@ -1182,33 +1182,33 @@ var ve = { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Za = ({ +const ot = ({ name: e, iconNode: a, - absoluteStrokeWidth: r, - "absolute-stroke-width": n, + absoluteStrokeWidth: o, + "absolute-stroke-width": r, strokeWidth: s, - "stroke-width": d, - size: t = ve.width, - color: l = ve.stroke, - ...v -}, { slots: o }) => De( + "stroke-width": f, + size: t = Ee.width, + color: n = Ee.stroke, + ...m +}, { slots: l }) => Be( "svg", { - ...ve, - ...v, + ...Ee, + ...m, width: t, height: t, - stroke: l, - "stroke-width": Be(r) || Be(n) || r === !0 || n === !0 ? Number(s || d || ve["stroke-width"]) * 24 / Number(t) : s || d || ve["stroke-width"], - class: Ra( + stroke: n, + "stroke-width": qe(o) || qe(r) || o === !0 || r === !0 ? Number(s || f || Ee["stroke-width"]) * 24 / Number(t) : s || f || Ee["stroke-width"], + class: et( "lucide", - v.class, - ...e ? [`lucide-${Te(Wa(e))}-icon`, `lucide-${Te(e)}`] : ["lucide-icon"] + m.class, + ...e ? [`lucide-${Le(tt(e))}-icon`, `lucide-${Le(e)}`] : ["lucide-icon"] ), - ...!o.default && !Ya(v) && { "aria-hidden": "true" } + ...!l.default && !xa(m) && { "aria-hidden": "true" } }, - [...a.map((g) => De(...g)), ...o.default ? [o.default()] : []] + [...a.map((c) => Be(...c)), ...l.default ? [l.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1216,15 +1216,15 @@ const Za = ({ * 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) => (r, { slots: n, attrs: s }) => De( - Za, +const ye = (e, a) => (o, { slots: r, attrs: s }) => Be( + ot, { ...s, - ...r, + ...o, iconNode: a, name: e }, - n + r ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1232,7 +1232,7 @@ const Ae = (e, a) => (r, { slots: n, attrs: s }) => De( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Pe = Ae("arrow-down", [ +const Fe = ye("arrow-down", [ ["path", { d: "M12 5v14", key: "s699le" }], ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] ]); @@ -1242,7 +1242,7 @@ const Pe = Ae("arrow-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Oe = Ae("arrow-up", [ +const je = ye("arrow-up", [ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], ["path", { d: "M12 19V5", key: "x0mq9r" }] ]); @@ -1252,7 +1252,25 @@ const Oe = Ae("arrow-up", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ga = Ae("ellipsis-vertical", [ +const Ue = ye("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 ze = ye("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 nt = 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" }] @@ -1263,12 +1281,12 @@ const Ga = Ae("ellipsis-vertical", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Xa = Ae("search", [ +const lt = ye("search", [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] -]), Ka = z({ +]), rt = H({ name: "EliTabelaCaixaDeBusca", - components: { Search: Xa }, + components: { Search: lt }, props: { modelo: { type: String, @@ -1282,41 +1300,41 @@ const Xa = Ae("search", [ } }, setup(e, { emit: a }) { - const r = I(e.modelo ?? ""); - se( + const o = B(e.modelo ?? ""); + fe( () => e.modelo, (s) => { - s !== void 0 && s !== r.value && (r.value = s); + s !== void 0 && s !== o.value && (o.value = s); } ); - function n() { - a("buscar", r.value.trim()); + function r() { + a("buscar", o.value.trim()); } - return { texto: r, emitirBusca: n }; + return { texto: o, emitirBusca: r }; } -}), Qa = { class: "eli-tabela__busca" }, xa = { class: "eli-tabela__busca-input-wrapper" }; -function et(e, a, r, n, s, d) { - const t = J("Search"); - return f(), _("div", Qa, [ - k("div", xa, [ - Ke(k("input", { +}), st = { class: "eli-tabela__busca" }, it = { class: "eli-tabela__busca-input-wrapper" }; +function ut(e, a, o, r, s, f) { + const t = x("Search"); + return i(), g("div", st, [ + _("div", it, [ + ra(_("input", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (l) => e.texto = l), + "onUpdate:modelValue": a[0] || (a[0] = (n) => e.texto = n), type: "search", class: "eli-tabela__busca-input", placeholder: "Digite termos para filtrar", - onKeyup: a[1] || (a[1] = Qe((...l) => e.emitirBusca && e.emitirBusca(...l), ["enter"])) + onKeyup: a[1] || (a[1] = sa((...n) => e.emitirBusca && e.emitirBusca(...n), ["enter"])) }, null, 544), [ - [xe, e.texto] + [ia, e.texto] ]), - k("button", { + _("button", { type: "button", class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...l) => e.emitirBusca && e.emitirBusca(...l)) + onClick: a[2] || (a[2] = (...n) => e.emitirBusca && e.emitirBusca(...n)) }, [ - O(t, { + M(t, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -1326,9 +1344,9 @@ function et(e, a, r, n, s, d) { ]) ]); } -const at = /* @__PURE__ */ H(Ka, [["render", et], ["__scopeId", "data-v-f7b534c8"]]), tt = z({ +const dt = /* @__PURE__ */ Y(rt, [["render", ut], ["__scopeId", "data-v-341415d1"]]), ct = H({ name: "EliTabelaCabecalho", - components: { EliTabelaCaixaDeBusca: at }, + components: { EliTabelaCaixaDeBusca: dt }, props: { exibirBusca: { type: Boolean, @@ -1357,57 +1375,57 @@ const at = /* @__PURE__ */ H(Ka, [["render", et], ["__scopeId", "data-v-f7b534c8 } }, setup(e, { emit: a }) { - const r = M(() => e.acoesCabecalho.length > 0); - function n(d) { - a("buscar", d); + const o = V(() => e.acoesCabecalho.length > 0); + function r(f) { + a("buscar", f); } function s() { a("colunas"); } - return { temAcoesCabecalho: r, emitBuscar: n, emitColunas: s }; + return { temAcoesCabecalho: o, emitBuscar: r, emitColunas: s }; } -}), ot = { class: "eli-tabela__cabecalho" }, nt = { +}), pt = { class: "eli-tabela__cabecalho" }, mt = { key: 0, class: "eli-tabela__busca-grupo" -}, lt = { +}, ft = { key: 1, class: "eli-tabela__acoes-cabecalho" -}, rt = ["onClick"], it = { class: "eli-tabela__acoes-cabecalho-rotulo" }; -function st(e, a, r, n, s, d) { - const t = J("EliTabelaCaixaDeBusca"); - return f(), _("div", ot, [ - e.exibirBusca ? (f(), _("div", nt, [ - e.exibirBotaoColunas ? (f(), _("button", { +}, vt = ["onClick"], bt = { class: "eli-tabela__acoes-cabecalho-rotulo" }; +function ht(e, a, o, r, s, f) { + const t = x("EliTabelaCaixaDeBusca"); + return i(), g("div", pt, [ + e.exibirBusca ? (i(), g("div", mt, [ + e.exibirBotaoColunas ? (i(), g("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 ")) : x("", !0), - O(t, { + onClick: a[0] || (a[0] = (...n) => e.emitColunas && e.emitColunas(...n)) + }, " Colunas ")) : te("", !0), + M(t, { modelo: e.valorBusca, onBuscar: e.emitBuscar }, null, 8, ["modelo", "onBuscar"]) - ])) : x("", !0), - e.temAcoesCabecalho ? (f(), _("div", lt, [ - (f(!0), _(ee, null, ne(e.acoesCabecalho, (l, v) => (f(), _("button", { - key: `${l.rotulo}-${v}`, + ])) : te("", !0), + e.temAcoesCabecalho ? (i(), g("div", ft, [ + (i(!0), g(le, null, pe(e.acoesCabecalho, (n, m) => (i(), g("button", { + key: `${n.rotulo}-${m}`, type: "button", class: "eli-tabela__acoes-cabecalho-botao", - style: Se(l.cor ? { backgroundColor: l.cor, color: "#fff" } : void 0), - onClick: l.acao + style: Te(n.cor ? { backgroundColor: n.cor, color: "#fff" } : void 0), + onClick: n.acao }, [ - l.icone ? (f(), U(ke(l.icone), { + n.icone ? (i(), z(De(n.icone), { key: 0, class: "eli-tabela__acoes-cabecalho-icone", size: 16, "stroke-width": 2 - })) : x("", !0), - k("span", it, Z(l.rotulo), 1) - ], 12, rt))), 128)) - ])) : x("", !0) + })) : te("", !0), + _("span", bt, j(n.rotulo), 1) + ], 12, vt))), 128)) + ])) : te("", !0) ]); } -const ut = /* @__PURE__ */ H(tt, [["render", st], ["__scopeId", "data-v-5b4ab3b9"]]), dt = z({ +const gt = /* @__PURE__ */ Y(ct, [["render", ht], ["__scopeId", "data-v-42938cb8"]]), $t = H({ name: "EliTabelaEstados", props: { carregando: { @@ -1424,25 +1442,25 @@ const ut = /* @__PURE__ */ H(tt, [["render", st], ["__scopeId", "data-v-5b4ab3b9 default: void 0 } } -}), ct = { +}), yt = { key: 0, class: "eli-tabela eli-tabela--carregando", "aria-busy": "true" -}, mt = { +}, Ct = { key: 1, class: "eli-tabela eli-tabela--erro", role: "alert" -}, ft = { class: "eli-tabela__erro-mensagem" }, pt = { +}, _t = { class: "eli-tabela__erro-mensagem" }, Et = { key: 2, class: "eli-tabela eli-tabela--vazio" }; -function bt(e, a, r, n, s, d) { - return e.carregando ? (f(), _("div", ct, " Carregando... ")) : e.erro ? (f(), _("div", mt, [ - a[0] || (a[0] = k("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), - k("div", ft, Z(e.erro), 1) - ])) : (f(), _("div", pt, Z(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); +function kt(e, a, o, r, s, f) { + return e.carregando ? (i(), g("div", yt, " Carregando... ")) : e.erro ? (i(), g("div", Ct, [ + a[0] || (a[0] = _("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), + _("div", _t, j(e.erro), 1) + ])) : (i(), g("div", Et, j(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); } -const vt = /* @__PURE__ */ H(dt, [["render", bt]]), gt = z({ +const Dt = /* @__PURE__ */ Y($t, [["render", kt]]), St = H({ name: "EliTabelaDebug", props: { isDev: { @@ -1458,22 +1476,22 @@ const vt = /* @__PURE__ */ H(dt, [["render", bt]]), gt = z({ required: !0 } } -}), ht = { +}), wt = { 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, r, n, s, d) { - return e.isDev ? (f(), _("div", ht, [ - a[0] || (a[0] = k("div", null, [ - k("b", null, "EliTabela debug") +function Vt(e, a, o, r, s, f) { + return e.isDev ? (i(), g("div", wt, [ + a[0] || (a[0] = _("div", null, [ + _("b", null, "EliTabela debug") ], -1)), - k("div", null, "menuAberto: " + Z(e.menuAberto), 1), - k("div", null, "menuPos: top=" + Z(e.menuPopupPos.top) + ", left=" + Z(e.menuPopupPos.left), 1) - ])) : x("", !0); + _("div", null, "menuAberto: " + j(e.menuAberto), 1), + _("div", null, "menuPos: top=" + j(e.menuPopupPos.top) + ", left=" + j(e.menuPopupPos.left), 1) + ])) : te("", !0); } -const $t = /* @__PURE__ */ H(gt, [["render", yt]]), Ct = z({ +const At = /* @__PURE__ */ Y(St, [["render", Vt]]), Mt = H({ name: "EliTabelaHead", - components: { ArrowUp: Oe, ArrowDown: Pe }, + components: { ArrowUp: je, ArrowDown: Fe }, props: { colunas: { type: Array, @@ -1483,6 +1501,10 @@ const $t = /* @__PURE__ */ H(gt, [["render", yt]]), Ct = z({ type: Boolean, required: !0 }, + temColunasInvisiveis: { + type: Boolean, + required: !0 + }, colunaOrdenacao: { type: String, required: !0 @@ -1498,72 +1520,70 @@ const $t = /* @__PURE__ */ H(gt, [["render", yt]]), Ct = z({ } }, setup(e, { emit: a }) { - function r(d) { - return (d == null ? void 0 : d.coluna_ordem) !== void 0 && (d == null ? void 0 : d.coluna_ordem) !== null; + function o(s) { + return (s == null ? void 0 : s.coluna_ordem) !== void 0 && (s == null ? void 0 : s.coluna_ordem) !== null; } - function n(d) { - return d === "direita" ? "eli-tabela__celula--direita" : d === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; - } - function s(d) { - a("alternarOrdenacao", d); + function r(s) { + a("alternarOrdenacao", s); } return { - ArrowUp: Oe, - ArrowDown: Pe, - isOrdenavel: r, - obterClasseAlinhamento: n, - emitAlternarOrdenacao: s + ArrowUp: je, + ArrowDown: Fe, + isOrdenavel: o, + emitAlternarOrdenacao: r }; } -}), _t = { class: "eli-tabela__thead" }, St = { class: "eli-tabela__tr eli-tabela__tr--header" }, kt = ["onClick"], At = { class: "eli-tabela__th-texto" }, Dt = { +}), Bt = { class: "eli-tabela__thead" }, Tt = { class: "eli-tabela__tr eli-tabela__tr--header" }, It = { + key: 0, + class: "eli-tabela__th eli-tabela__th--expander", + scope: "col" +}, Pt = ["onClick"], Ot = { class: "eli-tabela__th-texto" }, Nt = { key: 1, class: "eli-tabela__th-label" -}, Et = { - key: 0, +}, qt = { + key: 1, class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }; -function Mt(e, a, r, n, s, d) { - const t = J("ArrowUp"); - return f(), _("thead", _t, [ - k("tr", St, [ - (f(!0), _(ee, null, ne(e.colunas, (l, v) => (f(), _("th", { - key: `th-${v}`, - class: me(["eli-tabela__th", [ - e.isOrdenavel(l) ? "eli-tabela__th--ordenavel" : void 0, - e.obterClasseAlinhamento(l.alinhamento) - ]]), +function Lt(e, a, o, r, s, f) { + const t = x("ArrowUp"); + return i(), g("thead", Bt, [ + _("tr", Tt, [ + e.temColunasInvisiveis ? (i(), g("th", It)) : te("", !0), + (i(!0), g(le, null, pe(e.colunas, (n, m) => (i(), g("th", { + key: `th-${m}`, + class: be(["eli-tabela__th", [e.isOrdenavel(n) ? "eli-tabela__th--ordenavel" : void 0]]), scope: "col" }, [ - e.isOrdenavel(l) ? (f(), _("button", { + e.isOrdenavel(n) ? (i(), g("button", { key: 0, type: "button", - class: me(["eli-tabela__th-botao", [ - e.colunaOrdenacao === String(l.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 + class: be(["eli-tabela__th-botao", [ + e.colunaOrdenacao === String(n.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 ]]), - onClick: (o) => e.emitAlternarOrdenacao(String(l.coluna_ordem)) + onClick: (l) => e.emitAlternarOrdenacao(String(n.coluna_ordem)) }, [ - k("span", At, Z(l.rotulo), 1), - e.colunaOrdenacao === String(l.coluna_ordem) ? (f(), U(ke(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { + _("span", Ot, j(n.rotulo), 1), + e.colunaOrdenacao === String(n.coluna_ordem) ? (i(), z(De(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { key: 0, class: "eli-tabela__th-icone", size: 16, "stroke-width": 2, "aria-hidden": "true" - })) : (f(), U(t, { + })) : (i(), z(t, { key: 1, class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", size: 16, "stroke-width": 2, "aria-hidden": "true" })) - ], 10, kt)) : (f(), _("span", Dt, Z(l.rotulo), 1)) + ], 10, Pt)) : (i(), g("span", Nt, j(n.rotulo), 1)) ], 2))), 128)), - e.temAcoes ? (f(), _("th", Et, " Ações ")) : x("", !0) + e.temAcoes ? (i(), g("th", qt, " Ações ")) : te("", !0) ]) ]); } -const wt = /* @__PURE__ */ H(Ct, [["render", Mt]]), Vt = z({ +const Ft = /* @__PURE__ */ Y(Mt, [["render", Lt]]), jt = H({ name: "EliTabelaCelulaTextoSimples", components: {}, props: { @@ -1578,12 +1598,42 @@ const wt = /* @__PURE__ */ H(Ct, [["render", Mt]]), Vt = z({ setup({ dados: e }) { return { dados: e }; } -}); -function Bt(e, a, r, n, s, d) { - var t; - return Z((t = e.dados) == null ? void 0 : t.texto); +}), Ut = { key: 1 }; +function zt(e, a, o, r, s, f) { + var t, n, m; + return (t = e.dados) != null && t.acao ? (i(), g("button", { + key: 0, + type: "button", + class: "eli-tabela__celula-link", + onClick: a[0] || (a[0] = ce((l) => e.dados.acao(), ["stop", "prevent"])) + }, j((n = e.dados) == null ? void 0 : n.texto), 1)) : (i(), g("span", Ut, j((m = e.dados) == null ? void 0 : m.texto), 1)); } -const Tt = /* @__PURE__ */ H(Vt, [["render", Bt]]), Pt = z({ +const Ht = /* @__PURE__ */ Y(jt, [["render", zt], ["__scopeId", "data-v-7a629ffa"]]), Yt = H({ + name: "EliTabelaCelulaTextoTruncado", + props: { + dados: { + type: Object + } + }, + setup({ dados: e }) { + return { dados: e }; + } +}), Rt = ["title"], Jt = ["title"]; +function Wt(e, a, o, r, s, f) { + var t, n, m, l, c; + return (t = e.dados) != null && t.acao ? (i(), g("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(($) => e.dados.acao(), ["stop", "prevent"])) + }, j((m = e.dados) == null ? void 0 : m.texto), 9, Rt)) : (i(), g("span", { + key: 1, + class: "eli-tabela__texto-truncado", + title: (l = e.dados) == null ? void 0 : l.texto + }, j((c = e.dados) == null ? void 0 : c.texto), 9, Jt)); +} +const Zt = /* @__PURE__ */ Y(Yt, [["render", Wt], ["__scopeId", "data-v-74854889"]]), Gt = H({ name: "EliTabelaCelulaNumero", components: {}, props: { @@ -1598,15 +1648,21 @@ const Tt = /* @__PURE__ */ H(Vt, [["render", Bt]]), Pt = z({ setup({ dados: e }) { return { dados: e }; } -}); -function Ot(e, a, r, n, s, d) { - var t; - return Z(String((t = e.dados) == null ? void 0 : t.numero).replace(".", ",")); +}), Xt = { key: 1 }; +function Kt(e, a, o, r, s, f) { + var t, n, m; + return (t = e.dados) != null && t.acao ? (i(), g("button", { + key: 0, + type: "button", + class: "eli-tabela__celula-link", + onClick: a[0] || (a[0] = ce((l) => e.dados.acao(), ["stop", "prevent"])) + }, j(String((n = e.dados) == null ? void 0 : n.numero).replace(".", ",")), 1)) : (i(), g("span", Xt, j(String((m = e.dados) == null ? void 0 : m.numero).replace(".", ",")), 1)); } -const It = /* @__PURE__ */ H(Pt, [["render", Ot]]), qt = { - textoSimples: Tt, - numero: It -}, Nt = z({ +const Qt = /* @__PURE__ */ Y(Gt, [["render", Kt], ["__scopeId", "data-v-e7bac7ff"]]), xt = { + textoSimples: Ht, + textoTruncado: Zt, + numero: Qt +}, eo = H({ name: "EliTabelaCelula", props: { celula: { @@ -1616,24 +1672,69 @@ const It = /* @__PURE__ */ H(Pt, [["render", Ot]]), qt = { } }, setup(e) { - const a = M(() => e.celula[0]), r = M(() => e.celula[1]), n = M(() => qt[a.value]), s = M(() => r.value); - return { Componente: n, dadosParaComponente: s }; + const a = V(() => e.celula[0]), o = V(() => e.celula[1]), r = V(() => xt[a.value]), s = V(() => o.value); + return { Componente: r, dadosParaComponente: s }; } }); -function Lt(e, a, r, n, s, d) { - return f(), U(ke(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +function ao(e, a, o, r, s, f) { + return i(), z(De(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); } -const Ft = /* @__PURE__ */ H(Nt, [["render", Lt]]), Ut = z({ +const aa = /* @__PURE__ */ Y(eo, [["render", ao]]), to = H({ + name: "EliTabelaDetalhesLinha", + components: { EliTabelaCelula: aa }, + props: { + linha: { + type: null, + required: !0 + }, + colunasInvisiveis: { + type: Array, + required: !0 + } + } +}), oo = { class: "eli-tabela__detalhes" }, no = { class: "eli-tabela__detalhe-rotulo" }, lo = { class: "eli-tabela__detalhe-valor" }; +function ro(e, a, o, r, s, f) { + const t = x("EliTabelaCelula"); + return i(), g("div", oo, [ + (i(!0), g(le, null, pe(e.colunasInvisiveis, (n, m) => (i(), g("div", { + key: `det-${m}-${n.rotulo}`, + class: "eli-tabela__detalhe" + }, [ + _("div", no, j(n.rotulo), 1), + _("div", lo, [ + M(t, { + celula: n.celula(e.linha) + }, null, 8, ["celula"]) + ]) + ]))), 128)) + ]); +} +const so = /* @__PURE__ */ Y(to, [["render", ro], ["__scopeId", "data-v-f1ee8d20"]]), io = H({ name: "EliTabelaBody", components: { - EliTabelaCelula: Ft, - MoreVertical: Ga + EliTabelaCelula: aa, + EliTabelaDetalhesLinha: so, + MoreVertical: nt, + ChevronRight: ze, + ChevronDown: Ue }, 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 @@ -1653,94 +1754,105 @@ const Ft = /* @__PURE__ */ H(Nt, [["render", Lt]]), Ut = z({ toggleMenu: { type: Function, required: !0 + }, + alternarLinhaExpandida: { + type: Function, + required: !0 } }, setup() { - function e(n) { - return n === "direita" ? "eli-tabela__celula--direita" : n === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; - } - function a(n) { - if (n != null) - return typeof n == "number" ? `${n}px` : String(n); - } - function r(n) { - if (!Array.isArray(n)) return; - const s = n[0], d = n[1]; - if (s === "textoSimples") - return typeof (d == null ? void 0 : d.texto) == "string" ? d.texto : void 0; - if (s === "numero") - return typeof (d == null ? void 0 : d.numero) == "number" ? String(d.numero) : void 0; - } return { - obterClasseAlinhamento: e, - obterMaxWidth: a, - obterTooltipCelula: r + ChevronRight: ze, + ChevronDown: Ue }; } -}), jt = { class: "eli-tabela__tbody" }, zt = ["onClick"], Ht = ["title"], Yt = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"]; -function Rt(e, a, r, n, s, d) { - const t = J("EliTabelaCelula"), l = J("MoreVertical"); - return f(), _("tbody", jt, [ - (f(!0), _(ee, null, ne(e.linhas, (v, o) => (f(), _("tr", { - key: `tr-${o}`, - class: me(["eli-tabela__tr", [o % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) - }, [ - (f(!0), _(ee, null, ne(e.colunas, (g, y) => (f(), _("td", { - key: `td-${o}-${y}`, - class: me(["eli-tabela__td", [ - g.acao ? "eli-tabela__td--clicavel" : void 0, - e.obterClasseAlinhamento(g.alinhamento) - ]]), - onClick: (L) => g.acao ? () => { - var A; - return (A = g.acao) == null ? void 0 : A.call(g); - } : void 0 +}), uo = { class: "eli-tabela__tbody" }, co = ["aria-expanded", "aria-label", "title", "onClick"], po = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"], mo = ["colspan"]; +function fo(e, a, o, r, s, f) { + const t = x("EliTabelaCelula"), n = x("MoreVertical"), m = x("EliTabelaDetalhesLinha"); + return i(), g("tbody", uo, [ + (i(!0), g(le, null, pe(e.linhas, (l, c) => { + var $, I, D, y, v, T; + return i(), g(le, { + key: `grp-${c}` }, [ - g.truncar ? (f(), _("span", { - key: 0, - class: "eli-tabela__celula-conteudo", - style: Se(g.largura_maxima ? { maxWidth: e.obterMaxWidth(g.largura_maxima) } : void 0), - title: e.obterTooltipCelula(g.celula(v)) + _("tr", { + class: be(["eli-tabela__tr", [c % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) }, [ - O(t, { - celula: g.celula(v) - }, null, 8, ["celula"]) - ], 12, Ht)) : (f(), U(t, { - key: 1, - celula: g.celula(v) - }, null, 8, ["celula"])) - ], 10, zt))), 128)), - e.temAcoes ? (f(), _("td", { - class: "eli-tabela__td eli-tabela__td--acoes", - key: `td-${o}-acoes` - }, [ - k("div", { - class: me(["eli-tabela__acoes-container", [e.menuAberto === o ? "eli-tabela__acoes-container--aberto" : void 0]]) - }, [ - k("button", { - class: "eli-tabela__acoes-toggle", - type: "button", - id: `eli-tabela-acoes-toggle-${o}`, - disabled: !e.possuiAcoes(o), - "aria-haspopup": "menu", - "aria-expanded": e.menuAberto === o ? "true" : "false", - "aria-controls": e.possuiAcoes(o) ? `eli-tabela-acoes-menu-${o}` : void 0, - "aria-label": e.possuiAcoes(o) ? "Ações da linha" : "Nenhuma ação disponível", - title: e.possuiAcoes(o) ? "Ações" : "Nenhuma ação disponível", - onClick: ue((g) => e.toggleMenu(o, g), ["stop"]) + e.temColunasInvisiveis ? (i(), g("td", { + class: "eli-tabela__td eli-tabela__td--expander", + key: `td-${c}-exp` }, [ - O(l, { - class: "eli-tabela__acoes-toggle-icone", - size: 18, - "stroke-width": 2 - }) - ], 8, Yt) - ], 2) - ])) : x("", !0) - ], 2))), 128)) + _("button", { + type: "button", + class: be(["eli-tabela__expander-botao", [($ = e.linhasExpandidas) != null && $[c] ? "eli-tabela__expander-botao--ativo" : void 0]]), + "aria-expanded": (I = e.linhasExpandidas) != null && I[c] ? "true" : "false", + "aria-label": (D = e.linhasExpandidas) != null && D[c] ? "Ocultar colunas ocultas" : "Mostrar colunas ocultas", + title: (y = e.linhasExpandidas) != null && y[c] ? "Ocultar detalhes" : "Mostrar detalhes", + onClick: ce((C) => e.alternarLinhaExpandida(c), ["stop"]) + }, [ + (i(), z(De((v = e.linhasExpandidas) != null && v[c] ? e.ChevronDown : e.ChevronRight), { + class: "eli-tabela__expander-icone", + size: 16, + "stroke-width": 2, + "aria-hidden": "true" + })) + ], 10, co) + ])) : te("", !0), + (i(!0), g(le, null, pe(e.colunas, (C, k) => (i(), g("td", { + key: `td-${c}-${k}`, + class: "eli-tabela__td" + }, [ + M(t, { + celula: C.celula(l) + }, null, 8, ["celula"]) + ]))), 128)), + e.temAcoes ? (i(), g("td", { + class: "eli-tabela__td eli-tabela__td--acoes", + key: `td-${c}-acoes` + }, [ + _("div", { + class: be(["eli-tabela__acoes-container", [e.menuAberto === c ? "eli-tabela__acoes-container--aberto" : void 0]]) + }, [ + _("button", { + class: "eli-tabela__acoes-toggle", + type: "button", + id: `eli-tabela-acoes-toggle-${c}`, + disabled: !e.possuiAcoes(c), + "aria-haspopup": "menu", + "aria-expanded": e.menuAberto === c ? "true" : "false", + "aria-controls": e.possuiAcoes(c) ? `eli-tabela-acoes-menu-${c}` : void 0, + "aria-label": e.possuiAcoes(c) ? "Ações da linha" : "Nenhuma ação disponível", + title: e.possuiAcoes(c) ? "Ações" : "Nenhuma ação disponível", + onClick: ce((C) => e.toggleMenu(c, C), ["stop"]) + }, [ + M(n, { + class: "eli-tabela__acoes-toggle-icone", + size: 18, + "stroke-width": 2 + }) + ], 8, po) + ], 2) + ])) : te("", !0) + ], 2), + e.temColunasInvisiveis && ((T = e.linhasExpandidas) != null && T[c]) ? (i(), g("tr", { + key: 0, + class: be(["eli-tabela__tr eli-tabela__tr--detalhes", [c % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) + }, [ + _("td", { + class: "eli-tabela__td eli-tabela__td--detalhes", + colspan: (e.temColunasInvisiveis ? 1 : 0) + e.colunas.length + (e.temAcoes ? 1 : 0) + }, [ + M(m, { + linha: l, + colunasInvisiveis: e.colunasInvisiveis + }, null, 8, ["linha", "colunasInvisiveis"]) + ], 8, mo) + ], 2)) : te("", !0) + ], 64); + }), 128)) ]); } -const Jt = /* @__PURE__ */ H(Ut, [["render", Rt]]), Wt = z({ +const vo = /* @__PURE__ */ Y(io, [["render", fo]]), bo = H({ name: "EliTabelaMenuAcoes", props: { menuAberto: { @@ -1766,58 +1878,58 @@ const Jt = /* @__PURE__ */ H(Ut, [["render", Rt]]), Wt = z({ return e !== null && typeof e == "object"; } }, - setup(e, { emit: a, expose: r }) { - const n = I(null); - r({ menuEl: n }); - const s = M(() => e.acoes.length > 0); - function d(t) { + setup(e, { emit: a, expose: o }) { + const r = B(null); + o({ menuEl: r }); + const s = V(() => e.acoes.length > 0); + function f(t) { e.linha && a("executar", { acao: t.acao, linha: e.linha }); } - return { menuEl: n, possuiAcoes: s, emitExecutar: d }; + return { menuEl: r, possuiAcoes: s, emitExecutar: f }; } -}), Zt = ["id", "aria-labelledby"], Gt = ["aria-label", "title", "onClick"], Xt = { class: "eli-tabela__acoes-item-texto" }; -function Kt(e, a, r, n, s, d) { - return f(), U(ea, { to: "body" }, [ - e.menuAberto !== null && e.possuiAcoes ? (f(), _("ul", { +}), ho = ["id", "aria-labelledby"], go = ["aria-label", "title", "onClick"], $o = { class: "eli-tabela__acoes-item-texto" }; +function yo(e, a, o, r, s, f) { + return i(), z(ua, { to: "body" }, [ + e.menuAberto !== null && e.possuiAcoes ? (i(), g("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: Se({ + style: Te({ position: "fixed", top: `${e.posicao.top}px`, left: `${e.posicao.left}px`, zIndex: 999999 }) }, [ - (f(!0), _(ee, null, ne(e.acoes, (t) => (f(), _("li", { + (i(!0), g(le, null, pe(e.acoes, (t) => (i(), g("li", { key: `acao-${e.menuAberto}-${t.indice}`, class: "eli-tabela__acoes-item", role: "none" }, [ - k("button", { + _("button", { type: "button", class: "eli-tabela__acoes-item-botao", - style: Se({ color: t.acao.cor }), + style: Te({ color: t.acao.cor }), role: "menuitem", "aria-label": t.acao.rotulo, title: t.acao.rotulo, - onClick: ue((l) => e.emitExecutar(t), ["stop"]) + onClick: ce((n) => e.emitExecutar(t), ["stop"]) }, [ - (f(), U(ke(t.acao.icone), { + (i(), z(De(t.acao.icone), { class: "eli-tabela__acoes-item-icone", size: 16, "stroke-width": 2 })), - k("span", Xt, Z(t.acao.rotulo), 1) - ], 12, Gt) + _("span", $o, j(t.acao.rotulo), 1) + ], 12, go) ]))), 128)) - ], 12, Zt)) : x("", !0) + ], 12, ho)) : te("", !0) ]); } -const Qt = /* @__PURE__ */ H(Wt, [["render", Kt]]), xt = z({ +const Co = /* @__PURE__ */ Y(bo, [["render", yo]]), _o = H({ name: "EliTabelaPaginacao", props: { pagina: { @@ -1839,89 +1951,89 @@ const Qt = /* @__PURE__ */ H(Wt, [["render", Kt]]), xt = z({ } }, setup(e, { emit: a }) { - const r = M(() => { - const o = e.maximoBotoes; - return typeof o == "number" && o >= 5 ? Math.floor(o) : 7; - }), n = M(() => { - const o = e.totalPaginas, g = e.pagina, y = r.value, L = [], A = (w) => { - L.push({ - label: String(w), - pagina: w, - ativo: w === g + const o = V(() => { + const l = e.maximoBotoes; + return typeof l == "number" && l >= 5 ? Math.floor(l) : 7; + }), r = V(() => { + const l = e.totalPaginas, c = e.pagina, $ = o.value, I = [], D = (k) => { + I.push({ + label: String(k), + pagina: k, + ativo: k === c }); - }, E = () => { - L.push({ label: "…", ehEllipsis: !0 }); + }, y = () => { + I.push({ label: "…", ehEllipsis: !0 }); }; - if (o <= y) { - for (let w = 1; w <= o; w += 1) - A(w); - return L; + if (l <= $) { + for (let k = 1; k <= l; k += 1) + D(k); + return I; } - const p = Math.max(3, y - 2); - let q = Math.max(2, g - Math.floor(p / 2)), D = q + p - 1; - D >= o && (D = o - 1, q = D - p + 1), A(1), q > 2 && E(); - for (let w = q; w <= D; w += 1) - A(w); - return D < o - 1 && E(), A(o), L; + const v = Math.max(3, $ - 2); + let T = Math.max(2, c - Math.floor(v / 2)), C = T + v - 1; + C >= l && (C = l - 1, T = C - v + 1), D(1), T > 2 && y(); + for (let k = T; k <= C; k += 1) + D(k); + return C < l - 1 && y(), D(l), I; }); - function s(o) { - if (!o) + function s(l) { + if (!l) return; - const g = Math.min(Math.max(1, o), e.totalPaginas); - g !== e.pagina && a("alterar", g); + const c = Math.min(Math.max(1, l), e.totalPaginas); + c !== e.pagina && a("alterar", c); } - const d = M(() => e.pagina <= 1), t = M(() => e.pagina >= e.totalPaginas), l = M(() => e.pagina), v = M(() => e.totalPaginas); + const f = V(() => e.pagina <= 1), t = V(() => e.pagina >= e.totalPaginas), n = V(() => e.pagina), m = V(() => e.totalPaginas); return { - botoes: n, + botoes: r, irParaPagina: s, - anteriorDesabilitado: d, + anteriorDesabilitado: f, proximaDesabilitada: t, - paginaAtual: l, - totalPaginasExibidas: v + paginaAtual: n, + totalPaginasExibidas: m }; } -}), eo = { +}), Eo = { key: 0, class: "eli-tabela__paginacao", role: "navigation", "aria-label": "Paginação de resultados" -}, ao = ["disabled"], to = { +}, ko = ["disabled"], Do = { key: 0, class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" -}, oo = ["disabled", "aria-current", "aria-label", "onClick"], no = ["disabled"]; -function lo(e, a, r, n, s, d) { - return e.totalPaginasExibidas > 1 ? (f(), _("nav", eo, [ - k("button", { +}, So = ["disabled", "aria-current", "aria-label", "onClick"], wo = ["disabled"]; +function Vo(e, a, o, r, s, f) { + return e.totalPaginasExibidas > 1 ? (i(), g("nav", Eo, [ + _("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, ao), - (f(!0), _(ee, null, ne(e.botoes, (t, l) => (f(), _(ee, { - key: `${t.label}-${l}` + }, " << ", 8, ko), + (i(!0), g(le, null, pe(e.botoes, (t, n) => (i(), g(le, { + key: `${t.label}-${n}` }, [ - t.ehEllipsis ? (f(), _("span", to, Z(t.label), 1)) : (f(), _("button", { + t.ehEllipsis ? (i(), g("span", Do, j(t.label), 1)) : (i(), g("button", { key: 1, type: "button", - class: me(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + class: be(["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: (v) => e.irParaPagina(t.pagina) - }, Z(t.label), 11, oo)) + onClick: (m) => e.irParaPagina(t.pagina) + }, j(t.label), 11, So)) ], 64))), 128)), - k("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, no) - ])) : x("", !0); + }, " >> ", 8, wo) + ])) : te("", !0); } -const ro = /* @__PURE__ */ H(xt, [["render", lo], ["__scopeId", "data-v-59d12455"]]), Ie = "application/x-eli-tabela-coluna", io = z({ +const Ao = /* @__PURE__ */ Y(_o, [["render", Vo], ["__scopeId", "data-v-5ca7a362"]]), He = "application/x-eli-tabela-coluna", Mo = H({ name: "EliTabelaModalColunas", props: { aberto: { @@ -1935,6 +2047,10 @@ const ro = /* @__PURE__ */ H(xt, [["render", lo], ["__scopeId", "data-v-59d12455 configInicial: { type: Object, required: !0 + }, + colunas: { + type: Array, + required: !0 } }, emits: { @@ -1946,218 +2062,221 @@ const ro = /* @__PURE__ */ H(xt, [["render", lo], ["__scopeId", "data-v-59d12455 } }, setup(e, { emit: a }) { - const r = I([]), n = I([]); + const o = B([]), r = B([]); function s() { - const E = e.rotulosColunas, p = new Set(e.configInicial.invisiveis ?? []), q = E.filter((K) => !p.has(K)), D = e.configInicial.visiveis ?? [], w = new Set(q), X = []; - for (const K of D) - w.has(K) && X.push(K); - for (const K of q) - X.includes(K) || X.push(K); - r.value = X, n.value = E.filter((K) => p.has(K)); + var se, ve; + const y = e.rotulosColunas, v = (((se = e.configInicial.visiveis) == null ? void 0 : se.length) ?? 0) > 0 || (((ve = e.configInicial.invisiveis) == null ? void 0 : ve.length) ?? 0) > 0, T = new Set( + e.colunas.filter((X) => X.visivel === !1).map((X) => X.rotulo) + ), C = v ? new Set(e.configInicial.invisiveis ?? []) : T, k = y.filter((X) => !C.has(X)), oe = e.configInicial.visiveis ?? [], ie = new Set(k), re = []; + for (const X of oe) + ie.has(X) && re.push(X); + for (const X of k) + re.includes(X) || re.push(X); + o.value = re, r.value = y.filter((X) => C.has(X)); } - se( - () => [e.aberto, e.rotulosColunas, e.configInicial], + fe( + () => [e.aberto, e.rotulosColunas, e.configInicial, e.colunas], () => { e.aberto && s(); }, { deep: !0, immediate: !0 } ); - function d() { + function f() { a("fechar"); } function t() { a("salvar", { - visiveis: [...r.value], - invisiveis: [...n.value] + visiveis: [...o.value], + invisiveis: [...r.value] }); } - function l(E, p) { - var q, D; + function n(y, v) { + var T, C; try { - (q = E.dataTransfer) == null || q.setData(Ie, JSON.stringify(p)), (D = E.dataTransfer) == null || D.setData("text/plain", p.rotulo), E.dataTransfer.effectAllowed = "move"; + (T = y.dataTransfer) == null || T.setData(He, JSON.stringify(v)), (C = y.dataTransfer) == null || C.setData("text/plain", v.rotulo), y.dataTransfer.effectAllowed = "move"; } catch { } } - function v(E) { - var p; + function m(y) { + var v; try { - const q = (p = E.dataTransfer) == null ? void 0 : p.getData(Ie); - if (!q) return null; - const D = JSON.parse(q); - return !D || typeof D.rotulo != "string" || D.origem !== "visiveis" && D.origem !== "invisiveis" ? null : D; + const T = (v = y.dataTransfer) == null ? void 0 : v.getData(He); + if (!T) return null; + const C = JSON.parse(T); + return !C || typeof C.rotulo != "string" || C.origem !== "visiveis" && C.origem !== "invisiveis" ? null : C; } catch { return null; } } - function o(E) { - const p = E.origem === "visiveis" ? r.value : n.value, q = p.indexOf(E.rotulo); - q >= 0 && p.splice(q, 1); + function l(y) { + const v = y.origem === "visiveis" ? o.value : r.value, T = v.indexOf(y.rotulo); + T >= 0 && v.splice(T, 1); } - function g(E, p, q) { - const D = E === "visiveis" ? r.value : n.value, w = D.indexOf(p); - w >= 0 && D.splice(w, 1), q === null || q < 0 || q > D.length ? D.push(p) : D.splice(q, 0, p); + function c(y, v, T) { + const C = y === "visiveis" ? o.value : r.value, k = C.indexOf(v); + k >= 0 && C.splice(k, 1), T === null || T < 0 || T > C.length ? C.push(v) : C.splice(T, 0, v); } - function y(E, p, q, D) { - l(E, { rotulo: p, origem: q, index: D }); + function $(y, v, T, C) { + n(y, { rotulo: v, origem: T, index: C }); } - function L(E, p, q) { - const D = v(E); - if (D) - if (o(D), g(p, D.rotulo, q), p === "visiveis") { - const w = n.value.indexOf(D.rotulo); - w >= 0 && n.value.splice(w, 1); + function I(y, v, T) { + const C = m(y); + if (C) + if (l(C), c(v, C.rotulo, T), v === "visiveis") { + const k = r.value.indexOf(C.rotulo); + k >= 0 && r.value.splice(k, 1); } else { - const w = r.value.indexOf(D.rotulo); - w >= 0 && r.value.splice(w, 1); + const k = o.value.indexOf(C.rotulo); + k >= 0 && o.value.splice(k, 1); } } - function A(E, p, q) { - const D = v(E); - if (D) - if (o(D), g(p, D.rotulo, null), p === "visiveis") { - const w = n.value.indexOf(D.rotulo); - w >= 0 && n.value.splice(w, 1); + function D(y, v, T) { + const C = m(y); + if (C) + if (l(C), c(v, C.rotulo, null), v === "visiveis") { + const k = r.value.indexOf(C.rotulo); + k >= 0 && r.value.splice(k, 1); } else { - const w = r.value.indexOf(D.rotulo); - w >= 0 && r.value.splice(w, 1); + const k = o.value.indexOf(C.rotulo); + k >= 0 && o.value.splice(k, 1); } } return { - visiveisLocal: r, - invisiveisLocal: n, - emitFechar: d, + visiveisLocal: o, + invisiveisLocal: r, + emitFechar: f, emitSalvar: t, - onDragStart: y, - onDropItem: L, - onDropLista: A + onDragStart: $, + onDropItem: I, + onDropLista: D }; } -}), so = { +}), Bo = { class: "eli-tabela-modal-colunas__modal", role: "dialog", "aria-modal": "true", "aria-label": "Configurar colunas" -}, uo = { class: "eli-tabela-modal-colunas__header" }, co = { class: "eli-tabela-modal-colunas__conteudo" }, mo = { class: "eli-tabela-modal-colunas__coluna" }, fo = ["onDragstart", "onDrop"], po = { class: "eli-tabela-modal-colunas__item-texto" }, bo = { class: "eli-tabela-modal-colunas__coluna" }, vo = ["onDragstart", "onDrop"], go = { class: "eli-tabela-modal-colunas__item-texto" }, ho = { class: "eli-tabela-modal-colunas__footer" }; -function yo(e, a, r, n, s, d) { - return e.aberto ? (f(), _("div", { +}, To = { class: "eli-tabela-modal-colunas__header" }, Io = { class: "eli-tabela-modal-colunas__conteudo" }, Po = { class: "eli-tabela-modal-colunas__coluna" }, Oo = ["onDragstart", "onDrop"], No = { class: "eli-tabela-modal-colunas__item-texto" }, qo = { class: "eli-tabela-modal-colunas__coluna" }, Lo = ["onDragstart", "onDrop"], Fo = { class: "eli-tabela-modal-colunas__item-texto" }, jo = { class: "eli-tabela-modal-colunas__footer" }; +function Uo(e, a, o, r, s, f) { + return e.aberto ? (i(), g("div", { key: 0, class: "eli-tabela-modal-colunas__overlay", role: "presentation", - onClick: a[9] || (a[9] = ue((...t) => e.emitFechar && e.emitFechar(...t), ["self"])) + onClick: a[9] || (a[9] = ce((...t) => e.emitFechar && e.emitFechar(...t), ["self"])) }, [ - k("div", so, [ - k("header", uo, [ - a[10] || (a[10] = k("h3", { class: "eli-tabela-modal-colunas__titulo" }, "Colunas", -1)), - k("button", { + _("div", Bo, [ + _("header", To, [ + 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)) }, " × ") ]), - k("div", co, [ - k("div", mo, [ - a[12] || (a[12] = k("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Invisíveis", -1)), - k("div", { + _("div", Io, [ + _("div", Po, [ + 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] = ue(() => { + onDragover: a[2] || (a[2] = ce(() => { }, ["prevent"])), - onDrop: a[3] || (a[3] = (t) => e.onDropLista(t, "invisiveis", null)) + onDrop: a[3] || (a[3] = (t) => e.onDropLista(t, "visiveis", null)) }, [ - (f(!0), _(ee, null, ne(e.invisiveisLocal, (t, l) => (f(), _("div", { - key: `inv-${t}`, - class: "eli-tabela-modal-colunas__item", - draggable: "true", - onDragstart: (v) => e.onDragStart(v, t, "invisiveis", l), - onDragover: a[1] || (a[1] = ue(() => { - }, ["prevent"])), - onDrop: (v) => e.onDropItem(v, "invisiveis", l) - }, [ - a[11] || (a[11] = k("span", { - class: "eli-tabela-modal-colunas__item-handle", - "aria-hidden": "true" - }, "⋮⋮", -1)), - k("span", po, Z(t), 1) - ], 40, fo))), 128)) - ], 32) - ]), - k("div", bo, [ - a[14] || (a[14] = k("div", { class: "eli-tabela-modal-colunas__coluna-titulo" }, "Visíveis", -1)), - k("div", { - class: "eli-tabela-modal-colunas__lista", - onDragover: a[5] || (a[5] = ue(() => { - }, ["prevent"])), - onDrop: a[6] || (a[6] = (t) => e.onDropLista(t, "visiveis", null)) - }, [ - (f(!0), _(ee, null, ne(e.visiveisLocal, (t, l) => (f(), _("div", { + (i(!0), g(le, null, pe(e.visiveisLocal, (t, n) => (i(), g("div", { key: `vis-${t}`, class: "eli-tabela-modal-colunas__item", draggable: "true", - onDragstart: (v) => e.onDragStart(v, t, "visiveis", l), - onDragover: a[4] || (a[4] = ue(() => { + onDragstart: (m) => e.onDragStart(m, t, "visiveis", n), + onDragover: a[1] || (a[1] = ce(() => { }, ["prevent"])), - onDrop: (v) => e.onDropItem(v, "visiveis", l) + onDrop: (m) => e.onDropItem(m, "visiveis", n) }, [ - a[13] || (a[13] = k("span", { + a[11] || (a[11] = _("span", { class: "eli-tabela-modal-colunas__item-handle", "aria-hidden": "true" }, "⋮⋮", -1)), - k("span", go, Z(t), 1) - ], 40, vo))), 128)) + _("span", No, j(t), 1) + ], 40, Oo))), 128)) + ], 32) + ]), + _("div", qo, [ + 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(() => { + }, ["prevent"])), + onDrop: a[6] || (a[6] = (t) => e.onDropLista(t, "invisiveis", null)) + }, [ + (i(!0), g(le, null, pe(e.invisiveisLocal, (t, n) => (i(), g("div", { + key: `inv-${t}`, + class: "eli-tabela-modal-colunas__item", + draggable: "true", + onDragstart: (m) => e.onDragStart(m, t, "invisiveis", n), + onDragover: a[4] || (a[4] = ce(() => { + }, ["prevent"])), + onDrop: (m) => e.onDropItem(m, "invisiveis", n) + }, [ + a[13] || (a[13] = _("span", { + class: "eli-tabela-modal-colunas__item-handle", + "aria-hidden": "true" + }, "⋮⋮", -1)), + _("span", Fo, j(t), 1) + ], 40, Lo))), 128)) ], 32) ]) ]), - k("footer", ho, [ - k("button", { + _("footer", jo, [ + _("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 "), - k("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 ") ]) ]) - ])) : x("", !0); + ])) : te("", !0); } -const $o = /* @__PURE__ */ H(io, [["render", yo], ["__scopeId", "data-v-c7d1b6d2"]]), Co = "eli:tabela"; -function Je(e) { - return `${Co}:${e}:colunas`; +const zo = /* @__PURE__ */ Y(Mo, [["render", Uo], ["__scopeId", "data-v-b8f693ef"]]), Ho = "eli:tabela"; +function ta(e) { + return `${Ho}:${e}:colunas`; } -function We(e) { +function oa(e) { if (!e || typeof e != "object") return { visiveis: [], invisiveis: [] }; - const a = e, r = Array.isArray(a.visiveis) ? a.visiveis.filter((s) => typeof s == "string") : [], n = Array.isArray(a.invisiveis) ? a.invisiveis.filter((s) => typeof s == "string") : []; - return { visiveis: r, invisiveis: n }; + const a = e, o = 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: o, invisiveis: r }; } -function qe(e) { +function Ye(e) { try { - const a = window.localStorage.getItem(Je(e)); - return a ? We(JSON.parse(a)) : { visiveis: [], invisiveis: [] }; + const a = window.localStorage.getItem(ta(e)); + return a ? oa(JSON.parse(a)) : { visiveis: [], invisiveis: [] }; } catch { return { visiveis: [], invisiveis: [] }; } } -function _o(e, a) { +function Yo(e, a) { try { - window.localStorage.setItem(Je(e), JSON.stringify(We(a))); + window.localStorage.setItem(ta(e), JSON.stringify(oa(a))); } catch { } } -const So = z({ +const Ro = H({ name: "EliTabela", inheritAttrs: !1, components: { - EliTabelaCabecalho: ut, - EliTabelaEstados: vt, - EliTabelaDebug: $t, - EliTabelaHead: wt, - EliTabelaBody: Jt, - EliTabelaMenuAcoes: Qt, - EliTabelaPaginacao: ro, - EliTabelaModalColunas: $o + EliTabelaCabecalho: gt, + EliTabelaEstados: Dt, + EliTabelaDebug: At, + EliTabelaHead: Ft, + EliTabelaBody: vo, + EliTabelaMenuAcoes: Co, + EliTabelaPaginacao: Ao, + EliTabelaModalColunas: zo }, props: { /** Configuração principal da tabela (colunas, consulta e ações) */ @@ -2167,135 +2286,156 @@ const So = z({ } }, setup(e) { - const r = I(!1), n = I(null), s = I([]), d = I(0), t = I([]), l = I(null), v = I(null), o = I({ top: 0, left: 0 }), g = I(""), y = I(1), L = I(null), A = I("asc"), E = M(() => e.tabela), p = M(() => !!e.tabela.mostrarCaixaDeBusca), q = M(() => e.tabela.acoesTabela ?? []), D = M(() => q.value.length > 0), w = I(!1), X = I( - qe(e.tabela.nome) - ), K = M(() => e.tabela.colunas.map((m) => m.rotulo)), re = M(() => { - const m = e.tabela.colunas, C = K.value, T = new Set(X.value.invisiveis ?? []), P = C.filter((V) => !T.has(V)), G = new Set(P), Y = X.value.visiveis ?? [], R = []; - for (const V of Y) - G.has(V) && R.push(V); - for (const V of P) - R.includes(V) || R.push(V); - const j = /* @__PURE__ */ new Map(); - for (const V of m) - j.has(V.rotulo) || j.set(V.rotulo, V); - return R.map((V) => j.get(V)).filter(Boolean); + const o = B(!1), r = B(null), s = B([]), f = B(0), t = B([]), n = B(null), m = B(null), l = B({ top: 0, left: 0 }), c = B(""), $ = B(1), I = B(null), D = B("asc"), y = V(() => e.tabela), v = V(() => !!e.tabela.mostrarCaixaDeBusca), T = V(() => e.tabela.acoesTabela ?? []), C = V(() => T.value.length > 0), k = B(!1), oe = B( + Ye(e.tabela.nome) + ), ie = B({}), re = V(() => e.tabela.colunas.map((b) => b.rotulo)), se = V(() => { + 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), L = b.filter((U) => O.has(U.rotulo)), R = q, K = /* @__PURE__ */ new Map(); + for (const U of L) + 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); + } + for (const U of L) + Q.includes(U) || Q.push(U); + return Q; + }), ve = V(() => se.value.length > 0), X = V(() => { + 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), L = new Set(O), R = A.filter((J) => !L.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); }); - function le() { - w.value = !0; - } function he() { - w.value = !1; + k.value = !0; } - function fe(m) { - X.value = m, _o(e.tabela.nome, m), w.value = !1; + function G() { + k.value = !1; } - const ie = M(() => { - const m = e.tabela.registros_por_consulta; - return typeof m == "number" && m > 0 ? Math.floor(m) : 10; - }), F = M(() => { - const m = ie.value; - if (!m || m <= 0) return 1; - const C = d.value; - return C ? Math.max(1, Math.ceil(C / m)) : 1; - }), N = M(() => (e.tabela.acoesLinha ?? []).length > 0); - let oe = 0; - function pe(m) { - var j, V, Q, ae, te, ye; - const C = m.getBoundingClientRect(), T = 8, P = ((Q = (V = (j = v.value) == null ? void 0 : j.menuEl) == null ? void 0 : V.value) == null ? void 0 : Q.offsetHeight) ?? 0, G = ((ye = (te = (ae = v.value) == null ? void 0 : ae.menuEl) == null ? void 0 : te.value) == null ? void 0 : ye.offsetWidth) ?? 180; - let Y = C.bottom + T; - const R = C.right - G; - P && Y + P > window.innerHeight - T && (Y = C.top - T - P), o.value = { - top: Math.max(T, Math.round(Y)), - left: Math.max(T, Math.round(R)) + function P(b) { + oe.value = b, Yo(e.tabela.nome, b), k.value = !1, ie.value = {}; + } + function ge(b) { + const A = !!ie.value[b]; + ie.value = { + ...ie.value, + [b]: !A }; } - function h(m) { - var T, P; - if (l.value === null) return; - const C = m.target; - (P = (T = v.value) == null ? void 0 : T.menuEl) != null && P.value && v.value.menuEl.value.contains(C) || (l.value = null); + const Ce = V(() => { + const b = e.tabela.registros_por_consulta; + return typeof b == "number" && b > 0 ? Math.floor(b) : 10; + }), E = V(() => { + const b = Ce.value; + if (!b || b <= 0) return 1; + const A = f.value; + return A ? Math.max(1, Math.ceil(A / b)) : 1; + }), p = V(() => (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 = m.value) == null ? void 0 : Q.menuEl) == null ? void 0 : ne.value) == null ? void 0 : ue.offsetHeight) ?? 0, L = ((J = (de = (U = m.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 - L; + O && R + O > window.innerHeight - q && (R = A.top - q - O), l.value = { + top: Math.max(q, Math.round(R)), + left: Math.max(q, Math.round(K)) + }; } - function c(m) { - if (m) { - if (L.value === m) { - A.value = A.value === "asc" ? "desc" : "asc", B(); + function d(b) { + var q, O; + if (n.value === null) return; + const A = b.target; + (O = (q = m.value) == null ? void 0 : q.menuEl) != null && O.value && m.value.menuEl.value.contains(A) || (n.value = null); + } + function S(b) { + if (b) { + if (I.value === b) { + D.value = D.value === "asc" ? "desc" : "asc", Z(); return; } - L.value = m, A.value = "asc", y.value !== 1 ? y.value = 1 : B(); + I.value = b, D.value = "asc", $.value !== 1 ? $.value = 1 : Z(); } } - function i(m) { - g.value !== m && (g.value = m, y.value !== 1 ? y.value = 1 : B()); + function w(b) { + c.value !== b && (c.value = b, $.value !== 1 ? $.value = 1 : Z()); } - function b(m) { - const C = Math.min(Math.max(1, m), F.value); - C !== y.value && (y.value = C); + function N(b) { + const A = Math.min(Math.max(1, b), E.value); + A !== $.value && ($.value = A); } - function u(m) { - const C = e.tabela.acoesLinha ?? [], T = t.value[m] ?? []; - return C.map((P, G) => { - const Y = P.exibir === void 0 ? !0 : typeof P.exibir == "boolean" ? P.exibir : !1; + function F(b) { + const A = e.tabela.acoesLinha ?? [], q = t.value[b] ?? []; + return A.map((O, L) => { + const R = O.exibir === void 0 ? !0 : typeof O.exibir == "boolean" ? O.exibir : !1; return { - acao: P, - indice: G, - visivel: T[G] ?? Y + acao: O, + indice: L, + visivel: q[L] ?? R }; - }).filter((P) => P.visivel); + }).filter((O) => O.visivel); } - function $(m) { - return u(m).length > 0; + function W(b) { + return F(b).length > 0; } - function S(m, C) { - if (!$(m)) return; - if (l.value === m) { - l.value = null; + function ae(b, A) { + if (!W(b)) return; + if (n.value === b) { + n.value = null; return; } - l.value = m; - const T = (C == null ? void 0 : C.currentTarget) ?? null; - T && (pe(T), requestAnimationFrame(() => pe(T))); + n.value = b; + const q = (A == null ? void 0 : A.currentTarget) ?? null; + q && (h(q), requestAnimationFrame(() => h(q))); } - async function B() { - var G, Y; - const m = ++oe; - r.value = !0, n.value = null, t.value = [], l.value = null; - const C = Math.max(1, ie.value), P = { - offSet: (y.value - 1) * C, - limit: C + async function Z() { + var L, R; + const b = ++u; + o.value = !0, r.value = null, t.value = [], n.value = null, ie.value = {}; + const A = Math.max(1, Ce.value), O = { + offSet: ($.value - 1) * A, + limit: A }; - g.value && (P.texto_busca = g.value), L.value && (P.coluna_ordem = L.value, P.direcao_ordem = A.value); + c.value && (O.texto_busca = c.value), I.value && (O.coluna_ordem = I.value, O.direcao_ordem = D.value); try { - const R = e.tabela, j = await R.consulta(P); - if (m !== oe) return; - if (j.cod !== Re.sucesso) { - s.value = [], d.value = 0, n.value = j.mensagem; + const K = e.tabela, Q = await K.consulta(O); + if (b !== u) return; + if (Q.cod !== ea.sucesso) { + s.value = [], f.value = 0, r.value = Q.mensagem; return; } - const V = ((G = j.valor) == null ? void 0 : G.valores) ?? [], Q = ((Y = j.valor) == null ? void 0 : Y.quantidade) ?? V.length; - s.value = V, d.value = Q; - const ae = Math.max(1, Math.ceil((Q || 0) / C)); - if (y.value > ae) { - y.value = ae; + const ne = ((L = Q.valor) == null ? void 0 : L.valores) ?? [], ue = ((R = Q.valor) == null ? void 0 : R.quantidade) ?? ne.length; + s.value = ne, f.value = ue; + const U = Math.max(1, Math.ceil((ue || 0) / A)); + if ($.value > U) { + $.value = U; return; } - const te = R.acoesLinha ?? []; - if (!te.length) { + const de = K.acoesLinha ?? []; + if (!de.length) { t.value = []; return; } - const ye = V.map( - () => te.map((be) => be.exibir === void 0 ? !0 : typeof be.exibir == "boolean" ? be.exibir : !1) + const J = ne.map( + () => de.map((_e) => _e.exibir === void 0 ? !0 : typeof _e.exibir == "boolean" ? _e.exibir : !1) ); - t.value = ye; - const Ze = await Promise.all( - V.map( - async (be) => Promise.all( - te.map(async ($e) => { - if ($e.exibir === void 0) return !0; - if (typeof $e.exibir == "boolean") return $e.exibir; + t.value = J; + const na = await Promise.all( + ne.map( + async (_e) => Promise.all( + de.map(async (Se) => { + if (Se.exibir === void 0) return !0; + if (typeof Se.exibir == "boolean") return Se.exibir; try { - const Ge = $e.exibir(be); - return !!await Promise.resolve(Ge); + const la = Se.exibir(_e); + return !!await Promise.resolve(la); } catch { return !1; } @@ -2303,154 +2443,340 @@ const So = z({ ) ) ); - m === oe && (t.value = Ze); - } catch (R) { - if (m !== oe) return; - s.value = [], d.value = 0, n.value = R instanceof Error ? R.message : "Erro ao carregar dados."; + b === u && (t.value = na); + } catch (K) { + if (b !== u) return; + s.value = [], f.value = 0, r.value = K instanceof Error ? K.message : "Erro ao carregar dados."; } finally { - m === oe && (r.value = !1); + b === u && (o.value = !1); } } - return aa(() => { - document.addEventListener("click", h), B(); - }), ta(() => { - document.removeEventListener("click", h); - }), se( + return da(() => { + document.addEventListener("click", d), Z(); + }), ca(() => { + document.removeEventListener("click", d); + }), fe( () => e.tabela.mostrarCaixaDeBusca, - (m) => { - !m && g.value && (g.value = "", y.value !== 1 ? y.value = 1 : B()); + (b) => { + !b && c.value && (c.value = "", $.value !== 1 ? $.value = 1 : Z()); } - ), se(y, (m, C) => { - m !== C && B(); - }), se( + ), fe($, (b, A) => { + b !== A && Z(); + }), fe( () => e.tabela, () => { - l.value = null, L.value = null, A.value = "asc", g.value = "", w.value = !1, X.value = qe(e.tabela.nome), y.value !== 1 ? y.value = 1 : B(); + n.value = null, I.value = null, D.value = "asc", c.value = "", k.value = !1, oe.value = Ye(e.tabela.nome), ie.value = {}, $.value !== 1 ? $.value = 1 : Z(); } - ), se( + ), fe( () => e.tabela.registros_por_consulta, () => { - y.value !== 1 ? y.value = 1 : B(); + $.value !== 1 ? $.value = 1 : Z(); } - ), se(s, () => { - l.value = null; + ), fe(s, () => { + n.value = null, ie.value = {}; }), { // state isDev: !1, - tabela: E, - carregando: r, - erro: n, + tabela: y, + carregando: o, + erro: r, linhas: s, - quantidade: d, - menuAberto: l, - valorBusca: g, - paginaAtual: y, - colunaOrdenacao: L, - direcaoOrdenacao: A, - totalPaginas: F, + quantidade: f, + menuAberto: n, + valorBusca: c, + paginaAtual: $, + colunaOrdenacao: I, + direcaoOrdenacao: D, + totalPaginas: E, // computed - exibirBusca: p, - acoesCabecalho: q, - temAcoesCabecalho: D, - temAcoes: N, - colunasEfetivas: re, - rotulosColunas: K, - modalColunasAberto: w, - configColunas: X, - abrirModalColunas: le, - fecharModalColunas: he, - salvarModalColunas: fe, + exibirBusca: v, + acoesCabecalho: T, + temAcoesCabecalho: C, + temAcoes: p, + colunasEfetivas: X, + rotulosColunas: re, + modalColunasAberto: k, + configColunas: oe, + temColunasInvisiveis: ve, + colunasInvisiveisEfetivas: se, + linhasExpandidas: ie, + abrirModalColunas: he, + fecharModalColunas: G, + salvarModalColunas: P, + alternarLinhaExpandida: ge, // actions - alternarOrdenacao: c, - atualizarBusca: i, - irParaPagina: b, - acoesDisponiveisPorLinha: u, - possuiAcoes: $, - toggleMenu: S, + alternarOrdenacao: S, + atualizarBusca: w, + irParaPagina: N, + acoesDisponiveisPorLinha: F, + possuiAcoes: W, + toggleMenu: ae, // popup - menuPopup: v, - menuPopupPos: o + menuPopup: m, + menuPopupPos: l }; } -}), ko = { class: "eli-tabela" }, Ao = { class: "eli-tabela__table" }; -function Do(e, a, r, n, s, d) { - const t = J("EliTabelaDebug"), l = J("EliTabelaEstados"), v = J("EliTabelaCabecalho"), o = J("EliTabelaModalColunas"), g = J("EliTabelaHead"), y = J("EliTabelaBody"), L = J("EliTabelaMenuAcoes"), A = J("EliTabelaPaginacao"); - return f(), _("div", ko, [ - O(t, { +}), Jo = { class: "eli-tabela" }, Wo = { class: "eli-tabela__table" }; +function Zo(e, a, o, r, s, f) { + const t = x("EliTabelaDebug"), n = x("EliTabelaEstados"), m = x("EliTabelaCabecalho"), l = x("EliTabelaModalColunas"), c = x("EliTabelaHead"), $ = x("EliTabelaBody"), I = x("EliTabelaMenuAcoes"), D = x("EliTabelaPaginacao"); + return i(), g("div", Jo, [ + M(t, { isDev: e.isDev, menuAberto: e.menuAberto, menuPopupPos: e.menuPopupPos }, null, 8, ["isDev", "menuAberto", "menuPopupPos"]), - e.carregando || e.erro || !e.linhas.length ? (f(), U(l, { + e.carregando || e.erro || !e.linhas.length ? (i(), z(n, { key: 0, carregando: e.carregando, erro: e.erro, mensagemVazio: e.tabela.mensagemVazio - }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (f(), _(ee, { key: 1 }, [ - e.exibirBusca || e.temAcoesCabecalho ? (f(), U(v, { + }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (i(), g(le, { key: 1 }, [ + e.exibirBusca || e.temAcoesCabecalho ? (i(), z(m, { key: 0, exibirBusca: e.exibirBusca, valorBusca: e.valorBusca, acoesCabecalho: e.acoesCabecalho, onBuscar: e.atualizarBusca, onColunas: e.abrirModalColunas - }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar", "onColunas"])) : x("", !0), - O(o, { + }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar", "onColunas"])) : te("", !0), + M(l, { aberto: e.modalColunasAberto, rotulosColunas: e.rotulosColunas, configInicial: e.configColunas, + colunas: e.tabela.colunas, onFechar: e.fecharModalColunas, onSalvar: e.salvarModalColunas - }, null, 8, ["aberto", "rotulosColunas", "configInicial", "onFechar", "onSalvar"]), - k("table", Ao, [ - O(g, { + }, null, 8, ["aberto", "rotulosColunas", "configInicial", "colunas", "onFechar", "onSalvar"]), + _("table", Wo, [ + M(c, { colunas: e.colunasEfetivas, temAcoes: e.temAcoes, + temColunasInvisiveis: e.temColunasInvisiveis, colunaOrdenacao: e.colunaOrdenacao, direcaoOrdenacao: e.direcaoOrdenacao, onAlternarOrdenacao: e.alternarOrdenacao - }, null, 8, ["colunas", "temAcoes", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), - O(y, { + }, null, 8, ["colunas", "temAcoes", "temColunasInvisiveis", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), + M($, { 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 - }, null, 8, ["colunas", "linhas", "temAcoes", "menuAberto", "possuiAcoes", "toggleMenu"]) + toggleMenu: e.toggleMenu, + alternarLinhaExpandida: e.alternarLinhaExpandida + }, null, 8, ["colunas", "colunasInvisiveis", "temColunasInvisiveis", "linhasExpandidas", "linhas", "temAcoes", "menuAberto", "possuiAcoes", "toggleMenu", "alternarLinhaExpandida"]) ]), - O(L, { + M(I, { 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: E, linha: p }) => { - e.menuAberto = null, E.acao(p); + onExecutar: a[0] || (a[0] = ({ acao: y, linha: v }) => { + e.menuAberto = null, y.acao(v); }) }, null, 8, ["menuAberto", "posicao", "acoes", "linha"]), - e.totalPaginas > 1 && e.quantidade > 0 ? (f(), U(A, { + e.totalPaginas > 1 && e.quantidade > 0 ? (i(), z(D, { key: 1, pagina: e.paginaAtual, totalPaginas: e.totalPaginas, maximoBotoes: e.tabela.maximo_botoes_paginacao, onAlterar: e.irParaPagina - }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : x("", !0) + }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : te("", !0) ], 64)) ]); } -const Eo = /* @__PURE__ */ H(So, [["render", Do]]), Uo = { +const Go = /* @__PURE__ */ Y(Ro, [["render", Zo]]), Xo = 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 r = V({ + get: () => e.value, + set: (s) => { + o("update:value", s), o("input", s), o("change", s); + } + }); + return { attrs: a, emit: o, localValue: r }; + } +}); +function Ko(e, a, o, r, s, f) { + var t, n, m, l; + return i(), z(Ae, me({ + modelValue: e.localValue, + "onUpdate:modelValue": a[0] || (a[0] = (c) => e.localValue = c), + label: (t = e.opcoes) == null ? void 0 : t.rotulo, + placeholder: (n = e.opcoes) == null ? void 0 : n.placeholder, + counter: (m = e.opcoes) == null ? void 0 : m.limiteCaracteres, + maxlength: (l = e.opcoes) == null ? void 0 : l.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 Qo = /* @__PURE__ */ Y(Xo, [["render", Ko]]); +function xo(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 o = a.indexOf("."); + return o === -1 ? 0 : a.slice(o + 1).replace(/0+$/, "").length; +} +function en(e) { + const a = (e ?? "").trim().replace(/,/g, "."); + if (!a) return null; + const o = Number(a); + return Number.isNaN(o) ? null : o; +} +function Me(e, a) { + return e == null ? "" : a === null ? String(e) : Number(e).toFixed(Math.max(0, a)).replace(/\./g, ","); +} +function Re(e) { + return (e ?? "").replace(/\D+/g, ""); +} +function an(e) { + const a = (e ?? "").replace(/[^0-9.,]+/g, ""), o = a.match(/[.,]/); + if (!o) return a; + const r = o[0], s = a.indexOf(r), f = a.slice(0, s).replace(/[.,]/g, ""), t = a.slice(s + 1).replace(/[.,]/g, ""); + return `${f.length ? f : "0"}${r}${t}`; +} +function tn(e, a) { + if (a === null) return e; + if (a <= 0) return e.replace(/[.,]/g, ""); + const o = e.match(/[.,]/); + if (!o) return e; + const r = o[0], s = e.indexOf(r), f = e.slice(0, s), t = e.slice(s + 1); + return `${f}${r}${t.slice(0, a)}`; +} +function on(e) { + const a = e.match(/^(\d+)[.,]$/); + if (!a) return null; + const o = Number(a[1]); + return Number.isNaN(o) ? null : o; +} +const nn = H({ + name: "EliEntradaNumero", + inheritAttrs: !1, + props: { + /** Interface padrão (EliEntrada): value + opcoes. */ + value: { + type: [Number, 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 r = V(() => { + var c; + const l = (c = e.opcoes) == null ? void 0 : c.precisao; + return l == null ? null : xo(l); + }), s = V(() => r.value === 0), f = V(() => { + const l = r.value; + return l !== null && l > 0; + }), t = B(""), n = B(void 0); + fe( + () => e.value, + (l) => { + l !== n.value && (t.value = Me(l, r.value), n.value = l); + }, + { immediate: !0 } + ); + function m(l) { + if (f.value) { + const D = r.value ?? 0, y = Re(l), v = y ? Number(y) : 0, T = Math.pow(10, D), C = y ? v / T : null, k = C === null ? null : C; + n.value = k, o("update:value", k), o("input", k), o("change", k), t.value = Me(k, D); + return; + } + const c = s.value ? Re(l) : an(l), $ = s.value ? c : tn(c, r.value); + let I = null; + if ($) { + const y = (s.value ? null : on($)) ?? en($); + I = y === null ? null : y; + } + n.value = I, o("update:value", I), o("input", I), o("change", I), t.value = Me(I, r.value); + } + return { attrs: a, emit: o, displayValue: t, isInteiro: s, onUpdateModelValue: m }; + } +}), ln = { class: "eli-entrada__prefixo" }, rn = { class: "eli-entrada__sufixo" }; +function sn(e, a, o, r, s, f) { + var t, n, m, l; + return i(), z(Ae, me({ + "model-value": e.displayValue, + label: (t = e.opcoes) == null ? void 0 : t.rotulo, + placeholder: (n = e.opcoes) == null ? void 0 : n.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")) + }), Je({ _: 2 }, [ + (m = e.opcoes) != null && m.prefixo ? { + name: "prepend-inner", + fn: ee(() => [ + _("span", ln, j(e.opcoes.prefixo), 1) + ]), + key: "0" + } : void 0, + (l = e.opcoes) != null && l.sufixo ? { + name: "append-inner", + fn: ee(() => [ + _("span", rn, j(e.opcoes.sufixo), 1) + ]), + key: "1" + } : void 0 + ]), 1040, ["model-value", "label", "placeholder", "type", "inputmode", "pattern", "onUpdate:modelValue"]); +} +const un = /* @__PURE__ */ Y(nn, [["render", sn], ["__scopeId", "data-v-77cbf216"]]), _n = { install(e) { - e.component("EliOlaMundo", Va), e.component("EliBotao", ze), e.component("EliBadge", Ee), e.component("EliInput", Ye), e.component("EliCartao", Ia), e.component("EliDataHora", Ha), e.component("EliTabela", Eo); + e.component("EliOlaMundo", Fa), e.component("EliBotao", Ke), e.component("EliBadge", Ie), e.component("EliInput", xe), e.component("EliCartao", Ya), e.component("EliDataHora", Qa), e.component("EliTabela", Go), e.component("EliEntradaTexto", Qo), e.component("EliEntradaNumero", un); } }; export { - Ee as EliBadge, - ze as EliBotao, - Ia as EliCartao, - Ha as EliDataHora, - Ye as EliInput, - Va as EliOlaMundo, - Eo as EliTabela, - Uo as default + Ie as EliBadge, + Ke as EliBotao, + Ya as EliCartao, + Qa as EliDataHora, + un as EliEntradaNumero, + Qo as EliEntradaTexto, + xe as EliInput, + Fa as EliOlaMundo, + Go as EliTabela, + _n as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index fadc49a..c17c64c 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,66 +1,76 @@ -(function(v,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):(v=typeof globalThis<"u"?globalThis:v||self,t(v.eli_vue={},v.Vue,v.VBtn,v.VBadge,v.VCheckbox,v.VIcon,v.VRadio,v.VRadioGroup,v.VSelect,v.VTextField,v.VTextarea,v.VCard,v.VGrid))})(this,(function(v,t,_e,Me,Ae,Ne,Te,ve,Pe,ue,Oe,G,Ie){"use strict";const qe=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 i=e.__vccOpts||e;for(const[r,c]of a)i[r]=c;return i};function Fe(e,a,i,r,c,u){return t.openBlock(),t.createBlock(_e.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 se=I(qe,[["render",Fe]]),me={suave:"4px",pill:"10px"},Le=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 me?me[e.radius]:e.radius),i=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),r=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:i,badgeStyle:r}}});function ze(e,a,i,r,c,u){return e.showBadge?(t.openBlock(),t.createBlock(Me.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 te=I(Le,[["render",ze],["__scopeId","data-v-371c8db4"]]);function je(e){return e.replace(/\D+/g,"")}function Ue(e){const a=je(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 He(e){return e.replace(/\D+/g,"")}function Re(e){const a=He(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 ce(e){return e.replace(/\D+/g,"")}function pe(e){const a=e.replace(/[^\d,]/g,""),i=a.split(",");return i.length>2?i[0]+","+i.slice(1).join(""):a}function Ye(e){return pe(e.replace(/%/g,""))}function Je(e){const a=ce(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function We(e){const a=ce(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Ge=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:i}){const r=t.ref(!1),c=t.ref(!1),u=t.computed({get:()=>e.modelValue,set:C=>{a("update:modelValue",C),a("change",C)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),l=t.computed(()=>e.type==="password"?c.value?"text":"password":"text"),g=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),n=t.computed(()=>e.error?"error":r.value?e.color:void 0);function h(C){const S=C.target;let f=S.value;switch(e.type){case"numericoInteiro":f=ce(f);break;case"numericoDecimal":f=pe(f);break;case"numericoMoeda":f=Je(f);break;case"porcentagem":f=Ye(f);break;case"telefone":f=Re(f);break;case"cpfCnpj":f=Ue(f);break;case"cep":f=We(f);break}S.value=f,a("update:modelValue",f),a("change",f)}function $(){c.value=!c.value}const P=t.computed(()=>(e.options||[]).map(C=>{if(C&&typeof C=="object"&&"value"in C){const f=C.value;return{label:C.label??String(f),value:f,disabled:C.disabled}}const S=C;return{label:String(S),value:S}}));return{attrs:i,value:u,isTextLike:o,inputHtmlType:l,inputMode:g,internalColor:n,showPassword:c,togglePassword:$,onInput:h,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:P}}}),Ze={class:"eli-input"},Xe={key:4,class:"checkbox-group"};function Ke(e,a,i,r,c,u){return t.openBlock(),t.createElementBlock("div",Ze,[e.isTextLike?(t.openBlock(),t.createBlock(ue.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(Ne.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(Oe.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(Pe.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(ve.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(Te.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",Xe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(Ae.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 de=I(Ge,[["render",Ke],["__scopeId","data-v-756cb549"]]),Qe=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:se,EliBadge:te,EliInput:de},setup(){const e=t.ref(""),a=t.ref([]),i=t.ref(""),r=t.ref(""),c=t.ref(""),u=t.ref(""),o=t.ref(""),l=t.ref(""),g=t.ref(""),n=t.ref(""),h=t.ref(""),$=t.ref(null),P=t.ref([]);return{nome:e,email:l,documento:h,estado:a,telefone:r,mensagem:g,senha:n,cor:$,habilidades:P,idade:c,altura:u,cep:i,valor:o}}}),xe={class:"grid-example"};function et(e,a,i,r,c,u){const o=t.resolveComponent("EliBadge"),l=t.resolveComponent("EliInput"),g=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ie.VContainer,null,{default:t.withCtx(()=>[t.createVNode(G.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(G.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(G.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",xe,[t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=n=>e.nome=n),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=n=>e.idade=n),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=n=>e.altura=n),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=n=>e.valor=n),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=n=>e.telefone=n),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=n=>e.cep=n),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(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]=n=>e.estado=n),multiple:""},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=n=>e.documento=n),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=n=>e.email=n),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=n=>e.senha=n),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(l,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=n=>e.mensagem=n),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(l,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=n=>e.cor=n),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(l,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=n=>e.habilidades=n),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=n=>e.nome=n),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(G.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(g,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const fe=I(Qe,[["render",et]]),tt=t.defineComponent({name:"EliCartao",components:{EliBadge:te},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 i=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"}}),c=t.computed(()=>`eli-cartao--${e.status}`);function u(){a("clicar",e.status)}return{rotuloStatus:i,corStatus:r,classeStatus:c,onClick:u}}}),at={class:"eli-cartao__titulo-texto"},ot={class:"eli-cartao__status"};function nt(e,a,i,r,c,u){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(G.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(G.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",at,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",ot,[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(G.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(G.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 be=I(tt,[["render",nt],["__scopeId","data-v-6c492bd9"]]);function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae={exports:{}},lt=ae.exports,ge;function it(){return ge||(ge=1,(function(e,a){(function(i,r){e.exports=r()})(lt,(function(){var i=1e3,r=6e4,c=36e5,u="millisecond",o="second",l="minute",g="hour",n="day",h="week",$="month",P="quarter",C="year",S="date",f="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|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,w={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(y){var m=["th","st","nd","rd"],s=y%100;return"["+y+(m[(s-20)%10]||m[s]||m[0])+"]"}},j=function(y,m,s){var b=String(y);return!b||b.length>=m?y:""+Array(m+1-b.length).join(s)+y},U={s:j,z:function(y){var m=-y.utcOffset(),s=Math.abs(m),b=Math.floor(s/60),d=s%60;return(m<=0?"+":"-")+j(b,2,"0")+":"+j(d,2,"0")},m:function y(m,s){if(m.date()1)return y(V[0])}else{var _=m.name;W[_]=m,d=_}return!b&&d&&(Z=d),d||!b&&Z},O=function(y,m){if(Q(y))return y.clone();var s=typeof m=="object"?m:{};return s.date=y,s.args=arguments,new J(s)},T=U;T.l=X,T.i=Q,T.w=function(y,m){return O(y,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var J=(function(){function y(s){this.$L=X(s.locale,null,!0),this.parse(s),this.$x=this.$x||s.x||{},this[re]=!0}var m=y.prototype;return m.parse=function(s){this.$d=(function(b){var d=b.date,k=b.utc;if(d===null)return new Date(NaN);if(T.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var V=d.match(N);if(V){var _=V[2]-1||0,p=(V[7]||"0").substring(0,3);return k?new Date(Date.UTC(V[1],_,V[3]||1,V[4]||0,V[5]||0,V[6]||0,p)):new Date(V[1],_,V[3]||1,V[4]||0,V[5]||0,V[6]||0,p)}}return new Date(d)})(s),this.init()},m.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()},m.$utils=function(){return T},m.isValid=function(){return this.$d.toString()!==f},m.isSame=function(s,b){var d=O(s);return this.startOf(b)<=d&&d<=this.endOf(b)},m.isAfter=function(s,b){return O(s)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:i}){const r=t.computed(()=>e.modo==="data"?"date":"datetime-local");function c(n){return e.modo==="data"?oe(n).format("YYYY-MM-DD"):oe(n).format("YYYY-MM-DDTHH:mm")}function u(n){return e.modo==="data"?oe(`${n}T00:00`).format():oe(n).format()}const o=t.computed({get:()=>e.modelValue?c(e.modelValue):"",set:n=>{const h=n&&n.length>0?n:null;if(!h){a("update:modelValue",null),a("alterar",null);return}const $=u(h);a("update:modelValue",$),a("alterar",$)}}),l=t.computed(()=>{if(e.min)return c(e.min)}),g=t.computed(()=>{if(e.max)return c(e.max)});return{attrs:i,valor:o,emit:a,minLocal:l,maxLocal:g,tipoInput:r}}}),dt={class:"eli-data-hora"};function ut(e,a,i,r,c,u){return t.openBlock(),t.createElementBlock("div",dt,[t.createVNode(ue.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=o=>e.emit("foco")),onBlur:a[2]||(a[2]=o=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const he=I(ct,[["render",ut],["__scopeId","data-v-71afabb6"]]);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||{});/** +(function(A,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(A=typeof globalThis<"u"?globalThis:A||self,t(A.eli_vue={},A.Vue,A.VBtn,A.VBadge,A.VCheckbox,A.VIcon,A.VRadio,A.VRadioGroup,A.VSelect,A.VTextField,A.VTextarea,A.VCard,A.VGrid))})(this,(function(A,t,Le,ze,je,Ue,He,Re,Ye,se,Je,ee,Ge){"use strict";const We=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),O=(e,a)=>{const n=e.__vccOpts||e;for(const[i,s]of a)n[i]=s;return n};function Ze(e,a,n,i,s,f){return t.openBlock(),t.createBlock(Le.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"eli-botao text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const pe=O(We,[["render",Ze]]),ge={suave:"4px",pill:"10px"},Xe=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ge?ge[e.radius]:e.radius),n=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),i=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:n,badgeStyle:i}}});function Ke(e,a,n,i,s,f){return e.showBadge?(t.openBlock(),t.createBlock(ze.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle,class:"eli-badge"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const ce=O(Xe,[["render",Ke],["__scopeId","data-v-371c8db4"]]);function Qe(e){return e.replace(/\D+/g,"")}function xe(e){const a=Qe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function et(e){return e.replace(/\D+/g,"")}function tt(e){const a=et(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function fe(e){return e.replace(/\D+/g,"")}function ye(e){const a=e.replace(/[^\d,]/g,""),n=a.split(",");return n.length>2?n[0]+","+n.slice(1).join(""):a}function at(e){return ye(e.replace(/%/g,""))}function ot(e){const a=fe(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function nt(e){const a=fe(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const lt=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:n}){const i=t.ref(!1),s=t.ref(!1),f=t.computed({get:()=>e.modelValue,set:C=>{a("update:modelValue",C),a("change",C)}}),o=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),l=t.computed(()=>e.type==="password"?s.value?"text":"password":"text"),p=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),r=t.computed(()=>e.error?"error":i.value?e.color:void 0);function u(C){const $=C.target;let b=$.value;switch(e.type){case"numericoInteiro":b=fe(b);break;case"numericoDecimal":b=ye(b);break;case"numericoMoeda":b=ot(b);break;case"porcentagem":b=at(b);break;case"telefone":b=tt(b);break;case"cpfCnpj":b=xe(b);break;case"cep":b=nt(b);break}$.value=b,a("update:modelValue",b),a("change",b)}function y(){s.value=!s.value}const _=t.computed(()=>(e.options||[]).map(C=>{if(C&&typeof C=="object"&&"value"in C){const b=C.value;return{label:C.label??String(b),value:b,disabled:C.disabled}}const $=C;return{label:String($),value:$}}));return{attrs:n,value:f,isTextLike:o,inputHtmlType:l,inputMode:p,internalColor:r,showPassword:s,togglePassword:y,onInput:u,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:_}}}),rt={class:"eli-input"},it={key:4,class:"checkbox-group"};function st(e,a,n,i,s,f){return t.openBlock(),t.createElementBlock("div",rt,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ue.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Je.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value=o),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ye.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value=o),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(Re.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=o=>e.value=o),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(He.VRadio,{key:String(o.value),label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",it,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,o=>(t.openBlock(),t.createBlock(je.VCheckbox,{key:String(o.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=l=>e.value=l),label:o.label,value:o.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const be=O(lt,[["render",st],["__scopeId","data-v-756cb549"]]),ct=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:pe,EliBadge:ce,EliInput:be},setup(){const e=t.ref(""),a=t.ref([]),n=t.ref(""),i=t.ref(""),s=t.ref(""),f=t.ref(""),o=t.ref(""),l=t.ref(""),p=t.ref(""),r=t.ref(""),u=t.ref(""),y=t.ref(null),_=t.ref([]);return{nome:e,email:l,documento:u,estado:a,telefone:i,mensagem:p,senha:r,cor:y,habilidades:_,idade:s,altura:f,cep:n,valor:o}}}),dt={class:"grid-example"};function ut(e,a,n,i,s,f){const o=t.resolveComponent("EliBadge"),l=t.resolveComponent("EliInput"),p=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ge.VContainer,null,{default:t.withCtx(()=>[t.createVNode(ee.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(o,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(ee.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",dt,[t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=r=>e.nome=r),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=r=>e.cep=r),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(l,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=r=>e.estado=r),multiple:""},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=r=>e.senha=r),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(l,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(l,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=r=>e.cor=r),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(l,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=r=>e.habilidades=r),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(l,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=r=>e.nome=r),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(ee.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(p,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const $e=O(ct,[["render",ut]]),mt=t.defineComponent({name:"EliCartao",components:{EliBadge:ce},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const n=t.computed(()=>e.status),i=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),s=t.computed(()=>`eli-cartao--${e.status}`);function f(){a("clicar",e.status)}return{rotuloStatus:n,corStatus:i,classeStatus:s,onClick:f}}}),pt={class:"eli-cartao__titulo-texto"},ft={class:"eli-cartao__status"};function bt(e,a,n,i,s,f){const o=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(ee.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(ee.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",pt,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",ft,[t.createVNode(o,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(ee.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(ee.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const ke=O(mt,[["render",bt],["__scopeId","data-v-6c492bd9"]]);function ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},gt=de.exports,Be;function yt(){return Be||(Be=1,(function(e,a){(function(n,i){e.exports=i()})(gt,(function(){var n=1e3,i=6e4,s=36e5,f="millisecond",o="second",l="minute",p="hour",r="day",u="week",y="month",_="quarter",C="year",$="date",b="Invalid Date",D=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var m=["th","st","nd","rd"],c=B%100;return"["+B+(m[(c-20)%10]||m[c]||m[0])+"]"}},G=function(B,m,c){var g=String(B);return!g||g.length>=m?B:""+Array(m+1-g.length).join(c)+B},K={s:G,z:function(B){var m=-B.utcOffset(),c=Math.abs(m),g=Math.floor(c/60),d=c%60;return(m<=0?"+":"-")+G(g,2,"0")+":"+G(d,2,"0")},m:function B(m,c){if(m.date()1)return B(S[0])}else{var M=m.name;X[M]=m,d=M}return!g&&d&&(Z=d),d||!g&&Z},U=function(B,m){if(H(B))return B.clone();var c=typeof m=="object"?m:{};return c.date=B,c.args=arguments,new ne(c)},w=K;w.l=oe,w.i=H,w.w=function(B,m){return U(B,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var ne=(function(){function B(c){this.$L=oe(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[te]=!0}var m=B.prototype;return m.parse=function(c){this.$d=(function(g){var d=g.date,V=g.utc;if(d===null)return new Date(NaN);if(w.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var S=d.match(D);if(S){var M=S[2]-1||0,I=(S[7]||"0").substring(0,3);return V?new Date(Date.UTC(S[1],M,S[3]||1,S[4]||0,S[5]||0,S[6]||0,I)):new Date(S[1],M,S[3]||1,S[4]||0,S[5]||0,S[6]||0,I)}}return new Date(d)})(c),this.init()},m.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},m.$utils=function(){return w},m.isValid=function(){return this.$d.toString()!==b},m.isSame=function(c,g){var d=U(c);return this.startOf(g)<=d&&d<=this.endOf(g)},m.isAfter=function(c,g){return U(c)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:n}){const i=t.computed(()=>e.modo==="data"?"date":"datetime-local");function s(r){return e.modo==="data"?ue(r).format("YYYY-MM-DD"):ue(r).format("YYYY-MM-DDTHH:mm")}function f(r){return e.modo==="data"?ue(`${r}T00:00`).format():ue(r).format()}const o=t.computed({get:()=>e.modelValue?s(e.modelValue):"",set:r=>{const u=r&&r.length>0?r:null;if(!u){a("update:modelValue",null),a("alterar",null);return}const y=f(u);a("update:modelValue",y),a("alterar",y)}}),l=t.computed(()=>{if(e.min)return s(e.min)}),p=t.computed(()=>{if(e.max)return s(e.max)});return{attrs:n,valor:o,emit:a,minLocal:l,maxLocal:p,tipoInput:i}}}),Bt={class:"eli-data-hora"};function Et(e,a,n,i,s,f){return t.openBlock(),t.createElementBlock("div",Bt,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=o=>e.valor=o),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=o=>e.emit("foco")),onBlur:a[2]||(a[2]=o=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const Ee=O(kt,[["render",Et],["__scopeId","data-v-71afabb6"]]);var Ce=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(Ce||{});/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mt=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + */const Ct=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $e=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 pt=(...e)=>e.filter((a,i,r)=>!!a&&a.trim()!==""&&r.indexOf(a)===i).join(" ").trim();/** + */const Vt=(...e)=>e.filter((a,n,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===n).join(" ").trim();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ke=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const Se=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ft=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,i,r)=>r?r.toUpperCase():i.toLowerCase());/** + */const St=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,n,i)=>i?i.toUpperCase():n.toLowerCase());/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bt=e=>{const a=ft(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + */const vt=e=>{const a=St(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var K={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** + */var le={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gt=({name:e,iconNode:a,absoluteStrokeWidth:i,"absolute-stroke-width":r,strokeWidth:c,"stroke-width":u,size:o=K.width,color:l=K.stroke,...g},{slots:n})=>t.h("svg",{...K,...g,width:o,height:o,stroke:l,"stroke-width":$e(i)||$e(r)||i===!0||r===!0?Number(c||u||K["stroke-width"])*24/Number(o):c||u||K["stroke-width"],class:pt("lucide",g.class,...e?[`lucide-${ke(bt(e))}-icon`,`lucide-${ke(e)}`]:["lucide-icon"]),...!n.default&&!mt(g)&&{"aria-hidden":"true"}},[...a.map(h=>t.h(...h)),...n.default?[n.default()]:[]]);/** + */const Dt=({name:e,iconNode:a,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:s,"stroke-width":f,size:o=le.width,color:l=le.stroke,...p},{slots:r})=>t.h("svg",{...le,...p,width:o,height:o,stroke:l,"stroke-width":Ve(n)||Ve(i)||n===!0||i===!0?Number(s||f||le["stroke-width"])*24/Number(o):s||f||le["stroke-width"],class:Vt("lucide",p.class,...e?[`lucide-${Se(vt(e))}-icon`,`lucide-${Se(e)}`]:["lucide-icon"]),...!r.default&&!Ct(p)&&{"aria-hidden":"true"}},[...a.map(u=>t.h(...u)),...r.default?[r.default()]:[]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ne=(e,a)=>(i,{slots:r,attrs:c})=>t.h(gt,{...c,...i,iconNode:a,name:e},r);/** + */const ae=(e,a)=>(n,{slots:i,attrs:s})=>t.h(Dt,{...s,...n,iconNode:a,name:e},i);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Be=ne("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const ve=ae("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ve=ne("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const De=ae("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ht=ne("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 _e=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yt=ne("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),$t=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:yt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const i=t.ref(e.modelo??"");t.watch(()=>e.modelo,c=>{c!==void 0&&c!==i.value&&(i.value=c)});function r(){a("buscar",i.value.trim())}return{texto:i,emitirBusca:r}}}),kt={class:"eli-tabela__busca"},Bt={class:"eli-tabela__busca-input-wrapper"};function Vt(e,a,i,r,c,u){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",kt,[t.createElementVNode("div",Bt,[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 Ct=I($t,[["render",Vt],["__scopeId","data-v-f7b534c8"]]),Et=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:Ct},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 i=t.computed(()=>e.acoesCabecalho.length>0);function r(u){a("buscar",u)}function c(){a("colunas")}return{temAcoesCabecalho:i,emitBuscar:r,emitColunas:c}}}),St={class:"eli-tabela__cabecalho"},wt={key:0,class:"eli-tabela__busca-grupo"},Dt={key:1,class:"eli-tabela__acoes-cabecalho"},_t=["onClick"],Mt={class:"eli-tabela__acoes-cabecalho-rotulo"};function At(e,a,i,r,c,u){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",St,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",wt,[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",Dt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(l,g)=>(t.openBlock(),t.createElementBlock("button",{key:`${l.rotulo}-${g}`,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",Mt,t.toDisplayString(l.rotulo),1)],12,_t))),128))])):t.createCommentVNode("",!0)])}const Nt=I(Et,[["render",At],["__scopeId","data-v-5b4ab3b9"]]),Tt=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"},Pt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Ot={class:"eli-tabela__erro-mensagem"},It={key:2,class:"eli-tabela eli-tabela--vazio"};function qt(e,a,i,r,c,u){return e.carregando?(t.openBlock(),t.createElementBlock("div",vt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Pt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Ot,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",It,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Ft=I(Tt,[["render",qt]]),Lt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),zt={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 jt(e,a,i,r,c,u){return e.isDev?(t.openBlock(),t.createElementBlock("div",zt,[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 Ut=I(Lt,[["render",jt]]),Ht=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:Ve,ArrowDown:Be},props:{colunas:{type:Array,required:!0},temAcoes:{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 i(u){return(u==null?void 0:u.coluna_ordem)!==void 0&&(u==null?void 0:u.coluna_ordem)!==null}function r(u){return u==="direita"?"eli-tabela__celula--direita":u==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function c(u){a("alternarOrdenacao",u)}return{ArrowUp:Ve,ArrowDown:Be,isOrdenavel:i,obterClasseAlinhamento:r,emitAlternarOrdenacao:c}}}),Rt={class:"eli-tabela__thead"},Yt={class:"eli-tabela__tr eli-tabela__tr--header"},Jt=["onClick"],Wt={class:"eli-tabela__th-texto"},Gt={key:1,class:"eli-tabela__th-label"},Zt={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Xt(e,a,i,r,c,u){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",Rt,[t.createElementVNode("tr",Yt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(l,g)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${g}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(l)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(l.alinhamento)]]),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:n=>e.emitAlternarOrdenacao(String(l.coluna_ordem))},[t.createElementVNode("span",Wt,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,Jt)):(t.openBlock(),t.createElementBlock("span",Gt,t.toDisplayString(l.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",Zt," Ações ")):t.createCommentVNode("",!0)])])}const Kt=I(Ht,[["render",Xt]]),Qt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function xt(e,a,i,r,c,u){var o;return t.toDisplayString((o=e.dados)==null?void 0:o.texto)}const ea=I(Qt,[["render",xt]]),ta=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function aa(e,a,i,r,c,u){var o;return t.toDisplayString(String((o=e.dados)==null?void 0:o.numero).replace(".",","))}const oa={textoSimples:ea,numero:I(ta,[["render",aa]])},na=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),i=t.computed(()=>e.celula[1]),r=t.computed(()=>oa[a.value]),c=t.computed(()=>i.value);return{Componente:r,dadosParaComponente:c}}});function ra(e,a,i,r,c,u){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const la=I(na,[["render",ra]]),ia=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:la,MoreVertical:ht},props:{colunas:{type:Array,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}},setup(){function e(r){return r==="direita"?"eli-tabela__celula--direita":r==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function a(r){if(r!=null)return typeof r=="number"?`${r}px`:String(r)}function i(r){if(!Array.isArray(r))return;const c=r[0],u=r[1];if(c==="textoSimples")return typeof(u==null?void 0:u.texto)=="string"?u.texto:void 0;if(c==="numero")return typeof(u==null?void 0:u.numero)=="number"?String(u.numero):void 0}return{obterClasseAlinhamento:e,obterMaxWidth:a,obterTooltipCelula:i}}}),sa={class:"eli-tabela__tbody"},ca=["onClick"],da=["title"],ua=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"];function ma(e,a,i,r,c,u){const o=t.resolveComponent("EliTabelaCelula"),l=t.resolveComponent("MoreVertical");return t.openBlock(),t.createElementBlock("tbody",sa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(g,n)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${n}`,class:t.normalizeClass(["eli-tabela__tr",[n%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(h,$)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${n}-${$}`,class:t.normalizeClass(["eli-tabela__td",[h.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(h.alinhamento)]]),onClick:P=>h.acao?()=>{var C;return(C=h.acao)==null?void 0:C.call(h)}:void 0},[h.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(h.largura_maxima?{maxWidth:e.obterMaxWidth(h.largura_maxima)}:void 0),title:e.obterTooltipCelula(h.celula(g))},[t.createVNode(o,{celula:h.celula(g)},null,8,["celula"])],12,da)):(t.openBlock(),t.createBlock(o,{key:1,celula:h.celula(g)},null,8,["celula"]))],10,ca))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${n}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===n?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${n}`,disabled:!e.possuiAcoes(n),"aria-haspopup":"menu","aria-expanded":e.menuAberto===n?"true":"false","aria-controls":e.possuiAcoes(n)?`eli-tabela-acoes-menu-${n}`:void 0,"aria-label":e.possuiAcoes(n)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(n)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(h=>e.toggleMenu(n,h),["stop"])},[t.createVNode(l,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,ua)],2)])):t.createCommentVNode("",!0)],2))),128))])}const pa=I(ia,[["render",ma]]),fa=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:i}){const r=t.ref(null);i({menuEl:r});const c=t.computed(()=>e.acoes.length>0);function u(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:r,possuiAcoes:c,emitExecutar:u}}}),ba=["id","aria-labelledby"],ga=["aria-label","title","onClick"],ha={class:"eli-tabela__acoes-item-texto"};function ya(e,a,i,r,c,u){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",ha,t.toDisplayString(o.acao.rotulo),1)],12,ga)]))),128))],12,ba)):t.createCommentVNode("",!0)])}const $a=I(fa,[["render",ya]]),ka=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 i=t.computed(()=>{const n=e.maximoBotoes;return typeof n=="number"&&n>=5?Math.floor(n):7}),r=t.computed(()=>{const n=e.totalPaginas,h=e.pagina,$=i.value,P=[],C=w=>{P.push({label:String(w),pagina:w,ativo:w===h})},S=()=>{P.push({label:"…",ehEllipsis:!0})};if(n<=$){for(let w=1;w<=n;w+=1)C(w);return P}const f=Math.max(3,$-2);let N=Math.max(2,h-Math.floor(f/2)),E=N+f-1;E>=n&&(E=n-1,N=E-f+1),C(1),N>2&&S();for(let w=N;w<=E;w+=1)C(w);return Ee.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),l=t.computed(()=>e.pagina),g=t.computed(()=>e.totalPaginas);return{botoes:r,irParaPagina:c,anteriorDesabilitado:u,proximaDesabilitada:o,paginaAtual:l,totalPaginasExibidas:g}}}),Ba={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},Va=["disabled"],Ca={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Ea=["disabled","aria-current","aria-label","onClick"],Sa=["disabled"];function wa(e,a,i,r,c,u){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Ba,[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,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${l}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",Ca,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:g=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,Ea))],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,Sa)])):t.createCommentVNode("",!0)}const Da=I(ka,[["render",wa],["__scopeId","data-v-59d12455"]]),Ce="application/x-eli-tabela-coluna",_a=t.defineComponent({name:"EliTabelaModalColunas",props:{aberto:{type:Boolean,required:!0},rotulosColunas:{type:Array,required:!0},configInicial:{type:Object,required:!0}},emits:{fechar(){return!0},salvar(e){return!0}},setup(e,{emit:a}){const i=t.ref([]),r=t.ref([]);function c(){const S=e.rotulosColunas,f=new Set(e.configInicial.invisiveis??[]),N=S.filter(U=>!f.has(U)),E=e.configInicial.visiveis??[],w=new Set(N),j=[];for(const U of E)w.has(U)&&j.push(U);for(const U of N)j.includes(U)||j.push(U);i.value=j,r.value=S.filter(U=>f.has(U))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial],()=>{e.aberto&&c()},{deep:!0,immediate:!0});function u(){a("fechar")}function o(){a("salvar",{visiveis:[...i.value],invisiveis:[...r.value]})}function l(S,f){var N,E;try{(N=S.dataTransfer)==null||N.setData(Ce,JSON.stringify(f)),(E=S.dataTransfer)==null||E.setData("text/plain",f.rotulo),S.dataTransfer.effectAllowed="move"}catch{}}function g(S){var f;try{const N=(f=S.dataTransfer)==null?void 0:f.getData(Ce);if(!N)return null;const E=JSON.parse(N);return!E||typeof E.rotulo!="string"||E.origem!=="visiveis"&&E.origem!=="invisiveis"?null:E}catch{return null}}function n(S){const f=S.origem==="visiveis"?i.value:r.value,N=f.indexOf(S.rotulo);N>=0&&f.splice(N,1)}function h(S,f,N){const E=S==="visiveis"?i.value:r.value,w=E.indexOf(f);w>=0&&E.splice(w,1),N===null||N<0||N>E.length?E.push(f):E.splice(N,0,f)}function $(S,f,N,E){l(S,{rotulo:f,origem:N,index:E})}function P(S,f,N){const E=g(S);if(E)if(n(E),h(f,E.rotulo,N),f==="visiveis"){const w=r.value.indexOf(E.rotulo);w>=0&&r.value.splice(w,1)}else{const w=i.value.indexOf(E.rotulo);w>=0&&i.value.splice(w,1)}}function C(S,f,N){const E=g(S);if(E)if(n(E),h(f,E.rotulo,null),f==="visiveis"){const w=r.value.indexOf(E.rotulo);w>=0&&r.value.splice(w,1)}else{const w=i.value.indexOf(E.rotulo);w>=0&&i.value.splice(w,1)}}return{visiveisLocal:i,invisiveisLocal:r,emitFechar:u,emitSalvar:o,onDragStart:$,onDropItem:P,onDropLista:C}}}),Ma={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},Aa={class:"eli-tabela-modal-colunas__header"},Na={class:"eli-tabela-modal-colunas__conteudo"},Ta={class:"eli-tabela-modal-colunas__coluna"},va=["onDragstart","onDrop"],Pa={class:"eli-tabela-modal-colunas__item-texto"},Oa={class:"eli-tabela-modal-colunas__coluna"},Ia=["onDragstart","onDrop"],qa={class:"eli-tabela-modal-colunas__item-texto"},Fa={class:"eli-tabela-modal-colunas__footer"};function La(e,a,i,r,c,u){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",Ma,[t.createElementVNode("header",Aa,[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",Na,[t.createElementVNode("div",Ta,[a[12]||(a[12]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Invisí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,"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:g=>e.onDragStart(g,o,"invisiveis",l),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:g=>e.onDropItem(g,"invisiveis",l)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",Pa,t.toDisplayString(o),1)],40,va))),128))],32)]),t.createElementVNode("div",Oa,[a[14]||(a[14]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Visí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,"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:g=>e.onDragStart(g,o,"visiveis",l),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:g=>e.onDropItem(g,"visiveis",l)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",qa,t.toDisplayString(o),1)],40,Ia))),128))],32)])]),t.createElementVNode("footer",Fa,[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 za=I(_a,[["render",La],["__scopeId","data-v-c7d1b6d2"]]),ja="eli:tabela";function Ee(e){return`${ja}:${e}:colunas`}function Se(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,i=Array.isArray(a.visiveis)?a.visiveis.filter(c=>typeof c=="string"):[],r=Array.isArray(a.invisiveis)?a.invisiveis.filter(c=>typeof c=="string"):[];return{visiveis:i,invisiveis:r}}function we(e){try{const a=window.localStorage.getItem(Ee(e));return a?Se(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function Ua(e,a){try{window.localStorage.setItem(Ee(e),JSON.stringify(Se(a)))}catch{}}const Ha=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Nt,EliTabelaEstados:Ft,EliTabelaDebug:Ut,EliTabelaHead:Kt,EliTabelaBody:pa,EliTabelaMenuAcoes:$a,EliTabelaPaginacao:Da,EliTabelaModalColunas:za},props:{tabela:{type:Object,required:!0}},setup(e){const i=t.ref(!1),r=t.ref(null),c=t.ref([]),u=t.ref(0),o=t.ref([]),l=t.ref(null),g=t.ref(null),n=t.ref({top:0,left:0}),h=t.ref(""),$=t.ref(1),P=t.ref(null),C=t.ref("asc"),S=t.computed(()=>e.tabela),f=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),N=t.computed(()=>e.tabela.acoesTabela??[]),E=t.computed(()=>N.value.length>0),w=t.ref(!1),j=t.ref(we(e.tabela.nome)),U=t.computed(()=>e.tabela.colunas.map(p=>p.rotulo)),Z=t.computed(()=>{const p=e.tabela.colunas,B=U.value,M=new Set(j.value.invisiveis??[]),A=B.filter(D=>!M.has(D)),z=new Set(A),F=j.value.visiveis??[],L=[];for(const D of F)z.has(D)&&L.push(D);for(const D of A)L.includes(D)||L.push(D);const q=new Map;for(const D of p)q.has(D.rotulo)||q.set(D.rotulo,D);return L.map(D=>q.get(D)).filter(Boolean)});function W(){w.value=!0}function re(){w.value=!1}function Q(p){j.value=p,Ua(e.tabela.nome,p),w.value=!1}const X=t.computed(()=>{const p=e.tabela.registros_por_consulta;return typeof p=="number"&&p>0?Math.floor(p):10}),O=t.computed(()=>{const p=X.value;if(!p||p<=0)return 1;const B=u.value;return B?Math.max(1,Math.ceil(B/p)):1}),T=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let J=0;function x(p){var q,D,H,R,Y,le;const B=p.getBoundingClientRect(),M=8,A=((H=(D=(q=g.value)==null?void 0:q.menuEl)==null?void 0:D.value)==null?void 0:H.offsetHeight)??0,z=((le=(Y=(R=g.value)==null?void 0:R.menuEl)==null?void 0:Y.value)==null?void 0:le.offsetWidth)??180;let F=B.bottom+M;const L=B.right-z;A&&F+A>window.innerHeight-M&&(F=B.top-M-A),n.value={top:Math.max(M,Math.round(F)),left:Math.max(M,Math.round(L))}}function y(p){var M,A;if(l.value===null)return;const B=p.target;(A=(M=g.value)==null?void 0:M.menuEl)!=null&&A.value&&g.value.menuEl.value.contains(B)||(l.value=null)}function m(p){if(p){if(P.value===p){C.value=C.value==="asc"?"desc":"asc",_();return}P.value=p,C.value="asc",$.value!==1?$.value=1:_()}}function s(p){h.value!==p&&(h.value=p,$.value!==1?$.value=1:_())}function b(p){const B=Math.min(Math.max(1,p),O.value);B!==$.value&&($.value=B)}function d(p){const B=e.tabela.acoesLinha??[],M=o.value[p]??[];return B.map((A,z)=>{const F=A.exibir===void 0?!0:typeof A.exibir=="boolean"?A.exibir:!1;return{acao:A,indice:z,visivel:M[z]??F}}).filter(A=>A.visivel)}function k(p){return d(p).length>0}function V(p,B){if(!k(p))return;if(l.value===p){l.value=null;return}l.value=p;const M=(B==null?void 0:B.currentTarget)??null;M&&(x(M),requestAnimationFrame(()=>x(M)))}async function _(){var z,F;const p=++J;i.value=!0,r.value=null,o.value=[],l.value=null;const B=Math.max(1,X.value),A={offSet:($.value-1)*B,limit:B};h.value&&(A.texto_busca=h.value),P.value&&(A.coluna_ordem=P.value,A.direcao_ordem=C.value);try{const L=e.tabela,q=await L.consulta(A);if(p!==J)return;if(q.cod!==ye.sucesso){c.value=[],u.value=0,r.value=q.mensagem;return}const D=((z=q.valor)==null?void 0:z.valores)??[],H=((F=q.valor)==null?void 0:F.quantidade)??D.length;c.value=D,u.value=H;const R=Math.max(1,Math.ceil((H||0)/B));if($.value>R){$.value=R;return}const Y=L.acoesLinha??[];if(!Y.length){o.value=[];return}const le=D.map(()=>Y.map(ee=>ee.exibir===void 0?!0:typeof ee.exibir=="boolean"?ee.exibir:!1));o.value=le;const Ga=await Promise.all(D.map(async ee=>Promise.all(Y.map(async ie=>{if(ie.exibir===void 0)return!0;if(typeof ie.exibir=="boolean")return ie.exibir;try{const Za=ie.exibir(ee);return!!await Promise.resolve(Za)}catch{return!1}}))));p===J&&(o.value=Ga)}catch(L){if(p!==J)return;c.value=[],u.value=0,r.value=L instanceof Error?L.message:"Erro ao carregar dados."}finally{p===J&&(i.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",y),_()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",y)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,p=>{!p&&h.value&&(h.value="",$.value!==1?$.value=1:_())}),t.watch($,(p,B)=>{p!==B&&_()}),t.watch(()=>e.tabela,()=>{l.value=null,P.value=null,C.value="asc",h.value="",w.value=!1,j.value=we(e.tabela.nome),$.value!==1?$.value=1:_()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{$.value!==1?$.value=1:_()}),t.watch(c,()=>{l.value=null}),{isDev:!1,tabela:S,carregando:i,erro:r,linhas:c,quantidade:u,menuAberto:l,valorBusca:h,paginaAtual:$,colunaOrdenacao:P,direcaoOrdenacao:C,totalPaginas:O,exibirBusca:f,acoesCabecalho:N,temAcoesCabecalho:E,temAcoes:T,colunasEfetivas:Z,rotulosColunas:U,modalColunasAberto:w,configColunas:j,abrirModalColunas:W,fecharModalColunas:re,salvarModalColunas:Q,alternarOrdenacao:m,atualizarBusca:s,irParaPagina:b,acoesDisponiveisPorLinha:d,possuiAcoes:k,toggleMenu:V,menuPopup:g,menuPopupPos:n}}}),Ra={class:"eli-tabela"},Ya={class:"eli-tabela__table"};function Ja(e,a,i,r,c,u){const o=t.resolveComponent("EliTabelaDebug"),l=t.resolveComponent("EliTabelaEstados"),g=t.resolveComponent("EliTabelaCabecalho"),n=t.resolveComponent("EliTabelaModalColunas"),h=t.resolveComponent("EliTabelaHead"),$=t.resolveComponent("EliTabelaBody"),P=t.resolveComponent("EliTabelaMenuAcoes"),C=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ra,[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(g,{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(n,{aberto:e.modalColunasAberto,rotulosColunas:e.rotulosColunas,configInicial:e.configColunas,onFechar:e.fecharModalColunas,onSalvar:e.salvarModalColunas},null,8,["aberto","rotulosColunas","configInicial","onFechar","onSalvar"]),t.createElementVNode("table",Ya,[t.createVNode(h,{colunas:e.colunasEfetivas,temAcoes:e.temAcoes,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode($,{colunas:e.colunasEfetivas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu},null,8,["colunas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu"])]),t.createVNode(P,{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:S,linha:f})=>{e.menuAberto=null,S.acao(f)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(C,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const De=I(Ha,[["render",Ja]]),Wa={install(e){e.component("EliOlaMundo",fe),e.component("EliBotao",se),e.component("EliBadge",te),e.component("EliInput",de),e.component("EliCartao",be),e.component("EliDataHora",he),e.component("EliTabela",De)}};v.EliBadge=te,v.EliBotao=se,v.EliCartao=be,v.EliDataHora=he,v.EliInput=de,v.EliOlaMundo=fe,v.EliTabela=De,v.default=Wa,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */const we=ae("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-vue-next v0.563.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _t=ae("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** + * @license lucide-vue-next v0.563.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wt=ae("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Nt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:wt},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const n=t.ref(e.modelo??"");t.watch(()=>e.modelo,s=>{s!==void 0&&s!==n.value&&(n.value=s)});function i(){a("buscar",n.value.trim())}return{texto:n,emitirBusca:i}}}),Mt={class:"eli-tabela__busca"},At={class:"eli-tabela__busca-input-wrapper"};function Tt(e,a,n,i,s,f){const o=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",Mt,[t.createElementVNode("div",At,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=l=>e.texto=l),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...l)=>e.emitirBusca&&e.emitirBusca(...l),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao","aria-label":"Buscar",title:"Buscar",onClick:a[2]||(a[2]=(...l)=>e.emitirBusca&&e.emitirBusca(...l))},[t.createVNode(o,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const Pt=O(Nt,[["render",Tt],["__scopeId","data-v-341415d1"]]),It=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:Pt},props:{exibirBusca:{type:Boolean,required:!0},exibirBotaoColunas:{type:Boolean,required:!1,default:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"},colunas(){return!0}},setup(e,{emit:a}){const n=t.computed(()=>e.acoesCabecalho.length>0);function i(f){a("buscar",f)}function s(){a("colunas")}return{temAcoesCabecalho:n,emitBuscar:i,emitColunas:s}}}),Ot={class:"eli-tabela__cabecalho"},qt={key:0,class:"eli-tabela__busca-grupo"},Ft={key:1,class:"eli-tabela__acoes-cabecalho"},Lt=["onClick"],zt={class:"eli-tabela__acoes-cabecalho-rotulo"};function jt(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",Ot,[e.exibirBusca?(t.openBlock(),t.createElementBlock("div",qt,[e.exibirBotaoColunas?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__acoes-cabecalho-botao eli-tabela__acoes-cabecalho-botao--colunas",onClick:a[0]||(a[0]=(...l)=>e.emitColunas&&e.emitColunas(...l))}," Colunas ")):t.createCommentVNode("",!0),t.createVNode(o,{modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",Ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(l,p)=>(t.openBlock(),t.createElementBlock("button",{key:`${l.rotulo}-${p}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(l.cor?{backgroundColor:l.cor,color:"#fff"}:void 0),onClick:l.acao},[l.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",zt,t.toDisplayString(l.rotulo),1)],12,Lt))),128))])):t.createCommentVNode("",!0)])}const Ut=O(It,[["render",jt],["__scopeId","data-v-42938cb8"]]),Ht=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),Rt={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},Yt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},Jt={class:"eli-tabela__erro-mensagem"},Gt={key:2,class:"eli-tabela eli-tabela--vazio"};function Wt(e,a,n,i,s,f){return e.carregando?(t.openBlock(),t.createElementBlock("div",Rt," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",Yt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",Jt,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Gt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Zt=O(Ht,[["render",Wt]]),Xt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Kt={key:0,style:{position:"fixed",left:"8px",bottom:"8px","z-index":"999999",background:"rgba(185,28,28,0.9)",color:"#fff",padding:"6px 10px","border-radius":"8px","font-size":"12px","max-width":"500px"}};function Qt(e,a,n,i,s,f){return e.isDev?(t.openBlock(),t.createElementBlock("div",Kt,[a[0]||(a[0]=t.createElementVNode("div",null,[t.createElementVNode("b",null,"EliTabela debug")],-1)),t.createElementVNode("div",null,"menuAberto: "+t.toDisplayString(e.menuAberto),1),t.createElementVNode("div",null,"menuPos: top="+t.toDisplayString(e.menuPopupPos.top)+", left="+t.toDisplayString(e.menuPopupPos.left),1)])):t.createCommentVNode("",!0)}const xt=O(Xt,[["render",Qt]]),ea=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:De,ArrowDown:ve},props:{colunas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},colunaOrdenacao:{type:String,required:!0},direcaoOrdenacao:{type:String,required:!0}},emits:{alternarOrdenacao(e){return typeof e=="string"&&e.length>0}},setup(e,{emit:a}){function n(s){return(s==null?void 0:s.coluna_ordem)!==void 0&&(s==null?void 0:s.coluna_ordem)!==null}function i(s){a("alternarOrdenacao",s)}return{ArrowUp:De,ArrowDown:ve,isOrdenavel:n,emitAlternarOrdenacao:i}}}),ta={class:"eli-tabela__thead"},aa={class:"eli-tabela__tr eli-tabela__tr--header"},oa={key:0,class:"eli-tabela__th eli-tabela__th--expander",scope:"col"},na=["onClick"],la={class:"eli-tabela__th-texto"},ra={key:1,class:"eli-tabela__th-label"},ia={key:1,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function sa(e,a,n,i,s,f){const o=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",ta,[t.createElementVNode("tr",aa,[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("th",oa)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(l,p)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${p}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(l)?"eli-tabela__th--ordenavel":void 0]]),scope:"col"},[e.isOrdenavel(l)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(l.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:r=>e.emitAlternarOrdenacao(String(l.coluna_ordem))},[t.createElementVNode("span",la,t.toDisplayString(l.rotulo),1),e.colunaOrdenacao===String(l.coluna_ordem)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.direcaoOrdenacao==="asc"?e.ArrowUp:e.ArrowDown),{key:0,class:"eli-tabela__th-icone",size:16,"stroke-width":2,"aria-hidden":"true"})):(t.openBlock(),t.createBlock(o,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,na)):(t.openBlock(),t.createElementBlock("span",ra,t.toDisplayString(l.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",ia," Ações ")):t.createCommentVNode("",!0)])])}const ca=O(ea,[["render",sa]]),da=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),ua={key:1};function ma(e,a,n,i,s,f){var o,l,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(r=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((l=e.dados)==null?void 0:l.texto),1)):(t.openBlock(),t.createElementBlock("span",ua,t.toDisplayString((p=e.dados)==null?void 0:p.texto),1))}const pa=O(da,[["render",ma],["__scopeId","data-v-7a629ffa"]]),fa=t.defineComponent({name:"EliTabelaCelulaTextoTruncado",props:{dados:{type:Object}},setup({dados:e}){return{dados:e}}}),ba=["title"],ha=["title"];function ga(e,a,n,i,s,f){var o,l,p,r,u;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__texto-truncado eli-tabela__celula-link",title:(l=e.dados)==null?void 0:l.texto,onClick:a[0]||(a[0]=t.withModifiers(y=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString((p=e.dados)==null?void 0:p.texto),9,ba)):(t.openBlock(),t.createElementBlock("span",{key:1,class:"eli-tabela__texto-truncado",title:(r=e.dados)==null?void 0:r.texto},t.toDisplayString((u=e.dados)==null?void 0:u.texto),9,ha))}const ya=O(fa,[["render",ga],["__scopeId","data-v-74854889"]]),$a=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}}),ka={key:1};function Ba(e,a,n,i,s,f){var o,l,p;return(o=e.dados)!=null&&o.acao?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"eli-tabela__celula-link",onClick:a[0]||(a[0]=t.withModifiers(r=>e.dados.acao(),["stop","prevent"]))},t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",",")),1)):(t.openBlock(),t.createElementBlock("span",ka,t.toDisplayString(String((p=e.dados)==null?void 0:p.numero).replace(".",",")),1))}const Ea={textoSimples:pa,textoTruncado:ya,numero:O($a,[["render",Ba],["__scopeId","data-v-e7bac7ff"]])},Ca=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),n=t.computed(()=>e.celula[1]),i=t.computed(()=>Ea[a.value]),s=t.computed(()=>n.value);return{Componente:i,dadosParaComponente:s}}});function Va(e,a,n,i,s,f){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Ne=O(Ca,[["render",Va]]),Sa=t.defineComponent({name:"EliTabelaDetalhesLinha",components:{EliTabelaCelula:Ne},props:{linha:{type:null,required:!0},colunasInvisiveis:{type:Array,required:!0}}}),va={class:"eli-tabela__detalhes"},Da={class:"eli-tabela__detalhe-rotulo"},_a={class:"eli-tabela__detalhe-valor"};function wa(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCelula");return t.openBlock(),t.createElementBlock("div",va,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunasInvisiveis,(l,p)=>(t.openBlock(),t.createElementBlock("div",{key:`det-${p}-${l.rotulo}`,class:"eli-tabela__detalhe"},[t.createElementVNode("div",Da,t.toDisplayString(l.rotulo),1),t.createElementVNode("div",_a,[t.createVNode(o,{celula:l.celula(e.linha)},null,8,["celula"])])]))),128))])}const Na=O(Sa,[["render",wa],["__scopeId","data-v-f1ee8d20"]]),Ma=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Ne,EliTabelaDetalhesLinha:Na,MoreVertical:_t,ChevronRight:we,ChevronDown:_e},props:{colunas:{type:Array,required:!0},colunasInvisiveis:{type:Array,required:!0},temColunasInvisiveis:{type:Boolean,required:!0},linhasExpandidas:{type:Object,required:!0},linhas:{type:Array,required:!0},temAcoes:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},possuiAcoes:{type:Function,required:!0},toggleMenu:{type:Function,required:!0},alternarLinhaExpandida:{type:Function,required:!0}},setup(){return{ChevronRight:we,ChevronDown:_e}}}),Aa={class:"eli-tabela__tbody"},Ta=["aria-expanded","aria-label","title","onClick"],Pa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"],Ia=["colspan"];function Oa(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaCelula"),l=t.resolveComponent("MoreVertical"),p=t.resolveComponent("EliTabelaDetalhesLinha");return t.openBlock(),t.createElementBlock("tbody",Aa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(r,u)=>{var y,_,C,$,b,D;return t.openBlock(),t.createElementBlock(t.Fragment,{key:`grp-${u}`},[t.createElementVNode("tr",{class:t.normalizeClass(["eli-tabela__tr",[u%2===1?"eli-tabela__tr--zebra":void 0]])},[e.temColunasInvisiveis?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--expander",key:`td-${u}-exp`},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["eli-tabela__expander-botao",[(y=e.linhasExpandidas)!=null&&y[u]?"eli-tabela__expander-botao--ativo":void 0]]),"aria-expanded":(_=e.linhasExpandidas)!=null&&_[u]?"true":"false","aria-label":(C=e.linhasExpandidas)!=null&&C[u]?"Ocultar colunas ocultas":"Mostrar colunas ocultas",title:($=e.linhasExpandidas)!=null&&$[u]?"Ocultar detalhes":"Mostrar detalhes",onClick:t.withModifiers(k=>e.alternarLinhaExpandida(u),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent((b=e.linhasExpandidas)!=null&&b[u]?e.ChevronDown:e.ChevronRight),{class:"eli-tabela__expander-icone",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Ta)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(k,E)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${u}-${E}`,class:"eli-tabela__td"},[t.createVNode(o,{celula:k.celula(r)},null,8,["celula"])]))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${u}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===u?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${u}`,disabled:!e.possuiAcoes(u),"aria-haspopup":"menu","aria-expanded":e.menuAberto===u?"true":"false","aria-controls":e.possuiAcoes(u)?`eli-tabela-acoes-menu-${u}`:void 0,"aria-label":e.possuiAcoes(u)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(u)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(k=>e.toggleMenu(u,k),["stop"])},[t.createVNode(l,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,Pa)],2)])):t.createCommentVNode("",!0)],2),e.temColunasInvisiveis&&((D=e.linhasExpandidas)!=null&&D[u])?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["eli-tabela__tr eli-tabela__tr--detalhes",[u%2===1?"eli-tabela__tr--zebra":void 0]])},[t.createElementVNode("td",{class:"eli-tabela__td eli-tabela__td--detalhes",colspan:(e.temColunasInvisiveis?1:0)+e.colunas.length+(e.temAcoes?1:0)},[t.createVNode(p,{linha:r,colunasInvisiveis:e.colunasInvisiveis},null,8,["linha","colunasInvisiveis"])],8,Ia)],2)):t.createCommentVNode("",!0)],64)}),128))])}const qa=O(Ma,[["render",Oa]]),Fa=t.defineComponent({name:"EliTabelaMenuAcoes",props:{menuAberto:{type:Number,required:!0},posicao:{type:Object,required:!0},acoes:{type:Array,required:!0},linha:{type:null,required:!0}},emits:{executar(e){return e!==null&&typeof e=="object"}},setup(e,{emit:a,expose:n}){const i=t.ref(null);n({menuEl:i});const s=t.computed(()=>e.acoes.length>0);function f(o){e.linha&&a("executar",{acao:o.acao,linha:e.linha})}return{menuEl:i,possuiAcoes:s,emitExecutar:f}}}),La=["id","aria-labelledby"],za=["aria-label","title","onClick"],ja={class:"eli-tabela__acoes-item-texto"};function Ua(e,a,n,i,s,f){return t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.menuAberto!==null&&e.possuiAcoes?(t.openBlock(),t.createElementBlock("ul",{key:0,id:`eli-tabela-acoes-menu-${e.menuAberto}`,ref:"menuEl",class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":`eli-tabela-acoes-toggle-${e.menuAberto}`,style:t.normalizeStyle({position:"fixed",top:`${e.posicao.top}px`,left:`${e.posicao.left}px`,zIndex:999999})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoes,o=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${o.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:o.acao.cor}),role:"menuitem","aria-label":o.acao.rotulo,title:o.acao.rotulo,onClick:t.withModifiers(l=>e.emitExecutar(o),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ja,t.toDisplayString(o.acao.rotulo),1)],12,za)]))),128))],12,La)):t.createCommentVNode("",!0)])}const Ha=O(Fa,[["render",Ua]]),Ra=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const n=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),i=t.computed(()=>{const r=e.totalPaginas,u=e.pagina,y=n.value,_=[],C=E=>{_.push({label:String(E),pagina:E,ativo:E===u})},$=()=>{_.push({label:"…",ehEllipsis:!0})};if(r<=y){for(let E=1;E<=r;E+=1)C(E);return _}const b=Math.max(3,y-2);let D=Math.max(2,u-Math.floor(b/2)),k=D+b-1;k>=r&&(k=r-1,D=k-b+1),C(1),D>2&&$();for(let E=D;E<=k;E+=1)C(E);return ke.pagina<=1),o=t.computed(()=>e.pagina>=e.totalPaginas),l=t.computed(()=>e.pagina),p=t.computed(()=>e.totalPaginas);return{botoes:i,irParaPagina:s,anteriorDesabilitado:f,proximaDesabilitada:o,paginaAtual:l,totalPaginasExibidas:p}}}),Ya={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},Ja=["disabled"],Ga={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Wa=["disabled","aria-current","aria-label","onClick"],Za=["disabled"];function Xa(e,a,n,i,s,f){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",Ya,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=o=>e.irParaPagina(e.paginaAtual-1))}," << ",8,Ja),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(o,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${o.label}-${l}`},[o.ehEllipsis?(t.openBlock(),t.createElementBlock("span",Ga,t.toDisplayString(o.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",o.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:o.ativo,"aria-current":o.ativo?"page":void 0,"aria-label":`Ir para página ${o.label}`,onClick:p=>e.irParaPagina(o.pagina)},t.toDisplayString(o.label),11,Wa))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=o=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,Za)])):t.createCommentVNode("",!0)}const Ka=O(Ra,[["render",Xa],["__scopeId","data-v-5ca7a362"]]),Me="application/x-eli-tabela-coluna",Qa=t.defineComponent({name:"EliTabelaModalColunas",props:{aberto:{type:Boolean,required:!0},rotulosColunas:{type:Array,required:!0},configInicial:{type:Object,required:!0},colunas:{type:Array,required:!0}},emits:{fechar(){return!0},salvar(e){return!0}},setup(e,{emit:a}){const n=t.ref([]),i=t.ref([]);function s(){var X,te;const $=e.rotulosColunas,b=(((X=e.configInicial.visiveis)==null?void 0:X.length)??0)>0||(((te=e.configInicial.invisiveis)==null?void 0:te.length)??0)>0,D=new Set(e.colunas.filter(H=>H.visivel===!1).map(H=>H.rotulo)),k=b?new Set(e.configInicial.invisiveis??[]):D,E=$.filter(H=>!k.has(H)),G=e.configInicial.visiveis??[],K=new Set(E),Z=[];for(const H of G)K.has(H)&&Z.push(H);for(const H of E)Z.includes(H)||Z.push(H);n.value=Z,i.value=$.filter(H=>k.has(H))}t.watch(()=>[e.aberto,e.rotulosColunas,e.configInicial,e.colunas],()=>{e.aberto&&s()},{deep:!0,immediate:!0});function f(){a("fechar")}function o(){a("salvar",{visiveis:[...n.value],invisiveis:[...i.value]})}function l($,b){var D,k;try{(D=$.dataTransfer)==null||D.setData(Me,JSON.stringify(b)),(k=$.dataTransfer)==null||k.setData("text/plain",b.rotulo),$.dataTransfer.effectAllowed="move"}catch{}}function p($){var b;try{const D=(b=$.dataTransfer)==null?void 0:b.getData(Me);if(!D)return null;const k=JSON.parse(D);return!k||typeof k.rotulo!="string"||k.origem!=="visiveis"&&k.origem!=="invisiveis"?null:k}catch{return null}}function r($){const b=$.origem==="visiveis"?n.value:i.value,D=b.indexOf($.rotulo);D>=0&&b.splice(D,1)}function u($,b,D){const k=$==="visiveis"?n.value:i.value,E=k.indexOf(b);E>=0&&k.splice(E,1),D===null||D<0||D>k.length?k.push(b):k.splice(D,0,b)}function y($,b,D,k){l($,{rotulo:b,origem:D,index:k})}function _($,b,D){const k=p($);if(k)if(r(k),u(b,k.rotulo,D),b==="visiveis"){const E=i.value.indexOf(k.rotulo);E>=0&&i.value.splice(E,1)}else{const E=n.value.indexOf(k.rotulo);E>=0&&n.value.splice(E,1)}}function C($,b,D){const k=p($);if(k)if(r(k),u(b,k.rotulo,null),b==="visiveis"){const E=i.value.indexOf(k.rotulo);E>=0&&i.value.splice(E,1)}else{const E=n.value.indexOf(k.rotulo);E>=0&&n.value.splice(E,1)}}return{visiveisLocal:n,invisiveisLocal:i,emitFechar:f,emitSalvar:o,onDragStart:y,onDropItem:_,onDropLista:C}}}),xa={class:"eli-tabela-modal-colunas__modal",role:"dialog","aria-modal":"true","aria-label":"Configurar colunas"},eo={class:"eli-tabela-modal-colunas__header"},to={class:"eli-tabela-modal-colunas__conteudo"},ao={class:"eli-tabela-modal-colunas__coluna"},oo=["onDragstart","onDrop"],no={class:"eli-tabela-modal-colunas__item-texto"},lo={class:"eli-tabela-modal-colunas__coluna"},ro=["onDragstart","onDrop"],io={class:"eli-tabela-modal-colunas__item-texto"},so={class:"eli-tabela-modal-colunas__footer"};function co(e,a,n,i,s,f){return e.aberto?(t.openBlock(),t.createElementBlock("div",{key:0,class:"eli-tabela-modal-colunas__overlay",role:"presentation",onClick:a[9]||(a[9]=t.withModifiers((...o)=>e.emitFechar&&e.emitFechar(...o),["self"]))},[t.createElementVNode("div",xa,[t.createElementVNode("header",eo,[a[10]||(a[10]=t.createElementVNode("h3",{class:"eli-tabela-modal-colunas__titulo"},"Colunas",-1)),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__fechar","aria-label":"Fechar",onClick:a[0]||(a[0]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," × ")]),t.createElementVNode("div",to,[t.createElementVNode("div",ao,[a[12]||(a[12]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Visíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[2]||(a[2]=t.withModifiers(()=>{},["prevent"])),onDrop:a[3]||(a[3]=o=>e.onDropLista(o,"visiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`vis-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"visiveis",l),onDragover:a[1]||(a[1]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"visiveis",l)},[a[11]||(a[11]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",no,t.toDisplayString(o),1)],40,oo))),128))],32)]),t.createElementVNode("div",lo,[a[14]||(a[14]=t.createElementVNode("div",{class:"eli-tabela-modal-colunas__coluna-titulo"},"Invisíveis",-1)),t.createElementVNode("div",{class:"eli-tabela-modal-colunas__lista",onDragover:a[5]||(a[5]=t.withModifiers(()=>{},["prevent"])),onDrop:a[6]||(a[6]=o=>e.onDropLista(o,"invisiveis",null))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.invisiveisLocal,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:`inv-${o}`,class:"eli-tabela-modal-colunas__item",draggable:"true",onDragstart:p=>e.onDragStart(p,o,"invisiveis",l),onDragover:a[4]||(a[4]=t.withModifiers(()=>{},["prevent"])),onDrop:p=>e.onDropItem(p,"invisiveis",l)},[a[13]||(a[13]=t.createElementVNode("span",{class:"eli-tabela-modal-colunas__item-handle","aria-hidden":"true"},"⋮⋮",-1)),t.createElementVNode("span",io,t.toDisplayString(o),1)],40,ro))),128))],32)])]),t.createElementVNode("footer",so,[t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--sec",onClick:a[7]||(a[7]=(...o)=>e.emitFechar&&e.emitFechar(...o))}," Cancelar "),t.createElementVNode("button",{type:"button",class:"eli-tabela-modal-colunas__botao eli-tabela-modal-colunas__botao--prim",onClick:a[8]||(a[8]=(...o)=>e.emitSalvar&&e.emitSalvar(...o))}," Salvar ")])])])):t.createCommentVNode("",!0)}const uo=O(Qa,[["render",co],["__scopeId","data-v-b8f693ef"]]),mo="eli:tabela";function Ae(e){return`${mo}:${e}:colunas`}function Te(e){if(!e||typeof e!="object")return{visiveis:[],invisiveis:[]};const a=e,n=Array.isArray(a.visiveis)?a.visiveis.filter(s=>typeof s=="string"):[],i=Array.isArray(a.invisiveis)?a.invisiveis.filter(s=>typeof s=="string"):[];return{visiveis:n,invisiveis:i}}function Pe(e){try{const a=window.localStorage.getItem(Ae(e));return a?Te(JSON.parse(a)):{visiveis:[],invisiveis:[]}}catch{return{visiveis:[],invisiveis:[]}}}function po(e,a){try{window.localStorage.setItem(Ae(e),JSON.stringify(Te(a)))}catch{}}const fo=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ut,EliTabelaEstados:Zt,EliTabelaDebug:xt,EliTabelaHead:ca,EliTabelaBody:qa,EliTabelaMenuAcoes:Ha,EliTabelaPaginacao:Ka,EliTabelaModalColunas:uo},props:{tabela:{type:Object,required:!0}},setup(e){const n=t.ref(!1),i=t.ref(null),s=t.ref([]),f=t.ref(0),o=t.ref([]),l=t.ref(null),p=t.ref(null),r=t.ref({top:0,left:0}),u=t.ref(""),y=t.ref(1),_=t.ref(null),C=t.ref("asc"),$=t.computed(()=>e.tabela),b=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),D=t.computed(()=>e.tabela.acoesTabela??[]),k=t.computed(()=>D.value.length>0),E=t.ref(!1),G=t.ref(Pe(e.tabela.nome)),K=t.ref({}),Z=t.computed(()=>e.tabela.colunas.map(h=>h.rotulo)),X=t.computed(()=>{var W,Q;const h=e.tabela.colunas,T=(((W=G.value.visiveis)==null?void 0:W.length)??0)>0||(((Q=G.value.invisiveis)==null?void 0:Q.length)??0)>0?G.value.invisiveis??[]:h.filter(q=>q.visivel===!1).map(q=>q.rotulo),N=new Set(T),P=h.filter(q=>N.has(q.rotulo)),F=T,R=new Map;for(const q of P)R.has(q.rotulo)||R.set(q.rotulo,q);const Y=[];for(const q of F){const x=R.get(q);x&&Y.push(x)}for(const q of P)Y.includes(q)||Y.push(q);return Y}),te=t.computed(()=>X.value.length>0),H=t.computed(()=>{var q,x;const h=e.tabela.colunas,v=Z.value,T=(((q=G.value.visiveis)==null?void 0:q.length)??0)>0||(((x=G.value.invisiveis)==null?void 0:x.length)??0)>0,N=T?G.value.invisiveis??[]:e.tabela.colunas.filter(L=>L.visivel===!1).map(L=>L.rotulo),P=new Set(N),F=v.filter(L=>!P.has(L)),R=new Set(F),Y=T?G.value.visiveis??[]:[],W=[];for(const L of Y)R.has(L)&&W.push(L);for(const L of F)W.includes(L)||W.push(L);const Q=new Map;for(const L of h)Q.has(L.rotulo)||Q.set(L.rotulo,L);return W.map(L=>Q.get(L)).filter(Boolean)});function oe(){E.value=!0}function U(){E.value=!1}function w(h){G.value=h,po(e.tabela.nome,h),E.value=!1,K.value={}}function ne(h){const v=!!K.value[h];K.value={...K.value,[h]:!v}}const re=t.computed(()=>{const h=e.tabela.registros_por_consulta;return typeof h=="number"&&h>0?Math.floor(h):10}),B=t.computed(()=>{const h=re.value;if(!h||h<=0)return 1;const v=f.value;return v?Math.max(1,Math.ceil(v/h)):1}),m=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let c=0;function g(h){var Y,W,Q,q,x,L;const v=h.getBoundingClientRect(),T=8,N=((Q=(W=(Y=p.value)==null?void 0:Y.menuEl)==null?void 0:W.value)==null?void 0:Q.offsetHeight)??0,P=((L=(x=(q=p.value)==null?void 0:q.menuEl)==null?void 0:x.value)==null?void 0:L.offsetWidth)??180;let F=v.bottom+T;const R=v.right-P;N&&F+N>window.innerHeight-T&&(F=v.top-T-N),r.value={top:Math.max(T,Math.round(F)),left:Math.max(T,Math.round(R))}}function d(h){var T,N;if(l.value===null)return;const v=h.target;(N=(T=p.value)==null?void 0:T.menuEl)!=null&&N.value&&p.value.menuEl.value.contains(v)||(l.value=null)}function V(h){if(h){if(_.value===h){C.value=C.value==="asc"?"desc":"asc",j();return}_.value=h,C.value="asc",y.value!==1?y.value=1:j()}}function S(h){u.value!==h&&(u.value=h,y.value!==1?y.value=1:j())}function M(h){const v=Math.min(Math.max(1,h),B.value);v!==y.value&&(y.value=v)}function I(h){const v=e.tabela.acoesLinha??[],T=o.value[h]??[];return v.map((N,P)=>{const F=N.exibir===void 0?!0:typeof N.exibir=="boolean"?N.exibir:!1;return{acao:N,indice:P,visivel:T[P]??F}}).filter(N=>N.visivel)}function z(h){return I(h).length>0}function J(h,v){if(!z(h))return;if(l.value===h){l.value=null;return}l.value=h;const T=(v==null?void 0:v.currentTarget)??null;T&&(g(T),requestAnimationFrame(()=>g(T)))}async function j(){var P,F;const h=++c;n.value=!0,i.value=null,o.value=[],l.value=null,K.value={};const v=Math.max(1,re.value),N={offSet:(y.value-1)*v,limit:v};u.value&&(N.texto_busca=u.value),_.value&&(N.coluna_ordem=_.value,N.direcao_ordem=C.value);try{const R=e.tabela,Y=await R.consulta(N);if(h!==c)return;if(Y.cod!==Ce.sucesso){s.value=[],f.value=0,i.value=Y.mensagem;return}const W=((P=Y.valor)==null?void 0:P.valores)??[],Q=((F=Y.valor)==null?void 0:F.quantidade)??W.length;s.value=W,f.value=Q;const q=Math.max(1,Math.ceil((Q||0)/v));if(y.value>q){y.value=q;return}const x=R.acoesLinha??[];if(!x.length){o.value=[];return}const L=W.map(()=>x.map(ie=>ie.exibir===void 0?!0:typeof ie.exibir=="boolean"?ie.exibir:!1));o.value=L;const No=await Promise.all(W.map(async ie=>Promise.all(x.map(async me=>{if(me.exibir===void 0)return!0;if(typeof me.exibir=="boolean")return me.exibir;try{const Mo=me.exibir(ie);return!!await Promise.resolve(Mo)}catch{return!1}}))));h===c&&(o.value=No)}catch(R){if(h!==c)return;s.value=[],f.value=0,i.value=R instanceof Error?R.message:"Erro ao carregar dados."}finally{h===c&&(n.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",d),j()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",d)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,h=>{!h&&u.value&&(u.value="",y.value!==1?y.value=1:j())}),t.watch(y,(h,v)=>{h!==v&&j()}),t.watch(()=>e.tabela,()=>{l.value=null,_.value=null,C.value="asc",u.value="",E.value=!1,G.value=Pe(e.tabela.nome),K.value={},y.value!==1?y.value=1:j()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{y.value!==1?y.value=1:j()}),t.watch(s,()=>{l.value=null,K.value={}}),{isDev:!1,tabela:$,carregando:n,erro:i,linhas:s,quantidade:f,menuAberto:l,valorBusca:u,paginaAtual:y,colunaOrdenacao:_,direcaoOrdenacao:C,totalPaginas:B,exibirBusca:b,acoesCabecalho:D,temAcoesCabecalho:k,temAcoes:m,colunasEfetivas:H,rotulosColunas:Z,modalColunasAberto:E,configColunas:G,temColunasInvisiveis:te,colunasInvisiveisEfetivas:X,linhasExpandidas:K,abrirModalColunas:oe,fecharModalColunas:U,salvarModalColunas:w,alternarLinhaExpandida:ne,alternarOrdenacao:V,atualizarBusca:S,irParaPagina:M,acoesDisponiveisPorLinha:I,possuiAcoes:z,toggleMenu:J,menuPopup:p,menuPopupPos:r}}}),bo={class:"eli-tabela"},ho={class:"eli-tabela__table"};function go(e,a,n,i,s,f){const o=t.resolveComponent("EliTabelaDebug"),l=t.resolveComponent("EliTabelaEstados"),p=t.resolveComponent("EliTabelaCabecalho"),r=t.resolveComponent("EliTabelaModalColunas"),u=t.resolveComponent("EliTabelaHead"),y=t.resolveComponent("EliTabelaBody"),_=t.resolveComponent("EliTabelaMenuAcoes"),C=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",bo,[t.createVNode(o,{isDev:e.isDev,menuAberto:e.menuAberto,menuPopupPos:e.menuPopupPos},null,8,["isDev","menuAberto","menuPopupPos"]),e.carregando||e.erro||!e.linhas.length?(t.openBlock(),t.createBlock(l,{key:0,carregando:e.carregando,erro:e.erro,mensagemVazio:e.tabela.mensagemVazio},null,8,["carregando","erro","mensagemVazio"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.exibirBusca||e.temAcoesCabecalho?(t.openBlock(),t.createBlock(p,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca,onColunas:e.abrirModalColunas},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar","onColunas"])):t.createCommentVNode("",!0),t.createVNode(r,{aberto:e.modalColunasAberto,rotulosColunas:e.rotulosColunas,configInicial:e.configColunas,colunas:e.tabela.colunas,onFechar:e.fecharModalColunas,onSalvar:e.salvarModalColunas},null,8,["aberto","rotulosColunas","configInicial","colunas","onFechar","onSalvar"]),t.createElementVNode("table",ho,[t.createVNode(u,{colunas:e.colunasEfetivas,temAcoes:e.temAcoes,temColunasInvisiveis:e.temColunasInvisiveis,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","temColunasInvisiveis","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(y,{colunas:e.colunasEfetivas,colunasInvisiveis:e.colunasInvisiveisEfetivas,temColunasInvisiveis:e.temColunasInvisiveis,linhasExpandidas:e.linhasExpandidas,linhas:e.linhas,temAcoes:e.temAcoes,menuAberto:e.menuAberto,possuiAcoes:e.possuiAcoes,toggleMenu:e.toggleMenu,alternarLinhaExpandida:e.alternarLinhaExpandida},null,8,["colunas","colunasInvisiveis","temColunasInvisiveis","linhasExpandidas","linhas","temAcoes","menuAberto","possuiAcoes","toggleMenu","alternarLinhaExpandida"])]),t.createVNode(_,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:$,linha:b})=>{e.menuAberto=null,$.acao(b)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(C,{key:1,pagina:e.paginaAtual,totalPaginas:e.totalPaginas,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:e.irParaPagina},null,8,["pagina","totalPaginas","maximoBotoes","onAlterar"])):t.createCommentVNode("",!0)],64))])}const Ie=O(fo,[["render",go]]),yo=t.defineComponent({name:"EliEntradaTexto",inheritAttrs:!1,props:{value:{type:[String,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const i=t.computed({get:()=>e.value,set:s=>{n("update:value",s),n("input",s),n("change",s)}});return{attrs:a,emit:n,localValue:i}}});function $o(e,a,n,i,s,f){var o,l,p,r;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({modelValue:e.localValue,"onUpdate:modelValue":a[0]||(a[0]=u=>e.localValue=u),label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,counter:(p=e.opcoes)==null?void 0:p.limiteCaracteres,maxlength:(r=e.opcoes)==null?void 0:r.limiteCaracteres},e.attrs,{onFocus:a[1]||(a[1]=()=>e.emit("focus")),onBlur:a[2]||(a[2]=()=>e.emit("blur"))}),null,16,["modelValue","label","placeholder","counter","maxlength"])}const Oe=O(yo,[["render",$o]]);function ko(e){if(!Number.isFinite(e)||e<=0||e>=1)return 0;const a=e.toString();if(a.includes("e-")){const[,s]=a.split("e-"),f=Number(s);return Number.isFinite(f)?f:0}const n=a.indexOf(".");return n===-1?0:a.slice(n+1).replace(/0+$/,"").length}function Bo(e){const a=(e??"").trim().replace(/,/g,".");if(!a)return null;const n=Number(a);return Number.isNaN(n)?null:n}function he(e,a){return e==null?"":a===null?String(e):Number(e).toFixed(Math.max(0,a)).replace(/\./g,",")}function qe(e){return(e??"").replace(/\D+/g,"")}function Eo(e){const a=(e??"").replace(/[^0-9.,]+/g,""),n=a.match(/[.,]/);if(!n)return a;const i=n[0],s=a.indexOf(i),f=a.slice(0,s).replace(/[.,]/g,""),o=a.slice(s+1).replace(/[.,]/g,"");return`${f.length?f:"0"}${i}${o}`}function Co(e,a){if(a===null)return e;if(a<=0)return e.replace(/[.,]/g,"");const n=e.match(/[.,]/);if(!n)return e;const i=n[0],s=e.indexOf(i),f=e.slice(0,s),o=e.slice(s+1);return`${f}${i}${o.slice(0,a)}`}function Vo(e){const a=e.match(/^(\d+)[.,]$/);if(!a)return null;const n=Number(a[1]);return Number.isNaN(n)?null:n}const So=t.defineComponent({name:"EliEntradaNumero",inheritAttrs:!1,props:{value:{type:[Number,null],default:void 0},opcoes:{type:Object,required:!0}},emits:{"update:value":e=>!0,input:e=>!0,change:e=>!0,focus:()=>!0,blur:()=>!0},setup(e,{attrs:a,emit:n}){const i=t.computed(()=>{var u;const r=(u=e.opcoes)==null?void 0:u.precisao;return r==null?null:ko(r)}),s=t.computed(()=>i.value===0),f=t.computed(()=>{const r=i.value;return r!==null&&r>0}),o=t.ref(""),l=t.ref(void 0);t.watch(()=>e.value,r=>{r!==l.value&&(o.value=he(r,i.value),l.value=r)},{immediate:!0});function p(r){if(f.value){const C=i.value??0,$=qe(r),b=$?Number($):0,D=Math.pow(10,C),k=$?b/D:null,E=k===null?null:k;l.value=E,n("update:value",E),n("input",E),n("change",E),o.value=he(E,C);return}const u=s.value?qe(r):Eo(r),y=s.value?u:Co(u,i.value);let _=null;if(y){const $=(s.value?null:Vo(y))??Bo(y);_=$===null?null:$}l.value=_,n("update:value",_),n("input",_),n("change",_),o.value=he(_,i.value)}return{attrs:a,emit:n,displayValue:o,isInteiro:s,onUpdateModelValue:p}}}),vo={class:"eli-entrada__prefixo"},Do={class:"eli-entrada__sufixo"};function _o(e,a,n,i,s,f){var o,l,p,r;return t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({"model-value":e.displayValue,label:(o=e.opcoes)==null?void 0:o.rotulo,placeholder:(l=e.opcoes)==null?void 0:l.placeholder,type:e.isInteiro?"number":"text",inputmode:e.isInteiro?"numeric":"decimal",pattern:e.isInteiro?"[0-9]*":"[0-9.,]*"},e.attrs,{"onUpdate:modelValue":e.onUpdateModelValue,onFocus:a[0]||(a[0]=()=>e.emit("focus")),onBlur:a[1]||(a[1]=()=>e.emit("blur"))}),t.createSlots({_:2},[(p=e.opcoes)!=null&&p.prefixo?{name:"prepend-inner",fn:t.withCtx(()=>[t.createElementVNode("span",vo,t.toDisplayString(e.opcoes.prefixo),1)]),key:"0"}:void 0,(r=e.opcoes)!=null&&r.sufixo?{name:"append-inner",fn:t.withCtx(()=>[t.createElementVNode("span",Do,t.toDisplayString(e.opcoes.sufixo),1)]),key:"1"}:void 0]),1040,["model-value","label","placeholder","type","inputmode","pattern","onUpdate:modelValue"])}const Fe=O(So,[["render",_o],["__scopeId","data-v-77cbf216"]]),wo={install(e){e.component("EliOlaMundo",$e),e.component("EliBotao",pe),e.component("EliBadge",ce),e.component("EliInput",be),e.component("EliCartao",ke),e.component("EliDataHora",Ee),e.component("EliTabela",Ie),e.component("EliEntradaTexto",Oe),e.component("EliEntradaNumero",Fe)}};A.EliBadge=ce,A.EliBotao=pe,A.EliCartao=ke,A.EliDataHora=Ee,A.EliEntradaNumero=Fe,A.EliEntradaTexto=Oe,A.EliInput=be,A.EliOlaMundo=$e,A.EliTabela=Ie,A.default=wo,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); diff --git a/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts b/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts new file mode 100644 index 0000000..c611096 --- /dev/null +++ b/dist/types/componentes/EliEntrada/EliEntradaNumero.vue.d.ts @@ -0,0 +1,49 @@ +import { PropType } from "vue"; +import type { PadroesEntradas } from "./tiposEntradas"; +type EntradaNumero = PadroesEntradas["numero"]; +declare const __VLS_export: import("vue").DefineComponent; + default: undefined; + }; + opcoes: { + type: PropType; + required: true; + }; +}>, { + 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); + displayValue: import("vue").Ref; + isInteiro: import("vue").ComputedRef; + onUpdateModelValue: (texto: string) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + "update:value": (_v: EntradaNumero["value"]) => true; + /** Compat Vue2 (v-model padrão: value + input) */ + input: (_v: EntradaNumero["value"]) => true; + change: (_v: EntradaNumero["value"]) => true; + focus: () => true; + blur: () => true; +}, string, import("vue").PublicProps, Readonly; + default: undefined; + }; + opcoes: { + type: PropType; + required: true; + }; +}>> & Readonly<{ + 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>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts b/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts new file mode 100644 index 0000000..1ee2e87 --- /dev/null +++ b/dist/types/componentes/EliEntrada/EliEntradaTexto.vue.d.ts @@ -0,0 +1,47 @@ +import { PropType } from "vue"; +import type { PadroesEntradas } from "./tiposEntradas"; +type EntradaTexto = PadroesEntradas["texto"]; +declare const __VLS_export: import("vue").DefineComponent; + default: undefined; + }; + opcoes: { + type: PropType; + required: true; + }; +}>, { + 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); + localValue: import("vue").WritableComputedRef; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + "update:value": (_v: EntradaTexto["value"]) => true; + /** Compat Vue2 (v-model padrão: value + input) */ + input: (_v: EntradaTexto["value"]) => true; + change: (_v: EntradaTexto["value"]) => true; + focus: () => true; + blur: () => true; +}, string, import("vue").PublicProps, Readonly; + default: undefined; + }; + opcoes: { + type: PropType; + required: true; + }; +}>> & Readonly<{ + 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>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/componentes/EliEntrada/index.d.ts b/dist/types/componentes/EliEntrada/index.d.ts new file mode 100644 index 0000000..f376631 --- /dev/null +++ b/dist/types/componentes/EliEntrada/index.d.ts @@ -0,0 +1,4 @@ +import EliEntradaTexto from "./EliEntradaTexto.vue"; +import EliEntradaNumero from "./EliEntradaNumero.vue"; +export { EliEntradaTexto, EliEntradaNumero }; +export type { PadroesEntradas, TipoEntrada } from "./tiposEntradas"; diff --git a/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts b/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts new file mode 100644 index 0000000..202ad73 --- /dev/null +++ b/dist/types/componentes/EliEntrada/registryEliEntradas.d.ts @@ -0,0 +1,106 @@ +export declare const registryTabelaCelulas: { + readonly texto: import("vue").DefineComponent; + default: undefined; + }; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + limiteCaracteres?: number; + }>; + required: true; + }; + }>, { + 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); + localValue: import("vue").WritableComputedRef; + }, {}, {}, {}, 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; + }; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + limiteCaracteres?: number; + }>; + required: true; + }; + }>> & Readonly<{ + 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>; + readonly numero: import("vue").DefineComponent; + default: undefined; + }; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + sufixo?: string; + prefixo?: string; + precisao?: number; + }>; + required: true; + }; + }>, { + 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); + displayValue: import("vue").Ref; + isInteiro: import("vue").ComputedRef; + onUpdateModelValue: (texto: string) => void; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + "update:value": (_v: number | null | undefined) => true; + input: (_v: number | null | undefined) => true; + change: (_v: number | null | undefined) => true; + focus: () => true; + blur: () => true; + }, string, import("vue").PublicProps, Readonly; + default: undefined; + }; + opcoes: { + type: import("vue").PropType<{ + rotulo: string; + placeholder?: string; + } & { + sufixo?: string; + prefixo?: string; + precisao?: number; + }>; + required: true; + }; + }>> & Readonly<{ + 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/tiposEntradas.d.ts b/dist/types/componentes/EliEntrada/tiposEntradas.d.ts new file mode 100644 index 0000000..acec971 --- /dev/null +++ b/dist/types/componentes/EliEntrada/tiposEntradas.d.ts @@ -0,0 +1,65 @@ +/** + * Tipos base para componentes de entrada (EliEntrada*) + * + * Objetivo: + * - Padronizar o shape de dados de todos os componentes de entrada. + * - Cada entrada possui sempre: + * 1) `value`: o valor atual (tipado) + * 2) `opcoes`: configuração do componente (rótulo, placeholder e extras por tipo) + * + * Como usar: + * - `PadroesEntradas[tipo]` retorna a tipagem completa (value + opcoes) daquele tipo. + * - `TipoEntrada` é a união com todos os tipos suportados (ex.: "texto" | "numero"). + */ +/** + * Contrato padrão de uma entrada. + * + * @typeParam T - tipo do `value` (ex.: string | null | undefined) + * @typeParam Mais - campos adicionais dentro de `opcoes`, específicos do tipo de entrada + */ +export type tipoPadraoEntrada = {}> = { + /** Valor atual do campo (pode aceitar null/undefined quando aplicável) */ + value: T; + /** Configurações do componente (visuais + regras simples do tipo) */ + opcoes: { + /** Rótulo exibido ao usuário */ + rotulo: string; + /** Texto de ajuda dentro do input quando vazio */ + placeholder?: string; + } & Mais; +}; +/** + * Mapa de tipos de entrada suportados e suas configurações específicas. + * + * Observação importante: + * - As chaves deste objeto (ex.: "texto", "numero") viram o tipo `TipoEntrada`. + * - Cada item define: + * - `value`: tipo do valor + * - `opcoes`: opções comuns + extras específicas + */ +export type PadroesEntradas = { + texto: tipoPadraoEntrada; + numero: tipoPadraoEntrada somente inteiros + * - 0.1 => 1 casa decimal + * - 0.01 => 2 casas decimais + * + * Dica: este conceito corresponde ao atributo HTML `step`. + */ + precisao?: number; + }>; +}; +/** + * União dos tipos de entrada suportados. + * Ex.: "texto" | "numero" + */ +export type TipoEntrada = keyof PadroesEntradas; diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/componentes/EliTabela/EliTabela.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabela.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabela.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaBody.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaBody.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaBody.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaCabecalho.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaCabecalho.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaCaixaDeBusca.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaDebug.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaDebug.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaDebug.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaDebug.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaDetalhesLinha.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaDetalhesLinha.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaDetalhesLinha.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaDetalhesLinha.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaEstados.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaEstados.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaEstados.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaEstados.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaHead.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaHead.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaHead.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaHead.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaMenuAcoes.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaMenuAcoes.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaMenuAcoes.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaMenuAcoes.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaModalColunas.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaModalColunas.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaModalColunas.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaModalColunas.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/EliTabelaPaginacao.vue.d.ts b/dist/types/componentes/EliTabela/EliTabelaPaginacao.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/EliTabelaPaginacao.vue.d.ts rename to dist/types/componentes/EliTabela/EliTabelaPaginacao.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts b/dist/types/componentes/EliTabela/celulas/EliTabelaCelula.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/EliTabelaCelula.vue.d.ts rename to dist/types/componentes/EliTabela/celulas/EliTabelaCelula.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts b/dist/types/componentes/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts rename to dist/types/componentes/EliTabela/celulas/EliTabelaCelulaNumero.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts b/dist/types/componentes/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts rename to dist/types/componentes/EliTabela/celulas/EliTabelaCelulaTextoSimples.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoTruncado.vue.d.ts b/dist/types/componentes/EliTabela/celulas/EliTabelaCelulaTextoTruncado.vue.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/EliTabelaCelulaTextoTruncado.vue.d.ts rename to dist/types/componentes/EliTabela/celulas/EliTabelaCelulaTextoTruncado.vue.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts b/dist/types/componentes/EliTabela/celulas/registryTabelaCelulas.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/registryTabelaCelulas.d.ts rename to dist/types/componentes/EliTabela/celulas/registryTabelaCelulas.d.ts diff --git a/dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts b/dist/types/componentes/EliTabela/celulas/tiposTabelaCelulas.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/celulas/tiposTabelaCelulas.d.ts rename to dist/types/componentes/EliTabela/celulas/tiposTabelaCelulas.d.ts diff --git a/dist/types/components/eli/EliTabela/colunasStorage.d.ts b/dist/types/componentes/EliTabela/colunasStorage.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/colunasStorage.d.ts rename to dist/types/componentes/EliTabela/colunasStorage.d.ts diff --git a/dist/types/components/eli/EliTabela/index.d.ts b/dist/types/componentes/EliTabela/index.d.ts similarity index 100% rename from dist/types/components/eli/EliTabela/index.d.ts rename to dist/types/componentes/EliTabela/index.d.ts diff --git a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts b/dist/types/componentes/EliTabela/types-eli-tabela.d.ts similarity index 99% rename from dist/types/components/eli/EliTabela/types-eli-tabela.d.ts rename to dist/types/componentes/EliTabela/types-eli-tabela.d.ts index a55527c..4406580 100644 --- a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts +++ b/dist/types/componentes/EliTabela/types-eli-tabela.d.ts @@ -13,7 +13,6 @@ export type EliColuna = { /** Função responsável por renderizar o conteúdo da célula. */ celula: (linha: T) => ComponenteCelula; /** Ação opcional disparada ao clicar na célula. */ - acao?: () => void; /** * Campo de ordenação associado à coluna. Caso informado, a coluna passa a * exibir controles de ordenação e utiliza o valor como chave para o backend. diff --git a/dist/types/index.d.ts b/dist/types/index.d.ts index da0038b..c2cb64f 100644 --- a/dist/types/index.d.ts +++ b/dist/types/index.d.ts @@ -6,7 +6,8 @@ import { EliBadge } from "./componentes/indicador"; import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliDataHora } from "./componentes/data_hora"; -import { EliTabela } from "./components/eli/EliTabela"; +import { EliTabela } from "./componentes/EliTabela"; +import { EliEntradaTexto, EliEntradaNumero } from "./componentes/EliEntrada"; export { EliOlaMundo }; export { EliBotao }; export { EliBadge }; @@ -14,5 +15,6 @@ export { EliInput }; export { EliCartao }; export { EliDataHora }; export { EliTabela }; +export { EliEntradaTexto, EliEntradaNumero }; declare const EliVue: Plugin; export default EliVue; diff --git a/package.json b/package.json index 2aa0c14..fc3fc60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.48", + "version": "0.1.58", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/componentes/EliEntrada/EliEntradaNumero.vue b/src/componentes/EliEntrada/EliEntradaNumero.vue new file mode 100644 index 0000000..cd27780 --- /dev/null +++ b/src/componentes/EliEntrada/EliEntradaNumero.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/src/componentes/EliEntrada/EliEntradaTexto.vue b/src/componentes/EliEntrada/EliEntradaTexto.vue new file mode 100644 index 0000000..5e95854 --- /dev/null +++ b/src/componentes/EliEntrada/EliEntradaTexto.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/componentes/EliEntrada/index.ts b/src/componentes/EliEntrada/index.ts new file mode 100644 index 0000000..bfab287 --- /dev/null +++ b/src/componentes/EliEntrada/index.ts @@ -0,0 +1,5 @@ +import EliEntradaTexto from "./EliEntradaTexto.vue"; +import EliEntradaNumero from "./EliEntradaNumero.vue"; + +export { EliEntradaTexto, EliEntradaNumero }; +export type { PadroesEntradas, TipoEntrada } from "./tiposEntradas"; diff --git a/src/componentes/EliEntrada/registryEliEntradas.ts b/src/componentes/EliEntrada/registryEliEntradas.ts new file mode 100644 index 0000000..f207047 --- /dev/null +++ b/src/componentes/EliEntrada/registryEliEntradas.ts @@ -0,0 +1,11 @@ +import type { Component } from "vue"; + +import EliEntradaTexto from "./EliEntradaTexto.vue"; +import EliEntradaNumero from "./EliEntradaNumero.vue"; + +import type { TipoEntrada } from "./tiposEntradas"; + +export const registryTabelaCelulas = { + texto: EliEntradaTexto, + numero: EliEntradaNumero, +} as const satisfies Record; diff --git a/src/componentes/EliEntrada/tiposEntradas.ts b/src/componentes/EliEntrada/tiposEntradas.ts new file mode 100644 index 0000000..cdcb71e --- /dev/null +++ b/src/componentes/EliEntrada/tiposEntradas.ts @@ -0,0 +1,81 @@ +/** + * Tipos base para componentes de entrada (EliEntrada*) + * + * Objetivo: + * - Padronizar o shape de dados de todos os componentes de entrada. + * - Cada entrada possui sempre: + * 1) `value`: o valor atual (tipado) + * 2) `opcoes`: configuração do componente (rótulo, placeholder e extras por tipo) + * + * Como usar: + * - `PadroesEntradas[tipo]` retorna a tipagem completa (value + opcoes) daquele tipo. + * - `TipoEntrada` é a união com todos os tipos suportados (ex.: "texto" | "numero"). + */ + +/** + * Contrato padrão de uma entrada. + * + * @typeParam T - tipo do `value` (ex.: string | null | undefined) + * @typeParam Mais - campos adicionais dentro de `opcoes`, específicos do tipo de entrada + */ +export type tipoPadraoEntrada = {}> = { + /** Valor atual do campo (pode aceitar null/undefined quando aplicável) */ + value: T + + /** Configurações do componente (visuais + regras simples do tipo) */ + opcoes: { + /** Rótulo exibido ao usuário */ + rotulo: string + + /** Texto de ajuda dentro do input quando vazio */ + placeholder?: string + } & Mais +} + +/** + * Mapa de tipos de entrada suportados e suas configurações específicas. + * + * Observação importante: + * - As chaves deste objeto (ex.: "texto", "numero") viram o tipo `TipoEntrada`. + * - Cada item define: + * - `value`: tipo do valor + * - `opcoes`: opções comuns + extras específicas + */ +export type PadroesEntradas = { + texto: tipoPadraoEntrada< + string | null | undefined, + { + /** Limite máximo de caracteres permitidos (se definido) */ + limiteCaracteres?: number + } + > + + numero: tipoPadraoEntrada< + number | null | undefined, + { + + + /** Unidade de medida (ex.: "kg", "m³") */ + sufixo?: string + + /** Moéda (ex.: "R$") */ + prefixo?: string + + /** + * Passo/precisão do valor numérico. + * - 1 => somente inteiros + * - 0.1 => 1 casa decimal + * - 0.01 => 2 casas decimais + * + * Dica: este conceito corresponde ao atributo HTML `step`. + */ + precisao?: number + } + > +} + +/** + * União dos tipos de entrada suportados. + * Ex.: "texto" | "numero" + */ +export type TipoEntrada = keyof PadroesEntradas diff --git a/src/index.ts b/src/index.ts index bd2b14c..2cb9a2a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { EliInput } from "./componentes/campo"; import { EliCartao } from "./componentes/cartao"; import { EliDataHora } from "./componentes/data_hora"; import { EliTabela } from "./componentes/EliTabela"; +import { EliEntradaTexto, EliEntradaNumero } from "./componentes/EliEntrada"; export { EliOlaMundo }; export { EliBotao }; @@ -15,6 +16,7 @@ export { EliInput }; export { EliCartao }; export { EliDataHora }; export { EliTabela }; +export { EliEntradaTexto, EliEntradaNumero }; const EliVue: Plugin = { install(app: App) { @@ -25,6 +27,8 @@ const EliVue: Plugin = { app.component("EliCartao", EliCartao); app.component("EliDataHora", EliDataHora); app.component("EliTabela", EliTabela); + app.component("EliEntradaTexto", EliEntradaTexto); + app.component("EliEntradaNumero", EliEntradaNumero); }, }; diff --git a/src/playground/App.vue b/src/playground/App.vue index 9656010..4dfe8d3 100644 --- a/src/playground/App.vue +++ b/src/playground/App.vue @@ -9,6 +9,7 @@ Indicador Cartão Campo + Entradas Data e hora Tabela Demo @@ -20,6 +21,7 @@ + @@ -32,6 +34,7 @@ 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"; import OlaMundoPlayground from "./ola_mundo.playground.vue"; @@ -41,6 +44,7 @@ type AbaPlayground = | "indicador" | "cartao" | "campo" + | "entradas" | "data_hora" | "tabela" | "ola_mundo"; @@ -50,6 +54,7 @@ const mapaHashParaAba: Record = { indicador: "indicador", cartao: "cartao", campo: "campo", + entradas: "entradas", "data-hora": "data_hora", tabela: "tabela", demo: "ola_mundo", @@ -60,6 +65,7 @@ const mapaAbaParaHash: Record = { indicador: "indicador", cartao: "cartao", campo: "campo", + entradas: "entradas", data_hora: "data-hora", tabela: "tabela", ola_mundo: "demo", @@ -72,6 +78,7 @@ export default defineComponent({ IndicadorPlayground, CartaoPlayground, CampoPlayground, + EntradasPlayground, DataHoraPlayground, TabelaPlayground, OlaMundoPlayground, diff --git a/src/playground/entradas.playground.vue b/src/playground/entradas.playground.vue new file mode 100644 index 0000000..03aa346 --- /dev/null +++ b/src/playground/entradas.playground.vue @@ -0,0 +1,88 @@ + + + diff --git a/tsconfig.json b/tsconfig.json index fe4029d..d62fc22 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,6 +26,6 @@ /* Vue */ "types": ["vite/client"] }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue"], + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue", "src/componentes/EliEntrada"], "exclude": ["dist", "node_modules"] }