From 51c3808a7f1e1ab13b101f205855348fdb3bcd71 Mon Sep 17 00:00:00 2001 From: Luiz Silva Date: Wed, 28 Jan 2026 19:12:20 -0300 Subject: [PATCH] =?UTF-8?q?adicionado=20gest=C3=A3o=20de=20colunas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/eli-vue.css | 2 +- dist/eli-vue.es.js | 2096 ++++++++++------- dist/eli-vue.umd.js | 28 +- .../eli/EliTabela/EliTabela.vue.d.ts | 72 +- .../eli/EliTabela/EliTabelaCabecalho.vue.d.ts | 17 +- .../EliTabela/EliTabelaModalColunas.vue.d.ts | 46 + .../eli/EliTabela/colunasStorage.d.ts | 10 + .../eli/EliTabela/types-eli-tabela.d.ts | 2 + package.json | 2 +- src/components/eli/EliTabela/EliTabela.vue | 82 +- .../eli/EliTabela/EliTabelaCabecalho.vue | 37 +- .../eli/EliTabela/EliTabelaModalColunas.vue | 394 ++++ .../eli/EliTabela/colunasStorage.ts | 49 + .../eli/EliTabela/types-eli-tabela.ts | 2 + 14 files changed, 1910 insertions(+), 929 deletions(-) create mode 100644 dist/types/components/eli/EliTabela/EliTabelaModalColunas.vue.d.ts create mode 100644 dist/types/components/eli/EliTabela/colunasStorage.d.ts create mode 100644 src/components/eli/EliTabela/EliTabelaModalColunas.vue create mode 100644 src/components/eli/EliTabela/colunasStorage.ts diff --git a/dist/eli-vue.css b/dist/eli-vue.css index 65b9064..b08a164 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__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{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-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} diff --git a/dist/eli-vue.es.js b/dist/eli-vue.es.js index f3e5130..6264923 100644 --- a/dist/eli-vue.es.js +++ b/dist/eli-vue.es.js @@ -1,16 +1,16 @@ -import { defineComponent as N, createBlock as P, openBlock as p, mergeProps as oe, withCtx as z, renderSlot as ie, computed as A, ref as w, createElementBlock as k, createCommentVNode as J, createSlots as Le, createVNode as V, createTextVNode as pe, toDisplayString as Y, Fragment as K, renderList as ee, resolveComponent as H, createElementVNode as B, h as Ae, watch as le, withDirectives as He, withKeys as Ye, vModelText as Fe, normalizeStyle as ge, resolveDynamicComponent as ye, normalizeClass as se, withModifiers as De, Teleport as Re, onMounted as We, onBeforeUnmount as Je } from "vue"; -import { VBtn as Ze } from "vuetify/components/VBtn"; -import { VBadge as Xe } from "vuetify/components/VBadge"; -import { VCheckbox as Ge } from "vuetify/components/VCheckbox"; -import { VIcon as Ke } from "vuetify/components/VIcon"; -import { VRadio as Qe } from "vuetify/components/VRadio"; -import { VRadioGroup as xe } from "vuetify/components/VRadioGroup"; -import { VSelect as ea } from "vuetify/components/VSelect"; -import { VTextField as Pe } from "vuetify/components/VTextField"; -import { VTextarea as aa } from "vuetify/components/VTextarea"; -import { VCard as Te, VCardTitle as Oe, VCardText as qe, VCardActions as Ie } from "vuetify/components/VCard"; -import { VContainer as ta } from "vuetify/components/VGrid"; -const oa = N({ +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({ name: "EliBotao", inheritAttrs: !1, props: { @@ -35,30 +35,30 @@ const oa = N({ default: !1 } } -}), j = (e, a) => { - const u = e.__vccOpts || e; - for (const [i, c] of a) - u[i] = c; - return u; +}), H = (e, a) => { + const r = e.__vccOpts || e; + for (const [n, s] of a) + r[n] = s; + return r; }; -function ra(e, a, u, i, c, m) { - return p(), P(Ze, oe({ +function fa(e, a, r, n, s, d) { + return f(), U(oa, de({ 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: z(() => [ - ie(e.$slots, "default") + default: W(() => [ + ce(e.$slots, "default") ]), _: 3 }, 16, ["color", "variant", "size", "disabled", "loading"]); } -const Ue = /* @__PURE__ */ j(oa, [["render", ra]]), Ee = { +const ze = /* @__PURE__ */ H(ma, [["render", fa]]), we = { suave: "4px", pill: "10px" -}, na = N({ +}, pa = z({ name: "EliBadge", inheritAttrs: !1, props: { @@ -97,14 +97,14 @@ const Ue = /* @__PURE__ */ j(oa, [["render", ra]]), Ee = { } }, setup(e) { - const a = A(() => e.radius in Ee ? Ee[e.radius] : e.radius), u = A(() => e.dot || e.badge !== void 0 ? e.visible : !1), i = A(() => ({ + 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(() => ({ "--eli-badge-radius": a.value })); - return { showBadge: u, badgeStyle: i }; + return { showBadge: r, badgeStyle: n }; } }); -function la(e, a, u, i, c, m) { - return e.showBadge ? (p(), P(Xe, oe({ +function ba(e, a, r, n, s, d) { + return e.showBadge ? (f(), U(na, de({ key: 0, color: e.color }, e.$attrs, { @@ -116,46 +116,46 @@ function la(e, a, u, i, c, m) { style: e.badgeStyle, class: "eli-badge" }), { - default: z(() => [ - ie(e.$slots, "default", {}, void 0, !0) + default: W(() => [ + ce(e.$slots, "default", {}, void 0, !0) ]), _: 3 - }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ie(e.$slots, "default", { key: 1 }, void 0, !0); + }, 16, ["color", "location", "offset-x", "offset-y", "dot", "content", "style"])) : ce(e.$slots, "default", { key: 1 }, void 0, !0); } -const Ce = /* @__PURE__ */ j(na, [["render", la], ["__scopeId", "data-v-371c8db4"]]); -function ia(e) { +const Ee = /* @__PURE__ */ H(pa, [["render", ba], ["__scopeId", "data-v-371c8db4"]]); +function va(e) { return e.replace(/\D+/g, ""); } -function sa(e) { - const a = ia(e); +function ga(e) { + const a = va(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 ua(e) { +function ha(e) { return e.replace(/\D+/g, ""); } -function da(e) { - const a = ua(e); +function ya(e) { + const a = ha(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 Ve(e) { +function Me(e) { return e.replace(/\D+/g, ""); } -function Ne(e) { - const a = e.replace(/[^\d,]/g, ""), u = a.split(","); - return u.length > 2 ? u[0] + "," + u.slice(1).join("") : a; +function He(e) { + const a = e.replace(/[^\d,]/g, ""), r = a.split(","); + return r.length > 2 ? r[0] + "," + r.slice(1).join("") : a; } -function ca(e) { - return Ne(e.replace(/%/g, "")); +function $a(e) { + return He(e.replace(/%/g, "")); } -function ma(e) { - const a = Ve(e); +function Ca(e) { + const a = Me(e); return a ? (parseInt(a, 10) / 100).toFixed(2).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") : ""; } -function pa(e) { - const a = Ve(e).slice(0, 8); +function _a(e) { + const a = Me(e).slice(0, 8); return a.length <= 5 ? a : a.replace(/^(\d{5})(\d{1,3})$/, "$1-$2"); } -const fa = N({ +const Sa = z({ name: "EliInput", inheritAttrs: !1, props: { @@ -197,13 +197,13 @@ const fa = N({ chips: Boolean }, emits: ["update:modelValue", "change", "focus", "blur"], - setup(e, { emit: a, attrs: u }) { - const i = w(!1), c = w(!1), m = A({ + setup(e, { emit: a, attrs: r }) { + const n = I(!1), s = I(!1), d = M({ get: () => e.modelValue, - set: (y) => { - a("update:modelValue", y), a("change", y); + set: (A) => { + a("update:modelValue", A), a("change", A); } - }), n = A( + }), t = M( () => [ "text", "password", @@ -218,83 +218,83 @@ const fa = N({ "porcentagem", "cep" ].includes(e.type) - ), s = A( - () => e.type === "password" ? c.value ? "text" : "password" : "text" - ), $ = A(() => { + ), l = M( + () => e.type === "password" ? s.value ? "text" : "password" : "text" + ), v = M(() => { if (e.type === "telefone") return "tel"; if (e.type === "porcentagem") return "decimal"; if (e.type.startsWith("numerico")) return "numeric"; - }), r = A( - () => e.error ? "error" : i.value ? e.color : void 0 + }), o = M( + () => e.error ? "error" : n.value ? e.color : void 0 ); - function h(y) { - const q = y.target; - let _ = q.value; + function g(A) { + const E = A.target; + let p = E.value; switch (e.type) { case "numericoInteiro": - _ = Ve(_); + p = Me(p); break; case "numericoDecimal": - _ = Ne(_); + p = He(p); break; case "numericoMoeda": - _ = ma(_); + p = Ca(p); break; case "porcentagem": - _ = ca(_); + p = $a(p); break; case "telefone": - _ = da(_); + p = ya(p); break; case "cpfCnpj": - _ = sa(_); + p = ga(p); break; case "cep": - _ = pa(_); + p = _a(p); break; } - q.value = _, a("update:modelValue", _), a("change", _); + E.value = p, a("update:modelValue", p), a("change", p); } - function g() { - c.value = !c.value; + function y() { + s.value = !s.value; } - const T = A(() => (e.options || []).map((y) => { - if (y && typeof y == "object" && "value" in y) { - const _ = y.value; + const L = M(() => (e.options || []).map((A) => { + if (A && typeof A == "object" && "value" in A) { + const p = A.value; return { - label: y.label ?? String(_), - value: _, - disabled: y.disabled + label: A.label ?? String(p), + value: p, + disabled: A.disabled }; } - const q = y; - return { label: String(q), value: q }; + const E = A; + return { label: String(E), value: E }; })); return { - attrs: u, - value: m, - isTextLike: n, - inputHtmlType: s, - inputMode: $, - internalColor: r, - showPassword: c, - togglePassword: g, - onInput: h, + attrs: r, + value: d, + isTextLike: t, + inputHtmlType: l, + inputMode: v, + internalColor: o, + showPassword: s, + togglePassword: y, + onInput: g, onFocus: () => a("focus"), onBlur: () => a("blur"), - computedItems: T + computedItems: L }; } -}), ba = { class: "eli-input" }, va = { +}), ka = { class: "eli-input" }, Aa = { key: 4, class: "checkbox-group" }; -function ha(e, a, u, i, c, m) { - return p(), k("div", ba, [ - e.isTextLike ? (p(), P(Pe, oe({ +function Da(e, a, r, n, s, d) { + return f(), _("div", ka, [ + e.isTextLike ? (f(), U(Ne, de({ key: 0, modelValue: e.value, - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n), + "onUpdate:modelValue": a[0] || (a[0] = (t) => e.value = t), type: e.inputHtmlType, label: e.label, placeholder: e.placeholder, @@ -313,34 +313,34 @@ function ha(e, a, u, i, c, m) { onFocus: e.onFocus, onBlur: e.onBlur, onInput: e.onInput - }), Le({ _: 2 }, [ + }), Xe({ _: 2 }, [ e.type === "password" && e.showPasswordToggle ? { name: "append-inner", - fn: z(() => [ - V(Ke, { + fn: W(() => [ + O(ra, { class: "cursor-pointer", onClick: e.togglePassword }, { - default: z(() => [ - pe(Y(e.showPassword ? "mdi-eye-off" : "mdi-eye"), 1) + default: W(() => [ + ge(Z(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" ? (p(), P(aa, oe({ + ]), 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({ key: 1, modelValue: e.value, - "onUpdate:modelValue": a[1] || (a[1] = (n) => e.value = n), + "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t), label: e.label, rows: e.rows, density: e.density, variant: e.variant - }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (p(), P(ea, oe({ + }, e.attrs), null, 16, ["modelValue", "label", "rows", "density", "variant"])) : e.type === "select" ? (f(), U(ua, de({ key: 2, modelValue: e.value, - "onUpdate:modelValue": a[2] || (a[2] = (n) => e.value = n), + "onUpdate:modelValue": a[2] || (a[2] = (t) => e.value = t), items: e.computedItems, label: e.label, placeholder: e.placeholder, @@ -357,127 +357,127 @@ function ha(e, a, u, i, c, m) { }, 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" ? (p(), P(xe, { + }), null, 16, ["modelValue", "items", "label", "placeholder", "multiple", "chips", "clearable", "disabled", "density", "variant", "error", "error-messages", "onFocus", "onBlur"])) : e.type === "radio" ? (f(), U(sa, { key: 3, modelValue: e.value, - "onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n), + "onUpdate:modelValue": a[3] || (a[3] = (t) => e.value = t), row: e.row }, { - default: z(() => [ - (p(!0), k(K, null, ee(e.computedItems, (n) => (p(), P(Qe, { - key: String(n.value), - label: n.label, - value: n.value + default: W(() => [ + (f(!0), _(ee, null, ne(e.computedItems, (t) => (f(), U(ia, { + key: String(t.value), + label: t.label, + value: t.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 - }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (p(), k("div", va, [ - (p(!0), k(K, null, ee(e.computedItems, (n) => (p(), P(Ge, { - key: String(n.value), + }, 8, ["modelValue", "row"])) : e.type === "checkbox" ? (f(), _("div", Aa, [ + (f(!0), _(ee, null, ne(e.computedItems, (t) => (f(), U(la, { + key: String(t.value), modelValue: e.value, - "onUpdate:modelValue": a[4] || (a[4] = (s) => e.value = s), - label: n.label, - value: n.value, + "onUpdate:modelValue": a[4] || (a[4] = (l) => e.value = l), + label: t.label, + value: t.value, density: e.density }, null, 8, ["modelValue", "label", "value", "density"]))), 128)) - ])) : J("", !0) + ])) : x("", !0) ]); } -const je = /* @__PURE__ */ j(fa, [["render", ha], ["__scopeId", "data-v-756cb549"]]), ga = N({ +const Ye = /* @__PURE__ */ H(Sa, [["render", Da], ["__scopeId", "data-v-756cb549"]]), Ea = z({ name: "EliOlaMundo", components: { - EliBotao: Ue, - EliBadge: Ce, - EliInput: je + EliBotao: ze, + EliBadge: Ee, + EliInput: Ye }, setup() { - const e = w(""), a = w([]), u = w(""), i = w(""), c = w(""), m = w(""), n = w(""), s = w(""), $ = w(""), r = w(""), h = w(""), g = w(null), T = w([]); + 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([]); return { nome: e, - email: s, - documento: h, + email: l, + documento: g, estado: a, - telefone: i, - mensagem: $, - senha: r, - cor: g, - habilidades: T, - idade: c, - altura: m, - cep: u, - valor: n + telefone: n, + mensagem: v, + senha: o, + cor: y, + habilidades: L, + idade: s, + altura: d, + cep: r, + valor: t }; } -}), ya = { class: "grid-example" }; -function $a(e, a, u, i, c, m) { - const n = H("EliBadge"), s = H("EliInput"), $ = H("EliBotao"); - return p(), P(ta, null, { - default: z(() => [ - V(Te, { +}), 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, { class: "mx-auto", max_width: "400" }, { - default: z(() => [ - V(Oe, null, { - default: z(() => [ - V(n, { + default: W(() => [ + O(Fe, null, { + default: W(() => [ + O(t, { badge: "Novo", "offset-x": "-15", location: "right center" }, { - default: z(() => [...a[14] || (a[14] = [ - pe(" Olá Mundo! ", -1) + default: W(() => [...a[14] || (a[14] = [ + ge(" Olá Mundo! ", -1) ])]), _: 1 }) ]), _: 1 }), - V(qe, null, { - default: z(() => [ - a[15] || (a[15] = pe(" Este é um componente de exemplo integrado com Vuetify. ", -1)), - B("div", ya, [ - V(s, { + O(Ue, null, { + default: W(() => [ + a[15] || (a[15] = ge(" Este é um componente de exemplo integrado com Vuetify. ", -1)), + k("div", Ma, [ + O(l, { modelValue: e.nome, - "onUpdate:modelValue": a[0] || (a[0] = (r) => e.nome = r), + "onUpdate:modelValue": a[0] || (a[0] = (o) => e.nome = o), label: "Nome", placeholder: "Digite o nome", density: "compact" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.idade, - "onUpdate:modelValue": a[1] || (a[1] = (r) => e.idade = r), + "onUpdate:modelValue": a[1] || (a[1] = (o) => e.idade = o), type: "numericoInteiro", label: "Idade", density: "default" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.altura, - "onUpdate:modelValue": a[2] || (a[2] = (r) => e.altura = r), + "onUpdate:modelValue": a[2] || (a[2] = (o) => e.altura = o), type: "numericoDecimal", label: "Altura", density: "comfortable" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.valor, - "onUpdate:modelValue": a[3] || (a[3] = (r) => e.valor = r), + "onUpdate:modelValue": a[3] || (a[3] = (o) => e.valor = o), type: "numericoMoeda", label: "Valor" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.telefone, - "onUpdate:modelValue": a[4] || (a[4] = (r) => e.telefone = r), + "onUpdate:modelValue": a[4] || (a[4] = (o) => e.telefone = o), type: "telefone", label: "Telefone" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.cep, - "onUpdate:modelValue": a[5] || (a[5] = (r) => e.cep = r), + "onUpdate:modelValue": a[5] || (a[5] = (o) => e.cep = o), type: "cep", label: "CEP", placeholder: "00000-000" }, null, 8, ["modelValue"]), - V(s, { + O(l, { type: "select", label: "Estado", options: [ @@ -485,58 +485,58 @@ function $a(e, a, u, i, c, m) { { label: "Rio de Janeiro", value: "RJ" } ], modelValue: e.estado, - "onUpdate:modelValue": a[6] || (a[6] = (r) => e.estado = r), + "onUpdate:modelValue": a[6] || (a[6] = (o) => e.estado = o), multiple: "" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.documento, - "onUpdate:modelValue": a[7] || (a[7] = (r) => e.documento = r), + "onUpdate:modelValue": a[7] || (a[7] = (o) => e.documento = o), type: "cpfCnpj", label: "CPF / CNPJ" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.email, - "onUpdate:modelValue": a[8] || (a[8] = (r) => e.email = r), + "onUpdate:modelValue": a[8] || (a[8] = (o) => e.email = o), label: "Email", placeholder: "email@exemplo.com" }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.senha, - "onUpdate:modelValue": a[9] || (a[9] = (r) => e.senha = r), + "onUpdate:modelValue": a[9] || (a[9] = (o) => e.senha = o), label: "Senha", type: "password", showPasswordToggle: !0, placeholder: "Digite sua senha" }, null, 8, ["modelValue"]), - V(s, { + O(l, { type: "textarea", modelValue: e.mensagem, - "onUpdate:modelValue": a[10] || (a[10] = (r) => e.mensagem = r), + "onUpdate:modelValue": a[10] || (a[10] = (o) => e.mensagem = o), label: "Mensagem", rows: 5 }, null, 8, ["modelValue"]), - V(s, { + O(l, { type: "radio", modelValue: e.cor, - "onUpdate:modelValue": a[11] || (a[11] = (r) => e.cor = r), + "onUpdate:modelValue": a[11] || (a[11] = (o) => e.cor = o), label: "Cor favorita", options: [ { label: "Azul", value: "azul" }, { label: "Verde", value: "verde" } ] }, null, 8, ["modelValue"]), - V(s, { + O(l, { type: "checkbox", modelValue: e.habilidades, - "onUpdate:modelValue": a[12] || (a[12] = (r) => e.habilidades = r), + "onUpdate:modelValue": a[12] || (a[12] = (o) => e.habilidades = o), options: [ { label: "Vue", value: "vue" }, { label: "React", value: "react" } ] }, null, 8, ["modelValue"]), - V(s, { + O(l, { modelValue: e.nome, - "onUpdate:modelValue": a[13] || (a[13] = (r) => e.nome = r), + "onUpdate:modelValue": a[13] || (a[13] = (o) => e.nome = o), label: "Nome", error: !0, "error-messages": ["Obrigatório"] @@ -545,15 +545,15 @@ function $a(e, a, u, i, c, m) { ]), _: 1 }), - V(Ie, null, { - default: z(() => [ - V($, { + O(je, null, { + default: W(() => [ + O(v, { color: "primary", variant: "elevated", block: "" }, { - default: z(() => [...a[16] || (a[16] = [ - pe(" Botão Vuetify ", -1) + default: W(() => [...a[16] || (a[16] = [ + ge(" Botão Vuetify ", -1) ])]), _: 1 }) @@ -567,9 +567,9 @@ function $a(e, a, u, i, c, m) { _: 1 }); } -const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ +const Va = /* @__PURE__ */ H(Ea, [["render", wa]]), Ba = z({ name: "EliCartao", - components: { EliBadge: Ce }, + components: { EliBadge: Ee }, inheritAttrs: !1, props: { /** Título de fallback caso o slot `titulo` não seja usado. */ @@ -596,7 +596,7 @@ const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ clicar: (e) => !0 }, setup(e, { emit: a }) { - const u = A(() => e.status), i = A(() => { + const r = M(() => e.status), n = M(() => { switch (e.status) { case "novo": return "primary"; @@ -607,40 +607,40 @@ const ka = /* @__PURE__ */ j(ga, [["render", $a]]), Aa = N({ case "cancelado": return "error"; } - }), c = A(() => `eli-cartao--${e.status}`); - function m() { + }), s = M(() => `eli-cartao--${e.status}`); + function d() { a("clicar", e.status); } return { - rotuloStatus: u, - corStatus: i, - classeStatus: c, - onClick: m + rotuloStatus: r, + corStatus: n, + classeStatus: s, + onClick: d }; } -}), Ca = { class: "eli-cartao__titulo-texto" }, Va = { class: "eli-cartao__status" }; -function Ea(e, a, u, i, c, m) { - const n = H("EliBadge"); - return p(), P(Te, oe({ +}), 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({ class: ["eli-cartao", e.classeStatus], variant: e.variant }, e.$attrs), { - default: z(() => [ - V(Oe, { class: "eli-cartao__titulo" }, { - default: z(() => [ - B("div", Ca, [ - ie(e.$slots, "titulo", {}, () => [ - pe(Y(e.titulo), 1) + default: W(() => [ + O(Fe, { class: "eli-cartao__titulo" }, { + default: W(() => [ + k("div", Ta, [ + ce(e.$slots, "titulo", {}, () => [ + ge(Z(e.titulo), 1) ], !0) ]), - B("div", Va, [ - V(n, { + k("div", Pa, [ + O(t, { badge: e.rotuloStatus, radius: "pill", color: e.corStatus }, { - default: z(() => [...a[0] || (a[0] = [ - B("span", null, null, -1) + default: W(() => [...a[0] || (a[0] = [ + k("span", null, null, -1) ])]), _: 1 }, 8, ["badge", "color"]) @@ -648,309 +648,309 @@ function Ea(e, a, u, i, c, m) { ]), _: 3 }), - V(qe, { class: "eli-cartao__conteudo" }, { - default: z(() => [ - ie(e.$slots, "default", {}, void 0, !0) + O(Ue, { class: "eli-cartao__conteudo" }, { + default: W(() => [ + ce(e.$slots, "default", {}, void 0, !0) ]), _: 3 }), - e.$slots.acoes ? (p(), P(Ie, { + e.$slots.acoes ? (f(), U(je, { key: 0, class: "eli-cartao__acoes" }, { - default: z(() => [ - ie(e.$slots, "acoes", {}, void 0, !0) + default: W(() => [ + ce(e.$slots, "acoes", {}, void 0, !0) ]), _: 3 - })) : J("", !0) + })) : x("", !0) ]), _: 3 }, 16, ["variant", "class"]); } -const _a = /* @__PURE__ */ j(Aa, [["render", Ea], ["__scopeId", "data-v-6c492bd9"]]); -function Ma(e) { +const Ia = /* @__PURE__ */ H(Ba, [["render", Oa], ["__scopeId", "data-v-6c492bd9"]]); +function qa(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var he = { exports: {} }, wa = he.exports, _e; -function Sa() { - return _e || (_e = 1, (function(e, a) { - (function(u, i) { - e.exports = i(); - })(wa, (function() { - var u = 1e3, i = 6e4, c = 36e5, m = "millisecond", n = "second", s = "minute", $ = "hour", r = "day", h = "week", g = "month", T = "quarter", y = "year", q = "date", _ = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, L = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(f) { - var t = ["th", "st", "nd", "rd"], o = f % 100; - return "[" + f + (t[(o - 20) % 10] || t[o] || t[0]) + "]"; - } }, re = function(f, t, o) { - var d = String(f); - return !d || d.length >= t ? f : "" + Array(t + 1 - d.length).join(o) + f; - }, ke = { s: re, z: function(f) { - var t = -f.utcOffset(), o = Math.abs(t), d = Math.floor(o / 60), l = o % 60; - return (t <= 0 ? "+" : "-") + re(d, 2, "0") + ":" + re(l, 2, "0"); - }, m: function f(t, o) { - if (t.date() < o.date()) return -f(o, t); - var d = 12 * (o.year() - t.year()) + (o.month() - t.month()), l = t.clone().add(d, g), v = o - l < 0, b = t.clone().add(d + (v ? -1 : 1), g); - return +(-(d + (o - l) / (v ? l - b : b - l)) || 0); - }, a: function(f) { - return f < 0 ? Math.ceil(f) || 0 : Math.floor(f); - }, p: function(f) { - return { M: g, y, w: h, d: r, D: q, h: $, m: s, s: n, ms: m, Q: T }[f] || String(f || "").toLowerCase().replace(/s$/, ""); - }, u: function(f) { - return f === void 0; - } }, Z = "en", X = {}; - X[Z] = L; - var ue = "$isDayjsObject", de = function(f) { - return f instanceof ae || !(!f || !f[ue]); - }, ne = function f(t, o, d) { - var l; - if (!t) return Z; - if (typeof t == "string") { - var v = t.toLowerCase(); - X[v] && (l = v), o && (X[v] = o, l = v); - var b = t.split("-"); - if (!l && b.length > 1) return f(b[0]); +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]); } else { - var C = t.name; - X[C] = t, l = C; + var B = c.name; + le[B] = c, u = B; } - return !d && l && (Z = l), l || !d && Z; - }, O = function(f, t) { - if (de(f)) return f.clone(); - var o = typeof t == "object" ? t : {}; - return o.date = f, o.args = arguments, new ae(o); - }, E = ke; - E.l = ne, E.i = de, E.w = function(f, t) { - return O(f, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset }); + 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 }); }; - var ae = (function() { - function f(o) { - this.$L = ne(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[ue] = !0; + 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 t = f.prototype; - return t.parse = function(o) { - this.$d = (function(d) { - var l = d.date, v = d.utc; - if (l === null) return /* @__PURE__ */ new Date(NaN); - if (E.u(l)) return /* @__PURE__ */ new Date(); - if (l instanceof Date) return new Date(l); - if (typeof l == "string" && !/Z$/i.test(l)) { - var b = l.match(Q); - if (b) { - var C = b[2] - 1 || 0, M = (b[7] || "0").substring(0, 3); - return v ? new Date(Date.UTC(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M)) : new Date(b[1], C, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, M); + 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); } } - return new Date(l); - })(o), this.init(); - }, t.init = function() { - var o = this.$d; - this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds(); - }, t.$utils = function() { - return E; - }, t.isValid = function() { - return this.$d.toString() !== _; - }, t.isSame = function(o, d) { - var l = O(o); - return this.startOf(d) <= l && l <= this.endOf(d); - }, t.isAfter = function(o, d) { - return O(o) < this.startOf(d); - }, t.isBefore = function(o, d) { - return this.endOf(d) < O(o); - }, t.$g = function(o, d, l) { - return E.u(o) ? this[d] : this.set(l, o); - }, t.unix = function() { + 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 Math.floor(this.valueOf() / 1e3); - }, t.valueOf = function() { + }, c.valueOf = function() { return this.$d.getTime(); - }, t.startOf = function(o, d) { - var l = this, v = !!E.u(d) || d, b = E.p(o), C = function(R, I) { - var G = E.w(l.$u ? Date.UTC(l.$y, I, R) : new Date(l.$y, I, R), l); - return v ? G : G.endOf(r); - }, M = function(R, I) { - return E.w(l.toDate()[R].apply(l.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(I)), l); - }, S = this.$W, D = this.$M, U = this.$D, F = "set" + (this.$u ? "UTC" : ""); - switch (b) { + }, 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 v ? C(1, 0) : C(31, 11); + return $ ? B(1, T) : B(0, T + 1); case g: - return v ? C(1, D) : C(0, D + 1); - case h: - var W = this.$locale().weekStart || 0, te = (S < W ? S + 7 : S) - W; - return C(v ? U - te : U + (6 - te), D); - case r: - case q: - return M(F + "Hours", 0); - case $: - return M(F + "Minutes", 1); - case s: - return M(F + "Seconds", 2); - case n: - return M(F + "Milliseconds", 3); + 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); + case l: + return m(G + "Seconds", 2); + case t: + return m(G + "Milliseconds", 3); default: return this.clone(); } - }, t.endOf = function(o) { - return this.startOf(o, !1); - }, t.$set = function(o, d) { - var l, v = E.p(o), b = "set" + (this.$u ? "UTC" : ""), C = (l = {}, l[r] = b + "Date", l[q] = b + "Date", l[g] = b + "Month", l[y] = b + "FullYear", l[$] = b + "Hours", l[s] = b + "Minutes", l[n] = b + "Seconds", l[m] = b + "Milliseconds", l)[v], M = v === r ? this.$D + (d - this.$W) : d; - if (v === g || v === y) { - var S = this.clone().set(q, 1); - S.$d[C](M), S.init(), this.$d = S.set(q, Math.min(this.$D, S.daysInMonth())).$d; - } else C && this.$d[C](M); + }, 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); return this.init(), this; - }, t.set = function(o, d) { - return this.clone().$set(o, d); - }, t.get = function(o) { - return this[E.p(o)](); - }, t.add = function(o, d) { - var l, v = this; - o = Number(o); - var b = E.p(d), C = function(D) { - var U = O(v); - return E.w(U.date(U.date() + Math.round(D * o)), v); + }, 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)), $); }; - if (b === g) return this.set(g, this.$M + o); - if (b === y) return this.set(y, this.$y + o); - if (b === r) return C(1); - if (b === h) return C(7); - var M = (l = {}, l[s] = i, l[$] = c, l[n] = u, l)[b] || 1, S = this.$d.getTime() + o * M; - return E.w(S, this); - }, t.subtract = function(o, d) { - return this.add(-1 * o, d); - }, t.format = function(o) { - var d = this, l = this.$locale(); - if (!this.isValid()) return l.invalidDate || _; - var v = o || "YYYY-MM-DDTHH:mm:ssZ", b = E.z(this), C = this.$H, M = this.$m, S = this.$M, D = l.weekdays, U = l.months, F = l.meridiem, W = function(I, G, ce, be) { - return I && (I[G] || I(d, v)) || ce[G].slice(0, be); - }, te = function(I) { - return E.s(C % 12 || 12, I, "0"); - }, R = F || function(I, G, ce) { - var be = I < 12 ? "AM" : "PM"; - return ce ? be.toLowerCase() : be; + 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; }; - return v.replace(x, (function(I, G) { - return G || (function(ce) { - switch (ce) { + return $.replace(D, (function(V, Q) { + return Q || (function(ae) { + switch (ae) { case "YY": - return String(d.$y).slice(-2); + return String(b.$y).slice(-2); case "YYYY": - return E.s(d.$y, 4, "0"); + return N.s(b.$y, 4, "0"); case "M": - return S + 1; + return C + 1; case "MM": - return E.s(S + 1, 2, "0"); + return N.s(C + 1, 2, "0"); case "MMM": - return W(l.monthsShort, S, U, 3); + return Y(u.monthsShort, C, P, 3); case "MMMM": - return W(U, S); + return Y(P, C); case "D": - return d.$D; + return b.$D; case "DD": - return E.s(d.$D, 2, "0"); + return N.s(b.$D, 2, "0"); case "d": - return String(d.$W); + return String(b.$W); case "dd": - return W(l.weekdaysMin, d.$W, D, 2); + return Y(u.weekdaysMin, b.$W, T, 2); case "ddd": - return W(l.weekdaysShort, d.$W, D, 3); + return Y(u.weekdaysShort, b.$W, T, 3); case "dddd": - return D[d.$W]; + return T[b.$W]; case "H": - return String(C); + return String(B); case "HH": - return E.s(C, 2, "0"); + return N.s(B, 2, "0"); case "h": - return te(1); + return R(1); case "hh": - return te(2); + return R(2); case "a": - return R(C, M, !0); + return j(B, m, !0); case "A": - return R(C, M, !1); + return j(B, m, !1); case "m": - return String(M); + return String(m); case "mm": - return E.s(M, 2, "0"); + return N.s(m, 2, "0"); case "s": - return String(d.$s); + return String(b.$s); case "ss": - return E.s(d.$s, 2, "0"); + return N.s(b.$s, 2, "0"); case "SSS": - return E.s(d.$ms, 3, "0"); + return N.s(b.$ms, 3, "0"); case "Z": - return b; + return S; } return null; - })(I) || b.replace(":", ""); + })(V) || S.replace(":", ""); })); - }, t.utcOffset = function() { + }, c.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, t.diff = function(o, d, l) { - var v, b = this, C = E.p(d), M = O(o), S = (M.utcOffset() - this.utcOffset()) * i, D = this - M, U = function() { - return E.m(b, M); + }, 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); }; - switch (C) { + switch (B) { + case A: + $ = P() / 12; + break; case y: - v = U() / 12; + $ = P(); + break; + case L: + $ = P() / 3; break; case g: - v = U(); + $ = (T - C) / 6048e5; break; - case T: - v = U() / 3; + case o: + $ = (T - C) / 864e5; break; - case h: - v = (D - S) / 6048e5; + case v: + $ = T / s; break; - case r: - v = (D - S) / 864e5; + case l: + $ = T / n; break; - case $: - v = D / c; - break; - case s: - v = D / i; - break; - case n: - v = D / u; + case t: + $ = T / r; break; default: - v = D; + $ = T; } - return l ? v : E.a(v); - }, t.daysInMonth = function() { - return this.endOf(g).$D; - }, t.$locale = function() { - return X[this.$L]; - }, t.locale = function(o, d) { - if (!o) return this.$L; - var l = this.clone(), v = ne(o, d, !0); - return v && (l.$L = v), l; - }, t.clone = function() { - return E.w(this.$d, this); - }, t.toDate = function() { + 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 new Date(this.valueOf()); - }, t.toJSON = function() { + }, c.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, t.toISOString = function() { + }, c.toISOString = function() { return this.$d.toISOString(); - }, t.toString = function() { + }, c.toString = function() { return this.$d.toUTCString(); - }, f; - })(), fe = ae.prototype; - return O.prototype = fe, [["$ms", m], ["$s", n], ["$m", s], ["$H", $], ["$W", r], ["$M", g], ["$y", y], ["$D", q]].forEach((function(f) { - fe[f[1]] = function(t) { - return this.$g(t, f[0], f[1]); + }, 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]); }; - })), O.extend = function(f, t) { - return f.$i || (f(t, ae, O), f.$i = !0), O; - }, O.locale = ne, O.isDayjs = de, O.unix = function(f) { - return O(1e3 * f); - }, O.en = X[Z], O.Ls = X, O.p = {}, O; + })), 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; })); - })(he)), he.exports; + })(_e)), _e.exports; } -var Ba = Sa(); -const ve = /* @__PURE__ */ Ma(Ba), Da = N({ +var Fa = La(); +const Ce = /* @__PURE__ */ qa(Fa), Ua = z({ name: "EliDataHora", inheritAttrs: !1, props: { @@ -1049,42 +1049,42 @@ const ve = /* @__PURE__ */ Ma(Ba), Da = N({ foco: () => !0, desfoco: () => !0 }, - setup(e, { emit: a, attrs: u }) { - const i = A( + setup(e, { emit: a, attrs: r }) { + const n = M( () => e.modo === "data" ? "date" : "datetime-local" ); - function c(r) { - return e.modo === "data" ? ve(r).format("YYYY-MM-DD") : ve(r).format("YYYY-MM-DDTHH:mm"); + function s(o) { + return e.modo === "data" ? Ce(o).format("YYYY-MM-DD") : Ce(o).format("YYYY-MM-DDTHH:mm"); } - function m(r) { - return e.modo === "data" ? ve(`${r}T00:00`).format() : ve(r).format(); + function d(o) { + return e.modo === "data" ? Ce(`${o}T00:00`).format() : Ce(o).format(); } - const n = A({ - get: () => e.modelValue ? c(e.modelValue) : "", - set: (r) => { - const h = r && r.length > 0 ? r : null; - if (!h) { + const t = M({ + get: () => e.modelValue ? s(e.modelValue) : "", + set: (o) => { + const g = o && o.length > 0 ? o : null; + if (!g) { a("update:modelValue", null), a("alterar", null); return; } - const g = m(h); - a("update:modelValue", g), a("alterar", g); + const y = d(g); + a("update:modelValue", y), a("alterar", y); } - }), s = A(() => { + }), l = M(() => { if (e.min) - return c(e.min); - }), $ = A(() => { + return s(e.min); + }), v = M(() => { if (e.max) - return c(e.max); + return s(e.max); }); - return { attrs: u, valor: n, emit: a, minLocal: s, maxLocal: $, tipoInput: i }; + return { attrs: r, valor: t, emit: a, minLocal: l, maxLocal: v, tipoInput: n }; } -}), Pa = { class: "eli-data-hora" }; -function Ta(e, a, u, i, c, m) { - return p(), k("div", Pa, [ - V(Pe, oe({ +}), ja = { class: "eli-data-hora" }; +function za(e, a, r, n, s, d) { + return f(), _("div", ja, [ + O(Ne, de({ modelValue: e.valor, - "onUpdate:modelValue": a[0] || (a[0] = (n) => e.valor = n), + "onUpdate:modelValue": a[0] || (a[0] = (t) => e.valor = t), type: e.tipoInput, label: e.rotulo, placeholder: e.placeholder, @@ -1099,20 +1099,20 @@ function Ta(e, a, u, i, c, m) { min: e.minLocal, max: e.maxLocal }, e.attrs, { - onFocus: a[1] || (a[1] = (n) => e.emit("foco")), - onBlur: a[2] || (a[2] = (n) => e.emit("desfoco")) + onFocus: a[1] || (a[1] = (t) => e.emit("foco")), + onBlur: a[2] || (a[2] = (t) => e.emit("desfoco")) }), null, 16, ["modelValue", "type", "label", "placeholder", "disabled", "clearable", "error", "error-messages", "hint", "persistent-hint", "density", "variant", "min", "max"]) ]); } -const Oa = /* @__PURE__ */ j(Da, [["render", Ta], ["__scopeId", "data-v-71afabb6"]]); -var ze = ((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))(ze || {}); +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 || {}); /** * @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 qa = (e) => { +const Ya = (e) => { for (const a in e) if (a.startsWith("aria-") || a === "role" || a === "title") return !0; @@ -1124,30 +1124,30 @@ const qa = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Me = (e) => e === ""; +const Be = (e) => e === ""; /** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Ia = (...e) => e.filter((a, u, i) => !!a && a.trim() !== "" && i.indexOf(a) === u).join(" ").trim(); +const Ra = (...e) => e.filter((a, r, n) => !!a && a.trim() !== "" && n.indexOf(a) === r).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 we = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); +const Te = (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 Ua = (e) => e.replace( +const Ja = (e) => e.replace( /^([A-Z])|[\s-_]+(\w)/g, - (a, u, i) => i ? i.toUpperCase() : u.toLowerCase() + (a, r, n) => n ? n.toUpperCase() : r.toLowerCase() ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1155,8 +1155,8 @@ const Ua = (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 Na = (e) => { - const a = Ua(e); +const Wa = (e) => { + const a = Ja(e); return a.charAt(0).toUpperCase() + a.slice(1); }; /** @@ -1165,7 +1165,7 @@ const Na = (e) => { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -var me = { +var ve = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, @@ -1182,33 +1182,33 @@ var me = { * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const ja = ({ +const Za = ({ name: e, iconNode: a, - absoluteStrokeWidth: u, - "absolute-stroke-width": i, - strokeWidth: c, - "stroke-width": m, - size: n = me.width, - color: s = me.stroke, - ...$ -}, { slots: r }) => Ae( + absoluteStrokeWidth: r, + "absolute-stroke-width": n, + strokeWidth: s, + "stroke-width": d, + size: t = ve.width, + color: l = ve.stroke, + ...v +}, { slots: o }) => De( "svg", { - ...me, - ...$, - width: n, - height: n, - stroke: s, - "stroke-width": Me(u) || Me(i) || u === !0 || i === !0 ? Number(c || m || me["stroke-width"]) * 24 / Number(n) : c || m || me["stroke-width"], - class: Ia( + ...ve, + ...v, + 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( "lucide", - $.class, - ...e ? [`lucide-${we(Na(e))}-icon`, `lucide-${we(e)}`] : ["lucide-icon"] + v.class, + ...e ? [`lucide-${Te(Wa(e))}-icon`, `lucide-${Te(e)}`] : ["lucide-icon"] ), - ...!r.default && !qa($) && { "aria-hidden": "true" } + ...!o.default && !Ya(v) && { "aria-hidden": "true" } }, - [...a.map((h) => Ae(...h)), ...r.default ? [r.default()] : []] + [...a.map((g) => De(...g)), ...o.default ? [o.default()] : []] ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1216,15 +1216,15 @@ const ja = ({ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const $e = (e, a) => (u, { slots: i, attrs: c }) => Ae( - ja, +const Ae = (e, a) => (r, { slots: n, attrs: s }) => De( + Za, { - ...c, - ...u, + ...s, + ...r, iconNode: a, name: e }, - i + n ); /** * @license lucide-vue-next v0.563.0 - ISC @@ -1232,7 +1232,7 @@ const $e = (e, a) => (u, { slots: i, attrs: c }) => Ae( * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Se = $e("arrow-down", [ +const Pe = Ae("arrow-down", [ ["path", { d: "M12 5v14", key: "s699le" }], ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }] ]); @@ -1242,7 +1242,7 @@ const Se = $e("arrow-down", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const Be = $e("arrow-up", [ +const Oe = Ae("arrow-up", [ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }], ["path", { d: "M12 19V5", key: "x0mq9r" }] ]); @@ -1252,7 +1252,7 @@ const Be = $e("arrow-up", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const za = $e("ellipsis-vertical", [ +const Ga = 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" }] @@ -1263,12 +1263,12 @@ const za = $e("ellipsis-vertical", [ * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ -const La = $e("search", [ +const Xa = Ae("search", [ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }], ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }] -]), Ha = N({ +]), Ka = z({ name: "EliTabelaCaixaDeBusca", - components: { Search: La }, + components: { Search: Xa }, props: { modelo: { type: String, @@ -1282,41 +1282,41 @@ const La = $e("search", [ } }, setup(e, { emit: a }) { - const u = w(e.modelo ?? ""); - le( + const r = I(e.modelo ?? ""); + se( () => e.modelo, - (c) => { - c !== void 0 && c !== u.value && (u.value = c); + (s) => { + s !== void 0 && s !== r.value && (r.value = s); } ); - function i() { - a("buscar", u.value.trim()); + function n() { + a("buscar", r.value.trim()); } - return { texto: u, emitirBusca: i }; + return { texto: r, emitirBusca: n }; } -}), Ya = { class: "eli-tabela__busca" }, Fa = { class: "eli-tabela__busca-input-wrapper" }; -function Ra(e, a, u, i, c, m) { - const n = H("Search"); - return p(), k("div", Ya, [ - B("div", Fa, [ - He(B("input", { +}), 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", { id: "eli-tabela-busca", - "onUpdate:modelValue": a[0] || (a[0] = (s) => e.texto = s), + "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] = Ye((...s) => e.emitirBusca && e.emitirBusca(...s), ["enter"])) + onKeyup: a[1] || (a[1] = Qe((...l) => e.emitirBusca && e.emitirBusca(...l), ["enter"])) }, null, 544), [ - [Fe, e.texto] + [xe, e.texto] ]), - B("button", { + k("button", { type: "button", class: "eli-tabela__busca-botao", "aria-label": "Buscar", title: "Buscar", - onClick: a[2] || (a[2] = (...s) => e.emitirBusca && e.emitirBusca(...s)) + onClick: a[2] || (a[2] = (...l) => e.emitirBusca && e.emitirBusca(...l)) }, [ - V(n, { + O(t, { class: "eli-tabela__busca-botao-icone", size: 16, "stroke-width": 2, @@ -1326,14 +1326,19 @@ function Ra(e, a, u, i, c, m) { ]) ]); } -const Wa = /* @__PURE__ */ j(Ha, [["render", Ra], ["__scopeId", "data-v-f7b534c8"]]), Ja = N({ +const at = /* @__PURE__ */ H(Ka, [["render", et], ["__scopeId", "data-v-f7b534c8"]]), tt = z({ name: "EliTabelaCabecalho", - components: { EliTabelaCaixaDeBusca: Wa }, + components: { EliTabelaCaixaDeBusca: at }, props: { exibirBusca: { type: Boolean, required: !0 }, + exibirBotaoColunas: { + type: Boolean, + required: !1, + default: !0 + }, valorBusca: { type: String, required: !0 @@ -1346,47 +1351,63 @@ const Wa = /* @__PURE__ */ j(Ha, [["render", Ra], ["__scopeId", "data-v-f7b534c8 emits: { buscar(e) { return typeof e == "string"; + }, + colunas() { + return !0; } }, setup(e, { emit: a }) { - const u = A(() => e.acoesCabecalho.length > 0); - function i(c) { - a("buscar", c); + const r = M(() => e.acoesCabecalho.length > 0); + function n(d) { + a("buscar", d); } - return { temAcoesCabecalho: u, emitBuscar: i }; + function s() { + a("colunas"); + } + return { temAcoesCabecalho: r, emitBuscar: n, emitColunas: s }; } -}), Za = { class: "eli-tabela__cabecalho" }, Xa = { +}), ot = { class: "eli-tabela__cabecalho" }, nt = { + key: 0, + class: "eli-tabela__busca-grupo" +}, lt = { key: 1, class: "eli-tabela__acoes-cabecalho" -}, Ga = ["onClick"], Ka = { class: "eli-tabela__acoes-cabecalho-rotulo" }; -function Qa(e, a, u, i, c, m) { - const n = H("EliTabelaCaixaDeBusca"); - return p(), k("div", Za, [ - e.exibirBusca ? (p(), P(n, { - key: 0, - modelo: e.valorBusca, - onBuscar: e.emitBuscar - }, null, 8, ["modelo", "onBuscar"])) : J("", !0), - e.temAcoesCabecalho ? (p(), k("div", Xa, [ - (p(!0), k(K, null, ee(e.acoesCabecalho, (s, $) => (p(), k("button", { - key: `${s.rotulo}-${$}`, +}, 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", { + 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, { + 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}`, type: "button", class: "eli-tabela__acoes-cabecalho-botao", - style: ge(s.cor ? { backgroundColor: s.cor, color: "#fff" } : void 0), - onClick: s.acao + style: Se(l.cor ? { backgroundColor: l.cor, color: "#fff" } : void 0), + onClick: l.acao }, [ - s.icone ? (p(), P(ye(s.icone), { + l.icone ? (f(), U(ke(l.icone), { key: 0, class: "eli-tabela__acoes-cabecalho-icone", size: 16, "stroke-width": 2 - })) : J("", !0), - B("span", Ka, Y(s.rotulo), 1) - ], 12, Ga))), 128)) - ])) : J("", !0) + })) : x("", !0), + k("span", it, Z(l.rotulo), 1) + ], 12, rt))), 128)) + ])) : x("", !0) ]); } -const xa = /* @__PURE__ */ j(Ja, [["render", Qa]]), et = N({ +const ut = /* @__PURE__ */ H(tt, [["render", st], ["__scopeId", "data-v-5b4ab3b9"]]), dt = z({ name: "EliTabelaEstados", props: { carregando: { @@ -1403,25 +1424,25 @@ const xa = /* @__PURE__ */ j(Ja, [["render", Qa]]), et = N({ default: void 0 } } -}), at = { +}), ct = { key: 0, class: "eli-tabela eli-tabela--carregando", "aria-busy": "true" -}, tt = { +}, mt = { key: 1, class: "eli-tabela eli-tabela--erro", role: "alert" -}, ot = { class: "eli-tabela__erro-mensagem" }, rt = { +}, ft = { class: "eli-tabela__erro-mensagem" }, pt = { key: 2, class: "eli-tabela eli-tabela--vazio" }; -function nt(e, a, u, i, c, m) { - return e.carregando ? (p(), k("div", at, " Carregando... ")) : e.erro ? (p(), k("div", tt, [ - a[0] || (a[0] = B("div", { class: "eli-tabela__erro-titulo" }, "Erro", -1)), - B("div", ot, Y(e.erro), 1) - ])) : (p(), k("div", rt, Y(e.mensagemVazio ?? "Nenhum registro encontrado."), 1)); +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)); } -const lt = /* @__PURE__ */ j(et, [["render", nt]]), it = N({ +const vt = /* @__PURE__ */ H(dt, [["render", bt]]), gt = z({ name: "EliTabelaDebug", props: { isDev: { @@ -1437,22 +1458,22 @@ const lt = /* @__PURE__ */ j(et, [["render", nt]]), it = N({ required: !0 } } -}), st = { +}), ht = { 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 ut(e, a, u, i, c, m) { - return e.isDev ? (p(), k("div", st, [ - a[0] || (a[0] = B("div", null, [ - B("b", null, "EliTabela debug") +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") ], -1)), - B("div", null, "menuAberto: " + Y(e.menuAberto), 1), - B("div", null, "menuPos: top=" + Y(e.menuPopupPos.top) + ", left=" + Y(e.menuPopupPos.left), 1) - ])) : J("", !0); + 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); } -const dt = /* @__PURE__ */ j(it, [["render", ut]]), ct = N({ +const $t = /* @__PURE__ */ H(gt, [["render", yt]]), Ct = z({ name: "EliTabelaHead", - components: { ArrowUp: Be, ArrowDown: Se }, + components: { ArrowUp: Oe, ArrowDown: Pe }, props: { colunas: { type: Array, @@ -1477,72 +1498,72 @@ const dt = /* @__PURE__ */ j(it, [["render", ut]]), ct = N({ } }, setup(e, { emit: a }) { - function u(m) { - return (m == null ? void 0 : m.coluna_ordem) !== void 0 && (m == null ? void 0 : m.coluna_ordem) !== null; + function r(d) { + return (d == null ? void 0 : d.coluna_ordem) !== void 0 && (d == null ? void 0 : d.coluna_ordem) !== null; } - function i(m) { - return m === "direita" ? "eli-tabela__celula--direita" : m === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + function n(d) { + return d === "direita" ? "eli-tabela__celula--direita" : d === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; } - function c(m) { - a("alternarOrdenacao", m); + function s(d) { + a("alternarOrdenacao", d); } return { - ArrowUp: Be, - ArrowDown: Se, - isOrdenavel: u, - obterClasseAlinhamento: i, - emitAlternarOrdenacao: c + ArrowUp: Oe, + ArrowDown: Pe, + isOrdenavel: r, + obterClasseAlinhamento: n, + emitAlternarOrdenacao: s }; } -}), mt = { class: "eli-tabela__thead" }, pt = { class: "eli-tabela__tr eli-tabela__tr--header" }, ft = ["onClick"], bt = { class: "eli-tabela__th-texto" }, vt = { +}), _t = { class: "eli-tabela__thead" }, St = { class: "eli-tabela__tr eli-tabela__tr--header" }, kt = ["onClick"], At = { class: "eli-tabela__th-texto" }, Dt = { key: 1, class: "eli-tabela__th-label" -}, ht = { +}, Et = { key: 0, class: "eli-tabela__th eli-tabela__th--acoes", scope: "col" }; -function gt(e, a, u, i, c, m) { - const n = H("ArrowUp"); - return p(), k("thead", mt, [ - B("tr", pt, [ - (p(!0), k(K, null, ee(e.colunas, (s, $) => (p(), k("th", { - key: `th-${$}`, - class: se(["eli-tabela__th", [ - e.isOrdenavel(s) ? "eli-tabela__th--ordenavel" : void 0, - e.obterClasseAlinhamento(s.alinhamento) +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) ]]), scope: "col" }, [ - e.isOrdenavel(s) ? (p(), k("button", { + e.isOrdenavel(l) ? (f(), _("button", { key: 0, type: "button", - class: se(["eli-tabela__th-botao", [ - e.colunaOrdenacao === String(s.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 + class: me(["eli-tabela__th-botao", [ + e.colunaOrdenacao === String(l.coluna_ordem) ? "eli-tabela__th-botao--ativo" : void 0 ]]), - onClick: (r) => e.emitAlternarOrdenacao(String(s.coluna_ordem)) + onClick: (o) => e.emitAlternarOrdenacao(String(l.coluna_ordem)) }, [ - B("span", bt, Y(s.rotulo), 1), - e.colunaOrdenacao === String(s.coluna_ordem) ? (p(), P(ye(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { + k("span", At, Z(l.rotulo), 1), + e.colunaOrdenacao === String(l.coluna_ordem) ? (f(), U(ke(e.direcaoOrdenacao === "asc" ? e.ArrowUp : e.ArrowDown), { key: 0, class: "eli-tabela__th-icone", size: 16, "stroke-width": 2, "aria-hidden": "true" - })) : (p(), P(n, { + })) : (f(), U(t, { key: 1, class: "eli-tabela__th-icone eli-tabela__th-icone--oculto", size: 16, "stroke-width": 2, "aria-hidden": "true" })) - ], 10, ft)) : (p(), k("span", vt, Y(s.rotulo), 1)) + ], 10, kt)) : (f(), _("span", Dt, Z(l.rotulo), 1)) ], 2))), 128)), - e.temAcoes ? (p(), k("th", ht, " Ações ")) : J("", !0) + e.temAcoes ? (f(), _("th", Et, " Ações ")) : x("", !0) ]) ]); } -const yt = /* @__PURE__ */ j(ct, [["render", gt]]), $t = N({ +const wt = /* @__PURE__ */ H(Ct, [["render", Mt]]), Vt = z({ name: "EliTabelaCelulaTextoSimples", components: {}, props: { @@ -1558,11 +1579,11 @@ const yt = /* @__PURE__ */ j(ct, [["render", gt]]), $t = N({ return { dados: e }; } }); -function kt(e, a, u, i, c, m) { - var n; - return Y((n = e.dados) == null ? void 0 : n.texto); +function Bt(e, a, r, n, s, d) { + var t; + return Z((t = e.dados) == null ? void 0 : t.texto); } -const At = /* @__PURE__ */ j($t, [["render", kt]]), Ct = N({ +const Tt = /* @__PURE__ */ H(Vt, [["render", Bt]]), Pt = z({ name: "EliTabelaCelulaNumero", components: {}, props: { @@ -1578,14 +1599,14 @@ const At = /* @__PURE__ */ j($t, [["render", kt]]), Ct = N({ return { dados: e }; } }); -function Vt(e, a, u, i, c, m) { - var n; - return Y(String((n = e.dados) == null ? void 0 : n.numero).replace(".", ",")); +function Ot(e, a, r, n, s, d) { + var t; + return Z(String((t = e.dados) == null ? void 0 : t.numero).replace(".", ",")); } -const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), _t = { - textoSimples: At, - numero: Et -}, Mt = N({ +const It = /* @__PURE__ */ H(Pt, [["render", Ot]]), qt = { + textoSimples: Tt, + numero: It +}, Nt = z({ name: "EliTabelaCelula", props: { celula: { @@ -1595,18 +1616,18 @@ const Et = /* @__PURE__ */ j(Ct, [["render", Vt]]), _t = { } }, setup(e) { - const a = A(() => e.celula[0]), u = A(() => e.celula[1]), i = A(() => _t[a.value]), c = A(() => u.value); - return { Componente: i, dadosParaComponente: c }; + 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 }; } }); -function wt(e, a, u, i, c, m) { - return p(), P(ye(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); +function Lt(e, a, r, n, s, d) { + return f(), U(ke(e.Componente), { dados: e.dadosParaComponente }, null, 8, ["dados"]); } -const St = /* @__PURE__ */ j(Mt, [["render", wt]]), Bt = N({ +const Ft = /* @__PURE__ */ H(Nt, [["render", Lt]]), Ut = z({ name: "EliTabelaBody", components: { - EliTabelaCelula: St, - MoreVertical: za + EliTabelaCelula: Ft, + MoreVertical: Ga }, props: { colunas: { @@ -1635,91 +1656,91 @@ const St = /* @__PURE__ */ j(Mt, [["render", wt]]), Bt = N({ } }, setup() { - function e(i) { - return i === "direita" ? "eli-tabela__celula--direita" : i === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; + function e(n) { + return n === "direita" ? "eli-tabela__celula--direita" : n === "centro" ? "eli-tabela__celula--centro" : "eli-tabela__celula--esquerda"; } - function a(i) { - if (i != null) - return typeof i == "number" ? `${i}px` : String(i); + function a(n) { + if (n != null) + return typeof n == "number" ? `${n}px` : String(n); } - function u(i) { - if (!Array.isArray(i)) return; - const c = i[0], m = i[1]; - if (c === "textoSimples") - return typeof (m == null ? void 0 : m.texto) == "string" ? m.texto : void 0; - if (c === "numero") - return typeof (m == null ? void 0 : m.numero) == "number" ? String(m.numero) : void 0; + 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: u + obterTooltipCelula: r }; } -}), Dt = { class: "eli-tabela__tbody" }, Pt = ["onClick"], Tt = ["title"], Ot = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label", "title", "onClick"]; -function qt(e, a, u, i, c, m) { - const n = H("EliTabelaCelula"), s = H("MoreVertical"); - return p(), k("tbody", Dt, [ - (p(!0), k(K, null, ee(e.linhas, ($, r) => (p(), k("tr", { - key: `tr-${r}`, - class: se(["eli-tabela__tr", [r % 2 === 1 ? "eli-tabela__tr--zebra" : void 0]]) +}), 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]]) }, [ - (p(!0), k(K, null, ee(e.colunas, (h, g) => (p(), k("td", { - key: `td-${r}-${g}`, - class: se(["eli-tabela__td", [ - h.acao ? "eli-tabela__td--clicavel" : void 0, - e.obterClasseAlinhamento(h.alinhamento) + (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: (T) => h.acao ? () => { - var y; - return (y = h.acao) == null ? void 0 : y.call(h); + onClick: (L) => g.acao ? () => { + var A; + return (A = g.acao) == null ? void 0 : A.call(g); } : void 0 }, [ - h.truncar ? (p(), k("span", { + g.truncar ? (f(), _("span", { key: 0, class: "eli-tabela__celula-conteudo", - style: ge(h.largura_maxima ? { maxWidth: e.obterMaxWidth(h.largura_maxima) } : void 0), - title: e.obterTooltipCelula(h.celula($)) + style: Se(g.largura_maxima ? { maxWidth: e.obterMaxWidth(g.largura_maxima) } : void 0), + title: e.obterTooltipCelula(g.celula(v)) }, [ - V(n, { - celula: h.celula($) + O(t, { + celula: g.celula(v) }, null, 8, ["celula"]) - ], 12, Tt)) : (p(), P(n, { + ], 12, Ht)) : (f(), U(t, { key: 1, - celula: h.celula($) + celula: g.celula(v) }, null, 8, ["celula"])) - ], 10, Pt))), 128)), - e.temAcoes ? (p(), k("td", { + ], 10, zt))), 128)), + e.temAcoes ? (f(), _("td", { class: "eli-tabela__td eli-tabela__td--acoes", - key: `td-${r}-acoes` + key: `td-${o}-acoes` }, [ - B("div", { - class: se(["eli-tabela__acoes-container", [e.menuAberto === r ? "eli-tabela__acoes-container--aberto" : void 0]]) + k("div", { + class: me(["eli-tabela__acoes-container", [e.menuAberto === o ? "eli-tabela__acoes-container--aberto" : void 0]]) }, [ - B("button", { + k("button", { class: "eli-tabela__acoes-toggle", type: "button", - id: `eli-tabela-acoes-toggle-${r}`, - disabled: !e.possuiAcoes(r), + id: `eli-tabela-acoes-toggle-${o}`, + disabled: !e.possuiAcoes(o), "aria-haspopup": "menu", - "aria-expanded": e.menuAberto === r ? "true" : "false", - "aria-controls": e.possuiAcoes(r) ? `eli-tabela-acoes-menu-${r}` : void 0, - "aria-label": e.possuiAcoes(r) ? "Ações da linha" : "Nenhuma ação disponível", - title: e.possuiAcoes(r) ? "Ações" : "Nenhuma ação disponível", - onClick: De((h) => e.toggleMenu(r, h), ["stop"]) + "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"]) }, [ - V(s, { + O(l, { class: "eli-tabela__acoes-toggle-icone", size: 18, "stroke-width": 2 }) - ], 8, Ot) + ], 8, Yt) ], 2) - ])) : J("", !0) + ])) : x("", !0) ], 2))), 128)) ]); } -const It = /* @__PURE__ */ j(Bt, [["render", qt]]), Ut = N({ +const Jt = /* @__PURE__ */ H(Ut, [["render", Rt]]), Wt = z({ name: "EliTabelaMenuAcoes", props: { menuAberto: { @@ -1745,58 +1766,58 @@ const It = /* @__PURE__ */ j(Bt, [["render", qt]]), Ut = N({ return e !== null && typeof e == "object"; } }, - setup(e, { emit: a, expose: u }) { - const i = w(null); - u({ menuEl: i }); - const c = A(() => e.acoes.length > 0); - function m(n) { - e.linha && a("executar", { acao: n.acao, linha: e.linha }); + setup(e, { emit: a, expose: r }) { + const n = I(null); + r({ menuEl: n }); + const s = M(() => e.acoes.length > 0); + function d(t) { + e.linha && a("executar", { acao: t.acao, linha: e.linha }); } - return { menuEl: i, possuiAcoes: c, emitExecutar: m }; + return { menuEl: n, possuiAcoes: s, emitExecutar: d }; } -}), Nt = ["id", "aria-labelledby"], jt = ["aria-label", "title", "onClick"], zt = { class: "eli-tabela__acoes-item-texto" }; -function Lt(e, a, u, i, c, m) { - return p(), P(Re, { to: "body" }, [ - e.menuAberto !== null && e.possuiAcoes ? (p(), k("ul", { +}), 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", { 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: ge({ + style: Se({ position: "fixed", top: `${e.posicao.top}px`, left: `${e.posicao.left}px`, zIndex: 999999 }) }, [ - (p(!0), k(K, null, ee(e.acoes, (n) => (p(), k("li", { - key: `acao-${e.menuAberto}-${n.indice}`, + (f(!0), _(ee, null, ne(e.acoes, (t) => (f(), _("li", { + key: `acao-${e.menuAberto}-${t.indice}`, class: "eli-tabela__acoes-item", role: "none" }, [ - B("button", { + k("button", { type: "button", class: "eli-tabela__acoes-item-botao", - style: ge({ color: n.acao.cor }), + style: Se({ color: t.acao.cor }), role: "menuitem", - "aria-label": n.acao.rotulo, - title: n.acao.rotulo, - onClick: De((s) => e.emitExecutar(n), ["stop"]) + "aria-label": t.acao.rotulo, + title: t.acao.rotulo, + onClick: ue((l) => e.emitExecutar(t), ["stop"]) }, [ - (p(), P(ye(n.acao.icone), { + (f(), U(ke(t.acao.icone), { class: "eli-tabela__acoes-item-icone", size: 16, "stroke-width": 2 })), - B("span", zt, Y(n.acao.rotulo), 1) - ], 12, jt) + k("span", Xt, Z(t.acao.rotulo), 1) + ], 12, Gt) ]))), 128)) - ], 12, Nt)) : J("", !0) + ], 12, Zt)) : x("", !0) ]); } -const Ht = /* @__PURE__ */ j(Ut, [["render", Lt]]), Yt = N({ +const Qt = /* @__PURE__ */ H(Wt, [["render", Kt]]), xt = z({ name: "EliTabelaPaginacao", props: { pagina: { @@ -1818,99 +1839,325 @@ const Ht = /* @__PURE__ */ j(Ut, [["render", Lt]]), Yt = N({ } }, setup(e, { emit: a }) { - const u = A(() => { - const r = e.maximoBotoes; - return typeof r == "number" && r >= 5 ? Math.floor(r) : 7; - }), i = A(() => { - const r = e.totalPaginas, h = e.pagina, g = u.value, T = [], y = (L) => { - T.push({ - label: String(L), - pagina: L, - ativo: L === h + 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 }); - }, q = () => { - T.push({ label: "…", ehEllipsis: !0 }); + }, E = () => { + L.push({ label: "…", ehEllipsis: !0 }); }; - if (r <= g) { - for (let L = 1; L <= r; L += 1) - y(L); - return T; + if (o <= y) { + for (let w = 1; w <= o; w += 1) + A(w); + return L; } - const _ = Math.max(3, g - 2); - let Q = Math.max(2, h - Math.floor(_ / 2)), x = Q + _ - 1; - x >= r && (x = r - 1, Q = x - _ + 1), y(1), Q > 2 && q(); - for (let L = Q; L <= x; L += 1) - y(L); - return x < r - 1 && q(), y(r), T; + 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; }); - function c(r) { - if (!r) + function s(o) { + if (!o) return; - const h = Math.min(Math.max(1, r), e.totalPaginas); - h !== e.pagina && a("alterar", h); + const g = Math.min(Math.max(1, o), e.totalPaginas); + g !== e.pagina && a("alterar", g); } - const m = A(() => e.pagina <= 1), n = A(() => e.pagina >= e.totalPaginas), s = A(() => e.pagina), $ = A(() => e.totalPaginas); + const d = M(() => e.pagina <= 1), t = M(() => e.pagina >= e.totalPaginas), l = M(() => e.pagina), v = M(() => e.totalPaginas); return { - botoes: i, - irParaPagina: c, - anteriorDesabilitado: m, - proximaDesabilitada: n, - paginaAtual: s, - totalPaginasExibidas: $ + botoes: n, + irParaPagina: s, + anteriorDesabilitado: d, + proximaDesabilitada: t, + paginaAtual: l, + totalPaginasExibidas: v }; } -}), Ft = { +}), eo = { key: 0, class: "eli-tabela__paginacao", role: "navigation", "aria-label": "Paginação de resultados" -}, Rt = ["disabled"], Wt = { +}, ao = ["disabled"], to = { key: 0, class: "eli-tabela__pagina-ellipsis", "aria-hidden": "true" -}, Jt = ["disabled", "aria-current", "aria-label", "onClick"], Zt = ["disabled"]; -function Xt(e, a, u, i, c, m) { - return e.totalPaginasExibidas > 1 ? (p(), k("nav", Ft, [ - B("button", { +}, 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", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.anteriorDesabilitado, "aria-label": "Página anterior", - onClick: a[0] || (a[0] = (n) => e.irParaPagina(e.paginaAtual - 1)) - }, " << ", 8, Rt), - (p(!0), k(K, null, ee(e.botoes, (n, s) => (p(), k(K, { - key: `${n.label}-${s}` + 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}` }, [ - n.ehEllipsis ? (p(), k("span", Wt, Y(n.label), 1)) : (p(), k("button", { + t.ehEllipsis ? (f(), _("span", to, Z(t.label), 1)) : (f(), _("button", { key: 1, type: "button", - class: se(["eli-tabela__pagina-botao", n.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), - disabled: n.ativo, - "aria-current": n.ativo ? "page" : void 0, - "aria-label": `Ir para página ${n.label}`, - onClick: ($) => e.irParaPagina(n.pagina) - }, Y(n.label), 11, Jt)) + class: me(["eli-tabela__pagina-botao", t.ativo ? "eli-tabela__pagina-botao--ativo" : void 0]), + disabled: t.ativo, + "aria-current": t.ativo ? "page" : void 0, + "aria-label": `Ir para página ${t.label}`, + onClick: (v) => e.irParaPagina(t.pagina) + }, Z(t.label), 11, oo)) ], 64))), 128)), - B("button", { + k("button", { type: "button", class: "eli-tabela__pagina-botao", disabled: e.proximaDesabilitada, "aria-label": "Próxima página", - onClick: a[1] || (a[1] = (n) => e.irParaPagina(e.paginaAtual + 1)) - }, " >> ", 8, Zt) - ])) : J("", !0); + onClick: a[1] || (a[1] = (t) => e.irParaPagina(e.paginaAtual + 1)) + }, " >> ", 8, no) + ])) : x("", !0); } -const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455"]]), Kt = N({ +const ro = /* @__PURE__ */ H(xt, [["render", lo], ["__scopeId", "data-v-59d12455"]]), Ie = "application/x-eli-tabela-coluna", io = z({ + 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 r = I([]), n = I([]); + 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)); + } + se( + () => [e.aberto, e.rotulosColunas, e.configInicial], + () => { + e.aberto && s(); + }, + { deep: !0, immediate: !0 } + ); + function d() { + a("fechar"); + } + function t() { + a("salvar", { + visiveis: [...r.value], + invisiveis: [...n.value] + }); + } + function l(E, p) { + var q, D; + 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"; + } catch { + } + } + function v(E) { + var p; + 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; + } 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 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 y(E, p, q, D) { + l(E, { rotulo: p, origem: q, index: D }); + } + 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); + } else { + const w = r.value.indexOf(D.rotulo); + w >= 0 && r.value.splice(w, 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); + } else { + const w = r.value.indexOf(D.rotulo); + w >= 0 && r.value.splice(w, 1); + } + } + return { + visiveisLocal: r, + invisiveisLocal: n, + emitFechar: d, + emitSalvar: t, + onDragStart: y, + onDropItem: L, + onDropLista: A + }; + } +}), so = { + 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", { + key: 0, + class: "eli-tabela-modal-colunas__overlay", + role: "presentation", + onClick: a[9] || (a[9] = ue((...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", { + 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", { + class: "eli-tabela-modal-colunas__lista", + onDragover: a[2] || (a[2] = ue(() => { + }, ["prevent"])), + onDrop: a[3] || (a[3] = (t) => e.onDropLista(t, "invisiveis", 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", { + 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(() => { + }, ["prevent"])), + onDrop: (v) => e.onDropItem(v, "visiveis", l) + }, [ + a[13] || (a[13] = k("span", { + class: "eli-tabela-modal-colunas__item-handle", + "aria-hidden": "true" + }, "⋮⋮", -1)), + k("span", go, Z(t), 1) + ], 40, vo))), 128)) + ], 32) + ]) + ]), + k("footer", ho, [ + k("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", { + 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); +} +const $o = /* @__PURE__ */ H(io, [["render", yo], ["__scopeId", "data-v-c7d1b6d2"]]), Co = "eli:tabela"; +function Je(e) { + return `${Co}:${e}:colunas`; +} +function We(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 }; +} +function qe(e) { + try { + const a = window.localStorage.getItem(Je(e)); + return a ? We(JSON.parse(a)) : { visiveis: [], invisiveis: [] }; + } catch { + return { visiveis: [], invisiveis: [] }; + } +} +function _o(e, a) { + try { + window.localStorage.setItem(Je(e), JSON.stringify(We(a))); + } catch { + } +} +const So = z({ name: "EliTabela", inheritAttrs: !1, components: { - EliTabelaCabecalho: xa, - EliTabelaEstados: lt, - EliTabelaDebug: dt, - EliTabelaHead: yt, - EliTabelaBody: It, - EliTabelaMenuAcoes: Ht, - EliTabelaPaginacao: Gt + EliTabelaCabecalho: ut, + EliTabelaEstados: vt, + EliTabelaDebug: $t, + EliTabelaHead: wt, + EliTabelaBody: Jt, + EliTabelaMenuAcoes: Qt, + EliTabelaPaginacao: ro, + EliTabelaModalColunas: $o }, props: { /** Configuração principal da tabela (colunas, consulta e ações) */ @@ -1920,113 +2167,135 @@ const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455 } }, setup(e) { - const u = w(!1), i = w(null), c = w([]), m = w(0), n = w([]), s = w(null), $ = w(null), r = w({ top: 0, left: 0 }), h = w(""), g = w(1), T = w(null), y = w("asc"), q = A(() => e.tabela), _ = A(() => !!e.tabela.mostrarCaixaDeBusca), Q = A(() => e.tabela.acoesTabela ?? []), x = A(() => Q.value.length > 0), L = A(() => { - const t = e.tabela.registros_por_consulta; - return typeof t == "number" && t > 0 ? Math.floor(t) : 10; - }), re = A(() => { - const t = L.value; - if (!t || t <= 0) return 1; - const o = m.value; - return o ? Math.max(1, Math.ceil(o / t)) : 1; - }), ke = A(() => (e.tabela.acoesLinha ?? []).length > 0); - let Z = 0; - function X(t) { - var M, S, D, U, F, W; - const o = t.getBoundingClientRect(), d = 8, l = ((D = (S = (M = $.value) == null ? void 0 : M.menuEl) == null ? void 0 : S.value) == null ? void 0 : D.offsetHeight) ?? 0, v = ((W = (F = (U = $.value) == null ? void 0 : U.menuEl) == null ? void 0 : F.value) == null ? void 0 : W.offsetWidth) ?? 180; - let b = o.bottom + d; - const C = o.right - v; - l && b + l > window.innerHeight - d && (b = o.top - d - l), r.value = { - top: Math.max(d, Math.round(b)), - left: Math.max(d, Math.round(C)) + 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); + }); + function le() { + w.value = !0; + } + function he() { + w.value = !1; + } + function fe(m) { + X.value = m, _o(e.tabela.nome, m), w.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 ue(t) { - var d, l; - if (s.value === null) return; - const o = t.target; - (l = (d = $.value) == null ? void 0 : d.menuEl) != null && l.value && $.value.menuEl.value.contains(o) || (s.value = null); + 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); } - function de(t) { - if (t) { - if (T.value === t) { - y.value = y.value === "asc" ? "desc" : "asc", f(); + function c(m) { + if (m) { + if (L.value === m) { + A.value = A.value === "asc" ? "desc" : "asc", B(); return; } - T.value = t, y.value = "asc", g.value !== 1 ? g.value = 1 : f(); + L.value = m, A.value = "asc", y.value !== 1 ? y.value = 1 : B(); } } - function ne(t) { - h.value !== t && (h.value = t, g.value !== 1 ? g.value = 1 : f()); + function i(m) { + g.value !== m && (g.value = m, y.value !== 1 ? y.value = 1 : B()); } - function O(t) { - const o = Math.min(Math.max(1, t), re.value); - o !== g.value && (g.value = o); + function b(m) { + const C = Math.min(Math.max(1, m), F.value); + C !== y.value && (y.value = C); } - function E(t) { - const o = e.tabela.acoesLinha ?? [], d = n.value[t] ?? []; - return o.map((l, v) => { - const b = l.exibir === void 0 ? !0 : typeof l.exibir == "boolean" ? l.exibir : !1; + 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; return { - acao: l, - indice: v, - visivel: d[v] ?? b + acao: P, + indice: G, + visivel: T[G] ?? Y }; - }).filter((l) => l.visivel); + }).filter((P) => P.visivel); } - function ae(t) { - return E(t).length > 0; + function $(m) { + return u(m).length > 0; } - function fe(t, o) { - if (!ae(t)) return; - if (s.value === t) { - s.value = null; + function S(m, C) { + if (!$(m)) return; + if (l.value === m) { + l.value = null; return; } - s.value = t; - const d = (o == null ? void 0 : o.currentTarget) ?? null; - d && (X(d), requestAnimationFrame(() => X(d))); + l.value = m; + const T = (C == null ? void 0 : C.currentTarget) ?? null; + T && (pe(T), requestAnimationFrame(() => pe(T))); } - async function f() { - var v, b; - const t = ++Z; - u.value = !0, i.value = null, n.value = [], s.value = null; - const o = Math.max(1, L.value), l = { - offSet: (g.value - 1) * o, - limit: o + 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 }; - h.value && (l.texto_busca = h.value), T.value && (l.coluna_ordem = T.value, l.direcao_ordem = y.value); + g.value && (P.texto_busca = g.value), L.value && (P.coluna_ordem = L.value, P.direcao_ordem = A.value); try { - const C = e.tabela, M = await C.consulta(l); - if (t !== Z) return; - if (M.cod !== ze.sucesso) { - c.value = [], m.value = 0, i.value = M.mensagem; + 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; return; } - const S = ((v = M.valor) == null ? void 0 : v.valores) ?? [], D = ((b = M.valor) == null ? void 0 : b.quantidade) ?? S.length; - c.value = S, m.value = D; - const U = Math.max(1, Math.ceil((D || 0) / o)); - if (g.value > U) { - g.value = U; + 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; return; } - const F = C.acoesLinha ?? []; - if (!F.length) { - n.value = []; + const te = R.acoesLinha ?? []; + if (!te.length) { + t.value = []; return; } - const W = S.map( - () => F.map((R) => R.exibir === void 0 ? !0 : typeof R.exibir == "boolean" ? R.exibir : !1) + const ye = V.map( + () => te.map((be) => be.exibir === void 0 ? !0 : typeof be.exibir == "boolean" ? be.exibir : !1) ); - n.value = W; - const te = await Promise.all( - S.map( - async (R) => Promise.all( - F.map(async (I) => { - if (I.exibir === void 0) return !0; - if (typeof I.exibir == "boolean") return I.exibir; + 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; try { - const G = I.exibir(R); - return !!await Promise.resolve(G); + const Ge = $e.exibir(be); + return !!await Promise.resolve(Ge); } catch { return !1; } @@ -2034,100 +2303,115 @@ const Gt = /* @__PURE__ */ j(Yt, [["render", Xt], ["__scopeId", "data-v-59d12455 ) ) ); - t === Z && (n.value = te); - } catch (C) { - if (t !== Z) return; - c.value = [], m.value = 0, i.value = C instanceof Error ? C.message : "Erro ao carregar dados."; + 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."; } finally { - t === Z && (u.value = !1); + m === oe && (r.value = !1); } } - return We(() => { - document.addEventListener("click", ue), f(); - }), Je(() => { - document.removeEventListener("click", ue); - }), le( + return aa(() => { + document.addEventListener("click", h), B(); + }), ta(() => { + document.removeEventListener("click", h); + }), se( () => e.tabela.mostrarCaixaDeBusca, - (t) => { - !t && h.value && (h.value = "", g.value !== 1 ? g.value = 1 : f()); + (m) => { + !m && g.value && (g.value = "", y.value !== 1 ? y.value = 1 : B()); } - ), le(g, (t, o) => { - t !== o && f(); - }), le( + ), se(y, (m, C) => { + m !== C && B(); + }), se( () => e.tabela, () => { - s.value = null, T.value = null, y.value = "asc", h.value = "", g.value !== 1 ? g.value = 1 : f(); + 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(); } - ), le( + ), se( () => e.tabela.registros_por_consulta, () => { - g.value !== 1 ? g.value = 1 : f(); + y.value !== 1 ? y.value = 1 : B(); } - ), le(c, () => { - s.value = null; + ), se(s, () => { + l.value = null; }), { // state isDev: !1, - tabela: q, - carregando: u, - erro: i, - linhas: c, - quantidade: m, - menuAberto: s, - valorBusca: h, - paginaAtual: g, - colunaOrdenacao: T, - direcaoOrdenacao: y, - totalPaginas: re, + tabela: E, + carregando: r, + erro: n, + linhas: s, + quantidade: d, + menuAberto: l, + valorBusca: g, + paginaAtual: y, + colunaOrdenacao: L, + direcaoOrdenacao: A, + totalPaginas: F, // computed - exibirBusca: _, - acoesCabecalho: Q, - temAcoesCabecalho: x, - temAcoes: ke, + exibirBusca: p, + acoesCabecalho: q, + temAcoesCabecalho: D, + temAcoes: N, + colunasEfetivas: re, + rotulosColunas: K, + modalColunasAberto: w, + configColunas: X, + abrirModalColunas: le, + fecharModalColunas: he, + salvarModalColunas: fe, // actions - alternarOrdenacao: de, - atualizarBusca: ne, - irParaPagina: O, - acoesDisponiveisPorLinha: E, - possuiAcoes: ae, - toggleMenu: fe, + alternarOrdenacao: c, + atualizarBusca: i, + irParaPagina: b, + acoesDisponiveisPorLinha: u, + possuiAcoes: $, + toggleMenu: S, // popup - menuPopup: $, - menuPopupPos: r + menuPopup: v, + menuPopupPos: o }; } -}), Qt = { class: "eli-tabela" }, xt = { class: "eli-tabela__table" }; -function eo(e, a, u, i, c, m) { - const n = H("EliTabelaDebug"), s = H("EliTabelaEstados"), $ = H("EliTabelaCabecalho"), r = H("EliTabelaHead"), h = H("EliTabelaBody"), g = H("EliTabelaMenuAcoes"), T = H("EliTabelaPaginacao"); - return p(), k("div", Qt, [ - V(n, { +}), 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, { isDev: e.isDev, menuAberto: e.menuAberto, menuPopupPos: e.menuPopupPos }, null, 8, ["isDev", "menuAberto", "menuPopupPos"]), - e.carregando || e.erro || !e.linhas.length ? (p(), P(s, { + e.carregando || e.erro || !e.linhas.length ? (f(), U(l, { key: 0, carregando: e.carregando, erro: e.erro, mensagemVazio: e.tabela.mensagemVazio - }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (p(), k(K, { key: 1 }, [ - e.exibirBusca || e.temAcoesCabecalho ? (p(), P($, { + }, null, 8, ["carregando", "erro", "mensagemVazio"])) : (f(), _(ee, { key: 1 }, [ + e.exibirBusca || e.temAcoesCabecalho ? (f(), U(v, { key: 0, exibirBusca: e.exibirBusca, valorBusca: e.valorBusca, acoesCabecalho: e.acoesCabecalho, - onBuscar: e.atualizarBusca - }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar"])) : J("", !0), - B("table", xt, [ - V(r, { - colunas: e.tabela.colunas, + onBuscar: e.atualizarBusca, + onColunas: e.abrirModalColunas + }, null, 8, ["exibirBusca", "valorBusca", "acoesCabecalho", "onBuscar", "onColunas"])) : x("", !0), + O(o, { + aberto: e.modalColunasAberto, + rotulosColunas: e.rotulosColunas, + configInicial: e.configColunas, + onFechar: e.fecharModalColunas, + onSalvar: e.salvarModalColunas + }, null, 8, ["aberto", "rotulosColunas", "configInicial", "onFechar", "onSalvar"]), + k("table", Ao, [ + O(g, { + colunas: e.colunasEfetivas, temAcoes: e.temAcoes, colunaOrdenacao: e.colunaOrdenacao, direcaoOrdenacao: e.direcaoOrdenacao, onAlternarOrdenacao: e.alternarOrdenacao }, null, 8, ["colunas", "temAcoes", "colunaOrdenacao", "direcaoOrdenacao", "onAlternarOrdenacao"]), - V(h, { - colunas: e.tabela.colunas, + O(y, { + colunas: e.colunasEfetivas, linhas: e.linhas, temAcoes: e.temAcoes, menuAberto: e.menuAberto, @@ -2135,38 +2419,38 @@ function eo(e, a, u, i, c, m) { toggleMenu: e.toggleMenu }, null, 8, ["colunas", "linhas", "temAcoes", "menuAberto", "possuiAcoes", "toggleMenu"]) ]), - V(g, { + O(L, { 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: y, linha: q }) => { - e.menuAberto = null, y.acao(q); + onExecutar: a[0] || (a[0] = ({ acao: E, linha: p }) => { + e.menuAberto = null, E.acao(p); }) }, null, 8, ["menuAberto", "posicao", "acoes", "linha"]), - e.totalPaginas > 1 && e.quantidade > 0 ? (p(), P(T, { + e.totalPaginas > 1 && e.quantidade > 0 ? (f(), U(A, { key: 1, pagina: e.paginaAtual, totalPaginas: e.totalPaginas, maximoBotoes: e.tabela.maximo_botoes_paginacao, onAlterar: e.irParaPagina - }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : J("", !0) + }, null, 8, ["pagina", "totalPaginas", "maximoBotoes", "onAlterar"])) : x("", !0) ], 64)) ]); } -const ao = /* @__PURE__ */ j(Kt, [["render", eo]]), bo = { +const Eo = /* @__PURE__ */ H(So, [["render", Do]]), Uo = { install(e) { - e.component("EliOlaMundo", ka), e.component("EliBotao", Ue), e.component("EliBadge", Ce), e.component("EliInput", je), e.component("EliCartao", _a), e.component("EliDataHora", Oa), e.component("EliTabela", ao); + 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); } }; export { - Ce as EliBadge, - Ue as EliBotao, - _a as EliCartao, - Oa as EliDataHora, - je as EliInput, - ka as EliOlaMundo, - ao as EliTabela, - bo as default + Ee as EliBadge, + ze as EliBotao, + Ia as EliCartao, + Ha as EliDataHora, + Ye as EliInput, + Va as EliOlaMundo, + Eo as EliTabela, + Uo as default }; diff --git a/dist/eli-vue.umd.js b/dist/eli-vue.umd.js index a4280f1..fadc49a 100644 --- a/dist/eli-vue.umd.js +++ b/dist/eli-vue.umd.js @@ -1,66 +1,66 @@ -(function(w,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):(w=typeof globalThis<"u"?globalThis:w||self,t(w.eli_vue={},w.Vue,w.VBtn,w.VBadge,w.VCheckbox,w.VIcon,w.VRadio,w.VRadioGroup,w.VSelect,w.VTextField,w.VTextarea,w.VCard,w.VGrid))})(this,(function(w,t,Be,Ve,Ce,Ee,Se,we,Ae,se,Me,Y,_e){"use strict";const De=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}}}),T=(e,a)=>{const d=e.__vccOpts||e;for(const[s,m]of a)d[s]=m;return d};function Ne(e,a,d,s,m,p){return t.openBlock(),t.createBlock(Be.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 ne=T(De,[["render",Ne]]),ce={suave:"4px",pill:"10px"},Te=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in ce?ce[e.radius]:e.radius),d=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),s=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:d,badgeStyle:s}}});function Pe(e,a,d,s,m,p){return e.showBadge?(t.openBlock(),t.createBlock(Ve.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 Q=T(Te,[["render",Pe],["__scopeId","data-v-371c8db4"]]);function Oe(e){return e.replace(/\D+/g,"")}function qe(e){const a=Oe(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function Ie(e){return e.replace(/\D+/g,"")}function ze(e){const a=Ie(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 re(e){return e.replace(/\D+/g,"")}function de(e){const a=e.replace(/[^\d,]/g,""),d=a.split(",");return d.length>2?d[0]+","+d.slice(1).join(""):a}function Le(e){return de(e.replace(/%/g,""))}function Fe(e){const a=re(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function Ue(e){const a=re(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const je=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:d}){const s=t.ref(!1),m=t.ref(!1),p=t.computed({get:()=>e.modelValue,set:$=>{a("update:modelValue",$),a("change",$)}}),l=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),c=t.computed(()=>e.type==="password"?m.value?"text":"password":"text"),k=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),r=t.computed(()=>e.error?"error":s.value?e.color:void 0);function y($){const D=$.target;let C=D.value;switch(e.type){case"numericoInteiro":C=re(C);break;case"numericoDecimal":C=de(C);break;case"numericoMoeda":C=Fe(C);break;case"porcentagem":C=Le(C);break;case"telefone":C=ze(C);break;case"cpfCnpj":C=qe(C);break;case"cep":C=Ue(C);break}D.value=C,a("update:modelValue",C),a("change",C)}function g(){m.value=!m.value}const M=t.computed(()=>(e.options||[]).map($=>{if($&&typeof $=="object"&&"value"in $){const C=$.value;return{label:$.label??String(C),value:C,disabled:$.disabled}}const D=$;return{label:String(D),value:D}}));return{attrs:d,value:p,isTextLike:l,inputHtmlType:c,inputMode:k,internalColor:r,showPassword:m,togglePassword:g,onInput:y,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:M}}}),He={class:"eli-input"},Ye={key:4,class:"checkbox-group"};function Re(e,a,d,s,m,p){return t.openBlock(),t.createElementBlock("div",He,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(Ee.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(Me.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=l=>e.value=l),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Ae.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=l=>e.value=l),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(we.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=l=>e.value=l),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Se.VRadio,{key:String(l.value),label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Ce.VCheckbox,{key:String(l.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=c=>e.value=c),label:l.label,value:l.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const le=T(je,[["render",Re],["__scopeId","data-v-756cb549"]]),We=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:ne,EliBadge:Q,EliInput:le},setup(){const e=t.ref(""),a=t.ref([]),d=t.ref(""),s=t.ref(""),m=t.ref(""),p=t.ref(""),l=t.ref(""),c=t.ref(""),k=t.ref(""),r=t.ref(""),y=t.ref(""),g=t.ref(null),M=t.ref([]);return{nome:e,email:c,documento:y,estado:a,telefone:s,mensagem:k,senha:r,cor:g,habilidades:M,idade:m,altura:p,cep:d,valor:l}}}),ve={class:"grid-example"};function Ge(e,a,d,s,m,p){const l=t.resolveComponent("EliBadge"),c=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(_e.VContainer,null,{default:t.withCtx(()=>[t.createVNode(Y.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(l,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(Y.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",ve,[t.createVNode(c,{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(c,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=r=>e.idade=r),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=r=>e.altura=r),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=r=>e.valor=r),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=r=>e.telefone=r),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(c,{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(c,{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(c,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=r=>e.documento=r),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(c,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=r=>e.email=r),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(c,{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(c,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=r=>e.mensagem=r),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(c,{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(c,{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(c,{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(Y.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ue=T(We,[["render",Ge]]),Je=t.defineComponent({name:"EliCartao",components:{EliBadge:Q},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const d=t.computed(()=>e.status),s=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),m=t.computed(()=>`eli-cartao--${e.status}`);function p(){a("clicar",e.status)}return{rotuloStatus:d,corStatus:s,classeStatus:m,onClick:p}}}),Ze={class:"eli-cartao__titulo-texto"},Xe={class:"eli-cartao__status"};function Ke(e,a,d,s,m,p){const l=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(Y.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(Y.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Ze,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Xe,[t.createVNode(l,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(Y.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(Y.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 me=T(Je,[["render",Ke],["__scopeId","data-v-6c492bd9"]]);function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}},xe=x.exports,pe;function et(){return pe||(pe=1,(function(e,a){(function(d,s){e.exports=s()})(xe,(function(){var d=1e3,s=6e4,m=36e5,p="millisecond",l="second",c="minute",k="hour",r="day",y="week",g="month",M="quarter",$="year",D="date",C="Invalid Date",j=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var o=["th","st","nd","rd"],n=f%100;return"["+f+(o[(n-20)%10]||o[n]||o[0])+"]"}},v=function(f,o,n){var u=String(f);return!u||u.length>=o?f:""+Array(o+1-u.length).join(n)+f},ie={s:v,z:function(f){var o=-f.utcOffset(),n=Math.abs(o),u=Math.floor(n/60),i=n%60;return(o<=0?"+":"-")+v(u,2,"0")+":"+v(i,2,"0")},m:function f(o,n){if(o.date()1)return f(b[0])}else{var B=o.name;F[B]=o,i=B}return!u&&i&&(L=i),i||!u&&L},_=function(f,o){if(X(f))return f.clone();var n=typeof o=="object"?o:{};return n.date=f,n.args=arguments,new R(n)},V=ie;V.l=G,V.i=X,V.w=function(f,o){return _(f,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var R=(function(){function f(n){this.$L=G(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[Z]=!0}var o=f.prototype;return o.parse=function(n){this.$d=(function(u){var i=u.date,h=u.utc;if(i===null)return new Date(NaN);if(V.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var b=i.match(j);if(b){var B=b[2]-1||0,E=(b[7]||"0").substring(0,3);return h?new Date(Date.UTC(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)):new Date(b[1],B,b[3]||1,b[4]||0,b[5]||0,b[6]||0,E)}}return new Date(i)})(n),this.init()},o.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},o.$utils=function(){return V},o.isValid=function(){return this.$d.toString()!==C},o.isSame=function(n,u){var i=_(n);return this.startOf(u)<=i&&i<=this.endOf(u)},o.isAfter=function(n,u){return _(n)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:d}){const s=t.computed(()=>e.modo==="data"?"date":"datetime-local");function m(r){return e.modo==="data"?ee(r).format("YYYY-MM-DD"):ee(r).format("YYYY-MM-DDTHH:mm")}function p(r){return e.modo==="data"?ee(`${r}T00:00`).format():ee(r).format()}const l=t.computed({get:()=>e.modelValue?m(e.modelValue):"",set:r=>{const y=r&&r.length>0?r:null;if(!y){a("update:modelValue",null),a("alterar",null);return}const g=p(y);a("update:modelValue",g),a("alterar",g)}}),c=t.computed(()=>{if(e.min)return m(e.min)}),k=t.computed(()=>{if(e.max)return m(e.max)});return{attrs:d,valor:l,emit:a,minLocal:c,maxLocal:k,tipoInput:s}}}),ot={class:"eli-data-hora"};function nt(e,a,d,s,m,p){return t.openBlock(),t.createElementBlock("div",ot,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=l=>e.valor=l),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=l=>e.emit("foco")),onBlur:a[2]||(a[2]=l=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const fe=T(at,[["render",nt],["__scopeId","data-v-71afabb6"]]);var be=(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))(be||{});/** +(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||{});/** * @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 rt=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** + */const mt=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 he=e=>e==="";/** + */const $e=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 lt=(...e)=>e.filter((a,d,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===d).join(" ").trim();/** + */const pt=(...e)=>e.filter((a,i,r)=>!!a&&a.trim()!==""&&r.indexOf(a)===i).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 ye=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const ke=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 it=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,d,s)=>s?s.toUpperCase():d.toLowerCase());/** + */const ft=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,i,r)=>r?r.toUpperCase():i.toLowerCase());/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const st=e=>{const a=it(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** + */const bt=e=>{const a=ft(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 J={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 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"};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ct=({name:e,iconNode:a,absoluteStrokeWidth:d,"absolute-stroke-width":s,strokeWidth:m,"stroke-width":p,size:l=J.width,color:c=J.stroke,...k},{slots:r})=>t.h("svg",{...J,...k,width:l,height:l,stroke:c,"stroke-width":he(d)||he(s)||d===!0||s===!0?Number(m||p||J["stroke-width"])*24/Number(l):m||p||J["stroke-width"],class:lt("lucide",k.class,...e?[`lucide-${ye(st(e))}-icon`,`lucide-${ye(e)}`]:["lucide-icon"]),...!r.default&&!rt(k)&&{"aria-hidden":"true"}},[...a.map(y=>t.h(...y)),...r.default?[r.default()]:[]]);/** + */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()]:[]]);/** * @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,a)=>(d,{slots:s,attrs:m})=>t.h(ct,{...m,...d,iconNode:a,name:e},s);/** + */const ne=(e,a)=>(i,{slots:r,attrs:c})=>t.h(gt,{...c,...i,iconNode:a,name:e},r);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ge=te("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const Be=ne("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 $e=te("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Ve=ne("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 dt=te("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 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"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ut=te("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mt=t.defineComponent({name:"EliTabelaCaixaDeBusca",components:{Search:ut},props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.ref(e.modelo??"");t.watch(()=>e.modelo,m=>{m!==void 0&&m!==d.value&&(d.value=m)});function s(){a("buscar",d.value.trim())}return{texto:d,emitirBusca:s}}}),pt={class:"eli-tabela__busca"},ft={class:"eli-tabela__busca-input-wrapper"};function bt(e,a,d,s,m,p){const l=t.resolveComponent("Search");return t.openBlock(),t.createElementBlock("div",pt,[t.createElementVNode("div",ft,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=c=>e.texto=c),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...c)=>e.emitirBusca&&e.emitirBusca(...c),["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]=(...c)=>e.emitirBusca&&e.emitirBusca(...c))},[t.createVNode(l,{class:"eli-tabela__busca-botao-icone",size:16,"stroke-width":2,"aria-hidden":"true"})])])])}const ht=T(mt,[["render",bt],["__scopeId","data-v-f7b534c8"]]),yt=t.defineComponent({name:"EliTabelaCabecalho",components:{EliTabelaCaixaDeBusca:ht},props:{exibirBusca:{type:Boolean,required:!0},valorBusca:{type:String,required:!0},acoesCabecalho:{type:Array,required:!0}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const d=t.computed(()=>e.acoesCabecalho.length>0);function s(m){a("buscar",m)}return{temAcoesCabecalho:d,emitBuscar:s}}}),gt={class:"eli-tabela__cabecalho"},$t={key:1,class:"eli-tabela__acoes-cabecalho"},kt=["onClick"],Bt={class:"eli-tabela__acoes-cabecalho-rotulo"};function Vt(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaCaixaDeBusca");return t.openBlock(),t.createElementBlock("div",gt,[e.exibirBusca?(t.openBlock(),t.createBlock(l,{key:0,modelo:e.valorBusca,onBuscar:e.emitBuscar},null,8,["modelo","onBuscar"])):t.createCommentVNode("",!0),e.temAcoesCabecalho?(t.openBlock(),t.createElementBlock("div",$t,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.acoesCabecalho,(c,k)=>(t.openBlock(),t.createElementBlock("button",{key:`${c.rotulo}-${k}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:t.normalizeStyle(c.cor?{backgroundColor:c.cor,color:"#fff"}:void 0),onClick:c.acao},[c.icone?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(c.icone),{key:0,class:"eli-tabela__acoes-cabecalho-icone",size:16,"stroke-width":2})):t.createCommentVNode("",!0),t.createElementVNode("span",Bt,t.toDisplayString(c.rotulo),1)],12,kt))),128))])):t.createCommentVNode("",!0)])}const Ct=T(yt,[["render",Vt]]),Et=t.defineComponent({name:"EliTabelaEstados",props:{carregando:{type:Boolean,required:!0},erro:{type:String,required:!0},mensagemVazio:{type:String,required:!1,default:void 0}}}),St={key:0,class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},wt={key:1,class:"eli-tabela eli-tabela--erro",role:"alert"},At={class:"eli-tabela__erro-mensagem"},Mt={key:2,class:"eli-tabela eli-tabela--vazio"};function _t(e,a,d,s,m,p){return e.carregando?(t.openBlock(),t.createElementBlock("div",St," Carregando... ")):e.erro?(t.openBlock(),t.createElementBlock("div",wt,[a[0]||(a[0]=t.createElementVNode("div",{class:"eli-tabela__erro-titulo"},"Erro",-1)),t.createElementVNode("div",At,t.toDisplayString(e.erro),1)])):(t.openBlock(),t.createElementBlock("div",Mt,t.toDisplayString(e.mensagemVazio??"Nenhum registro encontrado."),1))}const Dt=T(Et,[["render",_t]]),Nt=t.defineComponent({name:"EliTabelaDebug",props:{isDev:{type:Boolean,required:!0},menuAberto:{type:Number,required:!0},menuPopupPos:{type:Object,required:!0}}}),Tt={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 Pt(e,a,d,s,m,p){return e.isDev?(t.openBlock(),t.createElementBlock("div",Tt,[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 Ot=T(Nt,[["render",Pt]]),qt=t.defineComponent({name:"EliTabelaHead",components:{ArrowUp:$e,ArrowDown:ge},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 d(p){return(p==null?void 0:p.coluna_ordem)!==void 0&&(p==null?void 0:p.coluna_ordem)!==null}function s(p){return p==="direita"?"eli-tabela__celula--direita":p==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function m(p){a("alternarOrdenacao",p)}return{ArrowUp:$e,ArrowDown:ge,isOrdenavel:d,obterClasseAlinhamento:s,emitAlternarOrdenacao:m}}}),It={class:"eli-tabela__thead"},zt={class:"eli-tabela__tr eli-tabela__tr--header"},Lt=["onClick"],Ft={class:"eli-tabela__th-texto"},Ut={key:1,class:"eli-tabela__th-label"},jt={key:0,class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"};function Ht(e,a,d,s,m,p){const l=t.resolveComponent("ArrowUp");return t.openBlock(),t.createElementBlock("thead",It,[t.createElementVNode("tr",zt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(c,k)=>(t.openBlock(),t.createElementBlock("th",{key:`th-${k}`,class:t.normalizeClass(["eli-tabela__th",[e.isOrdenavel(c)?"eli-tabela__th--ordenavel":void 0,e.obterClasseAlinhamento(c.alinhamento)]]),scope:"col"},[e.isOrdenavel(c)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(["eli-tabela__th-botao",[e.colunaOrdenacao===String(c.coluna_ordem)?"eli-tabela__th-botao--ativo":void 0]]),onClick:r=>e.emitAlternarOrdenacao(String(c.coluna_ordem))},[t.createElementVNode("span",Ft,t.toDisplayString(c.rotulo),1),e.colunaOrdenacao===String(c.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(l,{key:1,class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,"stroke-width":2,"aria-hidden":"true"}))],10,Lt)):(t.openBlock(),t.createElementBlock("span",Ut,t.toDisplayString(c.rotulo),1))],2))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("th",jt," Ações ")):t.createCommentVNode("",!0)])])}const Yt=T(qt,[["render",Ht]]),Rt=t.defineComponent({name:"EliTabelaCelulaTextoSimples",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Wt(e,a,d,s,m,p){var l;return t.toDisplayString((l=e.dados)==null?void 0:l.texto)}const vt=T(Rt,[["render",Wt]]),Gt=t.defineComponent({name:"EliTabelaCelulaNumero",components:{},props:{dados:{type:Object}},data(){return{}},methods:{},setup({dados:e}){return{dados:e}}});function Jt(e,a,d,s,m,p){var l;return t.toDisplayString(String((l=e.dados)==null?void 0:l.numero).replace(".",","))}const Zt={textoSimples:vt,numero:T(Gt,[["render",Jt]])},Xt=t.defineComponent({name:"EliTabelaCelula",props:{celula:{type:Array,required:!0}},setup(e){const a=t.computed(()=>e.celula[0]),d=t.computed(()=>e.celula[1]),s=t.computed(()=>Zt[a.value]),m=t.computed(()=>d.value);return{Componente:s,dadosParaComponente:m}}});function Kt(e,a,d,s,m,p){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.Componente),{dados:e.dadosParaComponente},null,8,["dados"])}const Qt=T(Xt,[["render",Kt]]),xt=t.defineComponent({name:"EliTabelaBody",components:{EliTabelaCelula:Qt,MoreVertical:dt},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(s){return s==="direita"?"eli-tabela__celula--direita":s==="centro"?"eli-tabela__celula--centro":"eli-tabela__celula--esquerda"}function a(s){if(s!=null)return typeof s=="number"?`${s}px`:String(s)}function d(s){if(!Array.isArray(s))return;const m=s[0],p=s[1];if(m==="textoSimples")return typeof(p==null?void 0:p.texto)=="string"?p.texto:void 0;if(m==="numero")return typeof(p==null?void 0:p.numero)=="number"?String(p.numero):void 0}return{obterClasseAlinhamento:e,obterMaxWidth:a,obterTooltipCelula:d}}}),ea={class:"eli-tabela__tbody"},ta=["onClick"],aa=["title"],oa=["id","disabled","aria-expanded","aria-controls","aria-label","title","onClick"];function na(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaCelula"),c=t.resolveComponent("MoreVertical");return t.openBlock(),t.createElementBlock("tbody",ea,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.linhas,(k,r)=>(t.openBlock(),t.createElementBlock("tr",{key:`tr-${r}`,class:t.normalizeClass(["eli-tabela__tr",[r%2===1?"eli-tabela__tr--zebra":void 0]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.colunas,(y,g)=>(t.openBlock(),t.createElementBlock("td",{key:`td-${r}-${g}`,class:t.normalizeClass(["eli-tabela__td",[y.acao?"eli-tabela__td--clicavel":void 0,e.obterClasseAlinhamento(y.alinhamento)]]),onClick:M=>y.acao?()=>{var $;return($=y.acao)==null?void 0:$.call(y)}:void 0},[y.truncar?(t.openBlock(),t.createElementBlock("span",{key:0,class:"eli-tabela__celula-conteudo",style:t.normalizeStyle(y.largura_maxima?{maxWidth:e.obterMaxWidth(y.largura_maxima)}:void 0),title:e.obterTooltipCelula(y.celula(k))},[t.createVNode(l,{celula:y.celula(k)},null,8,["celula"])],12,aa)):(t.openBlock(),t.createBlock(l,{key:1,celula:y.celula(k)},null,8,["celula"]))],10,ta))),128)),e.temAcoes?(t.openBlock(),t.createElementBlock("td",{class:"eli-tabela__td eli-tabela__td--acoes",key:`td-${r}-acoes`},[t.createElementVNode("div",{class:t.normalizeClass(["eli-tabela__acoes-container",[e.menuAberto===r?"eli-tabela__acoes-container--aberto":void 0]])},[t.createElementVNode("button",{class:"eli-tabela__acoes-toggle",type:"button",id:`eli-tabela-acoes-toggle-${r}`,disabled:!e.possuiAcoes(r),"aria-haspopup":"menu","aria-expanded":e.menuAberto===r?"true":"false","aria-controls":e.possuiAcoes(r)?`eli-tabela-acoes-menu-${r}`:void 0,"aria-label":e.possuiAcoes(r)?"Ações da linha":"Nenhuma ação disponível",title:e.possuiAcoes(r)?"Ações":"Nenhuma ação disponível",onClick:t.withModifiers(y=>e.toggleMenu(r,y),["stop"])},[t.createVNode(c,{class:"eli-tabela__acoes-toggle-icone",size:18,"stroke-width":2})],8,oa)],2)])):t.createCommentVNode("",!0)],2))),128))])}const ra=T(xt,[["render",na]]),la=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:d}){const s=t.ref(null);d({menuEl:s});const m=t.computed(()=>e.acoes.length>0);function p(l){e.linha&&a("executar",{acao:l.acao,linha:e.linha})}return{menuEl:s,possuiAcoes:m,emitExecutar:p}}}),ia=["id","aria-labelledby"],sa=["aria-label","title","onClick"],ca={class:"eli-tabela__acoes-item-texto"};function da(e,a,d,s,m,p){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,l=>(t.openBlock(),t.createElementBlock("li",{key:`acao-${e.menuAberto}-${l.indice}`,class:"eli-tabela__acoes-item",role:"none"},[t.createElementVNode("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:t.normalizeStyle({color:l.acao.cor}),role:"menuitem","aria-label":l.acao.rotulo,title:l.acao.rotulo,onClick:t.withModifiers(c=>e.emitExecutar(l),["stop"])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.acao.icone),{class:"eli-tabela__acoes-item-icone",size:16,"stroke-width":2})),t.createElementVNode("span",ca,t.toDisplayString(l.acao.rotulo),1)],12,sa)]))),128))],12,ia)):t.createCommentVNode("",!0)])}const ua=T(la,[["render",da]]),ma=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const d=t.computed(()=>{const r=e.maximoBotoes;return typeof r=="number"&&r>=5?Math.floor(r):7}),s=t.computed(()=>{const r=e.totalPaginas,y=e.pagina,g=d.value,M=[],$=O=>{M.push({label:String(O),pagina:O,ativo:O===y})},D=()=>{M.push({label:"…",ehEllipsis:!0})};if(r<=g){for(let O=1;O<=r;O+=1)$(O);return M}const C=Math.max(3,g-2);let j=Math.max(2,y-Math.floor(C/2)),H=j+C-1;H>=r&&(H=r-1,j=H-C+1),$(1),j>2&&D();for(let O=j;O<=H;O+=1)$(O);return He.pagina<=1),l=t.computed(()=>e.pagina>=e.totalPaginas),c=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:s,irParaPagina:m,anteriorDesabilitado:p,proximaDesabilitada:l,paginaAtual:c,totalPaginasExibidas:k}}}),pa={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},fa=["disabled"],ba={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},ha=["disabled","aria-current","aria-label","onClick"],ya=["disabled"];function ga(e,a,d,s,m,p){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",pa,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=l=>e.irParaPagina(e.paginaAtual-1))}," << ",8,fa),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(l,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${l.label}-${c}`},[l.ehEllipsis?(t.openBlock(),t.createElementBlock("span",ba,t.toDisplayString(l.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",l.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:l.ativo,"aria-current":l.ativo?"page":void 0,"aria-label":`Ir para página ${l.label}`,onClick:k=>e.irParaPagina(l.pagina)},t.toDisplayString(l.label),11,ha))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=l=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,ya)])):t.createCommentVNode("",!0)}const $a=T(ma,[["render",ga],["__scopeId","data-v-59d12455"]]),ka=t.defineComponent({name:"EliTabela",inheritAttrs:!1,components:{EliTabelaCabecalho:Ct,EliTabelaEstados:Dt,EliTabelaDebug:Ot,EliTabelaHead:Yt,EliTabelaBody:ra,EliTabelaMenuAcoes:ua,EliTabelaPaginacao:$a},props:{tabela:{type:Object,required:!0}},setup(e){const d=t.ref(!1),s=t.ref(null),m=t.ref([]),p=t.ref(0),l=t.ref([]),c=t.ref(null),k=t.ref(null),r=t.ref({top:0,left:0}),y=t.ref(""),g=t.ref(1),M=t.ref(null),$=t.ref("asc"),D=t.computed(()=>e.tabela),C=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),j=t.computed(()=>e.tabela.acoesTabela??[]),H=t.computed(()=>j.value.length>0),O=t.computed(()=>{const o=e.tabela.registros_por_consulta;return typeof o=="number"&&o>0?Math.floor(o):10}),v=t.computed(()=>{const o=O.value;if(!o||o<=0)return 1;const n=p.value;return n?Math.max(1,Math.ceil(n/o)):1}),ie=t.computed(()=>(e.tabela.acoesLinha??[]).length>0);let L=0;function F(o){var E,S,A,P,q,z;const n=o.getBoundingClientRect(),u=8,i=((A=(S=(E=k.value)==null?void 0:E.menuEl)==null?void 0:S.value)==null?void 0:A.offsetHeight)??0,h=((z=(q=(P=k.value)==null?void 0:P.menuEl)==null?void 0:q.value)==null?void 0:z.offsetWidth)??180;let b=n.bottom+u;const B=n.right-h;i&&b+i>window.innerHeight-u&&(b=n.top-u-i),r.value={top:Math.max(u,Math.round(b)),left:Math.max(u,Math.round(B))}}function Z(o){var u,i;if(c.value===null)return;const n=o.target;(i=(u=k.value)==null?void 0:u.menuEl)!=null&&i.value&&k.value.menuEl.value.contains(n)||(c.value=null)}function X(o){if(o){if(M.value===o){$.value=$.value==="asc"?"desc":"asc",f();return}M.value=o,$.value="asc",g.value!==1?g.value=1:f()}}function G(o){y.value!==o&&(y.value=o,g.value!==1?g.value=1:f())}function _(o){const n=Math.min(Math.max(1,o),v.value);n!==g.value&&(g.value=n)}function V(o){const n=e.tabela.acoesLinha??[],u=l.value[o]??[];return n.map((i,h)=>{const b=i.exibir===void 0?!0:typeof i.exibir=="boolean"?i.exibir:!1;return{acao:i,indice:h,visivel:u[h]??b}}).filter(i=>i.visivel)}function R(o){return V(o).length>0}function ae(o,n){if(!R(o))return;if(c.value===o){c.value=null;return}c.value=o;const u=(n==null?void 0:n.currentTarget)??null;u&&(F(u),requestAnimationFrame(()=>F(u)))}async function f(){var h,b;const o=++L;d.value=!0,s.value=null,l.value=[],c.value=null;const n=Math.max(1,O.value),i={offSet:(g.value-1)*n,limit:n};y.value&&(i.texto_busca=y.value),M.value&&(i.coluna_ordem=M.value,i.direcao_ordem=$.value);try{const B=e.tabela,E=await B.consulta(i);if(o!==L)return;if(E.cod!==be.sucesso){m.value=[],p.value=0,s.value=E.mensagem;return}const S=((h=E.valor)==null?void 0:h.valores)??[],A=((b=E.valor)==null?void 0:b.quantidade)??S.length;m.value=S,p.value=A;const P=Math.max(1,Math.ceil((A||0)/n));if(g.value>P){g.value=P;return}const q=B.acoesLinha??[];if(!q.length){l.value=[];return}const z=S.map(()=>q.map(I=>I.exibir===void 0?!0:typeof I.exibir=="boolean"?I.exibir:!1));l.value=z;const W=await Promise.all(S.map(async I=>Promise.all(q.map(async N=>{if(N.exibir===void 0)return!0;if(typeof N.exibir=="boolean")return N.exibir;try{const U=N.exibir(I);return!!await Promise.resolve(U)}catch{return!1}}))));o===L&&(l.value=W)}catch(B){if(o!==L)return;m.value=[],p.value=0,s.value=B instanceof Error?B.message:"Erro ao carregar dados."}finally{o===L&&(d.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Z),f()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Z)}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,o=>{!o&&y.value&&(y.value="",g.value!==1?g.value=1:f())}),t.watch(g,(o,n)=>{o!==n&&f()}),t.watch(()=>e.tabela,()=>{c.value=null,M.value=null,$.value="asc",y.value="",g.value!==1?g.value=1:f()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{g.value!==1?g.value=1:f()}),t.watch(m,()=>{c.value=null}),{isDev:!1,tabela:D,carregando:d,erro:s,linhas:m,quantidade:p,menuAberto:c,valorBusca:y,paginaAtual:g,colunaOrdenacao:M,direcaoOrdenacao:$,totalPaginas:v,exibirBusca:C,acoesCabecalho:j,temAcoesCabecalho:H,temAcoes:ie,alternarOrdenacao:X,atualizarBusca:G,irParaPagina:_,acoesDisponiveisPorLinha:V,possuiAcoes:R,toggleMenu:ae,menuPopup:k,menuPopupPos:r}}}),Ba={class:"eli-tabela"},Va={class:"eli-tabela__table"};function Ca(e,a,d,s,m,p){const l=t.resolveComponent("EliTabelaDebug"),c=t.resolveComponent("EliTabelaEstados"),k=t.resolveComponent("EliTabelaCabecalho"),r=t.resolveComponent("EliTabelaHead"),y=t.resolveComponent("EliTabelaBody"),g=t.resolveComponent("EliTabelaMenuAcoes"),M=t.resolveComponent("EliTabelaPaginacao");return t.openBlock(),t.createElementBlock("div",Ba,[t.createVNode(l,{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(c,{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(k,{key:0,exibirBusca:e.exibirBusca,valorBusca:e.valorBusca,acoesCabecalho:e.acoesCabecalho,onBuscar:e.atualizarBusca},null,8,["exibirBusca","valorBusca","acoesCabecalho","onBuscar"])):t.createCommentVNode("",!0),t.createElementVNode("table",Va,[t.createVNode(r,{colunas:e.tabela.colunas,temAcoes:e.temAcoes,colunaOrdenacao:e.colunaOrdenacao,direcaoOrdenacao:e.direcaoOrdenacao,onAlternarOrdenacao:e.alternarOrdenacao},null,8,["colunas","temAcoes","colunaOrdenacao","direcaoOrdenacao","onAlternarOrdenacao"]),t.createVNode(y,{colunas:e.tabela.colunas,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(g,{ref:"menuPopup",menuAberto:e.menuAberto,posicao:e.menuPopupPos,acoes:e.menuAberto===null?[]:e.acoesDisponiveisPorLinha(e.menuAberto),linha:e.menuAberto===null?null:e.linhas[e.menuAberto],onExecutar:a[0]||(a[0]=({acao:$,linha:D})=>{e.menuAberto=null,$.acao(D)})},null,8,["menuAberto","posicao","acoes","linha"]),e.totalPaginas>1&&e.quantidade>0?(t.openBlock(),t.createBlock(M,{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 ke=T(ka,[["render",Ca]]),Ea={install(e){e.component("EliOlaMundo",ue),e.component("EliBotao",ne),e.component("EliBadge",Q),e.component("EliInput",le),e.component("EliCartao",me),e.component("EliDataHora",fe),e.component("EliTabela",ke)}};w.EliBadge=Q,w.EliBotao=ne,w.EliCartao=me,w.EliDataHora=fe,w.EliInput=le,w.EliOlaMundo=ue,w.EliTabela=ke,w.default=Ea,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})); + */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"}})})); diff --git a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts index 10641c8..28aef6f 100644 --- a/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabela.vue.d.ts @@ -6,6 +6,7 @@ import { PropType } from "vue"; /** Tipos da configuração/contrato da tabela */ import type { EliTabelaConsulta } from "./types-eli-tabela"; +import { type EliTabelaColunasConfig } from "./colunasStorage"; declare const __VLS_export: import("vue").DefineComponent; temAcoesCabecalho: import("vue").ComputedRef; temAcoes: import("vue").ComputedRef; + colunasEfetivas: import("vue").ComputedRef; + rotulosColunas: import("vue").ComputedRef; + modalColunasAberto: import("vue").Ref; + configColunas: import("vue").Ref<{ + visiveis: string[]; + invisiveis: string[]; + }, EliTabelaColunasConfig | { + visiveis: string[]; + invisiveis: string[]; + }>; + abrirModalColunas: () => void; + fecharModalColunas: () => void; + salvarModalColunas: (cfg: EliTabelaColunasConfig) => void; alternarOrdenacao: (chave?: string) => void; atualizarBusca: (texto: string) => void; irParaPagina: (pagina: number) => void; @@ -79,6 +93,11 @@ declare const __VLS_export: import("vue").DefineComponent, { temAcoesCabecalho: import("vue").ComputedRef; emitBuscar: (texto: string) => void; + emitColunas: () => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { buscar(valor: string): boolean; + colunas(): true; }, string, import("vue").PublicProps, Readonly> & Readonly<{ onBuscar?: ((valor: string) => any) | undefined; - }>, {}, {}, { + onColunas?: (() => any) | undefined; + }>, { + exibirBotaoColunas: boolean; + }, {}, { EliTabelaCaixaDeBusca: import("vue").DefineComponent> & Readonly<{ onAlterar?: ((pagina: number) => any) | undefined; }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; + EliTabelaModalColunas: import("vue").DefineComponent; + required: true; + }; + configInicial: { + type: PropType; + required: true; + }; + }>, { + visiveisLocal: import("vue").Ref; + invisiveisLocal: import("vue").Ref; + emitFechar: () => void; + emitSalvar: () => void; + onDragStart: (e: DragEvent, rotulo: string, origem: "visiveis" | "invisiveis", index: number) => void; + onDropItem: (e: DragEvent, destino: "visiveis" | "invisiveis", index: number) => void; + onDropLista: (e: DragEvent, destino: "visiveis" | "invisiveis", _index: number | null) => void; + }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + fechar(): true; + salvar(_config: EliTabelaColunasConfig): true; + }, string, import("vue").PublicProps, Readonly; + required: true; + }; + configInicial: { + type: PropType; + required: true; + }; + }>> & Readonly<{ + onFechar?: (() => any) | undefined; + onSalvar?: ((_config: EliTabelaColunasConfig) => any) | undefined; + }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare const _default: typeof __VLS_export; export default _default; diff --git a/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts b/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts index 320cf4e..95a73ea 100644 --- a/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts +++ b/dist/types/components/eli/EliTabela/EliTabelaCabecalho.vue.d.ts @@ -4,6 +4,11 @@ declare const __VLS_export: import("vue").DefineComponent, { temAcoesCabecalho: import("vue").ComputedRef; emitBuscar: (texto: string) => void; + emitColunas: () => void; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { buscar(valor: string): boolean; + colunas(): true; }, string, import("vue").PublicProps, Readonly> & Readonly<{ onBuscar?: ((valor: string) => any) | undefined; -}>, {}, {}, { + onColunas?: (() => any) | undefined; +}>, { + exibirBotaoColunas: boolean; +}, {}, { EliTabelaCaixaDeBusca: import("vue").DefineComponent; + required: true; + }; + configInicial: { + type: PropType; + required: true; + }; +}>, { + visiveisLocal: import("vue").Ref; + invisiveisLocal: import("vue").Ref; + emitFechar: () => void; + emitSalvar: () => void; + onDragStart: (e: DragEvent, rotulo: string, origem: OrigemLista, index: number) => void; + onDropItem: (e: DragEvent, destino: OrigemLista, index: number) => void; + onDropLista: (e: DragEvent, destino: OrigemLista, _index: number | null) => void; +}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { + fechar(): true; + salvar(_config: EliTabelaColunasConfig): true; +}, string, import("vue").PublicProps, Readonly; + required: true; + }; + configInicial: { + type: PropType; + required: true; + }; +}>> & Readonly<{ + onFechar?: (() => any) | undefined; + onSalvar?: ((_config: EliTabelaColunasConfig) => any) | undefined; +}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; +declare const _default: typeof __VLS_export; +export default _default; diff --git a/dist/types/components/eli/EliTabela/colunasStorage.d.ts b/dist/types/components/eli/EliTabela/colunasStorage.d.ts new file mode 100644 index 0000000..b7df5cf --- /dev/null +++ b/dist/types/components/eli/EliTabela/colunasStorage.d.ts @@ -0,0 +1,10 @@ +export type EliTabelaColunasConfig = { + /** Rotulos das colunas visiveis (em ordem). */ + visiveis: string[]; + /** Rotulos das colunas invisiveis. */ + invisiveis: string[]; +}; +export declare function storageKeyColunas(nomeTabela: string): string; +export declare function carregarConfigColunas(nomeTabela: string): EliTabelaColunasConfig; +export declare function salvarConfigColunas(nomeTabela: string, config: EliTabelaColunasConfig): void; +export declare function limparConfigColunas(nomeTabela: string): void; diff --git a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts index 14f7774..1135aa6 100644 --- a/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts +++ b/dist/types/components/eli/EliTabela/types-eli-tabela.d.ts @@ -63,6 +63,8 @@ export type EliTabelaAcao = { * - `mostrarCaixaDeBusca`: habilita um campo de busca textual no cabeçalho */ export type EliTabelaConsulta = { + /** nome da tabela, um identificador unico */ + nome: string; /** Indica se a caixa de busca deve ser exibida acima da tabela. */ mostrarCaixaDeBusca?: boolean; /** Lista de colunas da tabela. */ diff --git a/package.json b/package.json index e17f3d7..2aa0c14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eli-vue", - "version": "0.1.45", + "version": "0.1.48", "private": false, "main": "./dist/eli-vue.umd.js", "module": "./dist/eli-vue.es.js", diff --git a/src/components/eli/EliTabela/EliTabela.vue b/src/components/eli/EliTabela/EliTabela.vue index 37aec47..7dd3f25 100644 --- a/src/components/eli/EliTabela/EliTabela.vue +++ b/src/components/eli/EliTabela/EliTabela.vue @@ -16,11 +16,20 @@ :valorBusca="valorBusca" :acoesCabecalho="acoesCabecalho" @buscar="atualizarBusca" + @colunas="abrirModalColunas" + /> + + props.tabela.acoesTabela ?? []); const temAcoesCabecalho = computed(() => acoesCabecalho.value.length > 0); + /** Colunas: visibilidade/ordem com persistência */ + const modalColunasAberto = ref(false); + const configColunas = ref( + carregarConfigColunas(props.tabela.nome) + ); + + const rotulosColunas = computed(() => props.tabela.colunas.map((c) => c.rotulo)); + + const colunasEfetivas = computed(() => { + const colunas = props.tabela.colunas; + const todosRotulos = rotulosColunas.value; + const invisiveisSet = new Set(configColunas.value.invisiveis ?? []); + + // default: todas visiveis; so some se estiver explicitamente em invisiveis + const visiveisBaseRotulos = todosRotulos.filter((r) => !invisiveisSet.has(r)); + const visiveisSet = new Set(visiveisBaseRotulos); + + // aplica ordem salva; novas (sem definicao) entram no fim, respeitando ordem original + const ordemSalva = configColunas.value.visiveis ?? []; + const ordemFinal: string[] = []; + + for (const r of ordemSalva) { + if (visiveisSet.has(r)) ordemFinal.push(r); + } + for (const r of visiveisBaseRotulos) { + if (!ordemFinal.includes(r)) ordemFinal.push(r); + } + + // mapeia rótulo -> coluna, preservando duplicatas (se existirem) pelo primeiro match. + // OBS: pressupoe rotulo unico; se repetir, comportamento fica indefinido. + const mapa = new Map(); + for (const c of colunas) { + if (!mapa.has(c.rotulo)) mapa.set(c.rotulo, c); + } + + return ordemFinal.map((r) => mapa.get(r)).filter(Boolean); + }); + + function abrirModalColunas() { + modalColunasAberto.value = true; + } + + function fecharModalColunas() { + modalColunasAberto.value = false; + } + + function salvarModalColunas(cfg: EliTabelaColunasConfig) { + configColunas.value = cfg; + salvarConfigColunas(props.tabela.nome, cfg); + modalColunasAberto.value = false; + } + /** Registros por consulta (normaliza para inteiro positivo) */ const registrosPorConsulta = computed(() => { const valor = props.tabela.registros_por_consulta; @@ -453,6 +521,8 @@ export default defineComponent({ colunaOrdenacao.value = null; direcaoOrdenacao.value = "asc"; valorBusca.value = ""; + modalColunasAberto.value = false; + configColunas.value = carregarConfigColunas(props.tabela.nome); if (paginaAtual.value !== 1) { paginaAtual.value = 1; } else { @@ -499,6 +569,14 @@ export default defineComponent({ acoesCabecalho, temAcoesCabecalho, temAcoes, + colunasEfetivas, + rotulosColunas, + modalColunasAberto, + configColunas, + + abrirModalColunas, + fecharModalColunas, + salvarModalColunas, // actions alternarOrdenacao, diff --git a/src/components/eli/EliTabela/EliTabelaCabecalho.vue b/src/components/eli/EliTabela/EliTabelaCabecalho.vue index 327b06c..c3a4865 100644 --- a/src/components/eli/EliTabela/EliTabelaCabecalho.vue +++ b/src/components/eli/EliTabela/EliTabelaCabecalho.vue @@ -1,7 +1,17 @@