implementado filtro26
This commit is contained in:
parent
ba0e116a92
commit
5124844773
18 changed files with 3247 additions and 3257 deletions
|
|
@ -18,12 +18,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
erro: import("vue").Ref<string | null, string | null>;
|
||||
linhas: import("vue").Ref<unknown[], unknown[]>;
|
||||
linhasPaginadas: import("vue").ComputedRef<unknown[]>;
|
||||
filtrosAvancadosAtivos: import("vue").ComputedRef<{
|
||||
coluna: string;
|
||||
valor: any;
|
||||
operador: "=" | "!=" | ">" | ">=" | "<" | "<=" | "like" | "in" | "isNull";
|
||||
ou?: boolean | undefined;
|
||||
}[]>;
|
||||
filtrosAvancadosAtivos: import("vue").ComputedRef<tipoFiltro<any>[]>;
|
||||
quantidadeFiltrada: import("vue").ComputedRef<number>;
|
||||
quantidade: import("vue").Ref<number, number>;
|
||||
menuAberto: import("vue").Ref<number | null, number | null>;
|
||||
|
|
@ -60,7 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
parametrosConsultaAtuais: import("vue").ComputedRef<{
|
||||
atualizarConsulta: () => Promise<void>;
|
||||
editarLista: (novaLista: any[]) => Promise<any[]>;
|
||||
filtros?: tipoFiltro[];
|
||||
filtros?: import("p-comuns").tipoFiltro26<any>[] | undefined;
|
||||
coluna_ordem?: string | number | symbol | undefined;
|
||||
direcao_ordem?: "asc" | "desc";
|
||||
offSet?: number;
|
||||
|
|
@ -88,13 +83,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
salvarModalColunas: (cfg: EliTabelaColunasConfig) => void;
|
||||
modalFiltroAberto: import("vue").Ref<boolean, boolean>;
|
||||
filtrosUi: import("vue").Ref<{
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
valor: any;
|
||||
}[], {
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
valor: any;
|
||||
}[] | {
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
valor: any;
|
||||
}[]>;
|
||||
salvarFiltrosAvancados: (novo: any[]) => void;
|
||||
|
|
@ -861,8 +856,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
};
|
||||
filtrosBase: {
|
||||
type: PropType<Array<{
|
||||
coluna: string | number | symbol;
|
||||
operador: import("p-comuns").operadores | keyof typeof import("p-comuns").operadores;
|
||||
chave: string;
|
||||
rotulo: string;
|
||||
filtro: (valor: unknown) => import("p-comuns").tipoFiltro26<any>;
|
||||
entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada;
|
||||
}>>;
|
||||
required: true;
|
||||
|
|
@ -873,7 +869,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
};
|
||||
}>, {
|
||||
linhas: import("vue").Ref<{
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
entrada: readonly ["texto", {
|
||||
rotulo: string;
|
||||
placeholder?: string | undefined;
|
||||
|
|
@ -928,15 +924,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
densidade?: import("../..").CampoDensidade | undefined;
|
||||
variante?: import("../..").CampoVariante | undefined;
|
||||
}];
|
||||
operador: string;
|
||||
valor: any;
|
||||
}[], {
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada;
|
||||
operador: string;
|
||||
valor: any;
|
||||
}[] | {
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
entrada: readonly ["texto", {
|
||||
rotulo: string;
|
||||
placeholder?: string | undefined;
|
||||
|
|
@ -991,15 +985,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
densidade?: import("../..").CampoDensidade | undefined;
|
||||
variante?: import("../..").CampoVariante | undefined;
|
||||
}];
|
||||
operador: string;
|
||||
valor: any;
|
||||
}[]>;
|
||||
opcoesParaAdicionar: import("vue").ComputedRef<{
|
||||
coluna: string | number | symbol;
|
||||
operador: import("p-comuns").operadores | keyof typeof import("p-comuns").operadores;
|
||||
chave: string;
|
||||
rotulo: string;
|
||||
filtro: (valor: unknown) => import("p-comuns").tipoFiltro26<any>;
|
||||
entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada;
|
||||
}[]>;
|
||||
colunaParaAdicionar: import("vue").Ref<string, string>;
|
||||
chaveParaAdicionar: import("vue").Ref<string, string>;
|
||||
componenteEntrada: (entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada) => import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
value: {
|
||||
type: PropType<string | null | undefined>;
|
||||
|
|
@ -1352,8 +1346,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
emitSalvar: () => void;
|
||||
emitLimpar: () => void;
|
||||
rotuloDoFiltro: (f: {
|
||||
coluna: string | number | symbol;
|
||||
operador: import("p-comuns").operadores | keyof typeof import("p-comuns").operadores;
|
||||
chave: string;
|
||||
rotulo: string;
|
||||
filtro: (valor: unknown) => import("p-comuns").tipoFiltro26<any>;
|
||||
entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada;
|
||||
}) => string;
|
||||
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
||||
|
|
@ -1367,8 +1362,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
};
|
||||
filtrosBase: {
|
||||
type: PropType<Array<{
|
||||
coluna: string | number | symbol;
|
||||
operador: import("p-comuns").operadores | keyof typeof import("p-comuns").operadores;
|
||||
chave: string;
|
||||
rotulo: string;
|
||||
filtro: (valor: unknown) => import("p-comuns").tipoFiltro26<any>;
|
||||
entrada: import("../EliEntrada/tiposEntradas").ComponenteEntrada;
|
||||
}>>;
|
||||
required: true;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ import { type PropType } from "vue";
|
|||
import type { ComponenteEntrada } from "../EliEntrada/tiposEntradas";
|
||||
import type { tipoEliTabelaConsulta } from "./types-eli-tabela";
|
||||
type FiltroBase<T> = NonNullable<tipoEliTabelaConsulta<T>["filtroAvancado"]>[number];
|
||||
type LinhaFiltro<T> = {
|
||||
coluna: keyof T;
|
||||
type LinhaFiltro = {
|
||||
chave: string;
|
||||
entrada: ComponenteEntrada;
|
||||
operador: string;
|
||||
valor: any;
|
||||
};
|
||||
declare function rotuloDoFiltro(f: FiltroBase<any>): string;
|
||||
|
|
@ -26,7 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
};
|
||||
}>, {
|
||||
linhas: import("vue").Ref<{
|
||||
coluna: string | number | symbol;
|
||||
chave: string;
|
||||
entrada: readonly ["texto", {
|
||||
rotulo: string;
|
||||
placeholder?: string | undefined;
|
||||
|
|
@ -81,10 +80,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
densidade?: import("../..").CampoDensidade | undefined;
|
||||
variante?: import("../..").CampoVariante | undefined;
|
||||
}];
|
||||
operador: string;
|
||||
valor: any;
|
||||
}[], LinhaFiltro<any>[] | {
|
||||
coluna: string | number | symbol;
|
||||
}[], LinhaFiltro[] | {
|
||||
chave: string;
|
||||
entrada: readonly ["texto", {
|
||||
rotulo: string;
|
||||
placeholder?: string | undefined;
|
||||
|
|
@ -139,15 +137,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|||
densidade?: import("../..").CampoDensidade | undefined;
|
||||
variante?: import("../..").CampoVariante | undefined;
|
||||
}];
|
||||
operador: string;
|
||||
valor: any;
|
||||
}[]>;
|
||||
opcoesParaAdicionar: import("vue").ComputedRef<{
|
||||
coluna: string | number | symbol;
|
||||
operador: import("p-comuns").operadores | keyof typeof import("p-comuns").operadores;
|
||||
chave: string;
|
||||
rotulo: string;
|
||||
filtro: (valor: unknown) => import("p-comuns").tipoFiltro26<any>;
|
||||
entrada: ComponenteEntrada;
|
||||
}[]>;
|
||||
colunaParaAdicionar: import("vue").Ref<string, string>;
|
||||
chaveParaAdicionar: import("vue").Ref<string, string>;
|
||||
componenteEntrada: (entrada: ComponenteEntrada) => import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
value: {
|
||||
type: PropType<string | null | undefined>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export type EliTabelaFiltroAvancadoSalvo<T> = Array<{
|
||||
coluna: keyof T;
|
||||
valor: any;
|
||||
valor: T[keyof T];
|
||||
}>;
|
||||
export declare function carregarFiltroAvancado<T>(nomeTabela: string): EliTabelaFiltroAvancadoSalvo<T>;
|
||||
export declare function salvarFiltroAvancado<T>(nomeTabela: string, filtros: EliTabelaFiltroAvancadoSalvo<T>): void;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { LucideIcon } from "lucide-vue-next";
|
||||
import type { operadores, zFiltro } from "p-comuns";
|
||||
import type { tipoFiltro26 } from "p-comuns";
|
||||
export type tipoFiltro<T> = tipoFiltro26<T>;
|
||||
import type { tipoResposta } from "p-respostas";
|
||||
import type { ComponenteEntrada } from "../EliEntrada/tiposEntradas";
|
||||
import type { tiposTabelaCelulas, tipoTabelaCelula } from "./celulas/tiposTabelaCelulas";
|
||||
export type tipoFiltro = ReturnType<(typeof zFiltro)["parse"]>;
|
||||
export type tipoComponenteCelulaBase<T extends tipoTabelaCelula> = readonly [
|
||||
T,
|
||||
tiposTabelaCelulas[T]
|
||||
|
|
@ -52,7 +52,7 @@ export type tipoEliTabelaAcao<T> = {
|
|||
exibir?: boolean | ((linha: T) => Promise<boolean> | boolean);
|
||||
};
|
||||
export type parametrosConsulta<T> = {
|
||||
filtros?: tipoFiltro[];
|
||||
filtros?: tipoFiltro26<T>[];
|
||||
coluna_ordem?: keyof T;
|
||||
direcao_ordem?: "asc" | "desc";
|
||||
offSet?: number;
|
||||
|
|
@ -115,8 +115,13 @@ export type tipoEliTabelaConsulta<T> = {
|
|||
}) => void;
|
||||
}[];
|
||||
filtroAvancado?: {
|
||||
coluna: keyof T;
|
||||
operador: operadores | keyof typeof operadores;
|
||||
/** Identificador único do filtro (usado para persistência) */
|
||||
chave: string;
|
||||
/** Rótulo exibido no select de adicionar filtro */
|
||||
rotulo: string;
|
||||
/** vai gerar filtro e mescla com os filtros já existentes */
|
||||
filtro: (valor: unknown) => tipoFiltro26<T>;
|
||||
/** componente de entrada que vai receber o valor para o filtro */
|
||||
entrada: ComponenteEntrada;
|
||||
}[];
|
||||
};
|
||||
|
|
|
|||
1
dist/types/index.d.ts
vendored
1
dist/types/index.d.ts
vendored
|
|
@ -8,6 +8,7 @@ export { EliOlaMundo };
|
|||
export { EliBotao };
|
||||
export { EliBadge };
|
||||
export { EliCartao };
|
||||
export { criarFiltro26 } from "p-comuns";
|
||||
export * from "./componentes/EliEntrada";
|
||||
export * from "./componentes/EliTabela";
|
||||
export * from "./tipos";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue