@thibezer/ui-components-kit 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/LICENSE +21 -21
- package/README.md +150 -14
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +65 -65
- package/dist/camadas.js +762 -729
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +105 -146
- package/dist/canvas.js +5132 -1199
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-botao/ui-botao.d.ts +15 -0
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +4 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +10 -0
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-estilos-externos.d.ts +16 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +4 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +262 -0
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +32 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +1 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +143 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +1 -0
- package/dist/components/ui-modal/modal-pilha.d.ts +3 -0
- package/dist/components/ui-modal/ui-modal.d.ts +19 -4
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-corpo.d.ts +2 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +8 -1
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-renderizador.d.ts +1 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +21 -6
- package/dist/components/ui-tabela/tipos.d.ts +6 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +56 -2
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +0 -5
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +17 -1
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +10 -1
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +3 -1
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +5 -1
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +15 -0
- package/dist/core/alvo-digitavel.d.ts +1 -0
- package/dist/core/form-submissao.d.ts +16 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/parts.d.ts +6 -0
- package/dist/core/rotulo.d.ts +6 -0
- package/dist/core/svg-seguro.d.ts +10 -0
- package/dist/core/ui-bus.d.ts +13 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +14 -12
- package/dist/custom-elements.json +32905 -0
- package/dist/data.cjs +1 -1
- package/dist/data.js +51 -46
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +3 -3
- package/dist/form-submissao-C-SPRKgT.js +61 -0
- package/dist/form-submissao-DxKO5MHI.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +18 -0
- package/dist/gerencigeo-canvas/feature_adapters.d.ts +35 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +45 -0
- package/dist/gerencigeo-canvas/feature_amostra.d.ts +4 -0
- package/dist/gerencigeo-canvas/feature_caixa.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_cluster.d.ts +61 -0
- package/dist/gerencigeo-canvas/feature_cursores.d.ts +17 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +53 -0
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +91 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +62 -0
- package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_hud.d.ts +23 -0
- package/dist/gerencigeo-canvas/feature_indice.d.ts +36 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +16 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +31 -0
- package/dist/gerencigeo-canvas/feature_selecao.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +14 -0
- package/dist/gerencigeo-canvas/feature_snap.d.ts +25 -0
- package/dist/gerencigeo-canvas/feature_types.d.ts +86 -0
- package/dist/gerencigeo-canvas/feature_versoes.d.ts +19 -0
- package/dist/gerencigeo-canvas/index.d.ts +21 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +30 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +11 -3
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +1 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +24 -5
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +89 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +1 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +2 -2
- package/dist/gerencigeo-canvas/types.d.ts +12 -0
- package/dist/gerencigeo-canvas/utils.d.ts +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +117 -112
- package/dist/leaflet-DcO7uRC-.cjs +1 -0
- package/dist/{leaflet-DkaFZYc5.js → leaflet-PPDKB6Dd.js} +37 -37
- package/dist/mapa.cjs +4 -4
- package/dist/mapa.js +2 -2
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/parts-CaoQiCfI.js +7 -0
- package/dist/parts-vQa2873h.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +12 -12
- package/dist/seletor-mapa-base.cjs +16 -16
- package/dist/seletor-mapa-base.js +111 -61
- package/dist/svg-seguro-BsbNQqpd.js +50 -0
- package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +41 -36
- package/dist/tipos-elementos.d.ts +1232 -0
- package/dist/tipos-react.d.ts +113 -0
- package/dist/tipos-vue.d.ts +1201 -0
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BxT-sDmV.cjs +28 -0
- package/dist/ui-badge-C0eKBI8E.js +183 -0
- package/dist/ui-botao-OGJV6Vfk.js +165 -0
- package/dist/ui-botao-psS1juof.cjs +12 -0
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
- package/dist/{ui-campo-texto-B_JF6POq.js → ui-campo-texto-Uu2dJE_0.js} +81 -63
- package/dist/{ui-card-Bhm6k91e.cjs → ui-card-B86lJXTP.cjs} +7 -7
- package/dist/{ui-card-BJ8SmvVf.js → ui-card-C_o5_0cB.js} +14 -14
- package/dist/ui-kit.css +1 -1
- package/dist/ui-modal-CvGFGh1h.cjs +18 -0
- package/dist/ui-modal-DBOtSTbR.js +238 -0
- package/dist/{ui-paleta-ferramentas-Bpp4XBVg.js → ui-paleta-ferramentas-CEZYcN4J.js} +18 -27
- package/dist/{ui-paleta-ferramentas-B6dJ0O6K.cjs → ui-paleta-ferramentas-Dbj1kBS9.cjs} +6 -6
- package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
- package/dist/{ui-segmented-C8wuycjJ.js → ui-segmented-wUraId2e.js} +68 -67
- package/dist/ui-skeleton-DI4_9WOX.js +428 -0
- package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
- package/dist/{ui-switch-CO9MoS8x.js → ui-switch-BcOqOkiV.js} +92 -62
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
- package/dist/{ui-toast-CwUmiqyG.js → ui-toast-Bp_NlM5G.js} +51 -51
- package/dist/ui-toast-DGTZKne5.cjs +20 -0
- package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
- package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
- package/package.json +27 -7
- package/dist/leaflet-Cw6tqYFh.cjs +0 -1
- package/dist/ui-badge-92yelKls.js +0 -183
- package/dist/ui-badge-B95jSECC.cjs +0 -28
- package/dist/ui-botao-BShEouvi.js +0 -124
- package/dist/ui-botao-DF1yuUUD.cjs +0 -12
- package/dist/ui-campo-texto-BCh5HyCM.cjs +0 -16
- package/dist/ui-modal-Bi4isGYh.cjs +0 -18
- package/dist/ui-modal-DV-pw2x1.js +0 -194
- package/dist/ui-segmented-NC5cBXLh.cjs +0 -19
- package/dist/ui-skeleton-B3xQyn0Z.js +0 -396
- package/dist/ui-skeleton-D42oQufF.cjs +0 -33
- package/dist/ui-switch-C6o4yZUF.cjs +0 -53
- package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +0 -145
- package/dist/ui-tabela-propriedades-D-XKNVwK.js +0 -2078
- package/dist/ui-toast-CQBqvUm3.cjs +0 -20
- package/dist/zero-js-triggers-DdESy0tk.js +0 -205
- package/dist/zero-js-triggers-QGD7FOTv.cjs +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";var E=Object.defineProperty;var A=(s,n,t)=>n in s?E(s,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[n]=t;var u=(s,n,t)=>A(s,typeof n!="symbol"?n+"":n,t);const d=require("./ssr-safe-CiHD1adl.cjs"),w=require("./listener-bag-D5omxZ9h.cjs"),S=require("./ui-campo-texto-Cnn2UAkS.cjs"),z=require("./parts-vQa2873h.cjs"),k=':host{display:block;box-sizing:border-box;margin:0;padding:0;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){display:inline-block}.ui-texto{margin:0;padding:0;box-sizing:border-box;font-family:inherit;color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.ui-texto--h1{font-size:var(--ui-tamanho-h1, clamp(24px, 4vw, 36px));font-weight:var(--ui-peso-negrito, 700);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.5px}.ui-texto--h2{font-size:var(--ui-tamanho-h2, clamp(20px, 3vw, 28px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.3px}.ui-texto--h3{font-size:var(--ui-tamanho-h3, clamp(18px, 2.4vw, 24px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h4{font-size:var(--ui-tamanho-h4, clamp(16px, 2vw, 20px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h5{font-size:var(--ui-tamanho-h5, clamp(14px, 1.6vw, 18px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h6{font-size:var(--ui-tamanho-h6, clamp(13px, 1.2vw, 16px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);text-transform:uppercase;letter-spacing:.5px}.ui-texto--corpo{font-size:var(--ui-tamanho-corpo, 14px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--corpo-sm{font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--caption{font-size:var(--ui-tamanho-caption, 11px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-compacta, 1.2);color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--codigo{font-family:var(--ui-fonte-codigo, monospace);font-size:var(--ui-tamanho-codigo, 12px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5);background:var(--ui-cor-fundo-elevado, #1a1a1e);padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-texto--cor-primaria{color:var(--ui-cor-primaria, #00E08A)}.ui-texto--cor-secundaria{color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--cor-destaque{color:var(--ui-cor-destaque, #00E08A)}.ui-texto--cor-erro{color:var(--ui-cor-texto-erro, #ff5555)}.ui-texto--cor-sucesso{color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-texto--cor-alerta{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-texto--peso-normal{font-weight:var(--ui-peso-normal, 400)!important}.ui-texto--peso-medio{font-weight:var(--ui-peso-medio, 500)!important}.ui-texto--peso-seminegrito{font-weight:var(--ui-peso-seminegrito, 600)!important}.ui-texto--peso-negrito{font-weight:var(--ui-peso-negrito, 700)!important}.ui-texto--alinhamento-esquerda{text-align:left}.ui-texto--alinhamento-centro{text-align:center}.ui-texto--alinhamento-direita{text-align:right}.ui-texto--alinhamento-justificado{text-align:justify}.ui-texto--truncar{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}',C=new Set(["p","span","div","h1","h2","h3","h4","h5","h6","small","code","strong","em","label","blockquote","pre","b","i"]);class m extends d.SafeHTMLElement{constructor(){super();u(this,"container");u(this,"shadow");typeof this.attachShadow=="function"&&typeof document<"u"?(this.shadow=this.attachShadow({mode:"open"}),this.container=document.createElement("p"),this.container.className="ui-texto ui-texto--corpo",this.container.appendChild(document.createElement("slot")),this.shadow.innerHTML=`<style>${k}</style>`,this.shadow.appendChild(this.container)):(this.shadow=null,this.container=null)}static get observedAttributes(){return["variante","tag","cor","peso","alinhamento","truncar"]}connectedCallback(){this.render()}attributeChangedCallback(t,i,e){this.render()}resolveTag(){const t=this.getAttribute("tag");if(t){const e=t.toLowerCase().trim();if(C.has(e))return e;console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`)}const i=(this.getAttribute("variante")||"corpo").toLowerCase();switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return i;case"caption":return"small";case"codigo":return"code";case"corpo-sm":case"corpo":default:return"p"}}render(){const t=this.resolveTag(),i=this.getAttribute("variante")||"corpo",e=this.getAttribute("cor"),a=this.getAttribute("peso"),r=this.getAttribute("alinhamento"),o=this.hasAttribute("truncar");if(this.container.tagName.toLowerCase()!==t){const c=document.createElement(t);c.appendChild(document.createElement("slot")),this.shadow.replaceChild(c,this.container),this.container=c}const l=["ui-texto",`ui-texto--${i}`];e&&l.push(`ui-texto--cor-${e}`),a&&l.push(`ui-texto--peso-${a}`),r&&l.push(`ui-texto--alinhamento-${r}`),o&&l.push("ui-texto--truncar"),this.container.className=l.join(" ")}}d.definirCustomElement("ui-texto",m);const I=':host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle;position:relative}.ui-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-tamanho-avatar, 36px);height:var(--ui-tamanho-avatar, 36px);min-width:var(--ui-tamanho-avatar, 36px);min-height:var(--ui-tamanho-avatar, 36px);border-radius:50%;background-color:var(--ui-cor-fundo-elevado, #22222a);color:var(--ui-cor-primaria, #00E08A);font-weight:600;font-size:var(--ui-avatar-font-size, 14px);-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));line-height:1}.ui-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.ui-avatar--quadrado{border-radius:8px}.ui-avatar__status{position:absolute;bottom:0;right:0;width:25%;height:25%;min-width:8px;min-height:8px;max-width:14px;max-height:14px;border-radius:50%;border:2px solid var(--ui-cor-fundo-card, #121214);box-sizing:border-box}.ui-avatar__status--online{background-color:var(--ui-cor-primaria, #00E08A)}.ui-avatar__status--offline{background-color:#889}.ui-avatar__status--ausente{background-color:#ffb86c}.ui-avatar__status--ocupado{background-color:#f55}.ui-avatar--xs{--ui-tamanho-avatar: 20px;--ui-avatar-font-size: 10px}.ui-avatar--sm{--ui-tamanho-avatar: 28px;--ui-avatar-font-size: 11px}.ui-avatar--md{--ui-tamanho-avatar: 36px;--ui-avatar-font-size: 14px}.ui-avatar--lg{--ui-tamanho-avatar: 48px;--ui-avatar-font-size: 18px}.ui-avatar--xl{--ui-tamanho-avatar: 64px;--ui-avatar-font-size: 24px}';class p extends d.SafeHTMLElement{constructor(){super();u(this,"avatarElement");u(this,"statusElement");const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
+
<style>${I}</style>
|
|
3
|
+
<div class="ui-avatar">
|
|
4
|
+
<span class="ui-avatar__content"></span>
|
|
5
|
+
</div>
|
|
6
|
+
<span class="ui-avatar__status" style="display: none;"></span>
|
|
7
|
+
`,this.avatarElement=t.querySelector(".ui-avatar"),this.statusElement=t.querySelector(".ui-avatar__status")}static get observedAttributes(){return["src","nome","name","tamanho","size","formato","status"]}connectedCallback(){this.syncState()}attributeChangedCallback(t,i,e){this.syncState()}extrairIniciais(t){const i=t.trim().split(/\s+/).filter(Boolean);if(i.length===0)return"?";if(i.length===1)return i[0].substring(0,2).toUpperCase();const e=i[0][0],a=i[i.length-1][0];return(e+a).toUpperCase()}syncState(){const t=this.getAttribute("src"),i=this.getAttribute("nome")||this.getAttribute("name")||"",e=this.getAttribute("tamanho")||this.getAttribute("size")||"md",a=this.getAttribute("formato")||"circulo",r=this.getAttribute("status");this.avatarElement.className="ui-avatar",["xs","sm","md","lg","xl"].includes(e)?(this.avatarElement.classList.add(`ui-avatar--${e}`),this.avatarElement.style.removeProperty("--ui-tamanho-avatar")):isNaN(parseInt(e,10))?this.avatarElement.style.removeProperty("--ui-tamanho-avatar"):this.avatarElement.style.setProperty("--ui-tamanho-avatar",`${parseInt(e,10)}px`),a==="quadrado"&&this.avatarElement.classList.add("ui-avatar--quadrado");const o=this.avatarElement.querySelector(".ui-avatar__content");if(o)if(t){const l=o.querySelector("img");if(l&&l.getAttribute("src")===t)l.alt=i||"Avatar";else{o.textContent="";const c=document.createElement("img");c.className="ui-avatar__img",c.src=t,c.alt=i||"Avatar",c.onerror=()=>{this.renderFallback(o,i)},o.appendChild(c)}}else o.textContent="",this.renderFallback(o,i);r&&["online","offline","ausente","ocupado"].includes(r)?(this.statusElement.className=`ui-avatar__status ui-avatar__status--${r}`,this.statusElement.style.display="block"):this.statusElement.style.display="none"}renderFallback(t,i){i?t.textContent=this.extrairIniciais(i):t.innerHTML=`
|
|
8
|
+
<svg viewBox="0 0 24 24" width="60%" height="60%" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
9
|
+
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
|
|
10
|
+
<circle cx="12" cy="7" r="4"></circle>
|
|
11
|
+
</svg>
|
|
12
|
+
`}}d.definirCustomElement("ui-avatar",p);class g{constructor(n,t){u(this,"rafId",null);u(this,"resizeObserver");this.trackElement=n,this.indicadorElement=t}iniciarObserver(n,t){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>{this.atualizar(),t&&t()}),this.resizeObserver.observe(n))}destruir(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}atualizar(){this.rafId!==null&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.rafId=null;const n=this.trackElement.querySelector(".ui-segmented__item--ativo");if(!n){this.indicadorElement.style.opacity="0";return}const t=Math.round(n.offsetLeft),i=Math.round(n.offsetWidth);this.indicadorElement.style.transform=`translateX(${t}px)`,this.indicadorElement.style.width=`${i}px`,this.indicadorElement.style.opacity="1"})}}function v(s,n,t,i){if(t)return;const e=Array.from(n.querySelectorAll(".ui-segmented__item:not(:disabled)"));if(e.length===0)return;const a=e.findIndex(l=>l.classList.contains("ui-segmented__item--ativo"));let r=a;if(s.key==="ArrowRight"||s.key==="ArrowDown")s.preventDefault(),r=(a+1)%e.length;else if(s.key==="ArrowLeft"||s.key==="ArrowUp")s.preventDefault(),r=(a-1+e.length)%e.length;else if(s.key==="Home")s.preventDefault(),r=0;else if(s.key==="End")s.preventDefault(),r=e.length-1;else return;const o=e[r];if(o&&o.dataset.indice){const l=parseInt(o.dataset.indice,10);i(l)}}const q=':host{display:inline-block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-segmented{display:inline-flex;position:relative;background-color:var(--ui-cor-fundo, #0b0b0d);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);padding:3px;box-sizing:border-box;-webkit-user-select:none;user-select:none;gap:2px;align-items:center}.ui-segmented--full{display:flex;width:100%}.ui-segmented--full .ui-segmented__item{flex:1}.ui-segmented--sm{padding:2px;height:28px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px;height:22px}.ui-segmented--md{padding:3px;height:36px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px;height:28px}.ui-segmented--lg{padding:4px;height:42px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px;height:32px}.ui-segmented__indicador{position:absolute;top:3px;bottom:3px;left:0;background-color:var(--ui-cor-fundo-card, #1e1e24);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:calc(var(--ui-raio-borda, 8px) - 2px);box-shadow:var(--ui-sombra-sm, 0 2px 8px rgba(0, 0, 0, .4));pointer-events:none;transition:transform .22s cubic-bezier(.16,1,.3,1),width .22s cubic-bezier(.16,1,.3,1),opacity .15s ease;z-index:1;opacity:0}.ui-segmented--sm .ui-segmented__indicador{top:2px;bottom:2px}.ui-segmented--lg .ui-segmented__indicador{top:4px;bottom:4px}.ui-segmented__item{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-weight:500;cursor:pointer;border-radius:calc(var(--ui-raio-borda, 8px) - 2px);line-height:1;white-space:nowrap;transition:color .15s ease;box-sizing:border-box}.ui-segmented__item:hover:not(:disabled){color:var(--ui-cor-texto, #e1e1e6)}.ui-segmented__item--ativo{color:var(--ui-cor-texto, #ffffff)!important;font-weight:600}.ui-segmented__item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-segmented__item:disabled{opacity:.35;cursor:not-allowed}.ui-segmented__icone{display:inline-flex;align-items:center;justify-content:center;line-height:1}.ui-segmented__icone ui-icone,.ui-segmented__icone svg{shape-rendering:geometricPrecision;display:inline-flex;align-items:center;justify-content:center}',f=["valor","value","name","disabled","tamanho","size","largura-total","full-width","obrigatorio","required","mensagem-validacao"];function b(){return`
|
|
13
|
+
<style>${q}</style>
|
|
14
|
+
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
15
|
+
<div class="ui-segmented__indicador" part="indicador"></div>
|
|
16
|
+
<div class="ui-segmented__track" style="display: contents;"></div>
|
|
17
|
+
<slot style="display: none;"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
`}function x(s,n,t,i,e){const a=document.createElement("button");a.type="button",a.role="radio",a.className="ui-segmented__item",a.setAttribute("part",s.valor===t?"opcao opcao-selecionada":"opcao"),a.dataset.valor=s.valor,a.dataset.indice=String(n);const r=s.valor===t;if(a.setAttribute("aria-checked",String(r)),a.tabIndex=r?0:-1,r&&a.classList.add("ui-segmented__item--ativo"),(i||s.disabled)&&(a.disabled=!0),s.icone){const l=document.createElement("span");l.className="ui-segmented__icone";const c=document.createElement("ui-icone");c.setAttribute("nome",s.icone),c.setAttribute("tamanho","14"),l.appendChild(c),a.appendChild(l)}const o=document.createElement("span");return o.className="ui-segmented__texto",o.textContent=s.rotulo,a.appendChild(o),a.addEventListener("click",l=>{l.stopPropagation(),e()}),a}class h extends S.FormAssociatedElement{constructor(){super();u(this,"rootElement");u(this,"trackElement");u(this,"indicadorElement");u(this,"slotElement");u(this,"_opcoes",[]);u(this,"_defaultValue","");u(this,"listeners",new w.ListenerBag);u(this,"indicadorController");u(this,"handleSlotChange",()=>{this._opcoes.length===0&&this.carregarOpcoes()});u(this,"handleKeyDown",t=>{v(t,this.trackElement,this.disabled,i=>{this.selecionarIndice(i)})});const t=this.attachShadow({mode:"open"});t.innerHTML=b(),this.rootElement=t.querySelector(".ui-segmented"),this.indicadorElement=t.querySelector(".ui-segmented__indicador"),this.trackElement=t.querySelector(".ui-segmented__track"),this.slotElement=t.querySelector("slot"),this.indicadorController=new g(this.trackElement,this.indicadorElement)}static get observedAttributes(){return f}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.rootElement,"keydown",this.handleKeyDown),this.listeners.add(this.slotElement,"slotchange",this.handleSlotChange),this._defaultValue||(this._defaultValue=this.getAttribute("valor")||this.getAttribute("value")||""),this.indicadorController.iniciarObserver(this.rootElement),this.carregarOpcoes(),this.syncState()}disconnectedCallback(){this.listeners.cleanup(),this.indicadorController.destruir()}attributeChangedCallback(t,i,e){i!==e&&(t==="valor"||t==="value"?this.atualizarSelecao(e||""):this.syncState())}formResetCallback(){this.valor=this._defaultValue,this.syncState()}formStateRestoreCallback(t,i){typeof t=="string"&&(this.valor=t),this.syncState()}get type(){return"select-one"}atualizarValidade(){if(!this.internals||typeof this.internals.setValidity!="function")return;if(this.disabled){this.internals.setValidity({});return}if(this._customErrorMessage){this.internals.setValidity({customError:!0},this._customErrorMessage,this.rootElement);return}if((this.hasAttribute("obrigatorio")||this.hasAttribute("required"))&&(!this.valor||this.valor.trim()==="")){const i=this.getAttribute("mensagem-validacao")||"Selecione uma opção.";this.internals.setValidity({valueMissing:!0},i,this.rootElement);return}this.internals.setValidity({})}get valor(){return this.getAttribute("valor")||this.getAttribute("value")||""}set valor(t){this.setAttribute("valor",t),this.atualizarSelecao(t)}get value(){return this.valor}set value(t){this.valor=t}get name(){return this.getAttribute("name")||""}set name(t){this.setAttribute("name",t)}get disabled(){return this.hasAttribute("disabled")||this._formDisabled}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get opcoes(){return this._opcoes}set opcoes(t){this._opcoes=Array.isArray(t)?t:[],this.renderizarOpcoes()}carregarOpcoes(){const t=this.slotElement.assignedElements();if(t.length>0){const i=[];t.forEach(e=>{var a,r;if(e instanceof HTMLElement){const o=e.getAttribute("valor")||e.getAttribute("value")||e.getAttribute("data-value")||((a=e.textContent)==null?void 0:a.trim())||"",l=e.getAttribute("label")||e.getAttribute("rotulo")||((r=e.textContent)==null?void 0:r.trim())||o,c=e.getAttribute("icone")||e.getAttribute("icon")||void 0,y=e.hasAttribute("disabled");i.push({valor:o,rotulo:l,icone:c,disabled:y})}}),this._opcoes=i,this.renderizarOpcoes()}}renderizarOpcoes(){this.trackElement.innerHTML="";const t=this.valor,i=this.disabled;this._opcoes.forEach((a,r)=>{const o=x(a,r,t,i,()=>this.selecionarIndice(r));this.trackElement.appendChild(o)});const e=this.required||this.hasAttribute("sem-selecao-inicial");!t&&this._opcoes.length>0&&!e?this.selecionarIndice(0,!1):this.indicadorController.atualizar(),this.atualizarValidade()}selecionarIndice(t,i=!0){var r,o;if(this.disabled)return;const e=this._opcoes[t];if(!e||e.disabled)return;const a=this.valor;this.setAttribute("valor",e.valor),this.internals&&((o=(r=this.internals).setFormValue)==null||o.call(r,e.valor)),this.atualizarSelecao(e.valor),i&&a!==e.valor&&(this.dispatchEvent(new CustomEvent("ui-change",{detail:{valor:e.valor,rotulo:e.rotulo,indice:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-selecionar",{detail:{valor:e.valor,rotulo:e.rotulo,indice:t},bubbles:!0,composed:!0})))}atualizarSelecao(t){var e,a;Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach(r=>{const o=r.dataset.valor===t;r.classList.toggle("ui-segmented__item--ativo",o),z.alternarPart(r,"opcao-selecionada",o),r.setAttribute("aria-checked",String(o)),r.tabIndex=o?0:-1,o&&r.focus()}),this.internals&&((a=(e=this.internals).setFormValue)==null||a.call(e,t)),this.indicadorController.atualizar(),this.atualizarValidade()}syncState(){const t=this.getAttribute("tamanho")||this.getAttribute("size")||"md",i=this.hasAttribute("largura-total")||this.hasAttribute("full-width"),e=this.disabled;this.rootElement.className=`ui-segmented ui-segmented--${t}`,i&&this.rootElement.classList.add("ui-segmented--full"),this.rootElement.setAttribute("aria-disabled",String(e)),Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach(r=>{r.disabled=e}),this.indicadorController.atualizar(),this.atualizarValidade()}}class _ extends h{}d.definirCustomElement("ui-segmented",h);d.definirCustomElement("ui-segmento",_);exports.ATRIBUTOS_OBSERVADOS_SEGMENTED=f;exports.SegmentedIndicadorController=g;exports.UIAvatar=p;exports.UISegmented=h;exports.UISegmento=_;exports.UITexto=m;exports.criarBotaoOpcao=x;exports.criarTemplateSegmented=b;exports.tratarTecladoSegmented=v;
|
|
@@ -3,8 +3,9 @@ var v = (s, n, t) => n in s ? g(s, n, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var u = (s, n, t) => v(s, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { d, S as h } from "./ssr-safe-5cWfJP-s.js";
|
|
5
5
|
import { L as f } from "./listener-bag-DQgv7OON.js";
|
|
6
|
-
import { F as b } from "./ui-campo-texto-
|
|
7
|
-
|
|
6
|
+
import { F as b } from "./ui-campo-texto-Uu2dJE_0.js";
|
|
7
|
+
import { a as x } from "./parts-CaoQiCfI.js";
|
|
8
|
+
const _ = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){display:inline-block}.ui-texto{margin:0;padding:0;box-sizing:border-box;font-family:inherit;color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.ui-texto--h1{font-size:var(--ui-tamanho-h1, clamp(24px, 4vw, 36px));font-weight:var(--ui-peso-negrito, 700);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.5px}.ui-texto--h2{font-size:var(--ui-tamanho-h2, clamp(20px, 3vw, 28px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.3px}.ui-texto--h3{font-size:var(--ui-tamanho-h3, clamp(18px, 2.4vw, 24px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h4{font-size:var(--ui-tamanho-h4, clamp(16px, 2vw, 20px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h5{font-size:var(--ui-tamanho-h5, clamp(14px, 1.6vw, 18px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h6{font-size:var(--ui-tamanho-h6, clamp(13px, 1.2vw, 16px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);text-transform:uppercase;letter-spacing:.5px}.ui-texto--corpo{font-size:var(--ui-tamanho-corpo, 14px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--corpo-sm{font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--caption{font-size:var(--ui-tamanho-caption, 11px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-compacta, 1.2);color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--codigo{font-family:var(--ui-fonte-codigo, monospace);font-size:var(--ui-tamanho-codigo, 12px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5);background:var(--ui-cor-fundo-elevado, #1a1a1e);padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-texto--cor-primaria{color:var(--ui-cor-primaria, #00E08A)}.ui-texto--cor-secundaria{color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--cor-destaque{color:var(--ui-cor-destaque, #00E08A)}.ui-texto--cor-erro{color:var(--ui-cor-texto-erro, #ff5555)}.ui-texto--cor-sucesso{color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-texto--cor-alerta{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-texto--peso-normal{font-weight:var(--ui-peso-normal, 400)!important}.ui-texto--peso-medio{font-weight:var(--ui-peso-medio, 500)!important}.ui-texto--peso-seminegrito{font-weight:var(--ui-peso-seminegrito, 600)!important}.ui-texto--peso-negrito{font-weight:var(--ui-peso-negrito, 700)!important}.ui-texto--alinhamento-esquerda{text-align:left}.ui-texto--alinhamento-centro{text-align:center}.ui-texto--alinhamento-direita{text-align:right}.ui-texto--alinhamento-justificado{text-align:justify}.ui-texto--truncar{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}', y = /* @__PURE__ */ new Set([
|
|
8
9
|
"p",
|
|
9
10
|
"span",
|
|
10
11
|
"div",
|
|
@@ -24,12 +25,12 @@ const x = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:va
|
|
|
24
25
|
"b",
|
|
25
26
|
"i"
|
|
26
27
|
]);
|
|
27
|
-
class
|
|
28
|
+
class A extends h {
|
|
28
29
|
constructor() {
|
|
29
30
|
super();
|
|
30
31
|
u(this, "container");
|
|
31
32
|
u(this, "shadow");
|
|
32
|
-
typeof this.attachShadow == "function" && typeof document < "u" ? (this.shadow = this.attachShadow({ mode: "open" }), this.container = document.createElement("p"), this.container.className = "ui-texto ui-texto--corpo", this.container.appendChild(document.createElement("slot")), this.shadow.innerHTML = `<style>${
|
|
33
|
+
typeof this.attachShadow == "function" && typeof document < "u" ? (this.shadow = this.attachShadow({ mode: "open" }), this.container = document.createElement("p"), this.container.className = "ui-texto ui-texto--corpo", this.container.appendChild(document.createElement("slot")), this.shadow.innerHTML = `<style>${_}</style>`, this.shadow.appendChild(this.container)) : (this.shadow = null, this.container = null);
|
|
33
34
|
}
|
|
34
35
|
static get observedAttributes() {
|
|
35
36
|
return ["variante", "tag", "cor", "peso", "alinhamento", "truncar"];
|
|
@@ -44,7 +45,7 @@ class y extends h {
|
|
|
44
45
|
const t = this.getAttribute("tag");
|
|
45
46
|
if (t) {
|
|
46
47
|
const e = t.toLowerCase().trim();
|
|
47
|
-
if (
|
|
48
|
+
if (y.has(e))
|
|
48
49
|
return e;
|
|
49
50
|
console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`);
|
|
50
51
|
}
|
|
@@ -68,17 +69,17 @@ class y extends h {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
render() {
|
|
71
|
-
const t = this.resolveTag(), i = this.getAttribute("variante") || "corpo", e = this.getAttribute("cor"), a = this.getAttribute("peso"),
|
|
72
|
+
const t = this.resolveTag(), i = this.getAttribute("variante") || "corpo", e = this.getAttribute("cor"), a = this.getAttribute("peso"), r = this.getAttribute("alinhamento"), o = this.hasAttribute("truncar");
|
|
72
73
|
if (this.container.tagName.toLowerCase() !== t) {
|
|
73
74
|
const c = document.createElement(t);
|
|
74
75
|
c.appendChild(document.createElement("slot")), this.shadow.replaceChild(c, this.container), this.container = c;
|
|
75
76
|
}
|
|
76
77
|
const l = ["ui-texto", `ui-texto--${i}`];
|
|
77
|
-
e && l.push(`ui-texto--cor-${e}`), a && l.push(`ui-texto--peso-${a}`),
|
|
78
|
+
e && l.push(`ui-texto--cor-${e}`), a && l.push(`ui-texto--peso-${a}`), r && l.push(`ui-texto--alinhamento-${r}`), o && l.push("ui-texto--truncar"), this.container.className = l.join(" ");
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
d("ui-texto",
|
|
81
|
-
const
|
|
81
|
+
d("ui-texto", A);
|
|
82
|
+
const E = ':host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle;position:relative}.ui-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-tamanho-avatar, 36px);height:var(--ui-tamanho-avatar, 36px);min-width:var(--ui-tamanho-avatar, 36px);min-height:var(--ui-tamanho-avatar, 36px);border-radius:50%;background-color:var(--ui-cor-fundo-elevado, #22222a);color:var(--ui-cor-primaria, #00E08A);font-weight:600;font-size:var(--ui-avatar-font-size, 14px);-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));line-height:1}.ui-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.ui-avatar--quadrado{border-radius:8px}.ui-avatar__status{position:absolute;bottom:0;right:0;width:25%;height:25%;min-width:8px;min-height:8px;max-width:14px;max-height:14px;border-radius:50%;border:2px solid var(--ui-cor-fundo-card, #121214);box-sizing:border-box}.ui-avatar__status--online{background-color:var(--ui-cor-primaria, #00E08A)}.ui-avatar__status--offline{background-color:#889}.ui-avatar__status--ausente{background-color:#ffb86c}.ui-avatar__status--ocupado{background-color:#f55}.ui-avatar--xs{--ui-tamanho-avatar: 20px;--ui-avatar-font-size: 10px}.ui-avatar--sm{--ui-tamanho-avatar: 28px;--ui-avatar-font-size: 11px}.ui-avatar--md{--ui-tamanho-avatar: 36px;--ui-avatar-font-size: 14px}.ui-avatar--lg{--ui-tamanho-avatar: 48px;--ui-avatar-font-size: 18px}.ui-avatar--xl{--ui-tamanho-avatar: 64px;--ui-avatar-font-size: 24px}';
|
|
82
83
|
class w extends h {
|
|
83
84
|
constructor() {
|
|
84
85
|
super();
|
|
@@ -86,7 +87,7 @@ class w extends h {
|
|
|
86
87
|
u(this, "statusElement");
|
|
87
88
|
const t = this.attachShadow({ mode: "open" });
|
|
88
89
|
t.innerHTML = `
|
|
89
|
-
<style>${
|
|
90
|
+
<style>${E}</style>
|
|
90
91
|
<div class="ui-avatar">
|
|
91
92
|
<span class="ui-avatar__content"></span>
|
|
92
93
|
</div>
|
|
@@ -119,24 +120,24 @@ class w extends h {
|
|
|
119
120
|
return (e + a).toUpperCase();
|
|
120
121
|
}
|
|
121
122
|
syncState() {
|
|
122
|
-
const t = this.getAttribute("src"), i = this.getAttribute("nome") || this.getAttribute("name") || "", e = this.getAttribute("tamanho") || this.getAttribute("size") || "md", a = this.getAttribute("formato") || "circulo",
|
|
123
|
+
const t = this.getAttribute("src"), i = this.getAttribute("nome") || this.getAttribute("name") || "", e = this.getAttribute("tamanho") || this.getAttribute("size") || "md", a = this.getAttribute("formato") || "circulo", r = this.getAttribute("status");
|
|
123
124
|
this.avatarElement.className = "ui-avatar", ["xs", "sm", "md", "lg", "xl"].includes(e) ? (this.avatarElement.classList.add(`ui-avatar--${e}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : isNaN(parseInt(e, 10)) ? this.avatarElement.style.removeProperty("--ui-tamanho-avatar") : this.avatarElement.style.setProperty("--ui-tamanho-avatar", `${parseInt(e, 10)}px`), a === "quadrado" && this.avatarElement.classList.add("ui-avatar--quadrado");
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
125
|
+
const o = this.avatarElement.querySelector(".ui-avatar__content");
|
|
126
|
+
if (o)
|
|
126
127
|
if (t) {
|
|
127
|
-
const l =
|
|
128
|
+
const l = o.querySelector("img");
|
|
128
129
|
if (l && l.getAttribute("src") === t)
|
|
129
130
|
l.alt = i || "Avatar";
|
|
130
131
|
else {
|
|
131
|
-
|
|
132
|
+
o.textContent = "";
|
|
132
133
|
const c = document.createElement("img");
|
|
133
134
|
c.className = "ui-avatar__img", c.src = t, c.alt = i || "Avatar", c.onerror = () => {
|
|
134
|
-
this.renderFallback(
|
|
135
|
-
},
|
|
135
|
+
this.renderFallback(o, i);
|
|
136
|
+
}, o.appendChild(c);
|
|
136
137
|
}
|
|
137
138
|
} else
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
o.textContent = "", this.renderFallback(o, i);
|
|
140
|
+
r && ["online", "offline", "ausente", "ocupado"].includes(r) ? (this.statusElement.className = `ui-avatar__status ui-avatar__status--${r}`, this.statusElement.style.display = "block") : this.statusElement.style.display = "none";
|
|
140
141
|
}
|
|
141
142
|
renderFallback(t, i) {
|
|
142
143
|
i ? t.textContent = this.extrairIniciais(i) : t.innerHTML = `
|
|
@@ -148,7 +149,7 @@ class w extends h {
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
d("ui-avatar", w);
|
|
151
|
-
class
|
|
152
|
+
class z {
|
|
152
153
|
constructor(n, t) {
|
|
153
154
|
u(this, "rafId", null);
|
|
154
155
|
u(this, "resizeObserver");
|
|
@@ -175,31 +176,31 @@ class E {
|
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
+
function k(s, n, t, i) {
|
|
179
180
|
if (t) return;
|
|
180
181
|
const e = Array.from(
|
|
181
182
|
n.querySelectorAll(".ui-segmented__item:not(:disabled)")
|
|
182
183
|
);
|
|
183
184
|
if (e.length === 0) return;
|
|
184
185
|
const a = e.findIndex((l) => l.classList.contains("ui-segmented__item--ativo"));
|
|
185
|
-
let
|
|
186
|
+
let r = a;
|
|
186
187
|
if (s.key === "ArrowRight" || s.key === "ArrowDown")
|
|
187
|
-
s.preventDefault(),
|
|
188
|
+
s.preventDefault(), r = (a + 1) % e.length;
|
|
188
189
|
else if (s.key === "ArrowLeft" || s.key === "ArrowUp")
|
|
189
|
-
s.preventDefault(),
|
|
190
|
+
s.preventDefault(), r = (a - 1 + e.length) % e.length;
|
|
190
191
|
else if (s.key === "Home")
|
|
191
|
-
s.preventDefault(),
|
|
192
|
+
s.preventDefault(), r = 0;
|
|
192
193
|
else if (s.key === "End")
|
|
193
|
-
s.preventDefault(),
|
|
194
|
+
s.preventDefault(), r = e.length - 1;
|
|
194
195
|
else
|
|
195
196
|
return;
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const l = parseInt(
|
|
197
|
+
const o = e[r];
|
|
198
|
+
if (o && o.dataset.indice) {
|
|
199
|
+
const l = parseInt(o.dataset.indice, 10);
|
|
199
200
|
i(l);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
|
-
const
|
|
203
|
+
const S = ':host{display:inline-block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-segmented{display:inline-flex;position:relative;background-color:var(--ui-cor-fundo, #0b0b0d);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);padding:3px;box-sizing:border-box;-webkit-user-select:none;user-select:none;gap:2px;align-items:center}.ui-segmented--full{display:flex;width:100%}.ui-segmented--full .ui-segmented__item{flex:1}.ui-segmented--sm{padding:2px;height:28px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px;height:22px}.ui-segmented--md{padding:3px;height:36px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px;height:28px}.ui-segmented--lg{padding:4px;height:42px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px;height:32px}.ui-segmented__indicador{position:absolute;top:3px;bottom:3px;left:0;background-color:var(--ui-cor-fundo-card, #1e1e24);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:calc(var(--ui-raio-borda, 8px) - 2px);box-shadow:var(--ui-sombra-sm, 0 2px 8px rgba(0, 0, 0, .4));pointer-events:none;transition:transform .22s cubic-bezier(.16,1,.3,1),width .22s cubic-bezier(.16,1,.3,1),opacity .15s ease;z-index:1;opacity:0}.ui-segmented--sm .ui-segmented__indicador{top:2px;bottom:2px}.ui-segmented--lg .ui-segmented__indicador{top:4px;bottom:4px}.ui-segmented__item{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-weight:500;cursor:pointer;border-radius:calc(var(--ui-raio-borda, 8px) - 2px);line-height:1;white-space:nowrap;transition:color .15s ease;box-sizing:border-box}.ui-segmented__item:hover:not(:disabled){color:var(--ui-cor-texto, #e1e1e6)}.ui-segmented__item--ativo{color:var(--ui-cor-texto, #ffffff)!important;font-weight:600}.ui-segmented__item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-segmented__item:disabled{opacity:.35;cursor:not-allowed}.ui-segmented__icone{display:inline-flex;align-items:center;justify-content:center;line-height:1}.ui-segmented__icone ui-icone,.ui-segmented__icone svg{shape-rendering:geometricPrecision;display:inline-flex;align-items:center;justify-content:center}', C = [
|
|
203
204
|
"valor",
|
|
204
205
|
"value",
|
|
205
206
|
"name",
|
|
@@ -212,28 +213,28 @@ const k = ':host{display:inline-block;box-sizing:border-box;font-family:var(--ui
|
|
|
212
213
|
"required",
|
|
213
214
|
"mensagem-validacao"
|
|
214
215
|
];
|
|
215
|
-
function
|
|
216
|
+
function I() {
|
|
216
217
|
return `
|
|
217
|
-
<style>${
|
|
218
|
-
<div class="ui-segmented ui-segmented--md" role="radiogroup">
|
|
219
|
-
<div class="ui-segmented__indicador"></div>
|
|
218
|
+
<style>${S}</style>
|
|
219
|
+
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
220
|
+
<div class="ui-segmented__indicador" part="indicador"></div>
|
|
220
221
|
<div class="ui-segmented__track" style="display: contents;"></div>
|
|
221
222
|
<slot style="display: none;"></slot>
|
|
222
223
|
</div>
|
|
223
224
|
`;
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
+
function q(s, n, t, i, e) {
|
|
226
227
|
const a = document.createElement("button");
|
|
227
|
-
a.type = "button", a.role = "radio", a.className = "ui-segmented__item", a.dataset.valor = s.valor, a.dataset.indice = String(n);
|
|
228
|
-
const
|
|
229
|
-
if (a.setAttribute("aria-checked", String(
|
|
228
|
+
a.type = "button", a.role = "radio", a.className = "ui-segmented__item", a.setAttribute("part", s.valor === t ? "opcao opcao-selecionada" : "opcao"), a.dataset.valor = s.valor, a.dataset.indice = String(n);
|
|
229
|
+
const r = s.valor === t;
|
|
230
|
+
if (a.setAttribute("aria-checked", String(r)), a.tabIndex = r ? 0 : -1, r && a.classList.add("ui-segmented__item--ativo"), (i || s.disabled) && (a.disabled = !0), s.icone) {
|
|
230
231
|
const l = document.createElement("span");
|
|
231
232
|
l.className = "ui-segmented__icone";
|
|
232
233
|
const c = document.createElement("ui-icone");
|
|
233
234
|
c.setAttribute("nome", s.icone), c.setAttribute("tamanho", "14"), l.appendChild(c), a.appendChild(l);
|
|
234
235
|
}
|
|
235
|
-
const
|
|
236
|
-
return
|
|
236
|
+
const o = document.createElement("span");
|
|
237
|
+
return o.className = "ui-segmented__texto", o.textContent = s.rotulo, a.appendChild(o), a.addEventListener("click", (l) => {
|
|
237
238
|
l.stopPropagation(), e();
|
|
238
239
|
}), a;
|
|
239
240
|
}
|
|
@@ -252,18 +253,18 @@ class m extends b {
|
|
|
252
253
|
this._opcoes.length === 0 && this.carregarOpcoes();
|
|
253
254
|
});
|
|
254
255
|
u(this, "handleKeyDown", (t) => {
|
|
255
|
-
|
|
256
|
+
k(t, this.trackElement, this.disabled, (i) => {
|
|
256
257
|
this.selecionarIndice(i);
|
|
257
258
|
});
|
|
258
259
|
});
|
|
259
260
|
const t = this.attachShadow({ mode: "open" });
|
|
260
|
-
t.innerHTML =
|
|
261
|
+
t.innerHTML = I(), this.rootElement = t.querySelector(".ui-segmented"), this.indicadorElement = t.querySelector(".ui-segmented__indicador"), this.trackElement = t.querySelector(".ui-segmented__track"), this.slotElement = t.querySelector("slot"), this.indicadorController = new z(
|
|
261
262
|
this.trackElement,
|
|
262
263
|
this.indicadorElement
|
|
263
264
|
);
|
|
264
265
|
}
|
|
265
266
|
static get observedAttributes() {
|
|
266
|
-
return
|
|
267
|
+
return C;
|
|
267
268
|
}
|
|
268
269
|
connectedCallback() {
|
|
269
270
|
this.listeners.cleanup(), this.listeners.add(this.rootElement, "keydown", this.handleKeyDown), this.listeners.add(this.slotElement, "slotchange", this.handleSlotChange), this._defaultValue || (this._defaultValue = this.getAttribute("valor") || this.getAttribute("value") || ""), this.indicadorController.iniciarObserver(this.rootElement), this.carregarOpcoes(), this.syncState();
|
|
@@ -336,10 +337,10 @@ class m extends b {
|
|
|
336
337
|
if (t.length > 0) {
|
|
337
338
|
const i = [];
|
|
338
339
|
t.forEach((e) => {
|
|
339
|
-
var a,
|
|
340
|
+
var a, r;
|
|
340
341
|
if (e instanceof HTMLElement) {
|
|
341
|
-
const
|
|
342
|
-
i.push({ valor:
|
|
342
|
+
const o = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((a = e.textContent) == null ? void 0 : a.trim()) || "", l = e.getAttribute("label") || e.getAttribute("rotulo") || ((r = e.textContent) == null ? void 0 : r.trim()) || o, c = e.getAttribute("icone") || e.getAttribute("icon") || void 0, p = e.hasAttribute("disabled");
|
|
343
|
+
i.push({ valor: o, rotulo: l, icone: c, disabled: p });
|
|
343
344
|
}
|
|
344
345
|
}), this._opcoes = i, this.renderizarOpcoes();
|
|
345
346
|
}
|
|
@@ -347,26 +348,26 @@ class m extends b {
|
|
|
347
348
|
renderizarOpcoes() {
|
|
348
349
|
this.trackElement.innerHTML = "";
|
|
349
350
|
const t = this.valor, i = this.disabled;
|
|
350
|
-
this._opcoes.forEach((a,
|
|
351
|
-
const
|
|
351
|
+
this._opcoes.forEach((a, r) => {
|
|
352
|
+
const o = q(
|
|
352
353
|
a,
|
|
353
|
-
|
|
354
|
+
r,
|
|
354
355
|
t,
|
|
355
356
|
i,
|
|
356
|
-
() => this.selecionarIndice(
|
|
357
|
+
() => this.selecionarIndice(r)
|
|
357
358
|
);
|
|
358
|
-
this.trackElement.appendChild(
|
|
359
|
+
this.trackElement.appendChild(o);
|
|
359
360
|
});
|
|
360
361
|
const e = this.required || this.hasAttribute("sem-selecao-inicial");
|
|
361
362
|
!t && this._opcoes.length > 0 && !e ? this.selecionarIndice(0, !1) : this.indicadorController.atualizar(), this.atualizarValidade();
|
|
362
363
|
}
|
|
363
364
|
selecionarIndice(t, i = !0) {
|
|
364
|
-
var
|
|
365
|
+
var r, o;
|
|
365
366
|
if (this.disabled) return;
|
|
366
367
|
const e = this._opcoes[t];
|
|
367
368
|
if (!e || e.disabled) return;
|
|
368
369
|
const a = this.valor;
|
|
369
|
-
this.setAttribute("valor", e.valor), this.internals && ((
|
|
370
|
+
this.setAttribute("valor", e.valor), this.internals && ((o = (r = this.internals).setFormValue) == null || o.call(r, e.valor)), this.atualizarSelecao(e.valor), i && a !== e.valor && (this.dispatchEvent(
|
|
370
371
|
new CustomEvent("ui-change", {
|
|
371
372
|
detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
|
|
372
373
|
bubbles: !0,
|
|
@@ -382,30 +383,30 @@ class m extends b {
|
|
|
382
383
|
}
|
|
383
384
|
atualizarSelecao(t) {
|
|
384
385
|
var e, a;
|
|
385
|
-
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((r) => {
|
|
387
|
+
const o = r.dataset.valor === t;
|
|
388
|
+
r.classList.toggle("ui-segmented__item--ativo", o), x(r, "opcao-selecionada", o), r.setAttribute("aria-checked", String(o)), r.tabIndex = o ? 0 : -1, o && r.focus();
|
|
388
389
|
}), this.internals && ((a = (e = this.internals).setFormValue) == null || a.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
389
390
|
}
|
|
390
391
|
syncState() {
|
|
391
392
|
const t = this.getAttribute("tamanho") || this.getAttribute("size") || "md", i = this.hasAttribute("largura-total") || this.hasAttribute("full-width"), e = this.disabled;
|
|
392
|
-
this.rootElement.className = `ui-segmented ui-segmented--${t}`, i && this.rootElement.classList.add("ui-segmented--full"), this.rootElement.setAttribute("aria-disabled", String(e)), Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((
|
|
393
|
-
|
|
393
|
+
this.rootElement.className = `ui-segmented ui-segmented--${t}`, i && this.rootElement.classList.add("ui-segmented--full"), this.rootElement.setAttribute("aria-disabled", String(e)), Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((r) => {
|
|
394
|
+
r.disabled = e;
|
|
394
395
|
}), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
|
-
class
|
|
398
|
+
class L extends m {
|
|
398
399
|
}
|
|
399
400
|
d("ui-segmented", m);
|
|
400
|
-
d("ui-segmento",
|
|
401
|
+
d("ui-segmento", L);
|
|
401
402
|
export {
|
|
402
|
-
|
|
403
|
-
|
|
403
|
+
C as A,
|
|
404
|
+
z as S,
|
|
404
405
|
w as U,
|
|
405
406
|
m as a,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
L as b,
|
|
408
|
+
A as c,
|
|
409
|
+
q as d,
|
|
410
|
+
I as e,
|
|
411
|
+
k as t
|
|
411
412
|
};
|