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
8
dist-import/pilao-de-dados/Pilao/index.d.ts
vendored
8
dist-import/pilao-de-dados/Pilao/index.d.ts
vendored
|
|
@ -3,7 +3,7 @@ import { type tipoResposta } from "p-respostas";
|
|||
import type { z } from "zod";
|
||||
import type { zp_enviar_registros } from "../_enviar_registros";
|
||||
import { type zp_deletar_registros } from "../variaveis";
|
||||
import type { visoes } from "../visoes";
|
||||
import type { visoes_pilao } from "../visoes/listaDeVisoes";
|
||||
import type { tipo_pilao_api } from "./pilao-api.ts";
|
||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem";
|
||||
declare class ClassPilao {
|
||||
|
|
@ -20,11 +20,11 @@ declare class ClassPilao {
|
|||
rota: string;
|
||||
url: string;
|
||||
};
|
||||
rotaConsultarSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
||||
rotaConsultarSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||
rota: string;
|
||||
url: string;
|
||||
};
|
||||
rotaIframeSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
||||
rotaIframeSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||
rota: string;
|
||||
url: string;
|
||||
};
|
||||
|
|
@ -40,7 +40,7 @@ declare class ClassPilao {
|
|||
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
||||
private processarRegistros;
|
||||
salvarRegistros(): Promise<tipoResposta<true>>;
|
||||
serieConsultar<T extends keyof typeof visoes>(tipoVisao: T, parametros: z.infer<(typeof visoes)[T]>): {
|
||||
serieConsultar<T extends keyof typeof visoes_pilao>(tipoVisao: T, parametros: z.infer<(typeof visoes_pilao)[T]>): {
|
||||
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { z } from "zod";
|
||||
import type { visoes } from "../visoes";
|
||||
import type { visoes_pilao } from "../visoes/listaDeVisoes";
|
||||
export type tipoConstrutorPilao = {
|
||||
produto: string;
|
||||
conta: string;
|
||||
};
|
||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes> = {
|
||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: z.infer<(typeof visoes)[T]>;
|
||||
serie: z.infer<(typeof visoes_pilao)[T]>;
|
||||
};
|
||||
|
|
|
|||
225
dist-import/pilao-de-dados/index.d.ts
vendored
225
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -4,225 +4,10 @@ export * from "./Pilao/pilao-api";
|
|||
export * from "./Pilao/tipagem";
|
||||
export declare const pPilao: {
|
||||
extruturas_de_campos: {
|
||||
z_contagem_em_barra_vertical: {
|
||||
visao: "z_contagem_em_barra_vertical";
|
||||
rotulo: string;
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colanuEixoX: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colunaAgrupamento: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
filtros: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza";
|
||||
rotulo: string;
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
classes: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
filtros: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_tabela: {
|
||||
visao: "z_tabela";
|
||||
rotulo: string;
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colunas: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
filtros: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
coluna_ordem: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
direcao_ordem: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_soma_em_barra_vertical: {
|
||||
visao: "z_soma_em_barra_vertical";
|
||||
rotulo: string;
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colanuEixoX: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colunaSoma: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
colunaAgrupamento: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
filtros: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: string;
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>>;
|
||||
order: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
||||
z_contagem_em_pizza: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
||||
z_tabela: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_tabela">;
|
||||
z_soma_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
||||
};
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
|
|
@ -486,7 +271,7 @@ export declare const pPilao: {
|
|||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>;
|
||||
visoes: {
|
||||
visoes_pilao: {
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ export * from "./Pilao";
|
|||
export * from "./Pilao/pilao-api";
|
||||
export * from "./Pilao/tipagem";
|
||||
import { z_filtro } from "./_serie_consultar";
|
||||
import { extruturas_de_campos, visoes } from "./visoes";
|
||||
import { extruturas_de_campos } from "./visoes";
|
||||
import { visoes_pilao } from "./visoes/listaDeVisoes";
|
||||
export const pPilao = {
|
||||
zp_deletar_registros,
|
||||
zp_registrar_base_dados,
|
||||
|
|
@ -16,7 +17,7 @@ export const pPilao = {
|
|||
operadores_pilao,
|
||||
operadores_permitidos_por_tipo,
|
||||
z_filtro,
|
||||
visoes,
|
||||
...visoes,
|
||||
visoes_pilao,
|
||||
...visoes_pilao,
|
||||
extruturas_de_campos,
|
||||
};
|
||||
|
|
|
|||
6
dist-import/pilao-de-dados/visoes/estrutura_de_campos/index.d.ts
vendored
Normal file
6
dist-import/pilao-de-dados/visoes/estrutura_de_campos/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import type { visoes_pilao } from "../listaDeVisoes";
|
||||
import type { tipo_estrutura_visao_grafico } from "../tipagem";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const extruturas_de_campos: {
|
||||
[T in keyof typeof visoes_pilao]: tipo_estrutura_visao_grafico<T>;
|
||||
};
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import { z_contagem_em_barra_vertical } from "./z_contagem_em_barra_vertical";
|
||||
import { z_contagem_em_pizza } from "./z_contagem_em_pizza";
|
||||
import { z_soma_em_barra_vertical } from "./z_soma_em_barra_vertical";
|
||||
import { z_tabela } from "./z_tabela";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const extruturas_de_campos = {
|
||||
z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza,
|
||||
z_soma_em_barra_vertical,
|
||||
z_tabela,
|
||||
};
|
||||
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_barra_vertical.d.ts
vendored
Normal file
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_barra_vertical.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { tipo_estrutura_visao_grafico } from "../tipagem";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const z_contagem_em_barra_vertical: tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// usar describe para definir o tipo de campo para render do componente
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const z_contagem_em_barra_vertical = {
|
||||
visao: "z_contagem_em_barra_vertical",
|
||||
rotulo: "Contagem em Barra Vertical",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros, colunaAgrupamento, }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Contagem de ${tabela} por ${colanuEixoX}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}${!colunaAgrupamento?.length
|
||||
? ""
|
||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colanuEixoX: {
|
||||
rotulo: "Coluna do Eixo X",
|
||||
tipo_campo: "coluna",
|
||||
order: 2,
|
||||
},
|
||||
colunaAgrupamento: {
|
||||
rotulo: "Colunas de Agrupamento",
|
||||
tipo_campo: "lista_colunas",
|
||||
order: 3,
|
||||
},
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 4,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 5 },
|
||||
},
|
||||
};
|
||||
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_pizza.d.ts
vendored
Normal file
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_pizza.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { tipo_estrutura_visao_grafico } from "../tipagem";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const z_contagem_em_pizza: tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// usar describe para definir o tipo de campo para render do componente
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const z_contagem_em_pizza = {
|
||||
visao: "z_contagem_em_pizza",
|
||||
rotulo: "Contagem em Pizza",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, classes, filtros }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Contagem de ${tabela} por ${classes}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
classes: { rotulo: "Classes", tipo_campo: "coluna", order: 2 },
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 3,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 4 },
|
||||
},
|
||||
};
|
||||
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_soma_em_barra_vertical.d.ts
vendored
Normal file
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_soma_em_barra_vertical.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { tipo_estrutura_visao_grafico } from "../tipagem";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const z_soma_em_barra_vertical: tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// usar describe para definir o tipo de campo para render do componente
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const z_soma_em_barra_vertical = {
|
||||
visao: "z_soma_em_barra_vertical",
|
||||
rotulo: "Soma em Barra Vertical",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ descricao_pelo_usuario, colanuEixoX, filtros, colunaAgrupamento, colunaSoma, }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Soma de ${colunaSoma} por ${colanuEixoX}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}${!colunaAgrupamento?.length
|
||||
? ""
|
||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colunaSoma: {
|
||||
rotulo: "Coluna de Somatória",
|
||||
tipo_campo: "coluna",
|
||||
order: 2,
|
||||
},
|
||||
colanuEixoX: {
|
||||
rotulo: "Coluna do Eixo X",
|
||||
tipo_campo: "coluna",
|
||||
order: 3,
|
||||
},
|
||||
colunaAgrupamento: {
|
||||
rotulo: "Colunas de Agrupamento",
|
||||
tipo_campo: "lista_colunas",
|
||||
order: 4,
|
||||
},
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 5,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 5 },
|
||||
},
|
||||
};
|
||||
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_tabela.d.ts
vendored
Normal file
3
dist-import/pilao-de-dados/visoes/estrutura_de_campos/z_tabela.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { tipo_estrutura_visao_grafico } from "../tipagem";
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const z_tabela: tipo_estrutura_visao_grafico<"z_tabela">;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// usar describe para definir o tipo de campo para render do componente
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const z_tabela = {
|
||||
visao: "z_tabela",
|
||||
rotulo: "Tabela",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, filtros }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Consulta na ${tabela} ${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colunas: { rotulo: "Colunas", tipo_campo: "lista_colunas", order: 2 },
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 3,
|
||||
},
|
||||
coluna_ordem: {
|
||||
rotulo: "Coluna de Ordem",
|
||||
tipo_campo: "coluna",
|
||||
order: 4,
|
||||
},
|
||||
direcao_ordem: {
|
||||
rotulo: "Direção de Ordem",
|
||||
tipo_campo: "ordem",
|
||||
order: 5,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 6 },
|
||||
},
|
||||
};
|
||||
345
dist-import/pilao-de-dados/visoes/index.d.ts
vendored
345
dist-import/pilao-de-dados/visoes/index.d.ts
vendored
|
|
@ -1,344 +1 @@
|
|||
import { z } from "zod";
|
||||
declare const z_tipos_campos: z.ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros", "ordem"]>;
|
||||
export declare const z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_soma_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaSoma: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
classes: z.ZodString;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_tabela: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colunas: z.ZodArray<z.ZodString, "many">;
|
||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}>;
|
||||
export declare const visoes: {
|
||||
z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
classes: z.ZodString;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
z_tabela: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colunas: z.ZodArray<z.ZodString, "many">;
|
||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}>;
|
||||
z_soma_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaSoma: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
};
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export declare const extruturas_de_campos: {
|
||||
[z in keyof typeof visoes]: {
|
||||
/** Nome da Visão */
|
||||
visao: z;
|
||||
/** Rotulo */
|
||||
rotulo: string;
|
||||
/** Retorna a tabela Referente ao Registro */
|
||||
tabela: (_: z.infer<(typeof visoes)[z]>) => string;
|
||||
/** Descrição */
|
||||
descricao: (_: z.infer<(typeof visoes)[z]>) => string;
|
||||
/** Lista os campos e suas configurações */
|
||||
campos: {
|
||||
[c in keyof Required<z.infer<(typeof visoes)[z]>>]: {
|
||||
rotulo: string;
|
||||
tipo_campo: z.infer<typeof z_tipos_campos>;
|
||||
order: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export {};
|
||||
export * from "./estrutura_de_campos";
|
||||
|
|
|
|||
|
|
@ -1,182 +1 @@
|
|||
import { z } from "zod";
|
||||
import { z_filtro } from "../_serie_consultar";
|
||||
// usar describe para definir o tipo de campo para render do componente
|
||||
const z_tipos_campos = z.enum([
|
||||
"tabela",
|
||||
"coluna",
|
||||
"texto",
|
||||
"lista_colunas",
|
||||
"lista_filtros",
|
||||
"ordem",
|
||||
]);
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_soma_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaSoma: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_contagem_em_pizza = z.object({
|
||||
tabela: z.string(),
|
||||
classes: z.string(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_tabela = z.object({
|
||||
tabela: z.string(),
|
||||
colunas: z.string().array(),
|
||||
coluna_ordem: z.string().optional(),
|
||||
direcao_ordem: z.enum(["asc", "desc", "1", "-1"]).optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const visoes = {
|
||||
z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza,
|
||||
z_tabela,
|
||||
z_soma_em_barra_vertical,
|
||||
};
|
||||
/** Cria a estrutura de campos para insersão de dados */
|
||||
export const extruturas_de_campos = {
|
||||
z_contagem_em_barra_vertical: {
|
||||
visao: "z_contagem_em_barra_vertical",
|
||||
rotulo: "Contagem em Barra Vertical",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros, colunaAgrupamento, }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Contagem de ${tabela} por ${colanuEixoX}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}${!colunaAgrupamento?.length
|
||||
? ""
|
||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colanuEixoX: {
|
||||
rotulo: "Coluna do Eixo X",
|
||||
tipo_campo: "coluna",
|
||||
order: 2,
|
||||
},
|
||||
colunaAgrupamento: {
|
||||
rotulo: "Colunas de Agrupamento",
|
||||
tipo_campo: "lista_colunas",
|
||||
order: 3,
|
||||
},
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 4,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 5 },
|
||||
},
|
||||
},
|
||||
z_soma_em_barra_vertical: {
|
||||
visao: "z_soma_em_barra_vertical",
|
||||
rotulo: "Soma em Barra Vertical",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros, colunaAgrupamento, }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Contagem de ${tabela} por ${colanuEixoX}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}${!colunaAgrupamento?.length
|
||||
? ""
|
||||
: `, agrupado por ${colunaAgrupamento.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colunaSoma: {
|
||||
rotulo: "Coluna de Somatória",
|
||||
tipo_campo: "coluna",
|
||||
order: 2,
|
||||
},
|
||||
colanuEixoX: {
|
||||
rotulo: "Coluna do Eixo X",
|
||||
tipo_campo: "coluna",
|
||||
order: 3,
|
||||
},
|
||||
colunaAgrupamento: {
|
||||
rotulo: "Colunas de Agrupamento",
|
||||
tipo_campo: "lista_colunas",
|
||||
order: 4,
|
||||
},
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 5,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 5 },
|
||||
},
|
||||
},
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza",
|
||||
rotulo: "Contagem em Pizza",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, classes, filtros }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Contagem de ${tabela} por ${classes}${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
classes: { rotulo: "Classes", tipo_campo: "coluna", order: 2 },
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 3,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 4 },
|
||||
},
|
||||
},
|
||||
z_tabela: {
|
||||
visao: "z_tabela",
|
||||
rotulo: "Tabela",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, filtros }) => {
|
||||
if (String(descricao_pelo_usuario || "").trim())
|
||||
return String(descricao_pelo_usuario || "").trim();
|
||||
return `Consulta na ${tabela} ${!filtros?.length
|
||||
? ""
|
||||
: `, quando ${filtros
|
||||
.map(({ coluna, operador, valor }) => `${coluna} ${operador} ${valor}`)
|
||||
.join(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
tabela: { rotulo: "Tabela", tipo_campo: "tabela", order: 1 },
|
||||
colunas: { rotulo: "Colunas", tipo_campo: "lista_colunas", order: 2 },
|
||||
descricao_pelo_usuario: {
|
||||
rotulo: "Descrição (opcional)",
|
||||
tipo_campo: "texto",
|
||||
order: 3,
|
||||
},
|
||||
coluna_ordem: {
|
||||
rotulo: "Coluna de Ordem",
|
||||
tipo_campo: "coluna",
|
||||
order: 4,
|
||||
},
|
||||
direcao_ordem: {
|
||||
rotulo: "Direção de Ordem",
|
||||
tipo_campo: "ordem",
|
||||
order: 5,
|
||||
},
|
||||
filtros: { rotulo: "Filtros", tipo_campo: "lista_filtros", order: 6 },
|
||||
},
|
||||
},
|
||||
};
|
||||
export * from "./estrutura_de_campos";
|
||||
|
|
|
|||
321
dist-import/pilao-de-dados/visoes/listaDeVisoes.d.ts
vendored
Normal file
321
dist-import/pilao-de-dados/visoes/listaDeVisoes.d.ts
vendored
Normal file
|
|
@ -0,0 +1,321 @@
|
|||
import { z } from "zod";
|
||||
export declare const z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_soma_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaSoma: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
classes: z.ZodString;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
export declare const z_tabela: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colunas: z.ZodArray<z.ZodString, "many">;
|
||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}>;
|
||||
export declare const visoes_pilao: {
|
||||
z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
classes: z.ZodString;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
classes: string;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
z_tabela: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colunas: z.ZodArray<z.ZodString, "many">;
|
||||
coluna_ordem: z.ZodOptional<z.ZodString>;
|
||||
direcao_ordem: z.ZodOptional<z.ZodEnum<["asc", "desc", "1", "-1"]>>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colunas: string[];
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
coluna_ordem?: string | undefined;
|
||||
direcao_ordem?: "1" | "asc" | "desc" | "-1" | undefined;
|
||||
}>;
|
||||
z_soma_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaSoma: z.ZodString;
|
||||
colunaAgrupamento: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
filtros: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">>;
|
||||
descricao_pelo_usuario: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaSoma: string;
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
filtros?: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[] | undefined;
|
||||
descricao_pelo_usuario?: string | undefined;
|
||||
}>;
|
||||
};
|
||||
37
dist-import/pilao-de-dados/visoes/listaDeVisoes.js
Normal file
37
dist-import/pilao-de-dados/visoes/listaDeVisoes.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { z } from "zod";
|
||||
import { z_filtro } from "../_serie_consultar";
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_soma_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaSoma: z.string(),
|
||||
colunaAgrupamento: z.string().array().optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_contagem_em_pizza = z.object({
|
||||
tabela: z.string(),
|
||||
classes: z.string(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const z_tabela = z.object({
|
||||
tabela: z.string(),
|
||||
colunas: z.string().array(),
|
||||
coluna_ordem: z.string().optional(),
|
||||
direcao_ordem: z.enum(["asc", "desc", "1", "-1"]).optional(),
|
||||
filtros: z_filtro.array().optional(),
|
||||
descricao_pelo_usuario: z.string().optional(),
|
||||
});
|
||||
export const visoes_pilao = {
|
||||
z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza,
|
||||
z_tabela,
|
||||
z_soma_em_barra_vertical,
|
||||
};
|
||||
21
dist-import/pilao-de-dados/visoes/tipagem.d.ts
vendored
Normal file
21
dist-import/pilao-de-dados/visoes/tipagem.d.ts
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { z } from "zod";
|
||||
import type { visoes_pilao } from "./listaDeVisoes";
|
||||
export declare const z_tipos_campos_reg_grafico: z.ZodEnum<["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;
|
||||
};
|
||||
};
|
||||
};
|
||||
9
dist-import/pilao-de-dados/visoes/tipagem.js
Normal file
9
dist-import/pilao-de-dados/visoes/tipagem.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { z } from "zod";
|
||||
export const z_tipos_campos_reg_grafico = z.enum([
|
||||
"tabela",
|
||||
"coluna",
|
||||
"texto",
|
||||
"lista_colunas",
|
||||
"lista_filtros",
|
||||
"ordem",
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue