@thibezer/ui-components-kit 2.17.1 → 2.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/camadas.cjs +51 -52
- package/dist/camadas.js +136 -135
- package/dist/custom-elements.json +4090 -4090
- package/package.json +1 -1
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +0 -3
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +0 -6
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +0 -6
- package/dist/leaflet-DcO7uRC-.cjs +0 -1
- package/dist/leaflet-PPDKB6Dd.js +0 -69
- package/dist/motor-BCWqlv3e.cjs +0 -1
- package/dist/motor-CXjQjVba.js +0 -1386
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-1UU8vT-b.js +0 -198
- package/dist/ui-badge-B5J_c5P5.js +0 -197
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-badge-CKKKPdt8.cjs +0 -28
- package/dist/ui-badge-DC4y6Dik.cjs +0 -28
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-bU_bf6SU.js +0 -166
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-botao-xTbH5mpH.cjs +0 -12
- package/dist/ui-campo-texto-19tIrmBK.js +0 -377
- package/dist/ui-campo-texto-CH8mzX61.cjs +0 -16
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-DVU_sWV1.cjs +0 -16
- package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
- package/dist/ui-campo-texto-W5M0gNE4.js +0 -377
- package/dist/ui-card-0wu4rjEX.cjs +0 -20
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-BYyYxxY1.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- package/dist/ui-card-CojoGXaT.js +0 -144
- package/dist/ui-card-DRtpOo3l.js +0 -143
- package/dist/ui-controle-cores-B4R6ct4I.js +0 -291
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-Bq_XUrIQ.cjs +0 -32
- package/dist/ui-controle-cores-BtA6yzu3.js +0 -291
- package/dist/ui-controle-cores-C8um-If9.cjs +0 -32
- package/dist/ui-controle-cores-CHMKGemo.cjs +0 -141
- package/dist/ui-controle-cores-C_cVXxCn.js +0 -291
- package/dist/ui-controle-cores-CuDFS8Y8.cjs +0 -32
- package/dist/ui-controle-cores-Dog7ERYv.js +0 -697
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-linha-BxhEBn27.js +0 -749
- package/dist/ui-linha-C306zxWG.cjs +0 -19
- package/dist/ui-linha-C_azWkcG.js +0 -517
- package/dist/ui-linha-CcalUBDw.cjs +0 -38
- package/dist/ui-linha-DAz6DBcl.cjs +0 -38
- package/dist/ui-linha-DkxwMhD-.js +0 -749
- package/dist/ui-modal-4nU-tXjO.cjs +0 -18
- package/dist/ui-modal-BkYvNP0G.js +0 -214
- package/dist/ui-modal-BwB9fksp.js +0 -214
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-modal-DBOtSTbR.js +0 -238
- package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +0 -1233
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +0 -1173
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-DyF5YLsV.js +0 -418
- package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-seletor-cor-C4U2eqxY.cjs +0 -82
- package/dist/ui-seletor-cor-D2_C6Aor.js +0 -391
- package/dist/ui-seletor-cor-DPKqf5wb.cjs +0 -82
- package/dist/ui-seletor-cor-FYtRccnK.js +0 -396
- package/dist/ui-skeleton-B2Rgrv8o.js +0 -648
- package/dist/ui-skeleton-DEHwpDqa.js +0 -648
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-DiOxTBZK.cjs +0 -52
- package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
- package/dist/ui-skeleton-W9uwIceA.js +0 -585
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-skeleton-sIphhOSx.cjs +0 -52
- package/dist/ui-switch-BL-x_-SM.js +0 -1202
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-C0i_3QXu.cjs +0 -66
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-switch-DAIgOhqr.cjs +0 -66
- package/dist/ui-switch-_F8yubdX.js +0 -1203
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +0 -3202
- package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +0 -142
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +0 -141
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-BoYXzP5Z.js +0 -3191
- package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +0 -141
- package/dist/ui-tabela-propriedades-C5YYnod1.js +0 -3053
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +0 -142
- package/dist/ui-tabela-propriedades-CyPyKXtB.js +0 -3013
- package/dist/ui-tabela-propriedades-DWOKznMN.cjs +0 -142
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- package/dist/ui-tabela-propriedades-DqvPilK_.cjs +0 -142
- package/dist/ui-tabela-propriedades-DuaC4sFX.js +0 -2767
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,214 +0,0 @@
|
|
|
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 I } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
-
import { L as q } 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}';
|
|
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((l) => t(l)), 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 n = [];
|
|
30
|
-
let f = /* @__PURE__ */ new Set(), x = "";
|
|
31
|
-
function v() {
|
|
32
|
-
T(f);
|
|
33
|
-
const e = n[n.length - 1];
|
|
34
|
-
f = e ? M(e) : /* @__PURE__ */ new Set();
|
|
35
|
-
}
|
|
36
|
-
function R(e) {
|
|
37
|
-
const o = n.indexOf(e);
|
|
38
|
-
o >= 0 && n.splice(o, 1), n.length === 0 && (x = document.body.style.overflow, document.body.style.overflow = "hidden"), n.push(e), v();
|
|
39
|
-
}
|
|
40
|
-
function _(e) {
|
|
41
|
-
const o = n.indexOf(e);
|
|
42
|
-
o < 0 || (n.splice(o, 1), n.length === 0 && (document.body.style.overflow = x), v());
|
|
43
|
-
}
|
|
44
|
-
function F(e) {
|
|
45
|
-
return n[n.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 b() {
|
|
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, b())) 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], l = i[i.length - 1], s = b(), d = !c(o, s), u = c(a, s), p = c(l, s);
|
|
91
|
-
e.shiftKey ? (u || d) && (e.preventDefault(), l.focus()) : (p || d) && (e.preventDefault(), a.focus());
|
|
92
|
-
}
|
|
93
|
-
class A extends I {
|
|
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 q());
|
|
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 = b();
|
|
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 l = this.getAttribute("aria-label") || this.getAttribute("rotulo"), s = this.getAttribute("aria-labelledby");
|
|
198
|
-
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) {
|
|
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
|
-
};
|
|
@@ -1,214 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var q=(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)=>q(e,typeof o!="symbol"?o+"":o,t);const b=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}';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(l=>t(l)),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 n=[];let _=new Set,w="";function E(){y(_);const e=n[n.length-1];_=e?v(e):new Set}function F(e){const o=n.indexOf(e);o>=0&&n.splice(o,1),n.length===0&&(w=document.body.style.overflow,document.body.style.overflow="hidden"),n.push(e),E()}function x(e){const o=n.indexOf(e);o<0||(n.splice(o,1),n.length===0&&(document.body.style.overflow=w),E())}function R(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 p(){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,p()))return;o.focus()}function P(e,o,t){const i=L(t);if(i.length===0){e.preventDefault();return}const a=i[0],l=i[i.length-1],s=p(),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 b.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=p();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 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 C=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=C?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}}class S extends f{}b.definirCustomElement("ui-modal",f);b.definirCustomElement("ui-dialog",S);exports.UIDialog=S;exports.UIModal=f;exports.aplicarInertForaDoModal=v;exports.removerInertForaDoModal=y;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var k=(e,a,t)=>a in e?A(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t;var s=(e,a,t)=>k(e,typeof a!="symbol"?a+"":a,t);const m=require("./ssr-safe-CiHD1adl.cjs"),S=':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}';function _(e){const a=new Set;if(typeof document>"u")return a;let t=e;for(;t&&t!==document.body&&t!==document.documentElement;){const i=t.parentElement;if(!i)break;const o=Array.from(i.children);for(const r of o)if(r!==t&&!r.contains(e)&&r.tagName!=="SCRIPT"&&r.tagName!=="STYLE"&&!(r.hasAttribute("inert")||r.inert===!0)){r.setAttribute("inert","");try{r.inert=!0}catch{}a.add(r)}t=i}if(document.body){const i=Array.from(document.body.children);for(const o of i)if(o!==e&&!o.contains(e)&&o.tagName!=="SCRIPT"&&o.tagName!=="STYLE"&&!(o.hasAttribute("inert")||o.inert===!0)){o.setAttribute("inert","");try{o.inert=!0}catch{}a.add(o)}}return a}function g(e){e.forEach(a=>{try{a.removeAttribute("inert"),a.inert=!1}catch{}}),e.clear()}const n=[];let p=new Set,v="";function x(){g(p);const e=n[n.length-1];p=e?_(e):new Set}function C(e){const a=n.indexOf(e);a>=0&&n.splice(a,1),n.length===0&&(v=document.body.style.overflow,document.body.style.overflow="hidden"),n.push(e),x()}function f(e){const a=n.indexOf(e);a<0||(n.splice(a,1),n.length===0&&(document.body.style.overflow=v),x())}function I(e){return n[n.length-1]===e}const h='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 F(){var a;let e=document.activeElement;for(;(a=e==null?void 0:e.shadowRoot)!=null&&a.activeElement;)e=e.shadowRoot.activeElement;return e}class c extends m.SafeHTMLElement{constructor(){super();s(this,"backdropElement");s(this,"dialogElement");s(this,"tituloElement");s(this,"closeElement");s(this,"_elementoGatilho",null);s(this,"_focables",[]);s(this,"_tituloId");s(this,"_estaAberto",!1);s(this,"handleSlotChange",()=>{this.syncState()});s(this,"handleBackdropClick",t=>{t.stopPropagation(),this.fechar()});s(this,"handleCloseClick",t=>{t.stopPropagation(),this.fechar()});s(this,"handleKeyDown",t=>{var i,o;if(this._estaAberto&&I(this)){if(t.key==="Escape")this.fechar(),t.stopImmediatePropagation();else if(t.key==="Tab"){if(this._atualizarFocables(),this._focables.length===0){t.preventDefault();return}const r=this._focables[0],d=this._focables[this._focables.length-1],l=this.getRootNode().activeElement;t.shiftKey?(l===r||!this.contains(l)&&!((i=this.shadowRoot)!=null&&i.contains(l)))&&(t.preventDefault(),d.focus()):(l===d||!this.contains(l)&&!((o=this.shadowRoot)!=null&&o.contains(l)))&&(t.preventDefault(),r.focus())}}});this._tituloId=`ui-modal-title-${Math.random().toString(36).substring(2,9)}`;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
-
<style>${S}</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.backdropElement.addEventListener("click",this.handleBackdropClick),this.closeElement.addEventListener("click",this.handleCloseClick),window.addEventListener("keydown",this.handleKeyDown),this.shadowRoot.querySelectorAll("slot").forEach(i=>{i.addEventListener("slotchange",this.handleSlotChange)}),this.syncState()}disconnectedCallback(){this.backdropElement.removeEventListener("click",this.handleBackdropClick),this.closeElement.removeEventListener("click",this.handleCloseClick),window.removeEventListener("keydown",this.handleKeyDown),this.shadowRoot.querySelectorAll("slot").forEach(i=>{i.removeEventListener("slotchange",this.handleSlotChange)}),this._estaAberto&&(this._estaAberto=!1,f(this))}attributeChangedCallback(t,i,o){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=F();this._elementoGatilho=t&&t!==document.body&&!this.contains(t)?t:null,C(this),this.dispatchEvent(new CustomEvent("ui-abrir",{bubbles:!0,composed:!0})),setTimeout(()=>{this._estaAberto&&this.focarConteudoInicial()},0)}aoFechar(){this._estaAberto=!1,f(this),this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0}));const t=this._elementoGatilho;this._elementoGatilho=null;const i=document.activeElement,o=!i||i===document.body||i===this||this.contains(i);t!=null&&t.isConnected&&o&&t.focus()}focarConteudoInicial(){const t=this.obterFocaveisDoConteudo(),i=t.filter(o=>o.hasAttribute("autofocus"));for(const o of[...i,...t]){o.focus();const r=document.activeElement;if(r===o||o.contains(r))return}this.dialogElement.focus()}syncState(){var l,b;const t=this.aberto,i=this.getAttribute("titulo")||this.getAttribute("title")||"",o=(l=this.shadowRoot)==null?void 0:l.querySelector(".ui-modal__footer");this.dialogElement.setAttribute("aria-hidden",String(!t));const r=this.getAttribute("aria-label")||this.getAttribute("rotulo"),d=this.getAttribute("aria-labelledby");if(r?(this.dialogElement.setAttribute("aria-label",r),this.dialogElement.removeAttribute("aria-labelledby")):d?(this.dialogElement.setAttribute("aria-labelledby",d),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")),o){const E=Array.from(((b=this.shadowRoot)==null?void 0:b.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(w=>w.assignedNodes({flatten:!0}).some(u=>u.nodeType===Node.ELEMENT_NODE||u.textContent&&u.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;o.style.display=E?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}static ehFocavel(t){return!t.hasAttribute("disabled")&&t.getAttribute("aria-hidden")!=="true"}obterFocaveisDoConteudo(){const t=[];return this.shadowRoot.querySelectorAll("slot").forEach(i=>{i.assignedElements({flatten:!0}).forEach(o=>{o instanceof HTMLElement&&(o.matches(h)&&t.push(o),t.push(...Array.from(o.querySelectorAll(h))))})}),t.filter(c.ehFocavel)}_atualizarFocables(){const t=Array.from(this.shadowRoot.querySelectorAll(h)).filter(i=>window.getComputedStyle(i).display!=="none"&&c.ehFocavel(i));this._focables=[...t,...this.obterFocaveisDoConteudo()]}}class y extends c{}m.definirCustomElement("ui-modal",c);m.definirCustomElement("ui-dialog",y);exports.UIDialog=y;exports.UIModal=c;exports.aplicarInertForaDoModal=_;exports.removerInertForaDoModal=g;
|