@thibezer/ui-components-kit 2.8.0 → 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.
Files changed (183) hide show
  1. package/CHANGELOG.md +203 -265
  2. package/README.md +791 -815
  3. package/dist/botao.cjs +1 -1
  4. package/dist/botao.js +1 -1
  5. package/dist/camadas.cjs +94 -94
  6. package/dist/camadas.js +1124 -1218
  7. package/dist/campo-texto.cjs +1 -1
  8. package/dist/campo-texto.js +1 -1
  9. package/dist/canvas.cjs +65 -66
  10. package/dist/canvas.js +3444 -3795
  11. package/dist/card.cjs +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/components/ui-avatar/ui-avatar.d.ts +0 -11
  14. package/dist/components/ui-badge/ui-badge.d.ts +0 -2
  15. package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -1
  16. package/dist/components/ui-barra-ferramentas/tipos.d.ts +31 -0
  17. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +17 -1
  18. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +17 -0
  19. package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +0 -2
  20. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +11 -4
  21. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +1 -13
  22. package/dist/components/ui-camadas/ui-camadas.d.ts +5 -3
  23. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +1 -2
  24. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
  25. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +8 -3
  26. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +106 -26
  27. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +1 -3
  28. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +1 -4
  29. package/dist/components/ui-checkbox/ui-checkbox.d.ts +1 -4
  30. package/dist/components/ui-cores/tipos.d.ts +0 -2
  31. package/dist/components/ui-cores/ui-controle-cores.d.ts +3 -8
  32. package/dist/components/ui-cores/ui-seletor-cor.d.ts +1 -3
  33. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +5 -12
  34. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +6 -15
  35. package/dist/components/ui-mapa/ui-mapa.d.ts +1 -14
  36. package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
  37. package/dist/components/ui-modal/ui-modal.d.ts +11 -1
  38. package/dist/components/ui-radio/radio-grupo-registry.d.ts +0 -10
  39. package/dist/components/ui-radio/ui-radio.d.ts +2 -9
  40. package/dist/components/ui-skeleton/ui-skeleton.d.ts +0 -9
  41. package/dist/components/ui-switch/ui-switch.d.ts +1 -3
  42. package/dist/components/ui-tabela/ui-tabela.d.ts +19 -1
  43. package/dist/components/ui-tooltip/ui-tooltip.d.ts +1 -24
  44. package/dist/core/index.d.ts +0 -1
  45. package/dist/core.cjs +1 -1
  46. package/dist/core.js +18 -28
  47. package/dist/cores.cjs +1 -1
  48. package/dist/cores.js +1 -1
  49. package/dist/custom-elements.json +18859 -23721
  50. package/dist/data.cjs +1 -1
  51. package/dist/data.js +2 -2
  52. package/dist/feedback.cjs +1 -1
  53. package/dist/feedback.js +2 -2
  54. package/dist/form-validacao-BIOXxt-1.js +140 -0
  55. package/dist/form-validacao-ytRYSF3E.cjs +1 -0
  56. package/dist/forms.cjs +1 -1
  57. package/dist/forms.js +2 -2
  58. package/dist/gerencigeo-canvas/feature_metricas.d.ts +9 -0
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.d.ts +0 -3
  61. package/dist/index.js +178 -179
  62. package/dist/mapa.cjs +16 -11
  63. package/dist/mapa.js +170 -242
  64. package/dist/modal.cjs +1 -1
  65. package/dist/modal.js +1 -1
  66. package/dist/register.cjs +1 -1
  67. package/dist/register.js +11 -11
  68. package/dist/svg-seguro-ChVJ2L2z.js +74 -0
  69. package/dist/svg-seguro-J2RM1Ssf.cjs +1 -0
  70. package/dist/tabela.cjs +1 -1
  71. package/dist/tabela.js +1 -1
  72. package/dist/tipos-elementos.d.ts +17 -35
  73. package/dist/tipos-react.d.ts +0 -2
  74. package/dist/tipos-vue.d.ts +12 -34
  75. package/dist/tools.cjs +1 -1
  76. package/dist/tools.js +1 -1
  77. package/dist/ui-badge-BxT-sDmV.cjs +28 -0
  78. package/dist/ui-badge-C0eKBI8E.js +183 -0
  79. package/dist/ui-botao-BOOnP8ds.cjs +12 -0
  80. package/dist/ui-botao-DfqSivHl.js +165 -0
  81. package/dist/ui-botao-OGJV6Vfk.js +165 -0
  82. package/dist/ui-botao-psS1juof.cjs +12 -0
  83. package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
  84. package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-Uu2dJE_0.js} +51 -51
  85. package/dist/ui-card-B86lJXTP.cjs +20 -0
  86. package/dist/{ui-card-BNYCQ7g-.js → ui-card-C_o5_0cB.js} +42 -50
  87. package/dist/ui-controle-cores-BS0WYPdi.js +572 -0
  88. package/dist/ui-controle-cores-Er6ZcQ7U.cjs +111 -0
  89. package/dist/ui-kit.css +1 -1
  90. package/dist/ui-modal-CvGFGh1h.cjs +18 -0
  91. package/dist/{ui-modal-BkYvNP0G.js → ui-modal-DBOtSTbR.js} +140 -116
  92. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +624 -0
  93. package/dist/ui-paleta-ferramentas-CU4icLl0.js +1171 -0
  94. package/dist/{ui-paleta-ferramentas-bDLPbiGA.cjs → ui-paleta-ferramentas-Ccmo-rB5.cjs} +7 -7
  95. package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +21 -0
  96. package/dist/{ui-paleta-ferramentas-Ksh6gMW3.js → ui-paleta-ferramentas-DNN5i6nL.js} +329 -359
  97. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +18 -0
  98. package/dist/ui-paleta-ferramentas-DbwdWVtT.js +1173 -0
  99. package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +21 -0
  100. package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
  101. package/dist/ui-segmented-DyF5YLsV.js +418 -0
  102. package/dist/ui-segmented-rn9RxRGM.cjs +19 -0
  103. package/dist/{ui-linha-nCDh2wPm.js → ui-segmented-wUraId2e.js} +105 -200
  104. package/dist/ui-skeleton-DI4_9WOX.js +428 -0
  105. package/dist/{ui-skeleton-DiOxTBZK.cjs → ui-skeleton-SPYqku8P.cjs} +10 -10
  106. package/dist/{ui-skeleton-B2Rgrv8o.js → ui-skeleton-W9uwIceA.js} +191 -254
  107. package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
  108. package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BcOqOkiV.js} +128 -187
  109. package/dist/ui-switch-D7iPKDj-.cjs +53 -0
  110. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
  111. package/dist/{ui-tabela-propriedades-DzZlyNZ_.cjs → ui-tabela-propriedades-BecPqC-e.cjs} +10 -10
  112. package/dist/{ui-tabela-propriedades-D9Echt2X.js → ui-tabela-propriedades-BokvDD3b.js} +826 -845
  113. package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
  114. package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +141 -0
  115. package/dist/ui-tabela-propriedades-Df9ajC6M.js +2648 -0
  116. package/dist/ui-toast-Bp_NlM5G.js +156 -0
  117. package/dist/ui-toast-DGTZKne5.cjs +20 -0
  118. package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
  119. package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
  120. package/package.json +3 -3
  121. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  122. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  123. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  124. package/dist/altura-controle-vxQiXG4q.js +0 -62
  125. package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +0 -16
  126. package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +0 -24
  127. package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +0 -14
  128. package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +0 -17
  129. package/dist/components/ui-camadas/camadas-colecao.d.ts +0 -27
  130. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +0 -31
  131. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +0 -10
  132. package/dist/components/ui-camadas/camadas-lembranca.d.ts +0 -34
  133. package/dist/components/ui-camadas/camadas-render.d.ts +0 -14
  134. package/dist/components/ui-camadas/camadas-renomear.d.ts +0 -12
  135. package/dist/components/ui-camadas/camadas-selecao-api.d.ts +0 -17
  136. package/dist/components/ui-camadas/camadas-thumb.d.ts +0 -1
  137. package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +0 -15
  138. package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +0 -22
  139. package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +0 -26
  140. package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +0 -21
  141. package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +0 -39
  142. package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +0 -68
  143. package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +0 -37
  144. package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +0 -48
  145. package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +0 -24
  146. package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +0 -22
  147. package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +0 -53
  148. package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +0 -33
  149. package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +0 -5
  150. package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +0 -5
  151. package/dist/components/ui-canvas-cad/tipos.d.ts +0 -37
  152. package/dist/components/ui-linha/index.d.ts +0 -1
  153. package/dist/components/ui-linha/ui-linha.d.ts +0 -48
  154. package/dist/components/ui-mapa/mapa-atributos.d.ts +0 -14
  155. package/dist/components/ui-mapa/mapa-basemaps.d.ts +0 -7
  156. package/dist/components/ui-mapa/mapa-icones.d.ts +0 -4
  157. package/dist/components/ui-mapa/mapa-leaflet.d.ts +0 -5
  158. package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +0 -22
  159. package/dist/components/ui-mapa/tipos.d.ts +0 -13
  160. package/dist/components/ui-modal/modal-foco.d.ts +0 -28
  161. package/dist/components/ui-tabela/tabela-estados.d.ts +0 -16
  162. package/dist/components/ui-tabela/tabela-rolagem.d.ts +0 -44
  163. package/dist/components/ui-tabela/tabela-teclado.d.ts +0 -16
  164. package/dist/components/ui-tooltip/tooltip-popover.d.ts +0 -7
  165. package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +0 -29
  166. package/dist/core/altura-controle.d.ts +0 -34
  167. package/dist/core/opcoes.d.ts +0 -9
  168. package/dist/core/rotulo-controle.d.ts +0 -13
  169. package/dist/form-validacao-BlQFxUVj.js +0 -104
  170. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  171. package/dist/opcoes-CJYLi6kd.js +0 -12
  172. package/dist/opcoes-CkyDxBuQ.cjs +0 -1
  173. package/dist/ui-badge-BWhoGgo9.js +0 -197
  174. package/dist/ui-badge-SIR81R9l.cjs +0 -28
  175. package/dist/ui-botao-D24oXySA.cjs +0 -12
  176. package/dist/ui-botao-Dsj08jjw.js +0 -165
  177. package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
  178. package/dist/ui-card-BrjBL-yo.cjs +0 -20
  179. package/dist/ui-controle-cores-DgEza3wF.js +0 -612
  180. package/dist/ui-controle-cores-uY__TgwW.cjs +0 -117
  181. package/dist/ui-linha-C6HBnsaw.cjs +0 -19
  182. package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
  183. package/dist/ui-switch-D9a8XlVX.cjs +0 -53
package/dist/mapa.js CHANGED
@@ -1,166 +1,111 @@
1
- var C = Object.defineProperty;
2
- var x = (r, e, t) => e in r ? C(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var s = (r, e, t) => x(r, typeof e != "symbol" ? e + "" : e, t);
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 { l as z, p as v } from "./leaflet-PPDKB6Dd.js";
6
- import { d as m, S as d } from "./ssr-safe-5cWfJP-s.js";
7
- import { c as S, o as I } from "./leaflet-loader-Cjcdgj5R.js";
8
- const _ = ":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 h() {
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: () => r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
13
+ layer: () => s.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
20
14
  attribution: '&copy; <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: () => r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
19
+ layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
26
20
  attribution: "Tiles &copy; Esri &mdash; 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: () => r.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
25
+ layer: () => s.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
32
26
  attribution: 'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <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: () => r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {
31
+ layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {
38
32
  attribution: "Tiles &copy; Esri &mdash; 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
- const p = { lat: -23.55052, lng: -46.633308, zoom: 13 }, L = "#00f5a0", O = "#3388ff", k = 3, l = (r) => Number.isFinite(r);
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>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
87
- </div>
88
- `;
89
- class H extends d {
37
+ class C extends d {
90
38
  constructor() {
91
39
  super();
92
- s(this, "mapContainer");
93
- s(this, "mapInstance", null);
94
- s(this, "_initTimer", null);
95
- s(this, "_resizeObserver");
96
- s(this, "_resizeTimer");
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
- ${z}
102
- ${_}
48
+ ${x}
49
+ ${M}
103
50
  </style>
104
- <div class="ui-mapa-container" id="map-container" role="region"></div>
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"), this.sincronizarRotulo();
53
+ `, this.mapContainer = t.getElementById("map-container");
107
54
  }
108
55
  static get observedAttributes() {
109
- return ["lat", "lng", "zoom", "aria-label"];
56
+ return ["lat", "lng", "zoom"];
110
57
  }
111
58
  connectedCallback() {
112
- this.sincronizarRotulo(), this._initTimer = setTimeout(() => {
113
- this._initTimer = null, this.initMap();
59
+ this._initTimer = window.setTimeout(() => {
60
+ this.initMap();
114
61
  }, 0);
115
62
  }
116
63
  disconnectedCallback() {
117
- var t;
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, i, o) {
121
- if (i !== o) {
122
- if (t === "aria-label") {
123
- this.sincronizarRotulo();
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 b;
73
+ var g;
139
74
  if (this.mapInstance) return;
140
- const t = await E();
141
- if (!this.isConnected || this.mapInstance) return;
75
+ const t = await _();
142
76
  if (!t) {
143
- this.mapContainer.innerHTML = V;
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>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
82
+ </div>
83
+ `;
144
84
  return;
145
85
  }
146
- const i = w(t), o = A(this.getAttribute("lat"), this.getAttribute("lng"), this.getAttribute("zoom")), a = t.map(this.mapContainer).setView([o.lat, o.lng], o.zoom);
147
- this.mapInstance = a;
148
- const n = G(this.getAttribute("camadas"), Object.keys(i)), f = i[n[0]].layer();
149
- if (f.addTo(a), n.length > 1) {
150
- const c = { [i[n[0]].nome]: f };
151
- for (const g of n.slice(1)) c[i[g].nome] = i[g].layer();
152
- t.control.layers(c, void 0, { position: "topright" }).addTo(a);
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
- (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(() => {
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
- var c;
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)), this._invalidarTimer = setTimeout(() => {
160
- var c;
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: a },
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
- m("ui-mapa", H);
173
- const u = "http://www.w3.org/2000/svg";
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
- s(this, "marker", null);
234
- s(this, "vinculo", new M(this, {
235
- rotulo: "ui-mapa-marcador",
236
- aoMapa: (t) => this.criarMarcador(t),
237
- aoPerderMapa: () => this.removerMarcador()
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.vinculo.conectar();
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.vinculo.desconectar(), this.removerMarcador();
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, i, o) {
250
- if (!(i === o || !this.marker)) {
138
+ attributeChangedCallback(t, e, r) {
139
+ if (e !== r && this.marker) {
251
140
  if (t === "lat" || t === "lng") {
252
- const a = v(this.getAttribute("lat"), this.getAttribute("lng"));
253
- a && this.marker.setLatLng([a.lat, a.lon]);
254
- } else if (t === "titulo")
255
- this.marker.unbindPopup(), o && this.marker.bindPopup(this.createPopupContent(o)), this.aplicarNomeAcessivel();
256
- else if (t === "cor" || t === "formato") {
257
- const a = h();
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 i = document.createElement("div");
268
- return i.className = "ui-mapa-popup", i.textContent = t, i;
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 i = this.getAttribute("formato") === "circle" ? "circle" : "pin";
272
- return B(t, T(this.getAttribute("cor"), L), i);
273
- }
274
- /** O ícone é um `div`: o nome acessível vai em `aria-label` (o Leaflet já põe `role=button` e `tabindex=0`). */
275
- aplicarNomeAcessivel() {
276
- var o;
277
- const t = (o = this.marker) == null ? void 0 : o.getElement();
278
- if (!t) return;
279
- const i = this.getAttribute("titulo");
280
- i ? (t.setAttribute("aria-label", i), t.setAttribute("title", i)) : (t.removeAttribute("aria-label"), t.removeAttribute("title"));
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
- criarMarcador(t) {
283
- this.removerMarcador();
284
- const i = v(this.getAttribute("lat"), this.getAttribute("lng"));
285
- if (!i) return;
286
- const o = h();
287
- if (!o) return;
288
- const a = this.getAttribute("titulo"), n = o.marker([i.lat, i.lon], { icon: this.createIcon(o), keyboard: !0, title: a || void 0 });
289
- a && n.bindPopup(this.createPopupContent(a)), n.addTo(t), this.marker = n, this.aplicarNomeAcessivel();
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
- m("ui-mapa-marcador", X);
293
- class W extends d {
203
+ u("ui-mapa-marcador", I);
204
+ class A extends d {
294
205
  constructor() {
295
206
  super(...arguments);
296
- s(this, "polyline", null);
297
- s(this, "vinculo", new M(this, {
298
- rotulo: "ui-mapa-linha",
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.vinculo.conectar();
215
+ this._initTimer = setTimeout(() => this.initLinha(), 0);
308
216
  }
309
217
  disconnectedCallback() {
310
- this.vinculo.desconectar(), this.removerLinha();
218
+ this._initTimer && (clearTimeout(this._initTimer), this._initTimer = null), this.polyline && (this.polyline.remove(), this.polyline = null);
311
219
  }
312
- attributeChangedCallback(t, i, o) {
313
- i === o || !this.polyline || (t === "pontos" ? this.polyline.setLatLngs(y(this.getAttribute("pontos"))) : this.polyline.setStyle(this.estilo()));
314
- }
315
- estilo() {
316
- return {
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
- removerLinha() {
322
- var t;
323
- (t = this.polyline) == null || t.remove(), this.polyline = null;
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
- criarLinha(t) {
326
- this.removerLinha();
327
- const i = h();
328
- i && (this.polyline = i.polyline(y(this.getAttribute("pontos")), this.estilo()).addTo(t));
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
- m("ui-mapa-linha", W);
259
+ u("ui-mapa-linha", A);
332
260
  export {
333
- H as UIMapa,
334
- W as UIMapaLinha,
335
- X as UIMapaMarcador
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-CUNbpbZ1.cjs");exports.UIDialog=o.UIDialog;exports.UIModal=o.UIModal;exports.aplicarInertForaDoModal=o.aplicarInertForaDoModal;exports.removerInertForaDoModal=o.removerInertForaDoModal;
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
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import { U as e, a as l, b as s, r as t } from "./ui-modal-BkYvNP0G.js";
2
+ import { U as e, a as l, b as s, r as t } from "./ui-modal-DBOtSTbR.js";
3
3
  export {
4
4
  e as UIDialog,
5
5
  l as UIModal,
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-D24oXySA.cjs");require("./ui-switch-D9a8XlVX.cjs");require("./ui-linha-C6HBnsaw.cjs");require("./ui-campo-texto-DauJCde3.cjs");require("./ui-paleta-ferramentas-bDLPbiGA.cjs");require("./ui-badge-SIR81R9l.cjs");require("./ui-card-BrjBL-yo.cjs");require("./ui-modal-CUNbpbZ1.cjs");require("./ui-skeleton-DiOxTBZK.cjs");require("./ui-tabela-propriedades-DzZlyNZ_.cjs");require("./ui-controle-cores-uY__TgwW.cjs");function i(){r.isBrowser&&e.initZeroJSTriggers()}r.isBrowser&&e.initZeroJSTriggers();exports.isBrowser=r.isBrowser;exports.registrarTodosComponentes=i;
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-Dsj08jjw.js";
4
- import "./ui-switch-DO1R0Ce7.js";
5
- import "./ui-linha-nCDh2wPm.js";
6
- import "./ui-campo-texto-B_OHVGiN.js";
7
- import "./ui-paleta-ferramentas-Ksh6gMW3.js";
8
- import "./ui-badge-BWhoGgo9.js";
9
- import "./ui-card-BNYCQ7g-.js";
10
- import "./ui-modal-BkYvNP0G.js";
11
- import "./ui-skeleton-B2Rgrv8o.js";
12
- import "./ui-tabela-propriedades-D9Echt2X.js";
13
- import "./ui-controle-cores-DgEza3wF.js";
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;