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 { z } from "zod";
|
||||||
import type { zp_enviar_registros } from "../_enviar_registros";
|
import type { zp_enviar_registros } from "../_enviar_registros";
|
||||||
import { type zp_deletar_registros } from "../variaveis";
|
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 { tipo_pilao_api } from "./pilao-api.ts";
|
||||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem";
|
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem";
|
||||||
declare class ClassPilao {
|
declare class ClassPilao {
|
||||||
|
|
@ -20,11 +20,11 @@ declare class ClassPilao {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
rotaConsultarSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
rotaConsultarSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
rotaIframeSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
rotaIframeSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
|
|
@ -40,7 +40,7 @@ declare class ClassPilao {
|
||||||
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
||||||
private processarRegistros;
|
private processarRegistros;
|
||||||
salvarRegistros(): Promise<tipoResposta<true>>;
|
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>>>;
|
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import type { z } from "zod";
|
import type { z } from "zod";
|
||||||
import type { visoes } from "../visoes";
|
import type { visoes_pilao } from "../visoes/listaDeVisoes";
|
||||||
export type tipoConstrutorPilao = {
|
export type tipoConstrutorPilao = {
|
||||||
produto: string;
|
produto: string;
|
||||||
conta: string;
|
conta: string;
|
||||||
};
|
};
|
||||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes> = {
|
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
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 * from "./Pilao/tipagem";
|
||||||
export declare const pPilao: {
|
export declare const pPilao: {
|
||||||
extruturas_de_campos: {
|
extruturas_de_campos: {
|
||||||
z_contagem_em_barra_vertical: {
|
z_contagem_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
||||||
visao: "z_contagem_em_barra_vertical";
|
z_contagem_em_pizza: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
||||||
rotulo: string;
|
z_tabela: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_tabela">;
|
||||||
tabela: (_: {
|
z_soma_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
||||||
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("zod").ZodObject<{
|
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||||
tabela: import("zod").ZodString;
|
tabela: import("zod").ZodString;
|
||||||
|
|
@ -486,7 +271,7 @@ export declare const pPilao: {
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||||
valor?: any;
|
valor?: any;
|
||||||
}>;
|
}>;
|
||||||
visoes: {
|
visoes_pilao: {
|
||||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||||
tabela: import("zod").ZodString;
|
tabela: import("zod").ZodString;
|
||||||
colanuEixoX: import("zod").ZodString;
|
colanuEixoX: import("zod").ZodString;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ export * from "./Pilao";
|
||||||
export * from "./Pilao/pilao-api";
|
export * from "./Pilao/pilao-api";
|
||||||
export * from "./Pilao/tipagem";
|
export * from "./Pilao/tipagem";
|
||||||
import { z_filtro } from "./_serie_consultar";
|
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 = {
|
export const pPilao = {
|
||||||
zp_deletar_registros,
|
zp_deletar_registros,
|
||||||
zp_registrar_base_dados,
|
zp_registrar_base_dados,
|
||||||
|
|
@ -16,7 +17,7 @@ export const pPilao = {
|
||||||
operadores_pilao,
|
operadores_pilao,
|
||||||
operadores_permitidos_por_tipo,
|
operadores_permitidos_por_tipo,
|
||||||
z_filtro,
|
z_filtro,
|
||||||
visoes,
|
visoes_pilao,
|
||||||
...visoes,
|
...visoes_pilao,
|
||||||
extruturas_de_campos,
|
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";
|
export * from "./estrutura_de_campos";
|
||||||
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 {};
|
|
||||||
|
|
|
||||||
|
|
@ -1,182 +1 @@
|
||||||
import { z } from "zod";
|
export * from "./estrutura_de_campos";
|
||||||
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 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
||||||
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",
|
||||||
|
]);
|
||||||
8
dist-require/pilao-de-dados/Pilao/index.d.ts
vendored
8
dist-require/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 { z } from "zod";
|
||||||
import type { zp_enviar_registros } from "../_enviar_registros";
|
import type { zp_enviar_registros } from "../_enviar_registros";
|
||||||
import { type zp_deletar_registros } from "../variaveis";
|
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 { tipo_pilao_api } from "./pilao-api.ts";
|
||||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem";
|
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem";
|
||||||
declare class ClassPilao {
|
declare class ClassPilao {
|
||||||
|
|
@ -20,11 +20,11 @@ declare class ClassPilao {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
rotaConsultarSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
rotaConsultarSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
rotaIframeSerie(tipoVisao: keyof typeof visoes | ":tipoVisao"): {
|
rotaIframeSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
|
|
@ -40,7 +40,7 @@ declare class ClassPilao {
|
||||||
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
adicionarCodigoParaDeletar(tabela: string, ...codigos: z.infer<typeof zp_deletar_registros>["codigos"]): this;
|
||||||
private processarRegistros;
|
private processarRegistros;
|
||||||
salvarRegistros(): Promise<tipoResposta<true>>;
|
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>>>;
|
dados: () => Promise<tipoResposta<tipoRetornoSerieconsulta<T>>>;
|
||||||
url: () => string;
|
url: () => string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import type { z } from "zod";
|
import type { z } from "zod";
|
||||||
import type { visoes } from "../visoes";
|
import type { visoes_pilao } from "../visoes/listaDeVisoes";
|
||||||
export type tipoConstrutorPilao = {
|
export type tipoConstrutorPilao = {
|
||||||
produto: string;
|
produto: string;
|
||||||
conta: string;
|
conta: string;
|
||||||
};
|
};
|
||||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes> = {
|
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
||||||
registros: any[];
|
registros: any[];
|
||||||
legenda: string;
|
legenda: string;
|
||||||
serie: z.infer<(typeof visoes)[T]>;
|
serie: z.infer<(typeof visoes_pilao)[T]>;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
225
dist-require/pilao-de-dados/index.d.ts
vendored
225
dist-require/pilao-de-dados/index.d.ts
vendored
|
|
@ -4,225 +4,10 @@ export * from "./Pilao/pilao-api";
|
||||||
export * from "./Pilao/tipagem";
|
export * from "./Pilao/tipagem";
|
||||||
export declare const pPilao: {
|
export declare const pPilao: {
|
||||||
extruturas_de_campos: {
|
extruturas_de_campos: {
|
||||||
z_contagem_em_barra_vertical: {
|
z_contagem_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_barra_vertical">;
|
||||||
visao: "z_contagem_em_barra_vertical";
|
z_contagem_em_pizza: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_contagem_em_pizza">;
|
||||||
rotulo: string;
|
z_tabela: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_tabela">;
|
||||||
tabela: (_: {
|
z_soma_em_barra_vertical: import("./visoes/tipagem").tipo_estrutura_visao_grafico<"z_soma_em_barra_vertical">;
|
||||||
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("zod").ZodObject<{
|
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||||
tabela: import("zod").ZodString;
|
tabela: import("zod").ZodString;
|
||||||
|
|
@ -486,7 +271,7 @@ export declare const pPilao: {
|
||||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||||
valor?: any;
|
valor?: any;
|
||||||
}>;
|
}>;
|
||||||
visoes: {
|
visoes_pilao: {
|
||||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||||
tabela: import("zod").ZodString;
|
tabela: import("zod").ZodString;
|
||||||
colanuEixoX: import("zod").ZodString;
|
colanuEixoX: import("zod").ZodString;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ __exportStar(require("./Pilao/pilao-api"), exports);
|
||||||
__exportStar(require("./Pilao/tipagem"), exports);
|
__exportStar(require("./Pilao/tipagem"), exports);
|
||||||
const _serie_consultar_1 = require("./_serie_consultar");
|
const _serie_consultar_1 = require("./_serie_consultar");
|
||||||
const visoes_1 = require("./visoes");
|
const visoes_1 = require("./visoes");
|
||||||
|
const listaDeVisoes_1 = require("./visoes/listaDeVisoes");
|
||||||
exports.pPilao = {
|
exports.pPilao = {
|
||||||
zp_deletar_registros: variaveis_2.zp_deletar_registros,
|
zp_deletar_registros: variaveis_2.zp_deletar_registros,
|
||||||
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
||||||
|
|
@ -35,7 +36,7 @@ exports.pPilao = {
|
||||||
operadores_pilao: variaveis_2.operadores_pilao,
|
operadores_pilao: variaveis_2.operadores_pilao,
|
||||||
operadores_permitidos_por_tipo: variaveis_2.operadores_permitidos_por_tipo,
|
operadores_permitidos_por_tipo: variaveis_2.operadores_permitidos_por_tipo,
|
||||||
z_filtro: _serie_consultar_1.z_filtro,
|
z_filtro: _serie_consultar_1.z_filtro,
|
||||||
visoes: visoes_1.visoes,
|
visoes_pilao: listaDeVisoes_1.visoes_pilao,
|
||||||
...visoes_1.visoes,
|
...listaDeVisoes_1.visoes_pilao,
|
||||||
extruturas_de_campos: visoes_1.extruturas_de_campos,
|
extruturas_de_campos: visoes_1.extruturas_de_campos,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
6
dist-require/pilao-de-dados/visoes/estrutura_de_campos/index.d.ts
vendored
Normal file
6
dist-require/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,14 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.extruturas_de_campos = void 0;
|
||||||
|
const z_contagem_em_barra_vertical_1 = require("./z_contagem_em_barra_vertical");
|
||||||
|
const z_contagem_em_pizza_1 = require("./z_contagem_em_pizza");
|
||||||
|
const z_soma_em_barra_vertical_1 = require("./z_soma_em_barra_vertical");
|
||||||
|
const z_tabela_1 = require("./z_tabela");
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
exports.extruturas_de_campos = {
|
||||||
|
z_contagem_em_barra_vertical: z_contagem_em_barra_vertical_1.z_contagem_em_barra_vertical,
|
||||||
|
z_contagem_em_pizza: z_contagem_em_pizza_1.z_contagem_em_pizza,
|
||||||
|
z_soma_em_barra_vertical: z_soma_em_barra_vertical_1.z_soma_em_barra_vertical,
|
||||||
|
z_tabela: z_tabela_1.z_tabela,
|
||||||
|
};
|
||||||
3
dist-require/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_barra_vertical.d.ts
vendored
Normal file
3
dist-require/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,40 @@
|
||||||
|
"use strict";
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.z_contagem_em_barra_vertical = void 0;
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
exports.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-require/pilao-de-dados/visoes/estrutura_de_campos/z_contagem_em_pizza.d.ts
vendored
Normal file
3
dist-require/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,29 @@
|
||||||
|
"use strict";
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.z_contagem_em_pizza = void 0;
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
exports.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-require/pilao-de-dados/visoes/estrutura_de_campos/z_soma_em_barra_vertical.d.ts
vendored
Normal file
3
dist-require/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,45 @@
|
||||||
|
"use strict";
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.z_soma_em_barra_vertical = void 0;
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
exports.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-require/pilao-de-dados/visoes/estrutura_de_campos/z_tabela.d.ts
vendored
Normal file
3
dist-require/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,39 @@
|
||||||
|
"use strict";
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.z_tabela = void 0;
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
exports.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-require/pilao-de-dados/visoes/index.d.ts
vendored
345
dist-require/pilao-de-dados/visoes/index.d.ts
vendored
|
|
@ -1,344 +1 @@
|
||||||
import { z } from "zod";
|
export * from "./estrutura_de_campos";
|
||||||
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 {};
|
|
||||||
|
|
|
||||||
|
|
@ -1,185 +1,17 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||||
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.extruturas_de_campos = exports.visoes = exports.z_tabela = exports.z_contagem_em_pizza = exports.z_soma_em_barra_vertical = exports.z_contagem_em_barra_vertical = void 0;
|
__exportStar(require("./estrutura_de_campos"), exports);
|
||||||
const zod_1 = require("zod");
|
|
||||||
const _serie_consultar_1 = require("../_serie_consultar");
|
|
||||||
// usar describe para definir o tipo de campo para render do componente
|
|
||||||
const z_tipos_campos = zod_1.z.enum([
|
|
||||||
"tabela",
|
|
||||||
"coluna",
|
|
||||||
"texto",
|
|
||||||
"lista_colunas",
|
|
||||||
"lista_filtros",
|
|
||||||
"ordem",
|
|
||||||
]);
|
|
||||||
exports.z_contagem_em_barra_vertical = zod_1.z.object({
|
|
||||||
tabela: zod_1.z.string(),
|
|
||||||
colanuEixoX: zod_1.z.string(),
|
|
||||||
colunaAgrupamento: zod_1.z.string().array().optional(),
|
|
||||||
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
|
||||||
descricao_pelo_usuario: zod_1.z.string().optional(),
|
|
||||||
});
|
|
||||||
exports.z_soma_em_barra_vertical = zod_1.z.object({
|
|
||||||
tabela: zod_1.z.string(),
|
|
||||||
colanuEixoX: zod_1.z.string(),
|
|
||||||
colunaSoma: zod_1.z.string(),
|
|
||||||
colunaAgrupamento: zod_1.z.string().array().optional(),
|
|
||||||
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
|
||||||
descricao_pelo_usuario: zod_1.z.string().optional(),
|
|
||||||
});
|
|
||||||
exports.z_contagem_em_pizza = zod_1.z.object({
|
|
||||||
tabela: zod_1.z.string(),
|
|
||||||
classes: zod_1.z.string(),
|
|
||||||
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
|
||||||
descricao_pelo_usuario: zod_1.z.string().optional(),
|
|
||||||
});
|
|
||||||
exports.z_tabela = zod_1.z.object({
|
|
||||||
tabela: zod_1.z.string(),
|
|
||||||
colunas: zod_1.z.string().array(),
|
|
||||||
coluna_ordem: zod_1.z.string().optional(),
|
|
||||||
direcao_ordem: zod_1.z.enum(["asc", "desc", "1", "-1"]).optional(),
|
|
||||||
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
|
||||||
descricao_pelo_usuario: zod_1.z.string().optional(),
|
|
||||||
});
|
|
||||||
exports.visoes = {
|
|
||||||
z_contagem_em_barra_vertical: exports.z_contagem_em_barra_vertical,
|
|
||||||
z_contagem_em_pizza: exports.z_contagem_em_pizza,
|
|
||||||
z_tabela: exports.z_tabela,
|
|
||||||
z_soma_em_barra_vertical: exports.z_soma_em_barra_vertical,
|
|
||||||
};
|
|
||||||
/** Cria a estrutura de campos para insersão de dados */
|
|
||||||
exports.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 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
||||||
321
dist-require/pilao-de-dados/visoes/listaDeVisoes.d.ts
vendored
Normal file
321
dist-require/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;
|
||||||
|
}>;
|
||||||
|
};
|
||||||
40
dist-require/pilao-de-dados/visoes/listaDeVisoes.js
Normal file
40
dist-require/pilao-de-dados/visoes/listaDeVisoes.js
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.visoes_pilao = exports.z_tabela = exports.z_contagem_em_pizza = exports.z_soma_em_barra_vertical = exports.z_contagem_em_barra_vertical = void 0;
|
||||||
|
const zod_1 = require("zod");
|
||||||
|
const _serie_consultar_1 = require("../_serie_consultar");
|
||||||
|
exports.z_contagem_em_barra_vertical = zod_1.z.object({
|
||||||
|
tabela: zod_1.z.string(),
|
||||||
|
colanuEixoX: zod_1.z.string(),
|
||||||
|
colunaAgrupamento: zod_1.z.string().array().optional(),
|
||||||
|
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
||||||
|
descricao_pelo_usuario: zod_1.z.string().optional(),
|
||||||
|
});
|
||||||
|
exports.z_soma_em_barra_vertical = zod_1.z.object({
|
||||||
|
tabela: zod_1.z.string(),
|
||||||
|
colanuEixoX: zod_1.z.string(),
|
||||||
|
colunaSoma: zod_1.z.string(),
|
||||||
|
colunaAgrupamento: zod_1.z.string().array().optional(),
|
||||||
|
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
||||||
|
descricao_pelo_usuario: zod_1.z.string().optional(),
|
||||||
|
});
|
||||||
|
exports.z_contagem_em_pizza = zod_1.z.object({
|
||||||
|
tabela: zod_1.z.string(),
|
||||||
|
classes: zod_1.z.string(),
|
||||||
|
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
||||||
|
descricao_pelo_usuario: zod_1.z.string().optional(),
|
||||||
|
});
|
||||||
|
exports.z_tabela = zod_1.z.object({
|
||||||
|
tabela: zod_1.z.string(),
|
||||||
|
colunas: zod_1.z.string().array(),
|
||||||
|
coluna_ordem: zod_1.z.string().optional(),
|
||||||
|
direcao_ordem: zod_1.z.enum(["asc", "desc", "1", "-1"]).optional(),
|
||||||
|
filtros: _serie_consultar_1.z_filtro.array().optional(),
|
||||||
|
descricao_pelo_usuario: zod_1.z.string().optional(),
|
||||||
|
});
|
||||||
|
exports.visoes_pilao = {
|
||||||
|
z_contagem_em_barra_vertical: exports.z_contagem_em_barra_vertical,
|
||||||
|
z_contagem_em_pizza: exports.z_contagem_em_pizza,
|
||||||
|
z_tabela: exports.z_tabela,
|
||||||
|
z_soma_em_barra_vertical: exports.z_soma_em_barra_vertical,
|
||||||
|
};
|
||||||
21
dist-require/pilao-de-dados/visoes/tipagem.d.ts
vendored
Normal file
21
dist-require/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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
12
dist-require/pilao-de-dados/visoes/tipagem.js
Normal file
12
dist-require/pilao-de-dados/visoes/tipagem.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.z_tipos_campos_reg_grafico = void 0;
|
||||||
|
const zod_1 = require("zod");
|
||||||
|
exports.z_tipos_campos_reg_grafico = zod_1.z.enum([
|
||||||
|
"tabela",
|
||||||
|
"coluna",
|
||||||
|
"texto",
|
||||||
|
"lista_colunas",
|
||||||
|
"lista_filtros",
|
||||||
|
"ordem",
|
||||||
|
]);
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-drives",
|
"name": "p-drives",
|
||||||
"version": "0.173.0",
|
"version": "0.176.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import type { z } from "zod"
|
||||||
|
|
||||||
import type { zp_enviar_registros } from "../_enviar_registros"
|
import type { zp_enviar_registros } from "../_enviar_registros"
|
||||||
import { PREFIXO_PILAO, type zp_deletar_registros } from "../variaveis"
|
import { PREFIXO_PILAO, 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 { tipo_pilao_api } from "./pilao-api.ts"
|
||||||
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem"
|
import type { tipoConstrutorPilao, tipoRetornoSerieconsulta } from "./tipagem"
|
||||||
|
|
||||||
|
|
@ -54,11 +55,11 @@ class ClassPilao {
|
||||||
return this.#gerarUrl("deletar-registros")
|
return this.#gerarUrl("deletar-registros")
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaConsultarSerie(tipoVisao: keyof typeof visoes | ":tipoVisao") {
|
rotaConsultarSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao") {
|
||||||
return this.#gerarUrl("consultar-serie", tipoVisao)
|
return this.#gerarUrl("consultar-serie", tipoVisao)
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaIframeSerie(tipoVisao: keyof typeof visoes | ":tipoVisao") {
|
rotaIframeSerie(tipoVisao: keyof typeof visoes_pilao | ":tipoVisao") {
|
||||||
const rota = `${PREFIXO_PILAO}/consultar-serie/${this.#produto}/${this.#conta}/${tipoVisao}`
|
const rota = `${PREFIXO_PILAO}/consultar-serie/${this.#produto}/${this.#conta}/${tipoVisao}`
|
||||||
const url = `${this.baseUrlSite}${rota}`
|
const url = `${this.baseUrlSite}${rota}`
|
||||||
return { rota, url }
|
return { rota, url }
|
||||||
|
|
@ -219,9 +220,9 @@ class ClassPilao {
|
||||||
return respostaComuns.valor(true)
|
return respostaComuns.valor(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
serieConsultar<T extends keyof typeof visoes>(
|
serieConsultar<T extends keyof typeof visoes_pilao>(
|
||||||
tipoVisao: T,
|
tipoVisao: T,
|
||||||
parametros: z.infer<(typeof visoes)[T]>,
|
parametros: z.infer<(typeof visoes_pilao)[T]>,
|
||||||
) {
|
) {
|
||||||
const dados = async (): Promise<
|
const dados = async (): Promise<
|
||||||
tipoResposta<tipoRetornoSerieconsulta<T>>
|
tipoResposta<tipoRetornoSerieconsulta<T>>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import type { z } from "zod"
|
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 tipoConstrutorPilao = { produto: string; conta: string }
|
||||||
|
|
||||||
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes> = {
|
export type tipoRetornoSerieconsulta<T extends keyof typeof visoes_pilao> = {
|
||||||
registros: any[]
|
registros: any[]
|
||||||
legenda: string
|
legenda: string
|
||||||
serie: z.infer<(typeof visoes)[T]>
|
serie: z.infer<(typeof visoes_pilao)[T]>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ export * from "./Pilao/pilao-api"
|
||||||
export * from "./Pilao/tipagem"
|
export * from "./Pilao/tipagem"
|
||||||
|
|
||||||
import { z_filtro } from "./_serie_consultar"
|
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 = {
|
export const pPilao = {
|
||||||
zp_deletar_registros,
|
zp_deletar_registros,
|
||||||
|
|
@ -31,7 +32,7 @@ export const pPilao = {
|
||||||
operadores_pilao,
|
operadores_pilao,
|
||||||
operadores_permitidos_por_tipo,
|
operadores_permitidos_por_tipo,
|
||||||
z_filtro,
|
z_filtro,
|
||||||
visoes,
|
visoes_pilao,
|
||||||
...visoes,
|
...visoes_pilao,
|
||||||
extruturas_de_campos,
|
extruturas_de_campos,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
src/pilao-de-dados/visoes/estrutura_de_campos/index.ts
Normal file
16
src/pilao-de-dados/visoes/estrutura_de_campos/index.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import type { visoes_pilao } from "../listaDeVisoes"
|
||||||
|
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
||||||
|
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: {
|
||||||
|
[T in keyof typeof visoes_pilao]: tipo_estrutura_visao_grafico<T>
|
||||||
|
} = {
|
||||||
|
z_contagem_em_barra_vertical,
|
||||||
|
z_contagem_em_pizza,
|
||||||
|
z_soma_em_barra_vertical,
|
||||||
|
z_tabela,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
|
||||||
|
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
||||||
|
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
export const z_contagem_em_barra_vertical: tipo_estrutura_visao_grafico<"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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
|
||||||
|
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
||||||
|
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
export const z_contagem_em_pizza: tipo_estrutura_visao_grafico<"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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
|
||||||
|
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
||||||
|
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
export const z_soma_em_barra_vertical: tipo_estrutura_visao_grafico<"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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
45
src/pilao-de-dados/visoes/estrutura_de_campos/z_tabela.ts
Normal file
45
src/pilao-de-dados/visoes/estrutura_de_campos/z_tabela.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
// usar describe para definir o tipo de campo para render do componente
|
||||||
|
|
||||||
|
import type { tipo_estrutura_visao_grafico } from "../tipagem"
|
||||||
|
|
||||||
|
/** Cria a estrutura de campos para insersão de dados */
|
||||||
|
export const z_tabela: tipo_estrutura_visao_grafico<"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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,253 +1 @@
|
||||||
import { z } from "zod"
|
export * from "./estrutura_de_campos"
|
||||||
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 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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} = {
|
|
||||||
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 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
|
||||||
42
src/pilao-de-dados/visoes/listaDeVisoes.ts
Normal file
42
src/pilao-de-dados/visoes/listaDeVisoes.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
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,
|
||||||
|
}
|
||||||
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