@thibezer/ui-components-kit 2.7.0 → 2.8.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 +31 -0
- package/README.md +28 -4
- 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 +98 -94
- package/dist/camadas.js +646 -574
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +28 -28
- package/dist/canvas.js +1110 -980
- package/dist/components/ui-camadas/camadas-host.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -1
- package/dist/components/ui-camadas/camadas-render.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +12 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +4 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +13 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +11 -0
- package/dist/components/ui-linha/index.d.ts +1 -0
- package/dist/components/ui-linha/ui-linha.d.ts +48 -0
- package/dist/core/altura-controle.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +29 -20
- package/dist/custom-elements.json +22245 -21471
- package/dist/data.cjs +1 -1
- package/dist/data.js +1 -1
- 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/feature_popup.d.ts +2 -0
- package/dist/gerencigeo-canvas/mapa_core.d.ts +6 -0
- package/dist/gerencigeo-canvas/popup_gate.d.ts +30 -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/register.cjs +1 -1
- package/dist/register.js +5 -5
- package/dist/tipos-elementos.d.ts +38 -3
- package/dist/tipos-react.d.ts +2 -0
- package/dist/tipos-vue.d.ts +34 -3
- package/dist/{ui-badge-ChiiiO1r.js → ui-badge-BWhoGgo9.js} +4 -4
- package/dist/{ui-badge-DUCxyAG6.cjs → ui-badge-SIR81R9l.cjs} +3 -3
- 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-kit.css +1 -1
- package/dist/ui-linha-C6HBnsaw.cjs +19 -0
- package/dist/{ui-segmented-kbO1BLVs.js → ui-linha-nCDh2wPm.js} +162 -94
- package/dist/{ui-switch-BX6U5Ykm.cjs → ui-switch-D9a8XlVX.cjs} +9 -9
- package/dist/{ui-switch-DO5jR0hy.js → ui-switch-DO1R0Ce7.js} +55 -55
- package/package.json +2 -2
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.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-campo-texto-CHTfMO-H.cjs +0 -16
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-gum_jDdI.js +0 -380
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- 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-modal-DBOtSTbR.js +0 -238
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-segmented-BOaGRQw4.cjs +0 -19
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-skeleton-BilwGdOm.js +0 -634
- package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
- package/dist/ui-skeleton-W9uwIceA.js +0 -585
- package/dist/ui-skeleton-gZrJipCC.cjs +0 -52
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (
|
|
4
|
-
import { d as p, S as
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var y = (s, a, t) => a in s ? A(s, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[a] = t;
|
|
3
|
+
var u = (s, a, t) => y(s, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
import { d as p, S as v } from "./ssr-safe-5cWfJP-s.js";
|
|
5
5
|
import { e as g, a as m } from "./opcoes-CJYLi6kd.js";
|
|
6
|
-
import { L as
|
|
7
|
-
import { F as E } from "./ui-campo-texto-
|
|
8
|
-
import { a as
|
|
9
|
-
|
|
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([
|
|
10
11
|
"p",
|
|
11
12
|
"span",
|
|
12
13
|
"div",
|
|
@@ -26,12 +27,12 @@ const z = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:va
|
|
|
26
27
|
"b",
|
|
27
28
|
"i"
|
|
28
29
|
]);
|
|
29
|
-
class O extends
|
|
30
|
+
class O extends v {
|
|
30
31
|
constructor() {
|
|
31
32
|
super();
|
|
32
33
|
u(this, "container");
|
|
33
34
|
u(this, "shadow");
|
|
34
|
-
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);
|
|
35
36
|
}
|
|
36
37
|
static get observedAttributes() {
|
|
37
38
|
return ["variante", "tag", "cor", "peso", "alinhamento", "truncar"];
|
|
@@ -46,11 +47,11 @@ class O extends b {
|
|
|
46
47
|
const t = this.getAttribute("tag");
|
|
47
48
|
if (t) {
|
|
48
49
|
const e = t.toLowerCase().trim();
|
|
49
|
-
if (
|
|
50
|
+
if (q.has(e))
|
|
50
51
|
return e;
|
|
51
52
|
console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`);
|
|
52
53
|
}
|
|
53
|
-
const i = g(this.getAttribute("variante"),
|
|
54
|
+
const i = g(this.getAttribute("variante"), b, "corpo");
|
|
54
55
|
switch (i) {
|
|
55
56
|
case "h1":
|
|
56
57
|
case "h2":
|
|
@@ -70,18 +71,18 @@ class O extends b {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
render() {
|
|
73
|
-
const t = this.resolveTag(), i = g(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), n = this.hasAttribute("truncar");
|
|
74
75
|
if (this.container.tagName.toLowerCase() !== t) {
|
|
75
76
|
const c = document.createElement(t);
|
|
76
77
|
c.appendChild(document.createElement("slot")), this.shadow.replaceChild(c, this.container), this.container = c;
|
|
77
78
|
}
|
|
78
79
|
const l = ["ui-texto", `ui-texto--${i}`];
|
|
79
|
-
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}`), n && l.push("ui-texto--truncar"), this.container.className = l.join(" ");
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
p("ui-texto", O);
|
|
83
|
-
const
|
|
84
|
-
class
|
|
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"], j = ["online", "offline", "ausente", "ocupado"], N = 8, M = 512;
|
|
85
|
+
class $ extends v {
|
|
85
86
|
constructor() {
|
|
86
87
|
super();
|
|
87
88
|
u(this, "avatarElement");
|
|
@@ -92,7 +93,7 @@ class M extends b {
|
|
|
92
93
|
u(this, "_sincronizando", !1);
|
|
93
94
|
const t = this.attachShadow({ mode: "open" });
|
|
94
95
|
t.innerHTML = `
|
|
95
|
-
<style>${
|
|
96
|
+
<style>${L}</style>
|
|
96
97
|
<div class="ui-avatar">
|
|
97
98
|
<span class="ui-avatar__content"></span>
|
|
98
99
|
</div>
|
|
@@ -123,8 +124,8 @@ class M extends b {
|
|
|
123
124
|
if (i.length === 0) return "?";
|
|
124
125
|
if (i.length === 1)
|
|
125
126
|
return Array.from(i[0]).slice(0, 2).join("").toUpperCase();
|
|
126
|
-
const e = Array.from(i[0])[0],
|
|
127
|
-
return (e +
|
|
127
|
+
const e = Array.from(i[0])[0], r = Array.from(i[i.length - 1])[0];
|
|
128
|
+
return (e + r).toUpperCase();
|
|
128
129
|
}
|
|
129
130
|
lerNome() {
|
|
130
131
|
return this.getAttribute("nome") || this.getAttribute("name") || "";
|
|
@@ -134,21 +135,21 @@ class M extends b {
|
|
|
134
135
|
* Um `aria-label`/`aria-hidden` definido pelo consumidor nunca é sobrescrito.
|
|
135
136
|
*/
|
|
136
137
|
sincronizarAcessibilidade(t, i) {
|
|
137
|
-
const e = this.getAttribute("aria-label"),
|
|
138
|
-
if (!(
|
|
138
|
+
const e = this.getAttribute("aria-label"), r = e !== null && e !== this._rotuloAuto, o = this.hasAttribute("aria-hidden") && !this._ocultoAuto;
|
|
139
|
+
if (!(r || o)) {
|
|
139
140
|
if (this._sincronizando = !0, t) {
|
|
140
|
-
const
|
|
141
|
-
this.setAttribute("role", "img"), this.setAttribute("aria-label",
|
|
141
|
+
const n = i ? `${t}, ${i}` : t;
|
|
142
|
+
this.setAttribute("role", "img"), this.setAttribute("aria-label", n), this._rotuloAuto = n, this.removeAttribute("aria-hidden"), this._ocultoAuto = !1;
|
|
142
143
|
} else
|
|
143
144
|
this._rotuloAuto !== null && this.removeAttribute("aria-label"), this._rotuloAuto = null, this.removeAttribute("role"), this.setAttribute("aria-hidden", "true"), this._ocultoAuto = !0;
|
|
144
145
|
this._sincronizando = !1;
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
syncState() {
|
|
148
|
-
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(),
|
|
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"), j);
|
|
149
150
|
this.avatarElement.className = "ui-avatar";
|
|
150
|
-
const
|
|
151
|
-
|
|
151
|
+
const n = m(e, x), l = parseInt(e, 10);
|
|
152
|
+
n ? (this.avatarElement.classList.add(`ui-avatar--${n}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(l) && l >= N && 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");
|
|
152
153
|
const c = this.avatarElement.querySelector(".ui-avatar__content");
|
|
153
154
|
if (c)
|
|
154
155
|
if (t) {
|
|
@@ -175,17 +176,17 @@ class M extends b {
|
|
|
175
176
|
`;
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
p("ui-avatar",
|
|
179
|
-
class
|
|
180
|
-
constructor(
|
|
179
|
+
p("ui-avatar", $);
|
|
180
|
+
class V {
|
|
181
|
+
constructor(a, t) {
|
|
181
182
|
u(this, "rafId", null);
|
|
182
183
|
u(this, "resizeObserver");
|
|
183
|
-
this.trackElement =
|
|
184
|
+
this.trackElement = a, this.indicadorElement = t;
|
|
184
185
|
}
|
|
185
|
-
iniciarObserver(
|
|
186
|
+
iniciarObserver(a, t) {
|
|
186
187
|
typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
|
|
187
188
|
this.atualizar(), t && t();
|
|
188
|
-
}), this.resizeObserver.observe(
|
|
189
|
+
}), this.resizeObserver.observe(a));
|
|
189
190
|
}
|
|
190
191
|
destruir() {
|
|
191
192
|
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
@@ -193,56 +194,59 @@ class $ {
|
|
|
193
194
|
atualizar() {
|
|
194
195
|
this.rafId !== null && cancelAnimationFrame(this.rafId), this.rafId = requestAnimationFrame(() => {
|
|
195
196
|
this.rafId = null;
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
197
|
+
const a = this.trackElement.querySelector(".ui-segmented__item--ativo");
|
|
198
|
+
if (!a) {
|
|
198
199
|
this.indicadorElement.style.opacity = "0";
|
|
199
200
|
return;
|
|
200
201
|
}
|
|
201
|
-
const t = Math.round(
|
|
202
|
+
const t = Math.round(a.offsetLeft), i = Math.round(a.offsetWidth);
|
|
202
203
|
this.indicadorElement.style.transform = `translateX(${t}px)`, this.indicadorElement.style.width = `${i}px`, this.indicadorElement.style.opacity = "1";
|
|
203
204
|
});
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function D(s, a, t, i) {
|
|
207
208
|
if (t) return;
|
|
208
209
|
const e = Array.from(
|
|
209
|
-
|
|
210
|
+
a.querySelectorAll(".ui-segmented__item:not(:disabled)")
|
|
210
211
|
);
|
|
211
212
|
if (e.length === 0) return;
|
|
212
|
-
const
|
|
213
|
-
let o =
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
else if (
|
|
217
|
-
|
|
218
|
-
else if (
|
|
219
|
-
|
|
220
|
-
else if (
|
|
221
|
-
|
|
213
|
+
const r = e.findIndex((l) => l.classList.contains("ui-segmented__item--ativo"));
|
|
214
|
+
let o = r;
|
|
215
|
+
if (s.key === "ArrowRight" || s.key === "ArrowDown")
|
|
216
|
+
s.preventDefault(), o = (r + 1) % e.length;
|
|
217
|
+
else if (s.key === "ArrowLeft" || s.key === "ArrowUp")
|
|
218
|
+
s.preventDefault(), o = (r - 1 + e.length) % e.length;
|
|
219
|
+
else if (s.key === "Home")
|
|
220
|
+
s.preventDefault(), o = 0;
|
|
221
|
+
else if (s.key === "End")
|
|
222
|
+
s.preventDefault(), o = e.length - 1;
|
|
222
223
|
else
|
|
223
224
|
return;
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
const l = parseInt(
|
|
225
|
+
const n = e[o];
|
|
226
|
+
if (n && n.dataset.indice) {
|
|
227
|
+
const l = parseInt(n.dataset.indice, 10);
|
|
227
228
|
i(l);
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
|
-
const
|
|
231
|
+
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;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)}}', F = [
|
|
231
232
|
"valor",
|
|
232
233
|
"value",
|
|
233
234
|
"name",
|
|
234
235
|
"disabled",
|
|
235
236
|
"tamanho",
|
|
236
237
|
"size",
|
|
238
|
+
"densidade",
|
|
239
|
+
"altura",
|
|
240
|
+
"height",
|
|
237
241
|
"largura-total",
|
|
238
242
|
"full-width",
|
|
239
243
|
"obrigatorio",
|
|
240
244
|
"required",
|
|
241
245
|
"mensagem-validacao"
|
|
242
246
|
];
|
|
243
|
-
function
|
|
247
|
+
function U() {
|
|
244
248
|
return `
|
|
245
|
-
<style>${
|
|
249
|
+
<style>${H}</style>
|
|
246
250
|
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
247
251
|
<div class="ui-segmented__indicador" part="indicador"></div>
|
|
248
252
|
<div class="ui-segmented__track" style="display: contents;"></div>
|
|
@@ -250,22 +254,22 @@ function j() {
|
|
|
250
254
|
</div>
|
|
251
255
|
`;
|
|
252
256
|
}
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
const o =
|
|
257
|
-
if (
|
|
257
|
+
function R(s, a, t, i, e) {
|
|
258
|
+
const r = document.createElement("button");
|
|
259
|
+
r.type = "button", r.role = "radio", r.className = "ui-segmented__item", r.setAttribute("part", s.valor === t ? "opcao opcao-selecionada" : "opcao"), r.dataset.valor = s.valor, r.dataset.indice = String(a);
|
|
260
|
+
const o = s.valor === t;
|
|
261
|
+
if (r.setAttribute("aria-checked", String(o)), r.tabIndex = o ? 0 : -1, o && r.classList.add("ui-segmented__item--ativo"), (i || s.disabled) && (r.disabled = !0), s.icone) {
|
|
258
262
|
const l = document.createElement("span");
|
|
259
263
|
l.className = "ui-segmented__icone";
|
|
260
264
|
const c = document.createElement("ui-icone");
|
|
261
|
-
c.setAttribute("nome",
|
|
265
|
+
c.setAttribute("nome", s.icone), c.setAttribute("tamanho", "14"), l.appendChild(c), r.appendChild(l);
|
|
262
266
|
}
|
|
263
|
-
const
|
|
264
|
-
return
|
|
267
|
+
const n = document.createElement("span");
|
|
268
|
+
return n.className = "ui-segmented__texto", n.textContent = s.rotulo, r.appendChild(n), r.addEventListener("click", (l) => {
|
|
265
269
|
l.stopPropagation(), e();
|
|
266
|
-
}),
|
|
270
|
+
}), r;
|
|
267
271
|
}
|
|
268
|
-
class
|
|
272
|
+
class _ extends E {
|
|
269
273
|
constructor() {
|
|
270
274
|
super();
|
|
271
275
|
u(this, "rootElement");
|
|
@@ -274,24 +278,24 @@ class x extends E {
|
|
|
274
278
|
u(this, "slotElement");
|
|
275
279
|
u(this, "_opcoes", []);
|
|
276
280
|
u(this, "_defaultValue", "");
|
|
277
|
-
u(this, "listeners", new
|
|
281
|
+
u(this, "listeners", new w());
|
|
278
282
|
u(this, "indicadorController");
|
|
279
283
|
u(this, "handleSlotChange", () => {
|
|
280
284
|
this._opcoes.length === 0 && this.carregarOpcoes();
|
|
281
285
|
});
|
|
282
286
|
u(this, "handleKeyDown", (t) => {
|
|
283
|
-
|
|
287
|
+
D(t, this.trackElement, this.disabled, (i) => {
|
|
284
288
|
this.selecionarIndice(i);
|
|
285
289
|
});
|
|
286
290
|
});
|
|
287
291
|
const t = this.attachShadow({ mode: "open" });
|
|
288
|
-
t.innerHTML =
|
|
292
|
+
t.innerHTML = U(), 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(
|
|
289
293
|
this.trackElement,
|
|
290
294
|
this.indicadorElement
|
|
291
295
|
);
|
|
292
296
|
}
|
|
293
297
|
static get observedAttributes() {
|
|
294
|
-
return
|
|
298
|
+
return F;
|
|
295
299
|
}
|
|
296
300
|
connectedCallback() {
|
|
297
301
|
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();
|
|
@@ -364,10 +368,10 @@ class x extends E {
|
|
|
364
368
|
if (t.length > 0) {
|
|
365
369
|
const i = [];
|
|
366
370
|
t.forEach((e) => {
|
|
367
|
-
var
|
|
371
|
+
var r, o;
|
|
368
372
|
if (e instanceof HTMLElement) {
|
|
369
|
-
const
|
|
370
|
-
i.push({ valor:
|
|
373
|
+
const n = 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()) || n, c = e.getAttribute("icone") || e.getAttribute("icon") || void 0, d = e.hasAttribute("disabled");
|
|
374
|
+
i.push({ valor: n, rotulo: l, icone: c, disabled: d });
|
|
371
375
|
}
|
|
372
376
|
}), this._opcoes = i, this.renderizarOpcoes();
|
|
373
377
|
}
|
|
@@ -375,26 +379,26 @@ class x extends E {
|
|
|
375
379
|
renderizarOpcoes() {
|
|
376
380
|
this.trackElement.innerHTML = "";
|
|
377
381
|
const t = this.valor, i = this.disabled;
|
|
378
|
-
this._opcoes.forEach((
|
|
379
|
-
const
|
|
380
|
-
|
|
382
|
+
this._opcoes.forEach((r, o) => {
|
|
383
|
+
const n = R(
|
|
384
|
+
r,
|
|
381
385
|
o,
|
|
382
386
|
t,
|
|
383
387
|
i,
|
|
384
388
|
() => this.selecionarIndice(o)
|
|
385
389
|
);
|
|
386
|
-
this.trackElement.appendChild(
|
|
390
|
+
this.trackElement.appendChild(n);
|
|
387
391
|
});
|
|
388
392
|
const e = this.required || this.hasAttribute("sem-selecao-inicial");
|
|
389
393
|
!t && this._opcoes.length > 0 && !e ? this.selecionarIndice(0, !1) : this.indicadorController.atualizar(), this.atualizarValidade();
|
|
390
394
|
}
|
|
391
395
|
selecionarIndice(t, i = !0) {
|
|
392
|
-
var o,
|
|
396
|
+
var o, n;
|
|
393
397
|
if (this.disabled) return;
|
|
394
398
|
const e = this._opcoes[t];
|
|
395
399
|
if (!e || e.disabled) return;
|
|
396
|
-
const
|
|
397
|
-
this.setAttribute("valor", e.valor), this.internals && ((
|
|
400
|
+
const r = this.valor;
|
|
401
|
+
this.setAttribute("valor", e.valor), this.internals && ((n = (o = this.internals).setFormValue) == null || n.call(o, e.valor)), this.atualizarSelecao(e.valor), i && r !== e.valor && (this.dispatchEvent(
|
|
398
402
|
new CustomEvent("ui-change", {
|
|
399
403
|
detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
|
|
400
404
|
bubbles: !0,
|
|
@@ -409,31 +413,95 @@ class x extends E {
|
|
|
409
413
|
));
|
|
410
414
|
}
|
|
411
415
|
atualizarSelecao(t) {
|
|
412
|
-
var e,
|
|
416
|
+
var e, r;
|
|
413
417
|
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((o) => {
|
|
414
|
-
const
|
|
415
|
-
o.classList.toggle("ui-segmented__item--ativo",
|
|
416
|
-
}), this.internals && ((
|
|
418
|
+
const n = o.dataset.valor === t;
|
|
419
|
+
o.classList.toggle("ui-segmented__item--ativo", n), z(o, "opcao-selecionada", n), o.setAttribute("aria-checked", String(n)), o.tabIndex = n ? 0 : -1, n && o.focus();
|
|
420
|
+
}), this.internals && ((r = (e = this.internals).setFormValue) == null || r.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
417
421
|
}
|
|
418
422
|
syncState() {
|
|
419
|
-
|
|
423
|
+
f(this);
|
|
424
|
+
const t = S(
|
|
425
|
+
this.getAttribute("tamanho") ?? this.getAttribute("size") ?? this.getAttribute("densidade")
|
|
426
|
+
) ?? "md", i = this.hasAttribute("largura-total") || this.hasAttribute("full-width"), e = this.disabled;
|
|
420
427
|
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) => {
|
|
421
428
|
o.disabled = e;
|
|
422
429
|
}), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
423
430
|
}
|
|
424
431
|
}
|
|
425
|
-
class
|
|
432
|
+
class P extends _ {
|
|
426
433
|
}
|
|
427
|
-
p("ui-segmented",
|
|
428
|
-
p("ui-segmento",
|
|
434
|
+
p("ui-segmented", _);
|
|
435
|
+
p("ui-segmento", P);
|
|
436
|
+
const B = ':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}';
|
|
437
|
+
class X extends v {
|
|
438
|
+
static get observedAttributes() {
|
|
439
|
+
return ["tamanho", "size", "densidade", "altura", "height"];
|
|
440
|
+
}
|
|
441
|
+
constructor() {
|
|
442
|
+
super();
|
|
443
|
+
const a = this.attachShadow({ mode: "open" });
|
|
444
|
+
a.innerHTML = `<style>${B}</style><slot></slot>`;
|
|
445
|
+
}
|
|
446
|
+
connectedCallback() {
|
|
447
|
+
f(this);
|
|
448
|
+
}
|
|
449
|
+
attributeChangedCallback(a, t, i) {
|
|
450
|
+
t !== i && f(this);
|
|
451
|
+
}
|
|
452
|
+
lerTexto(a) {
|
|
453
|
+
return this.getAttribute(a);
|
|
454
|
+
}
|
|
455
|
+
definirTexto(a, t) {
|
|
456
|
+
t == null || t === "" ? this.removeAttribute(a) : this.setAttribute(a, String(t));
|
|
457
|
+
}
|
|
458
|
+
get tamanho() {
|
|
459
|
+
return this.lerTexto("tamanho");
|
|
460
|
+
}
|
|
461
|
+
set tamanho(a) {
|
|
462
|
+
this.definirTexto("tamanho", a);
|
|
463
|
+
}
|
|
464
|
+
get altura() {
|
|
465
|
+
return this.lerTexto("altura");
|
|
466
|
+
}
|
|
467
|
+
set altura(a) {
|
|
468
|
+
this.definirTexto("altura", a === null ? null : String(a));
|
|
469
|
+
}
|
|
470
|
+
get alinhar() {
|
|
471
|
+
return this.lerTexto("alinhar");
|
|
472
|
+
}
|
|
473
|
+
set alinhar(a) {
|
|
474
|
+
this.definirTexto("alinhar", a);
|
|
475
|
+
}
|
|
476
|
+
get justificar() {
|
|
477
|
+
return this.lerTexto("justificar");
|
|
478
|
+
}
|
|
479
|
+
set justificar(a) {
|
|
480
|
+
this.definirTexto("justificar", a);
|
|
481
|
+
}
|
|
482
|
+
get espaco() {
|
|
483
|
+
return this.lerTexto("espaco");
|
|
484
|
+
}
|
|
485
|
+
set espaco(a) {
|
|
486
|
+
this.definirTexto("espaco", a);
|
|
487
|
+
}
|
|
488
|
+
get semQuebra() {
|
|
489
|
+
return this.hasAttribute("sem-quebra");
|
|
490
|
+
}
|
|
491
|
+
set semQuebra(a) {
|
|
492
|
+
this.toggleAttribute("sem-quebra", !!a);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
p("ui-linha", X);
|
|
429
496
|
export {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
497
|
+
F as A,
|
|
498
|
+
V as S,
|
|
499
|
+
$ as U,
|
|
500
|
+
X as a,
|
|
501
|
+
_ as b,
|
|
502
|
+
P as c,
|
|
503
|
+
O as d,
|
|
504
|
+
R as e,
|
|
505
|
+
U as f,
|
|
506
|
+
D as t
|
|
439
507
|
};
|