@thibezer/ui-components-kit 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +760 -739
- package/dist/camadas.cjs +72 -72
- package/dist/camadas.js +700 -667
- package/dist/canvas.cjs +99 -140
- package/dist/canvas.js +5125 -1192
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +4 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +10 -0
- package/dist/components/ui-canvas-cad/cad-estilos-externos.d.ts +16 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +4 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +262 -0
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +32 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +1 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +143 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +1 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +8 -1
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +19 -9
- package/dist/components/ui-tabela/tipos.d.ts +6 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +41 -2
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +0 -5
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +17 -1
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +10 -1
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +3 -1
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +5 -1
- package/dist/core/alvo-digitavel.d.ts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/svg-seguro.d.ts +10 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +12 -10
- package/dist/custom-elements.json +14782 -10666
- package/dist/data.cjs +1 -1
- package/dist/data.js +51 -46
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +1 -1
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +18 -0
- package/dist/gerencigeo-canvas/feature_adapters.d.ts +35 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +45 -0
- package/dist/gerencigeo-canvas/feature_amostra.d.ts +4 -0
- package/dist/gerencigeo-canvas/feature_caixa.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_cluster.d.ts +61 -0
- package/dist/gerencigeo-canvas/feature_cursores.d.ts +17 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +53 -0
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +91 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +62 -0
- package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_hud.d.ts +23 -0
- package/dist/gerencigeo-canvas/feature_indice.d.ts +36 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +16 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +31 -0
- package/dist/gerencigeo-canvas/feature_selecao.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +14 -0
- package/dist/gerencigeo-canvas/feature_snap.d.ts +25 -0
- package/dist/gerencigeo-canvas/feature_types.d.ts +86 -0
- package/dist/gerencigeo-canvas/feature_versoes.d.ts +19 -0
- package/dist/gerencigeo-canvas/index.d.ts +21 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +30 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +11 -3
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +1 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +24 -5
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +89 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +1 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +2 -2
- package/dist/gerencigeo-canvas/types.d.ts +12 -0
- package/dist/gerencigeo-canvas/utils.d.ts +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +111 -106
- package/dist/leaflet-DcO7uRC-.cjs +1 -0
- package/dist/{leaflet-DkaFZYc5.js → leaflet-PPDKB6Dd.js} +37 -37
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -3
- package/dist/seletor-mapa-base.cjs +13 -13
- package/dist/seletor-mapa-base.js +101 -51
- package/dist/svg-seguro-BsbNQqpd.js +50 -0
- package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +41 -36
- package/dist/tipos-elementos.d.ts +17 -4
- package/dist/tipos-vue.d.ts +15 -4
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/{ui-paleta-ferramentas-BIytXQLh.js → ui-paleta-ferramentas-CEZYcN4J.js} +18 -27
- package/dist/{ui-paleta-ferramentas-DqLY51qa.cjs → ui-paleta-ferramentas-Dbj1kBS9.cjs} +6 -6
- package/dist/{ui-switch-DWLgVVnT.js → ui-switch-BcOqOkiV.js} +124 -96
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/{ui-tabela-propriedades-BNcE6VLX.js → ui-tabela-propriedades-Boy7I5yW.js} +1304 -1072
- package/package.json +169 -169
- package/dist/leaflet-Cw6tqYFh.cjs +0 -1
- package/dist/ui-switch-yZIn3IW0.cjs +0 -53
- package/dist/ui-tabela-propriedades-D3pyQvyy.cjs +0 -145
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var k = (n,
|
|
3
|
-
var a = (n,
|
|
2
|
+
var k = (n, i, t) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var a = (n, i, t) => k(n, typeof i != "symbol" ? i + "" : i, t);
|
|
4
4
|
import { L as d } from "./listener-bag-DQgv7OON.js";
|
|
5
5
|
import { a as y } from "./parts-CaoQiCfI.js";
|
|
6
6
|
import { d as h } from "./ssr-safe-5cWfJP-s.js";
|
|
7
|
-
import { F as u, r as
|
|
7
|
+
import { F as u, r as w } from "./ui-campo-texto-Uu2dJE_0.js";
|
|
8
8
|
import { g as m, o as p, c as f } from "./form-validacao-BIOXxt-1.js";
|
|
9
|
-
class
|
|
10
|
-
constructor(
|
|
9
|
+
class A {
|
|
10
|
+
constructor(i, t, e) {
|
|
11
11
|
a(this, "scrollHandler");
|
|
12
12
|
a(this, "resizeHandler");
|
|
13
13
|
a(this, "posicionar", () => {
|
|
@@ -15,20 +15,28 @@ class w {
|
|
|
15
15
|
this.content.style.top = "", this.content.style.left = "", this.content.style.minWidth = "";
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
this.content.style.top = `${Math.round(
|
|
18
|
+
const i = this.button.getBoundingClientRect();
|
|
19
|
+
this.content.style.top = `${Math.round(i.bottom + 2)}px`, this.content.style.left = `${Math.round(i.left)}px`, this.content.style.minWidth = `${Math.round(Math.max(i.width, 120))}px`, this.ajustarAoViewport(i);
|
|
20
20
|
});
|
|
21
|
-
this.host =
|
|
21
|
+
this.host = i, this.button = t, this.content = e;
|
|
22
22
|
}
|
|
23
23
|
isMobileOrBottomSheet() {
|
|
24
24
|
return typeof window > "u" ? !1 : window.innerWidth <= 640 || this.host.hasAttribute("bottom-sheet") || this.host.hasAttribute("modo-mobile");
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/** Com a lista já visível (medida real): abre para cima se faltar espaço embaixo e não deixa sair pela lateral. */
|
|
27
|
+
ajustarAoViewport(i) {
|
|
28
|
+
const t = this.content.offsetHeight, e = this.content.offsetWidth;
|
|
29
|
+
if (t <= 0 || typeof window > "u") return;
|
|
30
|
+
const s = 8;
|
|
31
|
+
i.bottom + 2 + t > window.innerHeight - s && i.top - 2 - t >= s && (this.content.style.top = `${Math.round(i.top - 2 - t)}px`), i.left + e > window.innerWidth - s && (this.content.style.left = `${Math.max(s, Math.round(window.innerWidth - s - e))}px`);
|
|
32
|
+
}
|
|
33
|
+
ativarAcompanhamento(i) {
|
|
34
|
+
if (this.scrollHandler = i, 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")
|
|
28
35
|
try {
|
|
29
36
|
this.content.showPopover();
|
|
30
37
|
} catch {
|
|
31
38
|
}
|
|
39
|
+
this.posicionar();
|
|
32
40
|
}
|
|
33
41
|
desativarAcompanhamento() {
|
|
34
42
|
if (this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler, { capture: !0 }), this.scrollHandler = void 0), this.resizeHandler && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = void 0), typeof this.content.hidePopover == "function")
|
|
@@ -39,23 +47,34 @@ class w {
|
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
class E {
|
|
42
|
-
constructor(
|
|
50
|
+
constructor(i) {
|
|
43
51
|
a(this, "focusedIndex", -1);
|
|
44
|
-
this.listElement =
|
|
52
|
+
this.listElement = i;
|
|
45
53
|
}
|
|
46
54
|
focarPrimeiroItem() {
|
|
47
|
-
const
|
|
48
|
-
|
|
55
|
+
const i = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
|
|
56
|
+
if (i.length > 0) {
|
|
57
|
+
const t = i.findIndex((e) => e.classList.contains("ui-lista-flutuante__item--selecionado"));
|
|
58
|
+
this.focusedIndex = Math.max(0, t), i[this.focusedIndex].focus();
|
|
59
|
+
}
|
|
49
60
|
}
|
|
50
61
|
resetarFoco() {
|
|
51
62
|
this.focusedIndex = -1;
|
|
52
63
|
}
|
|
53
|
-
moverFoco(
|
|
64
|
+
moverFoco(i) {
|
|
54
65
|
const t = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
|
|
55
|
-
t.length !== 0 && (this.focusedIndex +=
|
|
56
|
-
}
|
|
57
|
-
tratarKeydownLista(
|
|
58
|
-
|
|
66
|
+
t.length !== 0 && (this.focusedIndex += i, this.focusedIndex < 0 && (this.focusedIndex = t.length - 1), this.focusedIndex >= t.length && (this.focusedIndex = 0), t[this.focusedIndex].focus());
|
|
67
|
+
}
|
|
68
|
+
tratarKeydownLista(i, t, e, s, r) {
|
|
69
|
+
if (i.key === "ArrowDown")
|
|
70
|
+
i.preventDefault(), this.moverFoco(1);
|
|
71
|
+
else if (i.key === "ArrowUp")
|
|
72
|
+
i.preventDefault(), this.moverFoco(-1);
|
|
73
|
+
else if (i.key === "Home" || i.key === "End") {
|
|
74
|
+
i.preventDefault();
|
|
75
|
+
const o = i.key === "End";
|
|
76
|
+
this.focusedIndex = o ? -1 : 0, o ? this.moverFoco(-1) : this.moverFoco(0);
|
|
77
|
+
} else i.key === "Tab" ? s() : i.key === "Enter" || i.key === " " ? (i.preventDefault(), this.focusedIndex >= 0 && this.focusedIndex < t.length && e(t[this.focusedIndex])) : i.key === "Escape" && (i.preventDefault(), s(), r.focus());
|
|
59
78
|
}
|
|
60
79
|
}
|
|
61
80
|
const S = ':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}.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, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));padding:0 8px;background-color: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-color: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: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: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-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-lista-flutuante__item--selecionado{background-color: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)}}', L = [
|
|
@@ -102,16 +121,16 @@ function C() {
|
|
|
102
121
|
</div>
|
|
103
122
|
`;
|
|
104
123
|
}
|
|
105
|
-
function b(n,
|
|
106
|
-
n.innerHTML = "",
|
|
107
|
-
const
|
|
108
|
-
|
|
124
|
+
function b(n, i, t) {
|
|
125
|
+
n.innerHTML = "", i.forEach((e) => {
|
|
126
|
+
const s = document.createElement("li"), r = String(e.id) === String(t);
|
|
127
|
+
s.className = `ui-lista-flutuante__item ${r ? "ui-lista-flutuante__item--selecionado" : ""}`, s.setAttribute("data-id", e.id), s.textContent = e.label, s.role = "option", s.tabIndex = -1, s.setAttribute("part", r ? "opcao opcao-selecionada" : "opcao"), r && s.setAttribute("aria-selected", "true"), n.appendChild(s);
|
|
109
128
|
});
|
|
110
129
|
}
|
|
111
|
-
function z(n,
|
|
130
|
+
function z(n, i) {
|
|
112
131
|
n.querySelectorAll(".ui-lista-flutuante__item").forEach((e) => {
|
|
113
|
-
const
|
|
114
|
-
y(e, "opcao-selecionada",
|
|
132
|
+
const s = e.getAttribute("data-id");
|
|
133
|
+
y(e, "opcao-selecionada", s === String(i)), s === String(i) ? (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"));
|
|
115
134
|
});
|
|
116
135
|
}
|
|
117
136
|
class g extends u {
|
|
@@ -130,6 +149,7 @@ class g extends u {
|
|
|
130
149
|
a(this, "_itens", []);
|
|
131
150
|
a(this, "_value", "");
|
|
132
151
|
a(this, "_defaultValue", "");
|
|
152
|
+
a(this, "_defaultCapturado", !1);
|
|
133
153
|
a(this, "observer");
|
|
134
154
|
a(this, "posicionamento");
|
|
135
155
|
a(this, "teclado");
|
|
@@ -137,7 +157,13 @@ class g extends u {
|
|
|
137
157
|
t.stopPropagation(), !this.disabled && (this.hasAttribute("aberta") ? this.fechar() : this.abrir());
|
|
138
158
|
});
|
|
139
159
|
a(this, "handleKeyDown", (t) => {
|
|
140
|
-
|
|
160
|
+
if (!this.disabled) {
|
|
161
|
+
if (t.key === "Escape" && this.hasAttribute("aberta")) {
|
|
162
|
+
t.preventDefault(), this.fechar();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
(t.key === "Enter" || t.key === " " || t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), this.hasAttribute("aberta") ? this.teclado.focarPrimeiroItem() : this.abrir());
|
|
166
|
+
}
|
|
141
167
|
});
|
|
142
168
|
a(this, "handleListKeyDown", (t) => {
|
|
143
169
|
this.hasAttribute("aberta") && this.teclado.tratarKeydownLista(
|
|
@@ -168,7 +194,7 @@ class g extends u {
|
|
|
168
194
|
t.stopPropagation();
|
|
169
195
|
const e = (o = t.target) == null ? void 0 : o.closest("li[data-id]");
|
|
170
196
|
if (!e) return;
|
|
171
|
-
const
|
|
197
|
+
const s = e.getAttribute("data-id"), r = this._itens.find((l) => String(l.id) === String(s));
|
|
172
198
|
r && this.selecionarItem(r);
|
|
173
199
|
});
|
|
174
200
|
const t = this.attachShadow({ mode: "open" });
|
|
@@ -179,7 +205,7 @@ class g extends u {
|
|
|
179
205
|
gatilho: `${e}-gatilho`,
|
|
180
206
|
texto: `${e}-texto`,
|
|
181
207
|
lista: `${e}-lista`
|
|
182
|
-
}, 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
|
|
208
|
+
}, 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 A(this, this.button, this.content), this.teclado = new E(this.listElement);
|
|
183
209
|
}
|
|
184
210
|
static get observedAttributes() {
|
|
185
211
|
return L;
|
|
@@ -187,24 +213,24 @@ class g extends u {
|
|
|
187
213
|
connectedCallback() {
|
|
188
214
|
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) => {
|
|
189
215
|
t.stopPropagation(), this.fechar();
|
|
190
|
-
}), this.listeners.add(document, "click", this.handleClickFora), this.listeners.add(this.labelElement, "click", this.focarGatilho), this.listeners.add(this, "click", this.handleHostClick), this._defaultValue = this.getAttribute("value") || "", this.carregarItensFilhos(), this.syncState(), this.observer = new MutationObserver(() => this.carregarItensFilhos()), this.observer.observe(this, { childList: !0, subtree: !0 });
|
|
216
|
+
}), this.listeners.add(document, "click", this.handleClickFora), this.listeners.add(this.labelElement, "click", this.focarGatilho), this.listeners.add(this, "click", this.handleHostClick), this._defaultCapturado || (this._defaultValue = this.getAttribute("value") || "", this._defaultCapturado = !0), this.carregarItensFilhos(), this.syncState(), this.observer = new MutationObserver(() => this.carregarItensFilhos()), this.observer.observe(this, { childList: !0, subtree: !0 });
|
|
191
217
|
}
|
|
192
218
|
carregarItensFilhos() {
|
|
193
219
|
const t = Array.from(this.querySelectorAll('option, ui-opcao, [role="option"], [data-opcao], [data-value]:not(input):not(select)'));
|
|
194
|
-
t.length > 0 && (this._itens = t.map((e,
|
|
220
|
+
t.length > 0 && (this._itens = t.map((e, s) => {
|
|
195
221
|
var o;
|
|
196
|
-
const r = e.getAttribute("value") || e.getAttribute("data-value") || String(
|
|
222
|
+
const r = e.getAttribute("value") || e.getAttribute("data-value") || String(s + 1);
|
|
197
223
|
return {
|
|
198
224
|
id: r,
|
|
199
|
-
label: ((o = e.textContent) == null ? void 0 : o.trim()) || r || `Opção ${
|
|
225
|
+
label: ((o = e.textContent) == null ? void 0 : o.trim()) || r || `Opção ${s + 1}`
|
|
200
226
|
};
|
|
201
227
|
}), b(this.listElement, this._itens, this._value), this.syncLabel());
|
|
202
228
|
}
|
|
203
229
|
disconnectedCallback() {
|
|
204
230
|
this.listeners.cleanup(), this.observer && this.observer.disconnect(), this.fechar();
|
|
205
231
|
}
|
|
206
|
-
attributeChangedCallback(t, e,
|
|
207
|
-
t === "aberta" && this.button.setAttribute("aria-expanded", String(
|
|
232
|
+
attributeChangedCallback(t, e, s) {
|
|
233
|
+
t === "aberta" && this.button.setAttribute("aria-expanded", String(s !== null)), (t === "texto-padrao" || t === "placeholder" || t === "label" || t === "rotulo" || t === "aria-label") && this.syncLabel(), t === "value" && s !== this._value && (this.value = s || ""), t === "disabled" && (this.button.disabled = this.disabled), (t === "altura" || t === "height") && (s ? this.style.setProperty("--ui-campo-altura", isNaN(Number(s)) ? s : `${s}px`) : this.style.removeProperty("--ui-campo-altura"));
|
|
208
234
|
}
|
|
209
235
|
get value() {
|
|
210
236
|
return this._value;
|
|
@@ -272,18 +298,18 @@ class g extends u {
|
|
|
272
298
|
syncLabel() {
|
|
273
299
|
const t = this.getAttribute("label") || this.getAttribute("rotulo");
|
|
274
300
|
if (t)
|
|
275
|
-
|
|
301
|
+
w(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");
|
|
276
302
|
else {
|
|
277
303
|
this.labelElement.style.display = "none", this.sincronizarRotuloExterno();
|
|
278
|
-
const
|
|
279
|
-
this.sheetTituloElement.textContent =
|
|
304
|
+
const s = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
|
|
305
|
+
this.sheetTituloElement.textContent = s;
|
|
280
306
|
}
|
|
281
|
-
const e = this._itens.find((
|
|
307
|
+
const e = this._itens.find((s) => String(s.id) === String(this._value));
|
|
282
308
|
if (e)
|
|
283
309
|
this.textoElement.textContent = e.label;
|
|
284
310
|
else {
|
|
285
|
-
const
|
|
286
|
-
this.textoElement.textContent =
|
|
311
|
+
const s = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
|
|
312
|
+
this.textoElement.textContent = s;
|
|
287
313
|
}
|
|
288
314
|
}
|
|
289
315
|
/** Sem o atributo `label`, usa o rótulo de fora do Shadow DOM (aria-label, <label for>, <label> envolvente). */
|
|
@@ -297,30 +323,32 @@ class g extends u {
|
|
|
297
323
|
t && this.style.setProperty("--ui-campo-altura", isNaN(Number(t)) ? t : `${t}px`), this.hasAttribute("value") && (this._value = this.getAttribute("value") || "", this.internals.setFormValue(this._value)), this.syncLabel(), this.atualizarValidade();
|
|
298
324
|
}
|
|
299
325
|
selecionarItem(t) {
|
|
300
|
-
|
|
326
|
+
var r;
|
|
327
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.activeElement, s = !!e && this.content.contains(e);
|
|
328
|
+
this.value = t.id, this.fechar(), s && this.button.focus(), this.dispatchEvent(
|
|
301
329
|
new CustomEvent("ui-selecionar", {
|
|
302
330
|
detail: t,
|
|
303
331
|
bubbles: !0,
|
|
304
332
|
composed: !0
|
|
305
333
|
})
|
|
306
334
|
), this.dispatchEvent(
|
|
307
|
-
new Event("
|
|
335
|
+
new Event("input", {
|
|
308
336
|
bubbles: !0,
|
|
309
337
|
composed: !0
|
|
310
338
|
})
|
|
311
339
|
), this.dispatchEvent(
|
|
312
|
-
new Event("
|
|
340
|
+
new Event("change", {
|
|
313
341
|
bubbles: !0,
|
|
314
342
|
composed: !0
|
|
315
343
|
})
|
|
316
344
|
);
|
|
317
345
|
}
|
|
318
346
|
}
|
|
319
|
-
class
|
|
347
|
+
class I extends g {
|
|
320
348
|
}
|
|
321
349
|
h("ui-lista-flutuante", g);
|
|
322
|
-
h("ui-select",
|
|
323
|
-
const
|
|
350
|
+
h("ui-select", I);
|
|
351
|
+
const q = ':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-color: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-color: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}}';
|
|
324
352
|
class V extends u {
|
|
325
353
|
constructor() {
|
|
326
354
|
super();
|
|
@@ -344,7 +372,7 @@ class V extends u {
|
|
|
344
372
|
});
|
|
345
373
|
const t = this.attachShadow({ mode: "open" });
|
|
346
374
|
t.innerHTML = `
|
|
347
|
-
<style>${
|
|
375
|
+
<style>${q}</style>
|
|
348
376
|
<div class="ui-checkbox" part="base" tabindex="0" role="checkbox" aria-checked="false">
|
|
349
377
|
<span class="ui-checkbox__box" part="controle">
|
|
350
378
|
<span class="ui-checkbox__mark" part="indicador"></span>
|
|
@@ -375,7 +403,7 @@ class V extends u {
|
|
|
375
403
|
disconnectedCallback() {
|
|
376
404
|
this.listeners.cleanup();
|
|
377
405
|
}
|
|
378
|
-
attributeChangedCallback(t, e,
|
|
406
|
+
attributeChangedCallback(t, e, s) {
|
|
379
407
|
this.syncState();
|
|
380
408
|
}
|
|
381
409
|
get marcado() {
|
|
@@ -453,11 +481,11 @@ class V extends u {
|
|
|
453
481
|
));
|
|
454
482
|
}
|
|
455
483
|
syncState() {
|
|
456
|
-
const t = this.marcado, e = this.indeterminado,
|
|
484
|
+
const t = this.marcado, e = this.indeterminado, s = this.disabled, r = this.getAttribute("label"), o = this.getAttribute("posicao-label") || "direita";
|
|
457
485
|
this.containerElement.setAttribute(
|
|
458
486
|
"aria-checked",
|
|
459
487
|
e ? "mixed" : String(t)
|
|
460
|
-
),
|
|
488
|
+
), s ? (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"), o === "esquerda" ? this.containerElement.classList.add("ui-checkbox--label-esquerda") : this.containerElement.classList.remove("ui-checkbox--label-esquerda"), e ? this.markElement.innerHTML = `
|
|
461
489
|
<svg viewBox="0 0 24 24">
|
|
462
490
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
463
491
|
</svg>
|
|
@@ -478,55 +506,55 @@ class V extends u {
|
|
|
478
506
|
h("ui-checkbox", V);
|
|
479
507
|
const D = ':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-color: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-color: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}';
|
|
480
508
|
class c {
|
|
481
|
-
static getScopeNode(
|
|
482
|
-
return
|
|
509
|
+
static getScopeNode(i) {
|
|
510
|
+
return i.closest("form") || i.getRootNode() || document;
|
|
483
511
|
}
|
|
484
|
-
static registrar(
|
|
485
|
-
const t =
|
|
512
|
+
static registrar(i) {
|
|
513
|
+
const t = i.name;
|
|
486
514
|
if (t) {
|
|
487
|
-
const e = this.getScopeNode(
|
|
515
|
+
const e = this.getScopeNode(i);
|
|
488
516
|
this.registry.has(e) || this.registry.set(e, /* @__PURE__ */ new Map());
|
|
489
|
-
const
|
|
490
|
-
|
|
517
|
+
const s = this.registry.get(e);
|
|
518
|
+
s.has(t) || s.set(t, /* @__PURE__ */ new Set()), s.get(t).add(i);
|
|
491
519
|
}
|
|
492
520
|
}
|
|
493
|
-
static desregistrar(
|
|
494
|
-
const t =
|
|
521
|
+
static desregistrar(i) {
|
|
522
|
+
const t = i.name;
|
|
495
523
|
if (t) {
|
|
496
|
-
const e = this.getScopeNode(
|
|
497
|
-
if (
|
|
498
|
-
const r =
|
|
499
|
-
r.delete(
|
|
524
|
+
const e = this.getScopeNode(i), s = this.registry.get(e);
|
|
525
|
+
if (s && s.has(t)) {
|
|
526
|
+
const r = s.get(t);
|
|
527
|
+
r.delete(i), r.size === 0 && s.delete(t), s.size === 0 && this.registry.delete(e);
|
|
500
528
|
}
|
|
501
529
|
}
|
|
502
530
|
}
|
|
503
|
-
static obterRadiosDoGrupo(
|
|
504
|
-
const t =
|
|
531
|
+
static obterRadiosDoGrupo(i) {
|
|
532
|
+
const t = i.name;
|
|
505
533
|
if (!t) return [];
|
|
506
|
-
const e = this.getScopeNode(
|
|
507
|
-
return !
|
|
534
|
+
const e = this.getScopeNode(i), s = this.registry.get(e);
|
|
535
|
+
return !s || !s.has(t) ? [] : Array.from(s.get(t));
|
|
508
536
|
}
|
|
509
|
-
static desmarcarOutros(
|
|
510
|
-
this.obterRadiosDoGrupo(
|
|
511
|
-
e !==
|
|
537
|
+
static desmarcarOutros(i) {
|
|
538
|
+
this.obterRadiosDoGrupo(i).forEach((e) => {
|
|
539
|
+
e !== i && (e.removeAttribute("marcado"), e.removeAttribute("checked"), e.syncState());
|
|
512
540
|
});
|
|
513
541
|
}
|
|
514
|
-
static tratarNavegacaoTeclado(
|
|
515
|
-
if (["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
-
const r =
|
|
542
|
+
static tratarNavegacaoTeclado(i, t) {
|
|
543
|
+
if (["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(i.key)) {
|
|
544
|
+
i.preventDefault();
|
|
545
|
+
const s = this.obterRadiosDoGrupo(t).filter((l) => !l.disabled);
|
|
546
|
+
if (s.length <= 1) return;
|
|
547
|
+
const r = s.indexOf(t);
|
|
520
548
|
let o = r;
|
|
521
|
-
if (
|
|
522
|
-
const l =
|
|
549
|
+
if (i.key === "ArrowDown" || i.key === "ArrowRight" ? o = (r + 1) % s.length : (i.key === "ArrowUp" || i.key === "ArrowLeft") && (o = (r - 1 + s.length) % s.length), o !== r && o >= 0 && o < s.length) {
|
|
550
|
+
const l = s[o];
|
|
523
551
|
l.selecionar(), l.focus();
|
|
524
552
|
}
|
|
525
553
|
}
|
|
526
554
|
}
|
|
527
555
|
}
|
|
528
556
|
a(c, "registry", /* @__PURE__ */ new WeakMap());
|
|
529
|
-
class
|
|
557
|
+
class M extends u {
|
|
530
558
|
constructor() {
|
|
531
559
|
super();
|
|
532
560
|
a(this, "containerElement");
|
|
@@ -576,7 +604,7 @@ class R extends u {
|
|
|
576
604
|
disconnectedCallback() {
|
|
577
605
|
this.containerElement.removeEventListener("click", this.handleClick), this.containerElement.removeEventListener("keydown", this.handleKeyDown), this.containerElement.removeEventListener("focus", this.handleFocus), this.containerElement.removeEventListener("blur", this.handleBlur), c.desregistrar(this);
|
|
578
606
|
}
|
|
579
|
-
attributeChangedCallback(t, e,
|
|
607
|
+
attributeChangedCallback(t, e, s) {
|
|
580
608
|
this.syncState();
|
|
581
609
|
}
|
|
582
610
|
get marcado() {
|
|
@@ -611,7 +639,7 @@ class R extends u {
|
|
|
611
639
|
return;
|
|
612
640
|
}
|
|
613
641
|
const t = c.obterRadiosDoGrupo(this);
|
|
614
|
-
if ((this.required || t.length > 0 && t.some((
|
|
642
|
+
if ((this.required || t.length > 0 && t.some((s) => s.required)) && !(this.marcado || t.length > 0 && t.some((r) => r.marcado))) {
|
|
615
643
|
const r = this.getAttribute("mensagem-validacao") || "Selecione uma opção.";
|
|
616
644
|
this.internals.setValidity({ valueMissing: !0 }, r, this.containerElement);
|
|
617
645
|
return;
|
|
@@ -640,7 +668,7 @@ class R extends u {
|
|
|
640
668
|
), c.obterRadiosDoGrupo(this).forEach((t) => t.atualizarValidade()));
|
|
641
669
|
}
|
|
642
670
|
syncState() {
|
|
643
|
-
const t = this.marcado, e = this.disabled,
|
|
671
|
+
const t = this.marcado, e = this.disabled, s = this.getAttribute("label"), r = this.getAttribute("posicao-label") || "direita";
|
|
644
672
|
if (this.containerElement.setAttribute("aria-checked", String(t)), e)
|
|
645
673
|
this.containerElement.classList.add("ui-radio--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true");
|
|
646
674
|
else {
|
|
@@ -648,7 +676,7 @@ class R extends u {
|
|
|
648
676
|
const o = c.obterRadiosDoGrupo(this);
|
|
649
677
|
o.length > 0 ? o.some((v) => v.marcado) ? this.containerElement.setAttribute("tabindex", t ? "0" : "-1") : this.containerElement.setAttribute("tabindex", o[0] === this ? "0" : "-1") : this.containerElement.setAttribute("tabindex", "0");
|
|
650
678
|
}
|
|
651
|
-
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"),
|
|
679
|
+
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"), s ? (this.labelElement.textContent = s, this.labelElement.style.display = "inline") : this.labelElement.style.display = "none", t ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
|
|
652
680
|
}
|
|
653
681
|
// === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
|
|
654
682
|
formResetCallback() {
|
|
@@ -658,8 +686,8 @@ class R extends u {
|
|
|
658
686
|
typeof t == "string" ? this.marcado = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.marcado = t), this.syncState();
|
|
659
687
|
}
|
|
660
688
|
}
|
|
661
|
-
h("ui-radio",
|
|
662
|
-
const
|
|
689
|
+
h("ui-radio", M);
|
|
690
|
+
const R = ':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-color: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-color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-switch__thumb{display:block;width:16px;height:16px;background-color:#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-color: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}}';
|
|
663
691
|
class x extends u {
|
|
664
692
|
constructor() {
|
|
665
693
|
super();
|
|
@@ -685,7 +713,7 @@ class x extends u {
|
|
|
685
713
|
});
|
|
686
714
|
const t = this.attachShadow({ mode: "open" });
|
|
687
715
|
t.innerHTML = `
|
|
688
|
-
<style>${
|
|
716
|
+
<style>${R}</style>
|
|
689
717
|
<div class="ui-switch" part="base" tabindex="0" role="switch" aria-checked="false">
|
|
690
718
|
<span class="ui-switch__track" part="controle">
|
|
691
719
|
<span class="ui-switch__thumb" part="indicador"></span>
|
|
@@ -718,7 +746,7 @@ class x extends u {
|
|
|
718
746
|
disconnectedCallback() {
|
|
719
747
|
this.listeners.cleanup();
|
|
720
748
|
}
|
|
721
|
-
attributeChangedCallback(t, e,
|
|
749
|
+
attributeChangedCallback(t, e, s) {
|
|
722
750
|
this.syncState();
|
|
723
751
|
}
|
|
724
752
|
get ativo() {
|
|
@@ -789,8 +817,8 @@ class x extends u {
|
|
|
789
817
|
));
|
|
790
818
|
}
|
|
791
819
|
syncState() {
|
|
792
|
-
const t = this.ativo, e = this.disabled,
|
|
793
|
-
if (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(
|
|
820
|
+
const t = this.ativo, e = this.disabled, s = this.getAttribute("tamanho") || this.getAttribute("size") || "md", r = this.getAttribute("label"), o = this.getAttribute("posicao-label") || "direita";
|
|
821
|
+
if (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(s) ? this.containerElement.classList.add(`ui-switch--${s}`) : this.containerElement.classList.add("ui-switch--md"), o === "esquerda" ? this.containerElement.classList.add("ui-switch--label-esquerda") : this.containerElement.classList.remove("ui-switch--label-esquerda"), r)
|
|
794
822
|
this.labelElement.textContent = r, this.labelElement.style.display = "inline", this.containerElement.setAttribute("aria-labelledby", this.labelId), this.containerElement.removeAttribute("aria-label");
|
|
795
823
|
else {
|
|
796
824
|
this.labelElement.style.display = "none", this.containerElement.removeAttribute("aria-labelledby");
|
|
@@ -807,21 +835,21 @@ class x extends u {
|
|
|
807
835
|
typeof t == "string" ? this.ativo = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.ativo = t), this.syncState();
|
|
808
836
|
}
|
|
809
837
|
}
|
|
810
|
-
class
|
|
838
|
+
class F extends x {
|
|
811
839
|
}
|
|
812
840
|
h("ui-switch", x);
|
|
813
|
-
h("ui-toggle",
|
|
841
|
+
h("ui-toggle", F);
|
|
814
842
|
export {
|
|
815
843
|
L as A,
|
|
816
|
-
|
|
844
|
+
A as L,
|
|
817
845
|
c as R,
|
|
818
846
|
V as U,
|
|
819
847
|
E as a,
|
|
820
848
|
g as b,
|
|
821
|
-
|
|
822
|
-
|
|
849
|
+
M as c,
|
|
850
|
+
I as d,
|
|
823
851
|
x as e,
|
|
824
|
-
|
|
852
|
+
F as f,
|
|
825
853
|
z as g,
|
|
826
854
|
C as h,
|
|
827
855
|
b as r
|