@thibezer/ui-components-kit 2.24.1 → 2.25.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 +83 -1
- package/dist/botao.cjs +12 -1
- package/dist/botao.js +162 -3
- package/dist/camadas.cjs +311 -1
- package/dist/camadas.js +3244 -148
- package/dist/campo-texto.cjs +16 -1
- package/dist/campo-texto.js +308 -7
- package/dist/canvas.cjs +22 -22
- package/dist/canvas.js +230 -233
- package/dist/card.cjs +20 -1
- package/dist/card.js +145 -2
- package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +26 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +9 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha.d.ts +2 -2
- package/dist/components/ui-editor-prancha/editor-barra.d.ts +19 -0
- package/dist/components/ui-editor-prancha/editor-modos.d.ts +35 -0
- package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
- package/dist/components/ui-editor-prancha/index.d.ts +1 -0
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +63 -7
- package/dist/core/alvo-digitavel.d.ts +3 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +43 -54
- package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
- package/dist/cores.cjs +32 -1
- package/dist/cores.js +300 -13
- package/dist/custom-elements.json +11945 -11071
- package/dist/data.cjs +28 -1
- package/dist/data.js +286 -99
- package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
- package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
- package/dist/feedback.cjs +52 -1
- package/dist/feedback.js +655 -25
- package/dist/forms.cjs +66 -1
- package/dist/forms.js +1216 -39
- package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
- package/dist/index.cjs +67 -1
- package/dist/index.js +1476 -274
- package/dist/kit-base-BmkPi5Rz.cjs +2 -0
- package/dist/kit-base-CBXA66aM.js +1084 -0
- package/dist/mapa.cjs +5 -5
- package/dist/mapa.js +16 -17
- package/dist/modal.cjs +18 -1
- package/dist/modal.js +235 -29
- package/dist/motor.js +49 -49
- package/dist/prancha-nucleo.cjs +3 -1
- package/dist/prancha-nucleo.js +3120 -277
- package/dist/prancha.cjs +38 -1
- package/dist/prancha.js +3470 -228
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -20
- package/dist/seletor-mapa-base.cjs +13 -13
- package/dist/seletor-mapa-base.js +3 -5
- package/dist/tabela.cjs +142 -1
- package/dist/tabela.js +3773 -92
- package/dist/tipos-elementos.d.ts +7 -3
- package/dist/tipos-vue.d.ts +6 -3
- package/dist/tools.cjs +16 -1
- package/dist/tools.js +1564 -26
- package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-CPjA9vhZ.js} +8 -9
- package/dist/ui-seletor-cor-D_ifitEN.cjs +83 -0
- package/dist/utils-ClVgqVyJ.cjs +1 -0
- package/dist/utils-DrHoxxmf.js +83 -0
- package/package.json +43 -2
- package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
- package/dist/acessibilidade-CUlSXc2X.js +0 -38
- package/dist/altura-controle-ukMRPckR.cjs +0 -1
- package/dist/altura-controle-vxQiXG4q.js +0 -62
- package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
- package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
- package/dist/degrade-CIxvOTUv.cjs +0 -1
- package/dist/degrade-gDa5sW__.js +0 -119
- package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
- package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
- package/dist/feature_historico-BAIYk1Me.cjs +0 -3
- package/dist/feature_historico-C4h9y5fu.js +0 -3039
- package/dist/form-atalhos-7JTYvumA.cjs +0 -1
- package/dist/form-atalhos-DDTlpgaB.js +0 -203
- package/dist/form-erros-CwPz7Jr4.cjs +0 -1
- package/dist/form-erros-DT5HklfD.js +0 -184
- package/dist/form-submissao-C-SPRKgT.js +0 -61
- package/dist/form-submissao-DxKO5MHI.cjs +0 -1
- package/dist/form-validacao-BlQFxUVj.js +0 -104
- package/dist/form-validacao-DIeyQVH5.cjs +0 -1
- package/dist/geometria-px-DKrWq_XY.js +0 -639
- package/dist/leaflet-CEPcxGWV.cjs +0 -1
- package/dist/leaflet-DOq10gfg.js +0 -84
- package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
- package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
- package/dist/listener-bag-D5omxZ9h.cjs +0 -1
- package/dist/listener-bag-DQgv7OON.js +0 -34
- package/dist/motor-By2te6PZ.js +0 -1400
- package/dist/motor-CkMxd378.cjs +0 -1
- package/dist/opcoes-CupvWVIm.js +0 -24
- package/dist/opcoes-vdAUY5OI.cjs +0 -1
- package/dist/parts-CaoQiCfI.js +0 -7
- package/dist/parts-vQa2873h.cjs +0 -1
- package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
- package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
- package/dist/ssr-safe-5cWfJP-s.js +0 -10
- package/dist/ssr-safe-CiHD1adl.cjs +0 -1
- package/dist/svg-seguro-ChVJ2L2z.js +0 -74
- package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
- package/dist/ui-badge-DE58YSBY.cjs +0 -28
- package/dist/ui-badge-KgmI3jOD.js +0 -201
- package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
- package/dist/ui-botao-zLkcMMyP.js +0 -168
- package/dist/ui-bus-CUd99VJi.js +0 -177
- package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
- package/dist/ui-camadas-DoHPnbQm.js +0 -3133
- package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
- package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
- package/dist/ui-campo-texto-btevggO3.js +0 -379
- package/dist/ui-card-7IEYbCN0.js +0 -150
- package/dist/ui-card-Bx8EyzYY.cjs +0 -20
- package/dist/ui-card-C-EJoKnm.js +0 -150
- package/dist/ui-card-DFnRp9bl.js +0 -146
- package/dist/ui-card-DrWVJQKw.cjs +0 -20
- package/dist/ui-card-DsIjHMmG.cjs +0 -20
- package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
- package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
- package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
- package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
- package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
- package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
- package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
- package/dist/ui-linha-B4mBRm1x.cjs +0 -61
- package/dist/ui-linha-DTEIIww4.js +0 -1167
- package/dist/ui-linha-KFF86FW5.js +0 -752
- package/dist/ui-modal-BrXzVZ65.js +0 -216
- package/dist/ui-modal-lARKzEVZ.cjs +0 -18
- package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
- package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
- package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
- package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
- package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
- package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
- package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
- package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
- package/dist/ui-skeleton-BLEV6h3k.js +0 -653
- package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
- package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
- package/dist/ui-switch-Ctxk-jKS.js +0 -1212
- package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
- package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
- package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
- package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
- package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
- package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
- package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
- package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
- package/dist/zero-js-triggers-CJT988bR.js +0 -83
- package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
package/dist/mapa.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.defineProperty;var I=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>I(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const n=require("./kit-base-BmkPi5Rz.cjs"),g=require("./utils-ClVgqVyJ.cjs"),z=":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)}";function m(){return n.obterLeafletSincrono()??null}async function _(){return await n.carregarLeaflet()??null}function E(r){return{osm:{nome:"OpenStreetMap",layer:()=>r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'})},satelite:{nome:"Satélite (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"})},topografia:{nome:"Topografia",layer:()=>r.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'})},ruas:{nome:"Ruas (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"})}}}const u={lat:-23.55052,lng:-46.633308,zoom:13},L="#00f5a0",w="#3388ff",O=3,p=r=>Number.isFinite(r);function v(r,e,t){const i=parseFloat(r??""),o=parseFloat(e??""),a=parseInt(t??"",10);return{lat:p(i)&&Math.abs(i)<=90?i:u.lat,lng:p(o)&&Math.abs(o)<=180?o:u.lng,zoom:p(a)&&a>=0&&a<=22?a:u.zoom}}function k(r,e){const t=parseInt(r??"",10);return p(t)&&t>0?t:e}const P=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,R=/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/deg-]+\)$/i,N=/^[a-z]{3,30}$/i;function y(r,e){const t=(r??"").trim();return P.test(t)||R.test(t)||N.test(t)?t:e}function U(r,e){const t=(r??"").split(",").map(i=>i.trim().toLowerCase()).filter(i=>e.includes(i));return t.length>0?t:["osm"]}function A(r){if(!r)return[];let e;try{e=JSON.parse(r)}catch(i){return console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"',i),[]}if(!Array.isArray(e))return[];const t=[];for(const i of e){if(!Array.isArray(i)||i.length<2)continue;const[o,a]=i;typeof o=="number"&&typeof a=="number"&&p(o)&&p(a)&&Math.abs(o)<=90&&Math.abs(a)<=180&&t.push([o,a])}return t}const D="Mapa",G=`
|
|
2
2
|
<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));">
|
|
3
3
|
<span style="font-size: 20px; margin-bottom: 6px;" aria-hidden="true">🗺️</span>
|
|
4
4
|
<strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
|
|
5
5
|
<span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code><ui-mapa></code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code><script src=".../leaflet.js"></script></code>.</span>
|
|
6
6
|
</div>
|
|
7
|
-
`;class
|
|
7
|
+
`;class T extends n.SafeHTMLElement{constructor(){super();s(this,"mapContainer");s(this,"mapInstance",null);s(this,"_initTimer",null);s(this,"_resizeObserver");s(this,"_resizeTimer");s(this,"_invalidarTimer");const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
8
8
|
<style>
|
|
9
|
-
${
|
|
10
|
-
${
|
|
9
|
+
${n.leafletCss}
|
|
10
|
+
${z}
|
|
11
11
|
</style>
|
|
12
12
|
<div class="ui-mapa-container" id="map-container" part="base" role="region"></div>
|
|
13
13
|
<div style="display: none;"><slot></slot></div>
|
|
14
|
-
`,this.mapContainer=t.getElementById("map-container"),this.sincronizarRotulo()}static get observedAttributes(){return["lat","lng","zoom","aria-label"]}connectedCallback(){this.sincronizarRotulo(),this._initTimer=setTimeout(()=>{this._initTimer=null,this.initMap()},0)}disconnectedCallback(){var t;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)}attributeChangedCallback(t,i,o){if(i!==o){if(t==="aria-label"){this.sincronizarRotulo();return}if(this.mapInstance){const a=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom"));this.mapInstance.setView([a.lat,a.lng],a.zoom)}}}sincronizarRotulo(){var t;(t=this.mapContainer)==null||t.setAttribute("aria-label",this.getAttribute("aria-label")||
|
|
14
|
+
`,this.mapContainer=t.getElementById("map-container"),this.sincronizarRotulo()}static get observedAttributes(){return["lat","lng","zoom","aria-label"]}connectedCallback(){this.sincronizarRotulo(),this._initTimer=setTimeout(()=>{this._initTimer=null,this.initMap()},0)}disconnectedCallback(){var t;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)}attributeChangedCallback(t,i,o){if(i!==o){if(t==="aria-label"){this.sincronizarRotulo();return}if(this.mapInstance){const a=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom"));this.mapInstance.setView([a.lat,a.lng],a.zoom)}}}sincronizarRotulo(){var t;(t=this.mapContainer)==null||t.setAttribute("aria-label",this.getAttribute("aria-label")||D)}async initMap(){var f;if(this.mapInstance)return;const t=await _();if(!this.isConnected||this.mapInstance)return;if(!t){this.mapContainer.innerHTML=G;return}const i=E(t),o=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom")),a=t.map(this.mapContainer).setView([o.lat,o.lng],o.zoom);this.mapInstance=a;const l=U(this.getAttribute("camadas"),Object.keys(i)),d=i[l[0]].layer();if(d.addTo(a),l.length>1){const c={[i[l[0]].nome]:d};for(const b of l.slice(1))c[i[b].nome]=i[b].layer();t.control.layers(c,void 0,{position:"topright"}).addTo(a)}(f=t.Icon)!=null&&f.Default&&(t.Icon.Default.imagePath="https://unpkg.com/leaflet@1.9.4/dist/images/"),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{var c;return(c=this.mapInstance)==null?void 0:c.invalidateSize()},60)}),this._resizeObserver.observe(this.mapContainer)),this._invalidarTimer=setTimeout(()=>{var c;return(c=this.mapInstance)==null?void 0:c.invalidateSize()},100),this.dispatchEvent(new CustomEvent("ui-mapa-pronto",{detail:{map:a},bubbles:!0,composed:!0}))}getMap(){return this.mapInstance}}n.definirCustomElement("ui-mapa",T);const h="http://www.w3.org/2000/svg";function H(r){const e=document.createElement("div");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}function V(r){const e=document.createElementNS(h,"svg");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))";const t=document.createElementNS(h,"path");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);const i=document.createElementNS(h,"circle");return i.setAttribute("cx","12"),i.setAttribute("cy","11"),i.setAttribute("r","4.5"),i.setAttribute("fill","#ffffff"),e.append(t,i),e}function $(r,e,t){return t==="circle"?r.divIcon({className:"ui-mapa-div-marker",html:H(e),iconSize:[14,14],iconAnchor:[7,7]}):r.divIcon({className:"ui-mapa-svg-pin",html:V(e),iconSize:[24,32],iconAnchor:[12,32],popupAnchor:[0,-30]})}const F=30,B=50;class M{constructor(e,t){s(this,"pai",null);s(this,"timer",null);s(this,"tentativas",0);s(this,"aoPronto",()=>{this.opcoes.aoPerderMapa(),this.tentativas=0,this.tentar()});this.host=e,this.opcoes=t}conectar(){var e;this.desconectar(),this.pai=this.host.closest("ui-mapa"),(e=this.pai)==null||e.addEventListener("ui-mapa-pronto",this.aoPronto),this.agendar(0)}desconectar(){var e;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}agendar(e){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>this.tentar(),e)}tentar(){this.timer=null;const e=this.pai??this.host.closest("ui-mapa");if(!e){console.warn(`<${this.opcoes.rotulo}> deve estar dentro de um elemento <ui-mapa>`);return}const t=e.getMap();if(!t){if(this.tentativas>=F){console.warn(`<${this.opcoes.rotulo}> Tempo limite esgotado aguardando inicialização do mapa pai.`);return}this.tentativas++,this.agendar(B);return}this.tentativas=0,this.opcoes.aoMapa(t)}}class C extends n.SafeHTMLElement{constructor(){super(...arguments);s(this,"marker",null);s(this,"vinculo",new M(this,{rotulo:"ui-mapa-marcador",aoMapa:t=>this.criarMarcador(t),aoPerderMapa:()=>this.removerMarcador()}))}static get observedAttributes(){return["lat","lng","titulo","cor","formato"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerMarcador()}attributeChangedCallback(t,i,o){if(!(i===o||!this.marker)){if(t==="lat"||t==="lng"){const a=g.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));a&&this.marker.setLatLng([a.lat,a.lon])}else if(t==="titulo")this.marker.unbindPopup(),o&&this.marker.bindPopup(this.createPopupContent(o)),this.aplicarNomeAcessivel();else if(t==="cor"||t==="formato"){const a=m();a&&this.marker.setIcon(this.createIcon(a))}}}removerMarcador(){var t;(t=this.marker)==null||t.remove(),this.marker=null}createPopupContent(t){const i=document.createElement("div");return i.className="ui-mapa-popup",i.textContent=t,i}createIcon(t){const i=this.getAttribute("formato")==="circle"?"circle":"pin";return $(t,y(this.getAttribute("cor"),L),i)}aplicarNomeAcessivel(){var o;const t=(o=this.marker)==null?void 0:o.getElement();if(!t)return;const i=this.getAttribute("titulo");i?(t.setAttribute("aria-label",i),t.setAttribute("title",i)):(t.removeAttribute("aria-label"),t.removeAttribute("title"))}criarMarcador(t){this.removerMarcador();const i=g.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));if(!i)return;const o=m();if(!o)return;const a=this.getAttribute("titulo"),l=o.marker([i.lat,i.lon],{icon:this.createIcon(o),keyboard:!0,title:a||void 0});a&&l.bindPopup(this.createPopupContent(a)),l.addTo(t),this.marker=l,this.aplicarNomeAcessivel()}}n.definirCustomElement("ui-mapa-marcador",C);class S extends n.SafeHTMLElement{constructor(){super(...arguments);s(this,"polyline",null);s(this,"vinculo",new M(this,{rotulo:"ui-mapa-linha",aoMapa:t=>this.criarLinha(t),aoPerderMapa:()=>this.removerLinha()}))}static get observedAttributes(){return["pontos","cor","espessura"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerLinha()}attributeChangedCallback(t,i,o){i===o||!this.polyline||(t==="pontos"?this.polyline.setLatLngs(A(this.getAttribute("pontos"))):this.polyline.setStyle(this.estilo()))}estilo(){return{color:y(this.getAttribute("cor"),w),weight:k(this.getAttribute("espessura"),O)}}removerLinha(){var t;(t=this.polyline)==null||t.remove(),this.polyline=null}criarLinha(t){this.removerLinha();const i=m();i&&(this.polyline=i.polyline(A(this.getAttribute("pontos")),this.estilo()).addTo(t))}}n.definirCustomElement("ui-mapa-linha",S);exports.UIMapa=T;exports.UIMapaLinha=S;exports.UIMapaMarcador=C;
|
package/dist/mapa.js
CHANGED
|
@@ -2,15 +2,14 @@ var C = Object.defineProperty;
|
|
|
2
2
|
var x = (r, e, t) => e in r ? C(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var s = (r, e, t) => x(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { c as S, o as I } from "./leaflet-loader-Cjcdgj5R.js";
|
|
5
|
+
import { c as z, o as S, S as m, l as I, d } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
import { p as v } from "./utils-DrHoxxmf.js";
|
|
8
7
|
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
8
|
function h() {
|
|
10
|
-
return
|
|
9
|
+
return S() ?? null;
|
|
11
10
|
}
|
|
12
11
|
async function E() {
|
|
13
|
-
return await
|
|
12
|
+
return await z() ?? null;
|
|
14
13
|
}
|
|
15
14
|
function w(r) {
|
|
16
15
|
return {
|
|
@@ -86,7 +85,7 @@ const U = "Mapa", V = `
|
|
|
86
85
|
<span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code><ui-mapa></code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code><script src=".../leaflet.js"></script></code>.</span>
|
|
87
86
|
</div>
|
|
88
87
|
`;
|
|
89
|
-
class H extends
|
|
88
|
+
class H extends m {
|
|
90
89
|
constructor() {
|
|
91
90
|
super();
|
|
92
91
|
s(this, "mapContainer");
|
|
@@ -98,7 +97,7 @@ class H extends d {
|
|
|
98
97
|
const t = this.attachShadow({ mode: "open" });
|
|
99
98
|
t.innerHTML = `
|
|
100
99
|
<style>
|
|
101
|
-
${
|
|
100
|
+
${I}
|
|
102
101
|
${_}
|
|
103
102
|
</style>
|
|
104
103
|
<div class="ui-mapa-container" id="map-container" part="base" role="region"></div>
|
|
@@ -135,7 +134,7 @@ class H extends d {
|
|
|
135
134
|
(t = this.mapContainer) == null || t.setAttribute("aria-label", this.getAttribute("aria-label") || U);
|
|
136
135
|
}
|
|
137
136
|
async initMap() {
|
|
138
|
-
var
|
|
137
|
+
var f;
|
|
139
138
|
if (this.mapInstance) return;
|
|
140
139
|
const t = await E();
|
|
141
140
|
if (!this.isConnected || this.mapInstance) return;
|
|
@@ -145,13 +144,13 @@ class H extends d {
|
|
|
145
144
|
}
|
|
146
145
|
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
146
|
this.mapInstance = a;
|
|
148
|
-
const n = G(this.getAttribute("camadas"), Object.keys(i)),
|
|
149
|
-
if (
|
|
150
|
-
const c = { [i[n[0]].nome]:
|
|
147
|
+
const n = G(this.getAttribute("camadas"), Object.keys(i)), b = i[n[0]].layer();
|
|
148
|
+
if (b.addTo(a), n.length > 1) {
|
|
149
|
+
const c = { [i[n[0]].nome]: b };
|
|
151
150
|
for (const g of n.slice(1)) c[i[g].nome] = i[g].layer();
|
|
152
151
|
t.control.layers(c, void 0, { position: "topright" }).addTo(a);
|
|
153
152
|
}
|
|
154
|
-
(
|
|
153
|
+
(f = t.Icon) != null && f.Default && (t.Icon.Default.imagePath = "https://unpkg.com/leaflet@1.9.4/dist/images/"), typeof ResizeObserver < "u" && (this._resizeObserver = new ResizeObserver(() => {
|
|
155
154
|
this._resizeTimer && clearTimeout(this._resizeTimer), this._resizeTimer = setTimeout(() => {
|
|
156
155
|
var c;
|
|
157
156
|
return (c = this.mapInstance) == null ? void 0 : c.invalidateSize();
|
|
@@ -169,7 +168,7 @@ class H extends d {
|
|
|
169
168
|
return this.mapInstance;
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
|
-
|
|
171
|
+
d("ui-mapa", H);
|
|
173
172
|
const u = "http://www.w3.org/2000/svg";
|
|
174
173
|
function $(r) {
|
|
175
174
|
const e = document.createElement("div");
|
|
@@ -227,7 +226,7 @@ class M {
|
|
|
227
226
|
this.tentativas = 0, this.opcoes.aoMapa(t);
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
|
-
class X extends
|
|
229
|
+
class X extends m {
|
|
231
230
|
constructor() {
|
|
232
231
|
super(...arguments);
|
|
233
232
|
s(this, "marker", null);
|
|
@@ -289,8 +288,8 @@ class X extends d {
|
|
|
289
288
|
a && n.bindPopup(this.createPopupContent(a)), n.addTo(t), this.marker = n, this.aplicarNomeAcessivel();
|
|
290
289
|
}
|
|
291
290
|
}
|
|
292
|
-
|
|
293
|
-
class W extends
|
|
291
|
+
d("ui-mapa-marcador", X);
|
|
292
|
+
class W extends m {
|
|
294
293
|
constructor() {
|
|
295
294
|
super(...arguments);
|
|
296
295
|
s(this, "polyline", null);
|
|
@@ -328,7 +327,7 @@ class W extends d {
|
|
|
328
327
|
i && (this.polyline = i.polyline(y(this.getAttribute("pontos")), this.estilo()).addTo(t));
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
|
-
|
|
330
|
+
d("ui-mapa-linha", W);
|
|
332
331
|
export {
|
|
333
332
|
H as UIMapa,
|
|
334
333
|
W as UIMapaLinha,
|
package/dist/modal.cjs
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const
|
|
1
|
+
"use strict";var M=Object.defineProperty;var T=(e,o,t)=>o in e?M(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var r=(e,o,t)=>T(e,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const h=require("./kit-base-BmkPi5Rz.cjs"),z=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-modal__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-modal, 1000) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{display:block;opacity:1;pointer-events:auto}.ui-modal__dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);max-width:560px;width:90%;max-height:85vh;background:var(--ui-degrade-interno, var(--ui-modal-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-borda, 12px);box-shadow:var(--ui-sombra-lg, 0 12px 36px rgba(0, 0, 0, .6));z-index:var(--ui-z-modal, 1000);display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s linear .2s;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1);transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s}@starting-style{:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:0;transform:translate(-50%,-50%) scale(.94)}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{opacity:0}}.ui-modal__handle{display:none;width:36px;height:4px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:6px auto 12px;flex-shrink:0}.ui-modal__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);gap:12px}.ui-modal__titulo{font-size:18px;font-weight:600;margin:0;color:var(--ui-cor-texto, #e1e1e6)}.ui-modal__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}:host([bloquear-fechamento]) .ui-modal__close{display:none}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-modal__body{padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;flex:1;box-sizing:border-box}.ui-modal__footer{padding:14px 20px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);background:var(--ui-modal-rodape-fundo, var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15)))}@media (max-width: 640px){.ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}.ui-modal__close{min-width:44px;min-height:44px;font-size:18px}.ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{transform:translateY(0)!important}.ui-modal__handle{display:block!important}}:host([bottom-sheet]) .ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}:host([bottom-sheet]) .ui-modal__close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([bottom-sheet][aberto]) .ui-modal__dialog,:host([bottom-sheet][open]) .ui-modal__dialog{transform:translateY(0)!important}:host([bottom-sheet]) .ui-modal__handle{display:block!important}:host(.squarecircle) .ui-modal__painel,:host(.squarecircles) .ui-modal__painel,:host(.ui-squarecircle) .ui-modal__painel,:host(.ui-squarecircles) .ui-modal__painel,:host([formato="squarecircle"]) .ui-modal__painel,:host([formato="squarecircles"]) .ui-modal__painel,:host([formato="squircle"]) .ui-modal__painel{border-radius:var(--ui-raio-xl, 16px)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-card: var(--ui-gradiente-card)}';function R(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"}function w(e){const o=new Set;if(typeof document>"u")return o;const t=a=>{a===e||a.contains(e)||R(a)||a.inert||a.hasAttribute("inert")||(a.setAttribute("inert",""),a.inert=!0,o.add(a))};let i=e;for(;i&&i!==document.body&&i!==document.documentElement;){const a=i.parentElement;if(!a)break;Array.from(a.children).forEach(l=>t(l)),i=a}return document.body&&Array.from(document.body.children).forEach(a=>t(a)),o}function A(e){e.forEach(o=>{o.removeAttribute("inert"),o.inert=!1}),e.clear()}const n=[];let y=new Set,k="";function S(){A(y);const e=n[n.length-1];y=e?w(e):new Set}function F(e){const o=n.indexOf(e);o>=0&&n.splice(o,1),n.length===0&&(k=document.body.style.overflow,document.body.style.overflow="hidden"),n.push(e),S()}function E(e){const o=n.indexOf(e);o<0||(n.splice(o,1),n.length===0&&(document.body.style.overflow=k),S())}function L(e){return n[n.length-1]===e}const _='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-input, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';function v(){var o;let e=document.activeElement;for(;(o=e==null?void 0:e.shadowRoot)!=null&&o.activeElement;)e=e.shadowRoot.activeElement;return e}function b(e,o){let t=o;for(;t;){if(t===e)return!0;const i=t.getRootNode();t=t.parentNode??(i instanceof ShadowRoot?i.host:null)}return!1}function C(e){return!e.hasAttribute("disabled")&&e.getAttribute("aria-hidden")!=="true"}function q(e){const o=[];return e.querySelectorAll("slot").forEach(t=>{t.assignedElements({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(i.matches(_)&&o.push(i),o.push(...Array.from(i.querySelectorAll(_))))})}),o.filter(C)}function P(e){return[...Array.from(e.querySelectorAll(_)).filter(t=>window.getComputedStyle(t).display!=="none"&&C(t)),...q(e)]}function N(e,o){const t=q(e),i=t.filter(a=>a.hasAttribute("autofocus"));for(const a of[...i,...t])if(a.focus(),b(a,v()))return;o.focus()}function O(e,o,t){const i=P(t);if(i.length===0){e.preventDefault();return}const a=i[0],l=i[i.length-1],s=v(),d=!b(o,s),u=b(a,s),c=b(l,s);e.shiftKey?(u||d)&&(e.preventDefault(),l.focus()):(c||d)&&(e.preventDefault(),a.focus())}class x extends h.SafeHTMLElement{constructor(){super();r(this,"backdropElement");r(this,"dialogElement");r(this,"tituloElement");r(this,"closeElement");r(this,"ouvintes",new h.ListenerBag);r(this,"_elementoGatilho",null);r(this,"_tituloId");r(this,"_estaAberto",!1);r(this,"handleSlotChange",()=>{this.syncState()});r(this,"handleBackdropClick",t=>{t.stopPropagation(),this.fechar()});r(this,"handleCloseClick",t=>{t.stopPropagation(),this.fechar()});r(this,"handleKeyDown",t=>{this._estaAberto&&L(this)&&(t.key==="Escape"?(this.fechar(),t.stopImmediatePropagation()):t.key==="Tab"&&O(t,this,this.shadowRoot))});this._tituloId=`ui-modal-title-${Math.random().toString(36).substring(2,9)}`;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
+
<style>${z}</style>
|
|
3
|
+
<div class="ui-modal__backdrop" part="fundo"></div>
|
|
4
|
+
<div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
|
|
5
|
+
<div class="ui-modal__handle"></div>
|
|
6
|
+
<div class="ui-modal__header" part="cabecalho">
|
|
7
|
+
<h3 class="ui-modal__titulo" part="titulo" id="${this._tituloId}"></h3>
|
|
8
|
+
<button class="ui-modal__close" part="fechar" type="button" aria-label="Fechar modal" title="Fechar">✕</button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="ui-modal__body" part="corpo">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="ui-modal__footer" part="rodape">
|
|
14
|
+
<slot name="rodape"></slot>
|
|
15
|
+
<slot name="footer"></slot>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
`,this.backdropElement=t.querySelector(".ui-modal__backdrop"),this.dialogElement=t.querySelector(".ui-modal__dialog"),this.tituloElement=t.querySelector(".ui-modal__titulo"),this.closeElement=t.querySelector(".ui-modal__close")}static get observedAttributes(){return["aberto","open","titulo","title","aria-label","aria-labelledby","rotulo","bottom-sheet","bloquear-fechamento",...h.ATRIBUTOS_DEGRADE]}connectedCallback(){this.ouvintes.cleanup(),this.ouvintes.add(this.backdropElement,"click",this.handleBackdropClick),this.ouvintes.add(this.closeElement,"click",this.handleCloseClick),this.ouvintes.add(window,"keydown",this.handleKeyDown),this.shadowRoot.querySelectorAll("slot").forEach(t=>{this.ouvintes.add(t,"slotchange",this.handleSlotChange)}),this.syncState()}disconnectedCallback(){this.ouvintes.cleanup(),this._estaAberto&&(this._estaAberto=!1,E(this))}attributeChangedCallback(t,i,a){this.syncState()}get aberto(){return this.hasAttribute("aberto")||this.hasAttribute("open")}set aberto(t){t?this.setAttribute("aberto",""):(this.removeAttribute("aberto"),this.removeAttribute("open"))}abrir(){this.aberto=!0}fechar(){this.hasAttribute("bloquear-fechamento")||(this.aberto=!1)}aoAbrir(){this._estaAberto=!0;const t=v();this._elementoGatilho=t&&t!==document.body&&!this.contains(t)?t:null,F(this),this.dispatchEvent(new CustomEvent("ui-abrir",{bubbles:!0,composed:!0})),setTimeout(()=>{this._estaAberto&&N(this.shadowRoot,this.dialogElement)},0)}aoFechar(){this._estaAberto=!1,E(this),this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0}));const t=this._elementoGatilho;this._elementoGatilho=null;const i=document.activeElement,a=!i||i===document.body||i===this||this.contains(i);t!=null&&t.isConnected&&a&&t.focus()}syncState(){var d,u;const t=this.aberto,i=this.getAttribute("titulo")||this.getAttribute("title")||"",a=(d=this.shadowRoot)==null?void 0:d.querySelector(".ui-modal__footer");this.dialogElement.setAttribute("aria-hidden",String(!t)),h.aplicarDegradeNoElemento(this,this.dialogElement);const l=this.getAttribute("aria-label")||this.getAttribute("rotulo"),s=this.getAttribute("aria-labelledby");if(l?(this.dialogElement.setAttribute("aria-label",l),this.dialogElement.removeAttribute("aria-labelledby")):s?(this.dialogElement.setAttribute("aria-labelledby",s),this.dialogElement.removeAttribute("aria-label")):i?(this.tituloElement.textContent=i,this.tituloElement.style.display="block",this.dialogElement.setAttribute("aria-labelledby",this._tituloId),this.dialogElement.removeAttribute("aria-label")):(this.tituloElement.style.display="none",this.dialogElement.removeAttribute("aria-labelledby"),this.dialogElement.setAttribute("aria-label","Diálogo modal")),a){const p=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(f=>f.assignedNodes({flatten:!0}).some(g=>g.nodeType===Node.ELEMENT_NODE||g.textContent&&g.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;a.style.display=p?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}}class D extends x{}h.definirCustomElement("ui-modal",x);h.definirCustomElement("ui-dialog",D);function I(e){return typeof document>"u"?Promise.resolve(!1):new Promise(o=>{const t=document.createElement("ui-modal");t.setAttribute("titulo",e.titulo);const i=document.createElement("p");i.style.margin="0",i.textContent=e.mensagem,t.appendChild(i);const a=(c,p,f)=>{const m=document.createElement("ui-botao");return m.setAttribute("slot","rodape"),m.setAttribute("variante",f),m.dataset.confirmar=c,m.textContent=p,m},l=a("cancelar",e.rotuloCancelar||"Cancelar","secundario"),s=a("confirmar",e.rotuloConfirmar,e.destrutivo?"destrutivo":"primario");t.append(l,s);let d=!1;const u=c=>{d||(d=!0,o(c),t.aberto=!1,setTimeout(()=>t.remove(),0))};s.addEventListener("click",()=>u(!0)),l.addEventListener("click",()=>u(!1)),t.addEventListener("ui-fechar",()=>u(!1)),document.body.appendChild(t),t.abrir()})}async function j(e,o={}){return e.avaliar()?I({titulo:o.titulo??"Descartar alterações?",mensagem:o.mensagem??"Há alterações que ainda não foram salvas. Se continuar, elas serão perdidas.",rotuloConfirmar:o.rotuloConfirmar??"Descartar alterações",rotuloCancelar:o.rotuloCancelar??"Continuar editando",destrutivo:!0}):!0}exports.UIDialog=D;exports.UIModal=x;exports.aplicarInertForaDoModal=w;exports.confirmarAcao=I;exports.confirmarDescarteSeSujo=j;exports.removerInertForaDoModal=A;
|
package/dist/modal.js
CHANGED
|
@@ -1,38 +1,244 @@
|
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var q = (e, o, t) => o in e ? C(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var r = (e, o, t) => q(e, typeof o != "symbol" ? o + "" : o, t);
|
|
1
4
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import { S as D, A as I, L as T, g as z, d as y } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
const L = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-modal__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-modal, 1000) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{display:block;opacity:1;pointer-events:auto}.ui-modal__dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);max-width:560px;width:90%;max-height:85vh;background:var(--ui-degrade-interno, var(--ui-modal-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #18181c))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-borda, 12px);box-shadow:var(--ui-sombra-lg, 0 12px 36px rgba(0, 0, 0, .6));z-index:var(--ui-z-modal, 1000);display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s linear .2s;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1);transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s}@starting-style{:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:0;transform:translate(-50%,-50%) scale(.94)}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{opacity:0}}.ui-modal__handle{display:none;width:36px;height:4px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:6px auto 12px;flex-shrink:0}.ui-modal__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);gap:12px}.ui-modal__titulo{font-size:18px;font-weight:600;margin:0;color:var(--ui-cor-texto, #e1e1e6)}.ui-modal__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}:host([bloquear-fechamento]) .ui-modal__close{display:none}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-modal__body{padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;flex:1;box-sizing:border-box}.ui-modal__footer{padding:14px 20px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);background:var(--ui-modal-rodape-fundo, var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15)))}@media (max-width: 640px){.ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}.ui-modal__close{min-width:44px;min-height:44px;font-size:18px}.ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{transform:translateY(0)!important}.ui-modal__handle{display:block!important}}:host([bottom-sheet]) .ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}:host([bottom-sheet]) .ui-modal__close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([bottom-sheet][aberto]) .ui-modal__dialog,:host([bottom-sheet][open]) .ui-modal__dialog{transform:translateY(0)!important}:host([bottom-sheet]) .ui-modal__handle{display:block!important}:host(.squarecircle) .ui-modal__painel,:host(.squarecircles) .ui-modal__painel,:host(.ui-squarecircle) .ui-modal__painel,:host(.ui-squarecircles) .ui-modal__painel,:host([formato="squarecircle"]) .ui-modal__painel,:host([formato="squarecircles"]) .ui-modal__painel,:host([formato="squircle"]) .ui-modal__painel{border-radius:var(--ui-raio-xl, 16px)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-card: var(--ui-gradiente-card)}';
|
|
7
|
+
function M(e) {
|
|
8
|
+
return e.tagName === "SCRIPT" || e.tagName === "STYLE";
|
|
9
|
+
}
|
|
10
|
+
function R(e) {
|
|
11
|
+
const o = /* @__PURE__ */ new Set();
|
|
12
|
+
if (typeof document > "u") return o;
|
|
13
|
+
const t = (a) => {
|
|
14
|
+
a === e || a.contains(e) || M(a) || a.inert || a.hasAttribute("inert") || (a.setAttribute("inert", ""), a.inert = !0, o.add(a));
|
|
15
|
+
};
|
|
16
|
+
let i = e;
|
|
17
|
+
for (; i && i !== document.body && i !== document.documentElement; ) {
|
|
18
|
+
const a = i.parentElement;
|
|
19
|
+
if (!a) break;
|
|
20
|
+
Array.from(a.children).forEach((l) => t(l)), i = a;
|
|
21
|
+
}
|
|
22
|
+
return document.body && Array.from(document.body.children).forEach((a) => t(a)), o;
|
|
23
|
+
}
|
|
24
|
+
function F(e) {
|
|
25
|
+
e.forEach((o) => {
|
|
26
|
+
o.removeAttribute("inert"), o.inert = !1;
|
|
27
|
+
}), e.clear();
|
|
28
|
+
}
|
|
29
|
+
const n = [];
|
|
30
|
+
let v = /* @__PURE__ */ new Set(), E = "";
|
|
31
|
+
function w() {
|
|
32
|
+
F(v);
|
|
33
|
+
const e = n[n.length - 1];
|
|
34
|
+
v = e ? R(e) : /* @__PURE__ */ new Set();
|
|
35
|
+
}
|
|
36
|
+
function P(e) {
|
|
37
|
+
const o = n.indexOf(e);
|
|
38
|
+
o >= 0 && n.splice(o, 1), n.length === 0 && (E = document.body.style.overflow, document.body.style.overflow = "hidden"), n.push(e), w();
|
|
39
|
+
}
|
|
40
|
+
function x(e) {
|
|
41
|
+
const o = n.indexOf(e);
|
|
42
|
+
o < 0 || (n.splice(o, 1), n.length === 0 && (document.body.style.overflow = E), w());
|
|
43
|
+
}
|
|
44
|
+
function N(e) {
|
|
45
|
+
return n[n.length - 1] === e;
|
|
46
|
+
}
|
|
47
|
+
const g = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-input, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';
|
|
48
|
+
function _() {
|
|
49
|
+
var o;
|
|
50
|
+
let e = document.activeElement;
|
|
51
|
+
for (; (o = e == null ? void 0 : e.shadowRoot) != null && o.activeElement; )
|
|
52
|
+
e = e.shadowRoot.activeElement;
|
|
53
|
+
return e;
|
|
54
|
+
}
|
|
55
|
+
function h(e, o) {
|
|
56
|
+
let t = o;
|
|
57
|
+
for (; t; ) {
|
|
58
|
+
if (t === e) return !0;
|
|
59
|
+
const i = t.getRootNode();
|
|
60
|
+
t = t.parentNode ?? (i instanceof ShadowRoot ? i.host : null);
|
|
61
|
+
}
|
|
62
|
+
return !1;
|
|
63
|
+
}
|
|
64
|
+
function A(e) {
|
|
65
|
+
return !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true";
|
|
66
|
+
}
|
|
67
|
+
function k(e) {
|
|
68
|
+
const o = [];
|
|
69
|
+
return e.querySelectorAll("slot").forEach((t) => {
|
|
70
|
+
t.assignedElements({ flatten: !0 }).forEach((i) => {
|
|
71
|
+
i instanceof HTMLElement && (i.matches(g) && o.push(i), o.push(...Array.from(i.querySelectorAll(g))));
|
|
72
|
+
});
|
|
73
|
+
}), o.filter(A);
|
|
74
|
+
}
|
|
75
|
+
function O(e) {
|
|
76
|
+
return [...Array.from(e.querySelectorAll(g)).filter((t) => window.getComputedStyle(t).display !== "none" && A(t)), ...k(e)];
|
|
77
|
+
}
|
|
78
|
+
function B(e, o) {
|
|
79
|
+
const t = k(e), i = t.filter((a) => a.hasAttribute("autofocus"));
|
|
80
|
+
for (const a of [...i, ...t])
|
|
81
|
+
if (a.focus(), h(a, _())) return;
|
|
82
|
+
o.focus();
|
|
83
|
+
}
|
|
84
|
+
function G(e, o, t) {
|
|
85
|
+
const i = O(t);
|
|
86
|
+
if (i.length === 0) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const a = i[0], l = i[i.length - 1], s = _(), d = !h(o, s), u = h(a, s), c = h(l, s);
|
|
91
|
+
e.shiftKey ? (u || d) && (e.preventDefault(), l.focus()) : (c || d) && (e.preventDefault(), a.focus());
|
|
92
|
+
}
|
|
93
|
+
class S extends D {
|
|
94
|
+
constructor() {
|
|
95
|
+
super();
|
|
96
|
+
r(this, "backdropElement");
|
|
97
|
+
r(this, "dialogElement");
|
|
98
|
+
r(this, "tituloElement");
|
|
99
|
+
r(this, "closeElement");
|
|
100
|
+
r(this, "ouvintes", new T());
|
|
101
|
+
r(this, "_elementoGatilho", null);
|
|
102
|
+
r(this, "_tituloId");
|
|
103
|
+
/** Estado já aplicado (pilha, inert, scroll, eventos); difere de `aberto` durante uma transição. */
|
|
104
|
+
r(this, "_estaAberto", !1);
|
|
105
|
+
r(this, "handleSlotChange", () => {
|
|
106
|
+
this.syncState();
|
|
107
|
+
});
|
|
108
|
+
r(this, "handleBackdropClick", (t) => {
|
|
109
|
+
t.stopPropagation(), this.fechar();
|
|
110
|
+
});
|
|
111
|
+
r(this, "handleCloseClick", (t) => {
|
|
112
|
+
t.stopPropagation(), this.fechar();
|
|
113
|
+
});
|
|
114
|
+
r(this, "handleKeyDown", (t) => {
|
|
115
|
+
this._estaAberto && N(this) && (t.key === "Escape" ? (this.fechar(), t.stopImmediatePropagation()) : t.key === "Tab" && G(t, this, this.shadowRoot));
|
|
116
|
+
});
|
|
117
|
+
this._tituloId = `ui-modal-title-${Math.random().toString(36).substring(2, 9)}`;
|
|
118
|
+
const t = this.attachShadow({ mode: "open" });
|
|
119
|
+
t.innerHTML = `
|
|
120
|
+
<style>${L}</style>
|
|
121
|
+
<div class="ui-modal__backdrop" part="fundo"></div>
|
|
122
|
+
<div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
|
|
123
|
+
<div class="ui-modal__handle"></div>
|
|
124
|
+
<div class="ui-modal__header" part="cabecalho">
|
|
125
|
+
<h3 class="ui-modal__titulo" part="titulo" id="${this._tituloId}"></h3>
|
|
126
|
+
<button class="ui-modal__close" part="fechar" type="button" aria-label="Fechar modal" title="Fechar">✕</button>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="ui-modal__body" part="corpo">
|
|
129
|
+
<slot></slot>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="ui-modal__footer" part="rodape">
|
|
132
|
+
<slot name="rodape"></slot>
|
|
133
|
+
<slot name="footer"></slot>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`, this.backdropElement = t.querySelector(".ui-modal__backdrop"), this.dialogElement = t.querySelector(".ui-modal__dialog"), this.tituloElement = t.querySelector(".ui-modal__titulo"), this.closeElement = t.querySelector(".ui-modal__close");
|
|
137
|
+
}
|
|
138
|
+
static get observedAttributes() {
|
|
139
|
+
return [
|
|
140
|
+
"aberto",
|
|
141
|
+
"open",
|
|
142
|
+
"titulo",
|
|
143
|
+
"title",
|
|
144
|
+
"aria-label",
|
|
145
|
+
"aria-labelledby",
|
|
146
|
+
"rotulo",
|
|
147
|
+
"bottom-sheet",
|
|
148
|
+
"bloquear-fechamento",
|
|
149
|
+
...I
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
connectedCallback() {
|
|
153
|
+
this.ouvintes.cleanup(), this.ouvintes.add(this.backdropElement, "click", this.handleBackdropClick), this.ouvintes.add(this.closeElement, "click", this.handleCloseClick), this.ouvintes.add(window, "keydown", this.handleKeyDown), this.shadowRoot.querySelectorAll("slot").forEach((t) => {
|
|
154
|
+
this.ouvintes.add(t, "slotchange", this.handleSlotChange);
|
|
155
|
+
}), this.syncState();
|
|
156
|
+
}
|
|
157
|
+
disconnectedCallback() {
|
|
158
|
+
this.ouvintes.cleanup(), this._estaAberto && (this._estaAberto = !1, x(this));
|
|
159
|
+
}
|
|
160
|
+
attributeChangedCallback(t, i, a) {
|
|
161
|
+
this.syncState();
|
|
162
|
+
}
|
|
163
|
+
get aberto() {
|
|
164
|
+
return this.hasAttribute("aberto") || this.hasAttribute("open");
|
|
165
|
+
}
|
|
166
|
+
set aberto(t) {
|
|
167
|
+
t ? this.setAttribute("aberto", "") : (this.removeAttribute("aberto"), this.removeAttribute("open"));
|
|
168
|
+
}
|
|
169
|
+
abrir() {
|
|
170
|
+
this.aberto = !0;
|
|
171
|
+
}
|
|
172
|
+
/** Fecha o modal, exceto com `bloquear-fechamento` (remova o atributo ou use `aberto = false` para forçar). */
|
|
173
|
+
fechar() {
|
|
174
|
+
this.hasAttribute("bloquear-fechamento") || (this.aberto = !1);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Abrir/fechar pelo método, pela propriedade ou pelo atributo (`aberto`/`open`, comum em
|
|
178
|
+
* React/Vue) passa sempre por aqui: mesmos eventos, mesmo foco e mesma camada de inert.
|
|
179
|
+
*/
|
|
180
|
+
aoAbrir() {
|
|
181
|
+
this._estaAberto = !0;
|
|
182
|
+
const t = _();
|
|
183
|
+
this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null, P(this), this.dispatchEvent(new CustomEvent("ui-abrir", { bubbles: !0, composed: !0 })), setTimeout(() => {
|
|
184
|
+
this._estaAberto && B(this.shadowRoot, this.dialogElement);
|
|
185
|
+
}, 0);
|
|
186
|
+
}
|
|
187
|
+
aoFechar() {
|
|
188
|
+
this._estaAberto = !1, x(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
189
|
+
const t = this._elementoGatilho;
|
|
190
|
+
this._elementoGatilho = null;
|
|
191
|
+
const i = document.activeElement, a = !i || i === document.body || i === this || this.contains(i);
|
|
192
|
+
t != null && t.isConnected && a && t.focus();
|
|
193
|
+
}
|
|
194
|
+
syncState() {
|
|
195
|
+
var d, u;
|
|
196
|
+
const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "", a = (d = this.shadowRoot) == null ? void 0 : d.querySelector(".ui-modal__footer");
|
|
197
|
+
this.dialogElement.setAttribute("aria-hidden", String(!t)), z(this, this.dialogElement);
|
|
198
|
+
const l = this.getAttribute("aria-label") || this.getAttribute("rotulo"), s = this.getAttribute("aria-labelledby");
|
|
199
|
+
if (l ? (this.dialogElement.setAttribute("aria-label", l), this.dialogElement.removeAttribute("aria-labelledby")) : s ? (this.dialogElement.setAttribute("aria-labelledby", s), this.dialogElement.removeAttribute("aria-label")) : i ? (this.tituloElement.textContent = i, this.tituloElement.style.display = "block", this.dialogElement.setAttribute("aria-labelledby", this._tituloId), this.dialogElement.removeAttribute("aria-label")) : (this.tituloElement.style.display = "none", this.dialogElement.removeAttribute("aria-labelledby"), this.dialogElement.setAttribute("aria-label", "Diálogo modal")), a) {
|
|
200
|
+
const p = Array.from(((u = this.shadowRoot) == null ? void 0 : u.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((b) => b.assignedNodes({ flatten: !0 }).some((f) => f.nodeType === Node.ELEMENT_NODE || f.textContent && f.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
|
|
201
|
+
a.style.display = p ? "flex" : "none";
|
|
202
|
+
}
|
|
203
|
+
this.isConnected && t !== this._estaAberto && (t ? this.aoAbrir() : this.aoFechar());
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
class Y extends S {
|
|
207
|
+
}
|
|
208
|
+
y("ui-modal", S);
|
|
209
|
+
y("ui-dialog", Y);
|
|
210
|
+
function j(e) {
|
|
211
|
+
return typeof document > "u" ? Promise.resolve(!1) : new Promise((o) => {
|
|
212
|
+
const t = document.createElement("ui-modal");
|
|
213
|
+
t.setAttribute("titulo", e.titulo);
|
|
214
|
+
const i = document.createElement("p");
|
|
215
|
+
i.style.margin = "0", i.textContent = e.mensagem, t.appendChild(i);
|
|
216
|
+
const a = (c, p, b) => {
|
|
217
|
+
const m = document.createElement("ui-botao");
|
|
218
|
+
return m.setAttribute("slot", "rodape"), m.setAttribute("variante", b), m.dataset.confirmar = c, m.textContent = p, m;
|
|
219
|
+
}, l = a("cancelar", e.rotuloCancelar || "Cancelar", "secundario"), s = a("confirmar", e.rotuloConfirmar, e.destrutivo ? "destrutivo" : "primario");
|
|
220
|
+
t.append(l, s);
|
|
221
|
+
let d = !1;
|
|
222
|
+
const u = (c) => {
|
|
223
|
+
d || (d = !0, o(c), t.aberto = !1, setTimeout(() => t.remove(), 0));
|
|
18
224
|
};
|
|
19
|
-
s.addEventListener("click", () =>
|
|
225
|
+
s.addEventListener("click", () => u(!0)), l.addEventListener("click", () => u(!1)), t.addEventListener("ui-fechar", () => u(!1)), document.body.appendChild(t), t.abrir();
|
|
20
226
|
});
|
|
21
227
|
}
|
|
22
|
-
async function
|
|
23
|
-
return
|
|
24
|
-
titulo:
|
|
25
|
-
mensagem:
|
|
26
|
-
rotuloConfirmar:
|
|
27
|
-
rotuloCancelar:
|
|
228
|
+
async function K(e, o = {}) {
|
|
229
|
+
return e.avaliar() ? j({
|
|
230
|
+
titulo: o.titulo ?? "Descartar alterações?",
|
|
231
|
+
mensagem: o.mensagem ?? "Há alterações que ainda não foram salvas. Se continuar, elas serão perdidas.",
|
|
232
|
+
rotuloConfirmar: o.rotuloConfirmar ?? "Descartar alterações",
|
|
233
|
+
rotuloCancelar: o.rotuloCancelar ?? "Continuar editando",
|
|
28
234
|
destrutivo: !0
|
|
29
235
|
}) : !0;
|
|
30
236
|
}
|
|
31
237
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
238
|
+
Y as UIDialog,
|
|
239
|
+
S as UIModal,
|
|
240
|
+
R as aplicarInertForaDoModal,
|
|
241
|
+
j as confirmarAcao,
|
|
242
|
+
K as confirmarDescarteSeSujo,
|
|
243
|
+
F as removerInertForaDoModal
|
|
38
244
|
};
|