inclusão de mapas

This commit is contained in:
Luiz Silva 2026-06-06 18:54:24 -03:00
parent b564c2c302
commit 6b9a9dc705
20 changed files with 4200 additions and 3696 deletions

6990
dist/eli-vue.es.js vendored

File diff suppressed because one or more lines are too long

124
dist/eli-vue.umd.js vendored

File diff suppressed because one or more lines are too long

View file

@ -8,43 +8,24 @@ export default _default;
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
value: {
type: PropType<EntradaCoordenadas["value"]>;
default: () => {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
};
default: null;
};
opcoes: {
type: PropType<EntradaCoordenadas["opcoes"]>;
required: true;
};
}>, {
attrs: import("vue").Attrs;
emit: ((event: "input", _v: {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => void) & ((event: "blur") => void) & ((event: "update:value", _v: {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => void) & ((event: "change", _v: {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => void) & ((event: "focus") => void);
mapaRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
alturaEfetiva: import("vue").ComputedRef<number>;
geolocalizando: import("vue").Ref<boolean, boolean>;
possuiValor: import("vue").ComputedRef<boolean>;
latDisplay: import("vue").ComputedRef<string>;
lngDisplay: import("vue").ComputedRef<string>;
onLatChange: (v: string | number) => void;
onLngChange: (v: string | number) => void;
usarMinhaLocalizacao: () => Promise<void>;
limpar: () => void;
attrs: import("vue").Attrs;
mapaRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
"update:value": (_v: EntradaCoordenadas["value"]) => true;
input: (_v: EntradaCoordenadas["value"]) => true;
@ -54,12 +35,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
value: {
type: PropType<EntradaCoordenadas["value"]>;
default: () => {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
};
default: null;
};
opcoes: {
type: PropType<EntradaCoordenadas["opcoes"]>;
@ -71,20 +47,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => any) | undefined;
} | null | undefined) => any) | undefined;
onBlur?: (() => any) | undefined;
"onUpdate:value"?: ((_v: {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => any) | undefined;
} | null | undefined) => any) | undefined;
onChange?: ((_v: {
formato: "decimal";
datum: "EPSG:4326";
latitude: number;
longitude: number;
}) => any) | undefined;
} | null | undefined) => any) | undefined;
onFocus?: (() => any) | undefined;
}>, {
value: {
@ -92,5 +68,5 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
datum: "EPSG:4326";
latitude: number;
longitude: number;
};
} | null | undefined;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,15 +1,7 @@
/**
* Tipos base para componentes de entrada (EliEntrada*)
*
* Objetivo:
* - Padronizar o shape de dados de todos os componentes de entrada.
* - Cada entrada possui sempre:
* 1) `value`: o valor atual (tipado)
* 2) `opcoes`: configuração do componente (rótulo, placeholder e extras por tipo)
*
* Como usar:
* - `PadroesEntradas[tipo]` retorna a tipagem completa (value + opcoes) daquele tipo.
* - `TipoEntrada` é a união com todos os tipos suportados (ex.: "texto" | "numero").
* Tipos base para componentes de entrada (EliEntrada*).
* PadroesEntradas[tipo] → tipagem completa (value + opcoes).
* TipoEntrada → união de todos os tipos suportados.
*/
import type { zCoordenadas } from "p-comuns";
import type z from "zod";
@ -174,11 +166,18 @@ export type PadroesEntradas = {
/** Densidade do campo (Vuetify). */
densidade?: import("../../tipos").CampoDensidade;
}>;
coordenadas: tipoPadraoEntrada<z.infer<typeof zCoordenadas>, {
coordenadas: tipoPadraoEntrada<z.infer<typeof zCoordenadas> | null | undefined, {
/** Nível de zoom inicial do mapa Leaflet (default: 4) */
zoom?: number;
/** Altura do container do mapa em pixels (default: 300) */
alturaMapa?: number;
/** Camadas vetoriais GeoJSON (contornos do IBGE) */
camadas?: {
/** Exibir contornos dos estados */
estados?: boolean;
/** Exibir contornos dos municípios (carregados por UF conforme viewport) */
municipios?: boolean;
};
}>;
};
/**

View file

@ -0,0 +1,11 @@
import L from "leaflet";
export interface OpcoesCamadas {
estados?: boolean;
municipios?: boolean;
}
/**
* Inicializa camadas vetoriais GeoJSON no mapa Leaflet.
* - Estados: overlay imediato
* - Municípios: sob demanda por UF, com 3 níveis de detalhe por zoom
*/
export declare function inicializarCamadas(mapa: L.Map, opcoes: OpcoesCamadas): void;

View file

@ -0,0 +1,22 @@
import { type Ref } from "vue";
import type { PadroesEntradas } from "../tiposEntradas";
type EntradaCoordenadas = PadroesEntradas["coordenadas"];
type EmitFn = (event: string, ...args: unknown[]) => void;
interface OpcoesComposable {
value: () => EntradaCoordenadas["value"];
opcoes: () => EntradaCoordenadas["opcoes"];
emit: EmitFn;
mapaRef: Ref<HTMLElement | null>;
}
export declare function useCoordenadas({ value, opcoes, emit, mapaRef }: OpcoesComposable): {
alturaEfetiva: import("vue").ComputedRef<number>;
geolocalizando: Ref<boolean, boolean>;
possuiValor: import("vue").ComputedRef<boolean>;
latDisplay: import("vue").ComputedRef<string>;
lngDisplay: import("vue").ComputedRef<string>;
onLatChange: (v: string | number) => void;
onLngChange: (v: string | number) => void;
usarMinhaLocalizacao: () => Promise<void>;
limpar: () => void;
};
export {};

View file

@ -1070,6 +1070,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[], import("./useFiltroAvancado").LinhaFiltro[] | {
@ -1165,6 +1169,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[]>;
@ -1216,12 +1224,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
default: string;
};
}>> & Readonly<{
onLimpar?: (() => any) | undefined;
onFechar?: (() => any) | undefined;
onSalvar?: ((_linhas: {
chave: string;
valor: unknown;
}[], _formula?: string | undefined) => any) | undefined;
onLimpar?: (() => any) | undefined;
}>, {
modeloFormula: string;
}, {}, {

View file

@ -119,6 +119,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[], import("./useFiltroAvancado").LinhaFiltro[] | {
@ -214,6 +218,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[]>;
@ -267,12 +275,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
default: string;
};
}>> & Readonly<{
onLimpar?: (() => any) | undefined;
onFechar?: (() => any) | undefined;
onSalvar?: ((_linhas: {
chave: string;
valor: unknown;
}[], _formula?: string | undefined) => any) | undefined;
onLimpar?: (() => any) | undefined;
}>, {
modeloFormula: string;
}, {}, {

View file

@ -150,6 +150,10 @@ export declare function useFiltroAvancado({ aberto, filtrosBase, modelo, modeloF
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[], LinhaFiltro[] | {
@ -245,6 +249,10 @@ export declare function useFiltroAvancado({ aberto, filtrosBase, modelo, modeloF
apenasLeitura?: boolean | undefined;
zoom?: number | undefined;
alturaMapa?: number | undefined;
camadas?: {
estados?: boolean | undefined;
municipios?: boolean | undefined;
} | undefined;
}];
valor: unknown;
}[]>;