@thibezer/ui-components-kit 1.0.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/LICENSE +21 -0
- package/README.md +624 -0
- package/dist/botao.cjs +1 -0
- package/dist/botao.d.ts +8 -0
- package/dist/botao.js +6 -0
- package/dist/camadas.cjs +296 -0
- package/dist/camadas.d.ts +14 -0
- package/dist/camadas.js +1857 -0
- package/dist/campo-texto.cjs +1 -0
- package/dist/campo-texto.d.ts +8 -0
- package/dist/campo-texto.js +11 -0
- package/dist/canvas.cjs +254 -0
- package/dist/canvas.d.ts +8 -0
- package/dist/canvas.js +3082 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +7 -0
- package/dist/card.js +5 -0
- package/dist/components/ui-alerta/index.d.ts +2 -0
- package/dist/components/ui-alerta/ui-alerta-base.d.ts +23 -0
- package/dist/components/ui-alerta/ui-alerta.d.ts +2 -0
- package/dist/components/ui-alerta/ui-toast.d.ts +34 -0
- package/dist/components/ui-avatar/index.d.ts +1 -0
- package/dist/components/ui-avatar/ui-avatar.d.ts +12 -0
- package/dist/components/ui-badge/index.d.ts +1 -0
- package/dist/components/ui-badge/ui-badge.d.ts +20 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-icones.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/index.d.ts +4 -0
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +55 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +54 -0
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +52 -0
- package/dist/components/ui-botao/index.d.ts +1 -0
- package/dist/components/ui-botao/ui-botao.d.ts +26 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +18 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +18 -0
- package/dist/components/ui-camadas/camadas-eventos-arvore.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-eventos-camadas.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-eventos-rodape.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-host.d.ts +23 -0
- package/dist/components/ui-camadas/camadas-icones.d.ts +23 -0
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-metricas.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +65 -0
- package/dist/components/ui-camadas/camadas-resizer.d.ts +16 -0
- package/dist/components/ui-camadas/camadas-rodape.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +24 -0
- package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-teclado.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-utils.d.ts +26 -0
- package/dist/components/ui-camadas/index.d.ts +11 -0
- package/dist/components/ui-camadas/tipos.d.ts +116 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +112 -0
- package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +12 -0
- package/dist/components/ui-campo-texto/campo-texto-template.d.ts +2 -0
- package/dist/components/ui-campo-texto/index.d.ts +1 -0
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +57 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +13 -0
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-colecoes-dados.d.ts +46 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-painel-camadas.d.ts +9 -0
- package/dist/components/ui-canvas-cad/cad-tamanho-observer.d.ts +7 -0
- package/dist/components/ui-canvas-cad/cad-template.d.ts +1 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +29 -0
- package/dist/components/ui-canvas-cad/index.d.ts +8 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +91 -0
- package/dist/components/ui-card/index.d.ts +1 -0
- package/dist/components/ui-card/ui-card.d.ts +18 -0
- package/dist/components/ui-checkbox/index.d.ts +1 -0
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +36 -0
- package/dist/components/ui-drawer/drawer-acessibilidade.d.ts +16 -0
- package/dist/components/ui-drawer/index.d.ts +1 -0
- package/dist/components/ui-drawer/ui-drawer.d.ts +37 -0
- package/dist/components/ui-icone/index.d.ts +1 -0
- package/dist/components/ui-icone/ui-icone.d.ts +15 -0
- package/dist/components/ui-lista-flutuante/index.d.ts +1 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +15 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-render.d.ts +9 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-teclado.d.ts +13 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-template.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/tipos.d.ts +4 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +63 -0
- package/dist/components/ui-mapa/index.d.ts +3 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -0
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -0
- package/dist/components/ui-mapa/ui-mapa.d.ts +16 -0
- package/dist/components/ui-modal/index.d.ts +2 -0
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +12 -0
- package/dist/components/ui-modal/ui-modal.d.ts +30 -0
- package/dist/components/ui-radio/index.d.ts +1 -0
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +29 -0
- package/dist/components/ui-segmented/index.d.ts +1 -0
- package/dist/components/ui-segmented/segmented-indicador.d.ts +13 -0
- package/dist/components/ui-segmented/segmented-teclado.d.ts +4 -0
- package/dist/components/ui-segmented/segmented-template.d.ts +4 -0
- package/dist/components/ui-segmented/ui-segmented.d.ts +48 -0
- package/dist/components/ui-seletor-mapa-base/index.d.ts +2 -0
- package/dist/components/ui-seletor-mapa-base/tipos.d.ts +22 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +43 -0
- package/dist/components/ui-skeleton/index.d.ts +1 -0
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +19 -0
- package/dist/components/ui-stat/index.d.ts +1 -0
- package/dist/components/ui-stat/ui-stat.d.ts +30 -0
- package/dist/components/ui-switch/index.d.ts +1 -0
- package/dist/components/ui-switch/ui-switch.d.ts +36 -0
- package/dist/components/ui-tabela/index.d.ts +7 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +14 -0
- package/dist/components/ui-tabela/tabela-corpo.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-dom.d.ts +15 -0
- package/dist/components/ui-tabela/tabela-header.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-interacao.d.ts +9 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-ordenacao.d.ts +12 -0
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-redimensionamento.d.ts +28 -0
- package/dist/components/ui-tabela/tabela-remota.d.ts +15 -0
- package/dist/components/ui-tabela/tabela-renderizador.d.ts +29 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +24 -0
- package/dist/components/ui-tabela/tipos.d.ts +27 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +83 -0
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +7 -0
- package/dist/components/ui-tabela-propriedades/editores-cad.d.ts +17 -0
- package/dist/components/ui-tabela-propriedades/index.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/propriedades-densidade.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/propriedades-editores.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +7 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +26 -0
- package/dist/components/ui-tabela-propriedades/propriedades-painel-controles.d.ts +15 -0
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +24 -0
- package/dist/components/ui-tabela-propriedades/propriedades-seletor-tipo.d.ts +13 -0
- package/dist/components/ui-tabela-propriedades/propriedades-splitter.d.ts +13 -0
- package/dist/components/ui-tabela-propriedades/propriedades-template.d.ts +1 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +48 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +66 -0
- package/dist/components/ui-texto/index.d.ts +1 -0
- package/dist/components/ui-texto/ui-texto.d.ts +15 -0
- package/dist/components/ui-tooltip/index.d.ts +1 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +25 -0
- package/dist/core/acessibilidade.d.ts +21 -0
- package/dist/core/form-associated-element.d.ts +33 -0
- package/dist/core/form-validacao.d.ts +34 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/leaflet-loader.d.ts +7 -0
- package/dist/core/leaflet-style.d.ts +7 -0
- package/dist/core/listener-bag.d.ts +21 -0
- package/dist/core/ssr-safe.d.ts +20 -0
- package/dist/core/ui-bus.d.ts +85 -0
- package/dist/core/zero-js-triggers.d.ts +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.js +22 -0
- package/dist/data.cjs +1 -0
- package/dist/data.d.ts +22 -0
- package/dist/data.js +63 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.d.ts +26 -0
- package/dist/feedback.js +25 -0
- package/dist/form-validacao-BIOXxt-1.js +140 -0
- package/dist/form-validacao-ytRYSF3E.cjs +1 -0
- package/dist/forms.cjs +1 -0
- package/dist/forms.d.ts +22 -0
- package/dist/forms.js +25 -0
- package/dist/gerencigeo-canvas/canvas_destaque.d.ts +13 -0
- package/dist/gerencigeo-canvas/canvas_destaque_marcadores.d.ts +8 -0
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +56 -0
- package/dist/gerencigeo-canvas/canvas_selecao_box.d.ts +23 -0
- package/dist/gerencigeo-canvas/controller_dados_ops.d.ts +15 -0
- package/dist/gerencigeo-canvas/index.d.ts +17 -0
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +3 -0
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +6 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +37 -0
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +8 -0
- package/dist/gerencigeo-canvas/layer_renderer_factory.d.ts +14 -0
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +6 -0
- package/dist/gerencigeo-canvas/mapa_config.d.ts +11 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +53 -0
- package/dist/gerencigeo-canvas/mapa_core.d.ts +30 -0
- package/dist/gerencigeo-canvas/mapa_linhas.d.ts +14 -0
- package/dist/gerencigeo-canvas/mapa_marcadores.d.ts +18 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +8 -0
- package/dist/gerencigeo-canvas/renderers/grid_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/tile_renderer.d.ts +8 -0
- package/dist/gerencigeo-canvas/renderers/vector_lines_builder.d.ts +4 -0
- package/dist/gerencigeo-canvas/renderers/vector_lines_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +11 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/wms_renderer.d.ts +8 -0
- package/dist/gerencigeo-canvas/sigef_consultor.d.ts +9 -0
- package/dist/gerencigeo-canvas/tile_preloader.d.ts +2 -0
- package/dist/gerencigeo-canvas/types.d.ts +169 -0
- package/dist/gerencigeo-canvas/utils.d.ts +46 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +186 -0
- package/dist/leaflet-Cw6tqYFh.cjs +1 -0
- package/dist/leaflet-DkaFZYc5.js +69 -0
- package/dist/leaflet-loader-94z5VsdY.cjs +2 -0
- package/dist/leaflet-loader-Cjcdgj5R.js +21 -0
- package/dist/listener-bag-D5omxZ9h.cjs +1 -0
- package/dist/listener-bag-DQgv7OON.js +34 -0
- package/dist/mapa.cjs +19 -0
- package/dist/mapa.d.ts +11 -0
- package/dist/mapa.js +264 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.d.ts +8 -0
- package/dist/modal.js +8 -0
- package/dist/register.cjs +1 -0
- package/dist/register.d.ts +7 -0
- package/dist/register.js +21 -0
- package/dist/seletor-mapa-base.cjs +53 -0
- package/dist/seletor-mapa-base.d.ts +8 -0
- package/dist/seletor-mapa-base.js +275 -0
- package/dist/ssr-safe-5cWfJP-s.js +10 -0
- package/dist/ssr-safe-CiHD1adl.cjs +1 -0
- package/dist/tabela.cjs +1 -0
- package/dist/tabela.d.ts +12 -0
- package/dist/tabela.js +56 -0
- package/dist/tools.cjs +1 -0
- package/dist/tools.d.ts +8 -0
- package/dist/tools.js +30 -0
- package/dist/ui-badge-92yelKls.js +183 -0
- package/dist/ui-badge-B95jSECC.cjs +28 -0
- package/dist/ui-botao-BShEouvi.js +124 -0
- package/dist/ui-botao-DF1yuUUD.cjs +12 -0
- package/dist/ui-campo-texto-BCh5HyCM.cjs +16 -0
- package/dist/ui-campo-texto-B_JF6POq.js +361 -0
- package/dist/ui-card-BJ8SmvVf.js +111 -0
- package/dist/ui-card-Bhm6k91e.cjs +20 -0
- package/dist/ui-kit.css +1 -0
- package/dist/ui-modal-Bi4isGYh.cjs +18 -0
- package/dist/ui-modal-DV-pw2x1.js +194 -0
- package/dist/ui-paleta-ferramentas-B6dJ0O6K.cjs +18 -0
- package/dist/ui-paleta-ferramentas-Bpp4XBVg.js +633 -0
- package/dist/ui-segmented-C8wuycjJ.js +411 -0
- package/dist/ui-segmented-NC5cBXLh.cjs +19 -0
- package/dist/ui-skeleton-B3xQyn0Z.js +396 -0
- package/dist/ui-skeleton-D42oQufF.cjs +33 -0
- package/dist/ui-switch-C6o4yZUF.cjs +53 -0
- package/dist/ui-switch-CO9MoS8x.js +826 -0
- package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +145 -0
- package/dist/ui-tabela-propriedades-D-XKNVwK.js +2078 -0
- package/dist/ui-toast-CQBqvUm3.cjs +20 -0
- package/dist/ui-toast-CwUmiqyG.js +156 -0
- package/dist/zero-js-triggers-DdESy0tk.js +205 -0
- package/dist/zero-js-triggers-QGD7FOTv.cjs +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var x = (a, s, t) => s in a ? g(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
|
|
3
|
+
var i = (a, s, t) => x(a, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { S as f, d as m } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
+
import { g as v, v as _, a as E, o as y, c as A } from "./form-validacao-BIOXxt-1.js";
|
|
6
|
+
const w = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex}.ui-campo-texto__container{position:relative;width:100%;display:flex;flex-direction:column;justify-content:center}:host([label-flutuante]) .ui-campo-texto__container{margin-top:6px}.ui-campo-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-campo-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-campo-texto__wrapper{position:relative;display:flex;align-items:center;width:100%;height:var(--ui-campo-altura, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);padding:0 8px;gap:6px;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-campo-texto__wrapper--foco{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px #00e08a2e;background-color:var(--ui-cor-fundo-menu, #18181c)}.ui-campo-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px #ff55552e!important}.ui-campo-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background-color:#ffffff08}.ui-campo-texto__input{flex:1;width:100%;height:100%;min-height:0;background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:clamp(11px,.85rem,13px);line-height:1.2;padding:0;margin:0;box-sizing:border-box}.ui-campo-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-campo-texto__input:disabled{cursor:not-allowed}.ui-campo-texto__icone{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;font-size:14px;line-height:1;max-height:100%}.ui-campo-texto__icone svg,.ui-campo-texto__icone ::slotted(svg),.ui-campo-texto__icone ::slotted(ui-icone){shape-rendering:geometricPrecision;display:inline-flex;vertical-align:middle}.ui-campo-texto__icone--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none;transition:opacity .15s ease,transform .15s ease}.ui-campo-texto__icone--clicavel:hover{opacity:.85;transform:scale(1.1)}:host([label-flutuante]) .ui-campo-texto__label{position:absolute;left:8px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;z-index:3;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);padding:0 4px;border-radius:3px;margin-bottom:0;white-space:nowrap;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;transition:top .15s cubic-bezier(.4,0,.2,1),transform .15s cubic-bezier(.4,0,.2,1),color .15s ease,font-size .15s ease}:host([label-flutuante][tem-icone-esquerda]) .ui-campo-texto__label{left:28px}:host([label-flutuante]) .ui-campo-texto__label--ativa{top:-8px;left:8px!important;transform:translateY(0) scale(.85);transform-origin:left top;font-weight:600;color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}:host([label-flutuante][erro]) .ui-campo-texto__label--ativa,:host([label-flutuante][mensagem-erro]) .ui-campo-texto__label--ativa{color:var(--ui-cor-texto-erro, #ff5555)}.ui-campo-texto__helper{font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-campo-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500;display:flex;align-items:center;gap:4px}.ui-campo-texto__wrapper{touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-campo-texto__input{touch-action:manipulation}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-campo-texto__input{font-size:16px!important}:host(:not([inline])) .ui-campo-texto__wrapper{min-height:max(var(--ui-campo-altura, 38px),38px);padding:0 10px}.ui-campo-texto__label{font-size:13px}.ui-campo-texto__icone--clicavel{min-width:32px;min-height:32px}}', S = [
|
|
7
|
+
"label",
|
|
8
|
+
"placeholder",
|
|
9
|
+
"value",
|
|
10
|
+
"tipo",
|
|
11
|
+
"type",
|
|
12
|
+
"obrigatorio",
|
|
13
|
+
"required",
|
|
14
|
+
"minlength",
|
|
15
|
+
"min-length",
|
|
16
|
+
"maxlength",
|
|
17
|
+
"max-length",
|
|
18
|
+
"pattern",
|
|
19
|
+
"min",
|
|
20
|
+
"max",
|
|
21
|
+
"step",
|
|
22
|
+
"mensagem-validacao",
|
|
23
|
+
"helper-text",
|
|
24
|
+
"erro",
|
|
25
|
+
"mensagem-erro",
|
|
26
|
+
"disabled",
|
|
27
|
+
"readonly",
|
|
28
|
+
"label-flutuante",
|
|
29
|
+
"alternar-senha",
|
|
30
|
+
"tamanho",
|
|
31
|
+
"size",
|
|
32
|
+
"altura",
|
|
33
|
+
"height",
|
|
34
|
+
"densidade",
|
|
35
|
+
"aria-label"
|
|
36
|
+
];
|
|
37
|
+
function I() {
|
|
38
|
+
return `
|
|
39
|
+
<style>${w}</style>
|
|
40
|
+
<div class="ui-campo-texto__container">
|
|
41
|
+
<label class="ui-campo-texto__label" style="display: none;"></label>
|
|
42
|
+
<div class="ui-campo-texto__wrapper">
|
|
43
|
+
<span class="ui-campo-texto__icone ui-campo-texto__icone--esquerda">
|
|
44
|
+
<slot name="icone-esquerda"></slot>
|
|
45
|
+
</span>
|
|
46
|
+
<input class="ui-campo-texto__input" type="text" />
|
|
47
|
+
<span class="ui-campo-texto__icone ui-campo-texto__icone--direita">
|
|
48
|
+
<slot name="icone-direita"></slot>
|
|
49
|
+
</span>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="ui-campo-texto__helper" style="display: none;"></div>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
function V(a) {
|
|
56
|
+
const { labelElement: s, inputElement: t, labelText: e, placeholderText: n, isFlutuante: o, estaFocado: r, obrigatorio: u } = a, l = t.value.trim() !== "";
|
|
57
|
+
let h = !1;
|
|
58
|
+
try {
|
|
59
|
+
h = t.matches(":-webkit-autofill");
|
|
60
|
+
} catch {
|
|
61
|
+
h = !1;
|
|
62
|
+
}
|
|
63
|
+
e ? (u ? s.innerHTML = `${e} <span class="ui-campo-texto__asterisco" aria-hidden="true">*</span>` : s.textContent = e, s.style.display = "flex", o && (r || l || h) ? s.classList.add("ui-campo-texto__label--ativa") : s.classList.remove("ui-campo-texto__label--ativa")) : s.style.display = "none", o && !r && !l && !h ? t.placeholder = "" : t.placeholder = n;
|
|
64
|
+
}
|
|
65
|
+
function k(a, s, t) {
|
|
66
|
+
s ? (a.classList.add("ui-campo-texto__icone--clicavel"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.setAttribute("aria-label", t ? "Ocultar senha" : "Exibir senha")) : (a.classList.remove("ui-campo-texto__icone--clicavel"), a.removeAttribute("role"), a.removeAttribute("tabindex"), a.removeAttribute("aria-label"));
|
|
67
|
+
}
|
|
68
|
+
function C(a, s, t, e, n, o) {
|
|
69
|
+
e ? (a.classList.add("ui-campo-texto__wrapper--erro"), s.setAttribute("aria-invalid", "true")) : (a.classList.remove("ui-campo-texto__wrapper--erro"), s.removeAttribute("aria-invalid")), e && n ? (t.textContent = `⚠️ ${n}`, t.className = "ui-campo-texto__helper ui-campo-texto__helper--erro", t.style.display = "block") : o ? (t.textContent = o, t.className = "ui-campo-texto__helper", t.style.display = "block") : t.style.display = "none";
|
|
70
|
+
}
|
|
71
|
+
class d extends f {
|
|
72
|
+
constructor() {
|
|
73
|
+
super();
|
|
74
|
+
i(this, "internals");
|
|
75
|
+
i(this, "_formDisabled", !1);
|
|
76
|
+
i(this, "_customErrorMessage", "");
|
|
77
|
+
this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : {};
|
|
78
|
+
}
|
|
79
|
+
// === Ciclo de Vida Form-Associated Custom Elements ===
|
|
80
|
+
formDisabledCallback(t) {
|
|
81
|
+
this._formDisabled = t, this.syncState();
|
|
82
|
+
}
|
|
83
|
+
get form() {
|
|
84
|
+
var t;
|
|
85
|
+
return this.closest("form") ?? ((t = this.internals) == null ? void 0 : t.form) ?? null;
|
|
86
|
+
}
|
|
87
|
+
get required() {
|
|
88
|
+
return this.hasAttribute("obrigatorio") || this.hasAttribute("required");
|
|
89
|
+
}
|
|
90
|
+
set required(t) {
|
|
91
|
+
t ? this.setAttribute("obrigatorio", "") : (this.removeAttribute("obrigatorio"), this.removeAttribute("required")), this.syncState();
|
|
92
|
+
}
|
|
93
|
+
get obrigatorio() {
|
|
94
|
+
return this.required;
|
|
95
|
+
}
|
|
96
|
+
set obrigatorio(t) {
|
|
97
|
+
this.required = t;
|
|
98
|
+
}
|
|
99
|
+
// === API de Validação Nativa ===
|
|
100
|
+
get validity() {
|
|
101
|
+
var t;
|
|
102
|
+
return this.atualizarValidade(), (t = this.internals) == null ? void 0 : t.validity;
|
|
103
|
+
}
|
|
104
|
+
get validationMessage() {
|
|
105
|
+
var t;
|
|
106
|
+
return this.atualizarValidade(), ((t = this.internals) == null ? void 0 : t.validationMessage) ?? "";
|
|
107
|
+
}
|
|
108
|
+
get willValidate() {
|
|
109
|
+
var t;
|
|
110
|
+
return ((t = this.internals) == null ? void 0 : t.willValidate) ?? !1;
|
|
111
|
+
}
|
|
112
|
+
checkValidity() {
|
|
113
|
+
var t, e;
|
|
114
|
+
return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.checkValidity) == null ? void 0 : e.call(t)) ?? !0;
|
|
115
|
+
}
|
|
116
|
+
reportValidity() {
|
|
117
|
+
var t, e;
|
|
118
|
+
return this.atualizarValidade(), ((e = (t = this.internals) == null ? void 0 : t.reportValidity) == null ? void 0 : e.call(t)) ?? !0;
|
|
119
|
+
}
|
|
120
|
+
setCustomValidity(t) {
|
|
121
|
+
this._customErrorMessage = t || "", this.atualizarValidade();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
i(d, "formAssociated", !0);
|
|
125
|
+
class b extends d {
|
|
126
|
+
constructor() {
|
|
127
|
+
super();
|
|
128
|
+
i(this, "labelElement");
|
|
129
|
+
i(this, "wrapperElement");
|
|
130
|
+
i(this, "inputElement");
|
|
131
|
+
i(this, "helperElement");
|
|
132
|
+
i(this, "rightIconContainer");
|
|
133
|
+
i(this, "leftSlotElement");
|
|
134
|
+
i(this, "_senhaVisivel", !1);
|
|
135
|
+
i(this, "_checkTimer", null);
|
|
136
|
+
i(this, "_focado", !1);
|
|
137
|
+
i(this, "_inputId");
|
|
138
|
+
i(this, "_defaultValue", "");
|
|
139
|
+
i(this, "handleSlotChange", () => {
|
|
140
|
+
this.syncState();
|
|
141
|
+
});
|
|
142
|
+
i(this, "handleHostClick", (t) => {
|
|
143
|
+
A(this, t) && !this.disabled && this.inputElement.focus();
|
|
144
|
+
});
|
|
145
|
+
i(this, "handleRightIconClick", (t) => {
|
|
146
|
+
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
147
|
+
});
|
|
148
|
+
i(this, "handleRightIconKeyDown", (t) => {
|
|
149
|
+
(this.getAttribute("tipo") === "password" || this.hasAttribute("alternar-senha")) && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), this.alternarVisibilidadeSenha());
|
|
150
|
+
});
|
|
151
|
+
i(this, "handleFocus", () => {
|
|
152
|
+
this._focado = !0, this.wrapperElement.classList.add("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
153
|
+
});
|
|
154
|
+
i(this, "handleBlur", () => {
|
|
155
|
+
this._focado = !1, this.wrapperElement.classList.remove("ui-campo-texto__wrapper--foco"), this.syncState();
|
|
156
|
+
});
|
|
157
|
+
i(this, "handleInput", (t) => {
|
|
158
|
+
t.stopPropagation();
|
|
159
|
+
const e = t.target.value;
|
|
160
|
+
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
161
|
+
new CustomEvent("ui-input", {
|
|
162
|
+
detail: { value: e },
|
|
163
|
+
bubbles: !0,
|
|
164
|
+
composed: !0
|
|
165
|
+
})
|
|
166
|
+
), this.dispatchEvent(
|
|
167
|
+
new Event("input", {
|
|
168
|
+
bubbles: !0,
|
|
169
|
+
composed: !0
|
|
170
|
+
})
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
i(this, "handleChange", (t) => {
|
|
174
|
+
t.stopPropagation();
|
|
175
|
+
const e = t.target.value;
|
|
176
|
+
this.internals.setFormValue(e), this.syncState(), this.dispatchEvent(
|
|
177
|
+
new CustomEvent("ui-change", {
|
|
178
|
+
detail: { value: e },
|
|
179
|
+
bubbles: !0,
|
|
180
|
+
composed: !0
|
|
181
|
+
})
|
|
182
|
+
), this.dispatchEvent(
|
|
183
|
+
new Event("change", {
|
|
184
|
+
bubbles: !0,
|
|
185
|
+
composed: !0
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
|
|
190
|
+
t.innerHTML = I(), this.labelElement = t.querySelector(".ui-campo-texto__label"), this.wrapperElement = t.querySelector(".ui-campo-texto__wrapper"), this.inputElement = t.querySelector(".ui-campo-texto__input"), this.helperElement = t.querySelector(".ui-campo-texto__helper"), this.rightIconContainer = t.querySelector(".ui-campo-texto__icone--direita"), this.leftSlotElement = t.querySelector('slot[name="icone-esquerda"]'), this._inputId = v("ui-input"), this.inputElement.id = this._inputId, this.labelElement.htmlFor = this._inputId, this.helperElement.id = `${this._inputId}-helper`, this.inputElement.setAttribute("aria-describedby", `${this._inputId}-helper`);
|
|
191
|
+
}
|
|
192
|
+
static get observedAttributes() {
|
|
193
|
+
return S;
|
|
194
|
+
}
|
|
195
|
+
focus(t) {
|
|
196
|
+
this.inputElement.focus(t);
|
|
197
|
+
}
|
|
198
|
+
blur() {
|
|
199
|
+
this.inputElement.blur();
|
|
200
|
+
}
|
|
201
|
+
connectedCallback() {
|
|
202
|
+
this.inputElement.addEventListener("input", this.handleInput), this.inputElement.addEventListener("change", this.handleChange), this.inputElement.addEventListener("focus", this.handleFocus), this.inputElement.addEventListener("blur", this.handleBlur), this.rightIconContainer.addEventListener("click", this.handleRightIconClick), this.rightIconContainer.addEventListener("keydown", this.handleRightIconKeyDown), this.leftSlotElement.addEventListener("slotchange", this.handleSlotChange), this.addEventListener("click", this.handleHostClick), this._defaultValue = this.getAttribute("value") || "", this.hasAttribute("value") && !this.inputElement.value && (this.inputElement.value = this._defaultValue), this.syncState(), this._checkTimer = setTimeout(() => this.syncState(), 100);
|
|
203
|
+
}
|
|
204
|
+
disconnectedCallback() {
|
|
205
|
+
this.inputElement.removeEventListener("input", this.handleInput), this.inputElement.removeEventListener("change", this.handleChange), this.inputElement.removeEventListener("focus", this.handleFocus), this.inputElement.removeEventListener("blur", this.handleBlur), this.rightIconContainer.removeEventListener("click", this.handleRightIconClick), this.rightIconContainer.removeEventListener("keydown", this.handleRightIconKeyDown), this.leftSlotElement.removeEventListener("slotchange", this.handleSlotChange), this.removeEventListener("click", this.handleHostClick), this._checkTimer && clearTimeout(this._checkTimer);
|
|
206
|
+
}
|
|
207
|
+
attributeChangedCallback(t, e, n) {
|
|
208
|
+
t === "value" && n !== this.inputElement.value && !this._focado && (this.inputElement.value = n || ""), this.syncState();
|
|
209
|
+
}
|
|
210
|
+
get value() {
|
|
211
|
+
return this.inputElement ? this.inputElement.value : this.getAttribute("value") || "";
|
|
212
|
+
}
|
|
213
|
+
set value(t) {
|
|
214
|
+
if (this.setAttribute("value", t), this.inputElement)
|
|
215
|
+
try {
|
|
216
|
+
this.inputElement.value = t;
|
|
217
|
+
} catch {
|
|
218
|
+
}
|
|
219
|
+
this.syncState();
|
|
220
|
+
}
|
|
221
|
+
// === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
|
|
222
|
+
formResetCallback() {
|
|
223
|
+
var t;
|
|
224
|
+
this.inputElement.value = this._defaultValue, (t = this.internals) == null || t.setFormValue(this._defaultValue), this.syncState();
|
|
225
|
+
}
|
|
226
|
+
formStateRestoreCallback(t, e) {
|
|
227
|
+
typeof t == "string" && (this.value = t);
|
|
228
|
+
}
|
|
229
|
+
get name() {
|
|
230
|
+
return this.getAttribute("name") || "";
|
|
231
|
+
}
|
|
232
|
+
set name(t) {
|
|
233
|
+
this.setAttribute("name", t);
|
|
234
|
+
}
|
|
235
|
+
get type() {
|
|
236
|
+
return this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
237
|
+
}
|
|
238
|
+
get disabled() {
|
|
239
|
+
return this.hasAttribute("disabled") || this._formDisabled;
|
|
240
|
+
}
|
|
241
|
+
set disabled(t) {
|
|
242
|
+
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
243
|
+
}
|
|
244
|
+
get minLength() {
|
|
245
|
+
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length");
|
|
246
|
+
return t ? parseInt(t, 10) : -1;
|
|
247
|
+
}
|
|
248
|
+
set minLength(t) {
|
|
249
|
+
t >= 0 ? this.setAttribute("minlength", String(t)) : this.removeAttribute("minlength"), this.syncState();
|
|
250
|
+
}
|
|
251
|
+
get maxLength() {
|
|
252
|
+
const t = this.getAttribute("maxlength") ?? this.getAttribute("max-length");
|
|
253
|
+
return t ? parseInt(t, 10) : -1;
|
|
254
|
+
}
|
|
255
|
+
set maxLength(t) {
|
|
256
|
+
t >= 0 ? this.setAttribute("maxlength", String(t)) : this.removeAttribute("maxlength"), this.syncState();
|
|
257
|
+
}
|
|
258
|
+
get pattern() {
|
|
259
|
+
return this.getAttribute("pattern") || "";
|
|
260
|
+
}
|
|
261
|
+
set pattern(t) {
|
|
262
|
+
t ? this.setAttribute("pattern", t) : this.removeAttribute("pattern"), this.syncState();
|
|
263
|
+
}
|
|
264
|
+
atualizarValidade() {
|
|
265
|
+
var c, p;
|
|
266
|
+
const t = this.getAttribute("minlength") ?? this.getAttribute("min-length"), e = this.getAttribute("maxlength") ?? this.getAttribute("max-length"), n = this.getAttribute("min"), o = this.getAttribute("max"), r = this.inputElement ? this.inputElement.value : "", u = this.getAttribute("value") || r, l = !!((p = (c = this.inputElement) == null ? void 0 : c.validity) != null && p.badInput), h = _({
|
|
267
|
+
val: r,
|
|
268
|
+
rawVal: u,
|
|
269
|
+
badInput: l,
|
|
270
|
+
disabled: this.disabled,
|
|
271
|
+
required: this.required,
|
|
272
|
+
tipo: this.type,
|
|
273
|
+
minlength: t !== null ? parseInt(t, 10) : null,
|
|
274
|
+
maxlength: e !== null ? parseInt(e, 10) : null,
|
|
275
|
+
min: n !== null ? parseFloat(n) : null,
|
|
276
|
+
max: o !== null ? parseFloat(o) : null,
|
|
277
|
+
step: this.getAttribute("step"),
|
|
278
|
+
pattern: this.getAttribute("pattern"),
|
|
279
|
+
customError: this._customErrorMessage,
|
|
280
|
+
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
281
|
+
});
|
|
282
|
+
E(this.internals, h, this.inputElement);
|
|
283
|
+
}
|
|
284
|
+
alternarVisibilidadeSenha() {
|
|
285
|
+
var n;
|
|
286
|
+
if (!(this.getAttribute("tipo") === "password" || this._senhaVisivel)) return;
|
|
287
|
+
this._senhaVisivel = !this._senhaVisivel, this.inputElement.type = this._senhaVisivel ? "text" : "password";
|
|
288
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="icone-direita"]');
|
|
289
|
+
e && e.assignedElements().forEach((r) => {
|
|
290
|
+
var u, l;
|
|
291
|
+
(((u = r.textContent) == null ? void 0 : u.trim()) === "👁️" || ((l = r.textContent) == null ? void 0 : l.trim()) === "🙈") && (r.textContent = this._senhaVisivel ? "🙈" : "👁️");
|
|
292
|
+
}), this.dispatchEvent(
|
|
293
|
+
new CustomEvent("ui-toggle-senha", {
|
|
294
|
+
detail: { visivel: this._senhaVisivel },
|
|
295
|
+
bubbles: !0,
|
|
296
|
+
composed: !0
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
syncState() {
|
|
301
|
+
this.leftSlotElement.assignedNodes().length > 0 || this.querySelector('[slot="icone-esquerda"]') !== null ? this.setAttribute("tem-icone-esquerda", "") : this.removeAttribute("tem-icone-esquerda");
|
|
302
|
+
const e = this.getAttribute("altura") || this.getAttribute("height");
|
|
303
|
+
e ? this.style.setProperty("--ui-campo-altura", isNaN(Number(e)) ? e : `${e}px`) : this.style.removeProperty("--ui-campo-altura"), V({
|
|
304
|
+
labelElement: this.labelElement,
|
|
305
|
+
inputElement: this.inputElement,
|
|
306
|
+
labelText: this.getAttribute("label"),
|
|
307
|
+
placeholderText: this.getAttribute("placeholder") || "",
|
|
308
|
+
isFlutuante: this.hasAttribute("label-flutuante"),
|
|
309
|
+
estaFocado: this._focado,
|
|
310
|
+
obrigatorio: this.required
|
|
311
|
+
}), this.sincronizarNomeAcessivel();
|
|
312
|
+
const n = this.getAttribute("tipo") || this.getAttribute("type") || "text";
|
|
313
|
+
if (!this._senhaVisivel)
|
|
314
|
+
try {
|
|
315
|
+
this.inputElement.type = n;
|
|
316
|
+
} catch {
|
|
317
|
+
this.inputElement.type = "text";
|
|
318
|
+
}
|
|
319
|
+
const o = this.getAttribute("minlength") ?? this.getAttribute("min-length");
|
|
320
|
+
o !== null ? this.inputElement.minLength = parseInt(o, 10) : this.inputElement.removeAttribute("minlength");
|
|
321
|
+
const r = this.getAttribute("maxlength") ?? this.getAttribute("max-length");
|
|
322
|
+
r !== null ? this.inputElement.maxLength = parseInt(r, 10) : this.inputElement.removeAttribute("maxlength");
|
|
323
|
+
const u = this.getAttribute("pattern");
|
|
324
|
+
u !== null ? this.inputElement.pattern = u : this.inputElement.removeAttribute("pattern"), this.internals.setFormValue(this.inputElement.value);
|
|
325
|
+
const l = this.hasAttribute("disabled") || this._formDisabled, h = this.hasAttribute("readonly");
|
|
326
|
+
this.inputElement.disabled = l, this.inputElement.readOnly = h, l ? this.wrapperElement.classList.add("ui-campo-texto__wrapper--disabled") : this.wrapperElement.classList.remove("ui-campo-texto__wrapper--disabled");
|
|
327
|
+
const c = n === "password" || this.hasAttribute("alternar-senha");
|
|
328
|
+
k(this.rightIconContainer, c, this._senhaVisivel);
|
|
329
|
+
const p = this.hasAttribute("erro") || this.hasAttribute("mensagem-erro");
|
|
330
|
+
C(
|
|
331
|
+
this.wrapperElement,
|
|
332
|
+
this.inputElement,
|
|
333
|
+
this.helperElement,
|
|
334
|
+
p,
|
|
335
|
+
this.getAttribute("mensagem-erro"),
|
|
336
|
+
this.getAttribute("helper-text")
|
|
337
|
+
), this.atualizarValidade();
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Sem o atributo `label`, o input nativo herda o nome acessível de fora do Shadow DOM
|
|
341
|
+
* (`aria-label` no host, `<label for>` ou `<label>` envolvente).
|
|
342
|
+
*/
|
|
343
|
+
sincronizarNomeAcessivel() {
|
|
344
|
+
const t = this.getAttribute("label") ? "" : y(this, this.internals);
|
|
345
|
+
t ? this.inputElement.setAttribute("aria-label", t) : this.inputElement.removeAttribute("aria-label");
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
class L extends b {
|
|
349
|
+
}
|
|
350
|
+
m("ui-campo-texto", b);
|
|
351
|
+
m("ui-input", L);
|
|
352
|
+
export {
|
|
353
|
+
S as A,
|
|
354
|
+
d as F,
|
|
355
|
+
b as U,
|
|
356
|
+
L as a,
|
|
357
|
+
k as b,
|
|
358
|
+
I as c,
|
|
359
|
+
V as d,
|
|
360
|
+
C as s
|
|
361
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var _ = (i, t, e) => t in i ? y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var o = (i, t, e) => _(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { L as w } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { d as E, S as k } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
const A = ':host{display:block;width:100%;box-sizing:border-box}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-card--plano{background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:none}.ui-card--elevado{background-color:var(--ui-cor-fundo-elevado, #1e1e24);box-shadow:0 8px 24px #0006;border-color:#ffffff14}.ui-card--destaque{border-color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:0 0 0 1px #00e08a40}.ui-card--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none}.ui-card--clicavel:hover{transform:translateY(-3px);border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 10px 30px #00000080,0 0 15px #00e08a26}.ui-card--clicavel:active{transform:translateY(-1px)}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card__media{width:100%;overflow:hidden;display:block;line-height:0}::slotted([slot="midia"]),::slotted([slot="media"]){width:100%;height:auto;display:block;object-fit:cover}.ui-card__header{padding:14px 16px 8px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid rgba(255,255,255,.06);display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card--compacto .ui-card__header{padding:10px 12px 6px}.ui-card--compacto .ui-card__body{padding:8px 12px}.ui-card--compacto .ui-card__footer{padding:8px 12px 10px}';
|
|
7
|
+
class S extends k {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
o(this, "cardElement");
|
|
11
|
+
o(this, "listeners", new w());
|
|
12
|
+
o(this, "handleSlotChange", () => {
|
|
13
|
+
this.syncState();
|
|
14
|
+
});
|
|
15
|
+
o(this, "handleClick", (e) => {
|
|
16
|
+
this.disabled || e && e.target && e.target instanceof HTMLElement && e.target.closest('button, a, input, select, textarea, ui-botao, ui-switch, ui-checkbox, ui-radio, [role="button"]') || this.clicavel && (this.dispatchEvent(
|
|
17
|
+
new CustomEvent("ui-click", {
|
|
18
|
+
detail: {
|
|
19
|
+
id: this.id || "sem-id"
|
|
20
|
+
},
|
|
21
|
+
bubbles: !0,
|
|
22
|
+
composed: !0
|
|
23
|
+
})
|
|
24
|
+
), this.dispatchEvent(
|
|
25
|
+
new CustomEvent("ui-clique", {
|
|
26
|
+
detail: {
|
|
27
|
+
id: this.id || "sem-id"
|
|
28
|
+
},
|
|
29
|
+
bubbles: !0,
|
|
30
|
+
composed: !0
|
|
31
|
+
})
|
|
32
|
+
));
|
|
33
|
+
});
|
|
34
|
+
o(this, "handleKeyDown", (e) => {
|
|
35
|
+
!this.clicavel || this.disabled || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleClick());
|
|
36
|
+
});
|
|
37
|
+
const e = this.attachShadow({ mode: "open" });
|
|
38
|
+
e.innerHTML = `
|
|
39
|
+
<style>${A}</style>
|
|
40
|
+
<div class="ui-card">
|
|
41
|
+
<div class="ui-card__media">
|
|
42
|
+
<slot name="midia"></slot>
|
|
43
|
+
<slot name="media"></slot>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="ui-card__header">
|
|
46
|
+
<slot name="cabecalho"></slot>
|
|
47
|
+
<slot name="header"></slot>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="ui-card__body">
|
|
50
|
+
<slot></slot>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="ui-card__footer">
|
|
53
|
+
<slot name="rodape"></slot>
|
|
54
|
+
<slot name="footer"></slot>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
`, this.cardElement = e.querySelector(".ui-card");
|
|
58
|
+
}
|
|
59
|
+
static get observedAttributes() {
|
|
60
|
+
return [
|
|
61
|
+
"elevacao",
|
|
62
|
+
"elevation",
|
|
63
|
+
"variante",
|
|
64
|
+
"variant",
|
|
65
|
+
"clicavel",
|
|
66
|
+
"clickable",
|
|
67
|
+
"compacto",
|
|
68
|
+
"compact",
|
|
69
|
+
"disabled"
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
var a;
|
|
74
|
+
this.listeners.cleanup(), this.listeners.add(this.cardElement, "click", this.handleClick), this.listeners.add(this.cardElement, "keydown", this.handleKeyDown);
|
|
75
|
+
const e = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll("slot");
|
|
76
|
+
e == null || e.forEach((r) => this.listeners.add(r, "slotchange", this.handleSlotChange)), this.syncState();
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
this.listeners.cleanup();
|
|
80
|
+
}
|
|
81
|
+
attributeChangedCallback(e, a, r) {
|
|
82
|
+
this.syncState();
|
|
83
|
+
}
|
|
84
|
+
get clicavel() {
|
|
85
|
+
return this.hasAttribute("clicavel") || this.hasAttribute("clickable");
|
|
86
|
+
}
|
|
87
|
+
set clicavel(e) {
|
|
88
|
+
e ? this.setAttribute("clicavel", "") : (this.removeAttribute("clicavel"), this.removeAttribute("clickable")), this.syncState();
|
|
89
|
+
}
|
|
90
|
+
get disabled() {
|
|
91
|
+
return this.hasAttribute("disabled");
|
|
92
|
+
}
|
|
93
|
+
set disabled(e) {
|
|
94
|
+
e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
|
|
95
|
+
}
|
|
96
|
+
syncState() {
|
|
97
|
+
var h, b, p;
|
|
98
|
+
const e = this.getAttribute("elevacao") || this.getAttribute("elevation") || "plano", a = this.getAttribute("variante") || this.getAttribute("variant"), r = this.clicavel, f = this.hasAttribute("compacto") || this.hasAttribute("compact"), x = this.disabled;
|
|
99
|
+
this.cardElement.className = "ui-card", this.cardElement.classList.add(`ui-card--${e}`), a && this.cardElement.classList.add(`ui-card--${a}`), r ? (this.cardElement.classList.add("ui-card--clicavel"), this.cardElement.setAttribute("tabindex", "0")) : this.cardElement.removeAttribute("tabindex"), f && this.cardElement.classList.add("ui-card--compacto"), x && this.cardElement.classList.add("ui-card--disabled");
|
|
100
|
+
const l = (h = this.shadowRoot) == null ? void 0 : h.querySelector(".ui-card__header"), n = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".ui-card__footer"), u = (p = this.shadowRoot) == null ? void 0 : p.querySelector(".ui-card__media"), d = (m) => {
|
|
101
|
+
var v;
|
|
102
|
+
const g = m.map((s) => `slot[name="${s}"]`).join(", ");
|
|
103
|
+
return Array.from(((v = this.shadowRoot) == null ? void 0 : v.querySelectorAll(g)) || []).some((s) => s.assignedNodes({ flatten: !0 }).some((c) => c.nodeType === Node.ELEMENT_NODE || c.textContent && c.textContent.trim() !== "")) || m.some((s) => this.querySelector(`[slot="${s}"]`) !== null);
|
|
104
|
+
};
|
|
105
|
+
u && (u.style.display = d(["midia", "media"]) ? "block" : "none"), l && (l.style.display = d(["cabecalho", "header"]) ? "flex" : "none"), n && (n.style.display = d(["rodape", "footer"]) ? "flex" : "none");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
E("ui-card", S);
|
|
109
|
+
export {
|
|
110
|
+
S as U
|
|
111
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var E=(i,t,e)=>t in i?w(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var s=(i,t,e)=>E(i,typeof t!="symbol"?t+"":t,e);const k=require("./listener-bag-D5omxZ9h.cjs"),f=require("./ssr-safe-CiHD1adl.cjs"),A=':host{display:block;width:100%;box-sizing:border-box}:host(.h-full),:host([style*="height: 100%"]){height:100%}.ui-card{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-card--plano{background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:none}.ui-card--elevado{background-color:var(--ui-cor-fundo-elevado, #1e1e24);box-shadow:0 8px 24px #0006;border-color:#ffffff14}.ui-card--destaque{border-color:var(--ui-cor-primaria, #00E08A);background-color:var(--ui-cor-fundo-card, #18181c);box-shadow:0 0 0 1px #00e08a40}.ui-card--clicavel{cursor:pointer;-webkit-user-select:none;user-select:none}.ui-card--clicavel:hover{transform:translateY(-3px);border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 10px 30px #00000080,0 0 15px #00e08a26}.ui-card--clicavel:active{transform:translateY(-1px)}.ui-card--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-card__media{width:100%;overflow:hidden;display:block;line-height:0}::slotted([slot="midia"]),::slotted([slot="media"]){width:100%;height:auto;display:block;object-fit:cover}.ui-card__header{padding:14px 16px 8px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card__body{padding:12px 16px;flex:1;box-sizing:border-box}.ui-card__footer{padding:10px 16px 14px;border-top:1px solid rgba(255,255,255,.06);display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box}.ui-card--compacto .ui-card__header{padding:10px 12px 6px}.ui-card--compacto .ui-card__body{padding:8px 12px}.ui-card--compacto .ui-card__footer{padding:8px 12px 10px}';class x extends f.SafeHTMLElement{constructor(){super();s(this,"cardElement");s(this,"listeners",new k.ListenerBag);s(this,"handleSlotChange",()=>{this.syncState()});s(this,"handleClick",e=>{this.disabled||e&&e.target&&e.target instanceof HTMLElement&&e.target.closest('button, a, input, select, textarea, ui-botao, ui-switch, ui-checkbox, ui-radio, [role="button"]')||this.clicavel&&(this.dispatchEvent(new CustomEvent("ui-click",{detail:{id:this.id||"sem-id"},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-clique",{detail:{id:this.id||"sem-id"},bubbles:!0,composed:!0})))});s(this,"handleKeyDown",e=>{!this.clicavel||this.disabled||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleClick())});const e=this.attachShadow({mode:"open"});e.innerHTML=`
|
|
2
|
+
<style>${A}</style>
|
|
3
|
+
<div class="ui-card">
|
|
4
|
+
<div class="ui-card__media">
|
|
5
|
+
<slot name="midia"></slot>
|
|
6
|
+
<slot name="media"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="ui-card__header">
|
|
9
|
+
<slot name="cabecalho"></slot>
|
|
10
|
+
<slot name="header"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="ui-card__body">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="ui-card__footer">
|
|
16
|
+
<slot name="rodape"></slot>
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`,this.cardElement=e.querySelector(".ui-card")}static get observedAttributes(){return["elevacao","elevation","variante","variant","clicavel","clickable","compacto","compact","disabled"]}connectedCallback(){var a;this.listeners.cleanup(),this.listeners.add(this.cardElement,"click",this.handleClick),this.listeners.add(this.cardElement,"keydown",this.handleKeyDown);const e=(a=this.shadowRoot)==null?void 0:a.querySelectorAll("slot");e==null||e.forEach(r=>this.listeners.add(r,"slotchange",this.handleSlotChange)),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,a,r){this.syncState()}get clicavel(){return this.hasAttribute("clicavel")||this.hasAttribute("clickable")}set clicavel(e){e?this.setAttribute("clicavel",""):(this.removeAttribute("clicavel"),this.removeAttribute("clickable")),this.syncState()}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.syncState()}syncState(){var h,b,p;const e=this.getAttribute("elevacao")||this.getAttribute("elevation")||"plano",a=this.getAttribute("variante")||this.getAttribute("variant"),r=this.clicavel,g=this.hasAttribute("compacto")||this.hasAttribute("compact"),y=this.disabled;this.cardElement.className="ui-card",this.cardElement.classList.add(`ui-card--${e}`),a&&this.cardElement.classList.add(`ui-card--${a}`),r?(this.cardElement.classList.add("ui-card--clicavel"),this.cardElement.setAttribute("tabindex","0")):this.cardElement.removeAttribute("tabindex"),g&&this.cardElement.classList.add("ui-card--compacto"),y&&this.cardElement.classList.add("ui-card--disabled");const l=(h=this.shadowRoot)==null?void 0:h.querySelector(".ui-card__header"),n=(b=this.shadowRoot)==null?void 0:b.querySelector(".ui-card__footer"),u=(p=this.shadowRoot)==null?void 0:p.querySelector(".ui-card__media"),c=m=>{var v;const _=m.map(o=>`slot[name="${o}"]`).join(", ");return Array.from(((v=this.shadowRoot)==null?void 0:v.querySelectorAll(_))||[]).some(o=>o.assignedNodes({flatten:!0}).some(d=>d.nodeType===Node.ELEMENT_NODE||d.textContent&&d.textContent.trim()!==""))||m.some(o=>this.querySelector(`[slot="${o}"]`)!==null)};u&&(u.style.display=c(["midia","media"])?"block":"none"),l&&(l.style.display=c(["cabecalho","header"])?"flex":"none"),n&&(n.style.display=c(["rodape","footer"])?"flex":"none")}}f.definirCustomElement("ui-card",x);exports.UICard=x;
|
package/dist/ui-kit.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root,:root[data-tema=escuro],:root.dark,[data-tema=escuro]{color-scheme:dark;--ui-cor-primaria: #00E08A;--ui-cor-texto-sobre-primaria: #000000;--ui-cor-destaque: #00E08A;--ui-cor-fundo: #0b0b0d;--ui-cor-superficie: #141417;--ui-cor-fundo-elevado: #1a1a1e;--ui-cor-fundo-card: #18181c;--ui-cor-fundo-menu: #18181c;--ui-cor-hover-menu: rgba(255, 255, 255, .08);--ui-cor-texto: #e1e1e6;--ui-cor-texto-secundario: #888899;--ui-cor-texto-erro: #ff5555;--ui-cor-texto-sucesso: #00E08A;--ui-cor-texto-alerta: #ffb86c;--ui-cor-botao-secundario-fundo: #1e1e24;--ui-cor-botao-secundario-hover: #2a2a34;--ui-cor-botao-destrutivo-fundo: #ff4444;--ui-cor-botao-destrutivo-hover: #e03333;--ui-cor-botao-destrutivo-texto: #ffffff;--ui-cor-borda: rgba(255, 255, 255, .12)}:root[data-tema=claro],:root.light,[data-tema=claro],[data-theme=light]{color-scheme:light;--ui-cor-primaria: #00B368;--ui-cor-texto-sobre-primaria: #ffffff;--ui-cor-destaque: #00B368;--ui-cor-fundo: #f8f9fa;--ui-cor-superficie: #ffffff;--ui-cor-fundo-elevado: #f1f3f5;--ui-cor-fundo-card: #ffffff;--ui-cor-fundo-menu: #ffffff;--ui-cor-hover-menu: rgba(0, 0, 0, .05);--ui-cor-texto: #1a1a1e;--ui-cor-texto-secundario: #6c757d;--ui-cor-texto-erro: #e03131;--ui-cor-texto-sucesso: #00B368;--ui-cor-texto-alerta: #f59f00;--ui-cor-botao-secundario-fundo: #e9ecef;--ui-cor-botao-secundario-hover: #dee2e6;--ui-cor-botao-destrutivo-fundo: #e03131;--ui-cor-botao-destrutivo-hover: #c92a2a;--ui-cor-botao-destrutivo-texto: #ffffff;--ui-cor-borda: rgba(0, 0, 0, .12)}:root{--ui-raio-borda: 6px;--ui-espaco-xs: 4px;--ui-espaco-sm: 8px;--ui-espaco-md: 16px;--ui-espaco-lg: 24px;--ui-touch-target-min: 44px;--ui-altura-minima: 15px;--ui-campo-altura: var(--ui-altura-minima, 15px)}:root{--ui-fonte-base: "Inter", system-ui, -apple-system, sans-serif;--ui-fonte-codigo: "Fira Code", "Consolas", monospace;--ui-tamanho-h1: clamp(24px, 4vw, 36px);--ui-tamanho-h2: clamp(20px, 3vw, 28px);--ui-tamanho-h3: clamp(18px, 2.4vw, 24px);--ui-tamanho-h4: clamp(16px, 2vw, 20px);--ui-tamanho-h5: clamp(14px, 1.6vw, 18px);--ui-tamanho-h6: clamp(13px, 1.2vw, 16px);--ui-tamanho-corpo: 14px;--ui-tamanho-corpo-sm: 13px;--ui-tamanho-caption: 11px;--ui-tamanho-codigo: 12px;--ui-peso-normal: 400;--ui-peso-medio: 500;--ui-peso-seminegrito: 600;--ui-peso-negrito: 700;--ui-altura-linha-titulo: 1.25;--ui-altura-linha-corpo: 1.5;--ui-altura-linha-compacta: 1.2}:root{--ui-z-workspace-hud: 500;--ui-z-docked-bar: 600;--ui-z-drawer: 700;--ui-z-modal: 1000;--ui-z-popover: 1050;--ui-z-toast: 1100;--ui-z-tooltip: 1200}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var x=(l,a,t)=>a in l?y(l,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[a]=t;var s=(l,a,t)=>x(l,typeof a!="symbol"?a+"":a,t);const b=require("./ssr-safe-CiHD1adl.cjs"),v=':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:0 12px 36px #0009;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 .2s ease;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)}@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:#ffffff40;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 rgba(255,255,255,.08);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: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}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background-color:#ffffff1a}.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 rgba(255,255,255,.08);background-color:#00000026}@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:16px 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:16px 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 p(l){const a=new Set;if(typeof document>"u")return a;let t=l;for(;t&&t!==document.body&&t!==document.documentElement;){const o=t.parentElement;if(!o)break;const e=Array.from(o.children);for(const i of e)if(i!==t&&!i.contains(l)&&i.tagName!=="SCRIPT"&&i.tagName!=="STYLE"&&!(i.hasAttribute("inert")||i.inert===!0)){i.setAttribute("inert","");try{i.inert=!0}catch{}a.add(i)}t=o}if(document.body){const o=Array.from(document.body.children);for(const e of o)if(e!==l&&!e.contains(l)&&e.tagName!=="SCRIPT"&&e.tagName!=="STYLE"&&!(e.hasAttribute("inert")||e.inert===!0)){e.setAttribute("inert","");try{e.inert=!0}catch{}a.add(e)}}return a}function u(l){l.forEach(a=>{try{a.removeAttribute("inert"),a.inert=!1}catch{}}),l.clear()}const n=class n extends b.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,"_elementosInertes",new Set);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 o,e;if(this.aberto&&this._isTopMostModal()){if(t.key==="Escape")this.fechar(),t.stopImmediatePropagation();else if(t.key==="Tab"){if(this._atualizarFocables(),this._focables.length===0){t.preventDefault();return}const i=this._focables[0],r=this._focables[this._focables.length-1],d=this.getRootNode().activeElement;t.shiftKey?(d===i||!this.contains(d)&&!((o=this.shadowRoot)!=null&&o.contains(d)))&&(t.preventDefault(),r.focus()):(d===r||!this.contains(d)&&!((e=this.shadowRoot)!=null&&e.contains(d)))&&(t.preventDefault(),i.focus())}}});this._tituloId=`ui-modal-title-${Math.random().toString(36).substring(2,9)}`;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
+
<style>${v}</style>
|
|
3
|
+
<div class="ui-modal__backdrop"></div>
|
|
4
|
+
<div class="ui-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
|
|
5
|
+
<div class="ui-modal__handle"></div>
|
|
6
|
+
<div class="ui-modal__header">
|
|
7
|
+
<h3 class="ui-modal__titulo" id="${this._tituloId}"></h3>
|
|
8
|
+
<button class="ui-modal__close" type="button" aria-label="Fechar modal" title="Fechar">✕</button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="ui-modal__body">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="ui-modal__footer">
|
|
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(o=>{o.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(o=>{o.removeEventListener("slotchange",this.handleSlotChange)}),u(this._elementosInertes),this.hasAttribute("data-scroll-locked")&&(this.removeAttribute("data-scroll-locked"),n._openCount=Math.max(0,n._openCount-1),n._openCount===0&&(document.body.style.overflow=""))}attributeChangedCallback(t,o,e){(t==="aberto"||t==="open")&&e!==null&&(document.activeElement&&document.activeElement!==document.body&&(this._elementoGatilho=document.activeElement),setTimeout(()=>{this._atualizarFocables(),this._focables.length>0?this._focables[0].focus():this.dialogElement.focus()},0)),this.syncState()}get aberto(){return this.hasAttribute("aberto")||this.hasAttribute("open")}set aberto(t){t?this.setAttribute("aberto",""):(this.removeAttribute("aberto"),this.removeAttribute("open")),this.syncState()}abrir(){this.aberto||(document.activeElement&&document.activeElement!==document.body&&(this._elementoGatilho=document.activeElement),this.aberto=!0,this.dispatchEvent(new CustomEvent("ui-abrir",{bubbles:!0,composed:!0})),setTimeout(()=>{this._atualizarFocables(),this._focables.length>0?this._focables[0].focus():this.dialogElement.focus()},0))}fechar(){this.hasAttribute("bloquear-fechamento")||this.aberto&&(u(this._elementosInertes),this.aberto=!1,this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0})),this._elementoGatilho&&(this._elementoGatilho.focus(),this._elementoGatilho=null))}syncState(){var d,c;const t=this.aberto,o=this.getAttribute("titulo")||this.getAttribute("title")||"",e=(d=this.shadowRoot)==null?void 0:d.querySelector(".ui-modal__footer");this.dialogElement.setAttribute("aria-hidden",String(!t));const i=this.getAttribute("aria-label")||this.getAttribute("rotulo"),r=this.getAttribute("aria-labelledby");if(i?(this.dialogElement.setAttribute("aria-label",i),this.dialogElement.removeAttribute("aria-labelledby")):r?(this.dialogElement.setAttribute("aria-labelledby",r),this.dialogElement.removeAttribute("aria-label")):o?(this.tituloElement.textContent=o,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")),e){const _=Array.from(((c=this.shadowRoot)==null?void 0:c.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(g=>g.assignedNodes({flatten:!0}).some(m=>m.nodeType===Node.ELEMENT_NODE||m.textContent&&m.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;e.style.display=_?"flex":"none"}t?(this._elementosInertes.size===0&&(this._elementosInertes=p(this)),this.hasAttribute("data-scroll-locked")||(this.setAttribute("data-scroll-locked","true"),n._openCount++,n._openCount===1&&(document.body.style.overflow="hidden"))):(this._elementosInertes.size>0&&u(this._elementosInertes),this.hasAttribute("data-scroll-locked")&&(this.removeAttribute("data-scroll-locked"),n._openCount=Math.max(0,n._openCount-1),n._openCount===0&&(document.body.style.overflow="")))}_atualizarFocables(){const t='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select';let o=Array.from(this.shadowRoot.querySelectorAll(t));o=o.filter(r=>window.getComputedStyle(r).display!=="none");const e=this.shadowRoot.querySelectorAll("slot");let i=[];e.forEach(r=>{r.assignedElements({flatten:!0}).forEach(c=>{c instanceof HTMLElement&&(c.matches(t)&&i.push(c),i.push(...Array.from(c.querySelectorAll(t))))})}),this._focables=[...o,...i].filter(r=>!r.hasAttribute("disabled")&&r.getAttribute("aria-hidden")!=="true")}_isTopMostModal(){const t=Array.from(document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]"));return t[t.length-1]===this}};s(n,"_openCount",0);let h=n;class f extends h{}b.definirCustomElement("ui-modal",h);b.definirCustomElement("ui-dialog",f);exports.UIDialog=f;exports.UIModal=h;exports.aplicarInertForaDoModal=p;exports.removerInertForaDoModal=u;
|