@thibezer/ui-components-kit 2.8.1 → 2.8.2
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 +22 -103
- package/README.md +8 -32
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +110 -114
- package/dist/camadas.js +1177 -1343
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +63 -64
- package/dist/canvas.js +3544 -4025
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-avatar/ui-avatar.d.ts +0 -11
- package/dist/components/ui-badge/ui-badge.d.ts +0 -2
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -1
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +31 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +17 -1
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +0 -2
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +11 -4
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +1 -13
- package/dist/components/ui-camadas/camadas-host.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +1 -3
- package/dist/components/ui-camadas/camadas-selecao.d.ts +0 -12
- package/dist/components/ui-camadas/ui-camadas.d.ts +5 -8
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +1 -2
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +8 -3
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +106 -39
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +1 -3
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +1 -15
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +1 -4
- package/dist/components/ui-cores/tipos.d.ts +0 -2
- package/dist/components/ui-cores/ui-controle-cores.d.ts +3 -8
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +1 -3
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +5 -12
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +6 -15
- package/dist/components/ui-mapa/ui-mapa.d.ts +1 -14
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/ui-modal.d.ts +11 -1
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +0 -10
- package/dist/components/ui-radio/ui-radio.d.ts +2 -9
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +0 -9
- package/dist/components/ui-switch/ui-switch.d.ts +1 -3
- package/dist/components/ui-tabela/ui-tabela.d.ts +19 -1
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +1 -24
- package/dist/core/index.d.ts +0 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +18 -28
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +1 -1
- package/dist/custom-elements.json +13585 -18764
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/form-validacao-BIOXxt-1.js +140 -0
- package/dist/form-validacao-ytRYSF3E.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +1 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +0 -2
- package/dist/gerencigeo-canvas/mapa_core.d.ts +0 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +176 -179
- package/dist/mapa.cjs +16 -11
- package/dist/mapa.js +170 -242
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +11 -11
- package/dist/svg-seguro-ChVJ2L2z.js +74 -0
- package/dist/svg-seguro-J2RM1Ssf.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +20 -48
- package/dist/tipos-react.d.ts +0 -2
- package/dist/tipos-vue.d.ts +15 -44
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BxT-sDmV.cjs +28 -0
- package/dist/ui-badge-C0eKBI8E.js +183 -0
- package/dist/ui-botao-BOOnP8ds.cjs +12 -0
- package/dist/ui-botao-DfqSivHl.js +165 -0
- package/dist/ui-botao-OGJV6Vfk.js +165 -0
- package/dist/ui-botao-psS1juof.cjs +12 -0
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
- package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-Uu2dJE_0.js} +51 -51
- package/dist/ui-card-B86lJXTP.cjs +20 -0
- package/dist/{ui-card-BNYCQ7g-.js → ui-card-C_o5_0cB.js} +42 -50
- package/dist/ui-controle-cores-BS0WYPdi.js +572 -0
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +111 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-modal-CvGFGh1h.cjs +18 -0
- package/dist/{ui-modal-BkYvNP0G.js → ui-modal-DBOtSTbR.js} +140 -116
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +624 -0
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +1171 -0
- package/dist/{ui-paleta-ferramentas-bDLPbiGA.cjs → ui-paleta-ferramentas-Ccmo-rB5.cjs} +7 -7
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +21 -0
- package/dist/{ui-paleta-ferramentas-Ksh6gMW3.js → ui-paleta-ferramentas-DNN5i6nL.js} +329 -359
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +18 -0
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +1173 -0
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +21 -0
- package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
- package/dist/ui-segmented-DyF5YLsV.js +418 -0
- package/dist/ui-segmented-rn9RxRGM.cjs +19 -0
- package/dist/{ui-linha-nCDh2wPm.js → ui-segmented-wUraId2e.js} +105 -200
- package/dist/ui-skeleton-DI4_9WOX.js +428 -0
- package/dist/{ui-skeleton-DiOxTBZK.cjs → ui-skeleton-SPYqku8P.cjs} +10 -10
- package/dist/{ui-skeleton-B2Rgrv8o.js → ui-skeleton-W9uwIceA.js} +191 -254
- package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
- package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BcOqOkiV.js} +128 -187
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/{ui-tabela-propriedades-DzZlyNZ_.cjs → ui-tabela-propriedades-BecPqC-e.cjs} +10 -10
- package/dist/{ui-tabela-propriedades-D9Echt2X.js → ui-tabela-propriedades-BokvDD3b.js} +826 -845
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +141 -0
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +2648 -0
- package/dist/ui-toast-Bp_NlM5G.js +156 -0
- package/dist/ui-toast-DGTZKne5.cjs +20 -0
- package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
- package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
- package/package.json +3 -3
- package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
- package/dist/acessibilidade-CUlSXc2X.js +0 -38
- package/dist/altura-controle-ukMRPckR.cjs +0 -1
- package/dist/altura-controle-vxQiXG4q.js +0 -62
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +0 -16
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +0 -24
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +0 -14
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +0 -17
- package/dist/components/ui-camadas/camadas-colecao.d.ts +0 -27
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +0 -31
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +0 -10
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +0 -34
- package/dist/components/ui-camadas/camadas-render.d.ts +0 -15
- package/dist/components/ui-camadas/camadas-renomear.d.ts +0 -12
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +0 -17
- package/dist/components/ui-camadas/camadas-thumb.d.ts +0 -1
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +0 -15
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +0 -22
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +0 -26
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +0 -21
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +0 -39
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +0 -68
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +0 -37
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +0 -48
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +0 -28
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +0 -22
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +0 -53
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +0 -33
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +0 -5
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +0 -5
- package/dist/components/ui-canvas-cad/tipos.d.ts +0 -37
- package/dist/components/ui-linha/index.d.ts +0 -1
- package/dist/components/ui-linha/ui-linha.d.ts +0 -48
- package/dist/components/ui-mapa/mapa-atributos.d.ts +0 -14
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +0 -7
- package/dist/components/ui-mapa/mapa-icones.d.ts +0 -4
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +0 -5
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +0 -22
- package/dist/components/ui-mapa/tipos.d.ts +0 -13
- package/dist/components/ui-modal/modal-foco.d.ts +0 -28
- package/dist/components/ui-tabela/tabela-estados.d.ts +0 -16
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +0 -44
- package/dist/components/ui-tabela/tabela-teclado.d.ts +0 -16
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +0 -7
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +0 -29
- package/dist/core/altura-controle.d.ts +0 -34
- package/dist/core/opcoes.d.ts +0 -9
- package/dist/core/rotulo-controle.d.ts +0 -13
- package/dist/form-validacao-BlQFxUVj.js +0 -104
- package/dist/form-validacao-DIeyQVH5.cjs +0 -1
- package/dist/gerencigeo-canvas/popup_gate.d.ts +0 -30
- package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +0 -10
- package/dist/opcoes-CJYLi6kd.js +0 -12
- package/dist/opcoes-CkyDxBuQ.cjs +0 -1
- package/dist/ui-badge-BWhoGgo9.js +0 -197
- package/dist/ui-badge-SIR81R9l.cjs +0 -28
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
- package/dist/ui-card-BrjBL-yo.cjs +0 -20
- package/dist/ui-controle-cores-DgEza3wF.js +0 -612
- package/dist/ui-controle-cores-uY__TgwW.cjs +0 -117
- package/dist/ui-linha-C6HBnsaw.cjs +0 -19
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-switch-D9a8XlVX.cjs +0 -53
package/dist/mapa.js
CHANGED
|
@@ -1,166 +1,111 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var T = (s, n, t) => n in s ? v(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;
|
|
3
|
+
var a = (s, n, t) => T(s, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return I() ?? null;
|
|
11
|
-
}
|
|
12
|
-
async function E() {
|
|
13
|
-
return await S() ?? null;
|
|
14
|
-
}
|
|
15
|
-
function w(r) {
|
|
5
|
+
import { c as _, o as h } from "./leaflet-loader-Cjcdgj5R.js";
|
|
6
|
+
import { l as x, p as y } from "./leaflet-PPDKB6Dd.js";
|
|
7
|
+
import { d as u, S as d } from "./ssr-safe-5cWfJP-s.js";
|
|
8
|
+
const M = ":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)}";
|
|
9
|
+
function w(s) {
|
|
16
10
|
return {
|
|
17
11
|
osm: {
|
|
18
12
|
nome: "OpenStreetMap",
|
|
19
|
-
layer: () =>
|
|
13
|
+
layer: () => s.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
|
20
14
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
21
15
|
})
|
|
22
16
|
},
|
|
23
17
|
satelite: {
|
|
24
18
|
nome: "Satélite (Esri)",
|
|
25
|
-
layer: () =>
|
|
19
|
+
layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
|
|
26
20
|
attribution: "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
|
|
27
21
|
})
|
|
28
22
|
},
|
|
29
23
|
topografia: {
|
|
30
24
|
nome: "Topografia",
|
|
31
|
-
layer: () =>
|
|
25
|
+
layer: () => s.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
|
|
32
26
|
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>)'
|
|
33
27
|
})
|
|
34
28
|
},
|
|
35
29
|
ruas: {
|
|
36
30
|
nome: "Ruas (Esri)",
|
|
37
|
-
layer: () =>
|
|
31
|
+
layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {
|
|
38
32
|
attribution: "Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"
|
|
39
33
|
})
|
|
40
34
|
}
|
|
41
35
|
};
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
function A(r, e, t) {
|
|
45
|
-
const i = parseFloat(r ?? ""), o = parseFloat(e ?? ""), a = parseInt(t ?? "", 10);
|
|
46
|
-
return {
|
|
47
|
-
lat: l(i) && Math.abs(i) <= 90 ? i : p.lat,
|
|
48
|
-
lng: l(o) && Math.abs(o) <= 180 ? o : p.lng,
|
|
49
|
-
zoom: l(a) && a >= 0 && a <= 22 ? a : p.zoom
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function P(r, e) {
|
|
53
|
-
const t = parseInt(r ?? "", 10);
|
|
54
|
-
return l(t) && t > 0 ? t : e;
|
|
55
|
-
}
|
|
56
|
-
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, D = /^[a-z]{3,30}$/i;
|
|
57
|
-
function T(r, e) {
|
|
58
|
-
const t = (r ?? "").trim();
|
|
59
|
-
return R.test(t) || N.test(t) || D.test(t) ? t : e;
|
|
60
|
-
}
|
|
61
|
-
function G(r, e) {
|
|
62
|
-
const t = (r ?? "").split(",").map((i) => i.trim().toLowerCase()).filter((i) => e.includes(i));
|
|
63
|
-
return t.length > 0 ? t : ["osm"];
|
|
64
|
-
}
|
|
65
|
-
function y(r) {
|
|
66
|
-
if (!r) return [];
|
|
67
|
-
let e;
|
|
68
|
-
try {
|
|
69
|
-
e = JSON.parse(r);
|
|
70
|
-
} catch (i) {
|
|
71
|
-
return console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"', i), [];
|
|
72
|
-
}
|
|
73
|
-
if (!Array.isArray(e)) return [];
|
|
74
|
-
const t = [];
|
|
75
|
-
for (const i of e) {
|
|
76
|
-
if (!Array.isArray(i) || i.length < 2) continue;
|
|
77
|
-
const [o, a] = i;
|
|
78
|
-
typeof o == "number" && typeof a == "number" && l(o) && l(a) && Math.abs(o) <= 90 && Math.abs(a) <= 180 && t.push([o, a]);
|
|
79
|
-
}
|
|
80
|
-
return t;
|
|
81
|
-
}
|
|
82
|
-
const U = "Mapa", V = `
|
|
83
|
-
<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));">
|
|
84
|
-
<span style="font-size: 20px; margin-bottom: 6px;" aria-hidden="true">🗺️</span>
|
|
85
|
-
<strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
|
|
86
|
-
<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>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
|
89
|
-
class H extends d {
|
|
37
|
+
class C extends d {
|
|
90
38
|
constructor() {
|
|
91
39
|
super();
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
s(this, "_invalidarTimer");
|
|
40
|
+
a(this, "mapContainer");
|
|
41
|
+
a(this, "mapInstance", null);
|
|
42
|
+
a(this, "_initTimer", null);
|
|
43
|
+
a(this, "_resizeObserver");
|
|
44
|
+
a(this, "_resizeTimer");
|
|
98
45
|
const t = this.attachShadow({ mode: "open" });
|
|
99
46
|
t.innerHTML = `
|
|
100
47
|
<style>
|
|
101
|
-
${
|
|
102
|
-
${
|
|
48
|
+
${x}
|
|
49
|
+
${M}
|
|
103
50
|
</style>
|
|
104
|
-
<div class="ui-mapa-container" id="map-container"
|
|
51
|
+
<div class="ui-mapa-container" id="map-container"></div>
|
|
105
52
|
<div style="display: none;"><slot></slot></div>
|
|
106
|
-
`, this.mapContainer = t.getElementById("map-container")
|
|
53
|
+
`, this.mapContainer = t.getElementById("map-container");
|
|
107
54
|
}
|
|
108
55
|
static get observedAttributes() {
|
|
109
|
-
return ["lat", "lng", "zoom"
|
|
56
|
+
return ["lat", "lng", "zoom"];
|
|
110
57
|
}
|
|
111
58
|
connectedCallback() {
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
59
|
+
this._initTimer = window.setTimeout(() => {
|
|
60
|
+
this.initMap();
|
|
114
61
|
}, 0);
|
|
115
62
|
}
|
|
116
63
|
disconnectedCallback() {
|
|
117
|
-
|
|
118
|
-
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);
|
|
64
|
+
this._initTimer && (window.clearTimeout(this._initTimer), this._initTimer = null), this._resizeObserver && (this._resizeObserver.disconnect(), this._resizeObserver = void 0), this._resizeTimer && (window.clearTimeout(this._resizeTimer), this._resizeTimer = null), this.mapInstance && (this.mapInstance.remove(), this.mapInstance = null);
|
|
119
65
|
}
|
|
120
|
-
attributeChangedCallback(t,
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (this.mapInstance) {
|
|
127
|
-
const a = A(this.getAttribute("lat"), this.getAttribute("lng"), this.getAttribute("zoom"));
|
|
128
|
-
this.mapInstance.setView([a.lat, a.lng], a.zoom);
|
|
129
|
-
}
|
|
66
|
+
attributeChangedCallback(t, e, r) {
|
|
67
|
+
if (e !== r && this.mapInstance) {
|
|
68
|
+
const i = parseFloat(this.getAttribute("lat") || "-23.550520"), o = parseFloat(this.getAttribute("lng") || "-46.633308"), c = parseInt(this.getAttribute("zoom") || "13", 10);
|
|
69
|
+
!isNaN(i) && !isNaN(o) && this.mapInstance.setView([i, o], c);
|
|
130
70
|
}
|
|
131
71
|
}
|
|
132
|
-
/** Nome acessível da região: o `aria-label` do host ou "Mapa". */
|
|
133
|
-
sincronizarRotulo() {
|
|
134
|
-
var t;
|
|
135
|
-
(t = this.mapContainer) == null || t.setAttribute("aria-label", this.getAttribute("aria-label") || U);
|
|
136
|
-
}
|
|
137
72
|
async initMap() {
|
|
138
|
-
var
|
|
73
|
+
var g;
|
|
139
74
|
if (this.mapInstance) return;
|
|
140
|
-
const t = await
|
|
141
|
-
if (!this.isConnected || this.mapInstance) return;
|
|
75
|
+
const t = await _();
|
|
142
76
|
if (!t) {
|
|
143
|
-
this.mapContainer.innerHTML =
|
|
77
|
+
this.mapContainer.innerHTML = `
|
|
78
|
+
<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));">
|
|
79
|
+
<span style="font-size: 20px; margin-bottom: 6px;">🗺️</span>
|
|
80
|
+
<strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
|
|
81
|
+
<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>
|
|
82
|
+
</div>
|
|
83
|
+
`;
|
|
144
84
|
return;
|
|
145
85
|
}
|
|
146
|
-
const
|
|
147
|
-
this.mapInstance =
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
86
|
+
const e = w(t), r = parseFloat(this.getAttribute("lat") || "-23.550520"), i = parseFloat(this.getAttribute("lng") || "-46.633308"), o = parseInt(this.getAttribute("zoom") || "13", 10);
|
|
87
|
+
this.mapInstance = t.map(this.mapContainer).setView([r, i], o);
|
|
88
|
+
const c = this.getAttribute("camadas");
|
|
89
|
+
let p = ["osm"];
|
|
90
|
+
c && (p = c.split(",").map((l) => l.trim().toLowerCase()).filter((l) => e[l]), p.length === 0 && (p = ["osm"]));
|
|
91
|
+
const f = e[p[0]].layer();
|
|
92
|
+
if (f.addTo(this.mapInstance), p.length > 1) {
|
|
93
|
+
const l = {};
|
|
94
|
+
l[e[p[0]].nome] = f;
|
|
95
|
+
for (let m = 1; m < p.length; m++) {
|
|
96
|
+
const b = p[m];
|
|
97
|
+
l[e[b].nome] = e[b].layer();
|
|
98
|
+
}
|
|
99
|
+
t.control.layers(l, void 0, { position: "topright" }).addTo(this.mapInstance);
|
|
153
100
|
}
|
|
154
|
-
(
|
|
101
|
+
(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(() => {
|
|
155
102
|
this._resizeTimer && clearTimeout(this._resizeTimer), this._resizeTimer = setTimeout(() => {
|
|
156
|
-
|
|
157
|
-
return (c = this.mapInstance) == null ? void 0 : c.invalidateSize();
|
|
103
|
+
this.mapInstance && this.mapInstance.invalidateSize();
|
|
158
104
|
}, 60);
|
|
159
|
-
}), this._resizeObserver.observe(this.mapContainer)),
|
|
160
|
-
|
|
161
|
-
return (c = this.mapInstance) == null ? void 0 : c.invalidateSize();
|
|
105
|
+
}), this._resizeObserver.observe(this.mapContainer)), setTimeout(() => {
|
|
106
|
+
this.mapInstance && this.mapInstance.invalidateSize();
|
|
162
107
|
}, 100), this.dispatchEvent(new CustomEvent("ui-mapa-pronto", {
|
|
163
|
-
detail: { map:
|
|
108
|
+
detail: { map: this.mapInstance },
|
|
164
109
|
bubbles: !0,
|
|
165
110
|
composed: !0
|
|
166
111
|
}));
|
|
@@ -169,168 +114,151 @@ class H extends d {
|
|
|
169
114
|
return this.mapInstance;
|
|
170
115
|
}
|
|
171
116
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
function $(r) {
|
|
175
|
-
const e = document.createElement("div");
|
|
176
|
-
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;
|
|
177
|
-
}
|
|
178
|
-
function F(r) {
|
|
179
|
-
const e = document.createElementNS(u, "svg");
|
|
180
|
-
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))";
|
|
181
|
-
const t = document.createElementNS(u, "path");
|
|
182
|
-
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);
|
|
183
|
-
const i = document.createElementNS(u, "circle");
|
|
184
|
-
return i.setAttribute("cx", "12"), i.setAttribute("cy", "11"), i.setAttribute("r", "4.5"), i.setAttribute("fill", "#ffffff"), e.append(t, i), e;
|
|
185
|
-
}
|
|
186
|
-
function B(r, e, t) {
|
|
187
|
-
return t === "circle" ? r.divIcon({ className: "ui-mapa-div-marker", html: $(e), iconSize: [14, 14], iconAnchor: [7, 7] }) : r.divIcon({ className: "ui-mapa-svg-pin", html: F(e), iconSize: [24, 32], iconAnchor: [12, 32], popupAnchor: [0, -30] });
|
|
188
|
-
}
|
|
189
|
-
const j = 30, J = 50;
|
|
190
|
-
class M {
|
|
191
|
-
constructor(e, t) {
|
|
192
|
-
s(this, "pai", null);
|
|
193
|
-
s(this, "timer", null);
|
|
194
|
-
s(this, "tentativas", 0);
|
|
195
|
-
s(this, "aoPronto", () => {
|
|
196
|
-
this.opcoes.aoPerderMapa(), this.tentativas = 0, this.tentar();
|
|
197
|
-
});
|
|
198
|
-
this.host = e, this.opcoes = t;
|
|
199
|
-
}
|
|
200
|
-
conectar() {
|
|
201
|
-
var e;
|
|
202
|
-
this.desconectar(), this.pai = this.host.closest("ui-mapa"), (e = this.pai) == null || e.addEventListener("ui-mapa-pronto", this.aoPronto), this.agendar(0);
|
|
203
|
-
}
|
|
204
|
-
desconectar() {
|
|
205
|
-
var e;
|
|
206
|
-
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;
|
|
207
|
-
}
|
|
208
|
-
agendar(e) {
|
|
209
|
-
this.timer && clearTimeout(this.timer), this.timer = setTimeout(() => this.tentar(), e);
|
|
210
|
-
}
|
|
211
|
-
tentar() {
|
|
212
|
-
this.timer = null;
|
|
213
|
-
const e = this.pai ?? this.host.closest("ui-mapa");
|
|
214
|
-
if (!e) {
|
|
215
|
-
console.warn(`<${this.opcoes.rotulo}> deve estar dentro de um elemento <ui-mapa>`);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const t = e.getMap();
|
|
219
|
-
if (!t) {
|
|
220
|
-
if (this.tentativas >= j) {
|
|
221
|
-
console.warn(`<${this.opcoes.rotulo}> Tempo limite esgotado aguardando inicialização do mapa pai.`);
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
this.tentativas++, this.agendar(J);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
this.tentativas = 0, this.opcoes.aoMapa(t);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
class X extends d {
|
|
117
|
+
u("ui-mapa", C);
|
|
118
|
+
class I extends d {
|
|
231
119
|
constructor() {
|
|
232
120
|
super(...arguments);
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
121
|
+
a(this, "marker", null);
|
|
122
|
+
a(this, "_initTimer", null);
|
|
123
|
+
a(this, "_retryCount", 0);
|
|
124
|
+
a(this, "_parentMap", null);
|
|
125
|
+
a(this, "handleMapReady", () => {
|
|
126
|
+
this.marker && (this.marker.remove(), this.marker = null), this.initMarker();
|
|
127
|
+
});
|
|
239
128
|
}
|
|
240
129
|
static get observedAttributes() {
|
|
241
130
|
return ["lat", "lng", "titulo", "cor", "formato"];
|
|
242
131
|
}
|
|
243
132
|
connectedCallback() {
|
|
244
|
-
this.
|
|
133
|
+
this._parentMap = this.closest("ui-mapa"), this._parentMap && this._parentMap.addEventListener("ui-mapa-pronto", this.handleMapReady), this._initTimer = setTimeout(() => this.initMarker(), 0);
|
|
245
134
|
}
|
|
246
135
|
disconnectedCallback() {
|
|
247
|
-
this.
|
|
136
|
+
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);
|
|
248
137
|
}
|
|
249
|
-
attributeChangedCallback(t,
|
|
250
|
-
if (
|
|
138
|
+
attributeChangedCallback(t, e, r) {
|
|
139
|
+
if (e !== r && this.marker) {
|
|
251
140
|
if (t === "lat" || t === "lng") {
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
a && this.marker.setIcon(this.createIcon(a));
|
|
141
|
+
const i = y(this.getAttribute("lat"), this.getAttribute("lng"));
|
|
142
|
+
i && this.marker.setLatLng([i.lat, i.lon]);
|
|
143
|
+
}
|
|
144
|
+
if (t === "titulo" && (this.marker.unbindPopup(), r && this.marker.bindPopup(this.createPopupContent(r))), t === "cor" || t === "formato") {
|
|
145
|
+
const i = h() || window.L;
|
|
146
|
+
i && this.marker.setIcon(this.createIcon(i));
|
|
259
147
|
}
|
|
260
148
|
}
|
|
261
149
|
}
|
|
262
|
-
removerMarcador() {
|
|
263
|
-
var t;
|
|
264
|
-
(t = this.marker) == null || t.remove(), this.marker = null;
|
|
265
|
-
}
|
|
266
150
|
createPopupContent(t) {
|
|
267
|
-
const
|
|
268
|
-
return
|
|
151
|
+
const e = document.createElement("div");
|
|
152
|
+
return e.className = "ui-mapa-popup", e.textContent = t, e;
|
|
269
153
|
}
|
|
270
154
|
createIcon(t) {
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
155
|
+
const e = this.getAttribute("cor") || "#00f5a0";
|
|
156
|
+
if ((this.getAttribute("formato") || "pin") === "circle") {
|
|
157
|
+
const o = `<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>`;
|
|
158
|
+
return t.divIcon({
|
|
159
|
+
className: "ui-mapa-div-marker",
|
|
160
|
+
html: o,
|
|
161
|
+
iconSize: [14, 14],
|
|
162
|
+
iconAnchor: [7, 7]
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const i = `
|
|
166
|
+
<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));">
|
|
167
|
+
<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}"/>
|
|
168
|
+
<circle cx="12" cy="11" r="4.5" fill="#ffffff"/>
|
|
169
|
+
</svg>
|
|
170
|
+
`;
|
|
171
|
+
return t.divIcon({
|
|
172
|
+
className: "ui-mapa-svg-pin",
|
|
173
|
+
html: i,
|
|
174
|
+
iconSize: [24, 32],
|
|
175
|
+
iconAnchor: [12, 32],
|
|
176
|
+
popupAnchor: [0, -30]
|
|
177
|
+
});
|
|
281
178
|
}
|
|
282
|
-
|
|
283
|
-
this.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
179
|
+
initMarker() {
|
|
180
|
+
const t = this._parentMap || this.closest("ui-mapa");
|
|
181
|
+
if (!t) {
|
|
182
|
+
console.warn("<ui-mapa-marcador> deve estar dentro de um elemento <ui-mapa>");
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const e = t.getMap();
|
|
186
|
+
if (!e) {
|
|
187
|
+
if (this._retryCount >= 30) {
|
|
188
|
+
console.warn("<ui-mapa-marcador> Tempo limite esgotado aguardando inicialização do mapa pai.");
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this._retryCount++, this._initTimer = setTimeout(() => this.initMarker(), 50);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this._retryCount = 0;
|
|
195
|
+
const r = y(this.getAttribute("lat"), this.getAttribute("lng"));
|
|
196
|
+
if (!r) return;
|
|
197
|
+
const i = this.getAttribute("titulo"), o = h() || window.L;
|
|
198
|
+
o && (this.marker = o.marker([r.lat, r.lon], {
|
|
199
|
+
icon: this.createIcon(o)
|
|
200
|
+
}), this.marker && (i && this.marker.bindPopup(this.createPopupContent(i)), this.marker.addTo(e)));
|
|
290
201
|
}
|
|
291
202
|
}
|
|
292
|
-
|
|
293
|
-
class
|
|
203
|
+
u("ui-mapa-marcador", I);
|
|
204
|
+
class A extends d {
|
|
294
205
|
constructor() {
|
|
295
206
|
super(...arguments);
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
aoMapa: (t) => this.criarLinha(t),
|
|
300
|
-
aoPerderMapa: () => this.removerLinha()
|
|
301
|
-
}));
|
|
207
|
+
a(this, "polyline", null);
|
|
208
|
+
a(this, "_initTimer", null);
|
|
209
|
+
a(this, "_retryCount", 0);
|
|
302
210
|
}
|
|
303
211
|
static get observedAttributes() {
|
|
304
212
|
return ["pontos", "cor", "espessura"];
|
|
305
213
|
}
|
|
306
214
|
connectedCallback() {
|
|
307
|
-
this.
|
|
215
|
+
this._initTimer = setTimeout(() => this.initLinha(), 0);
|
|
308
216
|
}
|
|
309
217
|
disconnectedCallback() {
|
|
310
|
-
this.
|
|
218
|
+
this._initTimer && (clearTimeout(this._initTimer), this._initTimer = null), this.polyline && (this.polyline.remove(), this.polyline = null);
|
|
311
219
|
}
|
|
312
|
-
attributeChangedCallback(t,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
color: T(this.getAttribute("cor"), O),
|
|
318
|
-
weight: P(this.getAttribute("espessura"), k)
|
|
319
|
-
};
|
|
220
|
+
attributeChangedCallback(t, e, r) {
|
|
221
|
+
e !== r && this.polyline && (t === "pontos" ? this.polyline.setLatLngs(this.getPontos()) : (t === "cor" || t === "espessura") && this.polyline.setStyle({
|
|
222
|
+
color: this.getAttribute("cor") || "#3388ff",
|
|
223
|
+
weight: parseInt(this.getAttribute("espessura") || "3", 10)
|
|
224
|
+
}));
|
|
320
225
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
226
|
+
getPontos() {
|
|
227
|
+
try {
|
|
228
|
+
const t = this.getAttribute("pontos");
|
|
229
|
+
if (t)
|
|
230
|
+
return JSON.parse(t);
|
|
231
|
+
} catch (t) {
|
|
232
|
+
console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"', t);
|
|
233
|
+
}
|
|
234
|
+
return [];
|
|
324
235
|
}
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
|
|
328
|
-
|
|
236
|
+
initLinha() {
|
|
237
|
+
const t = this.closest("ui-mapa");
|
|
238
|
+
if (!t) {
|
|
239
|
+
console.warn("<ui-mapa-linha> deve estar dentro de um elemento <ui-mapa>");
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const e = t.getMap();
|
|
243
|
+
if (!e) {
|
|
244
|
+
if (this._retryCount >= 30) {
|
|
245
|
+
console.warn("<ui-mapa-linha> Tempo limite esgotado aguardando inicialização do mapa pai.");
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
this._retryCount++, this._initTimer = setTimeout(() => this.initLinha(), 50);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this._retryCount = 0;
|
|
252
|
+
const r = this.getAttribute("cor") || "#3388ff", i = parseInt(this.getAttribute("espessura") || "3", 10), o = h() || window.L;
|
|
253
|
+
o && (this.polyline = o.polyline(this.getPontos(), {
|
|
254
|
+
color: r,
|
|
255
|
+
weight: i
|
|
256
|
+
}), this.polyline && this.polyline.addTo(e));
|
|
329
257
|
}
|
|
330
258
|
}
|
|
331
|
-
|
|
259
|
+
u("ui-mapa-linha", A);
|
|
332
260
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
261
|
+
C as UIMapa,
|
|
262
|
+
A as UIMapaLinha,
|
|
263
|
+
I as UIMapaMarcador
|
|
336
264
|
};
|
package/dist/modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./ui-modal-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./ui-modal-CvGFGh1h.cjs");exports.UIDialog=o.UIDialog;exports.UIModal=o.UIModal;exports.aplicarInertForaDoModal=o.aplicarInertForaDoModal;exports.removerInertForaDoModal=o.removerInertForaDoModal;
|
package/dist/modal.js
CHANGED
package/dist/register.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./ssr-safe-CiHD1adl.cjs"),e=require("./zero-js-triggers-CgM9IIQB.cjs");require("./ui-botao-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./ssr-safe-CiHD1adl.cjs"),e=require("./zero-js-triggers-CgM9IIQB.cjs");require("./ui-botao-BOOnP8ds.cjs");require("./ui-switch-D7iPKDj-.cjs");require("./ui-segmented-rn9RxRGM.cjs");require("./ui-campo-texto-Cnn2UAkS.cjs");require("./ui-paleta-ferramentas-bvqxj1Yd.cjs");require("./ui-badge-BxT-sDmV.cjs");require("./ui-card-B86lJXTP.cjs");require("./ui-modal-CvGFGh1h.cjs");require("./ui-skeleton-SPYqku8P.cjs");require("./ui-tabela-propriedades-C-PeuW1i.cjs");require("./ui-controle-cores-Er6ZcQ7U.cjs");function i(){r.isBrowser&&e.initZeroJSTriggers()}r.isBrowser&&e.initZeroJSTriggers();exports.isBrowser=r.isBrowser;exports.registrarTodosComponentes=i;
|
package/dist/register.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { i as r } from "./ssr-safe-5cWfJP-s.js";
|
|
2
2
|
import { i } from "./zero-js-triggers-CJT988bR.js";
|
|
3
|
-
import "./ui-botao-
|
|
4
|
-
import "./ui-switch-
|
|
5
|
-
import "./ui-
|
|
6
|
-
import "./ui-campo-texto-
|
|
7
|
-
import "./ui-paleta-ferramentas-
|
|
8
|
-
import "./ui-badge-
|
|
9
|
-
import "./ui-card-
|
|
10
|
-
import "./ui-modal-
|
|
11
|
-
import "./ui-skeleton-
|
|
12
|
-
import "./ui-tabela-propriedades-
|
|
13
|
-
import "./ui-controle-cores-
|
|
3
|
+
import "./ui-botao-DfqSivHl.js";
|
|
4
|
+
import "./ui-switch-BcOqOkiV.js";
|
|
5
|
+
import "./ui-segmented-DyF5YLsV.js";
|
|
6
|
+
import "./ui-campo-texto-Uu2dJE_0.js";
|
|
7
|
+
import "./ui-paleta-ferramentas-DbwdWVtT.js";
|
|
8
|
+
import "./ui-badge-C0eKBI8E.js";
|
|
9
|
+
import "./ui-card-C_o5_0cB.js";
|
|
10
|
+
import "./ui-modal-DBOtSTbR.js";
|
|
11
|
+
import "./ui-skeleton-W9uwIceA.js";
|
|
12
|
+
import "./ui-tabela-propriedades-Df9ajC6M.js";
|
|
13
|
+
import "./ui-controle-cores-BS0WYPdi.js";
|
|
14
14
|
function d() {
|
|
15
15
|
r && i();
|
|
16
16
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const g = /* @__PURE__ */ new Set([
|
|
2
|
+
"svg",
|
|
3
|
+
"g",
|
|
4
|
+
"path",
|
|
5
|
+
"rect",
|
|
6
|
+
"circle",
|
|
7
|
+
"ellipse",
|
|
8
|
+
"line",
|
|
9
|
+
"polyline",
|
|
10
|
+
"polygon",
|
|
11
|
+
"text",
|
|
12
|
+
"tspan",
|
|
13
|
+
"title",
|
|
14
|
+
"desc",
|
|
15
|
+
"defs",
|
|
16
|
+
"symbol",
|
|
17
|
+
"use",
|
|
18
|
+
"lineargradient",
|
|
19
|
+
"radialgradient",
|
|
20
|
+
"stop",
|
|
21
|
+
"clippath",
|
|
22
|
+
"mask"
|
|
23
|
+
]), p = /^(javascript|data|vbscript):/i, h = /url\s*\(\s*['"]?\s*(?!#)/i;
|
|
24
|
+
let v = 0;
|
|
25
|
+
function E(r, e) {
|
|
26
|
+
const t = r.toLowerCase();
|
|
27
|
+
if (t.startsWith("on")) return !1;
|
|
28
|
+
const c = e.replace(/[\s\u0000-\u001f]+/g, "");
|
|
29
|
+
return p.test(c) ? !1 : t === "href" || t === "xlink:href" ? c.startsWith("#") : !h.test(e);
|
|
30
|
+
}
|
|
31
|
+
function u(r) {
|
|
32
|
+
Array.from(r.children).forEach((e) => {
|
|
33
|
+
if (!g.has(e.localName.toLowerCase())) {
|
|
34
|
+
console.warn(`[svg-seguro] Elemento <${e.localName}> não permitido foi descartado pela allowlist.`), e.remove();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
u(e);
|
|
38
|
+
}), Array.from(r.attributes).forEach((e) => {
|
|
39
|
+
E(e.name, e.value) || r.removeAttribute(e.name);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function A(r) {
|
|
43
|
+
const e = `ui-svg-${++v}-`, t = /* @__PURE__ */ new Map();
|
|
44
|
+
if (r.querySelectorAll("[id]").forEach((o) => {
|
|
45
|
+
const n = o.getAttribute("id");
|
|
46
|
+
if (n) {
|
|
47
|
+
const s = `${e}${n}`;
|
|
48
|
+
t.set(n, s), o.setAttribute("id", s);
|
|
49
|
+
}
|
|
50
|
+
}), t.size === 0) return;
|
|
51
|
+
const f = [r, ...Array.from(r.querySelectorAll("*"))], m = /url\(\s*#([a-zA-Z0-9_\-:]+)\s*\)/g;
|
|
52
|
+
f.forEach((o) => {
|
|
53
|
+
Array.from(o.attributes).forEach((n) => {
|
|
54
|
+
const s = n.name.toLowerCase(), i = n.value;
|
|
55
|
+
if ((s === "href" || s === "xlink:href") && i.startsWith("#")) {
|
|
56
|
+
const a = i.slice(1);
|
|
57
|
+
t.has(a) && o.setAttribute(n.name, `#${t.get(a)}`);
|
|
58
|
+
} else if (i.includes("url(#")) {
|
|
59
|
+
const a = i.replace(m, (d, l) => t.has(l) ? `url(#${t.get(l)})` : d);
|
|
60
|
+
a !== i && o.setAttribute(n.name, a);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function y(r) {
|
|
66
|
+
if (!r || typeof r != "string" || typeof document > "u") return null;
|
|
67
|
+
const e = document.createElement("template");
|
|
68
|
+
e.innerHTML = r.trim();
|
|
69
|
+
const t = e.content.querySelector("svg");
|
|
70
|
+
return t ? (u(t), A(t), t) : (r.trim().length > 0 && console.warn("[svg-seguro] Código descartado: nenhum elemento <svg> válido encontrado."), null);
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
y as h
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=new Set(["svg","g","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","defs","symbol","use","lineargradient","radialgradient","stop","clippath","mask"]),p=/^(javascript|data|vbscript):/i,h=/url\s*\(\s*['"]?\s*(?!#)/i;let v=0;function E(r,e){const t=r.toLowerCase();if(t.startsWith("on"))return!1;const c=e.replace(/[\s\u0000-\u001f]+/g,"");return p.test(c)?!1:t==="href"||t==="xlink:href"?c.startsWith("#"):!h.test(e)}function u(r){Array.from(r.children).forEach(e=>{if(!g.has(e.localName.toLowerCase())){console.warn(`[svg-seguro] Elemento <${e.localName}> não permitido foi descartado pela allowlist.`),e.remove();return}u(e)}),Array.from(r.attributes).forEach(e=>{E(e.name,e.value)||r.removeAttribute(e.name)})}function A(r){const e=`ui-svg-${++v}-`,t=new Map;if(r.querySelectorAll("[id]").forEach(o=>{const n=o.getAttribute("id");if(n){const s=`${e}${n}`;t.set(n,s),o.setAttribute("id",s)}}),t.size===0)return;const f=[r,...Array.from(r.querySelectorAll("*"))],m=/url\(\s*#([a-zA-Z0-9_\-:]+)\s*\)/g;f.forEach(o=>{Array.from(o.attributes).forEach(n=>{const s=n.name.toLowerCase(),i=n.value;if((s==="href"||s==="xlink:href")&&i.startsWith("#")){const a=i.slice(1);t.has(a)&&o.setAttribute(n.name,`#${t.get(a)}`)}else if(i.includes("url(#")){const a=i.replace(m,(d,l)=>t.has(l)?`url(#${t.get(l)})`:d);a!==i&&o.setAttribute(n.name,a)}})})}function S(r){if(!r||typeof r!="string"||typeof document>"u")return null;const e=document.createElement("template");e.innerHTML=r.trim();const t=e.content.querySelector("svg");return t?(u(t),A(t),t):(r.trim().length>0&&console.warn("[svg-seguro] Código descartado: nenhum elemento <svg> válido encontrado."),null)}exports.higienizarSvg=S;
|