@thibezer/ui-components-kit 2.29.0 → 2.31.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 +44 -0
- package/dist/camadas.cjs +1 -1
- package/dist/camadas.js +1 -1
- package/dist/canvas.cjs +66 -65
- package/dist/canvas.js +1799 -1366
- package/dist/components/ui-canvas-cad/cad-hud-coordenadas.d.ts +4 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +10 -0
- package/dist/components/ui-seletor-mapa-base/index.d.ts +1 -0
- package/dist/components/ui-seletor-mapa-base/seletor-mapa-base-util.d.ts +32 -0
- package/dist/components/ui-seletor-mapa-base/tipos.d.ts +8 -1
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +9 -0
- package/dist/custom-elements.json +17846 -17403
- package/dist/feature_caixa-DAyED81R.cjs +1 -0
- package/dist/feature_caixa-zoUAn0qg.js +877 -0
- package/dist/{feature_desenho-eq3MIZR9.cjs → feature_desenho-CESNXi8g.cjs} +1 -1
- package/dist/{feature_desenho-Cq3H27as.js → feature_desenho-fQfbVPvn.js} +2 -2
- package/dist/feature_metricas-CnSFE0at.cjs +1 -0
- package/dist/feature_metricas-hUren6kK.js +135 -0
- package/dist/geometria-px-C4xatxmY.cjs +1 -0
- package/dist/{geometria-px-BxTQKrZN.js → geometria-px-wXudjSxA.js} +224 -206
- package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +37 -1
- package/dist/gerencigeo-canvas/motor/tipos.d.ts +8 -2
- package/dist/gerencigeo-canvas/renderers/agenda_fatias.d.ts +56 -0
- package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +76 -2
- package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +20 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +21 -11
- package/dist/motor.cjs +1 -1
- package/dist/motor.js +445 -342
- package/dist/prancha-nucleo.cjs +1 -1
- package/dist/prancha-nucleo.js +4 -4
- package/dist/prancha.cjs +1 -1
- package/dist/prancha.js +3 -3
- package/dist/seletor-mapa-base.cjs +16 -16
- package/dist/seletor-mapa-base.js +183 -102
- package/dist/tipos-elementos.d.ts +2 -0
- package/dist/tipos-vue.d.ts +2 -0
- package/package.json +1 -1
- package/dist/feature_caixa-DOchASgS.js +0 -828
- package/dist/feature_caixa-MrJEfMol.cjs +0 -1
- package/dist/feature_metricas-CKQGG2nz.cjs +0 -1
- package/dist/feature_metricas-DGfd21VR.js +0 -130
- package/dist/geometria-px-BlB0OczX.cjs +0 -1
|
@@ -1,9 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var M = (r, o, e) => o in r ? k(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
3
|
+
var p = (r, o, e) => M(r, typeof o != "symbol" ? o + "" : o, e);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { S as
|
|
6
|
-
const
|
|
5
|
+
import { S as z, A as B, L as C, g as m, s as S, d as w } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
const l = { lat: 0, lng: 0, zoom: 2 }, y = 19, h = 85.05112878;
|
|
7
|
+
function _(r) {
|
|
8
|
+
const o = Number.isFinite(r) && r > 0 ? Math.floor(r) : 0;
|
|
9
|
+
return `${o} ${o === 1 ? "opção" : "opções"}`;
|
|
10
|
+
}
|
|
11
|
+
function $(r, o, e) {
|
|
12
|
+
const i = Number.isFinite(r) ? r : 0, t = Number.isFinite(o) ? o : 0, a = Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
13
|
+
return t >= a ? "baixo" : i > t ? "cima" : "baixo";
|
|
14
|
+
}
|
|
15
|
+
function I(r) {
|
|
16
|
+
if (typeof r != "string" || !r.trim()) return null;
|
|
17
|
+
const o = r.split(",").map((s) => Number(s.trim()));
|
|
18
|
+
if (o.length < 2 || o.length > 3) return null;
|
|
19
|
+
const [e, i, t] = o;
|
|
20
|
+
if (!Number.isFinite(e) || !Number.isFinite(i) || e < -90 || e > 90 || i < -180 || i > 180) return null;
|
|
21
|
+
const a = o.length === 3 ? t : l.zoom;
|
|
22
|
+
return Number.isFinite(a) ? { lat: e, lng: i, zoom: Math.min(y, Math.max(0, Math.round(a))) } : null;
|
|
23
|
+
}
|
|
24
|
+
function g(r, o, e) {
|
|
25
|
+
const i = Number.isFinite(e) ? Math.min(y, Math.max(0, Math.round(e))) : l.zoom, t = 2 ** i, a = Number.isFinite(r) ? Math.min(h, Math.max(-h, r)) : 0, s = Number.isFinite(o) ? Math.min(180, Math.max(-180, o)) : 0, n = a * Math.PI / 180, c = (b) => Math.min(t - 1, Math.max(0, Math.floor(b)));
|
|
26
|
+
return {
|
|
27
|
+
z: i,
|
|
28
|
+
x: c((s + 180) / 360 * t),
|
|
29
|
+
y: c((1 - Math.log(Math.tan(n) + 1 / Math.cos(n)) / Math.PI) / 2 * t)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function A(r) {
|
|
33
|
+
return /^https?:\/\//i.test(r.trim());
|
|
34
|
+
}
|
|
35
|
+
function N(r, o) {
|
|
36
|
+
return typeof r != "string" || !A(r) ? null : r.replace(/\{z\}/g, String(o.z)).replace(/\{x\}/g, String(o.x)).replace(/\{y\}/g, String(o.y)).replace(/\{s\}/g, "a").replace(/\{r\}/g, "");
|
|
37
|
+
}
|
|
38
|
+
function v(r, o) {
|
|
39
|
+
return r ? typeof r.thumbnailUrl == "string" && A(r.thumbnailUrl) ? r.thumbnailUrl : N(r.tileUrl, o) : null;
|
|
40
|
+
}
|
|
41
|
+
const H = ':host{display:inline-block;font-family:var(--ui-fonte-base, "Inter", sans-serif);color:var(--ui-cor-texto, #f1f1f5);box-sizing:border-box;-webkit-user-select:none;user-select:none}:host *,:host *:before,:host *:after{box-sizing:border-box}:host([posicao="bottom-right"]){position:absolute;bottom:16px;right:16px;z-index:var(--ui-z-workspace-hud, 500)}:host([posicao="bottom-left"]){position:absolute;bottom:16px;left:16px;z-index:var(--ui-z-workspace-hud, 500)}:host([posicao="top-right"]){position:absolute;top:16px;right:16px;z-index:var(--ui-z-workspace-hud, 500)}:host([posicao="top-left"]){position:absolute;top:16px;left:16px;z-index:var(--ui-z-workspace-hud, 500)}:host([posicao="inline"]){position:relative;display:inline-flex}.ui-basemap-wrapper{position:relative;display:inline-flex;align-items:center}.ui-basemap-trigger{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 12px 0 6px;background:var(--ui-degrade-interno, var(--ui-basemap-gatilho-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, rgba(18, 18, 24, .88)))));backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-pill, 999px);color:var(--ui-cor-texto, #f1f1f5);cursor:pointer;outline:none;font-size:11.5px;font-weight:500;letter-spacing:.2px;box-shadow:var(--ui-sombra-md, 0 4px 14px rgba(0, 0, 0, .35)),0 1px 3px #0003;transition:all .18s cubic-bezier(.16,1,.3,1)}.ui-basemap-trigger:hover{background:var(--ui-cor-botao-secundario-hover, rgba(28, 28, 36, .95));border-color:var(--ui-cor-primaria, #00E08A);transform:translateY(-1px);box-shadow:var(--ui-sombra-md, 0 6px 20px rgba(0, 0, 0, .45)),0 0 12px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 20%,transparent)}.ui-basemap-trigger:focus-visible{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-basemap-trigger.active{border-color:var(--ui-cor-primaria, #00E08A);background:var(--ui-degrade-interno, var(--ui-basemap-gatilho-ativo-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, rgba(22, 26, 32, .95)))));box-shadow:var(--ui-sombra-md, 0 4px 16px rgba(0, 0, 0, .4)),0 0 10px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}:host([compacto]) .ui-basemap-trigger,.ui-basemap-trigger.compacto{width:36px;height:36px;padding:0;justify-content:center;border-radius:50%}:host([compacto]) .ui-basemap-label,:host([compacto]) .ui-basemap-chevron,.ui-basemap-trigger.compacto .ui-basemap-label,.ui-basemap-trigger.compacto .ui-basemap-chevron{display:none!important}.ui-basemap-thumb-mini{width:22px;height:22px;border-radius:50%;object-fit:cover;flex-shrink:0;border:1.5px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .4))}.ui-basemap-thumb-mini.fallback{display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-basemap-thumb-mini.fallback svg{width:13px;height:13px}.ui-basemap-label{white-space:nowrap;max-width:130px;overflow:hidden;text-overflow:ellipsis}.ui-basemap-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);transition:transform .2s cubic-bezier(.16,1,.3,1);margin-left:2px}.ui-basemap-chevron svg{width:12px;height:12px}.ui-basemap-trigger.active .ui-basemap-chevron{transform:rotate(180deg);color:var(--ui-cor-primaria, #00E08A)}.ui-basemap-popover{position:absolute;min-width:210px;max-width:250px;background:var(--ui-degrade-interno, var(--ui-basemap-popover-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, rgba(16, 16, 22, .95)))));backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:12px;padding:6px;box-shadow:var(--ui-sombra-lg, 0 12px 32px rgba(0, 0, 0, .6)),0 2px 8px #0000004d;z-index:var(--ui-z-popover, 1050);display:flex;flex-direction:column;gap:3px;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px) scale(.97);transition:opacity .18s cubic-bezier(.16,1,.3,1),transform .18s cubic-bezier(.16,1,.3,1),visibility .18s}.ui-basemap-wrapper.pos-bottom-right .ui-basemap-popover,.ui-basemap-wrapper.pos-bottom-left .ui-basemap-popover,.ui-basemap-wrapper.pos-bottom .ui-basemap-popover{bottom:calc(100% + 8px);transform:translateY(8px) scale(.97)}.ui-basemap-wrapper.pos-bottom-right .ui-basemap-popover{right:0}.ui-basemap-wrapper.pos-bottom-left .ui-basemap-popover{left:0}.ui-basemap-wrapper.pos-top-right .ui-basemap-popover,.ui-basemap-wrapper.pos-top-left .ui-basemap-popover,.ui-basemap-wrapper.pos-top .ui-basemap-popover{top:calc(100% + 8px);transform:translateY(-8px) scale(.97)}.ui-basemap-wrapper.pos-top-right .ui-basemap-popover{right:0}.ui-basemap-wrapper.pos-top-left .ui-basemap-popover,.ui-basemap-wrapper.pos-auto .ui-basemap-popover{left:0}.ui-basemap-wrapper.pos-auto.abre-cima .ui-basemap-popover{bottom:calc(100% + 8px)}.ui-basemap-wrapper.pos-auto.abre-baixo .ui-basemap-popover{top:calc(100% + 8px)}.ui-basemap-wrapper.pos-auto.abre-baixo .ui-basemap-popover:not(.aberto){transform:translateY(-8px) scale(.97)}.ui-basemap-popover.aberto{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0) scale(1)}.ui-basemap-popover-header{display:flex;align-items:center;justify-content:space-between;padding:4px 8px 6px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);margin-bottom:2px}.ui-basemap-popover-titulo{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-popover-badge{font-size:9px;font-weight:600;padding:1px 5px;border-radius:var(--ui-raio-sm, 4px);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);color:var(--ui-cor-primaria, #00E08A);font-variant-numeric:tabular-nums}.ui-basemap-list{display:flex;flex-direction:column;gap:2px;max-height:280px;overflow-y:auto;overflow-x:hidden;padding-right:2px}.ui-basemap-list::-webkit-scrollbar{width:4px}.ui-basemap-list::-webkit-scrollbar-track{background:transparent}.ui-basemap-list::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-radius:2px}.ui-basemap-item{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:7px;background:transparent;border:1px solid transparent;cursor:pointer;transition:all .12s ease;outline:none}.ui-basemap-item:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent)}.ui-basemap-item:focus-visible{border-color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 6%,transparent)}.ui-basemap-item.active{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-basemap-item-preview{width:32px;height:24px;border-radius:var(--ui-raio-sm, 4px);object-fit:cover;flex-shrink:0;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .3))}.ui-basemap-item-preview-none{width:32px;height:24px;border-radius:var(--ui-raio-sm, 4px);flex-shrink:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-item-preview-none svg{width:14px;height:14px}.ui-basemap-item-info{display:flex;flex-direction:column;min-width:0;flex:1}.ui-basemap-item-nome{font-size:11px;font-weight:500;color:var(--ui-cor-texto, #f1f1f5);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-basemap-item.active .ui-basemap-item-nome{color:var(--ui-cor-primaria, #00E08A);font-weight:600}.ui-basemap-item-desc{font-size:9.5px;color:var(--ui-cor-texto-secundario, #77778b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-basemap-item-check{display:flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--ui-cor-primaria, #00E08A);opacity:0;transform:scale(.6);transition:all .15s cubic-bezier(.16,1,.3,1)}.ui-basemap-item.active .ui-basemap-item-check{opacity:1;transform:scale(1)}.ui-basemap-item-check svg{width:13px;height:13px}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-basemap-trigger[data-degrade]:not([data-degrade=false]),.ui-basemap-popover[data-degrade]:not([data-degrade=false]){--ui-basemap-gatilho-fundo: var(--ui-gradiente-elevado);--ui-basemap-gatilho-ativo-fundo: var(--ui-gradiente-elevado);--ui-basemap-popover-fundo: var(--ui-gradiente-elevado)}', x = "https://server.arcgisonline.com/ArcGIS/rest/services", O = [
|
|
7
42
|
{
|
|
8
43
|
id: "none",
|
|
9
44
|
nome: "Sem Mapa",
|
|
@@ -13,53 +48,53 @@ const w = ':host{display:inline-block;font-family:var(--ui-fonte-base, "Inter",
|
|
|
13
48
|
id: "google_satelite_puro",
|
|
14
49
|
nome: "Google Puro",
|
|
15
50
|
descricao: "Satélite limpo sem ruas ou rótulos",
|
|
16
|
-
|
|
51
|
+
tileUrl: "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}"
|
|
17
52
|
},
|
|
18
53
|
{
|
|
19
54
|
id: "google_satelite",
|
|
20
55
|
nome: "Google Híbrido",
|
|
21
56
|
descricao: "Satélite com nomes de ruas e divisas",
|
|
22
|
-
|
|
57
|
+
tileUrl: "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}"
|
|
23
58
|
},
|
|
24
59
|
{
|
|
25
60
|
id: "satelite",
|
|
26
61
|
nome: "Esri Satélite",
|
|
27
62
|
descricao: "Imagens orbitais de alta resolução",
|
|
28
|
-
|
|
63
|
+
tileUrl: `${x}/World_Imagery/MapServer/tile/{z}/{y}/{x}`
|
|
29
64
|
},
|
|
30
65
|
{
|
|
31
66
|
id: "osm",
|
|
32
67
|
nome: "OpenStreetMap",
|
|
33
68
|
descricao: "Mapa viário e urbano colaborativo",
|
|
34
|
-
|
|
69
|
+
tileUrl: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
35
70
|
},
|
|
36
71
|
{
|
|
37
72
|
id: "topografia",
|
|
38
73
|
nome: "Topografia",
|
|
39
74
|
descricao: "Curvas de nível e relevo sombreado",
|
|
40
|
-
|
|
75
|
+
tileUrl: "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png"
|
|
41
76
|
},
|
|
42
77
|
{
|
|
43
78
|
id: "dark",
|
|
44
79
|
nome: "Dark Canvas",
|
|
45
80
|
descricao: "Mapa escuro de alto contraste para CAD",
|
|
46
|
-
|
|
81
|
+
tileUrl: `${x}/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}`
|
|
47
82
|
}
|
|
48
|
-
],
|
|
83
|
+
], f = `
|
|
49
84
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
50
85
|
<circle cx="12" cy="12" r="10"></circle>
|
|
51
86
|
<line x1="2" y1="12" x2="22" y2="12"></line>
|
|
52
87
|
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
|
|
53
88
|
</svg>
|
|
54
|
-
`,
|
|
89
|
+
`, T = `
|
|
55
90
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
56
91
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
57
92
|
</svg>
|
|
58
|
-
`,
|
|
93
|
+
`, L = `
|
|
59
94
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
|
|
60
95
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
61
96
|
</svg>
|
|
62
|
-
`,
|
|
97
|
+
`, d = `
|
|
63
98
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
64
99
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
65
100
|
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
@@ -68,31 +103,32 @@ const w = ':host{display:inline-block;font-family:var(--ui-fonte-base, "Inter",
|
|
|
68
103
|
<line x1="15" y1="3" x2="15" y2="21"></line>
|
|
69
104
|
</svg>
|
|
70
105
|
`;
|
|
71
|
-
class
|
|
106
|
+
class E extends z {
|
|
72
107
|
constructor() {
|
|
73
108
|
super();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
109
|
+
p(this, "shadow");
|
|
110
|
+
p(this, "listeners", new C());
|
|
111
|
+
p(this, "_mapasBase", [...O]);
|
|
112
|
+
p(this, "wrapperEl");
|
|
113
|
+
p(this, "triggerBtn");
|
|
114
|
+
p(this, "popoverEl");
|
|
115
|
+
p(this, "listEl");
|
|
116
|
+
p(this, "thumbEl");
|
|
117
|
+
p(this, "labelEl");
|
|
118
|
+
p(this, "tileMiniatura", g(l.lat, l.lng, l.zoom));
|
|
83
119
|
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
|
|
84
|
-
<style>${
|
|
120
|
+
<style>${H}</style>
|
|
85
121
|
<div class="ui-basemap-wrapper" id="basemap-wrapper">
|
|
86
122
|
<button class="ui-basemap-trigger" id="basemap-trigger" part="base" type="button" aria-haspopup="listbox" aria-expanded="false" title="Alternar Mapa Base">
|
|
87
123
|
<span class="ui-basemap-thumb-container" id="thumb-container"></span>
|
|
88
124
|
<span class="ui-basemap-label" id="basemap-label">Esri Satélite</span>
|
|
89
|
-
<span class="ui-basemap-chevron">${
|
|
125
|
+
<span class="ui-basemap-chevron">${T}</span>
|
|
90
126
|
</button>
|
|
91
127
|
|
|
92
128
|
<div class="ui-basemap-popover" id="basemap-popover" part="lista" role="listbox" aria-label="Selecione o Mapa Base">
|
|
93
129
|
<div class="ui-basemap-popover-header">
|
|
94
130
|
<span class="ui-basemap-popover-titulo">Mapa Base</span>
|
|
95
|
-
<span class="ui-basemap-popover-badge" id="popover-count"
|
|
131
|
+
<span class="ui-basemap-popover-badge" id="popover-count"></span>
|
|
96
132
|
</div>
|
|
97
133
|
<div class="ui-basemap-list" id="basemap-list"></div>
|
|
98
134
|
</div>
|
|
@@ -107,19 +143,20 @@ class b extends g {
|
|
|
107
143
|
"aberto",
|
|
108
144
|
"compacto",
|
|
109
145
|
"desabilitado",
|
|
110
|
-
|
|
146
|
+
"centro-miniatura",
|
|
147
|
+
...B
|
|
111
148
|
];
|
|
112
149
|
}
|
|
113
150
|
connectedCallback() {
|
|
114
|
-
|
|
151
|
+
this.tileMiniatura = this.calcularTileMiniatura(), m(this, this.triggerBtn), m(this, this.popoverEl), this.atualizarPosicaoClasses(), this.renderizarOpcoes(), this.atualizarGatilho(), this.conectarEventos();
|
|
115
152
|
}
|
|
116
153
|
disconnectedCallback() {
|
|
117
154
|
this.listeners.cleanup();
|
|
118
155
|
}
|
|
119
|
-
attributeChangedCallback(e, i,
|
|
120
|
-
if (i !==
|
|
121
|
-
if (
|
|
122
|
-
|
|
156
|
+
attributeChangedCallback(e, i, t) {
|
|
157
|
+
if (i !== t) {
|
|
158
|
+
if (S(e)) {
|
|
159
|
+
m(this, this.triggerBtn), m(this, this.popoverEl);
|
|
123
160
|
return;
|
|
124
161
|
}
|
|
125
162
|
if (e === "mapa-base-ativo" || e === "valor")
|
|
@@ -127,13 +164,17 @@ class b extends g {
|
|
|
127
164
|
else if (e === "posicao")
|
|
128
165
|
this.atualizarPosicaoClasses();
|
|
129
166
|
else if (e === "aberto") {
|
|
130
|
-
const
|
|
131
|
-
this.aplicarEstadoAberto(
|
|
167
|
+
const a = t !== null && t !== "false";
|
|
168
|
+
this.aplicarEstadoAberto(a);
|
|
132
169
|
} else if (e === "compacto")
|
|
133
|
-
this.triggerBtn.classList.toggle("compacto",
|
|
134
|
-
else if (e === "
|
|
135
|
-
const
|
|
136
|
-
|
|
170
|
+
this.triggerBtn.classList.toggle("compacto", t !== null && t !== "false");
|
|
171
|
+
else if (e === "centro-miniatura") {
|
|
172
|
+
const a = this.calcularTileMiniatura(), s = this.tileMiniatura;
|
|
173
|
+
if (a.z === s.z && a.x === s.x && a.y === s.y) return;
|
|
174
|
+
this.tileMiniatura = a, this.renderizarOpcoes(), this.atualizarGatilho();
|
|
175
|
+
} else if (e === "desabilitado") {
|
|
176
|
+
const a = t !== null && t !== "false";
|
|
177
|
+
this.triggerBtn.disabled = a, a && this.fechar();
|
|
137
178
|
}
|
|
138
179
|
}
|
|
139
180
|
}
|
|
@@ -195,12 +236,12 @@ class b extends g {
|
|
|
195
236
|
this.fechar();
|
|
196
237
|
return;
|
|
197
238
|
}
|
|
198
|
-
const i = this._mapasBase.find((
|
|
239
|
+
const i = this._mapasBase.find((a) => a.id === e);
|
|
199
240
|
if (!i) return;
|
|
200
241
|
this.mapaBaseAtivo = e;
|
|
201
|
-
const
|
|
242
|
+
const t = { mapaBaseId: e, item: i };
|
|
202
243
|
this.dispatchEvent(new CustomEvent("ui-mapa-base-alterado", {
|
|
203
|
-
detail:
|
|
244
|
+
detail: t,
|
|
204
245
|
bubbles: !0,
|
|
205
246
|
composed: !0
|
|
206
247
|
})), this.dispatchEvent(new CustomEvent("change", {
|
|
@@ -210,35 +251,63 @@ class b extends g {
|
|
|
210
251
|
})), this.fechar();
|
|
211
252
|
}
|
|
212
253
|
// --- Renderização Interna ---
|
|
254
|
+
calcularTileMiniatura() {
|
|
255
|
+
const e = I(this.getAttribute("centro-miniatura")) ?? l;
|
|
256
|
+
return g(e.lat, e.lng, e.zoom);
|
|
257
|
+
}
|
|
258
|
+
/** `inline`/`auto` (ou valor desconhecido) decidem a direção ao abrir; as posições de canto são fixas. */
|
|
259
|
+
posicaoAutomatica() {
|
|
260
|
+
return !["bottom-left", "bottom-right", "top-left", "top-right"].includes(this.posicao);
|
|
261
|
+
}
|
|
213
262
|
atualizarPosicaoClasses() {
|
|
214
|
-
const e = this.posicao;
|
|
215
|
-
this.wrapperEl.className = `ui-basemap-wrapper pos-${e}`;
|
|
263
|
+
const e = this.posicao, i = this.posicaoAutomatica(), t = this.wrapperEl.classList.contains("abre-baixo") ? "abre-baixo" : "abre-cima";
|
|
264
|
+
this.wrapperEl.className = `ui-basemap-wrapper pos-${i ? "auto" : e}${i ? ` ${t}` : ""}`;
|
|
265
|
+
}
|
|
266
|
+
/** Mede o espaço na janela e escolhe abrir para cima ou para baixo; limita a lista ao espaço disponível. */
|
|
267
|
+
ajustarDirecao() {
|
|
268
|
+
if (!(!this.posicaoAutomatica() || typeof window > "u"))
|
|
269
|
+
try {
|
|
270
|
+
const e = this.triggerBtn.getBoundingClientRect(), i = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
271
|
+
if (!i || !e.width && !e.height) return;
|
|
272
|
+
const t = 16, a = e.top - t, s = i - e.bottom - t;
|
|
273
|
+
this.listEl.style.maxHeight = "";
|
|
274
|
+
const n = $(a, s, this.popoverEl.offsetHeight + 8);
|
|
275
|
+
this.wrapperEl.classList.toggle("abre-cima", n === "cima"), this.wrapperEl.classList.toggle("abre-baixo", n === "baixo");
|
|
276
|
+
const c = (n === "cima" ? a : s) - 8, b = this.popoverEl.offsetHeight - this.listEl.offsetHeight;
|
|
277
|
+
this.popoverEl.offsetHeight > c && (this.listEl.style.maxHeight = `${Math.max(96, Math.floor(c - b))}px`);
|
|
278
|
+
} catch {
|
|
279
|
+
}
|
|
216
280
|
}
|
|
217
281
|
aplicarEstadoAberto(e) {
|
|
218
|
-
this.popoverEl.classList.toggle("aberto", e), this.triggerBtn.classList.toggle("active", e), this.triggerBtn.setAttribute("aria-expanded", String(e));
|
|
282
|
+
e && this.ajustarDirecao(), this.popoverEl.classList.toggle("aberto", e), this.triggerBtn.classList.toggle("active", e), this.triggerBtn.setAttribute("aria-expanded", String(e));
|
|
219
283
|
}
|
|
220
284
|
atualizarGatilho() {
|
|
221
|
-
const e = this.mapaBaseAtivo, i = this._mapasBase.find((
|
|
222
|
-
|
|
285
|
+
const e = this.mapaBaseAtivo, i = this._mapasBase.find((t) => t.id === e);
|
|
286
|
+
if (i) {
|
|
287
|
+
this.labelEl.textContent = i.nome, this.triggerBtn.title = i.descricao ? `Mapa Base: ${i.nome} (${i.descricao})` : `Mapa Base: ${i.nome}`;
|
|
288
|
+
const t = v(i, this.tileMiniatura);
|
|
289
|
+
t ? this.thumbEl.innerHTML = `<img class="ui-basemap-thumb-mini" src="${u(t)}" alt="" referrerpolicy="no-referrer" decoding="async" />` : this.thumbEl.innerHTML = `<span class="ui-basemap-thumb-mini fallback">${d}</span>`;
|
|
290
|
+
} else
|
|
291
|
+
this.labelEl.textContent = "Mapa Base", this.triggerBtn.title = "Alternar Mapa Base", this.thumbEl.innerHTML = `<span class="ui-basemap-thumb-mini fallback">${f}</span>`;
|
|
223
292
|
}
|
|
224
293
|
renderizarOpcoes() {
|
|
225
294
|
const e = this.shadow.getElementById("popover-count");
|
|
226
|
-
e && (e.textContent =
|
|
295
|
+
e && (e.textContent = _(this._mapasBase.length));
|
|
227
296
|
const i = this.mapaBaseAtivo;
|
|
228
|
-
this.listEl.innerHTML = this._mapasBase.map((
|
|
229
|
-
const
|
|
297
|
+
this.listEl.innerHTML = this._mapasBase.map((t) => {
|
|
298
|
+
const a = t.id === i, s = v(t, this.tileMiniatura), n = s ? `<img class="ui-basemap-item-preview" src="${u(s)}" alt="" loading="lazy" referrerpolicy="no-referrer" decoding="async" />` : `<div class="ui-basemap-item-preview-none">${d}</div>`;
|
|
230
299
|
return `
|
|
231
|
-
<div class="ui-basemap-item ${
|
|
232
|
-
data-id="${
|
|
300
|
+
<div class="ui-basemap-item ${a ? "active" : ""}"
|
|
301
|
+
data-id="${u(t.id)}"
|
|
233
302
|
role="option"
|
|
234
|
-
aria-selected="${
|
|
303
|
+
aria-selected="${a}"
|
|
235
304
|
tabindex="0">
|
|
236
|
-
${
|
|
305
|
+
${n}
|
|
237
306
|
<div class="ui-basemap-item-info">
|
|
238
|
-
<span class="ui-basemap-item-nome">${
|
|
239
|
-
${
|
|
307
|
+
<span class="ui-basemap-item-nome">${u(t.nome)}</span>
|
|
308
|
+
${t.descricao ? `<span class="ui-basemap-item-desc">${u(t.descricao)}</span>` : ""}
|
|
240
309
|
</div>
|
|
241
|
-
<span class="ui-basemap-item-check">${
|
|
310
|
+
<span class="ui-basemap-item-check">${L}</span>
|
|
242
311
|
</div>
|
|
243
312
|
`;
|
|
244
313
|
}).join("");
|
|
@@ -246,84 +315,96 @@ class b extends g {
|
|
|
246
315
|
focarItem(e) {
|
|
247
316
|
const i = Array.from(this.listEl.querySelectorAll(".ui-basemap-item"));
|
|
248
317
|
if (i.length === 0) return;
|
|
249
|
-
const
|
|
250
|
-
let
|
|
318
|
+
const t = i.indexOf(this.shadow.activeElement);
|
|
319
|
+
let a;
|
|
251
320
|
switch (e) {
|
|
252
321
|
case "ativo":
|
|
253
|
-
|
|
322
|
+
a = Math.max(0, i.findIndex((s) => s.classList.contains("active")));
|
|
254
323
|
break;
|
|
255
324
|
case "proximo":
|
|
256
|
-
|
|
325
|
+
a = Math.min(i.length - 1, t + 1);
|
|
257
326
|
break;
|
|
258
327
|
case "anterior":
|
|
259
|
-
|
|
328
|
+
a = Math.max(0, t - 1);
|
|
260
329
|
break;
|
|
261
330
|
case "primeiro":
|
|
262
|
-
|
|
331
|
+
a = 0;
|
|
263
332
|
break;
|
|
264
333
|
default:
|
|
265
|
-
|
|
334
|
+
a = i.length - 1;
|
|
266
335
|
}
|
|
267
|
-
i[
|
|
336
|
+
i[a].focus();
|
|
268
337
|
}
|
|
269
338
|
atualizarSelecaoVisual() {
|
|
270
339
|
const e = this.mapaBaseAtivo;
|
|
271
|
-
this.listEl.querySelectorAll(".ui-basemap-item").forEach((
|
|
272
|
-
const
|
|
273
|
-
|
|
340
|
+
this.listEl.querySelectorAll(".ui-basemap-item").forEach((t) => {
|
|
341
|
+
const s = t.getAttribute("data-id") === e;
|
|
342
|
+
t.classList.toggle("active", s), t.setAttribute("aria-selected", String(s));
|
|
274
343
|
});
|
|
275
344
|
}
|
|
276
345
|
conectarEventos() {
|
|
277
|
-
this.listeners.add(this.triggerBtn, "click", (
|
|
278
|
-
|
|
279
|
-
}), this.listeners.add(this.listEl, "click", (
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
}), this.listeners.add(this.listEl, "keydown", (
|
|
285
|
-
const
|
|
346
|
+
this.listeners.add(this.triggerBtn, "click", (t) => {
|
|
347
|
+
t.stopPropagation(), this.alternar(), this.aberto && t.detail === 0 && this.focarItem("ativo");
|
|
348
|
+
}), this.listeners.add(this.listEl, "click", (t) => {
|
|
349
|
+
const a = t.target.closest(".ui-basemap-item");
|
|
350
|
+
if (!a) return;
|
|
351
|
+
const s = a.getAttribute("data-id");
|
|
352
|
+
s && this.selecionar(s);
|
|
353
|
+
}), this.listeners.add(this.listEl, "keydown", (t) => {
|
|
354
|
+
const a = {
|
|
286
355
|
ArrowDown: "proximo",
|
|
287
356
|
ArrowUp: "anterior",
|
|
288
357
|
Home: "primeiro",
|
|
289
358
|
End: "ultimo"
|
|
290
359
|
};
|
|
291
|
-
if (t
|
|
292
|
-
|
|
360
|
+
if (a[t.key]) {
|
|
361
|
+
t.preventDefault(), this.focarItem(a[t.key]);
|
|
293
362
|
return;
|
|
294
363
|
}
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
364
|
+
if (t.key === "Enter" || t.key === " ") {
|
|
365
|
+
const s = t.target.closest(".ui-basemap-item");
|
|
366
|
+
if (s) {
|
|
367
|
+
t.preventDefault();
|
|
368
|
+
const n = s.getAttribute("data-id");
|
|
369
|
+
n && this.selecionar(n);
|
|
301
370
|
}
|
|
302
371
|
}
|
|
303
372
|
});
|
|
304
|
-
const e = (
|
|
373
|
+
const e = (t) => {
|
|
305
374
|
if (!this.aberto) return;
|
|
306
|
-
|
|
375
|
+
t.composedPath().includes(this) || this.fechar();
|
|
307
376
|
};
|
|
308
|
-
this.listeners.add(document, "click", e), this.listeners.add(this.wrapperEl, "focusout", (
|
|
309
|
-
const
|
|
310
|
-
this.aberto &&
|
|
311
|
-
})
|
|
312
|
-
|
|
313
|
-
a.
|
|
377
|
+
this.listeners.add(document, "click", e), this.listeners.add(this.wrapperEl, "focusout", (t) => {
|
|
378
|
+
const a = t.relatedTarget;
|
|
379
|
+
this.aberto && a && !this.shadow.contains(a) && !this.contains(a) && this.fechar();
|
|
380
|
+
}), this.listeners.add(this.shadow, "error", (t) => {
|
|
381
|
+
const a = t.target;
|
|
382
|
+
if (!a || a.tagName !== "IMG") return;
|
|
383
|
+
const s = document.createElement("span"), n = a.classList.contains("ui-basemap-thumb-mini");
|
|
384
|
+
s.className = n ? "ui-basemap-thumb-mini fallback" : "ui-basemap-item-preview-none", s.innerHTML = n ? f : d, a.replaceWith(s);
|
|
385
|
+
}, !0);
|
|
386
|
+
const i = (t) => {
|
|
387
|
+
t.key === "Escape" && this.aberto && (this.fechar(), this.triggerBtn.focus());
|
|
314
388
|
};
|
|
315
389
|
this.listeners.add(document, "keydown", i);
|
|
316
390
|
}
|
|
317
391
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
392
|
+
function u(r) {
|
|
393
|
+
return r ? String(r).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") : "";
|
|
320
394
|
}
|
|
321
|
-
class
|
|
395
|
+
class D extends E {
|
|
322
396
|
}
|
|
323
|
-
|
|
324
|
-
|
|
397
|
+
w("ui-seletor-mapa-base", E);
|
|
398
|
+
w("ui-mapa-base", D);
|
|
325
399
|
export {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
400
|
+
l as CENTRO_MINIATURA_PADRAO,
|
|
401
|
+
O as MAPAS_BASE_PADRAO,
|
|
402
|
+
D as UIMapaBase,
|
|
403
|
+
E as UISeletorMapaBase,
|
|
404
|
+
$ as decidirAbertura,
|
|
405
|
+
I as lerCentroMiniatura,
|
|
406
|
+
N as preencherModeloTile,
|
|
407
|
+
_ as textoContagem,
|
|
408
|
+
g as tileDoPonto,
|
|
409
|
+
v as urlMiniatura
|
|
329
410
|
};
|
|
@@ -856,6 +856,7 @@ export interface PropsUiMapaBase {
|
|
|
856
856
|
aberto?: UIMapaBase['aberto'];
|
|
857
857
|
compacto?: UIMapaBase['compacto'];
|
|
858
858
|
desabilitado?: UIMapaBase['desabilitado'];
|
|
859
|
+
'centro-miniatura'?: ValorDeAtributo;
|
|
859
860
|
mapaBaseAtivo?: UIMapaBase['mapaBaseAtivo'];
|
|
860
861
|
'onui-mapa-base-alterado'?: (evento: CustomEvent) => void;
|
|
861
862
|
}
|
|
@@ -1309,6 +1310,7 @@ export interface PropsUiSeletorMapaBase {
|
|
|
1309
1310
|
aberto?: UISeletorMapaBase['aberto'];
|
|
1310
1311
|
compacto?: UISeletorMapaBase['compacto'];
|
|
1311
1312
|
desabilitado?: UISeletorMapaBase['desabilitado'];
|
|
1313
|
+
'centro-miniatura'?: ValorDeAtributo;
|
|
1312
1314
|
mapaBaseAtivo?: UISeletorMapaBase['mapaBaseAtivo'];
|
|
1313
1315
|
'onui-mapa-base-alterado'?: (evento: CustomEvent) => void;
|
|
1314
1316
|
}
|
package/dist/tipos-vue.d.ts
CHANGED
|
@@ -829,6 +829,7 @@ type PropsVueUiMapaBase = {
|
|
|
829
829
|
aberto?: UIMapaBase['aberto'];
|
|
830
830
|
compacto?: UIMapaBase['compacto'];
|
|
831
831
|
desabilitado?: UIMapaBase['desabilitado'];
|
|
832
|
+
centroMiniatura?: ValorDeAtributo;
|
|
832
833
|
onUiMapaBaseAlterado?: (evento: CustomEvent) => void;
|
|
833
834
|
};
|
|
834
835
|
|
|
@@ -1258,6 +1259,7 @@ type PropsVueUiSeletorMapaBase = {
|
|
|
1258
1259
|
aberto?: UISeletorMapaBase['aberto'];
|
|
1259
1260
|
compacto?: UISeletorMapaBase['compacto'];
|
|
1260
1261
|
desabilitado?: UISeletorMapaBase['desabilitado'];
|
|
1262
|
+
centroMiniatura?: ValorDeAtributo;
|
|
1261
1263
|
onUiMapaBaseAlterado?: (evento: CustomEvent) => void;
|
|
1262
1264
|
};
|
|
1263
1265
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thibezer/ui-components-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"description": "Web Components nativos (W3C Custom Elements + Shadow DOM) para interfaces densas de GIS, CAD e formulários, sem dependência de framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|