@thibezer/ui-components-kit 2.8.2 → 2.9.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 +146 -0
- package/README.md +32 -8
- package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
- package/dist/acessibilidade-CUlSXc2X.js +38 -0
- package/dist/altura-controle-ukMRPckR.cjs +1 -0
- package/dist/altura-controle-vxQiXG4q.js +62 -0
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +114 -110
- package/dist/camadas.js +1343 -1177
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +86 -85
- package/dist/canvas.js +5437 -4304
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
- package/dist/components/ui-badge/ui-badge.d.ts +2 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +3 -1
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +23 -0
- package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +22 -0
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +3 -7
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
- package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
- package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
- package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
- package/dist/components/ui-camadas/camadas-host.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -1
- package/dist/components/ui-camadas/camadas-render.d.ts +15 -0
- package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +12 -0
- package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +8 -5
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
- package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +28 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +39 -106
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
- package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
- package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +30 -1
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
- package/dist/components/ui-cores/tipos.d.ts +2 -0
- package/dist/components/ui-cores/ui-controle-cores.d.ts +8 -3
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +3 -1
- package/dist/components/ui-linha/index.d.ts +1 -0
- package/dist/components/ui-linha/ui-linha.d.ts +48 -0
- package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
- package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
- package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
- package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
- package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
- package/dist/components/ui-mapa/tipos.d.ts +13 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
- package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
- package/dist/components/ui-modal/modal-foco.d.ts +28 -0
- package/dist/components/ui-modal/ui-modal.d.ts +1 -11
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +9 -2
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-switch/ui-switch.d.ts +3 -1
- package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
- package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
- package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
- package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
- package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
- package/dist/core/altura-controle.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/opcoes.d.ts +9 -0
- package/dist/core/rotulo-controle.d.ts +13 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +28 -18
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +1 -1
- package/dist/custom-elements.json +22088 -16390
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/form-validacao-BlQFxUVj.js +104 -0
- package/dist/form-validacao-DIeyQVH5.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +0 -1
- package/dist/gerencigeo-canvas/curva_leaflet.d.ts +2 -2
- package/dist/gerencigeo-canvas/feature_curvas.d.ts +3 -1
- package/dist/gerencigeo-canvas/feature_lod.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +2 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +16 -8
- package/dist/gerencigeo-canvas/index.d.ts +7 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +22 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +5 -0
- package/dist/gerencigeo-canvas/mapa_core.d.ts +6 -0
- package/dist/gerencigeo-canvas/motor/dados-camada.d.ts +39 -0
- package/dist/gerencigeo-canvas/motor/estilo.d.ts +28 -0
- package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +27 -0
- package/dist/gerencigeo-canvas/motor/index.d.ts +5 -0
- package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +107 -0
- package/dist/gerencigeo-canvas/motor/tipos.d.ts +100 -0
- package/dist/gerencigeo-canvas/popup_gate.d.ts +30 -0
- package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +87 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +58 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_despachante.d.ts +31 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +48 -9
- package/dist/gerencigeo-canvas/renderers/marcadores_feicoes.d.ts +11 -0
- package/dist/gerencigeo-canvas/renderers/marcas_lod_layer.d.ts +19 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_feicoes_tipos.d.ts +44 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +95 -0
- package/dist/gerencigeo-canvas/renderers/selecao_visual.d.ts +6 -0
- package/dist/gerencigeo-canvas/types.d.ts +2 -0
- package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +179 -176
- package/dist/mapa.cjs +11 -16
- package/dist/mapa.js +242 -170
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/motor-BB6tB6U-.cjs +1 -0
- package/dist/motor-CFI84lM2.js +1301 -0
- package/dist/motor.cjs +1 -0
- package/dist/motor.d.ts +7 -0
- package/dist/motor.js +52 -0
- package/dist/opcoes-CJYLi6kd.js +12 -0
- package/dist/opcoes-CkyDxBuQ.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +11 -11
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +49 -8
- package/dist/tipos-react.d.ts +2 -0
- package/dist/tipos-vue.d.ts +45 -8
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BWhoGgo9.js +197 -0
- package/dist/ui-badge-SIR81R9l.cjs +28 -0
- package/dist/ui-botao-D24oXySA.cjs +12 -0
- package/dist/ui-botao-Dsj08jjw.js +165 -0
- package/dist/{ui-campo-texto-Uu2dJE_0.js → ui-campo-texto-B_OHVGiN.js} +51 -51
- package/dist/ui-campo-texto-DauJCde3.cjs +16 -0
- package/dist/{ui-card-C_o5_0cB.js → ui-card-BNYCQ7g-.js} +50 -42
- package/dist/ui-card-BrjBL-yo.cjs +20 -0
- package/dist/ui-controle-cores-DgEza3wF.js +612 -0
- package/dist/ui-controle-cores-uY__TgwW.cjs +117 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-BYAX4W6x.cjs +19 -0
- package/dist/{ui-segmented-DyF5YLsV.js → ui-linha-aqLlaYi7.js} +209 -114
- package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
- package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
- package/dist/{ui-paleta-ferramentas-DbwdWVtT.js → ui-paleta-ferramentas-BXXrI1Y7.js} +491 -431
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +21 -0
- package/dist/{ui-skeleton-W9uwIceA.js → ui-skeleton-B2Rgrv8o.js} +254 -191
- package/dist/{ui-skeleton-SPYqku8P.cjs → ui-skeleton-DiOxTBZK.cjs} +10 -10
- package/dist/ui-switch-D9a8XlVX.cjs +53 -0
- package/dist/{ui-switch-BcOqOkiV.js → ui-switch-DO1R0Ce7.js} +187 -128
- package/dist/{ui-tabela-propriedades-C-PeuW1i.cjs → ui-tabela-propriedades-CjK2gG14.cjs} +10 -10
- package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-DoL4SE0r.js} +845 -826
- package/package.json +8 -3
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (
|
|
4
|
-
import { d, S as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var y = (n, a, t) => a in n ? A(n, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[a] = t;
|
|
3
|
+
var u = (n, a, t) => y(n, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { d as p, S as v } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
+
import { e as g, a as m } from "./opcoes-CJYLi6kd.js";
|
|
6
|
+
import { L as w } from "./listener-bag-DQgv7OON.js";
|
|
7
|
+
import { F as E } from "./ui-campo-texto-B_OHVGiN.js";
|
|
8
|
+
import { a as z } from "./parts-CaoQiCfI.js";
|
|
9
|
+
import { b as f, c as S } from "./altura-controle-vxQiXG4q.js";
|
|
10
|
+
const 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}', b = ["h1", "h2", "h3", "h4", "h5", "h6", "corpo", "corpo-sm", "caption", "codigo"], C = ["primaria", "secundaria", "destaque", "erro", "sucesso", "alerta"], T = ["normal", "medio", "seminegrito", "negrito"], I = ["esquerda", "centro", "direita", "justificado"], q = /* @__PURE__ */ new Set([
|
|
9
11
|
"p",
|
|
10
12
|
"span",
|
|
11
13
|
"div",
|
|
@@ -25,12 +27,12 @@ const _ = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:va
|
|
|
25
27
|
"b",
|
|
26
28
|
"i"
|
|
27
29
|
]);
|
|
28
|
-
class
|
|
30
|
+
class O extends v {
|
|
29
31
|
constructor() {
|
|
30
32
|
super();
|
|
31
33
|
u(this, "container");
|
|
32
34
|
u(this, "shadow");
|
|
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>${
|
|
35
|
+
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);
|
|
34
36
|
}
|
|
35
37
|
static get observedAttributes() {
|
|
36
38
|
return ["variante", "tag", "cor", "peso", "alinhamento", "truncar"];
|
|
@@ -45,11 +47,11 @@ class w extends h {
|
|
|
45
47
|
const t = this.getAttribute("tag");
|
|
46
48
|
if (t) {
|
|
47
49
|
const e = t.toLowerCase().trim();
|
|
48
|
-
if (
|
|
50
|
+
if (q.has(e))
|
|
49
51
|
return e;
|
|
50
52
|
console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`);
|
|
51
53
|
}
|
|
52
|
-
const i = (this.getAttribute("variante")
|
|
54
|
+
const i = g(this.getAttribute("variante"), b, "corpo");
|
|
53
55
|
switch (i) {
|
|
54
56
|
case "h1":
|
|
55
57
|
case "h2":
|
|
@@ -69,25 +71,29 @@ class w extends h {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
render() {
|
|
72
|
-
const t = this.resolveTag(), i = this.getAttribute("variante")
|
|
74
|
+
const t = this.resolveTag(), i = g(this.getAttribute("variante"), b, "corpo"), e = m(this.getAttribute("cor"), C), r = m(this.getAttribute("peso"), T), o = m(this.getAttribute("alinhamento"), I), s = this.hasAttribute("truncar");
|
|
73
75
|
if (this.container.tagName.toLowerCase() !== t) {
|
|
74
76
|
const c = document.createElement(t);
|
|
75
77
|
c.appendChild(document.createElement("slot")), this.shadow.replaceChild(c, this.container), this.container = c;
|
|
76
78
|
}
|
|
77
79
|
const l = ["ui-texto", `ui-texto--${i}`];
|
|
78
|
-
e && l.push(`ui-texto--cor-${e}`),
|
|
80
|
+
e && l.push(`ui-texto--cor-${e}`), r && l.push(`ui-texto--peso-${r}`), o && l.push(`ui-texto--alinhamento-${o}`), s && l.push("ui-texto--truncar"), this.container.className = l.join(" ");
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
class
|
|
83
|
+
p("ui-texto", O);
|
|
84
|
+
const L = ':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}', x = ["xs", "sm", "md", "lg", "xl"], N = ["online", "offline", "ausente", "ocupado"], j = 8, M = 512;
|
|
85
|
+
class $ extends v {
|
|
84
86
|
constructor() {
|
|
85
87
|
super();
|
|
86
88
|
u(this, "avatarElement");
|
|
87
89
|
u(this, "statusElement");
|
|
90
|
+
/** O que este componente escreveu em aria-label / aria-hidden (para distinguir do que o consumidor definiu). */
|
|
91
|
+
u(this, "_rotuloAuto", null);
|
|
92
|
+
u(this, "_ocultoAuto", !1);
|
|
93
|
+
u(this, "_sincronizando", !1);
|
|
88
94
|
const t = this.attachShadow({ mode: "open" });
|
|
89
95
|
t.innerHTML = `
|
|
90
|
-
<style>${
|
|
96
|
+
<style>${L}</style>
|
|
91
97
|
<div class="ui-avatar">
|
|
92
98
|
<span class="ui-avatar__content"></span>
|
|
93
99
|
</div>
|
|
@@ -102,42 +108,64 @@ class A extends h {
|
|
|
102
108
|
"tamanho",
|
|
103
109
|
"size",
|
|
104
110
|
"formato",
|
|
105
|
-
"status"
|
|
111
|
+
"status",
|
|
112
|
+
"aria-label"
|
|
106
113
|
];
|
|
107
114
|
}
|
|
108
115
|
connectedCallback() {
|
|
109
116
|
this.syncState();
|
|
110
117
|
}
|
|
111
118
|
attributeChangedCallback(t, i, e) {
|
|
112
|
-
this.syncState();
|
|
119
|
+
this._sincronizando || this.syncState();
|
|
113
120
|
}
|
|
121
|
+
/** Iniciais por ponto de código (emoji e caracteres fora do BMP não são cortados ao meio). */
|
|
114
122
|
extrairIniciais(t) {
|
|
115
123
|
const i = t.trim().split(/\s+/).filter(Boolean);
|
|
116
124
|
if (i.length === 0) return "?";
|
|
117
125
|
if (i.length === 1)
|
|
118
|
-
return i[0].
|
|
119
|
-
const e = i[0][0],
|
|
120
|
-
return (e +
|
|
126
|
+
return Array.from(i[0]).slice(0, 2).join("").toUpperCase();
|
|
127
|
+
const e = Array.from(i[0])[0], r = Array.from(i[i.length - 1])[0];
|
|
128
|
+
return (e + r).toUpperCase();
|
|
129
|
+
}
|
|
130
|
+
lerNome() {
|
|
131
|
+
return this.getAttribute("nome") || this.getAttribute("name") || "";
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Nome acessível: com nome, o host é uma imagem nomeada ("Ana, online"); sem nome, é decorativo.
|
|
135
|
+
* Um `aria-label`/`aria-hidden` definido pelo consumidor nunca é sobrescrito.
|
|
136
|
+
*/
|
|
137
|
+
sincronizarAcessibilidade(t, i) {
|
|
138
|
+
const e = this.getAttribute("aria-label"), r = e !== null && e !== this._rotuloAuto, o = this.hasAttribute("aria-hidden") && !this._ocultoAuto;
|
|
139
|
+
if (!(r || o)) {
|
|
140
|
+
if (this._sincronizando = !0, t) {
|
|
141
|
+
const s = i ? `${t}, ${i}` : t;
|
|
142
|
+
this.setAttribute("role", "img"), this.setAttribute("aria-label", s), this._rotuloAuto = s, this.removeAttribute("aria-hidden"), this._ocultoAuto = !1;
|
|
143
|
+
} else
|
|
144
|
+
this._rotuloAuto !== null && this.removeAttribute("aria-label"), this._rotuloAuto = null, this.removeAttribute("role"), this.setAttribute("aria-hidden", "true"), this._ocultoAuto = !0;
|
|
145
|
+
this._sincronizando = !1;
|
|
146
|
+
}
|
|
121
147
|
}
|
|
122
148
|
syncState() {
|
|
123
|
-
const t = this.getAttribute("src"), i = this.
|
|
124
|
-
this.avatarElement.className = "ui-avatar"
|
|
125
|
-
const
|
|
126
|
-
|
|
149
|
+
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), r = this.getAttribute("formato"), o = m(this.getAttribute("status"), N);
|
|
150
|
+
this.avatarElement.className = "ui-avatar";
|
|
151
|
+
const s = m(e, x), l = parseInt(e, 10);
|
|
152
|
+
s ? (this.avatarElement.classList.add(`ui-avatar--${s}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(l) && l >= j && l <= M ? this.avatarElement.style.setProperty("--ui-tamanho-avatar", `${l}px`) : (this.avatarElement.classList.add(`ui-avatar--${g(null, x, "md")}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")), r === "quadrado" && this.avatarElement.classList.add("ui-avatar--quadrado");
|
|
153
|
+
const c = this.avatarElement.querySelector(".ui-avatar__content");
|
|
154
|
+
if (c)
|
|
127
155
|
if (t) {
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
|
|
156
|
+
const d = c.querySelector("img");
|
|
157
|
+
if (d && d.getAttribute("src") === t)
|
|
158
|
+
d.alt = "";
|
|
131
159
|
else {
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
this.renderFallback(
|
|
136
|
-
},
|
|
160
|
+
c.textContent = "";
|
|
161
|
+
const h = document.createElement("img");
|
|
162
|
+
h.className = "ui-avatar__img", h.src = t, h.alt = "", h.onerror = () => {
|
|
163
|
+
this.renderFallback(c, this.lerNome());
|
|
164
|
+
}, c.appendChild(h);
|
|
137
165
|
}
|
|
138
166
|
} else
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
c.textContent = "", this.renderFallback(c, i);
|
|
168
|
+
this.sincronizarAcessibilidade(i, o), o ? (this.statusElement.className = `ui-avatar__status ui-avatar__status--${o}`, this.statusElement.style.display = "block", this.statusElement.setAttribute("aria-hidden", "true")) : this.statusElement.style.display = "none";
|
|
141
169
|
}
|
|
142
170
|
renderFallback(t, i) {
|
|
143
171
|
i ? t.textContent = this.extrairIniciais(i) : t.innerHTML = `
|
|
@@ -148,17 +176,17 @@ class A extends h {
|
|
|
148
176
|
`;
|
|
149
177
|
}
|
|
150
178
|
}
|
|
151
|
-
|
|
152
|
-
class
|
|
153
|
-
constructor(
|
|
179
|
+
p("ui-avatar", $);
|
|
180
|
+
class V {
|
|
181
|
+
constructor(a, t) {
|
|
154
182
|
u(this, "rafId", null);
|
|
155
183
|
u(this, "resizeObserver");
|
|
156
|
-
this.trackElement =
|
|
184
|
+
this.trackElement = a, this.indicadorElement = t;
|
|
157
185
|
}
|
|
158
|
-
iniciarObserver(
|
|
186
|
+
iniciarObserver(a, t) {
|
|
159
187
|
typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
|
|
160
188
|
this.atualizar(), t && t();
|
|
161
|
-
}), this.resizeObserver.observe(
|
|
189
|
+
}), this.resizeObserver.observe(a));
|
|
162
190
|
}
|
|
163
191
|
destruir() {
|
|
164
192
|
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
@@ -166,62 +194,65 @@ class z {
|
|
|
166
194
|
atualizar() {
|
|
167
195
|
this.rafId !== null && cancelAnimationFrame(this.rafId), this.rafId = requestAnimationFrame(() => {
|
|
168
196
|
this.rafId = null;
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
197
|
+
const a = this.trackElement.querySelector(".ui-segmented__item--ativo");
|
|
198
|
+
if (!a) {
|
|
171
199
|
this.indicadorElement.style.opacity = "0";
|
|
172
200
|
return;
|
|
173
201
|
}
|
|
174
|
-
const t = this.indicadorElement.parentElement, i =
|
|
175
|
-
let
|
|
202
|
+
const t = this.indicadorElement.parentElement, i = a.getBoundingClientRect(), e = t == null ? void 0 : t.getBoundingClientRect();
|
|
203
|
+
let r, o;
|
|
176
204
|
if (t && e && i.width > 0 && e.width > 0) {
|
|
177
|
-
const
|
|
178
|
-
|
|
205
|
+
const s = t.clientLeft || 0;
|
|
206
|
+
r = Number((i.left - e.left - s).toFixed(2)), o = Number(i.width.toFixed(2));
|
|
179
207
|
} else
|
|
180
|
-
|
|
181
|
-
this.indicadorElement.style.transform = `translateX(${
|
|
208
|
+
r = Math.round(a.offsetLeft), o = Math.round(a.offsetWidth);
|
|
209
|
+
this.indicadorElement.style.transform = `translateX(${r}px)`, this.indicadorElement.style.width = `${o}px`, this.indicadorElement.style.opacity = "1";
|
|
182
210
|
});
|
|
183
211
|
}
|
|
184
212
|
}
|
|
185
|
-
function
|
|
213
|
+
function D(n, a, t, i) {
|
|
186
214
|
if (t) return;
|
|
187
215
|
const e = Array.from(
|
|
188
|
-
|
|
216
|
+
a.querySelectorAll(".ui-segmented__item:not(:disabled)")
|
|
189
217
|
);
|
|
190
218
|
if (e.length === 0) return;
|
|
191
|
-
const
|
|
192
|
-
let
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
else if (
|
|
196
|
-
|
|
197
|
-
else if (
|
|
198
|
-
|
|
199
|
-
else if (
|
|
200
|
-
|
|
219
|
+
const r = e.findIndex((l) => l.classList.contains("ui-segmented__item--ativo"));
|
|
220
|
+
let o = r;
|
|
221
|
+
if (n.key === "ArrowRight" || n.key === "ArrowDown")
|
|
222
|
+
n.preventDefault(), o = (r + 1) % e.length;
|
|
223
|
+
else if (n.key === "ArrowLeft" || n.key === "ArrowUp")
|
|
224
|
+
n.preventDefault(), o = (r - 1 + e.length) % e.length;
|
|
225
|
+
else if (n.key === "Home")
|
|
226
|
+
n.preventDefault(), o = 0;
|
|
227
|
+
else if (n.key === "End")
|
|
228
|
+
n.preventDefault(), o = e.length - 1;
|
|
201
229
|
else
|
|
202
230
|
return;
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
const l = parseInt(
|
|
231
|
+
const s = e[o];
|
|
232
|
+
if (s && s.dataset.indice) {
|
|
233
|
+
const l = parseInt(s.dataset.indice, 10);
|
|
206
234
|
i(l);
|
|
207
235
|
}
|
|
208
236
|
}
|
|
209
|
-
const
|
|
237
|
+
const H = ':host{display:inline-flex;vertical-align:middle;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{--_altura: var(--ui-campo-altura, 34px);--_moldura: 3px;display:inline-flex;position:relative;height:var(--_altura);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:var(--_moldura);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{--_moldura: 2px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px}.ui-segmented--lg{--_moldura: 4px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px}.ui-segmented__indicador{position:absolute;top:var(--_moldura);bottom:var(--_moldura);left:0;box-sizing:border-box;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__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;height:calc(var(--_altura) - 2px - 2 * var(--_moldura))}.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}@media (max-width: 640px){.ui-segmented{--_altura: max(var(--ui-campo-altura, 34px), 38px)}}', R = [
|
|
210
238
|
"valor",
|
|
211
239
|
"value",
|
|
212
240
|
"name",
|
|
213
241
|
"disabled",
|
|
214
242
|
"tamanho",
|
|
215
243
|
"size",
|
|
244
|
+
"densidade",
|
|
245
|
+
"altura",
|
|
246
|
+
"height",
|
|
216
247
|
"largura-total",
|
|
217
248
|
"full-width",
|
|
218
249
|
"obrigatorio",
|
|
219
250
|
"required",
|
|
220
251
|
"mensagem-validacao"
|
|
221
252
|
];
|
|
222
|
-
function
|
|
253
|
+
function F() {
|
|
223
254
|
return `
|
|
224
|
-
<style>${
|
|
255
|
+
<style>${H}</style>
|
|
225
256
|
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
226
257
|
<div class="ui-segmented__indicador" part="indicador"></div>
|
|
227
258
|
<div class="ui-segmented__track" style="display: contents;"></div>
|
|
@@ -229,22 +260,22 @@ function I() {
|
|
|
229
260
|
</div>
|
|
230
261
|
`;
|
|
231
262
|
}
|
|
232
|
-
function
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
263
|
+
function U(n, a, t, i, e) {
|
|
264
|
+
const r = document.createElement("button");
|
|
265
|
+
r.type = "button", r.role = "radio", r.className = "ui-segmented__item", r.setAttribute("part", n.valor === t ? "opcao opcao-selecionada" : "opcao"), r.dataset.valor = n.valor, r.dataset.indice = String(a);
|
|
266
|
+
const o = n.valor === t;
|
|
267
|
+
if (r.setAttribute("aria-checked", String(o)), r.tabIndex = o ? 0 : -1, o && r.classList.add("ui-segmented__item--ativo"), (i || n.disabled) && (r.disabled = !0), n.icone) {
|
|
237
268
|
const l = document.createElement("span");
|
|
238
269
|
l.className = "ui-segmented__icone";
|
|
239
270
|
const c = document.createElement("ui-icone");
|
|
240
|
-
c.setAttribute("nome",
|
|
271
|
+
c.setAttribute("nome", n.icone), c.setAttribute("tamanho", "14"), l.appendChild(c), r.appendChild(l);
|
|
241
272
|
}
|
|
242
|
-
const
|
|
243
|
-
return
|
|
273
|
+
const s = document.createElement("span");
|
|
274
|
+
return s.className = "ui-segmented__texto", s.textContent = n.rotulo, r.appendChild(s), r.addEventListener("click", (l) => {
|
|
244
275
|
l.stopPropagation(), e();
|
|
245
|
-
}),
|
|
276
|
+
}), r;
|
|
246
277
|
}
|
|
247
|
-
class
|
|
278
|
+
class _ extends E {
|
|
248
279
|
constructor() {
|
|
249
280
|
super();
|
|
250
281
|
u(this, "rootElement");
|
|
@@ -253,24 +284,24 @@ class m extends b {
|
|
|
253
284
|
u(this, "slotElement");
|
|
254
285
|
u(this, "_opcoes", []);
|
|
255
286
|
u(this, "_defaultValue", "");
|
|
256
|
-
u(this, "listeners", new
|
|
287
|
+
u(this, "listeners", new w());
|
|
257
288
|
u(this, "indicadorController");
|
|
258
289
|
u(this, "handleSlotChange", () => {
|
|
259
290
|
this._opcoes.length === 0 && this.carregarOpcoes();
|
|
260
291
|
});
|
|
261
292
|
u(this, "handleKeyDown", (t) => {
|
|
262
|
-
|
|
293
|
+
D(t, this.trackElement, this.disabled, (i) => {
|
|
263
294
|
this.selecionarIndice(i);
|
|
264
295
|
});
|
|
265
296
|
});
|
|
266
297
|
const t = this.attachShadow({ mode: "open" });
|
|
267
|
-
t.innerHTML =
|
|
298
|
+
t.innerHTML = F(), 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 V(
|
|
268
299
|
this.trackElement,
|
|
269
300
|
this.indicadorElement
|
|
270
301
|
);
|
|
271
302
|
}
|
|
272
303
|
static get observedAttributes() {
|
|
273
|
-
return
|
|
304
|
+
return R;
|
|
274
305
|
}
|
|
275
306
|
connectedCallback() {
|
|
276
307
|
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();
|
|
@@ -343,10 +374,10 @@ class m extends b {
|
|
|
343
374
|
if (t.length > 0) {
|
|
344
375
|
const i = [];
|
|
345
376
|
t.forEach((e) => {
|
|
346
|
-
var
|
|
377
|
+
var r, o;
|
|
347
378
|
if (e instanceof HTMLElement) {
|
|
348
|
-
const
|
|
349
|
-
i.push({ valor:
|
|
379
|
+
const s = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((r = e.textContent) == null ? void 0 : r.trim()) || "", l = e.getAttribute("label") || e.getAttribute("rotulo") || ((o = e.textContent) == null ? void 0 : o.trim()) || s, c = e.getAttribute("icone") || e.getAttribute("icon") || void 0, d = e.hasAttribute("disabled");
|
|
380
|
+
i.push({ valor: s, rotulo: l, icone: c, disabled: d });
|
|
350
381
|
}
|
|
351
382
|
}), this._opcoes = i, this.renderizarOpcoes();
|
|
352
383
|
}
|
|
@@ -354,26 +385,26 @@ class m extends b {
|
|
|
354
385
|
renderizarOpcoes() {
|
|
355
386
|
this.trackElement.innerHTML = "";
|
|
356
387
|
const t = this.valor, i = this.disabled;
|
|
357
|
-
this._opcoes.forEach((
|
|
358
|
-
const
|
|
359
|
-
a,
|
|
388
|
+
this._opcoes.forEach((r, o) => {
|
|
389
|
+
const s = U(
|
|
360
390
|
r,
|
|
391
|
+
o,
|
|
361
392
|
t,
|
|
362
393
|
i,
|
|
363
|
-
() => this.selecionarIndice(
|
|
394
|
+
() => this.selecionarIndice(o)
|
|
364
395
|
);
|
|
365
|
-
this.trackElement.appendChild(
|
|
396
|
+
this.trackElement.appendChild(s);
|
|
366
397
|
});
|
|
367
398
|
const e = this.required || this.hasAttribute("sem-selecao-inicial");
|
|
368
399
|
!t && this._opcoes.length > 0 && !e ? this.selecionarIndice(0, !1) : this.indicadorController.atualizar(), this.atualizarValidade();
|
|
369
400
|
}
|
|
370
401
|
selecionarIndice(t, i = !0) {
|
|
371
|
-
var
|
|
402
|
+
var o, s;
|
|
372
403
|
if (this.disabled) return;
|
|
373
404
|
const e = this._opcoes[t];
|
|
374
405
|
if (!e || e.disabled) return;
|
|
375
|
-
const
|
|
376
|
-
this.setAttribute("valor", e.valor), this.internals && ((
|
|
406
|
+
const r = this.valor;
|
|
407
|
+
this.setAttribute("valor", e.valor), this.internals && ((s = (o = this.internals).setFormValue) == null || s.call(o, e.valor)), this.atualizarSelecao(e.valor), i && r !== e.valor && (this.dispatchEvent(
|
|
377
408
|
new CustomEvent("ui-change", {
|
|
378
409
|
detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
|
|
379
410
|
bubbles: !0,
|
|
@@ -388,31 +419,95 @@ class m extends b {
|
|
|
388
419
|
));
|
|
389
420
|
}
|
|
390
421
|
atualizarSelecao(t) {
|
|
391
|
-
var e,
|
|
392
|
-
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
}), this.internals && ((
|
|
422
|
+
var e, r;
|
|
423
|
+
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((o) => {
|
|
424
|
+
const s = o.dataset.valor === t;
|
|
425
|
+
o.classList.toggle("ui-segmented__item--ativo", s), z(o, "opcao-selecionada", s), o.setAttribute("aria-checked", String(s)), o.tabIndex = s ? 0 : -1, s && o.focus();
|
|
426
|
+
}), this.internals && ((r = (e = this.internals).setFormValue) == null || r.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
396
427
|
}
|
|
397
428
|
syncState() {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
429
|
+
f(this);
|
|
430
|
+
const t = S(
|
|
431
|
+
this.getAttribute("tamanho") ?? this.getAttribute("size") ?? this.getAttribute("densidade")
|
|
432
|
+
) ?? "md", i = this.hasAttribute("largura-total") || this.hasAttribute("full-width"), e = this.disabled;
|
|
433
|
+
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((o) => {
|
|
434
|
+
o.disabled = e;
|
|
401
435
|
}), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
402
436
|
}
|
|
403
437
|
}
|
|
404
|
-
class
|
|
438
|
+
class B extends _ {
|
|
439
|
+
}
|
|
440
|
+
p("ui-segmented", _);
|
|
441
|
+
p("ui-segmento", B);
|
|
442
|
+
const P = ':host{--_espaco: var(--ui-espaco-sm, 8px);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--ui-linha-espaco, var(--_espaco));box-sizing:border-box;min-width:0;max-width:100%}:host([inline]){display:inline-flex;vertical-align:middle}:host([hidden]){display:none}:host([sem-quebra]){flex-wrap:nowrap}:host([espaco="nenhum"]){--_espaco: 0}:host([espaco="xs"]){--_espaco: var(--ui-espaco-xs, 4px)}:host([espaco="sm"]){--_espaco: var(--ui-espaco-sm, 8px)}:host([espaco="md"]){--_espaco: var(--ui-espaco-md, 16px)}:host([espaco="lg"]){--_espaco: var(--ui-espaco-lg, 24px)}:host([alinhar="inicio"]){align-items:flex-start}:host([alinhar="centro"]){align-items:center}:host([alinhar="fim"]){align-items:flex-end}:host([alinhar="esticar"]){align-items:stretch}:host([justificar="centro"]){justify-content:center}:host([justificar="fim"]){justify-content:flex-end}:host([justificar="entre"]){justify-content:space-between}:host([justificar="ao-redor"]){justify-content:space-around}::slotted(*){flex:0 0 auto;width:auto;max-width:100%;margin-top:0;margin-bottom:0}::slotted(ui-campo-texto),::slotted(ui-input),::slotted(ui-lista-flutuante),::slotted(ui-select){flex:1 1 var(--ui-linha-campo-base, 12rem);min-width:0}::slotted([expandir]){flex:1 1 0;min-width:0}';
|
|
443
|
+
class X extends v {
|
|
444
|
+
static get observedAttributes() {
|
|
445
|
+
return ["tamanho", "size", "densidade", "altura", "height"];
|
|
446
|
+
}
|
|
447
|
+
constructor() {
|
|
448
|
+
super();
|
|
449
|
+
const a = this.attachShadow({ mode: "open" });
|
|
450
|
+
a.innerHTML = `<style>${P}</style><slot></slot>`;
|
|
451
|
+
}
|
|
452
|
+
connectedCallback() {
|
|
453
|
+
f(this);
|
|
454
|
+
}
|
|
455
|
+
attributeChangedCallback(a, t, i) {
|
|
456
|
+
t !== i && f(this);
|
|
457
|
+
}
|
|
458
|
+
lerTexto(a) {
|
|
459
|
+
return this.getAttribute(a);
|
|
460
|
+
}
|
|
461
|
+
definirTexto(a, t) {
|
|
462
|
+
t == null || t === "" ? this.removeAttribute(a) : this.setAttribute(a, String(t));
|
|
463
|
+
}
|
|
464
|
+
get tamanho() {
|
|
465
|
+
return this.lerTexto("tamanho");
|
|
466
|
+
}
|
|
467
|
+
set tamanho(a) {
|
|
468
|
+
this.definirTexto("tamanho", a);
|
|
469
|
+
}
|
|
470
|
+
get altura() {
|
|
471
|
+
return this.lerTexto("altura");
|
|
472
|
+
}
|
|
473
|
+
set altura(a) {
|
|
474
|
+
this.definirTexto("altura", a === null ? null : String(a));
|
|
475
|
+
}
|
|
476
|
+
get alinhar() {
|
|
477
|
+
return this.lerTexto("alinhar");
|
|
478
|
+
}
|
|
479
|
+
set alinhar(a) {
|
|
480
|
+
this.definirTexto("alinhar", a);
|
|
481
|
+
}
|
|
482
|
+
get justificar() {
|
|
483
|
+
return this.lerTexto("justificar");
|
|
484
|
+
}
|
|
485
|
+
set justificar(a) {
|
|
486
|
+
this.definirTexto("justificar", a);
|
|
487
|
+
}
|
|
488
|
+
get espaco() {
|
|
489
|
+
return this.lerTexto("espaco");
|
|
490
|
+
}
|
|
491
|
+
set espaco(a) {
|
|
492
|
+
this.definirTexto("espaco", a);
|
|
493
|
+
}
|
|
494
|
+
get semQuebra() {
|
|
495
|
+
return this.hasAttribute("sem-quebra");
|
|
496
|
+
}
|
|
497
|
+
set semQuebra(a) {
|
|
498
|
+
this.toggleAttribute("sem-quebra", !!a);
|
|
499
|
+
}
|
|
405
500
|
}
|
|
406
|
-
|
|
407
|
-
d("ui-segmento", L);
|
|
501
|
+
p("ui-linha", X);
|
|
408
502
|
export {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
503
|
+
R as A,
|
|
504
|
+
V as S,
|
|
505
|
+
$ as U,
|
|
506
|
+
X as a,
|
|
507
|
+
_ as b,
|
|
508
|
+
B as c,
|
|
509
|
+
O as d,
|
|
510
|
+
U as e,
|
|
511
|
+
F as f,
|
|
512
|
+
D as t
|
|
418
513
|
};
|