Refatorado estrutura de visões de gráficos
This commit is contained in:
parent
33a89ac1f3
commit
fea1b3d96c
52 changed files with 1489 additions and 1777 deletions
31
src/pilao-de-dados/visoes/tipagem.ts
Normal file
31
src/pilao-de-dados/visoes/tipagem.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { z } from "zod"
|
||||
import type { visoes_pilao } from "./listaDeVisoes"
|
||||
|
||||
export const z_tipos_campos_reg_grafico = z.enum([
|
||||
"tabela",
|
||||
"coluna",
|
||||
"texto",
|
||||
"lista_colunas",
|
||||
"lista_filtros",
|
||||
"ordem",
|
||||
])
|
||||
|
||||
export type tipo_estrutura_visao_grafico<T extends keyof typeof visoes_pilao> =
|
||||
{
|
||||
/** Nome da Visão */
|
||||
visao: T
|
||||
/** Rotulo */
|
||||
rotulo: string
|
||||
/** Retorna a tabela Referente ao Registro */
|
||||
tabela: (_: z.infer<(typeof visoes_pilao)[T]>) => string
|
||||
/** Descrição */
|
||||
descricao: (_: z.infer<(typeof visoes_pilao)[T]>) => string
|
||||
/** Lista os campos e suas configurações */
|
||||
campos: {
|
||||
[c in keyof Required<z.infer<(typeof visoes_pilao)[T]>>]: {
|
||||
rotulo: string
|
||||
tipo_campo: z.infer<typeof z_tipos_campos_reg_grafico>
|
||||
order: number
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue