This commit is contained in:
Luiz Silva 2026-01-27 12:07:22 -03:00
parent 8bb5aea15e
commit 24c07da6f8
17 changed files with 1458 additions and 371 deletions

View file

@ -0,0 +1,17 @@
import { PropType } from "vue";
import type { EliTabelaConsulta } from "./types";
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
tabela: {
type: PropType<EliTabelaConsulta<any>>;
required: true;
};
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
tabela: {
type: PropType<EliTabelaConsulta<any>>;
required: true;
};
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
declare const _default: typeof __VLS_export;
export default _default;

View file

@ -0,0 +1,6 @@
import type { VNodeChild } from "vue";
export type EliCelulaTextoSimples = {
tipo: "texto-simples";
texto: string;
};
export declare const renderEliCelulaTextoSimples: (celula: EliCelulaTextoSimples) => VNodeChild;

View file

@ -0,0 +1,3 @@
export { default as EliTabela } from "./EliTabela.vue";
export * from "./types";
export * from "./celulas/EliCelulaTextoSimples";

View file

@ -0,0 +1,24 @@
import type { tipoResposta } from "p-respostas";
import type { VNodeChild } from "vue";
export type ComponenteCelula = VNodeChild;
export type EliColuna<T> = {
rotulo: string;
celula: (linha: T) => ComponenteCelula;
acao?: () => void;
};
export type EliConsultaPaginada<T> = {
valores: T[];
quantidade: number;
};
/**
* Estrutura de dados para uma tabela alimentada por uma consulta.
*
* - `colunas`: definição de colunas e como renderizar cada célula
* - `resposta`: função assíncrona que retorna uma resposta padronizada
*/
export type EliTabelaConsulta<T> = {
colunas: EliColuna<T>[];
resposta: () => Promise<tipoResposta<EliConsultaPaginada<T>>>;
/** Mensagem exibida quando a consulta retorna ok porém sem dados. */
mensagemVazio?: string;
};

View file

@ -5,11 +5,13 @@ import { EliBadge } from "./componentes/indicador";
import { EliInput } from "./componentes/campo";
import { EliCartao } from "./componentes/cartao";
import { EliDataHora } from "./componentes/data_hora";
import { EliTabela } from "./components/eli/EliTabela";
export { EliOlaMundo };
export { EliBotao };
export { EliBadge };
export { EliInput };
export { EliCartao };
export { EliDataHora };
export { EliTabela };
declare const EliVue: Plugin;
export default EliVue;