@thibezer/ui-components-kit 2.15.0 → 2.17.1
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 +57 -0
- package/README.md +1 -1
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +89 -89
- package/dist/camadas.js +1376 -1320
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +24 -24
- package/dist/canvas.js +757 -751
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-avatar/ui-avatar.d.ts +7 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-colecao.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +3 -1
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +1 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +7 -0
- package/dist/components/ui-mapa/ui-mapa.d.ts +1 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +6 -0
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-stat/ui-stat.d.ts +12 -0
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +2 -1
- package/dist/components/ui-tabela-propriedades/propriedades-persistencia.d.ts +63 -0
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +1 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +16 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +40 -1
- package/dist/core/degrade.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +33 -24
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +2 -2
- package/dist/custom-elements.json +6896 -5351
- package/dist/data.cjs +1 -1
- package/dist/data.js +89 -79
- package/dist/degrade-CIxvOTUv.cjs +1 -0
- package/dist/degrade-gDa5sW__.js +119 -0
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +215 -196
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +12 -12
- package/dist/seletor-mapa-base.cjs +10 -10
- package/dist/seletor-mapa-base.js +34 -28
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +83 -73
- package/dist/tipos-elementos.d.ts +33 -3
- package/dist/tipos-vue.d.ts +30 -3
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-1UU8vT-b.js +198 -0
- package/dist/ui-badge-CKKKPdt8.cjs +28 -0
- package/dist/ui-badge-DE58YSBY.cjs +28 -0
- package/dist/ui-badge-KgmI3jOD.js +201 -0
- package/dist/ui-botao-Dz8YvmiA.cjs +12 -0
- package/dist/ui-botao-bU_bf6SU.js +166 -0
- package/dist/ui-botao-xTbH5mpH.cjs +12 -0
- package/dist/ui-botao-zLkcMMyP.js +168 -0
- package/dist/ui-campo-texto-DVU_sWV1.cjs +16 -0
- package/dist/ui-campo-texto-Dliyt9qr.cjs +16 -0
- package/dist/ui-campo-texto-W5M0gNE4.js +377 -0
- package/dist/ui-campo-texto-btevggO3.js +379 -0
- package/dist/ui-card-BYyYxxY1.cjs +20 -0
- package/dist/ui-card-CojoGXaT.js +144 -0
- package/dist/ui-card-DFnRp9bl.js +146 -0
- package/dist/ui-card-DrWVJQKw.cjs +20 -0
- package/dist/ui-controle-cores-B1w_Yl69.cjs +32 -0
- package/dist/ui-controle-cores-BRjMvmMn.js +291 -0
- package/dist/ui-controle-cores-Bq_XUrIQ.cjs +32 -0
- package/dist/ui-controle-cores-BtA6yzu3.js +291 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-2kY7TNUJ.cjs +38 -0
- package/dist/ui-linha-DAz6DBcl.cjs +38 -0
- package/dist/ui-linha-DkxwMhD-.js +749 -0
- package/dist/ui-linha-KFF86FW5.js +752 -0
- package/dist/ui-modal-4nU-tXjO.cjs +18 -0
- package/dist/ui-modal-BrXzVZ65.js +216 -0
- package/dist/ui-modal-BwB9fksp.js +214 -0
- package/dist/ui-modal-lARKzEVZ.cjs +18 -0
- package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +1245 -0
- package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +21 -0
- package/dist/ui-seletor-cor-CMuuW-Ym.cjs +83 -0
- package/dist/ui-seletor-cor-DFIQ1sin.js +405 -0
- package/dist/ui-skeleton-BLEV6h3k.js +653 -0
- package/dist/ui-skeleton-B_XTaGrX.cjs +52 -0
- package/dist/ui-skeleton-DEHwpDqa.js +648 -0
- package/dist/ui-skeleton-sIphhOSx.cjs +52 -0
- package/dist/ui-switch-BXIDwC-Y.cjs +66 -0
- package/dist/ui-switch-Ctxk-jKS.js +1212 -0
- package/dist/ui-switch-DAIgOhqr.cjs +66 -0
- package/dist/ui-switch-_F8yubdX.js +1203 -0
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +3202 -0
- package/dist/ui-tabela-propriedades-CJyo568n.js +3517 -0
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +142 -0
- package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +142 -0
- package/package.json +187 -187
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var I=Object.defineProperty;var D=(e,o,t)=>o in e?I(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var r=(e,o,t)=>D(e,typeof o!="symbol"?o+"":o,t);const p=require("./ssr-safe-CiHD1adl.cjs"),M=require("./listener-bag-D5omxZ9h.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-color: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: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: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-color: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)}';function T(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"}function v(e){const o=new Set;if(typeof document>"u")return o;const t=a=>{a===e||a.contains(e)||T(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(n=>t(n)),i=a}return document.body&&Array.from(document.body.children).forEach(a=>t(a)),o}function y(e){e.forEach(o=>{o.removeAttribute("inert"),o.inert=!1}),e.clear()}const l=[];let g=new Set,w="";function E(){y(g);const e=l[l.length-1];g=e?v(e):new Set}function F(e){const o=l.indexOf(e);o>=0&&l.splice(o,1),l.length===0&&(w=document.body.style.overflow,document.body.style.overflow="hidden"),l.push(e),E()}function x(e){const o=l.indexOf(e);o<0||(l.splice(o,1),l.length===0&&(document.body.style.overflow=w),E())}function R(e){return l[l.length-1]===e}const m='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 b(){var o;let e=document.activeElement;for(;(o=e==null?void 0:e.shadowRoot)!=null&&o.activeElement;)e=e.shadowRoot.activeElement;return e}function c(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 A(e){return!e.hasAttribute("disabled")&&e.getAttribute("aria-hidden")!=="true"}function k(e){const o=[];return e.querySelectorAll("slot").forEach(t=>{t.assignedElements({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(i.matches(m)&&o.push(i),o.push(...Array.from(i.querySelectorAll(m))))})}),o.filter(A)}function L(e){return[...Array.from(e.querySelectorAll(m)).filter(t=>window.getComputedStyle(t).display!=="none"&&A(t)),...k(e)]}function N(e,o){const t=k(e),i=t.filter(a=>a.hasAttribute("autofocus"));for(const a of[...i,...t])if(a.focus(),c(a,b()))return;o.focus()}function P(e,o,t){const i=L(t);if(i.length===0){e.preventDefault();return}const a=i[0],n=i[i.length-1],s=b(),d=!c(o,s),u=c(a,s),_=c(n,s);e.shiftKey?(u||d)&&(e.preventDefault(),n.focus()):(_||d)&&(e.preventDefault(),a.focus())}class f extends p.SafeHTMLElement{constructor(){super();r(this,"backdropElement");r(this,"dialogElement");r(this,"tituloElement");r(this,"closeElement");r(this,"ouvintes",new M.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&&R(this)&&(t.key==="Escape"?(this.fechar(),t.stopImmediatePropagation()):t.key==="Tab"&&P(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"]}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,x(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=b();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,x(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));const n=this.getAttribute("aria-label")||this.getAttribute("rotulo"),s=this.getAttribute("aria-labelledby");if(n?(this.dialogElement.setAttribute("aria-label",n),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 C=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(q=>q.assignedNodes({flatten:!0}).some(h=>h.nodeType===Node.ELEMENT_NODE||h.textContent&&h.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;a.style.display=C?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}}class S extends f{}p.definirCustomElement("ui-modal",f);p.definirCustomElement("ui-dialog",S);exports.UIDialog=S;exports.UIModal=f;exports.aplicarInertForaDoModal=v;exports.removerInertForaDoModal=y;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var C = (e, o, t) => o in e ? S(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var r = (e, o, t) => C(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { d as _, S as q } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
+
import { L as D } from "./listener-bag-DQgv7OON.js";
|
|
6
|
+
import { A as I, a as T } from "./degrade-gDa5sW__.js";
|
|
7
|
+
const 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)}';
|
|
8
|
+
function M(e) {
|
|
9
|
+
return e.tagName === "SCRIPT" || e.tagName === "STYLE";
|
|
10
|
+
}
|
|
11
|
+
function R(e) {
|
|
12
|
+
const o = /* @__PURE__ */ new Set();
|
|
13
|
+
if (typeof document > "u") return o;
|
|
14
|
+
const t = (a) => {
|
|
15
|
+
a === e || a.contains(e) || M(a) || a.inert || a.hasAttribute("inert") || (a.setAttribute("inert", ""), a.inert = !0, o.add(a));
|
|
16
|
+
};
|
|
17
|
+
let i = e;
|
|
18
|
+
for (; i && i !== document.body && i !== document.documentElement; ) {
|
|
19
|
+
const a = i.parentElement;
|
|
20
|
+
if (!a) break;
|
|
21
|
+
Array.from(a.children).forEach((l) => t(l)), i = a;
|
|
22
|
+
}
|
|
23
|
+
return document.body && Array.from(document.body.children).forEach((a) => t(a)), o;
|
|
24
|
+
}
|
|
25
|
+
function F(e) {
|
|
26
|
+
e.forEach((o) => {
|
|
27
|
+
o.removeAttribute("inert"), o.inert = !1;
|
|
28
|
+
}), e.clear();
|
|
29
|
+
}
|
|
30
|
+
const n = [];
|
|
31
|
+
let f = /* @__PURE__ */ new Set(), v = "";
|
|
32
|
+
function x() {
|
|
33
|
+
F(f);
|
|
34
|
+
const e = n[n.length - 1];
|
|
35
|
+
f = e ? R(e) : /* @__PURE__ */ new Set();
|
|
36
|
+
}
|
|
37
|
+
function L(e) {
|
|
38
|
+
const o = n.indexOf(e);
|
|
39
|
+
o >= 0 && n.splice(o, 1), n.length === 0 && (v = document.body.style.overflow, document.body.style.overflow = "hidden"), n.push(e), x();
|
|
40
|
+
}
|
|
41
|
+
function g(e) {
|
|
42
|
+
const o = n.indexOf(e);
|
|
43
|
+
o < 0 || (n.splice(o, 1), n.length === 0 && (document.body.style.overflow = v), x());
|
|
44
|
+
}
|
|
45
|
+
function N(e) {
|
|
46
|
+
return n[n.length - 1] === e;
|
|
47
|
+
}
|
|
48
|
+
const m = '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';
|
|
49
|
+
function p() {
|
|
50
|
+
var o;
|
|
51
|
+
let e = document.activeElement;
|
|
52
|
+
for (; (o = e == null ? void 0 : e.shadowRoot) != null && o.activeElement; )
|
|
53
|
+
e = e.shadowRoot.activeElement;
|
|
54
|
+
return e;
|
|
55
|
+
}
|
|
56
|
+
function c(e, o) {
|
|
57
|
+
let t = o;
|
|
58
|
+
for (; t; ) {
|
|
59
|
+
if (t === e) return !0;
|
|
60
|
+
const i = t.getRootNode();
|
|
61
|
+
t = t.parentNode ?? (i instanceof ShadowRoot ? i.host : null);
|
|
62
|
+
}
|
|
63
|
+
return !1;
|
|
64
|
+
}
|
|
65
|
+
function y(e) {
|
|
66
|
+
return !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true";
|
|
67
|
+
}
|
|
68
|
+
function w(e) {
|
|
69
|
+
const o = [];
|
|
70
|
+
return e.querySelectorAll("slot").forEach((t) => {
|
|
71
|
+
t.assignedElements({ flatten: !0 }).forEach((i) => {
|
|
72
|
+
i instanceof HTMLElement && (i.matches(m) && o.push(i), o.push(...Array.from(i.querySelectorAll(m))));
|
|
73
|
+
});
|
|
74
|
+
}), o.filter(y);
|
|
75
|
+
}
|
|
76
|
+
function P(e) {
|
|
77
|
+
return [...Array.from(e.querySelectorAll(m)).filter((t) => window.getComputedStyle(t).display !== "none" && y(t)), ...w(e)];
|
|
78
|
+
}
|
|
79
|
+
function O(e, o) {
|
|
80
|
+
const t = w(e), i = t.filter((a) => a.hasAttribute("autofocus"));
|
|
81
|
+
for (const a of [...i, ...t])
|
|
82
|
+
if (a.focus(), c(a, p())) return;
|
|
83
|
+
o.focus();
|
|
84
|
+
}
|
|
85
|
+
function G(e, o, t) {
|
|
86
|
+
const i = P(t);
|
|
87
|
+
if (i.length === 0) {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const a = i[0], l = i[i.length - 1], s = p(), d = !c(o, s), u = c(a, s), b = c(l, s);
|
|
92
|
+
e.shiftKey ? (u || d) && (e.preventDefault(), l.focus()) : (b || d) && (e.preventDefault(), a.focus());
|
|
93
|
+
}
|
|
94
|
+
class E extends q {
|
|
95
|
+
constructor() {
|
|
96
|
+
super();
|
|
97
|
+
r(this, "backdropElement");
|
|
98
|
+
r(this, "dialogElement");
|
|
99
|
+
r(this, "tituloElement");
|
|
100
|
+
r(this, "closeElement");
|
|
101
|
+
r(this, "ouvintes", new D());
|
|
102
|
+
r(this, "_elementoGatilho", null);
|
|
103
|
+
r(this, "_tituloId");
|
|
104
|
+
/** Estado já aplicado (pilha, inert, scroll, eventos); difere de `aberto` durante uma transição. */
|
|
105
|
+
r(this, "_estaAberto", !1);
|
|
106
|
+
r(this, "handleSlotChange", () => {
|
|
107
|
+
this.syncState();
|
|
108
|
+
});
|
|
109
|
+
r(this, "handleBackdropClick", (t) => {
|
|
110
|
+
t.stopPropagation(), this.fechar();
|
|
111
|
+
});
|
|
112
|
+
r(this, "handleCloseClick", (t) => {
|
|
113
|
+
t.stopPropagation(), this.fechar();
|
|
114
|
+
});
|
|
115
|
+
r(this, "handleKeyDown", (t) => {
|
|
116
|
+
this._estaAberto && N(this) && (t.key === "Escape" ? (this.fechar(), t.stopImmediatePropagation()) : t.key === "Tab" && G(t, this, this.shadowRoot));
|
|
117
|
+
});
|
|
118
|
+
this._tituloId = `ui-modal-title-${Math.random().toString(36).substring(2, 9)}`;
|
|
119
|
+
const t = this.attachShadow({ mode: "open" });
|
|
120
|
+
t.innerHTML = `
|
|
121
|
+
<style>${z}</style>
|
|
122
|
+
<div class="ui-modal__backdrop" part="fundo"></div>
|
|
123
|
+
<div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
|
|
124
|
+
<div class="ui-modal__handle"></div>
|
|
125
|
+
<div class="ui-modal__header" part="cabecalho">
|
|
126
|
+
<h3 class="ui-modal__titulo" part="titulo" id="${this._tituloId}"></h3>
|
|
127
|
+
<button class="ui-modal__close" part="fechar" type="button" aria-label="Fechar modal" title="Fechar">✕</button>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="ui-modal__body" part="corpo">
|
|
130
|
+
<slot></slot>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="ui-modal__footer" part="rodape">
|
|
133
|
+
<slot name="rodape"></slot>
|
|
134
|
+
<slot name="footer"></slot>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
`, 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");
|
|
138
|
+
}
|
|
139
|
+
static get observedAttributes() {
|
|
140
|
+
return [
|
|
141
|
+
"aberto",
|
|
142
|
+
"open",
|
|
143
|
+
"titulo",
|
|
144
|
+
"title",
|
|
145
|
+
"aria-label",
|
|
146
|
+
"aria-labelledby",
|
|
147
|
+
"rotulo",
|
|
148
|
+
"bottom-sheet",
|
|
149
|
+
"bloquear-fechamento",
|
|
150
|
+
...I
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
connectedCallback() {
|
|
154
|
+
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) => {
|
|
155
|
+
this.ouvintes.add(t, "slotchange", this.handleSlotChange);
|
|
156
|
+
}), this.syncState();
|
|
157
|
+
}
|
|
158
|
+
disconnectedCallback() {
|
|
159
|
+
this.ouvintes.cleanup(), this._estaAberto && (this._estaAberto = !1, g(this));
|
|
160
|
+
}
|
|
161
|
+
attributeChangedCallback(t, i, a) {
|
|
162
|
+
this.syncState();
|
|
163
|
+
}
|
|
164
|
+
get aberto() {
|
|
165
|
+
return this.hasAttribute("aberto") || this.hasAttribute("open");
|
|
166
|
+
}
|
|
167
|
+
set aberto(t) {
|
|
168
|
+
t ? this.setAttribute("aberto", "") : (this.removeAttribute("aberto"), this.removeAttribute("open"));
|
|
169
|
+
}
|
|
170
|
+
abrir() {
|
|
171
|
+
this.aberto = !0;
|
|
172
|
+
}
|
|
173
|
+
/** Fecha o modal, exceto com `bloquear-fechamento` (remova o atributo ou use `aberto = false` para forçar). */
|
|
174
|
+
fechar() {
|
|
175
|
+
this.hasAttribute("bloquear-fechamento") || (this.aberto = !1);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Abrir/fechar pelo método, pela propriedade ou pelo atributo (`aberto`/`open`, comum em
|
|
179
|
+
* React/Vue) passa sempre por aqui: mesmos eventos, mesmo foco e mesma camada de inert.
|
|
180
|
+
*/
|
|
181
|
+
aoAbrir() {
|
|
182
|
+
this._estaAberto = !0;
|
|
183
|
+
const t = p();
|
|
184
|
+
this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null, L(this), this.dispatchEvent(new CustomEvent("ui-abrir", { bubbles: !0, composed: !0 })), setTimeout(() => {
|
|
185
|
+
this._estaAberto && O(this.shadowRoot, this.dialogElement);
|
|
186
|
+
}, 0);
|
|
187
|
+
}
|
|
188
|
+
aoFechar() {
|
|
189
|
+
this._estaAberto = !1, g(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
190
|
+
const t = this._elementoGatilho;
|
|
191
|
+
this._elementoGatilho = null;
|
|
192
|
+
const i = document.activeElement, a = !i || i === document.body || i === this || this.contains(i);
|
|
193
|
+
t != null && t.isConnected && a && t.focus();
|
|
194
|
+
}
|
|
195
|
+
syncState() {
|
|
196
|
+
var d, u;
|
|
197
|
+
const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "", a = (d = this.shadowRoot) == null ? void 0 : d.querySelector(".ui-modal__footer");
|
|
198
|
+
this.dialogElement.setAttribute("aria-hidden", String(!t)), T(this, this.dialogElement);
|
|
199
|
+
const l = this.getAttribute("aria-label") || this.getAttribute("rotulo"), s = this.getAttribute("aria-labelledby");
|
|
200
|
+
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) {
|
|
201
|
+
const A = Array.from(((u = this.shadowRoot) == null ? void 0 : u.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((k) => k.assignedNodes({ flatten: !0 }).some((h) => h.nodeType === Node.ELEMENT_NODE || h.textContent && h.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
|
|
202
|
+
a.style.display = A ? "flex" : "none";
|
|
203
|
+
}
|
|
204
|
+
this.isConnected && t !== this._estaAberto && (t ? this.aoAbrir() : this.aoFechar());
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
class U extends E {
|
|
208
|
+
}
|
|
209
|
+
_("ui-modal", E);
|
|
210
|
+
_("ui-dialog", U);
|
|
211
|
+
export {
|
|
212
|
+
U,
|
|
213
|
+
E as a,
|
|
214
|
+
R as b,
|
|
215
|
+
F as r
|
|
216
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var C = (e, o, t) => o in e ? S(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var r = (e, o, t) => C(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { d as g, S as q } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
+
import { L as I } from "./listener-bag-DQgv7OON.js";
|
|
6
|
+
const 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-color: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: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: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-color: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)}';
|
|
7
|
+
function D(e) {
|
|
8
|
+
return e.tagName === "SCRIPT" || e.tagName === "STYLE";
|
|
9
|
+
}
|
|
10
|
+
function M(e) {
|
|
11
|
+
const o = /* @__PURE__ */ new Set();
|
|
12
|
+
if (typeof document > "u") return o;
|
|
13
|
+
const t = (a) => {
|
|
14
|
+
a === e || a.contains(e) || D(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((n) => t(n)), i = a;
|
|
21
|
+
}
|
|
22
|
+
return document.body && Array.from(document.body.children).forEach((a) => t(a)), o;
|
|
23
|
+
}
|
|
24
|
+
function T(e) {
|
|
25
|
+
e.forEach((o) => {
|
|
26
|
+
o.removeAttribute("inert"), o.inert = !1;
|
|
27
|
+
}), e.clear();
|
|
28
|
+
}
|
|
29
|
+
const l = [];
|
|
30
|
+
let f = /* @__PURE__ */ new Set(), x = "";
|
|
31
|
+
function v() {
|
|
32
|
+
T(f);
|
|
33
|
+
const e = l[l.length - 1];
|
|
34
|
+
f = e ? M(e) : /* @__PURE__ */ new Set();
|
|
35
|
+
}
|
|
36
|
+
function R(e) {
|
|
37
|
+
const o = l.indexOf(e);
|
|
38
|
+
o >= 0 && l.splice(o, 1), l.length === 0 && (x = document.body.style.overflow, document.body.style.overflow = "hidden"), l.push(e), v();
|
|
39
|
+
}
|
|
40
|
+
function _(e) {
|
|
41
|
+
const o = l.indexOf(e);
|
|
42
|
+
o < 0 || (l.splice(o, 1), l.length === 0 && (document.body.style.overflow = x), v());
|
|
43
|
+
}
|
|
44
|
+
function F(e) {
|
|
45
|
+
return l[l.length - 1] === e;
|
|
46
|
+
}
|
|
47
|
+
const m = '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 p() {
|
|
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 c(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 y(e) {
|
|
65
|
+
return !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true";
|
|
66
|
+
}
|
|
67
|
+
function w(e) {
|
|
68
|
+
const o = [];
|
|
69
|
+
return e.querySelectorAll("slot").forEach((t) => {
|
|
70
|
+
t.assignedElements({ flatten: !0 }).forEach((i) => {
|
|
71
|
+
i instanceof HTMLElement && (i.matches(m) && o.push(i), o.push(...Array.from(i.querySelectorAll(m))));
|
|
72
|
+
});
|
|
73
|
+
}), o.filter(y);
|
|
74
|
+
}
|
|
75
|
+
function L(e) {
|
|
76
|
+
return [...Array.from(e.querySelectorAll(m)).filter((t) => window.getComputedStyle(t).display !== "none" && y(t)), ...w(e)];
|
|
77
|
+
}
|
|
78
|
+
function N(e, o) {
|
|
79
|
+
const t = w(e), i = t.filter((a) => a.hasAttribute("autofocus"));
|
|
80
|
+
for (const a of [...i, ...t])
|
|
81
|
+
if (a.focus(), c(a, p())) return;
|
|
82
|
+
o.focus();
|
|
83
|
+
}
|
|
84
|
+
function P(e, o, t) {
|
|
85
|
+
const i = L(t);
|
|
86
|
+
if (i.length === 0) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const a = i[0], n = i[i.length - 1], s = p(), d = !c(o, s), u = c(a, s), b = c(n, s);
|
|
91
|
+
e.shiftKey ? (u || d) && (e.preventDefault(), n.focus()) : (b || d) && (e.preventDefault(), a.focus());
|
|
92
|
+
}
|
|
93
|
+
class A extends q {
|
|
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 I());
|
|
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 && F(this) && (t.key === "Escape" ? (this.fechar(), t.stopImmediatePropagation()) : t.key === "Tab" && P(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>${z}</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
|
+
];
|
|
150
|
+
}
|
|
151
|
+
connectedCallback() {
|
|
152
|
+
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) => {
|
|
153
|
+
this.ouvintes.add(t, "slotchange", this.handleSlotChange);
|
|
154
|
+
}), this.syncState();
|
|
155
|
+
}
|
|
156
|
+
disconnectedCallback() {
|
|
157
|
+
this.ouvintes.cleanup(), this._estaAberto && (this._estaAberto = !1, _(this));
|
|
158
|
+
}
|
|
159
|
+
attributeChangedCallback(t, i, a) {
|
|
160
|
+
this.syncState();
|
|
161
|
+
}
|
|
162
|
+
get aberto() {
|
|
163
|
+
return this.hasAttribute("aberto") || this.hasAttribute("open");
|
|
164
|
+
}
|
|
165
|
+
set aberto(t) {
|
|
166
|
+
t ? this.setAttribute("aberto", "") : (this.removeAttribute("aberto"), this.removeAttribute("open"));
|
|
167
|
+
}
|
|
168
|
+
abrir() {
|
|
169
|
+
this.aberto = !0;
|
|
170
|
+
}
|
|
171
|
+
/** Fecha o modal, exceto com `bloquear-fechamento` (remova o atributo ou use `aberto = false` para forçar). */
|
|
172
|
+
fechar() {
|
|
173
|
+
this.hasAttribute("bloquear-fechamento") || (this.aberto = !1);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Abrir/fechar pelo método, pela propriedade ou pelo atributo (`aberto`/`open`, comum em
|
|
177
|
+
* React/Vue) passa sempre por aqui: mesmos eventos, mesmo foco e mesma camada de inert.
|
|
178
|
+
*/
|
|
179
|
+
aoAbrir() {
|
|
180
|
+
this._estaAberto = !0;
|
|
181
|
+
const t = p();
|
|
182
|
+
this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null, R(this), this.dispatchEvent(new CustomEvent("ui-abrir", { bubbles: !0, composed: !0 })), setTimeout(() => {
|
|
183
|
+
this._estaAberto && N(this.shadowRoot, this.dialogElement);
|
|
184
|
+
}, 0);
|
|
185
|
+
}
|
|
186
|
+
aoFechar() {
|
|
187
|
+
this._estaAberto = !1, _(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
188
|
+
const t = this._elementoGatilho;
|
|
189
|
+
this._elementoGatilho = null;
|
|
190
|
+
const i = document.activeElement, a = !i || i === document.body || i === this || this.contains(i);
|
|
191
|
+
t != null && t.isConnected && a && t.focus();
|
|
192
|
+
}
|
|
193
|
+
syncState() {
|
|
194
|
+
var d, u;
|
|
195
|
+
const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "", a = (d = this.shadowRoot) == null ? void 0 : d.querySelector(".ui-modal__footer");
|
|
196
|
+
this.dialogElement.setAttribute("aria-hidden", String(!t));
|
|
197
|
+
const n = this.getAttribute("aria-label") || this.getAttribute("rotulo"), s = this.getAttribute("aria-labelledby");
|
|
198
|
+
if (n ? (this.dialogElement.setAttribute("aria-label", n), 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) {
|
|
199
|
+
const E = Array.from(((u = this.shadowRoot) == null ? void 0 : u.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((k) => k.assignedNodes({ flatten: !0 }).some((h) => h.nodeType === Node.ELEMENT_NODE || h.textContent && h.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
|
|
200
|
+
a.style.display = E ? "flex" : "none";
|
|
201
|
+
}
|
|
202
|
+
this.isConnected && t !== this._estaAberto && (t ? this.aoAbrir() : this.aoFechar());
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
class O extends A {
|
|
206
|
+
}
|
|
207
|
+
g("ui-modal", A);
|
|
208
|
+
g("ui-dialog", O);
|
|
209
|
+
export {
|
|
210
|
+
O as U,
|
|
211
|
+
A as a,
|
|
212
|
+
M as b,
|
|
213
|
+
T as r
|
|
214
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var D=Object.defineProperty;var M=(e,o,t)=>o in e?D(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var r=(e,o,t)=>M(e,typeof o!="symbol"?o+"":o,t);const p=require("./ssr-safe-CiHD1adl.cjs"),T=require("./listener-bag-D5omxZ9h.cjs"),_=require("./degrade-CIxvOTUv.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 y(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 w(e){e.forEach(o=>{o.removeAttribute("inert"),o.inert=!1}),e.clear()}const n=[];let v=new Set,E="";function A(){w(v);const e=n[n.length-1];v=e?y(e):new Set}function F(e){const o=n.indexOf(e);o>=0&&n.splice(o,1),n.length===0&&(E=document.body.style.overflow,document.body.style.overflow="hidden"),n.push(e),A()}function x(e){const o=n.indexOf(e);o<0||(n.splice(o,1),n.length===0&&(document.body.style.overflow=E),A())}function L(e){return n[n.length-1]===e}const m='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 b(){var o;let e=document.activeElement;for(;(o=e==null?void 0:e.shadowRoot)!=null&&o.activeElement;)e=e.shadowRoot.activeElement;return e}function c(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 k(e){return!e.hasAttribute("disabled")&&e.getAttribute("aria-hidden")!=="true"}function S(e){const o=[];return e.querySelectorAll("slot").forEach(t=>{t.assignedElements({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(i.matches(m)&&o.push(i),o.push(...Array.from(i.querySelectorAll(m))))})}),o.filter(k)}function N(e){return[...Array.from(e.querySelectorAll(m)).filter(t=>window.getComputedStyle(t).display!=="none"&&k(t)),...S(e)]}function P(e,o){const t=S(e),i=t.filter(a=>a.hasAttribute("autofocus"));for(const a of[...i,...t])if(a.focus(),c(a,b()))return;o.focus()}function O(e,o,t){const i=N(t);if(i.length===0){e.preventDefault();return}const a=i[0],l=i[i.length-1],s=b(),d=!c(o,s),u=c(a,s),g=c(l,s);e.shiftKey?(u||d)&&(e.preventDefault(),l.focus()):(g||d)&&(e.preventDefault(),a.focus())}class f extends p.SafeHTMLElement{constructor(){super();r(this,"backdropElement");r(this,"dialogElement");r(this,"tituloElement");r(this,"closeElement");r(this,"ouvintes",new T.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",..._.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,x(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=b();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&&P(this.shadowRoot,this.dialogElement)},0)}aoFechar(){this._estaAberto=!1,x(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)),_.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 q=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(I=>I.assignedNodes({flatten:!0}).some(h=>h.nodeType===Node.ELEMENT_NODE||h.textContent&&h.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;a.style.display=q?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}}class C extends f{}p.definirCustomElement("ui-modal",f);p.definirCustomElement("ui-dialog",C);exports.UIDialog=C;exports.UIModal=f;exports.aplicarInertForaDoModal=y;exports.removerInertForaDoModal=w;
|