@thibezer/ui-components-kit 2.8.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +3 -3
- package/dist/canvas.cjs +70 -70
- package/dist/canvas.js +3125 -2473
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +24 -1
- package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +10 -3
- package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +10 -2
- package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +10 -3
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +31 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +12 -0
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +16 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +15 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/custom-elements.json +8934 -8415
- package/dist/data.cjs +1 -1
- package/dist/data.js +1 -1
- package/dist/gerencigeo-canvas/curva_leaflet.d.ts +2 -2
- package/dist/gerencigeo-canvas/feature_curvas.d.ts +3 -1
- package/dist/gerencigeo-canvas/feature_lod.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +9 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +16 -8
- package/dist/gerencigeo-canvas/index.d.ts +7 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +22 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +5 -0
- package/dist/gerencigeo-canvas/motor/dados-camada.d.ts +39 -0
- package/dist/gerencigeo-canvas/motor/estilo.d.ts +28 -0
- package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +27 -0
- package/dist/gerencigeo-canvas/motor/index.d.ts +5 -0
- package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +107 -0
- package/dist/gerencigeo-canvas/motor/tipos.d.ts +100 -0
- package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +87 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +58 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_despachante.d.ts +31 -0
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +48 -9
- package/dist/gerencigeo-canvas/renderers/marcadores_feicoes.d.ts +11 -0
- package/dist/gerencigeo-canvas/renderers/marcas_lod_layer.d.ts +19 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_feicoes_tipos.d.ts +44 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +95 -0
- package/dist/gerencigeo-canvas/renderers/selecao_visual.d.ts +6 -0
- package/dist/gerencigeo-canvas/types.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/motor-BB6tB6U-.cjs +1 -0
- package/dist/motor-CFI84lM2.js +1301 -0
- package/dist/motor.cjs +1 -0
- package/dist/motor.d.ts +7 -0
- package/dist/motor.js +52 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -3
- package/dist/svg-seguro-ChVJ2L2z.js +74 -0
- package/dist/svg-seguro-J2RM1Ssf.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +1 -1
- package/dist/tipos-elementos.d.ts +13 -0
- package/dist/tipos-vue.d.ts +8 -0
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/{ui-linha-C6HBnsaw.cjs → ui-linha-BYAX4W6x.cjs} +5 -5
- package/dist/{ui-linha-nCDh2wPm.js → ui-linha-aqLlaYi7.js} +57 -51
- package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +1233 -0
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +21 -0
- package/dist/{ui-tabela-propriedades-DzZlyNZ_.cjs → ui-tabela-propriedades-CjK2gG14.cjs} +1 -1
- package/dist/{ui-tabela-propriedades-D9Echt2X.js → ui-tabela-propriedades-DoL4SE0r.js} +1 -1
- package/package.json +6 -1
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-paleta-ferramentas-Ksh6gMW3.js +0 -890
- package/dist/ui-paleta-ferramentas-bDLPbiGA.cjs +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
|
-
var y = (
|
|
3
|
-
var u = (
|
|
2
|
+
var y = (n, a, t) => a in n ? A(n, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[a] = t;
|
|
3
|
+
var u = (n, a, t) => y(n, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
import { d as p, S as v } from "./ssr-safe-5cWfJP-s.js";
|
|
5
5
|
import { e as g, a as m } from "./opcoes-CJYLi6kd.js";
|
|
6
6
|
import { L as w } from "./listener-bag-DQgv7OON.js";
|
|
@@ -71,17 +71,17 @@ class O extends v {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
render() {
|
|
74
|
-
const t = this.resolveTag(), i = g(this.getAttribute("variante"), b, "corpo"), e = m(this.getAttribute("cor"), C), r = m(this.getAttribute("peso"), T), o = m(this.getAttribute("alinhamento"), I),
|
|
74
|
+
const t = this.resolveTag(), i = g(this.getAttribute("variante"), b, "corpo"), e = m(this.getAttribute("cor"), C), r = m(this.getAttribute("peso"), T), o = m(this.getAttribute("alinhamento"), I), s = this.hasAttribute("truncar");
|
|
75
75
|
if (this.container.tagName.toLowerCase() !== t) {
|
|
76
76
|
const c = document.createElement(t);
|
|
77
77
|
c.appendChild(document.createElement("slot")), this.shadow.replaceChild(c, this.container), this.container = c;
|
|
78
78
|
}
|
|
79
79
|
const l = ["ui-texto", `ui-texto--${i}`];
|
|
80
|
-
e && l.push(`ui-texto--cor-${e}`), r && l.push(`ui-texto--peso-${r}`), o && l.push(`ui-texto--alinhamento-${o}`),
|
|
80
|
+
e && l.push(`ui-texto--cor-${e}`), r && l.push(`ui-texto--peso-${r}`), o && l.push(`ui-texto--alinhamento-${o}`), s && l.push("ui-texto--truncar"), this.container.className = l.join(" ");
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
p("ui-texto", O);
|
|
84
|
-
const L = ':host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle;position:relative}.ui-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-tamanho-avatar, 36px);height:var(--ui-tamanho-avatar, 36px);min-width:var(--ui-tamanho-avatar, 36px);min-height:var(--ui-tamanho-avatar, 36px);border-radius:50%;background-color:var(--ui-cor-fundo-elevado, #22222a);color:var(--ui-cor-primaria, #00E08A);font-weight:600;font-size:var(--ui-avatar-font-size, 14px);-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));line-height:1}.ui-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.ui-avatar--quadrado{border-radius:8px}.ui-avatar__status{position:absolute;bottom:0;right:0;width:25%;height:25%;min-width:8px;min-height:8px;max-width:14px;max-height:14px;border-radius:50%;border:2px solid var(--ui-cor-fundo-card, #121214);box-sizing:border-box}.ui-avatar__status--online{background-color:var(--ui-cor-primaria, #00E08A)}.ui-avatar__status--offline{background-color:#889}.ui-avatar__status--ausente{background-color:#ffb86c}.ui-avatar__status--ocupado{background-color:#f55}.ui-avatar--xs{--ui-tamanho-avatar: 20px;--ui-avatar-font-size: 10px}.ui-avatar--sm{--ui-tamanho-avatar: 28px;--ui-avatar-font-size: 11px}.ui-avatar--md{--ui-tamanho-avatar: 36px;--ui-avatar-font-size: 14px}.ui-avatar--lg{--ui-tamanho-avatar: 48px;--ui-avatar-font-size: 18px}.ui-avatar--xl{--ui-tamanho-avatar: 64px;--ui-avatar-font-size: 24px}', x = ["xs", "sm", "md", "lg", "xl"],
|
|
84
|
+
const L = ':host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle;position:relative}.ui-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-tamanho-avatar, 36px);height:var(--ui-tamanho-avatar, 36px);min-width:var(--ui-tamanho-avatar, 36px);min-height:var(--ui-tamanho-avatar, 36px);border-radius:50%;background-color:var(--ui-cor-fundo-elevado, #22222a);color:var(--ui-cor-primaria, #00E08A);font-weight:600;font-size:var(--ui-avatar-font-size, 14px);-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));line-height:1}.ui-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.ui-avatar--quadrado{border-radius:8px}.ui-avatar__status{position:absolute;bottom:0;right:0;width:25%;height:25%;min-width:8px;min-height:8px;max-width:14px;max-height:14px;border-radius:50%;border:2px solid var(--ui-cor-fundo-card, #121214);box-sizing:border-box}.ui-avatar__status--online{background-color:var(--ui-cor-primaria, #00E08A)}.ui-avatar__status--offline{background-color:#889}.ui-avatar__status--ausente{background-color:#ffb86c}.ui-avatar__status--ocupado{background-color:#f55}.ui-avatar--xs{--ui-tamanho-avatar: 20px;--ui-avatar-font-size: 10px}.ui-avatar--sm{--ui-tamanho-avatar: 28px;--ui-avatar-font-size: 11px}.ui-avatar--md{--ui-tamanho-avatar: 36px;--ui-avatar-font-size: 14px}.ui-avatar--lg{--ui-tamanho-avatar: 48px;--ui-avatar-font-size: 18px}.ui-avatar--xl{--ui-tamanho-avatar: 64px;--ui-avatar-font-size: 24px}', x = ["xs", "sm", "md", "lg", "xl"], N = ["online", "offline", "ausente", "ocupado"], j = 8, M = 512;
|
|
85
85
|
class $ extends v {
|
|
86
86
|
constructor() {
|
|
87
87
|
super();
|
|
@@ -138,18 +138,18 @@ class $ extends v {
|
|
|
138
138
|
const e = this.getAttribute("aria-label"), r = e !== null && e !== this._rotuloAuto, o = this.hasAttribute("aria-hidden") && !this._ocultoAuto;
|
|
139
139
|
if (!(r || o)) {
|
|
140
140
|
if (this._sincronizando = !0, t) {
|
|
141
|
-
const
|
|
142
|
-
this.setAttribute("role", "img"), this.setAttribute("aria-label",
|
|
141
|
+
const s = i ? `${t}, ${i}` : t;
|
|
142
|
+
this.setAttribute("role", "img"), this.setAttribute("aria-label", s), this._rotuloAuto = s, this.removeAttribute("aria-hidden"), this._ocultoAuto = !1;
|
|
143
143
|
} else
|
|
144
144
|
this._rotuloAuto !== null && this.removeAttribute("aria-label"), this._rotuloAuto = null, this.removeAttribute("role"), this.setAttribute("aria-hidden", "true"), this._ocultoAuto = !0;
|
|
145
145
|
this._sincronizando = !1;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
syncState() {
|
|
149
|
-
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), r = this.getAttribute("formato"), o = m(this.getAttribute("status"),
|
|
149
|
+
const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), r = this.getAttribute("formato"), o = m(this.getAttribute("status"), N);
|
|
150
150
|
this.avatarElement.className = "ui-avatar";
|
|
151
|
-
const
|
|
152
|
-
|
|
151
|
+
const s = m(e, x), l = parseInt(e, 10);
|
|
152
|
+
s ? (this.avatarElement.classList.add(`ui-avatar--${s}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(l) && l >= j && l <= M ? this.avatarElement.style.setProperty("--ui-tamanho-avatar", `${l}px`) : (this.avatarElement.classList.add(`ui-avatar--${g(null, x, "md")}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")), r === "quadrado" && this.avatarElement.classList.add("ui-avatar--quadrado");
|
|
153
153
|
const c = this.avatarElement.querySelector(".ui-avatar__content");
|
|
154
154
|
if (c)
|
|
155
155
|
if (t) {
|
|
@@ -199,12 +199,18 @@ class V {
|
|
|
199
199
|
this.indicadorElement.style.opacity = "0";
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
const t =
|
|
203
|
-
|
|
202
|
+
const t = this.indicadorElement.parentElement, i = a.getBoundingClientRect(), e = t == null ? void 0 : t.getBoundingClientRect();
|
|
203
|
+
let r, o;
|
|
204
|
+
if (t && e && i.width > 0 && e.width > 0) {
|
|
205
|
+
const s = t.clientLeft || 0;
|
|
206
|
+
r = Number((i.left - e.left - s).toFixed(2)), o = Number(i.width.toFixed(2));
|
|
207
|
+
} else
|
|
208
|
+
r = Math.round(a.offsetLeft), o = Math.round(a.offsetWidth);
|
|
209
|
+
this.indicadorElement.style.transform = `translateX(${r}px)`, this.indicadorElement.style.width = `${o}px`, this.indicadorElement.style.opacity = "1";
|
|
204
210
|
});
|
|
205
211
|
}
|
|
206
212
|
}
|
|
207
|
-
function D(
|
|
213
|
+
function D(n, a, t, i) {
|
|
208
214
|
if (t) return;
|
|
209
215
|
const e = Array.from(
|
|
210
216
|
a.querySelectorAll(".ui-segmented__item:not(:disabled)")
|
|
@@ -212,23 +218,23 @@ function D(s, a, t, i) {
|
|
|
212
218
|
if (e.length === 0) return;
|
|
213
219
|
const r = e.findIndex((l) => l.classList.contains("ui-segmented__item--ativo"));
|
|
214
220
|
let o = r;
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
else if (
|
|
218
|
-
|
|
219
|
-
else if (
|
|
220
|
-
|
|
221
|
-
else if (
|
|
222
|
-
|
|
221
|
+
if (n.key === "ArrowRight" || n.key === "ArrowDown")
|
|
222
|
+
n.preventDefault(), o = (r + 1) % e.length;
|
|
223
|
+
else if (n.key === "ArrowLeft" || n.key === "ArrowUp")
|
|
224
|
+
n.preventDefault(), o = (r - 1 + e.length) % e.length;
|
|
225
|
+
else if (n.key === "Home")
|
|
226
|
+
n.preventDefault(), o = 0;
|
|
227
|
+
else if (n.key === "End")
|
|
228
|
+
n.preventDefault(), o = e.length - 1;
|
|
223
229
|
else
|
|
224
230
|
return;
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
const l = parseInt(
|
|
231
|
+
const s = e[o];
|
|
232
|
+
if (s && s.dataset.indice) {
|
|
233
|
+
const l = parseInt(s.dataset.indice, 10);
|
|
228
234
|
i(l);
|
|
229
235
|
}
|
|
230
236
|
}
|
|
231
|
-
const H = ':host{display:inline-flex;vertical-align:middle;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-segmented{--_altura: var(--ui-campo-altura, 34px);--_moldura: 3px;display:inline-flex;position:relative;height:var(--_altura);background-color:var(--ui-cor-fundo, #0b0b0d);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);padding:var(--_moldura);box-sizing:border-box;-webkit-user-select:none;user-select:none;gap:2px;align-items:center}.ui-segmented--full{display:flex;width:100%}.ui-segmented--full .ui-segmented__item{flex:1}.ui-segmented--sm{--_moldura: 2px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px}.ui-segmented--lg{--_moldura: 4px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px}.ui-segmented__indicador{position:absolute;top:var(--_moldura);bottom:var(--_moldura);left:0;background-color:var(--ui-cor-fundo-card, #1e1e24);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:calc(var(--ui-raio-borda, 8px) - 2px);box-shadow:var(--ui-sombra-sm, 0 2px 8px rgba(0, 0, 0, .4));pointer-events:none;transition:transform .22s cubic-bezier(.16,1,.3,1),width .22s cubic-bezier(.16,1,.3,1),opacity .15s ease;z-index:1;opacity:0}.ui-segmented__item{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-weight:500;cursor:pointer;border-radius:calc(var(--ui-raio-borda, 8px) - 2px);line-height:1;white-space:nowrap;transition:color .15s ease;box-sizing:border-box;height:calc(var(--_altura) - 2px - 2 * var(--_moldura))}.ui-segmented__item:hover:not(:disabled){color:var(--ui-cor-texto, #e1e1e6)}.ui-segmented__item--ativo{color:var(--ui-cor-texto, #ffffff)!important;font-weight:600}.ui-segmented__item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-segmented__item:disabled{opacity:.35;cursor:not-allowed}.ui-segmented__icone{display:inline-flex;align-items:center;justify-content:center;line-height:1}.ui-segmented__icone ui-icone,.ui-segmented__icone svg{shape-rendering:geometricPrecision;display:inline-flex;align-items:center;justify-content:center}@media (max-width: 640px){.ui-segmented{--_altura: max(var(--ui-campo-altura, 34px), 38px)}}',
|
|
237
|
+
const H = ':host{display:inline-flex;vertical-align:middle;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-segmented{--_altura: var(--ui-campo-altura, 34px);--_moldura: 3px;display:inline-flex;position:relative;height:var(--_altura);background-color:var(--ui-cor-fundo, #0b0b0d);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);padding:var(--_moldura);box-sizing:border-box;-webkit-user-select:none;user-select:none;gap:2px;align-items:center}.ui-segmented--full{display:flex;width:100%}.ui-segmented--full .ui-segmented__item{flex:1}.ui-segmented--sm{--_moldura: 2px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px}.ui-segmented--lg{--_moldura: 4px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px}.ui-segmented__indicador{position:absolute;top:var(--_moldura);bottom:var(--_moldura);left:0;box-sizing:border-box;background-color:var(--ui-cor-fundo-card, #1e1e24);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:calc(var(--ui-raio-borda, 8px) - 2px);box-shadow:var(--ui-sombra-sm, 0 2px 8px rgba(0, 0, 0, .4));pointer-events:none;transition:transform .22s cubic-bezier(.16,1,.3,1),width .22s cubic-bezier(.16,1,.3,1),opacity .15s ease;z-index:1;opacity:0}.ui-segmented__item{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-weight:500;cursor:pointer;border-radius:calc(var(--ui-raio-borda, 8px) - 2px);line-height:1;white-space:nowrap;transition:color .15s ease;box-sizing:border-box;height:calc(var(--_altura) - 2px - 2 * var(--_moldura))}.ui-segmented__item:hover:not(:disabled){color:var(--ui-cor-texto, #e1e1e6)}.ui-segmented__item--ativo{color:var(--ui-cor-texto, #ffffff)!important;font-weight:600}.ui-segmented__item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-segmented__item:disabled{opacity:.35;cursor:not-allowed}.ui-segmented__icone{display:inline-flex;align-items:center;justify-content:center;line-height:1}.ui-segmented__icone ui-icone,.ui-segmented__icone svg{shape-rendering:geometricPrecision;display:inline-flex;align-items:center;justify-content:center}@media (max-width: 640px){.ui-segmented{--_altura: max(var(--ui-campo-altura, 34px), 38px)}}', R = [
|
|
232
238
|
"valor",
|
|
233
239
|
"value",
|
|
234
240
|
"name",
|
|
@@ -244,7 +250,7 @@ const H = ':host{display:inline-flex;vertical-align:middle;box-sizing:border-box
|
|
|
244
250
|
"required",
|
|
245
251
|
"mensagem-validacao"
|
|
246
252
|
];
|
|
247
|
-
function
|
|
253
|
+
function F() {
|
|
248
254
|
return `
|
|
249
255
|
<style>${H}</style>
|
|
250
256
|
<div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
|
|
@@ -254,18 +260,18 @@ function U() {
|
|
|
254
260
|
</div>
|
|
255
261
|
`;
|
|
256
262
|
}
|
|
257
|
-
function
|
|
263
|
+
function U(n, a, t, i, e) {
|
|
258
264
|
const r = document.createElement("button");
|
|
259
|
-
r.type = "button", r.role = "radio", r.className = "ui-segmented__item", r.setAttribute("part",
|
|
260
|
-
const o =
|
|
261
|
-
if (r.setAttribute("aria-checked", String(o)), r.tabIndex = o ? 0 : -1, o && r.classList.add("ui-segmented__item--ativo"), (i ||
|
|
265
|
+
r.type = "button", r.role = "radio", r.className = "ui-segmented__item", r.setAttribute("part", n.valor === t ? "opcao opcao-selecionada" : "opcao"), r.dataset.valor = n.valor, r.dataset.indice = String(a);
|
|
266
|
+
const o = n.valor === t;
|
|
267
|
+
if (r.setAttribute("aria-checked", String(o)), r.tabIndex = o ? 0 : -1, o && r.classList.add("ui-segmented__item--ativo"), (i || n.disabled) && (r.disabled = !0), n.icone) {
|
|
262
268
|
const l = document.createElement("span");
|
|
263
269
|
l.className = "ui-segmented__icone";
|
|
264
270
|
const c = document.createElement("ui-icone");
|
|
265
|
-
c.setAttribute("nome",
|
|
271
|
+
c.setAttribute("nome", n.icone), c.setAttribute("tamanho", "14"), l.appendChild(c), r.appendChild(l);
|
|
266
272
|
}
|
|
267
|
-
const
|
|
268
|
-
return
|
|
273
|
+
const s = document.createElement("span");
|
|
274
|
+
return s.className = "ui-segmented__texto", s.textContent = n.rotulo, r.appendChild(s), r.addEventListener("click", (l) => {
|
|
269
275
|
l.stopPropagation(), e();
|
|
270
276
|
}), r;
|
|
271
277
|
}
|
|
@@ -289,13 +295,13 @@ class _ extends E {
|
|
|
289
295
|
});
|
|
290
296
|
});
|
|
291
297
|
const t = this.attachShadow({ mode: "open" });
|
|
292
|
-
t.innerHTML =
|
|
298
|
+
t.innerHTML = F(), this.rootElement = t.querySelector(".ui-segmented"), this.indicadorElement = t.querySelector(".ui-segmented__indicador"), this.trackElement = t.querySelector(".ui-segmented__track"), this.slotElement = t.querySelector("slot"), this.indicadorController = new V(
|
|
293
299
|
this.trackElement,
|
|
294
300
|
this.indicadorElement
|
|
295
301
|
);
|
|
296
302
|
}
|
|
297
303
|
static get observedAttributes() {
|
|
298
|
-
return
|
|
304
|
+
return R;
|
|
299
305
|
}
|
|
300
306
|
connectedCallback() {
|
|
301
307
|
this.listeners.cleanup(), this.listeners.add(this.rootElement, "keydown", this.handleKeyDown), this.listeners.add(this.slotElement, "slotchange", this.handleSlotChange), this._defaultValue || (this._defaultValue = this.getAttribute("valor") || this.getAttribute("value") || ""), this.indicadorController.iniciarObserver(this.rootElement), this.carregarOpcoes(), this.syncState();
|
|
@@ -370,8 +376,8 @@ class _ extends E {
|
|
|
370
376
|
t.forEach((e) => {
|
|
371
377
|
var r, o;
|
|
372
378
|
if (e instanceof HTMLElement) {
|
|
373
|
-
const
|
|
374
|
-
i.push({ valor:
|
|
379
|
+
const s = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((r = e.textContent) == null ? void 0 : r.trim()) || "", l = e.getAttribute("label") || e.getAttribute("rotulo") || ((o = e.textContent) == null ? void 0 : o.trim()) || s, c = e.getAttribute("icone") || e.getAttribute("icon") || void 0, d = e.hasAttribute("disabled");
|
|
380
|
+
i.push({ valor: s, rotulo: l, icone: c, disabled: d });
|
|
375
381
|
}
|
|
376
382
|
}), this._opcoes = i, this.renderizarOpcoes();
|
|
377
383
|
}
|
|
@@ -380,25 +386,25 @@ class _ extends E {
|
|
|
380
386
|
this.trackElement.innerHTML = "";
|
|
381
387
|
const t = this.valor, i = this.disabled;
|
|
382
388
|
this._opcoes.forEach((r, o) => {
|
|
383
|
-
const
|
|
389
|
+
const s = U(
|
|
384
390
|
r,
|
|
385
391
|
o,
|
|
386
392
|
t,
|
|
387
393
|
i,
|
|
388
394
|
() => this.selecionarIndice(o)
|
|
389
395
|
);
|
|
390
|
-
this.trackElement.appendChild(
|
|
396
|
+
this.trackElement.appendChild(s);
|
|
391
397
|
});
|
|
392
398
|
const e = this.required || this.hasAttribute("sem-selecao-inicial");
|
|
393
399
|
!t && this._opcoes.length > 0 && !e ? this.selecionarIndice(0, !1) : this.indicadorController.atualizar(), this.atualizarValidade();
|
|
394
400
|
}
|
|
395
401
|
selecionarIndice(t, i = !0) {
|
|
396
|
-
var o,
|
|
402
|
+
var o, s;
|
|
397
403
|
if (this.disabled) return;
|
|
398
404
|
const e = this._opcoes[t];
|
|
399
405
|
if (!e || e.disabled) return;
|
|
400
406
|
const r = this.valor;
|
|
401
|
-
this.setAttribute("valor", e.valor), this.internals && ((
|
|
407
|
+
this.setAttribute("valor", e.valor), this.internals && ((s = (o = this.internals).setFormValue) == null || s.call(o, e.valor)), this.atualizarSelecao(e.valor), i && r !== e.valor && (this.dispatchEvent(
|
|
402
408
|
new CustomEvent("ui-change", {
|
|
403
409
|
detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
|
|
404
410
|
bubbles: !0,
|
|
@@ -415,8 +421,8 @@ class _ extends E {
|
|
|
415
421
|
atualizarSelecao(t) {
|
|
416
422
|
var e, r;
|
|
417
423
|
Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((o) => {
|
|
418
|
-
const
|
|
419
|
-
o.classList.toggle("ui-segmented__item--ativo",
|
|
424
|
+
const s = o.dataset.valor === t;
|
|
425
|
+
o.classList.toggle("ui-segmented__item--ativo", s), z(o, "opcao-selecionada", s), o.setAttribute("aria-checked", String(s)), o.tabIndex = s ? 0 : -1, s && o.focus();
|
|
420
426
|
}), this.internals && ((r = (e = this.internals).setFormValue) == null || r.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
421
427
|
}
|
|
422
428
|
syncState() {
|
|
@@ -429,11 +435,11 @@ class _ extends E {
|
|
|
429
435
|
}), this.indicadorController.atualizar(), this.atualizarValidade();
|
|
430
436
|
}
|
|
431
437
|
}
|
|
432
|
-
class
|
|
438
|
+
class B extends _ {
|
|
433
439
|
}
|
|
434
440
|
p("ui-segmented", _);
|
|
435
|
-
p("ui-segmento",
|
|
436
|
-
const
|
|
441
|
+
p("ui-segmento", B);
|
|
442
|
+
const P = ':host{--_espaco: var(--ui-espaco-sm, 8px);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--ui-linha-espaco, var(--_espaco));box-sizing:border-box;min-width:0;max-width:100%}:host([inline]){display:inline-flex;vertical-align:middle}:host([hidden]){display:none}:host([sem-quebra]){flex-wrap:nowrap}:host([espaco="nenhum"]){--_espaco: 0}:host([espaco="xs"]){--_espaco: var(--ui-espaco-xs, 4px)}:host([espaco="sm"]){--_espaco: var(--ui-espaco-sm, 8px)}:host([espaco="md"]){--_espaco: var(--ui-espaco-md, 16px)}:host([espaco="lg"]){--_espaco: var(--ui-espaco-lg, 24px)}:host([alinhar="inicio"]){align-items:flex-start}:host([alinhar="centro"]){align-items:center}:host([alinhar="fim"]){align-items:flex-end}:host([alinhar="esticar"]){align-items:stretch}:host([justificar="centro"]){justify-content:center}:host([justificar="fim"]){justify-content:flex-end}:host([justificar="entre"]){justify-content:space-between}:host([justificar="ao-redor"]){justify-content:space-around}::slotted(*){flex:0 0 auto;width:auto;max-width:100%;margin-top:0;margin-bottom:0}::slotted(ui-campo-texto),::slotted(ui-input),::slotted(ui-lista-flutuante),::slotted(ui-select){flex:1 1 var(--ui-linha-campo-base, 12rem);min-width:0}::slotted([expandir]){flex:1 1 0;min-width:0}';
|
|
437
443
|
class X extends v {
|
|
438
444
|
static get observedAttributes() {
|
|
439
445
|
return ["tamanho", "size", "densidade", "altura", "height"];
|
|
@@ -441,7 +447,7 @@ class X extends v {
|
|
|
441
447
|
constructor() {
|
|
442
448
|
super();
|
|
443
449
|
const a = this.attachShadow({ mode: "open" });
|
|
444
|
-
a.innerHTML = `<style>${
|
|
450
|
+
a.innerHTML = `<style>${P}</style><slot></slot>`;
|
|
445
451
|
}
|
|
446
452
|
connectedCallback() {
|
|
447
453
|
f(this);
|
|
@@ -494,14 +500,14 @@ class X extends v {
|
|
|
494
500
|
}
|
|
495
501
|
p("ui-linha", X);
|
|
496
502
|
export {
|
|
497
|
-
|
|
503
|
+
R as A,
|
|
498
504
|
V as S,
|
|
499
505
|
$ as U,
|
|
500
506
|
X as a,
|
|
501
507
|
_ as b,
|
|
502
|
-
|
|
508
|
+
B as c,
|
|
503
509
|
O as d,
|
|
504
|
-
|
|
505
|
-
|
|
510
|
+
U as e,
|
|
511
|
+
F as f,
|
|
506
512
|
D as t
|
|
507
513
|
};
|