@thibezer/ui-components-kit 2.8.2 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -0
- package/README.md +37 -10
- package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
- package/dist/acessibilidade-CUlSXc2X.js +38 -0
- package/dist/altura-controle-ukMRPckR.cjs +1 -0
- package/dist/altura-controle-vxQiXG4q.js +62 -0
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +111 -109
- package/dist/camadas.js +1360 -1182
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +88 -86
- package/dist/canvas.js +4695 -3395
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-area-texto/area-texto-altura.d.ts +16 -0
- package/dist/components/ui-area-texto/area-texto-contador.d.ts +6 -0
- package/dist/components/ui-area-texto/area-texto-template.d.ts +2 -0
- package/dist/components/ui-area-texto/index.d.ts +3 -0
- package/dist/components/ui-area-texto/tipos.d.ts +19 -0
- package/dist/components/ui-area-texto/ui-area-texto.d.ts +100 -0
- package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/components/ui-badge/ui-badge.d.ts +2 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +3 -1
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +23 -0
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +22 -0
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +3 -7
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
- package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
- package/dist/components/ui-camadas/camadas-host.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -1
- package/dist/components/ui-camadas/camadas-render.d.ts +15 -0
- package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +8 -5
- package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +5 -1
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +1 -0
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +21 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +28 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +39 -106
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-recusas.d.ts +6 -0
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
- package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +30 -1
- package/dist/components/ui-card/card-interacao.d.ts +17 -0
- package/dist/components/ui-card/card-secoes.d.ts +10 -0
- package/dist/components/ui-card/ui-card.d.ts +23 -0
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
- package/dist/components/ui-cores/tipos.d.ts +2 -0
- package/dist/components/ui-cores/ui-controle-cores.d.ts +8 -3
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +3 -1
- package/dist/components/ui-linha/index.d.ts +1 -0
- package/dist/components/ui-linha/ui-linha.d.ts +48 -0
- package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
- package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
- package/dist/components/ui-mapa/tipos.d.ts +13 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
- package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/modal-foco.d.ts +28 -0
- package/dist/components/ui-modal/ui-modal.d.ts +1 -11
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +9 -2
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-switch/ui-switch.d.ts +3 -1
- package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
- package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
- package/dist/components/ui-texto/ui-texto.d.ts +16 -0
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
- package/dist/core/altura-controle.d.ts +34 -0
- package/dist/core/alvo-digitavel.d.ts +5 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/opcoes.d.ts +16 -0
- package/dist/core/rotulo-controle.d.ts +13 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +28 -18
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +9 -8
- package/dist/custom-elements.json +28294 -20127
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/form-validacao-BlQFxUVj.js +104 -0
- package/dist/form-validacao-DIeyQVH5.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.d.ts +4 -0
- package/dist/forms.js +15 -12
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +2 -1
- package/dist/gerencigeo-canvas/curva_leaflet.d.ts +2 -2
- package/dist/gerencigeo-canvas/feature_curvas.d.ts +3 -1
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +13 -1
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +3 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +13 -2
- package/dist/gerencigeo-canvas/feature_lod.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +2 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +16 -8
- package/dist/gerencigeo-canvas/index.d.ts +7 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +22 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +5 -0
- package/dist/gerencigeo-canvas/mapa_core.d.ts +10 -0
- package/dist/gerencigeo-canvas/motor/dados-camada.d.ts +39 -0
- package/dist/gerencigeo-canvas/motor/estilo.d.ts +28 -0
- package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +27 -0
- package/dist/gerencigeo-canvas/motor/index.d.ts +5 -0
- package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +107 -0
- package/dist/gerencigeo-canvas/motor/tipos.d.ts +100 -0
- package/dist/gerencigeo-canvas/popup_gate.d.ts +30 -0
- package/dist/gerencigeo-canvas/popup_residual.d.ts +5 -0
- package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +87 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +58 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_despachante.d.ts +31 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +48 -9
- package/dist/gerencigeo-canvas/renderers/marcadores_feicoes.d.ts +11 -0
- package/dist/gerencigeo-canvas/renderers/marcas_lod_layer.d.ts +19 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_feicoes_tipos.d.ts +44 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +95 -0
- package/dist/gerencigeo-canvas/renderers/selecao_visual.d.ts +6 -0
- package/dist/gerencigeo-canvas/types.d.ts +2 -0
- package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +196 -189
- package/dist/mapa.cjs +11 -16
- package/dist/mapa.js +242 -170
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/motor-BB6tB6U-.cjs +1 -0
- package/dist/motor-CFI84lM2.js +1301 -0
- package/dist/motor.cjs +1 -0
- package/dist/motor.d.ts +7 -0
- package/dist/motor.js +52 -0
- package/dist/opcoes-CupvWVIm.js +24 -0
- package/dist/opcoes-vdAUY5OI.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +14 -13
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +123 -8
- package/dist/tipos-react.d.ts +6 -0
- package/dist/tipos-vue.d.ts +119 -8
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-B5J_c5P5.js +197 -0
- package/dist/ui-badge-DC4y6Dik.cjs +28 -0
- package/dist/ui-botao-D24oXySA.cjs +12 -0
- package/dist/ui-botao-Dsj08jjw.js +165 -0
- package/dist/ui-campo-texto-19tIrmBK.js +377 -0
- package/dist/ui-campo-texto-CH8mzX61.cjs +16 -0
- package/dist/ui-card-0wu4rjEX.cjs +20 -0
- package/dist/ui-card-DRtpOo3l.js +143 -0
- package/dist/ui-controle-cores-BEUKOq4n.js +275 -0
- package/dist/ui-controle-cores-BLhrZHMh.cjs +32 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-C306zxWG.cjs +19 -0
- package/dist/ui-linha-C_azWkcG.js +517 -0
- package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
- package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
- package/dist/{ui-paleta-ferramentas-DbwdWVtT.js → ui-paleta-ferramentas-BXXrI1Y7.js} +491 -431
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +21 -0
- package/dist/ui-seletor-cor-2yGryC_Z.cjs +86 -0
- package/dist/ui-seletor-cor-BuyhoDZz.js +345 -0
- package/dist/{ui-skeleton-W9uwIceA.js → ui-skeleton-B2Rgrv8o.js} +254 -191
- package/dist/{ui-skeleton-SPYqku8P.cjs → ui-skeleton-DiOxTBZK.cjs} +10 -10
- package/dist/ui-switch-BL-x_-SM.js +1202 -0
- package/dist/ui-switch-C0i_3QXu.cjs +66 -0
- package/dist/{ui-tabela-propriedades-C-PeuW1i.cjs → ui-tabela-propriedades-CjK2gG14.cjs} +10 -10
- package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-DoL4SE0r.js} +845 -826
- package/package.json +8 -3
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- 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-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-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-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- 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,115 +1,123 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { d as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let t = e;
|
|
10
|
-
for (; t && t !== document.body && t !== document.documentElement; ) {
|
|
11
|
-
const i = t.parentElement;
|
|
12
|
-
if (!i) break;
|
|
13
|
-
const o = Array.from(i.children);
|
|
14
|
-
for (const r of o)
|
|
15
|
-
if (r !== t && !r.contains(e) && r.tagName !== "SCRIPT" && r.tagName !== "STYLE" && !(r.hasAttribute("inert") || r.inert === !0)) {
|
|
16
|
-
r.setAttribute("inert", "");
|
|
17
|
-
try {
|
|
18
|
-
r.inert = !0;
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
a.add(r);
|
|
22
|
-
}
|
|
23
|
-
t = i;
|
|
24
|
-
}
|
|
25
|
-
if (document.body) {
|
|
26
|
-
const i = Array.from(document.body.children);
|
|
27
|
-
for (const o of i)
|
|
28
|
-
if (o !== e && !o.contains(e) && o.tagName !== "SCRIPT" && o.tagName !== "STYLE" && !(o.hasAttribute("inert") || o.inert === !0)) {
|
|
29
|
-
o.setAttribute("inert", "");
|
|
30
|
-
try {
|
|
31
|
-
o.inert = !0;
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
a.add(o);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return a;
|
|
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";
|
|
38
9
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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;
|
|
45
27
|
}), e.clear();
|
|
46
28
|
}
|
|
47
29
|
const n = [];
|
|
48
|
-
let
|
|
49
|
-
function
|
|
50
|
-
|
|
30
|
+
let f = /* @__PURE__ */ new Set(), x = "";
|
|
31
|
+
function v() {
|
|
32
|
+
T(f);
|
|
51
33
|
const e = n[n.length - 1];
|
|
52
|
-
|
|
34
|
+
f = e ? M(e) : /* @__PURE__ */ new Set();
|
|
53
35
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
|
|
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();
|
|
57
39
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
|
|
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());
|
|
61
43
|
}
|
|
62
|
-
function
|
|
44
|
+
function F(e) {
|
|
63
45
|
return n[n.length - 1] === e;
|
|
64
46
|
}
|
|
65
|
-
const
|
|
66
|
-
function
|
|
67
|
-
var
|
|
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;
|
|
68
50
|
let e = document.activeElement;
|
|
69
|
-
for (; (
|
|
51
|
+
for (; (o = e == null ? void 0 : e.shadowRoot) != null && o.activeElement; )
|
|
70
52
|
e = e.shadowRoot.activeElement;
|
|
71
53
|
return e;
|
|
72
54
|
}
|
|
73
|
-
|
|
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 {
|
|
74
94
|
constructor() {
|
|
75
95
|
super();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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");
|
|
83
103
|
/** Estado já aplicado (pilha, inert, scroll, eventos); difere de `aberto` durante uma transição. */
|
|
84
|
-
|
|
85
|
-
|
|
104
|
+
r(this, "_estaAberto", !1);
|
|
105
|
+
r(this, "handleSlotChange", () => {
|
|
86
106
|
this.syncState();
|
|
87
107
|
});
|
|
88
|
-
|
|
108
|
+
r(this, "handleBackdropClick", (t) => {
|
|
89
109
|
t.stopPropagation(), this.fechar();
|
|
90
110
|
});
|
|
91
|
-
|
|
111
|
+
r(this, "handleCloseClick", (t) => {
|
|
92
112
|
t.stopPropagation(), this.fechar();
|
|
93
113
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (this._estaAberto && I(this)) {
|
|
97
|
-
if (t.key === "Escape")
|
|
98
|
-
this.fechar(), t.stopImmediatePropagation();
|
|
99
|
-
else if (t.key === "Tab") {
|
|
100
|
-
if (this._atualizarFocables(), this._focables.length === 0) {
|
|
101
|
-
t.preventDefault();
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const r = this._focables[0], d = this._focables[this._focables.length - 1], l = this.getRootNode().activeElement;
|
|
105
|
-
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());
|
|
106
|
-
}
|
|
107
|
-
}
|
|
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));
|
|
108
116
|
});
|
|
109
117
|
this._tituloId = `ui-modal-title-${Math.random().toString(36).substring(2, 9)}`;
|
|
110
118
|
const t = this.attachShadow({ mode: "open" });
|
|
111
119
|
t.innerHTML = `
|
|
112
|
-
<style>${
|
|
120
|
+
<style>${z}</style>
|
|
113
121
|
<div class="ui-modal__backdrop" part="fundo"></div>
|
|
114
122
|
<div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
|
|
115
123
|
<div class="ui-modal__handle"></div>
|
|
@@ -141,16 +149,14 @@ class c extends w {
|
|
|
141
149
|
];
|
|
142
150
|
}
|
|
143
151
|
connectedCallback() {
|
|
144
|
-
this.
|
|
145
|
-
|
|
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);
|
|
146
154
|
}), this.syncState();
|
|
147
155
|
}
|
|
148
156
|
disconnectedCallback() {
|
|
149
|
-
this.
|
|
150
|
-
i.removeEventListener("slotchange", this.handleSlotChange);
|
|
151
|
-
}), this._estaAberto && (this._estaAberto = !1, p(this));
|
|
157
|
+
this.ouvintes.cleanup(), this._estaAberto && (this._estaAberto = !1, _(this));
|
|
152
158
|
}
|
|
153
|
-
attributeChangedCallback(t, i,
|
|
159
|
+
attributeChangedCallback(t, i, a) {
|
|
154
160
|
this.syncState();
|
|
155
161
|
}
|
|
156
162
|
get aberto() {
|
|
@@ -172,67 +178,37 @@ class c extends w {
|
|
|
172
178
|
*/
|
|
173
179
|
aoAbrir() {
|
|
174
180
|
this._estaAberto = !0;
|
|
175
|
-
const t =
|
|
176
|
-
this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null,
|
|
177
|
-
this._estaAberto && this.
|
|
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);
|
|
178
184
|
}, 0);
|
|
179
185
|
}
|
|
180
186
|
aoFechar() {
|
|
181
|
-
this._estaAberto = !1,
|
|
187
|
+
this._estaAberto = !1, _(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
182
188
|
const t = this._elementoGatilho;
|
|
183
189
|
this._elementoGatilho = null;
|
|
184
|
-
const i = document.activeElement,
|
|
185
|
-
t != null && t.isConnected &&
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Foco inicial: `[autofocus]`, senão o primeiro controle do conteúdo/rodapé.
|
|
189
|
-
* O botão "✕" não recebe o foco inicial, evitando fechar o modal com um Enter acidental;
|
|
190
|
-
* sem controles, o próprio diálogo é focado para que o leitor de tela anuncie o título.
|
|
191
|
-
*/
|
|
192
|
-
focarConteudoInicial() {
|
|
193
|
-
const t = this.obterFocaveisDoConteudo(), i = t.filter((o) => o.hasAttribute("autofocus"));
|
|
194
|
-
for (const o of [...i, ...t]) {
|
|
195
|
-
o.focus();
|
|
196
|
-
const r = document.activeElement;
|
|
197
|
-
if (r === o || o.contains(r)) return;
|
|
198
|
-
}
|
|
199
|
-
this.dialogElement.focus();
|
|
190
|
+
const i = document.activeElement, a = !i || i === document.body || i === this || this.contains(i);
|
|
191
|
+
t != null && t.isConnected && a && t.focus();
|
|
200
192
|
}
|
|
201
193
|
syncState() {
|
|
202
|
-
var
|
|
203
|
-
const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "",
|
|
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");
|
|
204
196
|
this.dialogElement.setAttribute("aria-hidden", String(!t));
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
|
|
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";
|
|
209
201
|
}
|
|
210
202
|
this.isConnected && t !== this._estaAberto && (t ? this.aoAbrir() : this.aoFechar());
|
|
211
203
|
}
|
|
212
|
-
static ehFocavel(t) {
|
|
213
|
-
return !t.hasAttribute("disabled") && t.getAttribute("aria-hidden") !== "true";
|
|
214
|
-
}
|
|
215
|
-
/** Focáveis do conteúdo projetado (corpo e rodapé), na ordem dos slots. */
|
|
216
|
-
obterFocaveisDoConteudo() {
|
|
217
|
-
const t = [];
|
|
218
|
-
return this.shadowRoot.querySelectorAll("slot").forEach((i) => {
|
|
219
|
-
i.assignedElements({ flatten: !0 }).forEach((o) => {
|
|
220
|
-
o instanceof HTMLElement && (o.matches(u) && t.push(o), t.push(...Array.from(o.querySelectorAll(u))));
|
|
221
|
-
});
|
|
222
|
-
}), t.filter(c.ehFocavel);
|
|
223
|
-
}
|
|
224
|
-
_atualizarFocables() {
|
|
225
|
-
const t = Array.from(this.shadowRoot.querySelectorAll(u)).filter((i) => window.getComputedStyle(i).display !== "none" && c.ehFocavel(i));
|
|
226
|
-
this._focables = [...t, ...this.obterFocaveisDoConteudo()];
|
|
227
|
-
}
|
|
228
204
|
}
|
|
229
|
-
class
|
|
205
|
+
class O extends A {
|
|
230
206
|
}
|
|
231
|
-
|
|
232
|
-
|
|
207
|
+
g("ui-modal", A);
|
|
208
|
+
g("ui-dialog", O);
|
|
233
209
|
export {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
210
|
+
O as U,
|
|
211
|
+
A as a,
|
|
212
|
+
M as b,
|
|
213
|
+
T as r
|
|
238
214
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|