@thibezer/ui-components-kit 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +265 -204
- package/README.md +815 -791
- package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
- package/dist/acessibilidade-CUlSXc2X.js +38 -0
- package/dist/altura-controle-ukMRPckR.cjs +1 -0
- package/dist/altura-controle-vxQiXG4q.js +62 -0
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +94 -94
- package/dist/camadas.js +1218 -1124
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +66 -65
- package/dist/canvas.js +3769 -3389
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-alerta/ui-toast.d.ts +4 -15
- package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/components/ui-badge/ui-badge.d.ts +2 -0
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +16 -0
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +14 -0
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +17 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +1 -7
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
- package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-render.d.ts +14 -0
- package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +3 -5
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +24 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +26 -106
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
- package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +4 -1
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
- package/dist/components/ui-linha/index.d.ts +1 -0
- package/dist/components/ui-linha/ui-linha.d.ts +48 -0
- package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
- package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
- package/dist/components/ui-mapa/tipos.d.ts +13 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
- package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/modal-foco.d.ts +28 -0
- package/dist/components/ui-modal/ui-modal.d.ts +1 -11
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +9 -2
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-switch/ui-switch.d.ts +3 -1
- package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
- package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
- package/dist/core/altura-controle.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/opcoes.d.ts +9 -0
- package/dist/core/rotulo-controle.d.ts +13 -0
- package/dist/core/tipos-toast.d.ts +16 -0
- package/dist/core/ui-bus.d.ts +9 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +29 -19
- package/dist/custom-elements.json +20984 -15700
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +21 -21
- package/dist/form-validacao-BlQFxUVj.js +104 -0
- package/dist/form-validacao-DIeyQVH5.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +178 -177
- package/dist/mapa.cjs +11 -16
- package/dist/mapa.js +242 -170
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/opcoes-CJYLi6kd.js +12 -0
- package/dist/opcoes-CkyDxBuQ.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +13 -14
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +33 -3
- package/dist/tipos-react.d.ts +2 -0
- package/dist/tipos-vue.d.ts +32 -3
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BWhoGgo9.js +197 -0
- package/dist/ui-badge-SIR81R9l.cjs +28 -0
- package/dist/ui-botao-D24oXySA.cjs +12 -0
- package/dist/ui-botao-Dsj08jjw.js +165 -0
- package/dist/{zero-js-triggers-C_KrvFOQ.js → ui-bus-CUd99VJi.js} +36 -103
- package/dist/ui-bus-XqBLlTYQ.cjs +1 -0
- package/dist/{ui-campo-texto-Uu2dJE_0.js → ui-campo-texto-B_OHVGiN.js} +51 -51
- package/dist/ui-campo-texto-DauJCde3.cjs +16 -0
- package/dist/{ui-card-C_o5_0cB.js → ui-card-BNYCQ7g-.js} +50 -42
- package/dist/ui-card-BrjBL-yo.cjs +20 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-C6HBnsaw.cjs +19 -0
- package/dist/{ui-segmented-wUraId2e.js → ui-linha-nCDh2wPm.js} +200 -105
- package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
- package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
- package/dist/{ui-paleta-ferramentas-DNN5i6nL.js → ui-paleta-ferramentas-Ksh6gMW3.js} +359 -329
- package/dist/{ui-paleta-ferramentas-Ccmo-rB5.cjs → ui-paleta-ferramentas-bDLPbiGA.cjs} +7 -7
- package/dist/ui-skeleton-B2Rgrv8o.js +648 -0
- package/dist/ui-skeleton-DiOxTBZK.cjs +52 -0
- package/dist/ui-switch-D9a8XlVX.cjs +53 -0
- package/dist/{ui-switch-BcOqOkiV.js → ui-switch-DO1R0Ce7.js} +187 -128
- package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-D9Echt2X.js} +845 -826
- package/dist/{ui-tabela-propriedades-BecPqC-e.cjs → ui-tabela-propriedades-DzZlyNZ_.cjs} +10 -10
- package/dist/zero-js-triggers-CJT988bR.js +83 -0
- package/dist/zero-js-triggers-CgM9IIQB.cjs +1 -0
- package/package.json +9 -2
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { U as c, a as l } from "./ui-botao-
|
|
3
|
-
import { A as m, L as
|
|
4
|
-
import { A as b, S as L, U as O, a as R, b as v, c as z, d as M, e as D,
|
|
5
|
-
import { A as
|
|
6
|
-
import { U as
|
|
7
|
-
import { U as
|
|
8
|
-
import { U as
|
|
9
|
-
import { U as
|
|
10
|
-
import { U as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { i as r } from "./zero-js-triggers-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { c as qe, g as Ve, o as we } from "./form-validacao-BIOXxt-1.js";
|
|
2
|
+
import { U as c, a as l } from "./ui-botao-Dsj08jjw.js";
|
|
3
|
+
import { A as m, L as u, a as p, R as I, U, b as C, c as S, d as T, e as E, f as g, g as f, h as A, r as x } from "./ui-switch-DO1R0Ce7.js";
|
|
4
|
+
import { A as b, S as L, U as O, a as R, b as v, c as z, d as M, e as D, f as h, t as B } from "./ui-linha-nCDh2wPm.js";
|
|
5
|
+
import { A as _, U as y, a as q, c as V, s as w, b as H, d as N } from "./ui-campo-texto-B_OHVGiN.js";
|
|
6
|
+
import { U as k, a as j, b as J } from "./ui-paleta-ferramentas-Ksh6gMW3.js";
|
|
7
|
+
import { U as W, a as X, b as Z, c as Q, d as Y, e as $ } from "./ui-badge-BWhoGgo9.js";
|
|
8
|
+
import { U as ra } from "./ui-card-BNYCQ7g-.js";
|
|
9
|
+
import { U as oa, a as sa, b as ta, r as ia } from "./ui-modal-BkYvNP0G.js";
|
|
10
|
+
import { I as ca, U as la, a as da, b as ma, c as ua, d as pa, e as Ia, f as Ua, g as Ca, h as Sa, i as Ta, j as Ea, k as ga, l as fa, o as Aa, r as xa } from "./ui-skeleton-B2Rgrv8o.js";
|
|
11
|
+
import { G as ba, T as La, a as Oa, b as Ra, U as va, c as za, d as Ma, e as Da, f as ha, g as Ba, h as Fa, i as _a, j as ya, k as qa, l as Va, m as wa, n as Ha, o as Na, p as Ga, q as ka, r as ja, s as Ja, t as Ka, u as Wa, v as Xa, w as Za, x as Qa, y as Ya, z as $a, A as ar, B as rr, C as er, D as or, E as sr, F as tr, H as ir, I as nr, J as cr, K as lr, L as dr, M as mr, N as ur, O as pr, P as Ir, Q as Ur, R as Cr, S as Sr, V as Tr, W as Er, X as gr, Y as fr, Z as Ar, _ as xr, $ as Pr, a0 as br, a1 as Lr, a2 as Or, a3 as Rr, a4 as vr, a5 as zr, a6 as Mr } from "./ui-tabela-propriedades-D9Echt2X.js";
|
|
12
|
+
import { ICONES_FERRAMENTAS as hr } from "./tools.js";
|
|
13
|
+
import { P as Fr, U as _r, a as yr, b as qr, c as Vr, e as wr, f as Hr, n as Nr, d as Gr } from "./ui-controle-cores-DgEza3wF.js";
|
|
14
|
+
import { CamadasDragDropManager as jr, ICONES as Jr, LIMITE_FEICOES_POR_CAMADA as Kr, MAPAS_BASE_PADRAO as Wr, UICamadas as Xr, UILayerPanel as Zr, UIPainelCamadas as Qr, calcularAreaAnelSimples as Yr, calcularAreaPoligono as $r, calcularComprimentoLinha as ae, calcularDistanciaPontos as re, calcularSelecaoFeicao as ee, carregarEstadoPersistido as oe, construirHierarquiaCamadas as se, converterCamadaItemParaCanvasLayer as te, converterCanvasLayerParaCamadaItem as ie, converterFeicaoParaItem as ne, escapeHtml as ce, filtrarFeicoesPorBusca as le, formatarMetricaFeicoes as de, formatarOpcoesCamadasHierarquicas as me, gerarChaveStorage as ue, limparEstadoPersistido as pe, montarEstadoPersistido as Ie, obterIdsVisiveisFeicoes as Ue, reidratarCamadasComOverrides as Ce, removerSelecoesInvalidas as Se, renderizarArvoreCamadas as Te, renderizarGridMapasBase as Ee, renderizarRodapeAcoes as ge, renderizarThumbGeometria as fe, salvarEstadoPersistido as Ae, snapshotCamada as xe } from "./camadas.js";
|
|
15
|
+
import { UIMapaBase as be, UISeletorMapaBase as Le } from "./seletor-mapa-base.js";
|
|
16
|
+
import { U as Re } from "./ui-bus-CUd99VJi.js";
|
|
17
|
+
import { i as r } from "./zero-js-triggers-CJT988bR.js";
|
|
18
|
+
import { L as ze } from "./listener-bag-DQgv7OON.js";
|
|
19
|
+
import { c as De, o as he } from "./leaflet-loader-Cjcdgj5R.js";
|
|
20
|
+
import { S as Fe, d as _e, i as ye } from "./ssr-safe-5cWfJP-s.js";
|
|
21
|
+
import { c as Ve, g as we, o as He } from "./acessibilidade-CUlSXc2X.js";
|
|
23
22
|
const s = () => import("./mapa.js"), t = () => import("./canvas.js");
|
|
24
23
|
if (typeof document < "u") {
|
|
25
24
|
const a = () => {
|
|
@@ -29,183 +28,185 @@ if (typeof document < "u") {
|
|
|
29
28
|
}
|
|
30
29
|
typeof document < "u" && r();
|
|
31
30
|
export {
|
|
32
|
-
|
|
31
|
+
_ as ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO,
|
|
33
32
|
m as ATRIBUTOS_OBSERVADOS_LISTA_FLUTUANTE,
|
|
34
33
|
b as ATRIBUTOS_OBSERVADOS_SEGMENTED,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
jr as CamadasDragDropManager,
|
|
35
|
+
ba as GerenciadorValoresPropriedades,
|
|
36
|
+
Jr as ICONES,
|
|
37
|
+
ca as ICONES_ALERTA,
|
|
38
|
+
hr as ICONES_FERRAMENTAS,
|
|
39
|
+
Kr as LIMITE_FEICOES_POR_CAMADA,
|
|
40
|
+
u as ListaFlutuantePosicionamento,
|
|
41
|
+
p as ListaFlutuanteTeclado,
|
|
42
|
+
ze as ListenerBag,
|
|
43
|
+
Wr as MAPAS_BASE_PADRAO,
|
|
44
|
+
Fr as PALETA_CORES_PADRAO,
|
|
46
45
|
I as RadioGrupoRegistry,
|
|
47
|
-
|
|
46
|
+
Fe as SafeHTMLElement,
|
|
48
47
|
L as SegmentedIndicadorController,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
La as TabelaOrquestradorDados,
|
|
49
|
+
Oa as TabelaRemotaController,
|
|
50
|
+
Ra as TabelaSelecaoController,
|
|
51
|
+
la as UIAlerta,
|
|
53
52
|
O as UIAvatar,
|
|
54
|
-
|
|
53
|
+
W as UIBadge,
|
|
55
54
|
c as UIBotao,
|
|
56
55
|
l as UIBotaoPrimario,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
Re as UIBus,
|
|
57
|
+
Xr as UICamadas,
|
|
58
|
+
y as UICampoTexto,
|
|
59
|
+
ra as UICard,
|
|
61
60
|
U as UICheckbox,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
X as UIChip,
|
|
62
|
+
_r as UIControleCores,
|
|
63
|
+
oa as UIDialog,
|
|
64
|
+
da as UIDrawer,
|
|
65
|
+
ma as UIEsqueleto,
|
|
66
|
+
ua as UIGaveta,
|
|
67
|
+
k as UIIcone,
|
|
68
|
+
q as UIInput,
|
|
69
|
+
Z as UIKpi,
|
|
70
|
+
Zr as UILayerPanel,
|
|
71
|
+
R as UILinha,
|
|
72
72
|
C as UIListaFlutuante,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
be as UIMapaBase,
|
|
74
|
+
Q as UIMetrica,
|
|
75
|
+
sa as UIModal,
|
|
76
|
+
Qr as UIPainelCamadas,
|
|
77
|
+
pa as UIPainelLateral,
|
|
78
|
+
j as UIPaletaFerramentas,
|
|
79
|
+
Ia as UIPopover,
|
|
80
80
|
S as UIRadio,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
J as UIRibbon,
|
|
82
|
+
v as UISegmented,
|
|
83
|
+
z as UISegmento,
|
|
84
|
+
T as UISelect,
|
|
85
|
+
yr as UISeletorCor,
|
|
86
|
+
Le as UISeletorMapaBase,
|
|
87
|
+
Ua as UISheet,
|
|
88
|
+
Ca as UISkeleton,
|
|
89
|
+
Y as UIStat,
|
|
90
|
+
E as UISwitch,
|
|
91
|
+
va as UITabela,
|
|
92
|
+
za as UITabelaPropriedades,
|
|
93
|
+
$ as UITag,
|
|
94
|
+
M as UITexto,
|
|
95
|
+
Sa as UIToast,
|
|
96
96
|
g as UIToggle,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
Ta as UITooltip,
|
|
98
|
+
Ma as abrirPopoverRedimensionamento,
|
|
99
|
+
qr as abrirSeletorCor,
|
|
100
|
+
Da as alternarCategoria,
|
|
101
|
+
ha as alternarDirecaoOrdenacao,
|
|
102
|
+
Ba as alternarPosicionamentoFlutuante,
|
|
103
|
+
ta as aplicarInertForaDoModal,
|
|
104
|
+
Fa as aplicarOrdenacaoTabela,
|
|
105
|
+
_a as atualizarCampoVisual,
|
|
106
106
|
f as atualizarEstadoSelecaoLista,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
Ea as atualizarScrollLockDrawer,
|
|
108
|
+
ya as avaliarExpressaoMatematica,
|
|
109
|
+
qa as buscarLinhaPropriedade,
|
|
110
|
+
Yr as calcularAreaAnelSimples,
|
|
111
|
+
$r as calcularAreaPoligono,
|
|
112
|
+
ae as calcularComprimentoLinha,
|
|
113
|
+
re as calcularDistanciaPontos,
|
|
114
|
+
ee as calcularSelecaoFeicao,
|
|
115
|
+
oe as carregarEstadoPersistido,
|
|
116
|
+
De as carregarLeaflet,
|
|
117
117
|
t as carregarModuloCanvas,
|
|
118
118
|
s as carregarModuloMapa,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
119
|
+
Ve as cliqueVeioDeRotuloExterno,
|
|
120
|
+
Va as colapsarTodasCategorias,
|
|
121
|
+
wa as conectarArrastoFlutuante,
|
|
122
|
+
Ha as conectarPainelControles,
|
|
123
|
+
se as construirHierarquiaCamadas,
|
|
124
|
+
te as converterCamadaItemParaCanvasLayer,
|
|
125
|
+
ie as converterCanvasLayerParaCamadaItem,
|
|
126
|
+
ne as converterFeicaoParaItem,
|
|
127
|
+
Vr as coresUnicas,
|
|
128
|
+
D as criarBotaoOpcao,
|
|
129
|
+
Na as criarControladorSplitter,
|
|
130
130
|
Ga as criarEditorAcao,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
131
|
+
ka as criarEditorBooleano,
|
|
132
|
+
ja as criarEditorCorCad,
|
|
133
|
+
Ja as criarEditorCorSwatch,
|
|
134
|
+
Ka as criarEditorLinetype,
|
|
135
|
+
Wa as criarEditorLineweight,
|
|
136
|
+
Xa as criarEditorNumero,
|
|
137
|
+
Za as criarEditorReadonly,
|
|
138
|
+
Qa as criarEditorSelecao,
|
|
139
|
+
Ya as criarEditorTexto,
|
|
140
|
+
$a as criarEditorValor,
|
|
141
|
+
ar as criarLinhaPropriedade,
|
|
142
|
+
V as criarTemplateCampoTexto,
|
|
143
143
|
A as criarTemplateListaFlutuante,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
144
|
+
h as criarTemplateSegmented,
|
|
145
|
+
_e as definirCustomElement,
|
|
146
|
+
wr as escaparHtml,
|
|
147
|
+
ce as escapeHtml,
|
|
148
|
+
rr as executarOrquestracaoCorpo,
|
|
149
|
+
er as executarOrquestracaoHeader,
|
|
150
|
+
or as executarRedimensionamentoColuna,
|
|
151
|
+
sr as executarRedimensionamentoTeclado,
|
|
152
|
+
tr as exibirPromptPopoverRedimensionamento,
|
|
153
|
+
ir as expandirTodasCategorias,
|
|
154
|
+
Hr as fecharSeletorCor,
|
|
155
|
+
le as filtrarFeicoesPorBusca,
|
|
156
|
+
nr as focarProximoEditor,
|
|
157
|
+
cr as formatWidth,
|
|
158
|
+
de as formatarMetricaFeicoes,
|
|
159
|
+
me as formatarOpcoesCamadasHierarquicas,
|
|
160
|
+
ue as gerarChaveStorage,
|
|
161
|
+
we as gerarIdUnico,
|
|
162
|
+
ga as gerenciarTabTrap,
|
|
163
|
+
lr as getAlignmentClass,
|
|
164
|
+
dr as getRowHeight,
|
|
165
|
+
mr as getTextAlign,
|
|
166
|
+
ur as inicializarScrollVirtualizacao,
|
|
167
167
|
pr as iniciarRedimensionamentoColuna,
|
|
168
168
|
r as initZeroJSTriggers,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
Ir as interpretarIndice,
|
|
170
|
+
ye as isBrowser,
|
|
171
|
+
fa as isTopMostDrawer,
|
|
172
|
+
Ur as limitarLarguraColuna,
|
|
173
173
|
pe as limparEstadoPersistido,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
Cr as localizarIndiceItem,
|
|
175
|
+
Ie as montarEstadoPersistido,
|
|
176
|
+
Sr as montarEstruturaDOM,
|
|
177
|
+
Nr as normalizarCor,
|
|
178
178
|
Gr as normalizarOpacidade,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
Tr as normalizarTexto,
|
|
180
|
+
Aa as obterElementosFocaveis,
|
|
181
|
+
Ue as obterIdsVisiveisFeicoes,
|
|
182
|
+
he as obterLeafletSincrono,
|
|
183
|
+
He as obterRotuloExterno,
|
|
184
184
|
Er as orquestrarEstruturaInicial,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Se as
|
|
192
|
-
|
|
193
|
-
xr as
|
|
185
|
+
gr as proximaDensidade,
|
|
186
|
+
fr as redimensionarColunaPorDelta,
|
|
187
|
+
Ar as registrarAtualizadorEditor,
|
|
188
|
+
xa as registrarToastNoBus,
|
|
189
|
+
Ce as reidratarCamadasComOverrides,
|
|
190
|
+
ia as removerInertForaDoModal,
|
|
191
|
+
Se as removerSelecoesInvalidas,
|
|
192
|
+
Te as renderizarArvoreCamadas,
|
|
193
|
+
xr as renderizarCategoriasETree,
|
|
194
|
+
Pr as renderizarCorpoTabela,
|
|
194
195
|
Ee as renderizarGridMapasBase,
|
|
195
|
-
|
|
196
|
+
br as renderizarHeaderTabela,
|
|
196
197
|
x as renderizarItensLista,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
198
|
+
ge as renderizarRodapeAcoes,
|
|
199
|
+
Lr as renderizarSeletorTipos,
|
|
200
|
+
fe as renderizarThumbGeometria,
|
|
201
|
+
Ae as salvarEstadoPersistido,
|
|
202
|
+
Or as sincronizarAtributosTabela,
|
|
203
|
+
w as sincronizarFeedbackErro,
|
|
204
|
+
H as sincronizarIconeSenha,
|
|
205
|
+
N as sincronizarLabelEPlaceholder,
|
|
206
|
+
Rr as sincronizarPainelControles,
|
|
207
|
+
vr as sincronizarSelect,
|
|
208
|
+
xe as snapshotCamada,
|
|
209
|
+
zr as tratarMudancaAtributoTabela,
|
|
210
|
+
B as tratarTecladoSegmented,
|
|
211
|
+
Mr as valoresIguais
|
|
211
212
|
};
|
package/dist/mapa.cjs
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=Object.defineProperty;var z=(r,e,t)=>e in r?I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>z(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const m=require("./leaflet-DcO7uRC-.cjs"),p=require("./ssr-safe-CiHD1adl.cjs"),y=require("./leaflet-loader-94z5VsdY.cjs"),_=":host{display:block;width:100%;height:400px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1))}.ui-mapa-container{width:100%;height:100%;z-index:1}.leaflet-top,.leaflet-bottom{z-index:1000}.ui-mapa-popup{font-family:inherit;font-size:13px;font-weight:500;color:#111827;padding:2px 4px}.ui-mapa-svg-pin,.ui-mapa-div-marker{background:transparent!important;border:none!important;cursor:pointer;transition:transform .15s ease,filter .15s ease}.ui-mapa-svg-pin:hover,.ui-mapa-div-marker:hover{transform:scale(1.15);filter:brightness(1.2)}";function d(){return y.obterLeafletSincrono()??null}async function E(){return await y.carregarLeaflet()??null}function L(r){return{osm:{nome:"OpenStreetMap",layer:()=>r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'})},satelite:{nome:"Satélite (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"})},topografia:{nome:"Topografia",layer:()=>r.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'})},ruas:{nome:"Ruas (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"})}}}const u={lat:-23.55052,lng:-46.633308,zoom:13},w="#00f5a0",O="#3388ff",k=3,c=r=>Number.isFinite(r);function v(r,e,t){const i=parseFloat(r??""),o=parseFloat(e??""),a=parseInt(t??"",10);return{lat:c(i)&&Math.abs(i)<=90?i:u.lat,lng:c(o)&&Math.abs(o)<=180?o:u.lng,zoom:c(a)&&a>=0&&a<=22?a:u.zoom}}function P(r,e){const t=parseInt(r??"",10);return c(t)&&t>0?t:e}const R=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,N=/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/deg-]+\)$/i,U=/^[a-z]{3,30}$/i;function T(r,e){const t=(r??"").trim();return R.test(t)||N.test(t)||U.test(t)?t:e}function D(r,e){const t=(r??"").split(",").map(i=>i.trim().toLowerCase()).filter(i=>e.includes(i));return t.length>0?t:["osm"]}function A(r){if(!r)return[];let e;try{e=JSON.parse(r)}catch(i){return console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"',i),[]}if(!Array.isArray(e))return[];const t=[];for(const i of e){if(!Array.isArray(i)||i.length<2)continue;const[o,a]=i;typeof o=="number"&&typeof a=="number"&&c(o)&&c(a)&&Math.abs(o)<=90&&Math.abs(a)<=180&&t.push([o,a])}return t}const G="Mapa",H=`
|
|
2
|
+
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
|
|
3
|
+
<span style="font-size: 20px; margin-bottom: 6px;" aria-hidden="true">🗺️</span>
|
|
4
|
+
<strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
|
|
5
|
+
<span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code><ui-mapa></code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code><script src=".../leaflet.js"></script></code>.</span>
|
|
6
|
+
</div>
|
|
7
|
+
`;class M extends p.SafeHTMLElement{constructor(){super();s(this,"mapContainer");s(this,"mapInstance",null);s(this,"_initTimer",null);s(this,"_resizeObserver");s(this,"_resizeTimer");s(this,"_invalidarTimer");const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
8
|
<style>
|
|
3
|
-
${
|
|
4
|
-
${
|
|
9
|
+
${m.leafletCss}
|
|
10
|
+
${_}
|
|
5
11
|
</style>
|
|
6
|
-
<div class="ui-mapa-container" id="map-container"></div>
|
|
12
|
+
<div class="ui-mapa-container" id="map-container" role="region"></div>
|
|
7
13
|
<div style="display: none;"><slot></slot></div>
|
|
8
|
-
`,this.mapContainer=t.getElementById("map-container")}static get observedAttributes(){return["lat","lng","zoom"]}connectedCallback(){this._initTimer=
|
|
9
|
-
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
|
|
10
|
-
<span style="font-size: 20px; margin-bottom: 6px;">🗺️</span>
|
|
11
|
-
<strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
|
|
12
|
-
<span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code><ui-mapa></code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code><script src=".../leaflet.js"></script></code>.</span>
|
|
13
|
-
</div>
|
|
14
|
-
`;return}const e=I(t),r=parseFloat(this.getAttribute("lat")||"-23.550520"),i=parseFloat(this.getAttribute("lng")||"-46.633308"),s=parseInt(this.getAttribute("zoom")||"13",10);this.mapInstance=t.map(this.mapContainer).setView([r,i],s);const c=this.getAttribute("camadas");let l=["osm"];c&&(l=c.split(",").map(p=>p.trim().toLowerCase()).filter(p=>e[p]),l.length===0&&(l=["osm"]));const f=e[l[0]].layer();if(f.addTo(this.mapInstance),l.length>1){const p={};p[e[l[0]].nome]=f;for(let u=1;u<l.length;u++){const b=l[u];p[e[b].nome]=e[b].layer()}t.control.layers(p,void 0,{position:"topright"}).addTo(this.mapInstance)}(g=t.Icon)!=null&&g.Default&&(t.Icon.Default.imagePath="https://unpkg.com/leaflet@1.9.4/dist/images/"),typeof ResizeObserver<"u"&&this.mapContainer&&(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{this.mapInstance&&this.mapInstance.invalidateSize()},60)}),this._resizeObserver.observe(this.mapContainer)),setTimeout(()=>{this.mapInstance&&this.mapInstance.invalidateSize()},100),this.dispatchEvent(new CustomEvent("ui-mapa-pronto",{detail:{map:this.mapInstance},bubbles:!0,composed:!0}))}getMap(){return this.mapInstance}}m.definirCustomElement("ui-mapa",y);class v extends m.SafeHTMLElement{constructor(){super(...arguments);a(this,"marker",null);a(this,"_initTimer",null);a(this,"_retryCount",0);a(this,"_parentMap",null);a(this,"handleMapReady",()=>{this.marker&&(this.marker.remove(),this.marker=null),this.initMarker()})}static get observedAttributes(){return["lat","lng","titulo","cor","formato"]}connectedCallback(){this._parentMap=this.closest("ui-mapa"),this._parentMap&&this._parentMap.addEventListener("ui-mapa-pronto",this.handleMapReady),this._initTimer=setTimeout(()=>this.initMarker(),0)}disconnectedCallback(){this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),this._parentMap&&(this._parentMap.removeEventListener("ui-mapa-pronto",this.handleMapReady),this._parentMap=null),this.marker&&(this.marker.remove(),this.marker=null)}attributeChangedCallback(t,e,r){if(e!==r&&this.marker){if(t==="lat"||t==="lng"){const i=d.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));i&&this.marker.setLatLng([i.lat,i.lon])}if(t==="titulo"&&(this.marker.unbindPopup(),r&&this.marker.bindPopup(this.createPopupContent(r))),t==="cor"||t==="formato"){const i=h.obterLeafletSincrono()||window.L;i&&this.marker.setIcon(this.createIcon(i))}}}createPopupContent(t){const e=document.createElement("div");return e.className="ui-mapa-popup",e.textContent=t,e}createIcon(t){const e=this.getAttribute("cor")||"#00f5a0";if((this.getAttribute("formato")||"pin")==="circle"){const s=`<div style="width:14px; height:14px; background-color:${e}; border-radius:50%; border:2px solid #ffffff; box-shadow:0 1px 4px rgba(0,0,0,0.6);"></div>`;return t.divIcon({className:"ui-mapa-div-marker",html:s,iconSize:[14,14],iconAnchor:[7,7]})}const i=`
|
|
15
|
-
<svg width="24" height="32" viewBox="0 0 24 32" fill="none" xmlns="http://www.w3.org/2000/svg" style="filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45));">
|
|
16
|
-
<path d="M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z" fill="${e}"/>
|
|
17
|
-
<circle cx="12" cy="11" r="4.5" fill="#ffffff"/>
|
|
18
|
-
</svg>
|
|
19
|
-
`;return t.divIcon({className:"ui-mapa-svg-pin",html:i,iconSize:[24,32],iconAnchor:[12,32],popupAnchor:[0,-30]})}initMarker(){const t=this._parentMap||this.closest("ui-mapa");if(!t){console.warn("<ui-mapa-marcador> deve estar dentro de um elemento <ui-mapa>");return}const e=t.getMap();if(!e){if(this._retryCount>=30){console.warn("<ui-mapa-marcador> Tempo limite esgotado aguardando inicialização do mapa pai.");return}this._retryCount++,this._initTimer=setTimeout(()=>this.initMarker(),50);return}this._retryCount=0;const r=d.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));if(!r)return;const i=this.getAttribute("titulo"),s=h.obterLeafletSincrono()||window.L;s&&(this.marker=s.marker([r.lat,r.lon],{icon:this.createIcon(s)}),this.marker&&(i&&this.marker.bindPopup(this.createPopupContent(i)),this.marker.addTo(e)))}}m.definirCustomElement("ui-mapa-marcador",v);class T extends m.SafeHTMLElement{constructor(){super(...arguments);a(this,"polyline",null);a(this,"_initTimer",null);a(this,"_retryCount",0)}static get observedAttributes(){return["pontos","cor","espessura"]}connectedCallback(){this._initTimer=setTimeout(()=>this.initLinha(),0)}disconnectedCallback(){this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),this.polyline&&(this.polyline.remove(),this.polyline=null)}attributeChangedCallback(t,e,r){e!==r&&this.polyline&&(t==="pontos"?this.polyline.setLatLngs(this.getPontos()):(t==="cor"||t==="espessura")&&this.polyline.setStyle({color:this.getAttribute("cor")||"#3388ff",weight:parseInt(this.getAttribute("espessura")||"3",10)}))}getPontos(){try{const t=this.getAttribute("pontos");if(t)return JSON.parse(t)}catch(t){console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"',t)}return[]}initLinha(){const t=this.closest("ui-mapa");if(!t){console.warn("<ui-mapa-linha> deve estar dentro de um elemento <ui-mapa>");return}const e=t.getMap();if(!e){if(this._retryCount>=30){console.warn("<ui-mapa-linha> Tempo limite esgotado aguardando inicialização do mapa pai.");return}this._retryCount++,this._initTimer=setTimeout(()=>this.initLinha(),50);return}this._retryCount=0;const r=this.getAttribute("cor")||"#3388ff",i=parseInt(this.getAttribute("espessura")||"3",10),s=h.obterLeafletSincrono()||window.L;s&&(this.polyline=s.polyline(this.getPontos(),{color:r,weight:i}),this.polyline&&this.polyline.addTo(e))}}m.definirCustomElement("ui-mapa-linha",T);exports.UIMapa=y;exports.UIMapaLinha=T;exports.UIMapaMarcador=v;
|
|
14
|
+
`,this.mapContainer=t.getElementById("map-container"),this.sincronizarRotulo()}static get observedAttributes(){return["lat","lng","zoom","aria-label"]}connectedCallback(){this.sincronizarRotulo(),this._initTimer=setTimeout(()=>{this._initTimer=null,this.initMap()},0)}disconnectedCallback(){var t;this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),(t=this._resizeObserver)==null||t.disconnect(),this._resizeObserver=void 0,this._resizeTimer&&clearTimeout(this._resizeTimer),this._invalidarTimer&&clearTimeout(this._invalidarTimer),this._resizeTimer=void 0,this._invalidarTimer=void 0,this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}attributeChangedCallback(t,i,o){if(i!==o){if(t==="aria-label"){this.sincronizarRotulo();return}if(this.mapInstance){const a=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom"));this.mapInstance.setView([a.lat,a.lng],a.zoom)}}}sincronizarRotulo(){var t;(t=this.mapContainer)==null||t.setAttribute("aria-label",this.getAttribute("aria-label")||G)}async initMap(){var b;if(this.mapInstance)return;const t=await E();if(!this.isConnected||this.mapInstance)return;if(!t){this.mapContainer.innerHTML=H;return}const i=L(t),o=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom")),a=t.map(this.mapContainer).setView([o.lat,o.lng],o.zoom);this.mapInstance=a;const n=D(this.getAttribute("camadas"),Object.keys(i)),f=i[n[0]].layer();if(f.addTo(a),n.length>1){const l={[i[n[0]].nome]:f};for(const g of n.slice(1))l[i[g].nome]=i[g].layer();t.control.layers(l,void 0,{position:"topright"}).addTo(a)}(b=t.Icon)!=null&&b.Default&&(t.Icon.Default.imagePath="https://unpkg.com/leaflet@1.9.4/dist/images/"),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{var l;return(l=this.mapInstance)==null?void 0:l.invalidateSize()},60)}),this._resizeObserver.observe(this.mapContainer)),this._invalidarTimer=setTimeout(()=>{var l;return(l=this.mapInstance)==null?void 0:l.invalidateSize()},100),this.dispatchEvent(new CustomEvent("ui-mapa-pronto",{detail:{map:a},bubbles:!0,composed:!0}))}getMap(){return this.mapInstance}}p.definirCustomElement("ui-mapa",M);const h="http://www.w3.org/2000/svg";function V(r){const e=document.createElement("div");return e.style.cssText="width:14px;height:14px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 1px 4px rgba(0,0,0,0.6);",e.style.backgroundColor=r,e}function $(r){const e=document.createElementNS(h,"svg");e.setAttribute("width","24"),e.setAttribute("height","32"),e.setAttribute("viewBox","0 0 24 32"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true"),e.style.filter="drop-shadow(0 2px 4px rgba(0,0,0,0.45))";const t=document.createElementNS(h,"path");t.setAttribute("d","M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z"),t.setAttribute("fill",r);const i=document.createElementNS(h,"circle");return i.setAttribute("cx","12"),i.setAttribute("cy","11"),i.setAttribute("r","4.5"),i.setAttribute("fill","#ffffff"),e.append(t,i),e}function F(r,e,t){return t==="circle"?r.divIcon({className:"ui-mapa-div-marker",html:V(e),iconSize:[14,14],iconAnchor:[7,7]}):r.divIcon({className:"ui-mapa-svg-pin",html:$(e),iconSize:[24,32],iconAnchor:[12,32],popupAnchor:[0,-30]})}const j=30,q=50;class C{constructor(e,t){s(this,"pai",null);s(this,"timer",null);s(this,"tentativas",0);s(this,"aoPronto",()=>{this.opcoes.aoPerderMapa(),this.tentativas=0,this.tentar()});this.host=e,this.opcoes=t}conectar(){var e;this.desconectar(),this.pai=this.host.closest("ui-mapa"),(e=this.pai)==null||e.addEventListener("ui-mapa-pronto",this.aoPronto),this.agendar(0)}desconectar(){var e;this.timer&&clearTimeout(this.timer),this.timer=null,(e=this.pai)==null||e.removeEventListener("ui-mapa-pronto",this.aoPronto),this.pai=null,this.tentativas=0}agendar(e){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>this.tentar(),e)}tentar(){this.timer=null;const e=this.pai??this.host.closest("ui-mapa");if(!e){console.warn(`<${this.opcoes.rotulo}> deve estar dentro de um elemento <ui-mapa>`);return}const t=e.getMap();if(!t){if(this.tentativas>=j){console.warn(`<${this.opcoes.rotulo}> Tempo limite esgotado aguardando inicialização do mapa pai.`);return}this.tentativas++,this.agendar(q);return}this.tentativas=0,this.opcoes.aoMapa(t)}}class S extends p.SafeHTMLElement{constructor(){super(...arguments);s(this,"marker",null);s(this,"vinculo",new C(this,{rotulo:"ui-mapa-marcador",aoMapa:t=>this.criarMarcador(t),aoPerderMapa:()=>this.removerMarcador()}))}static get observedAttributes(){return["lat","lng","titulo","cor","formato"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerMarcador()}attributeChangedCallback(t,i,o){if(!(i===o||!this.marker)){if(t==="lat"||t==="lng"){const a=m.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));a&&this.marker.setLatLng([a.lat,a.lon])}else if(t==="titulo")this.marker.unbindPopup(),o&&this.marker.bindPopup(this.createPopupContent(o)),this.aplicarNomeAcessivel();else if(t==="cor"||t==="formato"){const a=d();a&&this.marker.setIcon(this.createIcon(a))}}}removerMarcador(){var t;(t=this.marker)==null||t.remove(),this.marker=null}createPopupContent(t){const i=document.createElement("div");return i.className="ui-mapa-popup",i.textContent=t,i}createIcon(t){const i=this.getAttribute("formato")==="circle"?"circle":"pin";return F(t,T(this.getAttribute("cor"),w),i)}aplicarNomeAcessivel(){var o;const t=(o=this.marker)==null?void 0:o.getElement();if(!t)return;const i=this.getAttribute("titulo");i?(t.setAttribute("aria-label",i),t.setAttribute("title",i)):(t.removeAttribute("aria-label"),t.removeAttribute("title"))}criarMarcador(t){this.removerMarcador();const i=m.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));if(!i)return;const o=d();if(!o)return;const a=this.getAttribute("titulo"),n=o.marker([i.lat,i.lon],{icon:this.createIcon(o),keyboard:!0,title:a||void 0});a&&n.bindPopup(this.createPopupContent(a)),n.addTo(t),this.marker=n,this.aplicarNomeAcessivel()}}p.definirCustomElement("ui-mapa-marcador",S);class x extends p.SafeHTMLElement{constructor(){super(...arguments);s(this,"polyline",null);s(this,"vinculo",new C(this,{rotulo:"ui-mapa-linha",aoMapa:t=>this.criarLinha(t),aoPerderMapa:()=>this.removerLinha()}))}static get observedAttributes(){return["pontos","cor","espessura"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerLinha()}attributeChangedCallback(t,i,o){i===o||!this.polyline||(t==="pontos"?this.polyline.setLatLngs(A(this.getAttribute("pontos"))):this.polyline.setStyle(this.estilo()))}estilo(){return{color:T(this.getAttribute("cor"),O),weight:P(this.getAttribute("espessura"),k)}}removerLinha(){var t;(t=this.polyline)==null||t.remove(),this.polyline=null}criarLinha(t){this.removerLinha();const i=d();i&&(this.polyline=i.polyline(A(this.getAttribute("pontos")),this.estilo()).addTo(t))}}p.definirCustomElement("ui-mapa-linha",x);exports.UIMapa=M;exports.UIMapaLinha=x;exports.UIMapaMarcador=S;
|