refatoração

This commit is contained in:
Luiz Silva 2026-05-16 17:43:46 -03:00
parent d56219c2de
commit 74ccdf5c6e
43 changed files with 6568 additions and 6333 deletions

View file

@ -8,7 +8,7 @@
item-value="chave"
:loading="carregando"
:disabled="carregando"
:menu-props="{ maxHeight: 320 }"
:menu-props="{ maxHeight: 320, zIndex: 99999 }"
:clearable="Boolean(opcoes?.limpavel)"
:error="Boolean(opcoes?.erro)"
:error-messages="opcoes?.mensagensErro"

View file

@ -4,11 +4,11 @@ import EliEntradaParagrafo from "./EliEntradaParagrafo.vue"
import EliEntradaSelecao from "./EliEntradaSelecao.vue"
import EliEntradaTexto from "./EliEntradaTexto.vue"
export type { PadroesEntradas, TipoEntrada } from "./tiposEntradas"
export {
EliEntradaTexto,
EliEntradaNumero,
EliEntradaDataHora,
EliEntradaNumero,
EliEntradaParagrafo,
EliEntradaSelecao,
EliEntradaTexto,
}
export type { PadroesEntradas, TipoEntrada } from "./tiposEntradas"

View file

@ -73,7 +73,7 @@
</template>
<script lang="ts">
import { ChevronDown, ChevronRight, MoreVertical } from "lucide-vue-next"
import { ChevronDown, ChevronRight, MoreVertical } from "@lucide/vue"
import { defineComponent, type PropType } from "vue"
import EliTabelaCelula from "./celulas/EliTabelaCelula.vue"
import EliTabelaDetalhesLinha from "./EliTabelaDetalhesLinha.vue"

View file

