@thibezer/ui-components-kit 2.24.2 → 2.25.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 +1131 -1102
- package/README.md +822 -822
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +1 -1
- package/dist/camadas.js +2 -2
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +13 -5
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +6 -1
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha.d.ts +2 -2
- package/dist/components/ui-editor-prancha/editor-barra.d.ts +19 -0
- package/dist/components/ui-editor-prancha/editor-modos.d.ts +26 -1
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +32 -9
- package/dist/core/alvo-digitavel.d.ts +3 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +4 -4
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +3 -3
- package/dist/custom-elements.json +16355 -15988
- package/dist/data.cjs +1 -1
- package/dist/data.js +1 -1
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +1 -1
- package/dist/forms.cjs +7 -7
- package/dist/forms.js +160 -156
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/kit-base-BmkPi5Rz.cjs +2 -0
- package/dist/{kit-base-_THn4w3u.js → kit-base-CBXA66aM.js} +119 -114
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/prancha.cjs +6 -6
- package/dist/prancha.js +1707 -1470
- package/dist/register.cjs +1 -1
- package/dist/register.js +1 -1
- package/dist/seletor-mapa-base.cjs +1 -1
- package/dist/seletor-mapa-base.js +1 -1
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +2 -2
- package/dist/tipos-vue.d.ts +2 -2
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/{ui-seletor-cor-B_twSm-V.js → ui-seletor-cor-CPjA9vhZ.js} +1 -1
- package/dist/{ui-seletor-cor-BGw8SBPm.cjs → ui-seletor-cor-D_ifitEN.cjs} +1 -1
- package/package.json +1 -1
- package/dist/kit-base-CGqj9aiD.cjs +0 -2
package/dist/forms.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var C = Object.defineProperty;
|
|
2
|
-
var z = (o,
|
|
3
|
-
var s = (o,
|
|
2
|
+
var z = (o, a, t) => a in o ? C(o, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[a] = t;
|
|
3
|
+
var s = (o, a, t) => z(o, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { A as b, F as m, L as p, u as f,
|
|
6
|
-
import { k as pt, m as ft, q as gt, r as xt, t as vt, w as _t, x as yt, y as Et, z as At, B as kt, D as wt, H as St, J as Ct } from "./kit-base-
|
|
5
|
+
import { A as b, F as m, L as p, u as f, T as h, V as L, W as I, g as d, f as q, R as E, E as A, e as D, p as g, d as c, h as V, j as v, s as R, Y as x } from "./kit-base-CBXA66aM.js";
|
|
6
|
+
import { k as pt, m as ft, q as gt, r as xt, t as vt, w as _t, x as yt, y as Et, z as At, B as kt, D as wt, H as St, J as Ct } from "./kit-base-CBXA66aM.js";
|
|
7
7
|
import { sincronizarFeedbackErro as T } from "./campo-texto.js";
|
|
8
|
-
import { ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO as Lt, UICampoTexto as
|
|
8
|
+
import { ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO as Lt, UICampoTexto as It, UIInput as qt, criarTemplateCampoTexto as Dt, sincronizarIconeSenha as Vt, sincronizarLabelEPlaceholder as Rt } from "./campo-texto.js";
|
|
9
9
|
const M = ':host{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;display:inline-flex}.ui-area-texto__container{position:relative;width:100%;display:flex;flex-direction:column}.ui-area-texto__label{display:flex;align-items:center;justify-content:space-between;font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;margin-bottom:4px;flex-shrink:0}.ui-area-texto__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px;font-weight:600}.ui-area-texto__wrapper{position:relative;display:flex;width:100%;background:var(--ui-degrade-interno, var(--ui-area-texto-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.ui-area-texto__wrapper:focus-within{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent);background:var(--ui-degrade-interno, var(--ui-area-texto-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-menu, #18181c))))}.ui-area-texto__wrapper--erro{border-color:var(--ui-cor-texto-erro, #ff5555)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 18%,transparent)!important}.ui-area-texto__wrapper--disabled{opacity:.5;cursor:not-allowed;background:var(--ui-area-texto-desabilitado-fundo, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 3%, transparent))}.ui-area-texto__input{display:block;flex:1;width:100%;min-width:0;max-height:calc(var(--ui-area-linhas-max) * 1.5em + 12px);background:transparent;border:none;outline:none;color:var(--ui-cor-texto, #e1e1e6);font-family:inherit;font-size:var(--ui-tamanho-corpo-sm, 13px);line-height:1.5;padding:6px 8px;margin:0;box-sizing:border-box;resize:vertical;overflow-wrap:anywhere;touch-action:manipulation}.ui-area-texto__input::placeholder{color:var(--ui-cor-texto-secundario, #888899);opacity:.65}.ui-area-texto__input:disabled{cursor:not-allowed;resize:none}.ui-area-texto__rodape{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.ui-area-texto__helper{flex:1;min-width:0;font-size:var(--ui-tamanho-caption, 11px);color:var(--ui-cor-texto-secundario, #888899);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px}.ui-area-texto__helper--erro{color:var(--ui-cor-texto-erro, #ff5555);font-weight:500}.ui-area-texto__contador{margin-left:auto;flex-shrink:0;font-size:var(--ui-tamanho-caption, 11px);line-height:var(--ui-altura-linha-compacta, 1.2);margin-top:2px;color:var(--ui-cor-texto-secundario, #888899);font-variant-numeric:tabular-nums}.ui-area-texto__contador[hidden]{display:none}.ui-area-texto__contador--aviso{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-area-texto__contador--excedido{color:var(--ui-cor-texto-erro, #ff5555);font-weight:600}.ui-area-texto__anuncio{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@media (max-width: 640px),(pointer: coarse) and (max-width: 1024px){.ui-area-texto__input{font-size:16px}.ui-area-texto__label{font-size:13px}}@media (prefers-reduced-motion: reduce){.ui-area-texto__wrapper{transition:none}}:host(.squarecircle) .ui-area-texto__wrapper,:host(.squarecircles) .ui-area-texto__wrapper,:host(.ui-squarecircle) .ui-area-texto__wrapper,:host(.ui-squarecircles) .ui-area-texto__wrapper,:host([formato="squarecircle"]) .ui-area-texto__wrapper,:host([formato="squarecircles"]) .ui-area-texto__wrapper,:host([formato="squircle"]) .ui-area-texto__wrapper{border-radius:var(--ui-raio-lg, 10px)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-card: var(--ui-gradiente-card)}', F = [
|
|
10
10
|
"label",
|
|
11
11
|
"placeholder",
|
|
@@ -47,33 +47,33 @@ function H() {
|
|
|
47
47
|
`;
|
|
48
48
|
}
|
|
49
49
|
const O = 0.9;
|
|
50
|
-
function $(o,
|
|
51
|
-
const t = Number.isFinite(o) && o > 0 ? Math.trunc(o) : 0, e =
|
|
50
|
+
function $(o, a) {
|
|
51
|
+
const t = Number.isFinite(o) && o > 0 ? Math.trunc(o) : 0, e = a !== null && Number.isFinite(a) && a > 0 ? Math.trunc(a) : null;
|
|
52
52
|
if (e === null) return { texto: String(t), nivel: "normal", anuncio: "" };
|
|
53
|
-
const
|
|
53
|
+
const i = `${t} / ${e}`;
|
|
54
54
|
if (t > e)
|
|
55
|
-
return { texto:
|
|
55
|
+
return { texto: i, nivel: "excedido", anuncio: `Limite de ${e} caracteres excedido em ${t - e}.` };
|
|
56
56
|
if (t >= e * O) {
|
|
57
57
|
const r = e - t;
|
|
58
58
|
return {
|
|
59
|
-
texto:
|
|
59
|
+
texto: i,
|
|
60
60
|
nivel: "aviso",
|
|
61
61
|
anuncio: r === 0 ? `Limite de ${e} caracteres atingido.` : `Restam ${r} caracteres.`
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
return { texto:
|
|
64
|
+
return { texto: i, nivel: "normal", anuncio: "" };
|
|
65
65
|
}
|
|
66
|
-
function P(o,
|
|
67
|
-
return !Number.isFinite(o) || !Number.isFinite(
|
|
66
|
+
function P(o, a) {
|
|
67
|
+
return !Number.isFinite(o) || !Number.isFinite(a) || o <= 0 || o <= a ? null : Math.ceil(o);
|
|
68
68
|
}
|
|
69
|
-
function _(o,
|
|
70
|
-
const t =
|
|
71
|
-
t > 0 && (
|
|
69
|
+
function _(o, a) {
|
|
70
|
+
const t = a.offsetHeight;
|
|
71
|
+
t > 0 && (a.style.minHeight = `${t}px`), o.style.height = "auto";
|
|
72
72
|
const e = P(o.scrollHeight, o.clientHeight);
|
|
73
|
-
e !== null && (o.style.height = `${e}px`),
|
|
73
|
+
e !== null && (o.style.height = `${e}px`), a.style.minHeight = "";
|
|
74
74
|
}
|
|
75
|
-
function B(o,
|
|
76
|
-
o.style.height = "",
|
|
75
|
+
function B(o, a) {
|
|
76
|
+
o.style.height = "", a.style.minHeight = "";
|
|
77
77
|
}
|
|
78
78
|
const N = ["nenhum", "vertical", "horizontal", "ambos"], U = {
|
|
79
79
|
nenhum: "none",
|
|
@@ -136,8 +136,8 @@ class k extends m {
|
|
|
136
136
|
disconnectedCallback() {
|
|
137
137
|
this.listeners.cleanup();
|
|
138
138
|
}
|
|
139
|
-
attributeChangedCallback(t, e,
|
|
140
|
-
t === "value" &&
|
|
139
|
+
attributeChangedCallback(t, e, i) {
|
|
140
|
+
t === "value" && i !== this.textareaElement.value && !this._focado && (this.textareaElement.value = i ?? ""), this.syncState();
|
|
141
141
|
}
|
|
142
142
|
// === API pública ===
|
|
143
143
|
focus(t) {
|
|
@@ -151,9 +151,9 @@ class k extends m {
|
|
|
151
151
|
this.textareaElement.select();
|
|
152
152
|
}
|
|
153
153
|
/** Define a seleção; índices inválidos são ignorados pelo navegador, nunca lançam. */
|
|
154
|
-
setSelectionRange(t, e,
|
|
154
|
+
setSelectionRange(t, e, i) {
|
|
155
155
|
try {
|
|
156
|
-
this.textareaElement.setSelectionRange(t, e,
|
|
156
|
+
this.textareaElement.setSelectionRange(t, e, i);
|
|
157
157
|
} catch {
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -195,13 +195,13 @@ class k extends m {
|
|
|
195
195
|
t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly");
|
|
196
196
|
}
|
|
197
197
|
get minLength() {
|
|
198
|
-
return
|
|
198
|
+
return h(this.getAttribute("minlength") ?? this.getAttribute("min-length")) ?? -1;
|
|
199
199
|
}
|
|
200
200
|
set minLength(t) {
|
|
201
201
|
t >= 0 ? this.setAttribute("minlength", String(t)) : this.removeAttribute("minlength");
|
|
202
202
|
}
|
|
203
203
|
get maxLength() {
|
|
204
|
-
return
|
|
204
|
+
return h(this.getAttribute("maxlength") ?? this.getAttribute("max-length")) ?? -1;
|
|
205
205
|
}
|
|
206
206
|
set maxLength(t) {
|
|
207
207
|
t >= 0 ? this.setAttribute("maxlength", String(t)) : this.removeAttribute("maxlength");
|
|
@@ -220,18 +220,18 @@ class k extends m {
|
|
|
220
220
|
disabled: this.disabled,
|
|
221
221
|
required: this.required,
|
|
222
222
|
tipo: "text",
|
|
223
|
-
minlength:
|
|
224
|
-
maxlength:
|
|
223
|
+
minlength: h(this.getAttribute("minlength") ?? this.getAttribute("min-length")),
|
|
224
|
+
maxlength: h(this.getAttribute("maxlength") ?? this.getAttribute("max-length")),
|
|
225
225
|
customError: this._customErrorMessage,
|
|
226
226
|
mensagemValidacao: this.getAttribute("mensagem-validacao")
|
|
227
227
|
});
|
|
228
|
-
|
|
228
|
+
I(this.internals, e, this.textareaElement);
|
|
229
229
|
}
|
|
230
230
|
syncState() {
|
|
231
|
-
var
|
|
232
|
-
|
|
231
|
+
var i, r;
|
|
232
|
+
d(this, this.wrapperElement);
|
|
233
233
|
const t = this.textareaElement, e = this.hasAttribute("auto-altura");
|
|
234
|
-
t.setAttribute("rows", String(
|
|
234
|
+
t.setAttribute("rows", String(q(this.getAttribute("linhas"), 1, G, j))), t.placeholder = this.getAttribute("placeholder") ?? "", this.sincronizarRotulo(), this.sincronizarLimites(), this.sincronizarEstadoInterativo(), this.sincronizarFeedback(), this.sincronizarContador(), this.sincronizarAltura(e), (r = (i = this.internals) == null ? void 0 : i.setFormValue) == null || r.call(i, t.value), this.atualizarValidade();
|
|
235
235
|
}
|
|
236
236
|
sincronizarRotulo() {
|
|
237
237
|
const t = this.getAttribute("label");
|
|
@@ -244,8 +244,8 @@ class k extends m {
|
|
|
244
244
|
e ? this.textareaElement.setAttribute("aria-label", e) : this.textareaElement.removeAttribute("aria-label");
|
|
245
245
|
}
|
|
246
246
|
sincronizarLimites() {
|
|
247
|
-
const t = this.textareaElement, e =
|
|
248
|
-
e !== null ? t.minLength = e : t.removeAttribute("minlength"),
|
|
247
|
+
const t = this.textareaElement, e = h(this.getAttribute("minlength") ?? this.getAttribute("min-length")), i = h(this.getAttribute("maxlength") ?? this.getAttribute("max-length"));
|
|
248
|
+
e !== null ? t.minLength = e : t.removeAttribute("minlength"), i !== null ? t.maxLength = i : t.removeAttribute("maxlength");
|
|
249
249
|
}
|
|
250
250
|
sincronizarEstadoInterativo() {
|
|
251
251
|
const t = this.textareaElement, e = this.disabled;
|
|
@@ -268,30 +268,30 @@ class k extends m {
|
|
|
268
268
|
this.contadorElement.hidden = !0, this.anuncioElement.textContent = "", this._nivelAnunciado = "normal";
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
const t =
|
|
271
|
+
const t = h(this.getAttribute("maxlength") ?? this.getAttribute("max-length"), 1), e = $(this.textareaElement.value.length, t);
|
|
272
272
|
this.contadorElement.hidden = !1, this.contadorElement.textContent = e.texto;
|
|
273
|
-
for (const
|
|
274
|
-
this.contadorElement.classList.toggle(`ui-area-texto__contador--${
|
|
273
|
+
for (const i of K)
|
|
274
|
+
this.contadorElement.classList.toggle(`ui-area-texto__contador--${i}`, i === e.nivel);
|
|
275
275
|
e.nivel !== this._nivelAnunciado && (this._nivelAnunciado = e.nivel, this.anuncioElement.textContent = e.anuncio);
|
|
276
276
|
}
|
|
277
277
|
sincronizarAltura(t) {
|
|
278
|
-
const e = this.textareaElement,
|
|
279
|
-
e.style.resize = U[
|
|
280
|
-
const r = t ?
|
|
278
|
+
const e = this.textareaElement, i = t ? "nenhum" : D(this.getAttribute("redimensionar"), N, "vertical");
|
|
279
|
+
e.style.resize = U[i];
|
|
280
|
+
const r = t ? h(this.getAttribute("linhas-max"), 1) : null;
|
|
281
281
|
r !== null ? this.style.setProperty("--ui-area-linhas-max", String(Math.min(r, W))) : this.style.removeProperty("--ui-area-linhas-max"), t ? _(e, this.wrapperElement) : B(e, this.wrapperElement);
|
|
282
282
|
}
|
|
283
|
-
emitirEdicao(t, e,
|
|
283
|
+
emitirEdicao(t, e, i) {
|
|
284
284
|
this.dispatchEvent(
|
|
285
|
-
new CustomEvent(t, { detail: { value:
|
|
285
|
+
new CustomEvent(t, { detail: { value: i }, bubbles: !0, composed: !0 })
|
|
286
286
|
), this.dispatchEvent(new Event(e, { bubbles: !0, composed: !0 }));
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
class X extends k {
|
|
290
290
|
}
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
c("ui-area-texto", k);
|
|
292
|
+
c("ui-textarea", X);
|
|
293
293
|
class Y {
|
|
294
|
-
constructor(
|
|
294
|
+
constructor(a, t, e) {
|
|
295
295
|
s(this, "scrollHandler");
|
|
296
296
|
s(this, "resizeHandler");
|
|
297
297
|
s(this, "posicionar", () => {
|
|
@@ -299,23 +299,23 @@ class Y {
|
|
|
299
299
|
this.content.style.top = "", this.content.style.left = "", this.content.style.minWidth = "";
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
this.content.style.top = `${Math.round(
|
|
302
|
+
const a = this.button.getBoundingClientRect();
|
|
303
|
+
this.content.style.top = `${Math.round(a.bottom + 2)}px`, this.content.style.left = `${Math.round(a.left)}px`, this.content.style.minWidth = `${Math.round(Math.max(a.width, 120))}px`, this.ajustarAoViewport(a);
|
|
304
304
|
});
|
|
305
|
-
this.host =
|
|
305
|
+
this.host = a, this.button = t, this.content = e;
|
|
306
306
|
}
|
|
307
307
|
isMobileOrBottomSheet() {
|
|
308
308
|
return typeof window > "u" ? !1 : window.innerWidth <= 640 || this.host.hasAttribute("bottom-sheet") || this.host.hasAttribute("modo-mobile");
|
|
309
309
|
}
|
|
310
310
|
/** Com a lista já visível (medida real): abre para cima se faltar espaço embaixo e não deixa sair pela lateral. */
|
|
311
|
-
ajustarAoViewport(
|
|
311
|
+
ajustarAoViewport(a) {
|
|
312
312
|
const t = this.content.offsetHeight, e = this.content.offsetWidth;
|
|
313
313
|
if (t <= 0 || typeof window > "u") return;
|
|
314
|
-
const
|
|
315
|
-
|
|
314
|
+
const i = 8;
|
|
315
|
+
a.bottom + 2 + t > window.innerHeight - i && a.top - 2 - t >= i && (this.content.style.top = `${Math.round(a.top - 2 - t)}px`), a.left + e > window.innerWidth - i && (this.content.style.left = `${Math.max(i, Math.round(window.innerWidth - i - e))}px`);
|
|
316
316
|
}
|
|
317
|
-
ativarAcompanhamento(
|
|
318
|
-
if (this.scrollHandler =
|
|
317
|
+
ativarAcompanhamento(a) {
|
|
318
|
+
if (this.scrollHandler = a, this.resizeHandler = this.posicionar, window.addEventListener("scroll", this.scrollHandler, { capture: !0, passive: !0 }), window.addEventListener("resize", this.resizeHandler, { passive: !0 }), typeof this.content.showPopover == "function")
|
|
319
319
|
try {
|
|
320
320
|
this.content.showPopover();
|
|
321
321
|
} catch {
|
|
@@ -331,37 +331,37 @@ class Y {
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
class J {
|
|
334
|
-
constructor(
|
|
334
|
+
constructor(a) {
|
|
335
335
|
s(this, "focusedIndex", -1);
|
|
336
|
-
this.listElement =
|
|
336
|
+
this.listElement = a;
|
|
337
337
|
}
|
|
338
338
|
focarPrimeiroItem() {
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
const t =
|
|
342
|
-
this.focusedIndex = Math.max(0, t),
|
|
339
|
+
const a = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
|
|
340
|
+
if (a.length > 0) {
|
|
341
|
+
const t = a.findIndex((e) => e.classList.contains("ui-lista-flutuante__item--selecionado"));
|
|
342
|
+
this.focusedIndex = Math.max(0, t), a[this.focusedIndex].focus();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
resetarFoco() {
|
|
346
346
|
this.focusedIndex = -1;
|
|
347
347
|
}
|
|
348
|
-
moverFoco(
|
|
348
|
+
moverFoco(a) {
|
|
349
349
|
const t = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
|
|
350
|
-
t.length !== 0 && (this.focusedIndex +=
|
|
351
|
-
}
|
|
352
|
-
tratarKeydownLista(
|
|
353
|
-
if (
|
|
354
|
-
|
|
355
|
-
else if (
|
|
356
|
-
|
|
357
|
-
else if (
|
|
358
|
-
|
|
359
|
-
const n =
|
|
350
|
+
t.length !== 0 && (this.focusedIndex += a, this.focusedIndex < 0 && (this.focusedIndex = t.length - 1), this.focusedIndex >= t.length && (this.focusedIndex = 0), t[this.focusedIndex].focus());
|
|
351
|
+
}
|
|
352
|
+
tratarKeydownLista(a, t, e, i, r) {
|
|
353
|
+
if (a.key === "ArrowDown")
|
|
354
|
+
a.preventDefault(), this.moverFoco(1);
|
|
355
|
+
else if (a.key === "ArrowUp")
|
|
356
|
+
a.preventDefault(), this.moverFoco(-1);
|
|
357
|
+
else if (a.key === "Home" || a.key === "End") {
|
|
358
|
+
a.preventDefault();
|
|
359
|
+
const n = a.key === "End";
|
|
360
360
|
this.focusedIndex = n ? -1 : 0, n ? this.moverFoco(-1) : this.moverFoco(0);
|
|
361
|
-
} else
|
|
361
|
+
} else a.key === "Tab" ? i() : a.key === "Enter" || a.key === " " ? (a.preventDefault(), this.focusedIndex >= 0 && this.focusedIndex < t.length && e(t[this.focusedIndex])) : a.key === "Escape" && (a.preventDefault(), i(), r.focus());
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
const
|
|
364
|
+
const Z = ':host{display:inline-block;position:relative;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto;vertical-align:middle}.ui-lista-flutuante__container{display:flex;flex-direction:column;width:100%;position:relative}.ui-lista-flutuante__label{font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:4px;-webkit-user-select:none;user-select:none;flex-shrink:0}.ui-lista-flutuante__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px}.ui-lista-flutuante__gatilho{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);padding:0 8px;background:var(--ui-degrade-interno, var(--ui-lista-flutuante-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e))));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:clamp(11px,.85rem,13px);line-height:1;cursor:pointer;box-sizing:border-box;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:border-color .15s ease,background-color .15s ease}.ui-lista-flutuante__gatilho:hover:not(:disabled){border-color:var(--ui-cor-primaria, #00E08A)}.ui-lista-flutuante__gatilho:disabled{opacity:.5;cursor:not-allowed}.ui-lista-flutuante__texto{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-align:left}.ui-lista-flutuante__seta{font-size:10px;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:transform .2s ease;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;shape-rendering:geometricPrecision}:host([aberta]) .ui-lista-flutuante__seta{transform:rotate(180deg)}.ui-lista-flutuante__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;z-index:calc(var(--ui-z-popover, 1050) - 1)}:host([aberta]) .ui-lista-flutuante__backdrop{display:block}:host(:not([aberta])) .ui-lista-flutuante__conteudo{display:none!important}:host([aberta]) .ui-lista-flutuante__conteudo{display:block}.ui-lista-flutuante__conteudo{position:fixed;margin:0;padding:4px;list-style:none;background:var(--ui-degrade-interno, var(--ui-lista-flutuante-menu-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-menu, #18181c))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .14));border-radius:var(--ui-raio-borda, 6px);box-shadow:var(--ui-sombra-lg, 0 8px 28px rgba(0, 0, 0, .55));max-height:220px;overflow-y:auto;z-index:var(--ui-z-popover, 1050);box-sizing:border-box;inset:auto}.ui-lista-flutuante__sheet-header{display:none;width:100%;margin-bottom:8px}.ui-lista-flutuante__handle{width:36px;height:4px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:2px auto 8px}.ui-lista-flutuante__sheet-title-bar{display:flex;align-items:center;justify-content:space-between;width:100%;padding:4px 6px 8px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));margin-bottom:6px}.ui-lista-flutuante__sheet-titulo{font-size:13px;font-weight:600;color:var(--ui-cor-primaria, #00E08A);letter-spacing:.3px;text-transform:uppercase}.ui-lista-flutuante__sheet-close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:14px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:color .15s,background-color .15s}.ui-lista-flutuante__sheet-close:hover{color:#fff;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent)}.ui-lista-flutuante__item{padding:6px 10px;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:12px;line-height:1.2;color:var(--ui-cor-texto, #e1e1e6);border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,color .12s ease;-webkit-user-select:none;user-select:none}.ui-lista-flutuante__item:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-lista-flutuante__item--selecionado{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent);color:var(--ui-cor-primaria, #00E08A);font-weight:600}.ui-lista-flutuante__item--selecionado:after{content:"✓";font-size:11px;color:var(--ui-cor-primaria, #00E08A)}@media (max-width: 640px){.ui-lista-flutuante__gatilho{min-height:max(var(--ui-campo-altura, 38px),38px);font-size:15px}:host([aberta]) .ui-lista-flutuante__backdrop{background-color:#00000059;-webkit-backdrop-filter:none;backdrop-filter:none}.ui-lista-flutuante__conteudo{position:fixed!important;bottom:0!important;top:auto!important;left:0!important;width:100vw!important;max-width:100vw!important;min-width:100vw!important;max-height:70vh!important;max-height:70dvh!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;border-bottom:none!important;padding:10px 16px calc(24px + env(safe-area-inset-bottom,0px)) 16px!important;box-shadow:0 -8px 32px #000000b3!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;animation:ui-bottom-sheet-slide .22s cubic-bezier(.4,0,.2,1)}.ui-lista-flutuante__sheet-header{display:flex!important;flex-direction:column!important}.ui-lista-flutuante__sheet-close{min-width:44px;min-height:44px;font-size:18px}.ui-lista-flutuante__item{padding:12px 14px!important;font-size:15px!important;margin-bottom:3px}}:host([bottom-sheet][aberta]) .ui-lista-flutuante__backdrop,:host([modo-mobile][aberta]) .ui-lista-flutuante__backdrop{background-color:#00000059;-webkit-backdrop-filter:none;backdrop-filter:none}:host([bottom-sheet]) .ui-lista-flutuante__conteudo,:host([modo-mobile]) .ui-lista-flutuante__conteudo{position:fixed!important;bottom:0!important;top:auto!important;left:0!important;width:100vw!important;max-width:100vw!important;min-width:100vw!important;max-height:70vh!important;max-height:70dvh!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;border-bottom:none!important;padding:10px 16px calc(24px + env(safe-area-inset-bottom,0px)) 16px!important;box-shadow:0 -8px 32px #000000b3!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;animation:ui-bottom-sheet-slide .22s cubic-bezier(.4,0,.2,1)}:host([bottom-sheet]) .ui-lista-flutuante__sheet-header,:host([modo-mobile]) .ui-lista-flutuante__sheet-header{display:flex!important;flex-direction:column!important}:host([bottom-sheet]) .ui-lista-flutuante__sheet-close,:host([modo-mobile]) .ui-lista-flutuante__sheet-close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-lista-flutuante__item,:host([modo-mobile]) .ui-lista-flutuante__item{padding:12px 14px!important;font-size:15px!important;margin-bottom:3px}@keyframes ui-bottom-sheet-slide{0%{transform:translateY(100%)}to{transform:translateY(0)}}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado)}', Q = [
|
|
365
365
|
"aberta",
|
|
366
366
|
"texto-padrao",
|
|
367
367
|
"value",
|
|
@@ -385,7 +385,7 @@ const Q = ':host{display:inline-block;position:relative;width:100%;box-sizing:bo
|
|
|
385
385
|
];
|
|
386
386
|
function tt() {
|
|
387
387
|
return `
|
|
388
|
-
<style>${
|
|
388
|
+
<style>${Z}</style>
|
|
389
389
|
<div class="ui-lista-flutuante__container">
|
|
390
390
|
<label class="ui-lista-flutuante__label" part="rotulo" style="display: none;"></label>
|
|
391
391
|
<div class="ui-lista-flutuante__backdrop"></div>
|
|
@@ -406,16 +406,16 @@ function tt() {
|
|
|
406
406
|
</div>
|
|
407
407
|
`;
|
|
408
408
|
}
|
|
409
|
-
function y(o,
|
|
410
|
-
o.innerHTML = "",
|
|
411
|
-
const
|
|
412
|
-
|
|
409
|
+
function y(o, a, t) {
|
|
410
|
+
o.innerHTML = "", a.forEach((e) => {
|
|
411
|
+
const i = document.createElement("li"), r = String(e.id) === String(t);
|
|
412
|
+
i.className = `ui-lista-flutuante__item ${r ? "ui-lista-flutuante__item--selecionado" : ""}`, i.setAttribute("data-id", e.id), i.textContent = e.label, i.role = "option", i.tabIndex = -1, i.setAttribute("part", r ? "opcao opcao-selecionada" : "opcao"), r && i.setAttribute("aria-selected", "true"), o.appendChild(i);
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
function et(o,
|
|
415
|
+
function et(o, a) {
|
|
416
416
|
o.querySelectorAll(".ui-lista-flutuante__item").forEach((e) => {
|
|
417
|
-
const
|
|
418
|
-
|
|
417
|
+
const i = e.getAttribute("data-id");
|
|
418
|
+
V(e, "opcao-selecionada", i === String(a)), i === String(a) ? (e.classList.add("ui-lista-flutuante__item--selecionado"), e.setAttribute("aria-selected", "true")) : (e.classList.remove("ui-lista-flutuante__item--selecionado"), e.removeAttribute("aria-selected"));
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
class w extends m {
|
|
@@ -479,7 +479,7 @@ class w extends m {
|
|
|
479
479
|
t.stopPropagation();
|
|
480
480
|
const e = (n = t.target) == null ? void 0 : n.closest("li[data-id]");
|
|
481
481
|
if (!e) return;
|
|
482
|
-
const
|
|
482
|
+
const i = e.getAttribute("data-id"), r = this._itens.find((u) => String(u.id) === String(i));
|
|
483
483
|
r && this.selecionarItem(r);
|
|
484
484
|
});
|
|
485
485
|
const t = this.attachShadow({ mode: "open" });
|
|
@@ -493,7 +493,7 @@ class w extends m {
|
|
|
493
493
|
}, this.labelElement.id = this.idsAcessibilidade.label, this.button.id = this.idsAcessibilidade.gatilho, this.textoElement.id = this.idsAcessibilidade.texto, this.content.id = this.idsAcessibilidade.lista, this.button.setAttribute("aria-controls", this.idsAcessibilidade.lista), this.posicionamento = new Y(this, this.button, this.content), this.teclado = new J(this.listElement);
|
|
494
494
|
}
|
|
495
495
|
static get observedAttributes() {
|
|
496
|
-
return
|
|
496
|
+
return Q;
|
|
497
497
|
}
|
|
498
498
|
connectedCallback() {
|
|
499
499
|
this.listeners.cleanup(), this.listeners.add(this.button, "click", this.toggleLista), this.listeners.add(this.button, "keydown", this.handleKeyDown), this.listeners.add(this.content, "keydown", this.handleListKeyDown), this.listeners.add(this.backdropElement, "click", this.fechar), this.listeners.add(this.listElement, "click", this.handleListClick), this.listeners.add(this.sheetCloseButton, "click", (t) => {
|
|
@@ -502,20 +502,24 @@ class w extends m {
|
|
|
502
502
|
}
|
|
503
503
|
carregarItensFilhos() {
|
|
504
504
|
const t = Array.from(this.querySelectorAll('option, ui-opcao, [role="option"], [data-opcao], [data-value]:not(input):not(select)'));
|
|
505
|
-
t.length > 0
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
505
|
+
if (t.length > 0) {
|
|
506
|
+
this._itens = t.map((i, r) => {
|
|
507
|
+
var u;
|
|
508
|
+
const n = i.hasAttribute("value") ? i.getAttribute("value") : i.getAttribute("data-value") || String(r + 1);
|
|
509
|
+
return {
|
|
510
|
+
id: n,
|
|
511
|
+
label: ((u = i.textContent) == null ? void 0 : u.trim()) || n || `Opção ${r + 1}`
|
|
512
|
+
};
|
|
513
|
+
});
|
|
514
|
+
const e = t.findIndex((i) => i.hasAttribute("selected"));
|
|
515
|
+
e >= 0 && !this.hasAttribute("value") && (this.value = this._itens[e].id), y(this.listElement, this._itens, this._value), this.syncLabel();
|
|
516
|
+
}
|
|
513
517
|
}
|
|
514
518
|
disconnectedCallback() {
|
|
515
519
|
this.listeners.cleanup(), this.observer && this.observer.disconnect(), this.fechar();
|
|
516
520
|
}
|
|
517
|
-
attributeChangedCallback(t, e,
|
|
518
|
-
t === "aberta" && this.button.setAttribute("aria-expanded", String(
|
|
521
|
+
attributeChangedCallback(t, e, i) {
|
|
522
|
+
t === "aberta" && this.button.setAttribute("aria-expanded", String(i !== null)), (t === "texto-padrao" || t === "placeholder" || t === "label" || t === "rotulo" || t === "aria-label") && this.syncLabel(), t === "value" && i !== this._value && (this.value = i || ""), t === "disabled" && (this.button.disabled = this.disabled), (t === "altura" || t === "height" || t === "tamanho" || t === "size" || t === "densidade") && v(this), R(t) && (d(this, this.button), d(this, this.content));
|
|
519
523
|
}
|
|
520
524
|
get value() {
|
|
521
525
|
return this._value;
|
|
@@ -586,15 +590,15 @@ class w extends m {
|
|
|
586
590
|
E(this.labelElement, t, this.required, "ui-lista-flutuante__asterisco"), this.labelElement.style.display = "block", this.sheetTituloElement.textContent = t, this.button.setAttribute("aria-labelledby", `${this.idsAcessibilidade.label} ${this.idsAcessibilidade.texto}`), this.content.setAttribute("aria-labelledby", this.idsAcessibilidade.label), this.button.removeAttribute("aria-label"), this.content.removeAttribute("aria-label");
|
|
587
591
|
else {
|
|
588
592
|
this.labelElement.style.display = "none", this.sincronizarRotuloExterno();
|
|
589
|
-
const
|
|
590
|
-
this.sheetTituloElement.textContent =
|
|
593
|
+
const i = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
|
|
594
|
+
this.sheetTituloElement.textContent = i;
|
|
591
595
|
}
|
|
592
|
-
const e = this._itens.find((
|
|
596
|
+
const e = this._itens.find((i) => String(i.id) === String(this._value));
|
|
593
597
|
if (e)
|
|
594
598
|
this.textoElement.textContent = e.label;
|
|
595
599
|
else {
|
|
596
|
-
const
|
|
597
|
-
this.textoElement.textContent =
|
|
600
|
+
const i = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
|
|
601
|
+
this.textoElement.textContent = i;
|
|
598
602
|
}
|
|
599
603
|
}
|
|
600
604
|
/** Sem o atributo `label`, usa o rótulo de fora do Shadow DOM (aria-label, <label for>, <label> envolvente). */
|
|
@@ -604,12 +608,12 @@ class w extends m {
|
|
|
604
608
|
t ? (this.button.setAttribute("aria-labelledby", `${this.idsAcessibilidade.gatilho} ${this.idsAcessibilidade.texto}`), this.button.setAttribute("aria-label", t), this.content.setAttribute("aria-label", t)) : (this.button.removeAttribute("aria-label"), this.content.removeAttribute("aria-label"));
|
|
605
609
|
}
|
|
606
610
|
syncState() {
|
|
607
|
-
v(this),
|
|
611
|
+
v(this), d(this, this.button), d(this, this.content), this.hasAttribute("value") && (this._value = this.getAttribute("value") || "", this.internals.setFormValue(this._value)), this.syncLabel(), this.atualizarValidade();
|
|
608
612
|
}
|
|
609
613
|
selecionarItem(t) {
|
|
610
614
|
var r;
|
|
611
|
-
const e = (r = this.shadowRoot) == null ? void 0 : r.activeElement,
|
|
612
|
-
this.value = t.id, this.fechar(),
|
|
615
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.activeElement, i = !!e && this.content.contains(e);
|
|
616
|
+
this.value = t.id, this.fechar(), i && this.button.focus(), this.dispatchEvent(
|
|
613
617
|
new CustomEvent("ui-selecionar", {
|
|
614
618
|
detail: t,
|
|
615
619
|
bubbles: !0,
|
|
@@ -630,8 +634,8 @@ class w extends m {
|
|
|
630
634
|
}
|
|
631
635
|
class it extends w {
|
|
632
636
|
}
|
|
633
|
-
|
|
634
|
-
|
|
637
|
+
c("ui-lista-flutuante", w);
|
|
638
|
+
c("ui-select", it);
|
|
635
639
|
const at = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-checkbox{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-checkbox--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-checkbox__box{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;min-width:16px;min-height:16px;background:var(--ui-checkbox-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-sm, 4px);box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;flex-shrink:0}.ui-checkbox:focus-visible .ui-checkbox__box,.ui-checkbox--foco .ui-checkbox__box{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-checkbox--checked .ui-checkbox__box,.ui-checkbox--indeterminate .ui-checkbox__box{background:var(--ui-degrade-interno, var(--ui-checkbox-ativo-fundo, var(--ui-fundo-primario, var(--ui-cor-primaria, #00E08A))));border-color:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-checkbox__mark{width:12px;height:12px;display:flex;align-items:center;justify-content:center;transition:transform .15s cubic-bezier(.4,0,.2,1),opacity .15s ease;transform:scale(0);opacity:0}.ui-checkbox--checked .ui-checkbox__mark,.ui-checkbox--indeterminate .ui-checkbox__mark{transform:scale(1);opacity:1}.ui-checkbox__mark svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}.ui-checkbox__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-checkbox--label-esquerda{flex-direction:row-reverse}@media (max-width: 640px){.ui-checkbox{min-height:40px;padding:4px 0}.ui-checkbox__box{width:20px;height:20px;min-width:20px;min-height:20px}.ui-checkbox__mark{width:14px;height:14px}.ui-checkbox__label{font-size:14px}}:host(.squarecircle) .ui-checkbox__box,:host(.squarecircles) .ui-checkbox__box,:host(.ui-squarecircle) .ui-checkbox__box,:host(.ui-squarecircles) .ui-checkbox__box,:host([formato="squarecircle"]) .ui-checkbox__box,:host([formato="squarecircles"]) .ui-checkbox__box,:host([formato="squircle"]) .ui-checkbox__box{border-radius:var(--ui-raio-squircle, 24%)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-primario: var(--ui-gradiente-primario)}';
|
|
636
640
|
class st extends m {
|
|
637
641
|
constructor() {
|
|
@@ -692,7 +696,7 @@ class st extends m {
|
|
|
692
696
|
disconnectedCallback() {
|
|
693
697
|
this.listeners.cleanup();
|
|
694
698
|
}
|
|
695
|
-
attributeChangedCallback(t, e,
|
|
699
|
+
attributeChangedCallback(t, e, i) {
|
|
696
700
|
this.syncState();
|
|
697
701
|
}
|
|
698
702
|
get marcado() {
|
|
@@ -774,12 +778,12 @@ class st extends m {
|
|
|
774
778
|
));
|
|
775
779
|
}
|
|
776
780
|
syncState() {
|
|
777
|
-
|
|
778
|
-
const t = this.marcado, e = this.indeterminado,
|
|
781
|
+
d(this, this.containerElement);
|
|
782
|
+
const t = this.marcado, e = this.indeterminado, i = this.disabled, r = this.getAttribute("label"), n = this.getAttribute("posicao-label") || "direita";
|
|
779
783
|
this.containerElement.setAttribute(
|
|
780
784
|
"aria-checked",
|
|
781
785
|
e ? "mixed" : String(t)
|
|
782
|
-
),
|
|
786
|
+
), i ? (this.containerElement.classList.add("ui-checkbox--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true")) : (this.containerElement.classList.remove("ui-checkbox--disabled"), this.containerElement.setAttribute("tabindex", "0"), this.containerElement.removeAttribute("aria-disabled")), t ? this.containerElement.classList.add("ui-checkbox--checked") : this.containerElement.classList.remove("ui-checkbox--checked"), e ? this.containerElement.classList.add("ui-checkbox--indeterminate") : this.containerElement.classList.remove("ui-checkbox--indeterminate"), n === "esquerda" ? this.containerElement.classList.add("ui-checkbox--label-esquerda") : this.containerElement.classList.remove("ui-checkbox--label-esquerda"), e ? this.markElement.innerHTML = `
|
|
783
787
|
<svg viewBox="0 0 24 24">
|
|
784
788
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
785
789
|
</svg>
|
|
@@ -803,56 +807,56 @@ class st extends m {
|
|
|
803
807
|
typeof t == "string" ? this.marcado = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.marcado = t), this.syncState();
|
|
804
808
|
}
|
|
805
809
|
}
|
|
806
|
-
|
|
810
|
+
c("ui-checkbox", st);
|
|
807
811
|
const rt = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-radio{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none}.ui-radio--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-radio__circle{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;min-width:16px;min-height:16px;background:var(--ui-radio-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:50%;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;flex-shrink:0}.ui-radio:focus-visible .ui-radio__circle,.ui-radio--foco .ui-radio__circle{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-radio--checked .ui-radio__circle{border-color:var(--ui-cor-primaria, #00E08A)}.ui-radio__dot{width:8px;height:8px;border-radius:50%;background:var(--ui-degrade-interno, var(--ui-radio-ativo-fundo, var(--ui-fundo-primario, var(--ui-cor-primaria, #00E08A))));transition:transform .15s cubic-bezier(.4,0,.2,1),opacity .15s ease;transform:scale(0);opacity:0}.ui-radio--checked .ui-radio__dot{transform:scale(1);opacity:1}.ui-radio__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-radio--label-esquerda{flex-direction:row-reverse}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-primario: var(--ui-gradiente-primario)}';
|
|
808
812
|
class l {
|
|
809
|
-
static getScopeNode(
|
|
810
|
-
return
|
|
813
|
+
static getScopeNode(a) {
|
|
814
|
+
return a.closest("form") || a.getRootNode() || document;
|
|
811
815
|
}
|
|
812
816
|
/** Registra (ou re-registra, se o nome ou o escopo mudaram) o radio no grupo do seu nome atual. */
|
|
813
|
-
static registrar(
|
|
814
|
-
this.desregistrar(
|
|
815
|
-
const t =
|
|
817
|
+
static registrar(a) {
|
|
818
|
+
this.desregistrar(a);
|
|
819
|
+
const t = a.name;
|
|
816
820
|
if (!t) return;
|
|
817
|
-
const e = this.getScopeNode(
|
|
818
|
-
let
|
|
819
|
-
|
|
820
|
-
let r =
|
|
821
|
-
r || (r = /* @__PURE__ */ new Set(),
|
|
822
|
-
}
|
|
823
|
-
static desregistrar(
|
|
824
|
-
const t = this.registros.get(
|
|
821
|
+
const e = this.getScopeNode(a);
|
|
822
|
+
let i = this.registry.get(e);
|
|
823
|
+
i || (i = /* @__PURE__ */ new Map(), this.registry.set(e, i));
|
|
824
|
+
let r = i.get(t);
|
|
825
|
+
r || (r = /* @__PURE__ */ new Set(), i.set(t, r)), r.add(a), this.registros.set(a, { scope: e, nome: t });
|
|
826
|
+
}
|
|
827
|
+
static desregistrar(a) {
|
|
828
|
+
const t = this.registros.get(a);
|
|
825
829
|
if (!t) return;
|
|
826
|
-
this.registros.delete(
|
|
827
|
-
const e = this.registry.get(t.scope),
|
|
828
|
-
!e || !
|
|
830
|
+
this.registros.delete(a);
|
|
831
|
+
const e = this.registry.get(t.scope), i = e == null ? void 0 : e.get(t.nome);
|
|
832
|
+
!e || !i || (i.delete(a), i.size === 0 && e.delete(t.nome), e.size === 0 && this.registry.delete(t.scope));
|
|
829
833
|
}
|
|
830
834
|
/** Radios do mesmo grupo que `radio`, usando o registro (não o nome atual, que pode ainda não ter sido registrado). */
|
|
831
|
-
static obterRadiosDoGrupo(
|
|
832
|
-
var
|
|
833
|
-
const t = this.registros.get(
|
|
835
|
+
static obterRadiosDoGrupo(a) {
|
|
836
|
+
var i;
|
|
837
|
+
const t = this.registros.get(a);
|
|
834
838
|
if (!t) return [];
|
|
835
|
-
const e = (
|
|
839
|
+
const e = (i = this.registry.get(t.scope)) == null ? void 0 : i.get(t.nome);
|
|
836
840
|
return e ? Array.from(e) : [];
|
|
837
841
|
}
|
|
838
|
-
static desmarcarOutros(
|
|
839
|
-
this.obterRadiosDoGrupo(
|
|
840
|
-
t !==
|
|
842
|
+
static desmarcarOutros(a) {
|
|
843
|
+
this.obterRadiosDoGrupo(a).forEach((t) => {
|
|
844
|
+
t !== a && (t.removeAttribute("marcado"), t.removeAttribute("checked"), t.syncState());
|
|
841
845
|
});
|
|
842
846
|
}
|
|
843
847
|
/** Reavalia o tabindex (roving) dos radios; use depois de entrar, sair ou mudar de grupo. */
|
|
844
|
-
static atualizarGrupo(
|
|
845
|
-
|
|
848
|
+
static atualizarGrupo(a) {
|
|
849
|
+
a.forEach((t) => t.atualizarTabindex());
|
|
846
850
|
}
|
|
847
|
-
static tratarNavegacaoTeclado(
|
|
848
|
-
if (!["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(
|
|
849
|
-
|
|
850
|
-
const e = this.obterRadiosDoGrupo(t).filter((
|
|
851
|
+
static tratarNavegacaoTeclado(a, t) {
|
|
852
|
+
if (!["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(a.key)) return;
|
|
853
|
+
a.preventDefault();
|
|
854
|
+
const e = this.obterRadiosDoGrupo(t).filter((u) => !u.disabled && u.isConnected);
|
|
851
855
|
if (e.length <= 1) return;
|
|
852
|
-
const
|
|
853
|
-
if (n !==
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
+
const i = e.indexOf(t), r = a.key === "ArrowDown" || a.key === "ArrowRight", n = (i + (r ? 1 : -1) + e.length) % e.length;
|
|
857
|
+
if (n !== i) {
|
|
858
|
+
const u = e[n];
|
|
859
|
+
u.selecionar(), u.focus();
|
|
856
860
|
}
|
|
857
861
|
}
|
|
858
862
|
}
|
|
@@ -914,7 +918,7 @@ class ot extends m {
|
|
|
914
918
|
const t = l.obterRadiosDoGrupo(this).filter((e) => e !== this && e.isConnected);
|
|
915
919
|
l.desregistrar(this), l.atualizarGrupo(t);
|
|
916
920
|
}
|
|
917
|
-
attributeChangedCallback(t, e,
|
|
921
|
+
attributeChangedCallback(t, e, i) {
|
|
918
922
|
if ((t === "name" || t === "nome") && this.isConnected) {
|
|
919
923
|
const r = l.obterRadiosDoGrupo(this).filter((n) => n !== this);
|
|
920
924
|
l.registrar(this), this.syncState(), l.atualizarGrupo([...r, ...l.obterRadiosDoGrupo(this).filter((n) => n !== this)]);
|
|
@@ -954,7 +958,7 @@ class ot extends m {
|
|
|
954
958
|
return;
|
|
955
959
|
}
|
|
956
960
|
const t = l.obterRadiosDoGrupo(this);
|
|
957
|
-
if ((this.required || t.length > 0 && t.some((
|
|
961
|
+
if ((this.required || t.length > 0 && t.some((i) => i.required)) && !(this.marcado || t.length > 0 && t.some((r) => r.marcado))) {
|
|
958
962
|
const r = this.getAttribute("mensagem-validacao") || "Selecione uma opção.";
|
|
959
963
|
this.internals.setValidity({ valueMissing: !0 }, r, this.containerElement);
|
|
960
964
|
return;
|
|
@@ -999,19 +1003,19 @@ class ot extends m {
|
|
|
999
1003
|
if (t.some((e) => e.marcado))
|
|
1000
1004
|
this.containerElement.setAttribute("tabindex", this.marcado ? "0" : "-1");
|
|
1001
1005
|
else {
|
|
1002
|
-
const e = t.find((
|
|
1006
|
+
const e = t.find((i) => !i.disabled);
|
|
1003
1007
|
this.containerElement.setAttribute("tabindex", e === this ? "0" : "-1");
|
|
1004
1008
|
}
|
|
1005
1009
|
}
|
|
1006
1010
|
syncState() {
|
|
1007
|
-
|
|
1008
|
-
const t = this.marcado, e = this.disabled,
|
|
1011
|
+
d(this, this.containerElement);
|
|
1012
|
+
const t = this.marcado, e = this.disabled, i = this.getAttribute("label"), r = this.getAttribute("posicao-label") || "direita";
|
|
1009
1013
|
this.containerElement.setAttribute("aria-checked", String(t)), this.atualizarTabindex(), e ? (this.containerElement.classList.add("ui-radio--disabled"), this.containerElement.setAttribute("aria-disabled", "true")) : (this.containerElement.classList.remove("ui-radio--disabled"), this.containerElement.removeAttribute("aria-disabled")), t ? this.containerElement.classList.add("ui-radio--checked") : this.containerElement.classList.remove("ui-radio--checked"), r === "esquerda" ? this.containerElement.classList.add("ui-radio--label-esquerda") : this.containerElement.classList.remove("ui-radio--label-esquerda"), x({
|
|
1010
1014
|
host: this,
|
|
1011
1015
|
internals: this.internals,
|
|
1012
1016
|
controle: this.containerElement,
|
|
1013
1017
|
rotulo: this.labelElement,
|
|
1014
|
-
texto:
|
|
1018
|
+
texto: i
|
|
1015
1019
|
}), t ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
|
|
1016
1020
|
}
|
|
1017
1021
|
// === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
|
|
@@ -1022,7 +1026,7 @@ class ot extends m {
|
|
|
1022
1026
|
typeof t == "string" ? this.marcado = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.marcado = t), this.syncState();
|
|
1023
1027
|
}
|
|
1024
1028
|
}
|
|
1025
|
-
|
|
1029
|
+
c("ui-radio", ot);
|
|
1026
1030
|
const nt = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-switch--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-switch__track{display:inline-flex;align-items:center;position:relative;width:36px;height:20px;background:var(--ui-switch-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-pill, 999px);box-sizing:border-box;padding:1px;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;flex-shrink:0}.ui-switch:focus-visible .ui-switch__track,.ui-switch--foco .ui-switch__track{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-switch--checked .ui-switch__track{background:var(--ui-degrade-interno, var(--ui-switch-ativo-fundo, var(--ui-fundo-primario, var(--ui-cor-primaria, #00E08A))));border-color:var(--ui-cor-primaria, #00E08A)}.ui-switch__thumb{display:block;width:16px;height:16px;background:#fff;border-radius:50%;box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .3));transition:transform .2s cubic-bezier(.4,0,.2,1),background-color .2s ease;transform:translate(0)}.ui-switch--checked .ui-switch__thumb{transform:translate(16px);background:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-switch--sm .ui-switch__track{width:28px;height:16px;padding:1px}.ui-switch--sm .ui-switch__thumb{width:12px;height:12px}.ui-switch--sm.ui-switch--checked .ui-switch__thumb{transform:translate(12px)}.ui-switch--lg .ui-switch__track{width:44px;height:24px;padding:1px}.ui-switch--lg .ui-switch__thumb{width:20px;height:20px}.ui-switch--lg.ui-switch--checked .ui-switch__thumb{transform:translate(20px)}.ui-switch__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-switch--label-esquerda{flex-direction:row-reverse}@media (max-width: 640px){.ui-switch{min-height:40px;padding:4px 0}.ui-switch__label{font-size:14px}}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado);--ui-fundo-primario: var(--ui-gradiente-primario)}';
|
|
1027
1031
|
class S extends m {
|
|
1028
1032
|
constructor() {
|
|
@@ -1083,7 +1087,7 @@ class S extends m {
|
|
|
1083
1087
|
disconnectedCallback() {
|
|
1084
1088
|
this.listeners.cleanup();
|
|
1085
1089
|
}
|
|
1086
|
-
attributeChangedCallback(t, e,
|
|
1090
|
+
attributeChangedCallback(t, e, i) {
|
|
1087
1091
|
this.syncState();
|
|
1088
1092
|
}
|
|
1089
1093
|
get ativo() {
|
|
@@ -1158,8 +1162,8 @@ class S extends m {
|
|
|
1158
1162
|
));
|
|
1159
1163
|
}
|
|
1160
1164
|
syncState() {
|
|
1161
|
-
const t = this.ativo, e = this.disabled,
|
|
1162
|
-
|
|
1165
|
+
const t = this.ativo, e = this.disabled, i = this.getAttribute("tamanho") || this.getAttribute("size") || "md", r = this.getAttribute("label"), n = this.getAttribute("posicao-label") || "direita";
|
|
1166
|
+
d(this, this.containerElement), this.containerElement.setAttribute("aria-checked", String(t)), e ? (this.containerElement.classList.add("ui-switch--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true")) : (this.containerElement.classList.remove("ui-switch--disabled"), this.containerElement.setAttribute("tabindex", "0"), this.containerElement.removeAttribute("aria-disabled")), t ? this.containerElement.classList.add("ui-switch--checked") : this.containerElement.classList.remove("ui-switch--checked"), this.containerElement.classList.remove("ui-switch--sm", "ui-switch--md", "ui-switch--lg"), ["sm", "md", "lg"].includes(i) ? this.containerElement.classList.add(`ui-switch--${i}`) : this.containerElement.classList.add("ui-switch--md"), n === "esquerda" ? this.containerElement.classList.add("ui-switch--label-esquerda") : this.containerElement.classList.remove("ui-switch--label-esquerda"), x({
|
|
1163
1167
|
host: this,
|
|
1164
1168
|
internals: this.internals,
|
|
1165
1169
|
controle: this.containerElement,
|
|
@@ -1177,19 +1181,19 @@ class S extends m {
|
|
|
1177
1181
|
}
|
|
1178
1182
|
class lt extends S {
|
|
1179
1183
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1184
|
+
c("ui-switch", S);
|
|
1185
|
+
c("ui-toggle", lt);
|
|
1182
1186
|
export {
|
|
1183
1187
|
Lt as ATRIBUTOS_OBSERVADOS_CAMPO_TEXTO,
|
|
1184
|
-
|
|
1188
|
+
Q as ATRIBUTOS_OBSERVADOS_LISTA_FLUTUANTE,
|
|
1185
1189
|
Y as ListaFlutuantePosicionamento,
|
|
1186
1190
|
J as ListaFlutuanteTeclado,
|
|
1187
1191
|
l as RadioGrupoRegistry,
|
|
1188
1192
|
pt as SELETOR_CAMPOS_PADRAO,
|
|
1189
1193
|
k as UIAreaTexto,
|
|
1190
|
-
|
|
1194
|
+
It as UICampoTexto,
|
|
1191
1195
|
st as UICheckbox,
|
|
1192
|
-
|
|
1196
|
+
qt as UIInput,
|
|
1193
1197
|
w as UIListaFlutuante,
|
|
1194
1198
|
ot as UIRadio,
|
|
1195
1199
|
it as UISelect,
|
|
@@ -1213,7 +1217,7 @@ export {
|
|
|
1213
1217
|
St as preencherCampos,
|
|
1214
1218
|
y as renderizarItensLista,
|
|
1215
1219
|
T as sincronizarFeedbackErro,
|
|
1216
|
-
|
|
1217
|
-
|
|
1220
|
+
Vt as sincronizarIconeSenha,
|
|
1221
|
+
Rt as sincronizarLabelEPlaceholder,
|
|
1218
1222
|
Ct as validarCampos
|
|
1219
1223
|
};
|