refatoração
This commit is contained in:
parent
d56219c2de
commit
74ccdf5c6e
43 changed files with 6568 additions and 6333 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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 }>,
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -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">,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue