@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,20 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var f=(r,o,e)=>o in r?h(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e;var i=(r,o,e)=>f(r,typeof o!="symbol"?o+"":o,e);const m=require("./listener-bag-D5omxZ9h.cjs"),c=require("./ssr-safe-CiHD1adl.cjs"),p=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:4px;line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:#ffffff26}.ui-alerta--sucesso{background-color:#00e08a1f;border-color:#00e08a4d;color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:#ff55551f;border-color:#ff55554d;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:#ffb86c1f;border-color:#ffb86c4d;color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:#00aaff1f;border-color:#00aaff4d;color:#0af}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:#ffffff14;border:1px solid rgba(255,255,255,.16);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:#ffffff2e;border-color:#ffffff4d}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario{background:#00e08a26;border-color:#00e08a59;color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:#00e08a40;border-color:#00e08a80}.ui-alerta__botao-acao--destrutivo{background:#ff444426;border-color:#ff444459;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:#ff444440;border-color:#ff444480}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:0 10px 32px #000000a6,0 0 0 1px #ffffff14;animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:#ffffff14;overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}',l={sucesso:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',erro:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',alerta:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',info:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'};class u extends c.SafeHTMLElement{constructor(){super();i(this,"alertaElement");i(this,"iconeElement");i(this,"tituloElement");i(this,"mensagemElement");i(this,"mensagemTextoElement");i(this,"closeElement");i(this,"acoesElement");i(this,"botaoAcaoElement");i(this,"progressoContainer");i(this,"progressoBarra");i(this,"listeners",new m.ListenerBag);const e=this.attachShadow({mode:"open"});e.innerHTML=`
|
|
2
|
+
<style>${p}</style>
|
|
3
|
+
<div class="ui-alerta" role="alert">
|
|
4
|
+
<span class="ui-alerta__icone"></span>
|
|
5
|
+
<div class="ui-alerta__conteudo">
|
|
6
|
+
<h4 class="ui-alerta__titulo" style="display: none;"></h4>
|
|
7
|
+
<p class="ui-alerta__mensagem">
|
|
8
|
+
<span class="ui-alerta__mensagem-texto" style="display: none;"></span>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="ui-alerta__acoes" style="display: none;">
|
|
13
|
+
<button type="button" class="ui-alerta__botao-acao"></button>
|
|
14
|
+
</div>
|
|
15
|
+
<button class="ui-alerta__close" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
|
|
16
|
+
<div class="ui-toast__progresso" style="display: none;">
|
|
17
|
+
<div class="ui-toast__progresso-barra"></div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`,this.alertaElement=e.querySelector(".ui-alerta"),this.iconeElement=e.querySelector(".ui-alerta__icone"),this.tituloElement=e.querySelector(".ui-alerta__titulo"),this.mensagemElement=e.querySelector(".ui-alerta__mensagem"),this.mensagemTextoElement=e.querySelector(".ui-alerta__mensagem-texto"),this.closeElement=e.querySelector(".ui-alerta__close"),this.acoesElement=e.querySelector(".ui-alerta__acoes"),this.botaoAcaoElement=e.querySelector(".ui-alerta__botao-acao"),this.progressoContainer=e.querySelector(".ui-toast__progresso"),this.progressoBarra=e.querySelector(".ui-toast__progresso-barra")}static get observedAttributes(){return["tipo","variante","variant","titulo","title","mensagem","fechavel","dismissible"]}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.closeElement,"click",()=>this.fechar()),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(e,a,t){this.syncState()}fechar(){this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0})),this.remove()}syncState(){const e=this.getAttribute("tipo")||this.getAttribute("variante")||this.getAttribute("variant")||"info",a=this.getAttribute("titulo")||this.getAttribute("title"),t=this.getAttribute("mensagem"),s=this.hasAttribute("fechavel")||this.hasAttribute("dismissible");this.alertaElement.className=`ui-alerta ui-alerta--${e}`;const d=l[e]||l.info;this.iconeElement.innerHTML=d,a?(this.tituloElement.textContent=a,this.tituloElement.style.display="block"):(this.tituloElement.style.display="none",this.tituloElement.textContent=""),t?(this.mensagemTextoElement.textContent=t,this.mensagemTextoElement.style.display="inline"):(this.mensagemTextoElement.style.display="none",this.mensagemTextoElement.textContent=""),s?this.closeElement.style.display="block":this.closeElement.style.display="none"}}c.definirCustomElement("ui-alerta",u);class n extends u{constructor(){super(...arguments);i(this,"timerId",null);i(this,"tempoRestante",4e3);i(this,"inicioTimestamp",0);i(this,"isPausado",!1);i(this,"acaoConfig");i(this,"containerRef",null);i(this,"handleAcaoClick",e=>{var a,t,s;e.stopPropagation(),(a=this.acaoConfig)!=null&&a.onClick&&this.acaoConfig.onClick(e),this.dispatchEvent(new CustomEvent("ui-toast-acao",{detail:{rotulo:(t=this.acaoConfig)==null?void 0:t.rotulo,tipo:(s=this.acaoConfig)==null?void 0:s.tipo},bubbles:!0,composed:!0})),this.fechar()});i(this,"pausarTimer",()=>{if(this.isPausado||this.tempoRestante<=0)return;this.isPausado=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null);const e=Date.now()-this.inicioTimestamp;this.tempoRestante=Math.max(0,this.tempoRestante-e),this.progressoBarra.style.animationPlayState="paused"});i(this,"retomarTimer",()=>{!this.isPausado||this.tempoRestante<=0||(this.isPausado=!1,this.progressoBarra.style.animationPlayState="running",this.iniciarTimer(Math.max(this.tempoRestante,300)))})}configurarAcao(e){this.acaoConfig=e,this.botaoAcaoElement.textContent=e.rotulo,this.acoesElement.style.display="flex";const a=e.tipo||"primario";this.botaoAcaoElement.className=`ui-alerta__botao-acao ui-alerta__botao-acao--${a}`}connectedCallback(){super.connectedCallback(),this.containerRef=this.parentElement,this.alertaElement.classList.add("ui-toast__banner"),this.acaoConfig&&this.listeners.add(this.botaoAcaoElement,"click",this.handleAcaoClick);const e=this.getAttribute("duracao")||this.getAttribute("duration")||"4000",a=parseInt(e,10);this.tempoRestante=isNaN(a)?4e3:a,this.tempoRestante>0?(this.progressoContainer.style.display="block",this.progressoBarra.style.animationDuration=`${this.tempoRestante}ms`,this.getAttribute("pausar-no-hover")!=="false"&&(this.listeners.add(this,"mouseenter",this.pausarTimer),this.listeners.add(this,"mouseleave",this.retomarTimer),this.listeners.add(this,"focusin",this.pausarTimer),this.listeners.add(this,"focusout",this.retomarTimer)),this.iniciarTimer(this.tempoRestante)):this.progressoContainer.style.display="none"}fechar(){const e=this.parentElement||this.containerRef;super.fechar(),e&&e.id.startsWith("ui-toast-container-")&&e.children.length===0&&e.remove()}disconnectedCallback(){super.disconnectedCallback(),this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.containerRef&&this.containerRef.id.startsWith("ui-toast-container-")&&this.containerRef.children.length===0&&(this.containerRef.remove(),this.containerRef=null)}iniciarTimer(e){this.timerId&&clearTimeout(this.timerId),this.inicioTimestamp=Date.now(),this.timerId=setTimeout(()=>{this.fechar()},e)}static obterContainer(e){const a=`ui-toast-container-${e}`;let t=document.getElementById(a);return t||(t=document.createElement("div"),t.id=a,t.style.position="fixed",t.style.setProperty("z-index","var(--ui-z-toast, 1100)"),t.style.display="flex",t.style.gap="10px",t.style.maxWidth="400px",t.style.width="calc(100vw - 32px)",t.style.pointerEvents="none",t.style.boxSizing="border-box",t.style.transition="all 0.2s ease",e==="top-right"?(t.style.top="20px",t.style.right="20px",t.style.flexDirection="column"):e==="top-left"?(t.style.top="20px",t.style.left="20px",t.style.flexDirection="column"):e==="bottom-left"?(t.style.bottom="20px",t.style.left="20px",t.style.flexDirection="column-reverse"):e==="top-center"?(t.style.top="20px",t.style.left="50%",t.style.transform="translateX(-50%)",t.style.flexDirection="column"):e==="bottom-center"?(t.style.bottom="20px",t.style.left="50%",t.style.transform="translateX(-50%)",t.style.flexDirection="column-reverse"):(t.style.bottom="20px",t.style.right="20px",t.style.flexDirection="column-reverse"),document.body.appendChild(t)),t}static notificar(e){if(typeof document>"u")return null;const a=e.posicao||"bottom-right",t=document.createElement("ui-toast");return e.tipo&&t.setAttribute("tipo",e.tipo),e.titulo&&t.setAttribute("titulo",e.titulo),e.mensagem&&t.setAttribute("mensagem",e.mensagem),e.duracao!==void 0&&t.setAttribute("duracao",String(e.duracao)),e.pausarNoHover===!1&&t.setAttribute("pausar-no-hover","false"),t.setAttribute("posicao",a),e.fechavel!==!1&&t.setAttribute("fechavel",""),e.acao&&t.configurarAcao(e.acao),n.obterContainer(a).appendChild(t),t}}c.definirCustomElement("ui-toast",n);exports.ICONES_ALERTA=l;exports.UIAlerta=u;exports.UIToast=n;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var m = (r, o, t) => o in r ? h(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
|
|
3
|
+
var i = (r, o, t) => m(r, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { L as f } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { d as c, S as p } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
const b = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:4px;line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:#ffffff26}.ui-alerta--sucesso{background-color:#00e08a1f;border-color:#00e08a4d;color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:#ff55551f;border-color:#ff55554d;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:#ffb86c1f;border-color:#ffb86c4d;color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:#00aaff1f;border-color:#00aaff4d;color:#0af}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:#ffffff14;border:1px solid rgba(255,255,255,.16);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:#ffffff2e;border-color:#ffffff4d}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario{background:#00e08a26;border-color:#00e08a59;color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:#00e08a40;border-color:#00e08a80}.ui-alerta__botao-acao--destrutivo{background:#ff444426;border-color:#ff444459;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:#ff444440;border-color:#ff444480}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:0 10px 32px #000000a6,0 0 0 1px #ffffff14;animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:#ffffff14;overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}', l = {
|
|
7
|
+
sucesso: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',
|
|
8
|
+
erro: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',
|
|
9
|
+
alerta: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',
|
|
10
|
+
info: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'
|
|
11
|
+
};
|
|
12
|
+
class u extends p {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
i(this, "alertaElement");
|
|
16
|
+
i(this, "iconeElement");
|
|
17
|
+
i(this, "tituloElement");
|
|
18
|
+
i(this, "mensagemElement");
|
|
19
|
+
i(this, "mensagemTextoElement");
|
|
20
|
+
i(this, "closeElement");
|
|
21
|
+
i(this, "acoesElement");
|
|
22
|
+
i(this, "botaoAcaoElement");
|
|
23
|
+
i(this, "progressoContainer");
|
|
24
|
+
i(this, "progressoBarra");
|
|
25
|
+
i(this, "listeners", new f());
|
|
26
|
+
const t = this.attachShadow({ mode: "open" });
|
|
27
|
+
t.innerHTML = `
|
|
28
|
+
<style>${b}</style>
|
|
29
|
+
<div class="ui-alerta" role="alert">
|
|
30
|
+
<span class="ui-alerta__icone"></span>
|
|
31
|
+
<div class="ui-alerta__conteudo">
|
|
32
|
+
<h4 class="ui-alerta__titulo" style="display: none;"></h4>
|
|
33
|
+
<p class="ui-alerta__mensagem">
|
|
34
|
+
<span class="ui-alerta__mensagem-texto" style="display: none;"></span>
|
|
35
|
+
<slot></slot>
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="ui-alerta__acoes" style="display: none;">
|
|
39
|
+
<button type="button" class="ui-alerta__botao-acao"></button>
|
|
40
|
+
</div>
|
|
41
|
+
<button class="ui-alerta__close" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
|
|
42
|
+
<div class="ui-toast__progresso" style="display: none;">
|
|
43
|
+
<div class="ui-toast__progresso-barra"></div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`, this.alertaElement = t.querySelector(".ui-alerta"), this.iconeElement = t.querySelector(".ui-alerta__icone"), this.tituloElement = t.querySelector(".ui-alerta__titulo"), this.mensagemElement = t.querySelector(".ui-alerta__mensagem"), this.mensagemTextoElement = t.querySelector(".ui-alerta__mensagem-texto"), this.closeElement = t.querySelector(".ui-alerta__close"), this.acoesElement = t.querySelector(".ui-alerta__acoes"), this.botaoAcaoElement = t.querySelector(".ui-alerta__botao-acao"), this.progressoContainer = t.querySelector(".ui-toast__progresso"), this.progressoBarra = t.querySelector(".ui-toast__progresso-barra");
|
|
47
|
+
}
|
|
48
|
+
static get observedAttributes() {
|
|
49
|
+
return [
|
|
50
|
+
"tipo",
|
|
51
|
+
"variante",
|
|
52
|
+
"variant",
|
|
53
|
+
"titulo",
|
|
54
|
+
"title",
|
|
55
|
+
"mensagem",
|
|
56
|
+
"fechavel",
|
|
57
|
+
"dismissible"
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
connectedCallback() {
|
|
61
|
+
this.listeners.cleanup(), this.listeners.add(this.closeElement, "click", () => this.fechar()), this.syncState();
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
this.listeners.cleanup();
|
|
65
|
+
}
|
|
66
|
+
attributeChangedCallback(t, a, e) {
|
|
67
|
+
this.syncState();
|
|
68
|
+
}
|
|
69
|
+
fechar() {
|
|
70
|
+
this.dispatchEvent(
|
|
71
|
+
new CustomEvent("ui-fechar", {
|
|
72
|
+
bubbles: !0,
|
|
73
|
+
composed: !0
|
|
74
|
+
})
|
|
75
|
+
), this.remove();
|
|
76
|
+
}
|
|
77
|
+
syncState() {
|
|
78
|
+
const t = this.getAttribute("tipo") || this.getAttribute("variante") || this.getAttribute("variant") || "info", a = this.getAttribute("titulo") || this.getAttribute("title"), e = this.getAttribute("mensagem"), s = this.hasAttribute("fechavel") || this.hasAttribute("dismissible");
|
|
79
|
+
this.alertaElement.className = `ui-alerta ui-alerta--${t}`;
|
|
80
|
+
const d = l[t] || l.info;
|
|
81
|
+
this.iconeElement.innerHTML = d, a ? (this.tituloElement.textContent = a, this.tituloElement.style.display = "block") : (this.tituloElement.style.display = "none", this.tituloElement.textContent = ""), e ? (this.mensagemTextoElement.textContent = e, this.mensagemTextoElement.style.display = "inline") : (this.mensagemTextoElement.style.display = "none", this.mensagemTextoElement.textContent = ""), s ? this.closeElement.style.display = "block" : this.closeElement.style.display = "none";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
c("ui-alerta", u);
|
|
85
|
+
class n extends u {
|
|
86
|
+
constructor() {
|
|
87
|
+
super(...arguments);
|
|
88
|
+
i(this, "timerId", null);
|
|
89
|
+
i(this, "tempoRestante", 4e3);
|
|
90
|
+
i(this, "inicioTimestamp", 0);
|
|
91
|
+
i(this, "isPausado", !1);
|
|
92
|
+
i(this, "acaoConfig");
|
|
93
|
+
i(this, "containerRef", null);
|
|
94
|
+
i(this, "handleAcaoClick", (t) => {
|
|
95
|
+
var a, e, s;
|
|
96
|
+
t.stopPropagation(), (a = this.acaoConfig) != null && a.onClick && this.acaoConfig.onClick(t), this.dispatchEvent(
|
|
97
|
+
new CustomEvent("ui-toast-acao", {
|
|
98
|
+
detail: {
|
|
99
|
+
rotulo: (e = this.acaoConfig) == null ? void 0 : e.rotulo,
|
|
100
|
+
tipo: (s = this.acaoConfig) == null ? void 0 : s.tipo
|
|
101
|
+
},
|
|
102
|
+
bubbles: !0,
|
|
103
|
+
composed: !0
|
|
104
|
+
})
|
|
105
|
+
), this.fechar();
|
|
106
|
+
});
|
|
107
|
+
i(this, "pausarTimer", () => {
|
|
108
|
+
if (this.isPausado || this.tempoRestante <= 0) return;
|
|
109
|
+
this.isPausado = !0, this.timerId && (clearTimeout(this.timerId), this.timerId = null);
|
|
110
|
+
const t = Date.now() - this.inicioTimestamp;
|
|
111
|
+
this.tempoRestante = Math.max(0, this.tempoRestante - t), this.progressoBarra.style.animationPlayState = "paused";
|
|
112
|
+
});
|
|
113
|
+
i(this, "retomarTimer", () => {
|
|
114
|
+
!this.isPausado || this.tempoRestante <= 0 || (this.isPausado = !1, this.progressoBarra.style.animationPlayState = "running", this.iniciarTimer(Math.max(this.tempoRestante, 300)));
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
configurarAcao(t) {
|
|
118
|
+
this.acaoConfig = t, this.botaoAcaoElement.textContent = t.rotulo, this.acoesElement.style.display = "flex";
|
|
119
|
+
const a = t.tipo || "primario";
|
|
120
|
+
this.botaoAcaoElement.className = `ui-alerta__botao-acao ui-alerta__botao-acao--${a}`;
|
|
121
|
+
}
|
|
122
|
+
connectedCallback() {
|
|
123
|
+
super.connectedCallback(), this.containerRef = this.parentElement, this.alertaElement.classList.add("ui-toast__banner"), this.acaoConfig && this.listeners.add(this.botaoAcaoElement, "click", this.handleAcaoClick);
|
|
124
|
+
const t = this.getAttribute("duracao") || this.getAttribute("duration") || "4000", a = parseInt(t, 10);
|
|
125
|
+
this.tempoRestante = isNaN(a) ? 4e3 : a, this.tempoRestante > 0 ? (this.progressoContainer.style.display = "block", this.progressoBarra.style.animationDuration = `${this.tempoRestante}ms`, this.getAttribute("pausar-no-hover") !== "false" && (this.listeners.add(this, "mouseenter", this.pausarTimer), this.listeners.add(this, "mouseleave", this.retomarTimer), this.listeners.add(this, "focusin", this.pausarTimer), this.listeners.add(this, "focusout", this.retomarTimer)), this.iniciarTimer(this.tempoRestante)) : this.progressoContainer.style.display = "none";
|
|
126
|
+
}
|
|
127
|
+
fechar() {
|
|
128
|
+
const t = this.parentElement || this.containerRef;
|
|
129
|
+
super.fechar(), t && t.id.startsWith("ui-toast-container-") && t.children.length === 0 && t.remove();
|
|
130
|
+
}
|
|
131
|
+
disconnectedCallback() {
|
|
132
|
+
super.disconnectedCallback(), this.timerId && (clearTimeout(this.timerId), this.timerId = null), this.containerRef && this.containerRef.id.startsWith("ui-toast-container-") && this.containerRef.children.length === 0 && (this.containerRef.remove(), this.containerRef = null);
|
|
133
|
+
}
|
|
134
|
+
iniciarTimer(t) {
|
|
135
|
+
this.timerId && clearTimeout(this.timerId), this.inicioTimestamp = Date.now(), this.timerId = setTimeout(() => {
|
|
136
|
+
this.fechar();
|
|
137
|
+
}, t);
|
|
138
|
+
}
|
|
139
|
+
static obterContainer(t) {
|
|
140
|
+
const a = `ui-toast-container-${t}`;
|
|
141
|
+
let e = document.getElementById(a);
|
|
142
|
+
return e || (e = document.createElement("div"), e.id = a, e.style.position = "fixed", e.style.setProperty("z-index", "var(--ui-z-toast, 1100)"), e.style.display = "flex", e.style.gap = "10px", e.style.maxWidth = "400px", e.style.width = "calc(100vw - 32px)", e.style.pointerEvents = "none", e.style.boxSizing = "border-box", e.style.transition = "all 0.2s ease", t === "top-right" ? (e.style.top = "20px", e.style.right = "20px", e.style.flexDirection = "column") : t === "top-left" ? (e.style.top = "20px", e.style.left = "20px", e.style.flexDirection = "column") : t === "bottom-left" ? (e.style.bottom = "20px", e.style.left = "20px", e.style.flexDirection = "column-reverse") : t === "top-center" ? (e.style.top = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column") : t === "bottom-center" ? (e.style.bottom = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column-reverse") : (e.style.bottom = "20px", e.style.right = "20px", e.style.flexDirection = "column-reverse"), document.body.appendChild(e)), e;
|
|
143
|
+
}
|
|
144
|
+
// Utilitário estático para disparo imperativo de Toasts de qualquer lugar no código
|
|
145
|
+
static notificar(t) {
|
|
146
|
+
if (typeof document > "u") return null;
|
|
147
|
+
const a = t.posicao || "bottom-right", e = document.createElement("ui-toast");
|
|
148
|
+
return t.tipo && e.setAttribute("tipo", t.tipo), t.titulo && e.setAttribute("titulo", t.titulo), t.mensagem && e.setAttribute("mensagem", t.mensagem), t.duracao !== void 0 && e.setAttribute("duracao", String(t.duracao)), t.pausarNoHover === !1 && e.setAttribute("pausar-no-hover", "false"), e.setAttribute("posicao", a), t.fechavel !== !1 && e.setAttribute("fechavel", ""), t.acao && e.configurarAcao(t.acao), n.obterContainer(a).appendChild(e), e;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
c("ui-toast", n);
|
|
152
|
+
export {
|
|
153
|
+
l as I,
|
|
154
|
+
u as U,
|
|
155
|
+
n as a
|
|
156
|
+
};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var v = (f, e, t) => e in f ? w(f, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[e] = t;
|
|
3
|
+
var g = (f, e, t) => v(f, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { a as A } from "./ui-toast-CwUmiqyG.js";
|
|
5
|
+
class E {
|
|
6
|
+
constructor() {
|
|
7
|
+
g(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
|
+
}
|
|
9
|
+
on(e, t) {
|
|
10
|
+
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
|
|
11
|
+
}
|
|
12
|
+
once(e, t) {
|
|
13
|
+
const r = (n) => {
|
|
14
|
+
this.off(e, r), t(n);
|
|
15
|
+
};
|
|
16
|
+
this.on(e, r);
|
|
17
|
+
}
|
|
18
|
+
off(e, t) {
|
|
19
|
+
const r = this.listeners.get(e);
|
|
20
|
+
r && (r.delete(t), r.size === 0 && this.listeners.delete(e));
|
|
21
|
+
}
|
|
22
|
+
emit(e, t) {
|
|
23
|
+
const r = this.listeners.get(e);
|
|
24
|
+
r && r.forEach((n) => {
|
|
25
|
+
try {
|
|
26
|
+
n(t);
|
|
27
|
+
} catch (c) {
|
|
28
|
+
console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`, c);
|
|
29
|
+
}
|
|
30
|
+
}), typeof window < "u" && window.dispatchEvent(
|
|
31
|
+
new CustomEvent(`uibus:${e}`, {
|
|
32
|
+
detail: t,
|
|
33
|
+
bubbles: !0,
|
|
34
|
+
composed: !0
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
/* ====================================================
|
|
39
|
+
Métodos de Atalho e Ações de Alta Produtividade
|
|
40
|
+
==================================================== */
|
|
41
|
+
/**
|
|
42
|
+
* Abre um modal pelo seu ID no documento.
|
|
43
|
+
*/
|
|
44
|
+
abrirModal(e) {
|
|
45
|
+
if (typeof document > "u") return !1;
|
|
46
|
+
const t = document.getElementById(e);
|
|
47
|
+
return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("modal:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("modal:aberto", { id: e }), !0) : (console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`), !1);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Fecha um modal pelo seu ID ou todos os modais abertos se nenhum ID for passado.
|
|
51
|
+
*/
|
|
52
|
+
fecharModal(e) {
|
|
53
|
+
if (typeof document > "u") return !1;
|
|
54
|
+
if (e) {
|
|
55
|
+
const t = document.getElementById(e);
|
|
56
|
+
return t && typeof t.fechar == "function" ? (t.fechar(), this.emit("modal:fechado", { id: e }), !0) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("modal:fechado", { id: e }), !0) : !1;
|
|
57
|
+
} else
|
|
58
|
+
return document.querySelectorAll(
|
|
59
|
+
"ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]"
|
|
60
|
+
).forEach((r) => {
|
|
61
|
+
typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
|
|
62
|
+
}), this.emit("modal:fechado-todos"), !0;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Abre um painel lateral (drawer / sheet) pelo seu ID no documento.
|
|
66
|
+
*/
|
|
67
|
+
abrirDrawer(e) {
|
|
68
|
+
if (typeof document > "u") return !1;
|
|
69
|
+
const t = document.getElementById(e);
|
|
70
|
+
return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("drawer:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("drawer:aberto", { id: e }), !0) : (console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`), !1);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Fecha um painel lateral (drawer / sheet) pelo seu ID ou todos se nenhum for passado.
|
|
74
|
+
*/
|
|
75
|
+
fecharDrawer(e) {
|
|
76
|
+
if (typeof document > "u") return !1;
|
|
77
|
+
if (e) {
|
|
78
|
+
const t = document.getElementById(e);
|
|
79
|
+
return t && typeof t.fechar == "function" ? (t.fechar(), this.emit("drawer:fechado", { id: e }), !0) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("drawer:fechado", { id: e }), !0) : !1;
|
|
80
|
+
} else
|
|
81
|
+
return document.querySelectorAll(
|
|
82
|
+
"ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"
|
|
83
|
+
).forEach((r) => {
|
|
84
|
+
typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
|
|
85
|
+
}), this.emit("drawer:fechado-todos"), !0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Dispara uma notificação toast flutuante inteligente.
|
|
89
|
+
*/
|
|
90
|
+
notificar(e) {
|
|
91
|
+
typeof e == "string" ? A.notificar({ mensagem: e, tipo: "info" }) : A.notificar(e);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Copia um texto para a área de transferência do usuário e exibe feedback opcional.
|
|
95
|
+
*/
|
|
96
|
+
async copiar(e, t) {
|
|
97
|
+
if (typeof navigator > "u" || !navigator.clipboard)
|
|
98
|
+
return !1;
|
|
99
|
+
try {
|
|
100
|
+
return await navigator.clipboard.writeText(e), t !== void 0 && this.notificar({
|
|
101
|
+
tipo: "sucesso",
|
|
102
|
+
mensagem: t || "Copiado para a área de transferência!"
|
|
103
|
+
}), this.emit("clipboard:copiado", { texto: e }), !0;
|
|
104
|
+
} catch (r) {
|
|
105
|
+
return console.error("[UIBus] Falha ao copiar texto:", r), this.notificar({
|
|
106
|
+
tipo: "erro",
|
|
107
|
+
mensagem: "Não foi possível copiar o texto."
|
|
108
|
+
}), !1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Altera a densidade visual global do kit (compacta, normal ou relaxada).
|
|
113
|
+
*/
|
|
114
|
+
definirDensidade(e) {
|
|
115
|
+
let t = 34;
|
|
116
|
+
typeof e == "number" ? t = Math.max(15, e) : e === "compacta" ? t = 26 : e === "relaxada" ? t = 42 : t = 34, !(typeof document > "u") && (document.documentElement.style.setProperty("--ui-altura-minima", `${t}px`), document.documentElement.style.setProperty("--ui-campo-altura", `${t}px`), document.documentElement.setAttribute("data-ui-densidade", typeof e == "string" ? e : "custom"), this.emit("densidade:alterada", { densidade: e, alturaPx: t }));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Alterna ou define o tema visual global.
|
|
120
|
+
*/
|
|
121
|
+
definirTema(e) {
|
|
122
|
+
if (typeof document > "u") return e || "escuro";
|
|
123
|
+
const t = document.documentElement;
|
|
124
|
+
let r = t.getAttribute("data-tema");
|
|
125
|
+
r || (r = t.classList.contains("dark") ? "escuro" : t.classList.contains("light") ? "claro" : "escuro");
|
|
126
|
+
const n = e || (r === "escuro" ? "claro" : "escuro");
|
|
127
|
+
return t.setAttribute("data-tema", n), n === "escuro" ? (t.classList.add("dark"), t.classList.remove("light")) : (t.classList.remove("dark"), t.classList.add("light")), this.emit("tema:alterado", { tema: n }), n;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const s = new E();
|
|
131
|
+
let y = !1;
|
|
132
|
+
function B() {
|
|
133
|
+
y || typeof document > "u" || (y = !0, document.addEventListener("click", (f) => {
|
|
134
|
+
const e = f.composedPath ? f.composedPath() : [f.target], t = "[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";
|
|
135
|
+
let r = null;
|
|
136
|
+
for (const a of e)
|
|
137
|
+
if (a instanceof HTMLElement && a.matches(t)) {
|
|
138
|
+
r = a;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (!r) return;
|
|
142
|
+
const n = r.getAttribute("target-modal") || r.getAttribute("modal-alvo");
|
|
143
|
+
if (n && s.abrirModal(n), r.hasAttribute("dismiss-modal") || r.hasAttribute("fechar-modal")) {
|
|
144
|
+
const a = r.getAttribute("dismiss-modal") || r.getAttribute("fechar-modal");
|
|
145
|
+
if (a && a !== "")
|
|
146
|
+
s.fecharModal(a);
|
|
147
|
+
else {
|
|
148
|
+
let i = null;
|
|
149
|
+
for (const o of e)
|
|
150
|
+
if (o instanceof HTMLElement && (o.matches("ui-modal, ui-dialog") || o.tagName === "UI-MODAL" || o.tagName === "UI-DIALOG")) {
|
|
151
|
+
i = o;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
i && (typeof i.fechar == "function" ? i.fechar() : (i.removeAttribute("aberto"), i.removeAttribute("open")));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const c = r.getAttribute("target-drawer") || r.getAttribute("drawer-alvo");
|
|
158
|
+
if (c && s.abrirDrawer(c), r.hasAttribute("dismiss-drawer") || r.hasAttribute("fechar-drawer")) {
|
|
159
|
+
const a = r.getAttribute("dismiss-drawer") || r.getAttribute("fechar-drawer");
|
|
160
|
+
if (a && a !== "")
|
|
161
|
+
s.fecharDrawer(a);
|
|
162
|
+
else {
|
|
163
|
+
let i = null;
|
|
164
|
+
for (const o of e)
|
|
165
|
+
if (o instanceof HTMLElement && (o.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta") || o.tagName.startsWith("UI-DRAWER") || o.tagName.startsWith("UI-SHEET"))) {
|
|
166
|
+
i = o;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
i && (typeof i.fechar == "function" ? i.fechar() : (i.removeAttribute("aberto"), i.removeAttribute("open")));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const l = r.getAttribute("toast-sucesso");
|
|
173
|
+
l && s.notificar({ tipo: "sucesso", mensagem: l });
|
|
174
|
+
const m = r.getAttribute("toast-erro");
|
|
175
|
+
m && s.notificar({ tipo: "erro", mensagem: m });
|
|
176
|
+
const d = r.getAttribute("toast-alerta");
|
|
177
|
+
d && s.notificar({ tipo: "alerta", mensagem: d });
|
|
178
|
+
const h = r.getAttribute("toast-info");
|
|
179
|
+
h && s.notificar({ tipo: "info", mensagem: h });
|
|
180
|
+
const u = r.getAttribute("copiar-texto");
|
|
181
|
+
if (u !== null) {
|
|
182
|
+
let a = u;
|
|
183
|
+
if (u.startsWith("#") || u.startsWith(".") || u.match(/^[a-zA-Z0-9_-]+$/))
|
|
184
|
+
try {
|
|
185
|
+
let o = null;
|
|
186
|
+
u.startsWith("#") || u.startsWith(".") ? o = document.querySelector(u) : o = document.getElementById(u) || document.querySelector(`#${u}`), o && (a = o.value !== void 0 && o.value !== null ? o.value : o.textContent || "");
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
const i = r.getAttribute("copiar-mensagem") || "Copiado com sucesso!";
|
|
190
|
+
s.copiar(a, i);
|
|
191
|
+
}
|
|
192
|
+
r.hasAttribute("alternar-tema") && s.definirTema();
|
|
193
|
+
const p = r.getAttribute("definir-densidade");
|
|
194
|
+
p && s.definirDensidade(p);
|
|
195
|
+
const b = r.getAttribute("limpar-form");
|
|
196
|
+
if (b) {
|
|
197
|
+
const a = document.getElementById(b);
|
|
198
|
+
a && typeof a.reset == "function" && (a.reset(), s.notificar({ tipo: "info", mensagem: "Formulário limpo." }));
|
|
199
|
+
}
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
export {
|
|
203
|
+
s as U,
|
|
204
|
+
B as i
|
|
205
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var v=(u,e,t)=>e in u?w(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var g=(u,e,t)=>v(u,typeof e!="symbol"?e+"":e,t);const A=require("./ui-toast-CQBqvUm3.cjs");class E{constructor(){g(this,"listeners",new Map)}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const r=n=>{this.off(e,r),t(n)};this.on(e,r)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}emit(e,t){const r=this.listeners.get(e);r&&r.forEach(n=>{try{n(t)}catch(f){console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,f)}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(`uibus:${e}`,{detail:t,bubbles:!0,composed:!0}))}abrirModal(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("modal:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("modal:aberto",{id:e}),!0):(console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`),!1)}fecharModal(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("modal:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("modal:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("modal:fechado-todos"),!0}abrirDrawer(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("drawer:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("drawer:aberto",{id:e}),!0):(console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`),!1)}fecharDrawer(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("drawer:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("drawer:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("drawer:fechado-todos"),!0}notificar(e){typeof e=="string"?A.UIToast.notificar({mensagem:e,tipo:"info"}):A.UIToast.notificar(e)}async copiar(e,t){if(typeof navigator>"u"||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),t!==void 0&&this.notificar({tipo:"sucesso",mensagem:t||"Copiado para a área de transferência!"}),this.emit("clipboard:copiado",{texto:e}),!0}catch(r){return console.error("[UIBus] Falha ao copiar texto:",r),this.notificar({tipo:"erro",mensagem:"Não foi possível copiar o texto."}),!1}}definirDensidade(e){let t=34;typeof e=="number"?t=Math.max(15,e):e==="compacta"?t=26:e==="relaxada"?t=42:t=34,!(typeof document>"u")&&(document.documentElement.style.setProperty("--ui-altura-minima",`${t}px`),document.documentElement.style.setProperty("--ui-campo-altura",`${t}px`),document.documentElement.setAttribute("data-ui-densidade",typeof e=="string"?e:"custom"),this.emit("densidade:alterada",{densidade:e,alturaPx:t}))}definirTema(e){if(typeof document>"u")return e||"escuro";const t=document.documentElement;let r=t.getAttribute("data-tema");r||(r=t.classList.contains("dark")?"escuro":t.classList.contains("light")?"claro":"escuro");const n=e||(r==="escuro"?"claro":"escuro");return t.setAttribute("data-tema",n),n==="escuro"?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.remove("dark"),t.classList.add("light")),this.emit("tema:alterado",{tema:n}),n}}const s=new E;let y=!1;function I(){y||typeof document>"u"||(y=!0,document.addEventListener("click",u=>{const e=u.composedPath?u.composedPath():[u.target],t="[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";let r=null;for(const a of e)if(a instanceof HTMLElement&&a.matches(t)){r=a;break}if(!r)return;const n=r.getAttribute("target-modal")||r.getAttribute("modal-alvo");if(n&&s.abrirModal(n),r.hasAttribute("dismiss-modal")||r.hasAttribute("fechar-modal")){const a=r.getAttribute("dismiss-modal")||r.getAttribute("fechar-modal");if(a&&a!=="")s.fecharModal(a);else{let i=null;for(const o of e)if(o instanceof HTMLElement&&(o.matches("ui-modal, ui-dialog")||o.tagName==="UI-MODAL"||o.tagName==="UI-DIALOG")){i=o;break}i&&(typeof i.fechar=="function"?i.fechar():(i.removeAttribute("aberto"),i.removeAttribute("open")))}}const f=r.getAttribute("target-drawer")||r.getAttribute("drawer-alvo");if(f&&s.abrirDrawer(f),r.hasAttribute("dismiss-drawer")||r.hasAttribute("fechar-drawer")){const a=r.getAttribute("dismiss-drawer")||r.getAttribute("fechar-drawer");if(a&&a!=="")s.fecharDrawer(a);else{let i=null;for(const o of e)if(o instanceof HTMLElement&&(o.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta")||o.tagName.startsWith("UI-DRAWER")||o.tagName.startsWith("UI-SHEET"))){i=o;break}i&&(typeof i.fechar=="function"?i.fechar():(i.removeAttribute("aberto"),i.removeAttribute("open")))}}const l=r.getAttribute("toast-sucesso");l&&s.notificar({tipo:"sucesso",mensagem:l});const m=r.getAttribute("toast-erro");m&&s.notificar({tipo:"erro",mensagem:m});const d=r.getAttribute("toast-alerta");d&&s.notificar({tipo:"alerta",mensagem:d});const h=r.getAttribute("toast-info");h&&s.notificar({tipo:"info",mensagem:h});const c=r.getAttribute("copiar-texto");if(c!==null){let a=c;if(c.startsWith("#")||c.startsWith(".")||c.match(/^[a-zA-Z0-9_-]+$/))try{let o=null;c.startsWith("#")||c.startsWith(".")?o=document.querySelector(c):o=document.getElementById(c)||document.querySelector(`#${c}`),o&&(a=o.value!==void 0&&o.value!==null?o.value:o.textContent||"")}catch{}const i=r.getAttribute("copiar-mensagem")||"Copiado com sucesso!";s.copiar(a,i)}r.hasAttribute("alternar-tema")&&s.definirTema();const p=r.getAttribute("definir-densidade");p&&s.definirDensidade(p);const b=r.getAttribute("limpar-form");if(b){const a=document.getElementById(b);a&&typeof a.reset=="function"&&(a.reset(),s.notificar({tipo:"info",mensagem:"Formulário limpo."}))}}))}exports.UIBus=s;exports.initZeroJSTriggers=I;
|
package/package.json
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thibezer/ui-components-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Web Components nativos (W3C Custom Elements + Shadow DOM) para interfaces densas de GIS, CAD e formulários, sem dependência de framework.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"web-components",
|
|
7
|
+
"custom-elements",
|
|
8
|
+
"shadow-dom",
|
|
9
|
+
"ui-kit",
|
|
10
|
+
"design-system",
|
|
11
|
+
"gis",
|
|
12
|
+
"cad",
|
|
13
|
+
"leaflet",
|
|
14
|
+
"form-associated"
|
|
15
|
+
],
|
|
16
|
+
"author": "thibezer",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://github.com/thibezer/Componentes-UI#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/thibezer/Componentes-UI.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/thibezer/Componentes-UI/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.cjs",
|
|
28
|
+
"module": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"style": "./dist/ui-kit.css",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js",
|
|
38
|
+
"require": "./dist/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./camadas": {
|
|
41
|
+
"types": "./dist/camadas.d.ts",
|
|
42
|
+
"import": "./dist/camadas.js",
|
|
43
|
+
"require": "./dist/camadas.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./forms": {
|
|
46
|
+
"types": "./dist/forms.d.ts",
|
|
47
|
+
"import": "./dist/forms.js",
|
|
48
|
+
"require": "./dist/forms.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./feedback": {
|
|
51
|
+
"types": "./dist/feedback.d.ts",
|
|
52
|
+
"import": "./dist/feedback.js",
|
|
53
|
+
"require": "./dist/feedback.cjs"
|
|
54
|
+
},
|
|
55
|
+
"./tabela": {
|
|
56
|
+
"types": "./dist/tabela.d.ts",
|
|
57
|
+
"import": "./dist/tabela.js",
|
|
58
|
+
"require": "./dist/tabela.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./style.css": "./dist/ui-kit.css",
|
|
61
|
+
"./ui-kit.css": "./dist/ui-kit.css",
|
|
62
|
+
"./register": {
|
|
63
|
+
"types": "./dist/register.d.ts",
|
|
64
|
+
"import": "./dist/register.js",
|
|
65
|
+
"require": "./dist/register.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./core": {
|
|
68
|
+
"types": "./dist/core/index.d.ts",
|
|
69
|
+
"import": "./dist/core.js",
|
|
70
|
+
"require": "./dist/core.cjs"
|
|
71
|
+
},
|
|
72
|
+
"./data": {
|
|
73
|
+
"types": "./dist/data.d.ts",
|
|
74
|
+
"import": "./dist/data.js",
|
|
75
|
+
"require": "./dist/data.cjs"
|
|
76
|
+
},
|
|
77
|
+
"./tools": {
|
|
78
|
+
"types": "./dist/tools.d.ts",
|
|
79
|
+
"import": "./dist/tools.js",
|
|
80
|
+
"require": "./dist/tools.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./mapa": {
|
|
83
|
+
"types": "./dist/mapa.d.ts",
|
|
84
|
+
"import": "./dist/mapa.js",
|
|
85
|
+
"require": "./dist/mapa.cjs"
|
|
86
|
+
},
|
|
87
|
+
"./canvas": {
|
|
88
|
+
"types": "./dist/canvas.d.ts",
|
|
89
|
+
"import": "./dist/canvas.js",
|
|
90
|
+
"require": "./dist/canvas.cjs"
|
|
91
|
+
},
|
|
92
|
+
"./botao": {
|
|
93
|
+
"types": "./dist/botao.d.ts",
|
|
94
|
+
"import": "./dist/botao.js",
|
|
95
|
+
"require": "./dist/botao.cjs"
|
|
96
|
+
},
|
|
97
|
+
"./campo-texto": {
|
|
98
|
+
"types": "./dist/campo-texto.d.ts",
|
|
99
|
+
"import": "./dist/campo-texto.js",
|
|
100
|
+
"require": "./dist/campo-texto.cjs"
|
|
101
|
+
},
|
|
102
|
+
"./modal": {
|
|
103
|
+
"types": "./dist/modal.d.ts",
|
|
104
|
+
"import": "./dist/modal.js",
|
|
105
|
+
"require": "./dist/modal.cjs"
|
|
106
|
+
},
|
|
107
|
+
"./card": {
|
|
108
|
+
"types": "./dist/card.d.ts",
|
|
109
|
+
"import": "./dist/card.js",
|
|
110
|
+
"require": "./dist/card.cjs"
|
|
111
|
+
},
|
|
112
|
+
"./seletor-mapa-base": {
|
|
113
|
+
"types": "./dist/seletor-mapa-base.d.ts",
|
|
114
|
+
"import": "./dist/seletor-mapa-base.js",
|
|
115
|
+
"require": "./dist/seletor-mapa-base.cjs"
|
|
116
|
+
},
|
|
117
|
+
"./package.json": "./package.json"
|
|
118
|
+
},
|
|
119
|
+
"scripts": {
|
|
120
|
+
"dev": "vite",
|
|
121
|
+
"build": "tsc && vite build",
|
|
122
|
+
"test": "vitest run",
|
|
123
|
+
"test:coverage": "vitest run --coverage",
|
|
124
|
+
"preview": "vite preview",
|
|
125
|
+
"prepublishOnly": "npm test && npm run build"
|
|
126
|
+
},
|
|
127
|
+
"peerDependencies": {
|
|
128
|
+
"leaflet": "^1.9.4"
|
|
129
|
+
},
|
|
130
|
+
"peerDependenciesMeta": {
|
|
131
|
+
"leaflet": {
|
|
132
|
+
"optional": true
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"devDependencies": {
|
|
136
|
+
"@types/leaflet": "^1.9.22",
|
|
137
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
138
|
+
"element-internals-polyfill": "^3.0.2",
|
|
139
|
+
"happy-dom": "^20.11.1",
|
|
140
|
+
"leaflet": "^1.9.4",
|
|
141
|
+
"typescript": "^5.0.0",
|
|
142
|
+
"vite": "^5.0.0",
|
|
143
|
+
"vite-plugin-dts": "^5.0.3",
|
|
144
|
+
"vitest": "^4.1.10"
|
|
145
|
+
},
|
|
146
|
+
"publishConfig": {
|
|
147
|
+
"access": "public"
|
|
148
|
+
}
|
|
149
|
+
}
|