@thibezer/ui-components-kit 2.9.0 → 2.10.1
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 +138 -0
- package/README.md +7 -4
- package/dist/camadas.cjs +53 -55
- package/dist/camadas.js +254 -242
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +73 -72
- package/dist/canvas.js +3212 -2690
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-area-texto/area-texto-altura.d.ts +16 -0
- package/dist/components/ui-area-texto/area-texto-contador.d.ts +6 -0
- package/dist/components/ui-area-texto/area-texto-template.d.ts +2 -0
- package/dist/components/ui-area-texto/index.d.ts +3 -0
- package/dist/components/ui-area-texto/tipos.d.ts +19 -0
- package/dist/components/ui-area-texto/ui-area-texto.d.ts +100 -0
- package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +5 -1
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +1 -0
- package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +7 -1
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +13 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +8 -2
- package/dist/components/ui-canvas-cad/cad-feicoes-teclado.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +12 -1
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +8 -1
- package/dist/components/ui-canvas-cad/cad-recusas.d.ts +6 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +2 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +7 -0
- package/dist/components/ui-card/card-interacao.d.ts +17 -0
- package/dist/components/ui-card/card-secoes.d.ts +10 -0
- package/dist/components/ui-card/ui-card.d.ts +23 -0
- package/dist/components/ui-cores/cores-utils.d.ts +2 -0
- package/dist/components/ui-cores/tipos.d.ts +9 -2
- package/dist/components/ui-cores/ui-controle-cores.d.ts +9 -4
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +12 -9
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +1 -1
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +3 -3
- package/dist/components/ui-tabela-propriedades/propriedades-valor-misto.d.ts +25 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +7 -0
- package/dist/components/ui-texto/ui-texto.d.ts +16 -0
- package/dist/core/alvo-digitavel.d.ts +5 -0
- package/dist/core/opcoes.d.ts +7 -0
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +11 -9
- package/dist/custom-elements.json +16677 -13587
- package/dist/data.cjs +1 -1
- package/dist/data.js +72 -64
- package/dist/forms.cjs +1 -1
- package/dist/forms.d.ts +4 -0
- package/dist/forms.js +15 -12
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +2 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +15 -1
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +6 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +64 -6
- package/dist/gerencigeo-canvas/mapa_core.d.ts +4 -0
- package/dist/gerencigeo-canvas/popup_residual.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +204 -191
- package/dist/{motor-CFI84lM2.js → motor-BKT2eStP.js} +3 -3
- package/dist/motor.js +1 -1
- package/dist/opcoes-CupvWVIm.js +24 -0
- package/dist/opcoes-vdAUY5OI.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +10 -9
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +66 -58
- package/dist/tipos-elementos.d.ts +78 -0
- package/dist/tipos-react.d.ts +4 -0
- package/dist/tipos-vue.d.ts +76 -0
- package/dist/{ui-badge-BWhoGgo9.js → ui-badge-B5J_c5P5.js} +1 -1
- package/dist/{ui-badge-SIR81R9l.cjs → ui-badge-DC4y6Dik.cjs} +1 -1
- package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-19tIrmBK.js} +91 -93
- package/dist/ui-campo-texto-CH8mzX61.cjs +16 -0
- package/dist/ui-card-0wu4rjEX.cjs +20 -0
- package/dist/ui-card-DRtpOo3l.js +143 -0
- package/dist/ui-controle-cores-CohlwXJK.cjs +32 -0
- package/dist/ui-controle-cores-DMtTUtLk.js +292 -0
- package/dist/{ui-linha-BYAX4W6x.cjs → ui-linha-C306zxWG.cjs} +6 -6
- package/dist/{ui-linha-aqLlaYi7.js → ui-linha-C_azWkcG.js} +103 -99
- package/dist/ui-seletor-cor-D9iI7yew.js +413 -0
- package/dist/ui-seletor-cor-Ft06TEUH.cjs +110 -0
- package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BL-x_-SM.js} +460 -173
- package/dist/ui-switch-C0i_3QXu.cjs +66 -0
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +141 -0
- package/dist/{ui-tabela-propriedades-DoL4SE0r.js → ui-tabela-propriedades-DuaC4sFX.js} +1295 -1195
- package/package.json +1 -1
- package/dist/opcoes-CJYLi6kd.js +0 -12
- package/dist/opcoes-CkyDxBuQ.cjs +0 -1
- package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
- package/dist/ui-card-BNYCQ7g-.js +0 -119
- package/dist/ui-card-BrjBL-yo.cjs +0 -20
- package/dist/ui-controle-cores-DgEza3wF.js +0 -612
- package/dist/ui-controle-cores-uY__TgwW.cjs +0 -117
- package/dist/ui-switch-D9a8XlVX.cjs +0 -53
- package/dist/ui-tabela-propriedades-CjK2gG14.cjs +0 -141
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { d as
|
|
5
|
-
import { e as
|
|
6
|
-
import { L as
|
|
7
|
-
import { F as
|
|
8
|
-
import { a as
|
|
9
|
-
import { b as
|
|
10
|
-
const
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var w = (n, a, t) => a in n ? y(n, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[a] = t;
|
|
3
|
+
var l = (n, a, t) => w(n, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { d as g, S as b } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
+
import { e as f, a as p, b as E } from "./opcoes-CupvWVIm.js";
|
|
6
|
+
import { L as z } from "./listener-bag-DQgv7OON.js";
|
|
7
|
+
import { F as S } from "./ui-campo-texto-19tIrmBK.js";
|
|
8
|
+
import { a as k } from "./parts-CaoQiCfI.js";
|
|
9
|
+
import { b as v, c as C } from "./altura-controle-vxQiXG4q.js";
|
|
10
|
+
const I = ':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;overflow-wrap:break-word}.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;-webkit-hyphens:auto;hyphens:auto}.ui-texto--truncar{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.ui-texto--linhas{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--ui-texto-linhas, 3);line-clamp:var(--ui-texto-linhas, 3);overflow:hidden}@media print{.ui-texto--linhas{-webkit-line-clamp:unset;line-clamp:unset;display:block;overflow:visible}}', x = ["h1", "h2", "h3", "h4", "h5", "h6", "corpo", "corpo-sm", "caption", "codigo"], T = ["primaria", "secundaria", "destaque", "erro", "sucesso", "alerta"], q = ["normal", "medio", "seminegrito", "negrito"], O = ["esquerda", "centro", "direita", "justificado"], L = /* @__PURE__ */ new Set([
|
|
11
11
|
"p",
|
|
12
12
|
"span",
|
|
13
13
|
"div",
|
|
@@ -26,16 +26,20 @@ const k = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:va
|
|
|
26
26
|
"pre",
|
|
27
27
|
"b",
|
|
28
28
|
"i"
|
|
29
|
-
]);
|
|
30
|
-
class
|
|
29
|
+
]), N = 50;
|
|
30
|
+
class j extends b {
|
|
31
31
|
constructor() {
|
|
32
32
|
super();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
typeof this.attachShadow == "function" && typeof document < "u"
|
|
33
|
+
l(this, "container", null);
|
|
34
|
+
l(this, "shadow", null);
|
|
35
|
+
if (typeof this.attachShadow == "function" && typeof document < "u") {
|
|
36
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
37
|
+
const t = document.createElement("p");
|
|
38
|
+
t.className = "ui-texto ui-texto--corpo", t.setAttribute("part", "base"), t.appendChild(document.createElement("slot")), this.container = t, this.shadow.innerHTML = `<style>${I}</style>`, this.shadow.appendChild(t);
|
|
39
|
+
}
|
|
36
40
|
}
|
|
37
41
|
static get observedAttributes() {
|
|
38
|
-
return ["variante", "tag", "cor", "peso", "alinhamento", "truncar"];
|
|
42
|
+
return ["variante", "tag", "cor", "peso", "alinhamento", "truncar", "linhas"];
|
|
39
43
|
}
|
|
40
44
|
connectedCallback() {
|
|
41
45
|
this.render();
|
|
@@ -47,11 +51,11 @@ class O extends v {
|
|
|
47
51
|
const t = this.getAttribute("tag");
|
|
48
52
|
if (t) {
|
|
49
53
|
const e = t.toLowerCase().trim();
|
|
50
|
-
if (
|
|
54
|
+
if (L.has(e))
|
|
51
55
|
return e;
|
|
52
56
|
console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`);
|
|
53
57
|
}
|
|
54
|
-
const i =
|
|
58
|
+
const i = f(this.getAttribute("variante"), x, "corpo");
|
|
55
59
|
switch (i) {
|
|
56
60
|
case "h1":
|
|
57
61
|
case "h2":
|
|
@@ -71,29 +75,29 @@ class O extends v {
|
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
render() {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
78
|
+
const { container: t, shadow: i } = this;
|
|
79
|
+
if (!t || !i) return;
|
|
80
|
+
const e = this.resolveTag(), r = f(this.getAttribute("variante"), x, "corpo"), o = p(this.getAttribute("cor"), T), s = p(this.getAttribute("peso"), q), u = p(this.getAttribute("alinhamento"), O), c = this.hasAttribute("truncar"), h = c ? 0 : E(this.getAttribute("linhas"), 1, N, 0);
|
|
81
|
+
let d = t;
|
|
82
|
+
t.tagName.toLowerCase() !== e && (d = document.createElement(e), d.setAttribute("part", "base"), d.appendChild(document.createElement("slot")), i.replaceChild(d, t), this.container = d);
|
|
83
|
+
const m = ["ui-texto", `ui-texto--${r}`];
|
|
84
|
+
o && m.push(`ui-texto--cor-${o}`), s && m.push(`ui-texto--peso-${s}`), u && m.push(`ui-texto--alinhamento-${u}`), c && m.push("ui-texto--truncar"), h > 0 && m.push("ui-texto--linhas"), d.className = m.join(" "), h > 0 ? d.style.setProperty("--ui-texto-linhas", String(h)) : d.style.removeProperty("--ui-texto-linhas");
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
class
|
|
87
|
+
g("ui-texto", j);
|
|
88
|
+
const M = ':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}', _ = ["xs", "sm", "md", "lg", "xl"], $ = ["online", "offline", "ausente", "ocupado"], H = 8, V = 512;
|
|
89
|
+
class D extends b {
|
|
86
90
|
constructor() {
|
|
87
91
|
super();
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
l(this, "avatarElement");
|
|
93
|
+
l(this, "statusElement");
|
|
90
94
|
/** O que este componente escreveu em aria-label / aria-hidden (para distinguir do que o consumidor definiu). */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
l(this, "_rotuloAuto", null);
|
|
96
|
+
l(this, "_ocultoAuto", !1);
|
|
97
|
+
l(this, "_sincronizando", !1);
|
|
94
98
|
const t = this.attachShadow({ mode: "open" });
|
|
95
99
|
t.innerHTML = `
|
|
96
|
-
<style>${
|
|
100
|
+
<style>${M}</style>
|
|
97
101
|
<div class="ui-avatar">
|
|
98
102
|
<span class="ui-avatar__content"></span>
|
|
99
103
|
</div>
|
|
@@ -146,22 +150,22 @@ class $ extends v {
|
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
syncState() {
|
|
149
|
-
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), r = this.getAttribute("formato"), o =
|
|
153
|
+
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), r = this.getAttribute("formato"), o = p(this.getAttribute("status"), $);
|
|
150
154
|
this.avatarElement.className = "ui-avatar";
|
|
151
|
-
const s =
|
|
152
|
-
s ? (this.avatarElement.classList.add(`ui-avatar--${s}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(
|
|
155
|
+
const s = p(e, _), u = parseInt(e, 10);
|
|
156
|
+
s ? (this.avatarElement.classList.add(`ui-avatar--${s}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(u) && u >= H && u <= V ? this.avatarElement.style.setProperty("--ui-tamanho-avatar", `${u}px`) : (this.avatarElement.classList.add(`ui-avatar--${f(null, _, "md")}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")), r === "quadrado" && this.avatarElement.classList.add("ui-avatar--quadrado");
|
|
153
157
|
const c = this.avatarElement.querySelector(".ui-avatar__content");
|
|
154
158
|
if (c)
|
|
155
159
|
if (t) {
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
|
|
160
|
+
const h = c.querySelector("img");
|
|
161
|
+
if (h && h.getAttribute("src") === t)
|
|
162
|
+
h.alt = "";
|
|
159
163
|
else {
|
|
160
164
|
c.textContent = "";
|
|
161
|
-
const
|
|
162
|
-
|
|
165
|
+
const d = document.createElement("img");
|
|
166
|
+
d.className = "ui-avatar__img", d.src = t, d.alt = "", d.onerror = () => {
|
|
163
167
|
this.renderFallback(c, this.lerNome());
|
|
164
|
-
}, c.appendChild(
|
|
168
|
+
}, c.appendChild(d);
|
|
165
169
|
}
|
|
166
170
|
} else
|
|
167
171
|
c.textContent = "", this.renderFallback(c, i);
|
|
@@ -176,11 +180,11 @@ class $ extends v {
|
|
|
176
180
|
`;
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
|
-
|
|
180
|
-
class
|
|
183
|
+
g("ui-avatar", D);
|
|
184
|
+
class R {
|
|
181
185
|
constructor(a, t) {
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
l(this, "rafId", null);
|
|
187
|
+
l(this, "resizeObserver");
|
|
184
188
|
this.trackElement = a, this.indicadorElement = t;
|
|
185
189
|
}
|
|
186
190
|
iniciarObserver(a, t) {
|
|
@@ -210,13 +214,13 @@ class V {
|
|
|
210
214
|
});
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
|
-
function
|
|
217
|
+
function F(n, a, t, i) {
|
|
214
218
|
if (t) return;
|
|
215
219
|
const e = Array.from(
|
|
216
220
|
a.querySelectorAll(".ui-segmented__item:not(:disabled)")
|
|
217
221
|
);
|
|
218
222
|
if (e.length === 0) return;
|
|
219
|
-
const r = e.findIndex((
|
|
223
|
+
const r = e.findIndex((u) => u.classList.contains("ui-segmented__item--ativo"));
|
|
220
224
|
let o = r;
|
|
221
225
|
if (n.key === "ArrowRight" || n.key === "ArrowDown")
|
|
222
226
|
n.preventDefault(), o = (r + 1) % e.length;
|
|
@@ -230,11 +234,11 @@ function D(n, a, t, i) {
|
|
|
230
234
|
return;
|
|
231
235
|
const s = e[o];
|
|
232
236
|
if (s && s.dataset.indice) {
|
|
233
|
-
const
|
|
234
|
-
i(
|
|
237
|
+
const u = parseInt(s.dataset.indice, 10);
|
|
238
|
+
i(u);
|
|
235
239
|
}
|
|
236
240
|
}
|
|
237
|
-
const
|
|
241
|
+
const P = ':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)}}', U = [
|
|
238
242
|
"valor",
|
|
239
243
|
"value",
|
|
240
244
|
"name",
|
|
@@ -250,9 +254,9 @@ const H = ':host{display:inline-flex;vertical-align:middle;box-sizing:border-box
|
|
|
250
254
|
"required",
|
|
251
255
|
"mensagem-validacao"
|
|
252
256
|
];
|
|
253
|
-
function
|
|
257
|
+
function B() {
|
|
254
258
|
return `
|
|
255
|
-
<style>${
|
|
259
|
+
<style>${P}</style>
|
|
256
260
|
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
257
261
|
<div class="ui-segmented__indicador" part="indicador"></div>
|
|
258
262
|
<div class="ui-segmented__track" style="display: contents;"></div>
|
|
@@ -260,48 +264,48 @@ function F() {
|
|
|
260
264
|
</div>
|
|
261
265
|
`;
|
|
262
266
|
}
|
|
263
|
-
function
|
|
267
|
+
function X(n, a, t, i, e) {
|
|
264
268
|
const r = document.createElement("button");
|
|
265
269
|
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
270
|
const o = n.valor === t;
|
|
267
271
|
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) {
|
|
268
|
-
const
|
|
269
|
-
|
|
272
|
+
const u = document.createElement("span");
|
|
273
|
+
u.className = "ui-segmented__icone";
|
|
270
274
|
const c = document.createElement("ui-icone");
|
|
271
|
-
c.setAttribute("nome", n.icone), c.setAttribute("tamanho", "14"),
|
|
275
|
+
c.setAttribute("nome", n.icone), c.setAttribute("tamanho", "14"), u.appendChild(c), r.appendChild(u);
|
|
272
276
|
}
|
|
273
277
|
const s = document.createElement("span");
|
|
274
|
-
return s.className = "ui-segmented__texto", s.textContent = n.rotulo, r.appendChild(s), r.addEventListener("click", (
|
|
275
|
-
|
|
278
|
+
return s.className = "ui-segmented__texto", s.textContent = n.rotulo, r.appendChild(s), r.addEventListener("click", (u) => {
|
|
279
|
+
u.stopPropagation(), e();
|
|
276
280
|
}), r;
|
|
277
281
|
}
|
|
278
|
-
class
|
|
282
|
+
class A extends S {
|
|
279
283
|
constructor() {
|
|
280
284
|
super();
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
l(this, "rootElement");
|
|
286
|
+
l(this, "trackElement");
|
|
287
|
+
l(this, "indicadorElement");
|
|
288
|
+
l(this, "slotElement");
|
|
289
|
+
l(this, "_opcoes", []);
|
|
290
|
+
l(this, "_defaultValue", "");
|
|
291
|
+
l(this, "listeners", new z());
|
|
292
|
+
l(this, "indicadorController");
|
|
293
|
+
l(this, "handleSlotChange", () => {
|
|
290
294
|
this._opcoes.length === 0 && this.carregarOpcoes();
|
|
291
295
|
});
|
|
292
|
-
|
|
293
|
-
|
|
296
|
+
l(this, "handleKeyDown", (t) => {
|
|
297
|
+
F(t, this.trackElement, this.disabled, (i) => {
|
|
294
298
|
this.selecionarIndice(i);
|
|
295
299
|
});
|
|
296
300
|
});
|
|
297
301
|
const t = this.attachShadow({ mode: "open" });
|
|
298
|
-
t.innerHTML =
|
|
302
|
+
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 R(
|
|
299
303
|
this.trackElement,
|
|
300
304
|
this.indicadorElement
|
|
301
305
|
);
|
|
302
306
|
}
|
|
303
307
|
static get observedAttributes() {
|
|
304
|
-
return
|
|
308
|
+
return U;
|
|
305
309
|
}
|
|
306
310
|
connectedCallback() {
|
|
307
311
|
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();
|
|
@@ -376,8 +380,8 @@ class _ extends E {
|
|
|
376
380
|
t.forEach((e) => {
|
|
377
381
|
var r, o;
|
|
378
382
|
if (e instanceof HTMLElement) {
|
|
379
|
-
const s = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((r = e.textContent) == null ? void 0 : r.trim()) || "",
|
|
380
|
-
i.push({ valor: s, rotulo:
|
|
383
|
+
const s = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((r = e.textContent) == null ? void 0 : r.trim()) || "", u = e.getAttribute("label") || e.getAttribute("rotulo") || ((o = e.textContent) == null ? void 0 : o.trim()) || s, c = e.getAttribute("icone") || e.getAttribute("icon") || void 0, h = e.hasAttribute("disabled");
|
|
384
|
+
i.push({ valor: s, rotulo: u, icone: c, disabled: h });
|
|
381
385
|
}
|
|
382
386
|
}), this._opcoes = i, this.renderizarOpcoes();
|
|
383
387
|
}
|
|
@@ -386,7 +390,7 @@ class _ extends E {
|
|
|
386
390
|
this.trackElement.innerHTML = "";
|
|
387
391
|
const t = this.valor, i = this.disabled;
|
|
388
392
|
this._opcoes.forEach((r, o) => {
|
|
389
|
-
const s =
|
|
393
|
+
const s = X(
|
|
390
394
|
r,
|
|
391
395
|
o,
|
|
392
396
|
t,
|
|
@@ -422,12 +426,12 @@ class _ extends E {
|
|
|
422
426
|
var e, r;
|
|
423
427
|
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((o) => {
|
|
424
428
|
const s = o.dataset.valor === t;
|
|
425
|
-
o.classList.toggle("ui-segmented__item--ativo", s),
|
|
429
|
+
o.classList.toggle("ui-segmented__item--ativo", s), k(o, "opcao-selecionada", s), o.setAttribute("aria-checked", String(s)), o.tabIndex = s ? 0 : -1, s && o.focus();
|
|
426
430
|
}), this.internals && ((r = (e = this.internals).setFormValue) == null || r.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
427
431
|
}
|
|
428
432
|
syncState() {
|
|
429
|
-
|
|
430
|
-
const t =
|
|
433
|
+
v(this);
|
|
434
|
+
const t = C(
|
|
431
435
|
this.getAttribute("tamanho") ?? this.getAttribute("size") ?? this.getAttribute("densidade")
|
|
432
436
|
) ?? "md", i = this.hasAttribute("largura-total") || this.hasAttribute("full-width"), e = this.disabled;
|
|
433
437
|
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) => {
|
|
@@ -435,25 +439,25 @@ class _ extends E {
|
|
|
435
439
|
}), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
436
440
|
}
|
|
437
441
|
}
|
|
438
|
-
class
|
|
442
|
+
class G extends A {
|
|
439
443
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
class
|
|
444
|
+
g("ui-segmented", A);
|
|
445
|
+
g("ui-segmento", G);
|
|
446
|
+
const K = ':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}';
|
|
447
|
+
class Q extends b {
|
|
444
448
|
static get observedAttributes() {
|
|
445
449
|
return ["tamanho", "size", "densidade", "altura", "height"];
|
|
446
450
|
}
|
|
447
451
|
constructor() {
|
|
448
452
|
super();
|
|
449
453
|
const a = this.attachShadow({ mode: "open" });
|
|
450
|
-
a.innerHTML = `<style>${
|
|
454
|
+
a.innerHTML = `<style>${K}</style><slot></slot>`;
|
|
451
455
|
}
|
|
452
456
|
connectedCallback() {
|
|
453
|
-
|
|
457
|
+
v(this);
|
|
454
458
|
}
|
|
455
459
|
attributeChangedCallback(a, t, i) {
|
|
456
|
-
t !== i &&
|
|
460
|
+
t !== i && v(this);
|
|
457
461
|
}
|
|
458
462
|
lerTexto(a) {
|
|
459
463
|
return this.getAttribute(a);
|
|
@@ -498,16 +502,16 @@ class X extends v {
|
|
|
498
502
|
this.toggleAttribute("sem-quebra", !!a);
|
|
499
503
|
}
|
|
500
504
|
}
|
|
501
|
-
|
|
505
|
+
g("ui-linha", Q);
|
|
502
506
|
export {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
507
|
+
U as A,
|
|
508
|
+
R as S,
|
|
509
|
+
D as U,
|
|
510
|
+
Q as a,
|
|
511
|
+
A as b,
|
|
512
|
+
G as c,
|
|
513
|
+
j as d,
|
|
514
|
+
X as e,
|
|
515
|
+
B as f,
|
|
516
|
+
F as t
|
|
513
517
|
};
|