@thibezer/ui-components-kit 2.29.0 → 2.30.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 +1260 -1240
- package/dist/canvas.cjs +31 -30
- package/dist/canvas.js +483 -457
- 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 +15771 -15328
- 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
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var g=(o,n,e)=>n in o?h(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var s=(o,n,e)=>g(o,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const p=require("./kit-base-BmkPi5Rz.cjs"),v=':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{left:0}.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)}',b=[{id:"none",nome:"Sem Mapa",descricao:"Tela CAD neutra com grade quadriculada"},{id:"google_satelite_puro",nome:"Google Puro",descricao:"Satélite limpo sem ruas ou rótulos",thumbnailUrl:"https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"},{id:"google_satelite",nome:"Google Híbrido",descricao:"Satélite com nomes de ruas e divisas",thumbnailUrl:"https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"},{id:"satelite",nome:"Esri Satélite",descricao:"Imagens orbitais de alta resolução",thumbnailUrl:"https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=160&auto=format&fit=crop&q=80"},{id:"osm",nome:"OpenStreetMap",descricao:"Mapa viário e urbano colaborativo",thumbnailUrl:"https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=160&auto=format&fit=crop&q=80"},{id:"topografia",nome:"Topografia",descricao:"Curvas de nível e relevo sombreado",thumbnailUrl:"https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=160&auto=format&fit=crop&q=80"},{id:"dark",nome:"Dark Canvas",descricao:"Mapa escuro de alto contraste para CAD",thumbnailUrl:"https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=160&auto=format&fit=crop&q=80"}],f=`
|
|
1
|
+
"use strict";var S=Object.defineProperty;var _=(r,o,e)=>o in r?S(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e;var p=(r,o,e)=>_(r,typeof o!="symbol"?o+"":o,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const l=require("./kit-base-BmkPi5Rz.cjs"),c={lat:0,lng:0,zoom:2},y=19,x=85.05112878;function A(r){const o=Number.isFinite(r)&&r>0?Math.floor(r):0;return`${o} ${o===1?"opção":"opções"}`}function E(r,o,e){const i=Number.isFinite(r)?r:0,t=Number.isFinite(o)?o:0,a=Number.isFinite(e)?Math.max(0,e):0;return t>=a?"baixo":i>t?"cima":"baixo"}function k(r){if(typeof r!="string"||!r.trim())return null;const o=r.split(",").map(s=>Number(s.trim()));if(o.length<2||o.length>3)return null;const[e,i,t]=o;if(!Number.isFinite(e)||!Number.isFinite(i)||e<-90||e>90||i<-180||i>180)return null;const a=o.length===3?t:c.zoom;return Number.isFinite(a)?{lat:e,lng:i,zoom:Math.min(y,Math.max(0,Math.round(a)))}:null}function h(r,o,e){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(x,Math.max(-x,r)):0,s=Number.isFinite(o)?Math.min(180,Math.max(-180,o)):0,n=a*Math.PI/180,u=b=>Math.min(t-1,Math.max(0,Math.floor(b)));return{z:i,x:u((s+180)/360*t),y:u((1-Math.log(Math.tan(n)+1/Math.cos(n))/Math.PI)/2*t)}}function M(r){return/^https?:\/\//i.test(r.trim())}function z(r,o){return typeof r!="string"||!M(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,"")}function g(r,o){return r?typeof r.thumbnailUrl=="string"&&M(r.thumbnailUrl)?r.thumbnailUrl:z(r.tileUrl,o):null}const I=':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)}',f="https://server.arcgisonline.com/ArcGIS/rest/services",B=[{id:"none",nome:"Sem Mapa",descricao:"Tela CAD neutra com grade quadriculada"},{id:"google_satelite_puro",nome:"Google Puro",descricao:"Satélite limpo sem ruas ou rótulos",tileUrl:"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}"},{id:"google_satelite",nome:"Google Híbrido",descricao:"Satélite com nomes de ruas e divisas",tileUrl:"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}"},{id:"satelite",nome:"Esri Satélite",descricao:"Imagens orbitais de alta resolução",tileUrl:`${f}/World_Imagery/MapServer/tile/{z}/{y}/{x}`},{id:"osm",nome:"OpenStreetMap",descricao:"Mapa viário e urbano colaborativo",tileUrl:"https://tile.openstreetmap.org/{z}/{x}/{y}.png"},{id:"topografia",nome:"Topografia",descricao:"Curvas de nível e relevo sombreado",tileUrl:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png"},{id:"dark",nome:"Dark Canvas",descricao:"Mapa escuro de alto contraste para CAD",tileUrl:`${f}/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}`}],w=`
|
|
2
2
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
3
3
|
<circle cx="12" cy="12" r="10"></circle>
|
|
4
4
|
<line x1="2" y1="12" x2="22" y2="12"></line>
|
|
5
5
|
<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>
|
|
6
6
|
</svg>
|
|
7
|
-
`,
|
|
7
|
+
`,N=`
|
|
8
8
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
9
9
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
10
10
|
</svg>
|
|
11
|
-
|
|
11
|
+
`,$=`
|
|
12
12
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
|
|
13
13
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
14
14
|
</svg>
|
|
@@ -20,34 +20,34 @@
|
|
|
20
20
|
<line x1="9" y1="3" x2="9" y2="21"></line>
|
|
21
21
|
<line x1="15" y1="3" x2="15" y2="21"></line>
|
|
22
22
|
</svg>
|
|
23
|
-
`;class
|
|
24
|
-
<style>${
|
|
23
|
+
`;class v extends l.SafeHTMLElement{constructor(){super();p(this,"shadow");p(this,"listeners",new l.ListenerBag);p(this,"_mapasBase",[...B]);p(this,"wrapperEl");p(this,"triggerBtn");p(this,"popoverEl");p(this,"listEl");p(this,"thumbEl");p(this,"labelEl");p(this,"tileMiniatura",h(c.lat,c.lng,c.zoom));this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=`
|
|
24
|
+
<style>${I}</style>
|
|
25
25
|
<div class="ui-basemap-wrapper" id="basemap-wrapper">
|
|
26
26
|
<button class="ui-basemap-trigger" id="basemap-trigger" part="base" type="button" aria-haspopup="listbox" aria-expanded="false" title="Alternar Mapa Base">
|
|
27
27
|
<span class="ui-basemap-thumb-container" id="thumb-container"></span>
|
|
28
28
|
<span class="ui-basemap-label" id="basemap-label">Esri Satélite</span>
|
|
29
|
-
<span class="ui-basemap-chevron">${
|
|
29
|
+
<span class="ui-basemap-chevron">${N}</span>
|
|
30
30
|
</button>
|
|
31
31
|
|
|
32
32
|
<div class="ui-basemap-popover" id="basemap-popover" part="lista" role="listbox" aria-label="Selecione o Mapa Base">
|
|
33
33
|
<div class="ui-basemap-popover-header">
|
|
34
34
|
<span class="ui-basemap-popover-titulo">Mapa Base</span>
|
|
35
|
-
<span class="ui-basemap-popover-badge" id="popover-count"
|
|
35
|
+
<span class="ui-basemap-popover-badge" id="popover-count"></span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class="ui-basemap-list" id="basemap-list"></div>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
`,this.wrapperEl=this.shadow.getElementById("basemap-wrapper"),this.triggerBtn=this.shadow.getElementById("basemap-trigger"),this.popoverEl=this.shadow.getElementById("basemap-popover"),this.listEl=this.shadow.getElementById("basemap-list"),this.thumbEl=this.shadow.getElementById("thumb-container"),this.labelEl=this.shadow.getElementById("basemap-label")}static get observedAttributes(){return["mapa-base-ativo","valor","posicao","aberto","compacto","desabilitado",...
|
|
41
|
-
<div class="ui-basemap-item ${
|
|
42
|
-
data-id="${
|
|
40
|
+
`,this.wrapperEl=this.shadow.getElementById("basemap-wrapper"),this.triggerBtn=this.shadow.getElementById("basemap-trigger"),this.popoverEl=this.shadow.getElementById("basemap-popover"),this.listEl=this.shadow.getElementById("basemap-list"),this.thumbEl=this.shadow.getElementById("thumb-container"),this.labelEl=this.shadow.getElementById("basemap-label")}static get observedAttributes(){return["mapa-base-ativo","valor","posicao","aberto","compacto","desabilitado","centro-miniatura",...l.ATRIBUTOS_DEGRADE]}connectedCallback(){this.tileMiniatura=this.calcularTileMiniatura(),l.aplicarDegradeNoElemento(this,this.triggerBtn),l.aplicarDegradeNoElemento(this,this.popoverEl),this.atualizarPosicaoClasses(),this.renderizarOpcoes(),this.atualizarGatilho(),this.conectarEventos()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,i,t){if(i!==t){if(l.ehAtributoDegrade(e)){l.aplicarDegradeNoElemento(this,this.triggerBtn),l.aplicarDegradeNoElemento(this,this.popoverEl);return}if(e==="mapa-base-ativo"||e==="valor")this.atualizarSelecaoVisual(),this.atualizarGatilho();else if(e==="posicao")this.atualizarPosicaoClasses();else if(e==="aberto"){const a=t!==null&&t!=="false";this.aplicarEstadoAberto(a)}else if(e==="compacto")this.triggerBtn.classList.toggle("compacto",t!==null&&t!=="false");else if(e==="centro-miniatura"){const a=this.calcularTileMiniatura(),s=this.tileMiniatura;if(a.z===s.z&&a.x===s.x&&a.y===s.y)return;this.tileMiniatura=a,this.renderizarOpcoes(),this.atualizarGatilho()}else if(e==="desabilitado"){const a=t!==null&&t!=="false";this.triggerBtn.disabled=a,a&&this.fechar()}}}get mapaBaseAtivo(){return this.getAttribute("mapa-base-ativo")||this.getAttribute("valor")||"satelite"}set mapaBaseAtivo(e){this.setAttribute("mapa-base-ativo",e),this.setAttribute("valor",e)}get valor(){return this.mapaBaseAtivo}set valor(e){this.mapaBaseAtivo=e}get posicao(){return this.getAttribute("posicao")||"inline"}set posicao(e){this.setAttribute("posicao",e)}get aberto(){return this.hasAttribute("aberto")&&this.getAttribute("aberto")!=="false"}set aberto(e){e?this.setAttribute("aberto",""):this.removeAttribute("aberto")}get compacto(){return this.hasAttribute("compacto")&&this.getAttribute("compacto")!=="false"}set compacto(e){e?this.setAttribute("compacto",""):this.removeAttribute("compacto")}get desabilitado(){return this.hasAttribute("desabilitado")&&this.getAttribute("desabilitado")!=="false"}set desabilitado(e){e?this.setAttribute("desabilitado",""):this.removeAttribute("desabilitado")}get mapasBase(){return this._mapasBase}definirMapasBase(e){Array.isArray(e)&&(this._mapasBase=[...e],this.renderizarOpcoes(),this.atualizarGatilho())}abrir(){this.desabilitado||(this.aberto=!0)}fechar(){this.aberto=!1}alternar(){this.aberto?this.fechar():this.abrir()}selecionar(e){if(!e||this.mapaBaseAtivo===e){this.fechar();return}const i=this._mapasBase.find(a=>a.id===e);if(!i)return;this.mapaBaseAtivo=e;const t={mapaBaseId:e,item:i};this.dispatchEvent(new CustomEvent("ui-mapa-base-alterado",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})),this.fechar()}calcularTileMiniatura(){const e=k(this.getAttribute("centro-miniatura"))??c;return h(e.lat,e.lng,e.zoom)}posicaoAutomatica(){return!["bottom-left","bottom-right","top-left","top-right"].includes(this.posicao)}atualizarPosicaoClasses(){const e=this.posicao,i=this.posicaoAutomatica(),t=this.wrapperEl.classList.contains("abre-baixo")?"abre-baixo":"abre-cima";this.wrapperEl.className=`ui-basemap-wrapper pos-${i?"auto":e}${i?` ${t}`:""}`}ajustarDirecao(){if(!(!this.posicaoAutomatica()||typeof window>"u"))try{const e=this.triggerBtn.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight||0;if(!i||!e.width&&!e.height)return;const t=16,a=e.top-t,s=i-e.bottom-t;this.listEl.style.maxHeight="";const n=E(a,s,this.popoverEl.offsetHeight+8);this.wrapperEl.classList.toggle("abre-cima",n==="cima"),this.wrapperEl.classList.toggle("abre-baixo",n==="baixo");const u=(n==="cima"?a:s)-8,b=this.popoverEl.offsetHeight-this.listEl.offsetHeight;this.popoverEl.offsetHeight>u&&(this.listEl.style.maxHeight=`${Math.max(96,Math.floor(u-b))}px`)}catch{}}aplicarEstadoAberto(e){e&&this.ajustarDirecao(),this.popoverEl.classList.toggle("aberto",e),this.triggerBtn.classList.toggle("active",e),this.triggerBtn.setAttribute("aria-expanded",String(e))}atualizarGatilho(){const e=this.mapaBaseAtivo,i=this._mapasBase.find(t=>t.id===e);if(i){this.labelEl.textContent=i.nome,this.triggerBtn.title=i.descricao?`Mapa Base: ${i.nome} (${i.descricao})`:`Mapa Base: ${i.nome}`;const t=g(i,this.tileMiniatura);t?this.thumbEl.innerHTML=`<img class="ui-basemap-thumb-mini" src="${m(t)}" alt="" referrerpolicy="no-referrer" decoding="async" />`:this.thumbEl.innerHTML=`<span class="ui-basemap-thumb-mini fallback">${d}</span>`}else this.labelEl.textContent="Mapa Base",this.triggerBtn.title="Alternar Mapa Base",this.thumbEl.innerHTML=`<span class="ui-basemap-thumb-mini fallback">${w}</span>`}renderizarOpcoes(){const e=this.shadow.getElementById("popover-count");e&&(e.textContent=A(this._mapasBase.length));const i=this.mapaBaseAtivo;this.listEl.innerHTML=this._mapasBase.map(t=>{const a=t.id===i,s=g(t,this.tileMiniatura),n=s?`<img class="ui-basemap-item-preview" src="${m(s)}" alt="" loading="lazy" referrerpolicy="no-referrer" decoding="async" />`:`<div class="ui-basemap-item-preview-none">${d}</div>`;return`
|
|
41
|
+
<div class="ui-basemap-item ${a?"active":""}"
|
|
42
|
+
data-id="${m(t.id)}"
|
|
43
43
|
role="option"
|
|
44
|
-
aria-selected="${
|
|
44
|
+
aria-selected="${a}"
|
|
45
45
|
tabindex="0">
|
|
46
|
-
${
|
|
46
|
+
${n}
|
|
47
47
|
<div class="ui-basemap-item-info">
|
|
48
|
-
<span class="ui-basemap-item-nome">${
|
|
49
|
-
${
|
|
48
|
+
<span class="ui-basemap-item-nome">${m(t.nome)}</span>
|
|
49
|
+
${t.descricao?`<span class="ui-basemap-item-desc">${m(t.descricao)}</span>`:""}
|
|
50
50
|
</div>
|
|
51
|
-
<span class="ui-basemap-item-check">${
|
|
51
|
+
<span class="ui-basemap-item-check">${$}</span>
|
|
52
52
|
</div>
|
|
53
|
-
`}).join("")}focarItem(e){const i=Array.from(this.listEl.querySelectorAll(".ui-basemap-item"));if(i.length===0)return;const
|
|
53
|
+
`}).join("")}focarItem(e){const i=Array.from(this.listEl.querySelectorAll(".ui-basemap-item"));if(i.length===0)return;const t=i.indexOf(this.shadow.activeElement);let a;switch(e){case"ativo":a=Math.max(0,i.findIndex(s=>s.classList.contains("active")));break;case"proximo":a=Math.min(i.length-1,t+1);break;case"anterior":a=Math.max(0,t-1);break;case"primeiro":a=0;break;default:a=i.length-1}i[a].focus()}atualizarSelecaoVisual(){const e=this.mapaBaseAtivo;this.listEl.querySelectorAll(".ui-basemap-item").forEach(t=>{const s=t.getAttribute("data-id")===e;t.classList.toggle("active",s),t.setAttribute("aria-selected",String(s))})}conectarEventos(){this.listeners.add(this.triggerBtn,"click",t=>{t.stopPropagation(),this.alternar(),this.aberto&&t.detail===0&&this.focarItem("ativo")}),this.listeners.add(this.listEl,"click",t=>{const a=t.target.closest(".ui-basemap-item");if(!a)return;const s=a.getAttribute("data-id");s&&this.selecionar(s)}),this.listeners.add(this.listEl,"keydown",t=>{const a={ArrowDown:"proximo",ArrowUp:"anterior",Home:"primeiro",End:"ultimo"};if(a[t.key]){t.preventDefault(),this.focarItem(a[t.key]);return}if(t.key==="Enter"||t.key===" "){const s=t.target.closest(".ui-basemap-item");if(s){t.preventDefault();const n=s.getAttribute("data-id");n&&this.selecionar(n)}}});const e=t=>{if(!this.aberto)return;t.composedPath().includes(this)||this.fechar()};this.listeners.add(document,"click",e),this.listeners.add(this.wrapperEl,"focusout",t=>{const a=t.relatedTarget;this.aberto&&a&&!this.shadow.contains(a)&&!this.contains(a)&&this.fechar()}),this.listeners.add(this.shadow,"error",t=>{const a=t.target;if(!a||a.tagName!=="IMG")return;const s=document.createElement("span"),n=a.classList.contains("ui-basemap-thumb-mini");s.className=n?"ui-basemap-thumb-mini fallback":"ui-basemap-item-preview-none",s.innerHTML=n?w:d,a.replaceWith(s)},!0);const i=t=>{t.key==="Escape"&&this.aberto&&(this.fechar(),this.triggerBtn.focus())};this.listeners.add(document,"keydown",i)}}function m(r){return r?String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}class C extends v{}l.definirCustomElement("ui-seletor-mapa-base",v);l.definirCustomElement("ui-mapa-base",C);exports.CENTRO_MINIATURA_PADRAO=c;exports.MAPAS_BASE_PADRAO=B;exports.UIMapaBase=C;exports.UISeletorMapaBase=v;exports.decidirAbertura=E;exports.lerCentroMiniatura=k;exports.preencherModeloTile=z;exports.textoContagem=A;exports.tileDoPonto=h;exports.urlMiniatura=g;
|