@thibezer/ui-components-kit 2.30.0 → 2.31.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 +42 -0
- package/dist/camadas.cjs +1 -1
- package/dist/camadas.js +1 -1
- package/dist/canvas.cjs +67 -67
- package/dist/canvas.js +1788 -1381
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +6 -0
- package/dist/custom-elements.json +29797 -29723
- 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 +7 -7
- package/dist/seletor-mapa-base.js +50 -38
- 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
|
@@ -2,43 +2,43 @@ var k = Object.defineProperty;
|
|
|
2
2
|
var M = (r, o, e) => o in r ? k(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
3
3
|
var p = (r, o, e) => M(r, typeof o != "symbol" ? o + "" : o, e);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { S as z, A as B, L as C, g as
|
|
6
|
-
const
|
|
5
|
+
import { S as z, A as B, L as C, g as b, s as S, d as w } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
const c = { lat: 0, lng: 0, zoom: 2 }, y = 19, h = 85.05112878;
|
|
7
7
|
function _(r) {
|
|
8
8
|
const o = Number.isFinite(r) && r > 0 ? Math.floor(r) : 0;
|
|
9
9
|
return `${o} ${o === 1 ? "opção" : "opções"}`;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function L(r, o, e) {
|
|
12
12
|
const i = Number.isFinite(r) ? r : 0, t = Number.isFinite(o) ? o : 0, a = Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
13
13
|
return t >= a ? "baixo" : i > t ? "cima" : "baixo";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function $(r) {
|
|
16
16
|
if (typeof r != "string" || !r.trim()) return null;
|
|
17
17
|
const o = r.split(",").map((s) => Number(s.trim()));
|
|
18
18
|
if (o.length < 2 || o.length > 3) return null;
|
|
19
19
|
const [e, i, t] = o;
|
|
20
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 :
|
|
21
|
+
const a = o.length === 3 ? t : c.zoom;
|
|
22
22
|
return Number.isFinite(a) ? { lat: e, lng: i, zoom: Math.min(y, Math.max(0, Math.round(a))) } : null;
|
|
23
23
|
}
|
|
24
24
|
function g(r, o, e) {
|
|
25
|
-
const i = Number.isFinite(e) ? Math.min(y, Math.max(0, Math.round(e))) :
|
|
25
|
+
const i = Number.isFinite(e) ? Math.min(y, Math.max(0, Math.round(e))) : c.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, l = (m) => Math.min(t - 1, Math.max(0, Math.floor(m)));
|
|
26
26
|
return {
|
|
27
27
|
z: i,
|
|
28
|
-
x:
|
|
29
|
-
y:
|
|
28
|
+
x: l((s + 180) / 360 * t),
|
|
29
|
+
y: l((1 - Math.log(Math.tan(n) + 1 / Math.cos(n)) / Math.PI) / 2 * t)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function A(r) {
|
|
33
33
|
return /^https?:\/\//i.test(r.trim());
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function I(r, o) {
|
|
36
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
37
|
}
|
|
38
38
|
function v(r, o) {
|
|
39
|
-
return r ? typeof r.thumbnailUrl == "string" && A(r.thumbnailUrl) ? r.thumbnailUrl :
|
|
39
|
+
return r ? typeof r.thumbnailUrl == "string" && A(r.thumbnailUrl) ? r.thumbnailUrl : I(r.tileUrl, o) : null;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const O = ':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.pendente{display:block;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent)}.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", N = [
|
|
42
42
|
{
|
|
43
43
|
id: "none",
|
|
44
44
|
nome: "Sem Mapa",
|
|
@@ -66,7 +66,7 @@ const H = ':host{display:inline-block;font-family:var(--ui-fonte-base, "Inter",
|
|
|
66
66
|
id: "osm",
|
|
67
67
|
nome: "OpenStreetMap",
|
|
68
68
|
descricao: "Mapa viário e urbano colaborativo",
|
|
69
|
-
tileUrl: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
69
|
+
tileUrl: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
id: "topografia",
|
|
@@ -86,11 +86,11 @@ const H = ':host{display:inline-block;font-family:var(--ui-fonte-base, "Inter",
|
|
|
86
86
|
<line x1="2" y1="12" x2="22" y2="12"></line>
|
|
87
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>
|
|
88
88
|
</svg>
|
|
89
|
-
`,
|
|
89
|
+
`, H = `
|
|
90
90
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
91
91
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
92
92
|
</svg>
|
|
93
|
-
`,
|
|
93
|
+
`, T = `
|
|
94
94
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
|
|
95
95
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
96
96
|
</svg>
|
|
@@ -108,21 +108,25 @@ class E extends z {
|
|
|
108
108
|
super();
|
|
109
109
|
p(this, "shadow");
|
|
110
110
|
p(this, "listeners", new C());
|
|
111
|
-
p(this, "_mapasBase", [...
|
|
111
|
+
p(this, "_mapasBase", [...N]);
|
|
112
112
|
p(this, "wrapperEl");
|
|
113
113
|
p(this, "triggerBtn");
|
|
114
114
|
p(this, "popoverEl");
|
|
115
115
|
p(this, "listEl");
|
|
116
116
|
p(this, "thumbEl");
|
|
117
117
|
p(this, "labelEl");
|
|
118
|
-
|
|
118
|
+
/** As miniaturas da lista só são pedidas na 1ª abertura (não disputam rede com o mapa na carga da página). */
|
|
119
|
+
p(this, "miniaturasLiberadas", !1);
|
|
120
|
+
/** Lista mudou (centro/catálogo) com o popover fechado: re-renderiza na próxima abertura. */
|
|
121
|
+
p(this, "opcoesPendentes", !1);
|
|
122
|
+
p(this, "tileMiniatura", g(c.lat, c.lng, c.zoom));
|
|
119
123
|
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
|
|
120
|
-
<style>${
|
|
124
|
+
<style>${O}</style>
|
|
121
125
|
<div class="ui-basemap-wrapper" id="basemap-wrapper">
|
|
122
126
|
<button class="ui-basemap-trigger" id="basemap-trigger" part="base" type="button" aria-haspopup="listbox" aria-expanded="false" title="Alternar Mapa Base">
|
|
123
127
|
<span class="ui-basemap-thumb-container" id="thumb-container"></span>
|
|
124
128
|
<span class="ui-basemap-label" id="basemap-label">Esri Satélite</span>
|
|
125
|
-
<span class="ui-basemap-chevron">${
|
|
129
|
+
<span class="ui-basemap-chevron">${H}</span>
|
|
126
130
|
</button>
|
|
127
131
|
|
|
128
132
|
<div class="ui-basemap-popover" id="basemap-popover" part="lista" role="listbox" aria-label="Selecione o Mapa Base">
|
|
@@ -148,7 +152,7 @@ class E extends z {
|
|
|
148
152
|
];
|
|
149
153
|
}
|
|
150
154
|
connectedCallback() {
|
|
151
|
-
this.tileMiniatura = this.calcularTileMiniatura(),
|
|
155
|
+
this.tileMiniatura = this.calcularTileMiniatura(), b(this, this.triggerBtn), b(this, this.popoverEl), this.atualizarPosicaoClasses(), this.renderizarOpcoes(), this.atualizarGatilho(), this.conectarEventos();
|
|
152
156
|
}
|
|
153
157
|
disconnectedCallback() {
|
|
154
158
|
this.listeners.cleanup();
|
|
@@ -156,7 +160,7 @@ class E extends z {
|
|
|
156
160
|
attributeChangedCallback(e, i, t) {
|
|
157
161
|
if (i !== t) {
|
|
158
162
|
if (S(e)) {
|
|
159
|
-
|
|
163
|
+
b(this, this.triggerBtn), b(this, this.popoverEl);
|
|
160
164
|
return;
|
|
161
165
|
}
|
|
162
166
|
if (e === "mapa-base-ativo" || e === "valor")
|
|
@@ -171,7 +175,7 @@ class E extends z {
|
|
|
171
175
|
else if (e === "centro-miniatura") {
|
|
172
176
|
const a = this.calcularTileMiniatura(), s = this.tileMiniatura;
|
|
173
177
|
if (a.z === s.z && a.x === s.x && a.y === s.y) return;
|
|
174
|
-
this.tileMiniatura = a, this.
|
|
178
|
+
this.tileMiniatura = a, this.renderizarOpcoesSeVisivel(), this.atualizarGatilho();
|
|
175
179
|
} else if (e === "desabilitado") {
|
|
176
180
|
const a = t !== null && t !== "false";
|
|
177
181
|
this.triggerBtn.disabled = a, a && this.fechar();
|
|
@@ -219,7 +223,7 @@ class E extends z {
|
|
|
219
223
|
return this._mapasBase;
|
|
220
224
|
}
|
|
221
225
|
definirMapasBase(e) {
|
|
222
|
-
Array.isArray(e) && (this._mapasBase = [...e], this.
|
|
226
|
+
Array.isArray(e) && (this._mapasBase = [...e], this.renderizarOpcoesSeVisivel(), this.atualizarGatilho());
|
|
223
227
|
}
|
|
224
228
|
// --- Ações Públicas ---
|
|
225
229
|
abrir() {
|
|
@@ -252,7 +256,7 @@ class E extends z {
|
|
|
252
256
|
}
|
|
253
257
|
// --- Renderização Interna ---
|
|
254
258
|
calcularTileMiniatura() {
|
|
255
|
-
const e =
|
|
259
|
+
const e = $(this.getAttribute("centro-miniatura")) ?? c;
|
|
256
260
|
return g(e.lat, e.lng, e.zoom);
|
|
257
261
|
}
|
|
258
262
|
/** `inline`/`auto` (ou valor desconhecido) decidem a direção ao abrir; as posições de canto são fixas. */
|
|
@@ -271,15 +275,23 @@ class E extends z {
|
|
|
271
275
|
if (!i || !e.width && !e.height) return;
|
|
272
276
|
const t = 16, a = e.top - t, s = i - e.bottom - t;
|
|
273
277
|
this.listEl.style.maxHeight = "";
|
|
274
|
-
const n =
|
|
278
|
+
const n = L(a, s, this.popoverEl.offsetHeight + 8);
|
|
275
279
|
this.wrapperEl.classList.toggle("abre-cima", n === "cima"), this.wrapperEl.classList.toggle("abre-baixo", n === "baixo");
|
|
276
|
-
const
|
|
277
|
-
this.popoverEl.offsetHeight >
|
|
280
|
+
const l = (n === "cima" ? a : s) - 8, m = this.popoverEl.offsetHeight - this.listEl.offsetHeight;
|
|
281
|
+
this.popoverEl.offsetHeight > l && (this.listEl.style.maxHeight = `${Math.max(96, Math.floor(l - m))}px`);
|
|
278
282
|
} catch {
|
|
279
283
|
}
|
|
280
284
|
}
|
|
285
|
+
/** Fechado com miniaturas já liberadas: adia a troca de imagens para a próxima abertura. */
|
|
286
|
+
renderizarOpcoesSeVisivel() {
|
|
287
|
+
if (this.miniaturasLiberadas && !this.aberto) {
|
|
288
|
+
this.opcoesPendentes = !0;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.renderizarOpcoes();
|
|
292
|
+
}
|
|
281
293
|
aplicarEstadoAberto(e) {
|
|
282
|
-
e && this.ajustarDirecao(), this.popoverEl.classList.toggle("aberto", e), this.triggerBtn.classList.toggle("active", e), this.triggerBtn.setAttribute("aria-expanded", String(e));
|
|
294
|
+
e && (!this.miniaturasLiberadas || this.opcoesPendentes) && (this.miniaturasLiberadas = !0, this.opcoesPendentes = !1, this.renderizarOpcoes()), e && this.ajustarDirecao(), this.popoverEl.classList.toggle("aberto", e), this.triggerBtn.classList.toggle("active", e), this.triggerBtn.setAttribute("aria-expanded", String(e));
|
|
283
295
|
}
|
|
284
296
|
atualizarGatilho() {
|
|
285
297
|
const e = this.mapaBaseAtivo, i = this._mapasBase.find((t) => t.id === e);
|
|
@@ -295,19 +307,19 @@ class E extends z {
|
|
|
295
307
|
e && (e.textContent = _(this._mapasBase.length));
|
|
296
308
|
const i = this.mapaBaseAtivo;
|
|
297
309
|
this.listEl.innerHTML = this._mapasBase.map((t) => {
|
|
298
|
-
const a = t.id === i, s = v(t, this.tileMiniatura),
|
|
310
|
+
const a = t.id === i, s = this.miniaturasLiberadas ? v(t, this.tileMiniatura) : null, l = !this.miniaturasLiberadas && !!(t.thumbnailUrl || t.tileUrl) ? '<span class="ui-basemap-item-preview pendente" aria-hidden="true"></span>' : 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>`;
|
|
299
311
|
return `
|
|
300
312
|
<div class="ui-basemap-item ${a ? "active" : ""}"
|
|
301
313
|
data-id="${u(t.id)}"
|
|
302
314
|
role="option"
|
|
303
315
|
aria-selected="${a}"
|
|
304
316
|
tabindex="0">
|
|
305
|
-
${
|
|
317
|
+
${l}
|
|
306
318
|
<div class="ui-basemap-item-info">
|
|
307
319
|
<span class="ui-basemap-item-nome">${u(t.nome)}</span>
|
|
308
320
|
${t.descricao ? `<span class="ui-basemap-item-desc">${u(t.descricao)}</span>` : ""}
|
|
309
321
|
</div>
|
|
310
|
-
<span class="ui-basemap-item-check">${
|
|
322
|
+
<span class="ui-basemap-item-check">${T}</span>
|
|
311
323
|
</div>
|
|
312
324
|
`;
|
|
313
325
|
}).join("");
|
|
@@ -392,18 +404,18 @@ class E extends z {
|
|
|
392
404
|
function u(r) {
|
|
393
405
|
return r ? String(r).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") : "";
|
|
394
406
|
}
|
|
395
|
-
class
|
|
407
|
+
class U extends E {
|
|
396
408
|
}
|
|
397
409
|
w("ui-seletor-mapa-base", E);
|
|
398
|
-
w("ui-mapa-base",
|
|
410
|
+
w("ui-mapa-base", U);
|
|
399
411
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
412
|
+
c as CENTRO_MINIATURA_PADRAO,
|
|
413
|
+
N as MAPAS_BASE_PADRAO,
|
|
414
|
+
U as UIMapaBase,
|
|
403
415
|
E as UISeletorMapaBase,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
416
|
+
L as decidirAbertura,
|
|
417
|
+
$ as lerCentroMiniatura,
|
|
418
|
+
I as preencherModeloTile,
|
|
407
419
|
_ as textoContagem,
|
|
408
420
|
g as tileDoPonto,
|
|
409
421
|
v as urlMiniatura
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thibezer/ui-components-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.2",
|
|
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",
|