@ -23,7 +23,7 @@
</template>
<script lang="ts">
import { Search } from "lucide-vue-next"
import { Search } from "@lucide/vue"
import { defineComponent, ref, watch } from "vue"
export default defineComponent({

View file

@ -22,8 +22,8 @@ export default defineComponent({
required: true,
},
menuAberto: {
type: Number as PropType<number | null>,
required: true,
type: [Number, Object] as PropType<number | null>,
default: null,
},
menuPopupPos: {
type: Object as PropType<{ top: number; left: number }>,

View file

@ -19,7 +19,7 @@ export default defineComponent({
components: { EliTabelaCelula },
props: {
linha: {
type: null as unknown as PropType<unknown>,
type: [Object, String, Number, Array] as PropType<unknown>,
required: true,
},
colunasInvisiveis: {

View file

@ -27,8 +27,8 @@ export default defineComponent({
required: true,
},
erro: {
type: String as PropType<string | null>,
required: true,
type: [String, Object] as PropType<string | null>,
default: null,
},
mensagemVazio: {
type: String as PropType<string | undefined>,

View file

@ -49,7 +49,7 @@
</template>
<script lang="ts">
import { ArrowDown, ArrowUp } from "lucide-vue-next"
import { ArrowDown, ArrowUp } from "@lucide/vue"
import { defineComponent, type PropType } from "vue"
import type { tipoEliColuna } from "./types-eli-tabela"
@ -71,8 +71,8 @@ export default defineComponent({
required: true,
},
colunaOrdenacao: {
type: String as PropType<string | null>,
required: true,
type: [String, Object] as PropType<string | null>,
default: null,
},
direcaoOrdenacao: {
type: String as PropType<"asc" | "desc">,

View file

@ -1,45 +1,47 @@
<template>
<Teleport to="body">
<ul
v-if="menuAberto !== null && possuiAcoes"
:id="`eli-tabela-acoes-menu-${menuAberto}`"
ref="menuEl"
class="eli-tabela__acoes-menu"
role="menu"
:aria-labelledby="`eli-tabela-acoes-toggle-${menuAberto}`"
:style="{
position: 'fixed',
top: `${posicao.top}px`,
left: `${posicao.left}px`,
zIndex: 999999,
}"
>
<li
v-for="item in acoes"
:key="`acao-${menuAberto}-${item.indice}`"
class="eli-tabela__acoes-item"
role="none"
<div class="eli-teleport-container">
<Teleport to="body">
<ul
v-if="menuAberto !== null && possuiAcoes"
:id="`eli-tabela-acoes-menu-${menuAberto}`"
ref="menuEl"
class="eli-tabela__acoes-menu"
role="menu"
:aria-labelledby="`eli-tabela-acoes-toggle-${menuAberto}`"
:style="{
position: 'fixed',
top: `${posicao.top}px`,
left: `${posicao.left}px`,
zIndex: 999999,
}"
>
<button
type="button"
class="eli-tabela__acoes-item-botao"
:style="{ color: item.acao.cor }"
role="menuitem"
:aria-label="item.acao.rotulo"
:title="item.acao.rotulo"
@click.stop="emitExecutar(item)"
<li
v-for="item in acoes"
:key="`acao-${menuAberto}-${item.indice}`"
class="eli-tabela__acoes-item"
role="none"
>
<component
:is="item.acao.icone"
class="eli-tabela__acoes-item-icone"
:size="16"
:stroke-width="2"
/>
<span class="eli-tabela__acoes-item-texto">{{ item.acao.rotulo }}</span>
</button>
</li>
</ul>
</Teleport>
<button
type="button"
class="eli-tabela__acoes-item-botao"
:style="{ color: item.acao.cor }"
role="menuitem"
:aria-label="item.acao.rotulo"
:title="item.acao.rotulo"
@click.stop="emitExecutar(item)"
>
<component
:is="item.acao.icone"
class="eli-tabela__acoes-item-icone"
:size="16"
:stroke-width="2"
/>
<span class="eli-tabela__acoes-item-texto">{{ item.acao.rotulo }}</span>
</button>
</li>
</ul>
</Teleport>
</div>
</template>
<script lang="ts">
@ -56,8 +58,8 @@ export default defineComponent({
name: "EliTabelaMenuAcoes",
props: {
menuAberto: {
type: Number as PropType<number | null>,
required: true,
type: [Number, Object] as PropType<number | null>,
default: null,
},
posicao: {
type: Object as PropType<{ top: number; left: number }>,
@ -70,7 +72,7 @@ export default defineComponent({
},
linha: {
// Aceita qualquer tipo de linha (objeto, string, etc.) sem validação runtime.
type: null as unknown as PropType<unknown | null>,
type: [Object, String, Number, Array] as PropType<unknown | null>,
required: true,
},
},

View file

@ -2,7 +2,7 @@
* Tipagem dos dados de entrada dos componentes de celulas
*/
import type { LucideIcon } from "lucide-vue-next"
import type { LucideIcon } from "@lucide/vue"
export type tiposTabelaCelulas = {
textoSimples: {

View file

@ -1,4 +1,4 @@
import type { LucideIcon } from "lucide-vue-next"
import type { LucideIcon } from "@lucide/vue"
import type { tipoFiltro26 } from "p-comuns"
export type tipoFiltro<T> = tipoFiltro26<T>
@ -26,7 +26,7 @@ export const celulaTabela = <T extends tipoTabelaCelula>(
return [tipo, dados] as const
}
export type { tipoTabelaCelula, tiposTabelaCelulas }
export type { tiposTabelaCelulas, tipoTabelaCelula }
export type tipoEliColuna<T> = {
/** Texto exibido no cabeçalho da coluna. */

View file

@ -13,17 +13,13 @@ import { EliTabela } from "./componentes/EliTabela"
import { EliBadge } from "./componentes/indicador"
import { EliOlaMundo } from "./componentes/ola_mundo"
export { EliOlaMundo }
export { EliBotao }
export { EliBadge }
export { EliCartao }
export { criarFiltro26 } from "p-comuns"
export * from "./componentes/EliEntrada"
// Exportar tudo (componentes + types + helpers) de Tabela e Entrada
export * from "./componentes/EliTabela"
// Exportar tipos compartilhados (ex: CartaoStatus)
export * from "./tipos"
export { EliBadge, EliBotao, EliCartao, EliOlaMundo }
const EliVue: Plugin = {
install(app: App) {

View file

@ -62,7 +62,7 @@
</template>
<script lang="ts">
import { BadgeCheck, Eye, Pencil, Plus, Trash2 } from "lucide-vue-next"
import { BadgeCheck, Eye, Pencil, Plus, Trash2 } from "@lucide/vue"
import { criarFiltro26, type tipoFiltro26 } from "p-comuns"
import { codigosResposta } from "p-respostas"
import { defineComponent, ref } from "vue"