add visoes
This commit is contained in:
parent
8e34798496
commit
9300367948
11 changed files with 1079 additions and 1 deletions
233
dist-import/pilao-de-dados/index.d.ts
vendored
233
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -5,6 +5,162 @@ import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
|||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export declare const pPilao: {
|
||||
extruturas_de_campos: {
|
||||
z_contagem_em_barra_vertical: {
|
||||
visao: "z_contagem_em_barra_vertical";
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colanuEixoX: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colunaAgrupamento: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
filtros: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza";
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colanuEixoX: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
filtros: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
colunaAgrupamento: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
zp_registrar_base_dados: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colunas: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
|
|
@ -151,4 +307,81 @@ export declare const pPilao: {
|
|||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>;
|
||||
visoes: {
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
colunaAgrupamento: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ export { PREFIXO_PILAO, urlPilao } from "./variaveis";
|
|||
import { enviar_registros, zp_enviar_registros, zp_registrar_base_dados, } from "./_enviar_registros";
|
||||
import { operadores_permitidos_por_tipo, operadores_pilao, tiposSeriesAgregacoes, validarZ, zp_produto_conta, } from "./variaveis";
|
||||
import { serie_consultar, z_filtro, zp_serie_registrar, } from "./_serie_consultar";
|
||||
import { extruturas_de_campos, visoes } from "./visoes";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export const pPilao = {
|
||||
zp_registrar_base_dados,
|
||||
|
|
@ -17,4 +18,7 @@ export const pPilao = {
|
|||
operadores_pilao,
|
||||
operadores_permitidos_por_tipo,
|
||||
z_filtro,
|
||||
visoes,
|
||||
...visoes,
|
||||
extruturas_de_campos,
|
||||
};
|
||||
|
|
|
|||
172
dist-import/pilao-de-dados/visoes/index.d.ts
vendored
Normal file
172
dist-import/pilao-de-dados/visoes/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import { z } from "zod";
|
||||
declare const z_tipos_campos: z.ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>;
|
||||
export declare const z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodArray<z.ZodString, "many">;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
export declare const z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
export declare const visoes: {
|
||||
z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodArray<z.ZodString, "many">;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
};
|
||||
/** 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;
|
||||
/** 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 z.infer<(typeof visoes)[z]>]: {
|
||||
tipo_campo: z.infer<typeof z_tipos_campos>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export {};
|
||||
71
dist-import/pilao-de-dados/visoes/index.js
Normal file
71
dist-import/pilao-de-dados/visoes/index.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import { z } from "zod";
|
||||
import { z_filtro } from "../_serie_consultar";
|
||||
// usar describe para definir o tipo de campo para render do componente
|
||||
const z_tipos_campos = z.enum([
|
||||
"tabela",
|
||||
"coluna",
|
||||
"texto",
|
||||
"lista_colunas",
|
||||
"lista_filtros",
|
||||
]);
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array(),
|
||||
filtros: z_filtro.array(),
|
||||
descricao_pelo_usuario: z.string(),
|
||||
});
|
||||
export const z_contagem_em_pizza = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
filtros: z_filtro.array(),
|
||||
descricao_pelo_usuario: z.string(),
|
||||
});
|
||||
export const visoes = {
|
||||
z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza,
|
||||
};
|
||||
/** 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",
|
||||
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: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
colunaAgrupamento: { tipo_campo: "lista_colunas" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros }) => {
|
||||
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(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
};
|
||||
233
dist-require/pilao-de-dados/index.d.ts
vendored
233
dist-require/pilao-de-dados/index.d.ts
vendored
|
|
@ -5,6 +5,162 @@ import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
|||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export declare const pPilao: {
|
||||
extruturas_de_campos: {
|
||||
z_contagem_em_barra_vertical: {
|
||||
visao: "z_contagem_em_barra_vertical";
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colanuEixoX: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colunaAgrupamento: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
filtros: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza";
|
||||
tabela: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
descricao: (_: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}) => string;
|
||||
campos: {
|
||||
tabela: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
colanuEixoX: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
filtros: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
descricao_pelo_usuario: {
|
||||
tipo_campo: import("zod").TypeOf<import("zod").ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
colunaAgrupamento: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
zp_registrar_base_dados: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colunas: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
|
|
@ -151,4 +307,81 @@ export declare const pPilao: {
|
|||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>;
|
||||
visoes: {
|
||||
z_contagem_em_barra_vertical: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
colunaAgrupamento: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
colanuEixoX: import("zod").ZodString;
|
||||
filtros: import("zod").ZodArray<import("zod").ZodObject<{
|
||||
coluna: import("zod").ZodString;
|
||||
valor: import("zod").ZodAny;
|
||||
operador: import("zod").ZodEnum<["=", "!=", ">", "<", ">=", "<=", "∩"]>;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}, {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}>, "many">;
|
||||
descricao_pelo_usuario: import("zod").ZodString;
|
||||
}, "strip", import("zod").ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const _enviar_registros_1 = require("./_enviar_registros");
|
|||
const variaveis_2 = require("./variaveis");
|
||||
Object.defineProperty(exports, "tiposSeriesAgregacoes", { enumerable: true, get: function () { return variaveis_2.tiposSeriesAgregacoes; } });
|
||||
const _serie_consultar_1 = require("./_serie_consultar");
|
||||
const visoes_1 = require("./visoes");
|
||||
exports.pPilao = {
|
||||
zp_registrar_base_dados: _enviar_registros_1.zp_registrar_base_dados,
|
||||
enviar_registros: _enviar_registros_1.enviar_registros,
|
||||
|
|
@ -22,4 +23,7 @@ exports.pPilao = {
|
|||
operadores_pilao: variaveis_2.operadores_pilao,
|
||||
operadores_permitidos_por_tipo: variaveis_2.operadores_permitidos_por_tipo,
|
||||
z_filtro: _serie_consultar_1.z_filtro,
|
||||
visoes: visoes_1.visoes,
|
||||
...visoes_1.visoes,
|
||||
extruturas_de_campos: visoes_1.extruturas_de_campos,
|
||||
};
|
||||
|
|
|
|||
172
dist-require/pilao-de-dados/visoes/index.d.ts
vendored
Normal file
172
dist-require/pilao-de-dados/visoes/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import { z } from "zod";
|
||||
declare const z_tipos_campos: z.ZodEnum<["tabela", "coluna", "texto", "lista_colunas", "lista_filtros"]>;
|
||||
export declare const z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodArray<z.ZodString, "many">;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
export declare const z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
export declare const visoes: {
|
||||
z_contagem_em_barra_vertical: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
colunaAgrupamento: z.ZodArray<z.ZodString, "many">;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
colunaAgrupamento: string[];
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
z_contagem_em_pizza: z.ZodObject<{
|
||||
tabela: z.ZodString;
|
||||
colanuEixoX: z.ZodString;
|
||||
filtros: 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.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}, {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
filtros: {
|
||||
coluna: string;
|
||||
operador: "=" | "!=" | ">" | "<" | ">=" | "<=" | "∩";
|
||||
valor?: any;
|
||||
}[];
|
||||
descricao_pelo_usuario: string;
|
||||
}>;
|
||||
};
|
||||
/** 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;
|
||||
/** 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 z.infer<(typeof visoes)[z]>]: {
|
||||
tipo_campo: z.infer<typeof z_tipos_campos>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export {};
|
||||
74
dist-require/pilao-de-dados/visoes/index.js
Normal file
74
dist-require/pilao-de-dados/visoes/index.js
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.extruturas_de_campos = exports.visoes = exports.z_contagem_em_pizza = exports.z_contagem_em_barra_vertical = void 0;
|
||||
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",
|
||||
]);
|
||||
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(),
|
||||
filtros: _serie_consultar_1.z_filtro.array(),
|
||||
descricao_pelo_usuario: zod_1.z.string(),
|
||||
});
|
||||
exports.z_contagem_em_pizza = zod_1.z.object({
|
||||
tabela: zod_1.z.string(),
|
||||
colanuEixoX: zod_1.z.string(),
|
||||
filtros: _serie_consultar_1.z_filtro.array(),
|
||||
descricao_pelo_usuario: zod_1.z.string(),
|
||||
});
|
||||
exports.visoes = {
|
||||
z_contagem_em_barra_vertical: exports.z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza: exports.z_contagem_em_pizza,
|
||||
};
|
||||
/** 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",
|
||||
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: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
colunaAgrupamento: { tipo_campo: "lista_colunas" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros }) => {
|
||||
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(", ")}`}.`;
|
||||
},
|
||||
campos: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-drives",
|
||||
"version": "0.118.0",
|
||||
"version": "0.119.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import {
|
|||
z_filtro,
|
||||
zp_serie_registrar,
|
||||
} from "./_serie_consultar"
|
||||
import { extruturas_de_campos, visoes } from "./visoes"
|
||||
|
||||
export { tiposSeriesAgregacoes }
|
||||
|
||||
|
|
@ -34,4 +35,7 @@ export const pPilao = {
|
|||
operadores_pilao,
|
||||
operadores_permitidos_por_tipo,
|
||||
z_filtro,
|
||||
visoes,
|
||||
...visoes,
|
||||
extruturas_de_campos,
|
||||
}
|
||||
|
|
|
|||
111
src/pilao-de-dados/visoes/index.ts
Normal file
111
src/pilao-de-dados/visoes/index.ts
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
import { z } from "zod"
|
||||
import { z_filtro } from "../_serie_consultar"
|
||||
// usar describe para definir o tipo de campo para render do componente
|
||||
|
||||
const z_tipos_campos = z.enum([
|
||||
"tabela",
|
||||
"coluna",
|
||||
"texto",
|
||||
"lista_colunas",
|
||||
"lista_filtros",
|
||||
])
|
||||
|
||||
export const z_contagem_em_barra_vertical = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string().array(),
|
||||
filtros: z_filtro.array(),
|
||||
descricao_pelo_usuario: z.string(),
|
||||
})
|
||||
|
||||
export const z_contagem_em_pizza = z.object({
|
||||
tabela: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
filtros: z_filtro.array(),
|
||||
descricao_pelo_usuario: z.string(),
|
||||
})
|
||||
|
||||
export const visoes = {
|
||||
z_contagem_em_barra_vertical,
|
||||
z_contagem_em_pizza,
|
||||
}
|
||||
|
||||
/** 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
|
||||
/** 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 z.infer<(typeof visoes)[z]>]: {
|
||||
tipo_campo: z.infer<typeof z_tipos_campos>
|
||||
}
|
||||
}
|
||||
}
|
||||
} = {
|
||||
z_contagem_em_barra_vertical: {
|
||||
visao: "z_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: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
colunaAgrupamento: { tipo_campo: "lista_colunas" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
z_contagem_em_pizza: {
|
||||
visao: "z_contagem_em_pizza",
|
||||
tabela: ({ tabela }) => tabela,
|
||||
descricao: ({ tabela, descricao_pelo_usuario, colanuEixoX, filtros }) => {
|
||||
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(", ")}`
|
||||
}.`
|
||||
},
|
||||
campos: {
|
||||
colanuEixoX: { tipo_campo: "coluna" },
|
||||
tabela: { tipo_campo: "tabela" },
|
||||
filtros: { tipo_campo: "lista_filtros" },
|
||||
descricao_pelo_usuario: { tipo_campo: "texto" },
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue