@thibezer/ui-components-kit 2.10.0 → 2.11.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 +499 -436
- package/README.md +2 -2
- package/dist/camadas.cjs +1 -1
- package/dist/camadas.js +1 -1
- package/dist/canvas.cjs +74 -74
- package/dist/canvas.js +3310 -2819
- package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +13 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +8 -2
- package/dist/components/ui-canvas-cad/cad-feicoes-teclado.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +1 -1
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +12 -1
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +8 -1
- package/dist/components/ui-canvas-cad/cad-linha-padrao.d.ts +27 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +2 -0
- package/dist/components/ui-canvas-cad/index.d.ts +2 -0
- package/dist/components/ui-canvas-cad/tipos.d.ts +25 -4
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +17 -1
- package/dist/components/ui-cores/cores-utils.d.ts +2 -0
- package/dist/components/ui-cores/tipos.d.ts +9 -2
- package/dist/components/ui-cores/ui-controle-cores.d.ts +9 -4
- package/dist/components/ui-cores/ui-seletor-cor.d.ts +12 -9
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +1 -1
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +3 -3
- package/dist/components/ui-tabela-propriedades/propriedades-valor-misto.d.ts +25 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +7 -0
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +12 -11
- package/dist/custom-elements.json +5527 -4665
- package/dist/data.cjs +1 -1
- package/dist/data.js +72 -64
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +2 -0
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +3 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +51 -4
- package/dist/gerencigeo-canvas/feature_types.d.ts +17 -0
- package/dist/gerencigeo-canvas/motor/estilo.d.ts +8 -0
- package/dist/gerencigeo-canvas/motor/index.d.ts +1 -0
- package/dist/gerencigeo-canvas/motor/tipos-linha.d.ts +22 -0
- package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +2 -0
- package/dist/gerencigeo-canvas/types.d.ts +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +154 -145
- package/dist/motor-BCWqlv3e.cjs +1 -0
- package/dist/motor-CXjQjVba.js +1386 -0
- package/dist/motor.cjs +1 -1
- package/dist/motor.js +45 -38
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -3
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +66 -58
- package/dist/tipos-elementos.d.ts +13 -0
- package/dist/tipos-vue.d.ts +11 -0
- package/dist/ui-controle-cores-CohlwXJK.cjs +32 -0
- package/dist/{ui-controle-cores-BEUKOq4n.js → ui-controle-cores-DMtTUtLk.js} +98 -81
- package/dist/ui-seletor-cor-D9iI7yew.js +413 -0
- package/dist/ui-seletor-cor-Ft06TEUH.cjs +110 -0
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +141 -0
- package/dist/{ui-tabela-propriedades-DoL4SE0r.js → ui-tabela-propriedades-DuaC4sFX.js} +1295 -1195
- package/package.json +1 -1
- package/dist/motor-BB6tB6U-.cjs +0 -1
- package/dist/motor-CFI84lM2.js +0 -1301
- package/dist/ui-controle-cores-BLhrZHMh.cjs +0 -32
- package/dist/ui-seletor-cor-2yGryC_Z.cjs +0 -86
- package/dist/ui-seletor-cor-BuyhoDZz.js +0 -345
- package/dist/ui-tabela-propriedades-CjK2gG14.cjs +0 -141
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (
|
|
4
|
-
import { L as
|
|
5
|
-
import { a as
|
|
6
|
-
import { d as
|
|
7
|
-
import { h as
|
|
8
|
-
class
|
|
9
|
-
constructor(
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var Ee = (t, r, e) => r in t ? ve(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var b = (t, r, e) => Ee(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { L as P } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { a as ye } from "./parts-CaoQiCfI.js";
|
|
6
|
+
import { d as le, S as de } from "./ssr-safe-5cWfJP-s.js";
|
|
7
|
+
import { h as we } from "./svg-seguro-ChVJ2L2z.js";
|
|
8
|
+
class Ce {
|
|
9
|
+
constructor(r) {
|
|
10
10
|
b(this, "autoFetchController", null);
|
|
11
11
|
b(this, "emVoo", null);
|
|
12
|
-
this.ctx =
|
|
12
|
+
this.ctx = r;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Busca os dados. Resolve `true` em sucesso e `false` em falha, cancelamento ou requisição
|
|
16
16
|
* substituída (nunca rejeita; o motivo da falha vai no evento `ui-fetch-erro`).
|
|
17
17
|
* Uma chamada com a mesma URL de uma requisição em andamento reaproveita essa requisição.
|
|
18
18
|
*/
|
|
19
|
-
carregar(
|
|
20
|
-
if (!
|
|
21
|
-
if (this.emVoo && this.emVoo.url ===
|
|
19
|
+
carregar(r) {
|
|
20
|
+
if (!r) return Promise.resolve(!1);
|
|
21
|
+
if (this.emVoo && this.emVoo.url === r && this.autoFetchController) return this.emVoo.promessa;
|
|
22
22
|
this.cancelarEmVoo();
|
|
23
23
|
const e = new AbortController();
|
|
24
24
|
this.autoFetchController = e;
|
|
25
|
-
const
|
|
26
|
-
return this.emVoo = { url:
|
|
25
|
+
const o = this.executar(r, e);
|
|
26
|
+
return this.emVoo = { url: r, promessa: o }, o;
|
|
27
27
|
}
|
|
28
|
-
emitir(
|
|
29
|
-
this.ctx.host.dispatchEvent(new CustomEvent(
|
|
28
|
+
emitir(r, e) {
|
|
29
|
+
this.ctx.host.dispatchEvent(new CustomEvent(r, { bubbles: !0, composed: !0, detail: e }));
|
|
30
30
|
}
|
|
31
|
-
erro(
|
|
31
|
+
erro(r, e, o, i) {
|
|
32
32
|
const a = e instanceof Error ? e.message : String(e);
|
|
33
33
|
console.error("[ui-tabela] Erro ao carregar dados remotos:", e);
|
|
34
|
-
const n = { url:
|
|
35
|
-
|
|
34
|
+
const n = { url: r, erro: a, origem: o };
|
|
35
|
+
i !== void 0 && (n.status = i), this.emitir("ui-fetch-erro", n);
|
|
36
36
|
}
|
|
37
|
-
async executar(
|
|
38
|
-
var
|
|
39
|
-
const
|
|
37
|
+
async executar(r, e) {
|
|
38
|
+
var l, d, c, s;
|
|
39
|
+
const o = () => this.autoFetchController === e, i = () => {
|
|
40
40
|
this.autoFetchController === e && (this.autoFetchController = null, this.emVoo = null);
|
|
41
41
|
};
|
|
42
|
-
this.ctx.onCarregandoAlterado(!0), this.emitir("ui-fetch-start", { url:
|
|
42
|
+
this.ctx.onCarregandoAlterado(!0), this.emitir("ui-fetch-start", { url: r });
|
|
43
43
|
let a = "rede", n;
|
|
44
44
|
try {
|
|
45
|
-
const u = { ...((d = (
|
|
45
|
+
const u = { ...((d = (l = this.ctx).getOpcoes) == null ? void 0 : d.call(l)) ?? {}, signal: e.signal }, h = await (((s = (c = this.ctx).getFetcher) == null ? void 0 : s.call(c)) ?? ((g, v) => fetch(g, v)))(r, u);
|
|
46
46
|
if (!h.ok)
|
|
47
47
|
throw a = "http", n = h.status, new Error(`HTTP ${h.status}: ${h.statusText}`);
|
|
48
48
|
a = "json";
|
|
49
49
|
const m = await h.json(), x = Array.isArray(m) ? m : (m == null ? void 0 : m.dados) || (m == null ? void 0 : m.items) || (m == null ? void 0 : m.data) || (m == null ? void 0 : m.rows) || [], f = Array.isArray(x) ? x : [];
|
|
50
|
-
return
|
|
50
|
+
return o() ? (a = "render", this.ctx.onDadosRecebidos(f), i(), this.ctx.onCarregandoAlterado(!1), this.emitir("ui-fetch-sucesso", { url: r, total: f.length, dados: f }), !0) : !1;
|
|
51
51
|
} catch (u) {
|
|
52
|
-
return (u == null ? void 0 : u.name) === "AbortError" ? (
|
|
52
|
+
return (u == null ? void 0 : u.name) === "AbortError" ? (o() && (i(), this.ctx.onCarregandoAlterado(!1)), this.emitir("ui-fetch-cancelado", { url: r }), !1) : (o() && (i(), this.ctx.onCarregandoAlterado(!1), this.erro(r, u, a, n)), !1);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
/** Cancela a requisição em andamento (se houver) e libera o indicador de carregamento. */
|
|
@@ -58,56 +58,56 @@ class ge {
|
|
|
58
58
|
}
|
|
59
59
|
cancelarEmVoo() {
|
|
60
60
|
if (this.autoFetchController) {
|
|
61
|
-
const
|
|
62
|
-
this.autoFetchController = null, this.emVoo = null,
|
|
61
|
+
const r = this.autoFetchController;
|
|
62
|
+
this.autoFetchController = null, this.emVoo = null, r.abort();
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
function
|
|
68
|
-
return
|
|
66
|
+
const Ae = ["id", "_id", "codigo", "key"];
|
|
67
|
+
function ke(t, r) {
|
|
68
|
+
return t != null && (t === r || String(t) === String(r));
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function J(t, r) {
|
|
71
71
|
let e = -1;
|
|
72
|
-
return typeof
|
|
73
|
-
}
|
|
74
|
-
function
|
|
75
|
-
if (!
|
|
76
|
-
if (typeof
|
|
77
|
-
return
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
for (const a of
|
|
81
|
-
const n =
|
|
72
|
+
return typeof t == "number" && Number.isInteger(t) ? e = t : typeof t == "string" && /^\d+$/.test(t.trim()) && (e = parseInt(t.trim(), 10)), e >= 0 && e < r ? e : -1;
|
|
73
|
+
}
|
|
74
|
+
function ze(t, r, e = "id", o = !1) {
|
|
75
|
+
if (!t || t.length === 0) return -1;
|
|
76
|
+
if (typeof r == "function")
|
|
77
|
+
return t.findIndex(r);
|
|
78
|
+
if (o) return J(r, t.length);
|
|
79
|
+
const i = [e, ...Ae.filter((a) => a !== e)];
|
|
80
|
+
for (const a of i) {
|
|
81
|
+
const n = t.findIndex((l) => !!l && typeof l == "object" && ke(l[a], r));
|
|
82
82
|
if (n !== -1) return n;
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return J(r, t.length);
|
|
85
85
|
}
|
|
86
|
-
class
|
|
87
|
-
constructor(
|
|
86
|
+
class Se {
|
|
87
|
+
constructor(r) {
|
|
88
88
|
b(this, "itemSelecionado", null);
|
|
89
89
|
b(this, "indiceSelecionado", null);
|
|
90
|
-
this.ctx =
|
|
90
|
+
this.ctx = r;
|
|
91
91
|
}
|
|
92
92
|
/** Mesmo objeto ou mesmo valor na chave configurada. */
|
|
93
|
-
indiceDoItem(
|
|
94
|
-
const
|
|
95
|
-
return
|
|
93
|
+
indiceDoItem(r, e) {
|
|
94
|
+
const o = this.ctx.getChaveId(), i = r.indexOf(e);
|
|
95
|
+
return i >= 0 ? i : e[o] == null ? -1 : r.findIndex((a) => (a == null ? void 0 : a[o]) != null && String(a[o]) === String(e[o]));
|
|
96
96
|
}
|
|
97
97
|
getItemSelecionado() {
|
|
98
98
|
return this.itemSelecionado;
|
|
99
99
|
}
|
|
100
|
-
setItemSelecionado(
|
|
101
|
-
this.itemSelecionado =
|
|
102
|
-
const e =
|
|
100
|
+
setItemSelecionado(r) {
|
|
101
|
+
this.itemSelecionado = r;
|
|
102
|
+
const e = r ? this.indiceDoItem(this.ctx.getDadosExibicao(), r) : -1;
|
|
103
103
|
this.indiceSelecionado = e >= 0 ? e : null, this.atualizarLinhasSelecionadas();
|
|
104
104
|
}
|
|
105
105
|
getIndiceSelecionado() {
|
|
106
106
|
return this.indiceSelecionado;
|
|
107
107
|
}
|
|
108
|
-
setIndiceSelecionado(
|
|
109
|
-
const e = this.ctx.getDadosExibicao(),
|
|
110
|
-
this.indiceSelecionado =
|
|
108
|
+
setIndiceSelecionado(r) {
|
|
109
|
+
const e = this.ctx.getDadosExibicao(), o = r !== null && r >= 0 && r < e.length;
|
|
110
|
+
this.indiceSelecionado = o ? r : null, this.itemSelecionado = o ? e[r] : null, this.atualizarLinhasSelecionadas();
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Reaplica a seleção após ordenar, filtrar ou trocar os dados.
|
|
@@ -116,80 +116,80 @@ class Ee {
|
|
|
116
116
|
* - Item removido dos dados: limpa a seleção e emite `ui-selecao-removida`.
|
|
117
117
|
*/
|
|
118
118
|
reconciliar() {
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
119
|
+
const r = this.itemSelecionado;
|
|
120
|
+
if (!r) {
|
|
121
121
|
this.indiceSelecionado = null;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
const e = this.ctx.getDadosExibicao(),
|
|
125
|
-
if (
|
|
126
|
-
this.indiceSelecionado =
|
|
124
|
+
const e = this.ctx.getDadosExibicao(), o = this.indiceDoItem(e, r);
|
|
125
|
+
if (o >= 0) {
|
|
126
|
+
this.indiceSelecionado = o, this.substituirReferencia(r, e[o]);
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
this.indiceSelecionado = null;
|
|
130
|
-
const
|
|
130
|
+
const i = this.ctx.getDadosOriginais(), a = this.indiceDoItem(i, r);
|
|
131
131
|
if (a >= 0) {
|
|
132
|
-
this.substituirReferencia(
|
|
132
|
+
this.substituirReferencia(r, i[a]);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
this.itemSelecionado = null, this.ctx.host.dispatchEvent(
|
|
136
|
-
new CustomEvent("ui-selecao-removida", { bubbles: !0, composed: !0, detail: { item:
|
|
136
|
+
new CustomEvent("ui-selecao-removida", { bubbles: !0, composed: !0, detail: { item: r } })
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
/** Mesmo registro com outro objeto (dados recarregados): atualiza a referência e avisa. */
|
|
140
|
-
substituirReferencia(
|
|
141
|
-
this.itemSelecionado = e,
|
|
142
|
-
new CustomEvent("ui-selecao-atualizada", { bubbles: !0, composed: !0, detail: { item: e, anterior:
|
|
140
|
+
substituirReferencia(r, e) {
|
|
141
|
+
this.itemSelecionado = e, r !== e && this.ctx.host.dispatchEvent(
|
|
142
|
+
new CustomEvent("ui-selecao-atualizada", { bubbles: !0, composed: !0, detail: { item: e, anterior: r } })
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
limparSelecao() {
|
|
146
146
|
this.itemSelecionado = null, this.indiceSelecionado = null, this.atualizarLinhasSelecionadas();
|
|
147
147
|
}
|
|
148
|
-
isItemSelecionado(
|
|
148
|
+
isItemSelecionado(r, e) {
|
|
149
149
|
if (this.itemSelecionado) {
|
|
150
|
-
if (this.itemSelecionado ===
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
return String(
|
|
154
|
-
if (
|
|
155
|
-
return String(
|
|
150
|
+
if (this.itemSelecionado === r) return !0;
|
|
151
|
+
const o = this.ctx.getChaveId();
|
|
152
|
+
if (r[o] != null && this.itemSelecionado[o] != null)
|
|
153
|
+
return String(r[o]) === String(this.itemSelecionado[o]);
|
|
154
|
+
if (r.id != null && this.itemSelecionado.id != null)
|
|
155
|
+
return String(r.id) === String(this.itemSelecionado.id);
|
|
156
156
|
}
|
|
157
157
|
return this.indiceSelecionado !== null && this.indiceSelecionado === e;
|
|
158
158
|
}
|
|
159
159
|
atualizarLinhasSelecionadas() {
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
160
|
+
const r = this.ctx.getTbody();
|
|
161
|
+
if (!r) return;
|
|
162
162
|
const e = this.ctx.getDadosExibicao();
|
|
163
|
-
|
|
164
|
-
const a =
|
|
165
|
-
|
|
163
|
+
r.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach((i) => {
|
|
164
|
+
const a = i.getAttribute("data-index"), n = a !== null ? parseInt(a, 10) : -1, l = n >= 0 ? e[n] : null, d = l ? this.isItemSelecionado(l, n) : !1;
|
|
165
|
+
i.classList.toggle("ui-tabela__tr--selecionada", d), ye(i, "linha-selecionada", d), d ? (i.setAttribute("data-selecionada", "true"), i.setAttribute("aria-current", "true"), i.setAttribute("aria-selected", "true")) : (i.removeAttribute("data-selecionada"), i.removeAttribute("aria-current"), i.setAttribute("aria-selected", "false"));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
rolarPara(
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
168
|
+
rolarPara(r, e) {
|
|
169
|
+
const o = this.ctx.getDadosExibicao(), i = ze(o, r, this.ctx.getChaveId(), (e == null ? void 0 : e.porIndice) === !0);
|
|
170
|
+
if (i === -1)
|
|
171
171
|
return !1;
|
|
172
172
|
if (e != null && e.selecionar) {
|
|
173
|
-
const a = i
|
|
174
|
-
this.itemSelecionado = a, this.indiceSelecionado =
|
|
173
|
+
const a = o[i];
|
|
174
|
+
this.itemSelecionado = a, this.indiceSelecionado = i, this.atualizarLinhasSelecionadas(), this.ctx.onLinhaAtiva(i), this.ctx.host.dispatchEvent(
|
|
175
175
|
new CustomEvent("ui-linha-selecionada", {
|
|
176
176
|
bubbles: !0,
|
|
177
177
|
composed: !0,
|
|
178
|
-
detail: { item: a, indice:
|
|
178
|
+
detail: { item: a, indice: i }
|
|
179
179
|
})
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
-
return this.ctx.onRolarParaIndice(
|
|
182
|
+
return this.ctx.onRolarParaIndice(i, (e == null ? void 0 : e.comportamento) || "smooth");
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function Le(t, r, e) {
|
|
186
|
+
return t !== e ? {
|
|
187
187
|
idColuna: e,
|
|
188
188
|
direcao: "asc"
|
|
189
|
-
} :
|
|
189
|
+
} : r === "asc" ? {
|
|
190
190
|
idColuna: e,
|
|
191
191
|
direcao: "desc"
|
|
192
|
-
} :
|
|
192
|
+
} : r === "desc" ? {
|
|
193
193
|
idColuna: null,
|
|
194
194
|
direcao: "original"
|
|
195
195
|
} : {
|
|
@@ -197,37 +197,37 @@ function ye(r, t, e) {
|
|
|
197
197
|
direcao: "asc"
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
const
|
|
201
|
-
function
|
|
202
|
-
if (
|
|
203
|
-
if (typeof
|
|
204
|
-
const
|
|
205
|
-
return e ? new Date(+e[3], +e[2] - 1, +e[1], +(e[4] ?? 0), +(e[5] ?? 0)).getTime() : Date.parse(
|
|
206
|
-
}
|
|
207
|
-
function
|
|
208
|
-
if (e === "data" || !e && (
|
|
209
|
-
const
|
|
210
|
-
if (!Number.isNaN(
|
|
211
|
-
} else if (e === "numero" || !e && typeof
|
|
212
|
-
const
|
|
213
|
-
if (!Number.isNaN(
|
|
214
|
-
} else if (e === "booleano" || !e && typeof
|
|
215
|
-
return +!!
|
|
216
|
-
return
|
|
217
|
-
}
|
|
218
|
-
function
|
|
219
|
-
if (!
|
|
220
|
-
return [...
|
|
221
|
-
const
|
|
222
|
-
return [...
|
|
223
|
-
const
|
|
224
|
-
return c ||
|
|
200
|
+
const Me = new Intl.Collator("pt-BR", { numeric: !0, sensitivity: "base" });
|
|
201
|
+
function ee(t) {
|
|
202
|
+
if (t instanceof Date) return t.getTime();
|
|
203
|
+
if (typeof t == "number") return t;
|
|
204
|
+
const r = String(t).trim(), e = /^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2}))?$/.exec(r);
|
|
205
|
+
return e ? new Date(+e[3], +e[2] - 1, +e[1], +(e[4] ?? 0), +(e[5] ?? 0)).getTime() : Date.parse(r);
|
|
206
|
+
}
|
|
207
|
+
function Te(t, r, e) {
|
|
208
|
+
if (e === "data" || !e && (t instanceof Date || r instanceof Date)) {
|
|
209
|
+
const o = ee(t), i = ee(r);
|
|
210
|
+
if (!Number.isNaN(o) && !Number.isNaN(i)) return o - i;
|
|
211
|
+
} else if (e === "numero" || !e && typeof t == "number" && typeof r == "number") {
|
|
212
|
+
const o = Number(t), i = Number(r);
|
|
213
|
+
if (!Number.isNaN(o) && !Number.isNaN(i)) return o - i;
|
|
214
|
+
} else if (e === "booleano" || !e && typeof t == "boolean" && typeof r == "boolean")
|
|
215
|
+
return +!!t - +!!r;
|
|
216
|
+
return Me.compare(String(t), String(r));
|
|
217
|
+
}
|
|
218
|
+
function Ne(t, r, e, o) {
|
|
219
|
+
if (!r || e === "original")
|
|
220
|
+
return [...t];
|
|
221
|
+
const i = e === "desc" ? -1 : 1;
|
|
222
|
+
return [...t].sort((a, n) => {
|
|
223
|
+
const l = a[r], d = n[r], c = l == null, s = d == null;
|
|
224
|
+
return c || s ? c === s ? 0 : c ? 1 : -1 : o != null && o.comparador ? o.comparador(l, d, a, n) * i : l === d ? 0 : Te(l, d, o == null ? void 0 : o.tipo) * i;
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
227
|
+
function q(t) {
|
|
228
|
+
return t.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
229
229
|
}
|
|
230
|
-
class
|
|
230
|
+
class De {
|
|
231
231
|
constructor() {
|
|
232
232
|
b(this, "dadosOriginais", []);
|
|
233
233
|
b(this, "dadosExibicao", []);
|
|
@@ -240,24 +240,24 @@ class ke {
|
|
|
240
240
|
/** Ordenação feita pelo servidor: a tabela guarda coluna/direção (indicador) mas não reordena os dados. */
|
|
241
241
|
b(this, "ordenacaoRemota", !1);
|
|
242
242
|
}
|
|
243
|
-
setColunas(
|
|
244
|
-
this.colunas =
|
|
243
|
+
setColunas(r) {
|
|
244
|
+
this.colunas = r, this.colunaOrdenada && this.aplicarOrdenacao();
|
|
245
245
|
}
|
|
246
|
-
setOrdenacaoRemota(
|
|
247
|
-
this.ordenacaoRemota !==
|
|
246
|
+
setOrdenacaoRemota(r) {
|
|
247
|
+
this.ordenacaoRemota !== r && (this.ordenacaoRemota = r, this.aplicarOrdenacao());
|
|
248
248
|
}
|
|
249
249
|
/** Restaura coluna/direção (ex.: `ui-sort` cancelado) e recalcula. */
|
|
250
|
-
restaurarOrdenacao(
|
|
251
|
-
this.colunaOrdenada =
|
|
250
|
+
restaurarOrdenacao(r, e) {
|
|
251
|
+
this.colunaOrdenada = r, this.direcaoOrdenacao = e, this.aplicarOrdenacao();
|
|
252
252
|
}
|
|
253
|
-
setColunasFiltro(
|
|
254
|
-
this.colunasFiltro =
|
|
253
|
+
setColunasFiltro(r) {
|
|
254
|
+
this.colunasFiltro = r, this.ultimoFiltro && this.aplicarOrdenacao();
|
|
255
255
|
}
|
|
256
256
|
getDadosOriginais() {
|
|
257
257
|
return this.dadosOriginais;
|
|
258
258
|
}
|
|
259
|
-
setDadosOriginais(
|
|
260
|
-
this.dadosOriginais = Array.isArray(
|
|
259
|
+
setDadosOriginais(r) {
|
|
260
|
+
this.dadosOriginais = Array.isArray(r) ? r.filter((e) => e != null) : [], this.aplicarOrdenacao();
|
|
261
261
|
}
|
|
262
262
|
getDadosExibicao() {
|
|
263
263
|
return this.dadosExibicao;
|
|
@@ -265,63 +265,63 @@ class ke {
|
|
|
265
265
|
getColunaOrdenada() {
|
|
266
266
|
return this.colunaOrdenada;
|
|
267
267
|
}
|
|
268
|
-
setColunaOrdenada(
|
|
269
|
-
this.colunaOrdenada =
|
|
268
|
+
setColunaOrdenada(r) {
|
|
269
|
+
this.colunaOrdenada = r, r ? this.direcaoOrdenacao === "original" && (this.direcaoOrdenacao = "asc") : this.direcaoOrdenacao = "original", this.aplicarOrdenacao();
|
|
270
270
|
}
|
|
271
271
|
getDirecaoOrdenacao() {
|
|
272
272
|
return this.direcaoOrdenacao;
|
|
273
273
|
}
|
|
274
|
-
setDirecaoOrdenacao(
|
|
275
|
-
this.direcaoOrdenacao =
|
|
274
|
+
setDirecaoOrdenacao(r) {
|
|
275
|
+
this.direcaoOrdenacao = r || "original", this.direcaoOrdenacao === "original" && (this.colunaOrdenada = null), this.aplicarOrdenacao();
|
|
276
276
|
}
|
|
277
|
-
alternarOrdenacaoColuna(
|
|
278
|
-
if (!
|
|
279
|
-
const e =
|
|
277
|
+
alternarOrdenacaoColuna(r) {
|
|
278
|
+
if (!r.ordenavel) return null;
|
|
279
|
+
const e = Le(this.colunaOrdenada, this.direcaoOrdenacao, r.id);
|
|
280
280
|
return this.colunaOrdenada = e.idColuna, this.direcaoOrdenacao = e.direcao, this.aplicarOrdenacao(), e;
|
|
281
281
|
}
|
|
282
282
|
/** Recalcula a lista exibida: filtro vigente e, sobre o resultado, a ordenação da coluna (valem juntos). */
|
|
283
283
|
aplicarOrdenacao() {
|
|
284
|
-
const
|
|
285
|
-
this.dadosExibicao = this.ordenacaoRemota ? [...e] :
|
|
284
|
+
const r = this.ultimoFiltro, e = r ? this.dadosOriginais.filter((i) => this.casaFiltro(i, r)) : this.dadosOriginais, o = this.colunaOrdenada ? this.colunas.find((i) => i.id === this.colunaOrdenada) : null;
|
|
285
|
+
this.dadosExibicao = this.ordenacaoRemota ? [...e] : Ne(e, this.colunaOrdenada, this.direcaoOrdenacao, o);
|
|
286
286
|
}
|
|
287
|
-
casaFiltro(
|
|
288
|
-
return (this.colunasFiltro.length > 0 ? this.colunasFiltro : Object.keys(
|
|
289
|
-
const a =
|
|
287
|
+
casaFiltro(r, e) {
|
|
288
|
+
return (this.colunasFiltro.length > 0 ? this.colunasFiltro : Object.keys(r)).some((i) => {
|
|
289
|
+
const a = r[i], n = this.colunas.find((d) => d.id === i);
|
|
290
290
|
if (n != null && n.textoFiltro)
|
|
291
291
|
try {
|
|
292
|
-
if (
|
|
292
|
+
if (q(String(n.textoFiltro(a, r) ?? "")).includes(e)) return !0;
|
|
293
293
|
} catch {
|
|
294
294
|
}
|
|
295
295
|
if (a == null || typeof a == "object" && !(a instanceof Date)) return !1;
|
|
296
|
-
const
|
|
297
|
-
return
|
|
296
|
+
const l = a instanceof Date ? `${a.toISOString()} ${a.toLocaleDateString("pt-BR")}` : String(a);
|
|
297
|
+
return q(l).includes(e);
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
/** Há um filtro de texto aplicado (o vazio vira "sem resultados"). */
|
|
301
301
|
temFiltro() {
|
|
302
302
|
return this.ultimoFiltro !== "";
|
|
303
303
|
}
|
|
304
|
-
filtrar(
|
|
305
|
-
this.ultimoFiltro =
|
|
304
|
+
filtrar(r) {
|
|
305
|
+
this.ultimoFiltro = q((r || "").trim()), this.aplicarOrdenacao();
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
const ze = ':host{display:block;width:100%;box-sizing:border-box;font-family:inherit;color:var(--ui-cor-texto, #e1e1e6);position:relative}.ui-tabela-container{width:100%;max-width:100%;max-height:var(--ui-tabela-max-height, 500px);overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-superficie, #141417);box-sizing:border-box;position:relative}.ui-tabela{width:100%;border-collapse:separate;border-spacing:0;text-align:left;font-size:14px;font-family:var(--ui-fonte-base, inherit);font-variant-numeric:tabular-nums}.ui-tabela thead{background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}.ui-tabela th{position:sticky;top:0;z-index:10;padding:10px 16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto-secundario, #9696a6);font-size:13px;font-weight:600;letter-spacing:.02em;border-bottom:2px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box}.ui-tabela th[aria-sort=ascending],.ui-tabela th[aria-sort=descending]{color:var(--ui-cor-texto, #e1e1e6)}.ui-tabela__resizer{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;z-index:20;background:linear-gradient(var(--ui-cor-borda, rgba(255, 255, 255, .12)),var(--ui-cor-borda, rgba(255, 255, 255, .12))) center / 1px 60% no-repeat;transition:background-color .15s ease}.ui-tabela__resizer:hover,.ui-tabela__resizer:focus-visible,.ui-tabela__resizer--ativo{background:var(--ui-cor-primaria, #00E08A);outline:none}:host([densidade="compacta"]) th,:host([densidade="compacta"]) td,:host([density="compact"]) th,:host([density="compact"]) td{padding:4px 8px}:host([densidade="normal"]) th,:host([densidade="normal"]) td,:host([density="normal"]) th,:host([density="normal"]) td{padding:10px 16px}:host([densidade="relaxada"]) th,:host([densidade="relaxada"]) td,:host([density="relaxed"]) th,:host([density="relaxed"]) td{padding:16px 20px}:host([altura-linha]) td,:host([row-height]) td{height:var(--ui-tabela-altura-linha);box-sizing:border-box;padding-top:0;padding-bottom:0;overflow:hidden;white-space:nowrap}.ui-tabela__header-content{display:inline-flex;align-items:center;vertical-align:middle;width:100%;box-sizing:border-box}.ui-tabela__header-text{margin-right:var(--ui-tabela-th-gap, 6px);display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis}.ui-tabela__sort-icon{width:var(--ui-tabela-th-icone, 16px);min-width:var(--ui-tabela-th-icone, 16px);flex:none;display:inline-flex;justify-content:center;align-items:center}.ui-tabela th.ui-tabela__th--ordenavel{cursor:pointer}@media (hover: hover){.ui-tabela th.ui-tabela__th--ordenavel:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,var(--ui-cor-fundo-elevado, #1a1a1e));color:var(--ui-cor-texto, #e1e1e6)}}.ui-tabela__ordenar{all:unset;display:flex;width:100%;box-sizing:border-box;cursor:pointer;font:inherit;color:inherit;text-align:inherit}.ui-tabela__ordenar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-radius:var(--ui-raio-sm, 4px)}.ui-tabela tbody tr:focus{outline:none}.ui-tabela tbody tr:focus-visible{outline:2px solid var(--ui-tabela-cor-foco, var(--ui-cor-texto, #e1e1e6));outline-offset:-2px;background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}.ui-tabela__sort-arrow{display:inline-block;width:14px;height:14px;vertical-align:middle;shape-rendering:geometricPrecision;fill:var(--ui-cor-primaria, #00E08A)}.ui-tabela__sort-arrow path{transition:opacity .15s ease;opacity:.35}.ui-tabela__sort-arrow--asc .seta-cima,.ui-tabela__sort-arrow--desc .seta-baixo{opacity:1}.ui-tabela__sort-arrow--inativo{fill:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__sort-arrow--inativo path{opacity:.6}.ui-tabela td{padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-borda, rgba(255, 255, 255, .12)) 60%,transparent);white-space:nowrap;vertical-align:middle;color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box}.ui-tabela__cell-content{display:inline-flex;align-items:center;vertical-align:middle}.ui-tabela__cell-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.ui-tabela--alinhar-esquerda{text-align:left}.ui-tabela--alinhar-esquerda .ui-tabela__header-content,.ui-tabela--alinhar-esquerda .ui-tabela__cell-content{justify-content:flex-start}.ui-tabela--alinhar-centro{text-align:center}.ui-tabela--alinhar-centro .ui-tabela__header-content,.ui-tabela--alinhar-centro .ui-tabela__cell-content{justify-content:center}.ui-tabela--alinhar-direita{text-align:right}.ui-tabela--alinhar-direita .ui-tabela__header-content,.ui-tabela--alinhar-direita .ui-tabela__cell-content{justify-content:flex-end}.ui-tabela tbody tr[data-index]{cursor:pointer}.ui-tabela tbody tr.ui-tabela__tr--par{background-color:var(--ui-tabela-zebra, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent))}@media (hover: hover){.ui-tabela tbody tr[data-index]:hover{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}}.ui-tabela tbody tr[data-index]:active{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 12%, transparent))}:host(:not([selecionar-texto])) .ui-tabela tbody td{-webkit-user-select:none;user-select:none}.ui-tabela tbody tr.ui-tabela__tr--selecionada,.ui-tabela tbody tr[data-selecionada=true]{background-color:var(--ui-tabela-selecionada, var(--ui-cor-linha-selecionada, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 14%, transparent)))}.ui-tabela tbody tr.ui-tabela__tr--selecionada td:first-child,.ui-tabela tbody tr[data-selecionada=true] td:first-child{box-shadow:inset 3px 0 0 var(--ui-cor-primaria, #00E08A)}@media (hover: hover){.ui-tabela tbody tr.ui-tabela__tr--selecionada:hover,.ui-tabela tbody tr[data-selecionada=true]:hover{background-color:var(--ui-tabela-selecionada-hover, var(--ui-cor-linha-selecionada-hover, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 22%, transparent)))}}.ui-tabela__virtual-spacer td{padding:0!important;border:none!important;height:inherit;background:transparent!important}.ui-tabela__empty{padding:40px 24px;text-align:center;color:var(--ui-cor-texto-secundario, #9696a6);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box}.ui-tabela__empty-icon{width:32px;height:32px;opacity:.5;fill:currentColor}.ui-tabela__empty-text{font-size:14px;font-weight:500;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__erro{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px;padding:10px 14px;border:1px solid var(--ui-cor-texto-erro, #ff5555);border-left-width:4px;border-radius:var(--ui-raio-borda, 6px);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);color:var(--ui-cor-texto, #e1e1e6);font-size:14px;box-sizing:border-box}.ui-tabela__erro-texto{flex:1 1 200px;min-width:0}.ui-tabela__erro-detalhe{display:block;margin-top:2px;font-size:12px;color:var(--ui-cor-texto-secundario, #9696a6);overflow-wrap:anywhere}.ui-tabela__erro-acao,.ui-tabela__prompt-actions button{background:var(--ui-cor-botao-secundario-fundo, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));padding:6px 12px;border-radius:var(--ui-raio-sm, 4px);font:inherit;cursor:pointer}.ui-tabela__erro-acao:hover,.ui-tabela__prompt-actions button:hover{background:var(--ui-cor-botao-secundario-hover, rgba(255, 255, 255, .2))}.ui-tabela__erro-acao:focus-visible,.ui-tabela__prompt-actions button:focus-visible,.ui-tabela__prompt-dialog input:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px}.ui-tabela__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.ui-tabela__loading{position:absolute;top:0;left:0;right:0;bottom:0;background-color:color-mix(in srgb,var(--ui-cor-superficie, #141417) 72%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;z-index:50;color:var(--ui-cor-texto, #e1e1e6);font-size:14px}.ui-tabela__spinner{width:32px;height:32px;border:3px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A);border-radius:50%;animation:ui-tabela-spin .8s linear infinite}@keyframes ui-tabela-spin{to{transform:rotate(360deg)}}.ui-tabela__prompt-dialog{margin:0;max-width:calc(100vw - 16px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);padding:12px;box-shadow:var(--ui-sombra-lg, 0 8px 32px rgba(0, 0, 0, .8));font-family:inherit;font-size:14px}.ui-tabela__prompt-dialog::backdrop{background:#0000004d}.ui-tabela__prompt-title{display:block;margin-bottom:8px;font-weight:500}.ui-tabela__prompt-dialog input{width:100%;padding:6px 8px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));background:var(--ui-cor-superficie, #141417);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:8px;box-sizing:border-box;font:inherit}.ui-tabela__prompt-dialog input[aria-invalid=true]{border-color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-erro{min-height:1.2em;margin-bottom:8px;font-size:12px;color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-actions{display:flex;justify-content:flex-end;gap:8px}.ui-tabela__prompt-actions button:last-child{background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000);font-weight:600}.ui-tabela__prompt-actions button:last-child:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 85%,var(--ui-cor-texto, #e1e1e6))}@media (pointer: coarse){.ui-tabela__resizer{width:16px}:host(:not([altura-linha]):not([row-height])) .ui-tabela tbody tr[data-index]{height:44px}}@media (max-width: 640px){.ui-tabela th{padding:8px 10px;font-size:12px}.ui-tabela td{padding:8px 10px;font-size:13px}}@media (prefers-reduced-motion: reduce){.ui-tabela__resizer,.ui-tabela__sort-arrow path{transition:none}.ui-tabela__spinner{animation-duration:2.4s}}';
|
|
309
|
-
function
|
|
310
|
-
return
|
|
308
|
+
const Re = ':host{display:block;width:100%;box-sizing:border-box;font-family:inherit;color:var(--ui-cor-texto, #e1e1e6);position:relative}.ui-tabela-container{width:100%;max-width:100%;max-height:var(--ui-tabela-max-height, 500px);overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-superficie, #141417);box-sizing:border-box;position:relative}.ui-tabela{width:100%;border-collapse:separate;border-spacing:0;text-align:left;font-size:14px;font-family:var(--ui-fonte-base, inherit);font-variant-numeric:tabular-nums}.ui-tabela thead{background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}.ui-tabela th{position:sticky;top:0;z-index:10;padding:10px 16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto-secundario, #9696a6);font-size:13px;font-weight:600;letter-spacing:.02em;border-bottom:2px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box}.ui-tabela th[aria-sort=ascending],.ui-tabela th[aria-sort=descending]{color:var(--ui-cor-texto, #e1e1e6)}.ui-tabela__resizer{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;z-index:20;background:linear-gradient(var(--ui-cor-borda, rgba(255, 255, 255, .12)),var(--ui-cor-borda, rgba(255, 255, 255, .12))) center / 1px 60% no-repeat;transition:background-color .15s ease}.ui-tabela__resizer:hover,.ui-tabela__resizer:focus-visible,.ui-tabela__resizer--ativo{background:var(--ui-cor-primaria, #00E08A);outline:none}:host([densidade="compacta"]) th,:host([densidade="compacta"]) td,:host([density="compact"]) th,:host([density="compact"]) td{padding:4px 8px}:host([densidade="normal"]) th,:host([densidade="normal"]) td,:host([density="normal"]) th,:host([density="normal"]) td{padding:10px 16px}:host([densidade="relaxada"]) th,:host([densidade="relaxada"]) td,:host([density="relaxed"]) th,:host([density="relaxed"]) td{padding:16px 20px}:host([altura-linha]) td,:host([row-height]) td{height:var(--ui-tabela-altura-linha);box-sizing:border-box;padding-top:0;padding-bottom:0;overflow:hidden;white-space:nowrap}.ui-tabela__header-content{display:inline-flex;align-items:center;vertical-align:middle;width:100%;box-sizing:border-box}.ui-tabela__header-text{margin-right:var(--ui-tabela-th-gap, 6px);display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis}.ui-tabela__sort-icon{width:var(--ui-tabela-th-icone, 16px);min-width:var(--ui-tabela-th-icone, 16px);flex:none;display:inline-flex;justify-content:center;align-items:center}.ui-tabela th.ui-tabela__th--ordenavel{cursor:pointer}@media (hover: hover){.ui-tabela th.ui-tabela__th--ordenavel:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,var(--ui-cor-fundo-elevado, #1a1a1e));color:var(--ui-cor-texto, #e1e1e6)}}.ui-tabela__ordenar{all:unset;display:flex;width:100%;box-sizing:border-box;cursor:pointer;font:inherit;color:inherit;text-align:inherit}.ui-tabela__ordenar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-radius:var(--ui-raio-sm, 4px)}.ui-tabela tbody tr:focus{outline:none}.ui-tabela tbody tr:focus-visible{outline:2px solid var(--ui-tabela-cor-foco, var(--ui-cor-texto, #e1e1e6));outline-offset:-2px;background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}.ui-tabela__sort-arrow{display:inline-block;width:14px;height:14px;vertical-align:middle;shape-rendering:geometricPrecision;fill:var(--ui-cor-primaria, #00E08A)}.ui-tabela__sort-arrow path{transition:opacity .15s ease;opacity:.35}.ui-tabela__sort-arrow--asc .seta-cima,.ui-tabela__sort-arrow--desc .seta-baixo{opacity:1}.ui-tabela__sort-arrow--inativo{fill:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__sort-arrow--inativo path{opacity:.6}.ui-tabela td{padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-borda, rgba(255, 255, 255, .12)) 60%,transparent);white-space:nowrap;vertical-align:middle;color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box}.ui-tabela__cell-content{display:inline-flex;align-items:center;vertical-align:middle}.ui-tabela__cell-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.ui-tabela--alinhar-esquerda{text-align:left}.ui-tabela--alinhar-esquerda .ui-tabela__header-content,.ui-tabela--alinhar-esquerda .ui-tabela__cell-content{justify-content:flex-start}.ui-tabela--alinhar-centro{text-align:center}.ui-tabela--alinhar-centro .ui-tabela__header-content,.ui-tabela--alinhar-centro .ui-tabela__cell-content{justify-content:center}.ui-tabela--alinhar-direita{text-align:right}.ui-tabela--alinhar-direita .ui-tabela__header-content,.ui-tabela--alinhar-direita .ui-tabela__cell-content{justify-content:flex-end}.ui-tabela tbody tr[data-index]{cursor:pointer}.ui-tabela tbody tr.ui-tabela__tr--par{background-color:var(--ui-tabela-zebra, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent))}@media (hover: hover){.ui-tabela tbody tr[data-index]:hover{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}}.ui-tabela tbody tr[data-index]:active{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 12%, transparent))}:host(:not([selecionar-texto])) .ui-tabela tbody td{-webkit-user-select:none;user-select:none}.ui-tabela tbody tr.ui-tabela__tr--selecionada,.ui-tabela tbody tr[data-selecionada=true]{background-color:var(--ui-tabela-selecionada, var(--ui-cor-linha-selecionada, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 14%, transparent)))}.ui-tabela tbody tr.ui-tabela__tr--selecionada td:first-child,.ui-tabela tbody tr[data-selecionada=true] td:first-child{box-shadow:inset 3px 0 0 var(--ui-cor-primaria, #00E08A)}@media (hover: hover){.ui-tabela tbody tr.ui-tabela__tr--selecionada:hover,.ui-tabela tbody tr[data-selecionada=true]:hover{background-color:var(--ui-tabela-selecionada-hover, var(--ui-cor-linha-selecionada-hover, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 22%, transparent)))}}.ui-tabela__virtual-spacer td{padding:0!important;border:none!important;height:inherit;background:transparent!important}.ui-tabela__empty{padding:40px 24px;text-align:center;color:var(--ui-cor-texto-secundario, #9696a6);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box}.ui-tabela__empty-icon{width:32px;height:32px;opacity:.5;fill:currentColor}.ui-tabela__empty-text{font-size:14px;font-weight:500;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__erro{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px;padding:10px 14px;border:1px solid var(--ui-cor-texto-erro, #ff5555);border-left-width:4px;border-radius:var(--ui-raio-borda, 6px);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);color:var(--ui-cor-texto, #e1e1e6);font-size:14px;box-sizing:border-box}.ui-tabela__erro-texto{flex:1 1 200px;min-width:0}.ui-tabela__erro-detalhe{display:block;margin-top:2px;font-size:12px;color:var(--ui-cor-texto-secundario, #9696a6);overflow-wrap:anywhere}.ui-tabela__erro-acao,.ui-tabela__prompt-actions button{background:var(--ui-cor-botao-secundario-fundo, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));padding:6px 12px;border-radius:var(--ui-raio-sm, 4px);font:inherit;cursor:pointer}.ui-tabela__erro-acao:hover,.ui-tabela__prompt-actions button:hover{background:var(--ui-cor-botao-secundario-hover, rgba(255, 255, 255, .2))}.ui-tabela__erro-acao:focus-visible,.ui-tabela__prompt-actions button:focus-visible,.ui-tabela__prompt-dialog input:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px}.ui-tabela__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.ui-tabela__loading{position:absolute;top:0;left:0;right:0;bottom:0;background-color:color-mix(in srgb,var(--ui-cor-superficie, #141417) 72%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;z-index:50;color:var(--ui-cor-texto, #e1e1e6);font-size:14px}.ui-tabela__spinner{width:32px;height:32px;border:3px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A);border-radius:50%;animation:ui-tabela-spin .8s linear infinite}@keyframes ui-tabela-spin{to{transform:rotate(360deg)}}.ui-tabela__prompt-dialog{margin:0;max-width:calc(100vw - 16px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);padding:12px;box-shadow:var(--ui-sombra-lg, 0 8px 32px rgba(0, 0, 0, .8));font-family:inherit;font-size:14px}.ui-tabela__prompt-dialog::backdrop{background:#0000004d}.ui-tabela__prompt-title{display:block;margin-bottom:8px;font-weight:500}.ui-tabela__prompt-dialog input{width:100%;padding:6px 8px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));background:var(--ui-cor-superficie, #141417);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:8px;box-sizing:border-box;font:inherit}.ui-tabela__prompt-dialog input[aria-invalid=true]{border-color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-erro{min-height:1.2em;margin-bottom:8px;font-size:12px;color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-actions{display:flex;justify-content:flex-end;gap:8px}.ui-tabela__prompt-actions button:last-child{background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000);font-weight:600}.ui-tabela__prompt-actions button:last-child:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 85%,var(--ui-cor-texto, #e1e1e6))}@media (pointer: coarse){.ui-tabela__resizer{width:16px}:host(:not([altura-linha]):not([row-height])) .ui-tabela tbody tr[data-index]{height:44px}}@media (max-width: 640px){.ui-tabela th{padding:8px 10px;font-size:12px}.ui-tabela td{padding:8px 10px;font-size:13px}}@media (prefers-reduced-motion: reduce){.ui-tabela__resizer,.ui-tabela__sort-arrow path{transition:none}.ui-tabela__spinner{animation-duration:2.4s}}';
|
|
309
|
+
function ce(t) {
|
|
310
|
+
return t == null || t === "" ? "" : typeof t == "number" ? `${t}px` : t;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
return
|
|
312
|
+
function ue(t) {
|
|
313
|
+
return t === "centro" || t === "center" ? "ui-tabela--alinhar-centro" : t === "direita" || t === "right" ? "ui-tabela--alinhar-direita" : "ui-tabela--alinhar-esquerda";
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
315
|
+
function pe(t) {
|
|
316
|
+
return t === "centro" || t === "center" ? "center" : t === "direita" || t === "right" ? "right" : "left";
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
318
|
+
function te(t) {
|
|
319
|
+
return t === "compacta" ? 30 : t === "relaxada" ? 56 : 42;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
321
|
+
function Be(t, r, e, o) {
|
|
322
|
+
t.innerHTML = `<style>${Re}</style>`;
|
|
323
|
+
const i = document.createElement("div");
|
|
324
|
+
i.className = "ui-tabela-container", i.setAttribute("part", "base"), e && (i.style.maxHeight = e);
|
|
325
325
|
const a = document.createElement("div");
|
|
326
326
|
a.className = "ui-tabela__empty", a.setAttribute("part", "vazio"), a.style.display = "none", a.setAttribute("role", "status");
|
|
327
327
|
const n = document.createElement("div");
|
|
@@ -329,12 +329,12 @@ function Se(r, t, e, i) {
|
|
|
329
329
|
<svg class="ui-tabela__empty-icon" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
|
|
330
330
|
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"/>
|
|
331
331
|
</svg>`;
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const l = document.createElement("span");
|
|
333
|
+
l.className = "ui-tabela__empty-text", l.textContent = r, a.appendChild(n), a.appendChild(l);
|
|
334
334
|
const d = document.createElement("table");
|
|
335
335
|
d.className = "ui-tabela", d.setAttribute("part", "tabela"), d.setAttribute("role", "grid");
|
|
336
|
-
const c = document.createElement("colgroup"),
|
|
337
|
-
d.appendChild(c), d.appendChild(
|
|
336
|
+
const c = document.createElement("colgroup"), s = document.createElement("thead"), u = document.createElement("tbody");
|
|
337
|
+
d.appendChild(c), d.appendChild(s), d.appendChild(u);
|
|
338
338
|
const p = document.createElement("div");
|
|
339
339
|
p.className = "ui-tabela__erro", p.setAttribute("part", "erro"), p.setAttribute("role", "alert"), p.style.display = "none";
|
|
340
340
|
const h = document.createElement("div");
|
|
@@ -346,228 +346,228 @@ function Se(r, t, e, i) {
|
|
|
346
346
|
const f = document.createElement("button");
|
|
347
347
|
f.type = "button", f.className = "ui-tabela__erro-acao", f.setAttribute("part", "erro-acao"), f.textContent = "Tentar novamente", p.appendChild(h), p.appendChild(f);
|
|
348
348
|
const g = document.createElement("div");
|
|
349
|
-
g.className = "ui-tabela__sr", g.setAttribute("role", "status"), g.setAttribute("aria-live", "polite"),
|
|
350
|
-
const
|
|
351
|
-
return
|
|
349
|
+
g.className = "ui-tabela__sr", g.setAttribute("role", "status"), g.setAttribute("aria-live", "polite"), i.appendChild(p), i.appendChild(d), i.appendChild(a), i.appendChild(g);
|
|
350
|
+
const v = document.createElement("div");
|
|
351
|
+
return v.className = "ui-tabela__loading", v.setAttribute("part", "carregando"), v.setAttribute("role", "status"), v.setAttribute("aria-live", "polite"), v.style.display = o ? "flex" : "none", v.innerHTML = `
|
|
352
352
|
<div class="ui-tabela__spinner" aria-hidden="true"></div>
|
|
353
353
|
<span class="ui-tabela__loading-texto">Carregando dados...</span>
|
|
354
|
-
`,
|
|
355
|
-
containerElement:
|
|
354
|
+
`, i.appendChild(v), t.appendChild(i), {
|
|
355
|
+
containerElement: i,
|
|
356
356
|
tableElement: d,
|
|
357
|
-
theadElement:
|
|
357
|
+
theadElement: s,
|
|
358
358
|
tbodyElement: u,
|
|
359
359
|
colgroupElement: c,
|
|
360
360
|
emptyElement: a,
|
|
361
|
-
loadingElement:
|
|
361
|
+
loadingElement: v,
|
|
362
362
|
erroElement: p,
|
|
363
363
|
anuncioElement: g
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Oe(t) {
|
|
367
367
|
var a, n;
|
|
368
|
-
if (!
|
|
369
|
-
|
|
370
|
-
const e =
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
368
|
+
if (!t.theadElement || !t.colgroupElement) return;
|
|
369
|
+
t.headerListeners.cleanup();
|
|
370
|
+
const e = t.theadElement.getRootNode().activeElement, o = e && t.theadElement.contains(e) ? ((a = e.closest("th")) == null ? void 0 : a.getAttribute("data-coluna")) ?? null : null;
|
|
371
|
+
t.theadElement.innerHTML = "", t.colgroupElement.innerHTML = "";
|
|
372
|
+
const i = document.createElement("tr");
|
|
373
|
+
if (i.setAttribute("aria-rowindex", "1"), t.colunas.forEach((l, d) => {
|
|
374
374
|
const c = document.createElement("col");
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
|
|
375
|
+
l.largura !== void 0 && (c.style.width = t.formatWidth(l.largura)), t.colgroupElement.appendChild(c);
|
|
376
|
+
const s = document.createElement("th"), u = t.getAlignmentClass(l.alinhamento);
|
|
377
|
+
if (s.className = u, s.setAttribute("part", "celula-cabecalho"), s.scope = "col", s.setAttribute("data-coluna", l.id), s.style.textAlign = t.getTextAlign(l.alinhamento), l.largura !== void 0 && (s.style.width = t.formatWidth(l.largura)), l.larguraMinima !== void 0 && (s.style.minWidth = t.formatWidth(l.larguraMinima)), l.larguraMaxima !== void 0) {
|
|
378
|
+
const _ = t.formatWidth(l.larguraMaxima);
|
|
379
|
+
s.style.maxWidth = _, s.style.overflow = "hidden", s.style.textOverflow = "ellipsis", s.style.whiteSpace = "nowrap";
|
|
380
380
|
}
|
|
381
|
-
|
|
382
|
-
const p = !!
|
|
383
|
-
if (
|
|
384
|
-
|
|
385
|
-
const
|
|
386
|
-
|
|
381
|
+
l.tooltip && (s.title = l.tooltip);
|
|
382
|
+
const p = !!l.ordenavel && t.colunaOrdenada === l.id && t.direcaoOrdenacao !== "original", h = p && t.direcaoOrdenacao === "desc";
|
|
383
|
+
if (l.ordenavel) {
|
|
384
|
+
s.classList.add("ui-tabela__th--ordenavel");
|
|
385
|
+
const _ = () => t.onHeaderClick(l);
|
|
386
|
+
t.headerListeners.add(s, "click", _), s.setAttribute("aria-sort", p ? h ? "descending" : "ascending" : "none");
|
|
387
387
|
}
|
|
388
|
-
const m = (
|
|
389
|
-
|
|
388
|
+
const m = (_) => t.onHeaderContextMenu(_, l, d, s);
|
|
389
|
+
t.headerListeners.add(s, "contextmenu", m);
|
|
390
390
|
const x = document.createElement("div");
|
|
391
391
|
x.className = "ui-tabela__header-content";
|
|
392
392
|
const f = document.createElement("span");
|
|
393
|
-
if (f.className = "ui-tabela__header-text", f.textContent =
|
|
394
|
-
const
|
|
395
|
-
|
|
393
|
+
if (f.className = "ui-tabela__header-text", f.textContent = l.rotulo, x.appendChild(f), l.ordenavel) {
|
|
394
|
+
const _ = document.createElement("span");
|
|
395
|
+
_.className = "ui-tabela__sort-icon";
|
|
396
396
|
const E = p ? h ? "ui-tabela__sort-arrow--desc" : "ui-tabela__sort-arrow--asc" : "ui-tabela__sort-arrow--inativo";
|
|
397
|
-
|
|
397
|
+
_.setAttribute("aria-hidden", "true"), _.innerHTML = `<svg class="ui-tabela__sort-arrow ${E}" viewBox="0 0 24 24" focusable="false"><path class="seta-cima" d="M7 11l5-5 5 5H7z"/><path class="seta-baixo" d="M7 13l5 5 5-5H7z"/></svg>`, x.appendChild(_);
|
|
398
398
|
}
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
|
|
399
|
+
if (l.ordenavel) {
|
|
400
|
+
const _ = document.createElement("button");
|
|
401
|
+
_.type = "button", _.className = "ui-tabela__ordenar", _.setAttribute("part", "ordenar"), _.appendChild(x), s.appendChild(_);
|
|
402
402
|
} else
|
|
403
|
-
|
|
403
|
+
s.appendChild(x);
|
|
404
404
|
const g = document.createElement("div");
|
|
405
|
-
g.className = "ui-tabela__resizer", g.setAttribute("part", "redimensionador"), g.title = "Arrastar para redimensionar largura (duplo-clique para auto-ajuste)", g.tabIndex = 0, g.setAttribute("role", "separator"), g.setAttribute("aria-orientation", "vertical"), g.setAttribute("aria-label", `Redimensionar coluna ${
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
const y = (
|
|
409
|
-
const E =
|
|
410
|
-
E.pointerType === "mouse" || !E.pointerType ||
|
|
405
|
+
g.className = "ui-tabela__resizer", g.setAttribute("part", "redimensionador"), g.title = "Arrastar para redimensionar largura (duplo-clique para auto-ajuste)", g.tabIndex = 0, g.setAttribute("role", "separator"), g.setAttribute("aria-orientation", "vertical"), g.setAttribute("aria-label", `Redimensionar coluna ${l.rotulo}`);
|
|
406
|
+
const v = (_) => t.onInitColumnResize(_, l, d, s, g);
|
|
407
|
+
t.headerListeners.add(g, "mousedown", v);
|
|
408
|
+
const y = (_) => {
|
|
409
|
+
const E = _;
|
|
410
|
+
E.pointerType === "mouse" || !E.pointerType || t.onInitColumnResize(E, l, d, s, g);
|
|
411
411
|
};
|
|
412
|
-
|
|
413
|
-
const
|
|
414
|
-
var N,
|
|
415
|
-
const E =
|
|
412
|
+
t.headerListeners.add(g, "pointerdown", y);
|
|
413
|
+
const k = (_) => {
|
|
414
|
+
var N, D;
|
|
415
|
+
const E = _, B = E.shiftKey ? 50 : 10;
|
|
416
416
|
if (E.key === "ArrowRight")
|
|
417
|
-
E.preventDefault(), (N =
|
|
417
|
+
E.preventDefault(), (N = t.onResizeTeclado) == null || N.call(t, B, l, d, s, c);
|
|
418
418
|
else if (E.key === "ArrowLeft")
|
|
419
|
-
E.preventDefault(), (
|
|
419
|
+
E.preventDefault(), (D = t.onResizeTeclado) == null || D.call(t, -B, l, d, s, c);
|
|
420
420
|
else if (E.key === "Enter" || E.key === "F2") {
|
|
421
421
|
E.preventDefault();
|
|
422
|
-
const C =
|
|
423
|
-
|
|
422
|
+
const C = s.getBoundingClientRect();
|
|
423
|
+
t.onHeaderContextMenu(new MouseEvent("contextmenu", { clientX: C.left, clientY: C.bottom }), l, d, s);
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
|
-
|
|
427
|
-
const w = (
|
|
428
|
-
|
|
426
|
+
t.headerListeners.add(g, "keydown", k);
|
|
427
|
+
const w = (_) => {
|
|
428
|
+
_.stopPropagation(), t.onColumnAutoFit(l, s, c);
|
|
429
429
|
};
|
|
430
|
-
|
|
431
|
-
}),
|
|
432
|
-
const
|
|
433
|
-
(n =
|
|
430
|
+
t.headerListeners.add(g, "dblclick", w), t.headerListeners.add(g, "click", (_) => _.stopPropagation()), s.appendChild(g), i.appendChild(s);
|
|
431
|
+
}), t.theadElement.appendChild(i), o !== null) {
|
|
432
|
+
const l = Array.from(i.children).find((d) => d.getAttribute("data-coluna") === o);
|
|
433
|
+
(n = l == null ? void 0 : l.querySelector(".ui-tabela__ordenar")) == null || n.focus();
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
const
|
|
437
|
-
function
|
|
438
|
-
for (const e of
|
|
439
|
-
if (e ===
|
|
440
|
-
if (e instanceof Element && e.matches(
|
|
436
|
+
const Ie = 'button, input, select, textarea, a, summary, [role="button"], [data-prevent-select]';
|
|
437
|
+
function Pe(t, r) {
|
|
438
|
+
for (const e of t.composedPath()) {
|
|
439
|
+
if (e === r) return !1;
|
|
440
|
+
if (e instanceof Element && e.matches(Ie)) return !0;
|
|
441
441
|
}
|
|
442
442
|
return !1;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
if (!
|
|
446
|
-
if (
|
|
447
|
-
|
|
448
|
-
const p =
|
|
444
|
+
function Fe(t) {
|
|
445
|
+
if (!t.tbodyElement || !t.tableElement || !t.emptyElement || !t.containerElement) return;
|
|
446
|
+
if (t.tableElement.setAttribute("aria-colcount", String(t.colunas.length)), !t.dadosExibicao || t.dadosExibicao.length === 0) {
|
|
447
|
+
t.tbodyElement.innerHTML = "", t.tableElement.setAttribute("aria-rowcount", "1"), t.tableElement.style.display = t.colunas.length > 0 ? "table" : "none", t.emptyElement.style.display = "flex";
|
|
448
|
+
const p = t.emptyElement.querySelector(".ui-tabela__empty-text"), h = t.filtroAtivo ? t.textoSemResultados : t.textoVazio;
|
|
449
449
|
p && h !== void 0 && (p.textContent = h);
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
let
|
|
455
|
-
if (
|
|
456
|
-
const p =
|
|
457
|
-
|
|
452
|
+
t.emptyElement.style.display = "none", t.tableElement.style.display = "table", t.tableElement.setAttribute("aria-rowcount", String(t.dadosExibicao.length + 1));
|
|
453
|
+
const r = t.dadosExibicao.length, e = t.rowHeight, o = t.virtualizar && r > 30;
|
|
454
|
+
let i = 0, a = r;
|
|
455
|
+
if (o) {
|
|
456
|
+
const p = t.containerElement.scrollTop, h = t.containerElement.clientHeight || 400, m = 5;
|
|
457
|
+
i = Math.max(0, Math.floor(p / e) - m), a = Math.min(r, Math.ceil((p + h) / e) + m);
|
|
458
458
|
}
|
|
459
|
-
const
|
|
460
|
-
|
|
459
|
+
const l = t.tbodyElement.getRootNode().activeElement, d = l && l.parentElement === t.tbodyElement ? l.getAttribute("data-index") : null, c = t.indiceAtivo ?? null, s = c !== null && c >= i && c < a ? c : i;
|
|
460
|
+
t.tbodyElement.innerHTML = "";
|
|
461
461
|
const u = document.createDocumentFragment();
|
|
462
|
-
if (
|
|
462
|
+
if (o && i > 0) {
|
|
463
463
|
const p = document.createElement("tr");
|
|
464
|
-
p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${
|
|
464
|
+
p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${i * e}px`;
|
|
465
465
|
const h = document.createElement("td");
|
|
466
|
-
h.colSpan =
|
|
467
|
-
}
|
|
468
|
-
for (let p =
|
|
469
|
-
const h =
|
|
470
|
-
m.setAttribute("data-index", String(p)), m.setAttribute("part", "linha"), m.setAttribute("aria-rowindex", String(p + 2)), m.setAttribute("aria-selected", "false"), m.tabIndex = p ===
|
|
471
|
-
const x =
|
|
472
|
-
h[x] !== void 0 ? m.setAttribute("data-id", String(h[x])) : h.id !== void 0 ? m.setAttribute("data-id", String(h.id)) : h._id !== void 0 && m.setAttribute("data-id", String(h._id)),
|
|
473
|
-
|
|
474
|
-
}),
|
|
475
|
-
const g = document.createElement("td"),
|
|
476
|
-
if (g.className =
|
|
477
|
-
const w =
|
|
466
|
+
h.colSpan = t.colunas.length || 1, p.appendChild(h), u.appendChild(p);
|
|
467
|
+
}
|
|
468
|
+
for (let p = i; p < a; p++) {
|
|
469
|
+
const h = t.dadosExibicao[p], m = document.createElement("tr");
|
|
470
|
+
m.setAttribute("data-index", String(p)), m.setAttribute("part", "linha"), m.setAttribute("aria-rowindex", String(p + 2)), m.setAttribute("aria-selected", "false"), m.tabIndex = p === s ? 0 : -1, p % 2 === 1 && m.classList.add("ui-tabela__tr--par");
|
|
471
|
+
const x = t.chaveId;
|
|
472
|
+
h[x] !== void 0 ? m.setAttribute("data-id", String(h[x])) : h.id !== void 0 ? m.setAttribute("data-id", String(h.id)) : h._id !== void 0 && m.setAttribute("data-id", String(h._id)), t.isItemSelecionado(h, p) && (m.classList.add("ui-tabela__tr--selecionada"), m.setAttribute("part", "linha linha-selecionada"), m.setAttribute("aria-current", "true"), m.setAttribute("aria-selected", "true"), m.setAttribute("data-selecionada", "true")), m.addEventListener("click", (f) => {
|
|
473
|
+
Pe(f, m) || t.onLinhaClique(h, p);
|
|
474
|
+
}), t.colunas.forEach((f) => {
|
|
475
|
+
const g = document.createElement("td"), v = t.getAlignmentClass(f.alinhamento);
|
|
476
|
+
if (g.className = v, g.setAttribute("part", "celula"), g.style.textAlign = t.getTextAlign(f.alinhamento), f.larguraMaxima !== void 0) {
|
|
477
|
+
const w = t.formatWidth(f.larguraMaxima);
|
|
478
478
|
g.style.maxWidth = w, g.style.overflow = "hidden", g.style.textOverflow = "ellipsis", g.style.whiteSpace = "nowrap";
|
|
479
479
|
}
|
|
480
480
|
const y = document.createElement("div");
|
|
481
481
|
y.className = "ui-tabela__cell-content", f.larguraMaxima !== void 0 && y.classList.add("ui-tabela__cell-truncate");
|
|
482
|
-
const
|
|
482
|
+
const k = h[f.id];
|
|
483
483
|
if (typeof f.render == "function")
|
|
484
484
|
try {
|
|
485
|
-
const w = f.render(
|
|
485
|
+
const w = f.render(k, h, p);
|
|
486
486
|
w instanceof Node ? y.appendChild(w) : y.textContent = String(w ?? "");
|
|
487
487
|
} catch (w) {
|
|
488
488
|
console.error(`[ui-tabela] Erro no render da coluna "${f.id}" (linha ${p}):`, w), y.textContent = "";
|
|
489
489
|
}
|
|
490
|
-
else if (
|
|
491
|
-
y.appendChild(
|
|
490
|
+
else if (k instanceof Node)
|
|
491
|
+
y.appendChild(k);
|
|
492
492
|
else {
|
|
493
|
-
const w =
|
|
493
|
+
const w = k != null ? String(k) : "";
|
|
494
494
|
y.textContent = w, f.larguraMaxima !== void 0 && !f.tooltip && (g.title = w);
|
|
495
495
|
}
|
|
496
496
|
g.appendChild(y), m.appendChild(g);
|
|
497
497
|
}), u.appendChild(m);
|
|
498
498
|
}
|
|
499
|
-
if (
|
|
499
|
+
if (o && a < r) {
|
|
500
500
|
const p = document.createElement("tr");
|
|
501
|
-
p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${(
|
|
501
|
+
p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${(r - a) * e}px`;
|
|
502
502
|
const h = document.createElement("td");
|
|
503
|
-
h.colSpan =
|
|
503
|
+
h.colSpan = t.colunas.length || 1, p.appendChild(h), u.appendChild(p);
|
|
504
504
|
}
|
|
505
|
-
if (
|
|
506
|
-
const p =
|
|
505
|
+
if (t.tbodyElement.appendChild(u), d !== null) {
|
|
506
|
+
const p = t.tbodyElement.querySelector(`tr[data-index="${d}"]`);
|
|
507
507
|
p == null || p.focus({ preventScroll: !0 });
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
if (
|
|
512
|
-
const
|
|
513
|
-
return isNaN(
|
|
510
|
+
function re(t) {
|
|
511
|
+
if (t === void 0) return null;
|
|
512
|
+
const r = typeof t == "number" ? t : parseInt(t, 10);
|
|
513
|
+
return isNaN(r) ? null : r;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const e =
|
|
517
|
-
let
|
|
518
|
-
const
|
|
519
|
-
return
|
|
515
|
+
function W(t, r) {
|
|
516
|
+
const e = re(t.larguraMinima);
|
|
517
|
+
let o = Math.max(e ?? 60, r);
|
|
518
|
+
const i = re(t.larguraMaxima);
|
|
519
|
+
return i !== null && (o = Math.min(i, o)), o;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
const
|
|
523
|
-
return
|
|
521
|
+
function Ve(t, r, e, o) {
|
|
522
|
+
const i = W(t, r.offsetWidth + o);
|
|
523
|
+
return t.largura = `${i}px`, r.style.width = `${i}px`, e && (e.style.width = `${i}px`), `${i}px`;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function He(t) {
|
|
526
526
|
const {
|
|
527
|
-
evento:
|
|
527
|
+
evento: r,
|
|
528
528
|
coluna: e,
|
|
529
|
-
colIndex:
|
|
530
|
-
thElement:
|
|
529
|
+
colIndex: o,
|
|
530
|
+
thElement: i,
|
|
531
531
|
resizer: a,
|
|
532
532
|
colgroupElement: n,
|
|
533
|
-
onResizeStart:
|
|
533
|
+
onResizeStart: l,
|
|
534
534
|
onResizeEnd: d,
|
|
535
535
|
onResizeCancel: c
|
|
536
|
-
} =
|
|
537
|
-
|
|
538
|
-
const
|
|
536
|
+
} = t;
|
|
537
|
+
r.stopPropagation(), r.preventDefault(), l(), a.classList.add("ui-tabela__resizer--ativo");
|
|
538
|
+
const s = r.pageX, u = i.offsetWidth, p = n == null ? void 0 : n.children[o], h = r.type === "pointerdown", m = h ? r.pointerId : null, x = h ? "pointermove" : "mousemove", f = h ? "pointerup" : "mouseup";
|
|
539
539
|
let g = !1;
|
|
540
|
-
const
|
|
541
|
-
const
|
|
542
|
-
if (m !== null &&
|
|
540
|
+
const v = (w) => {
|
|
541
|
+
const _ = w;
|
|
542
|
+
if (m !== null && _.pointerId !== m) return;
|
|
543
543
|
g = !0;
|
|
544
|
-
const E =
|
|
545
|
-
e.largura = `${E}px`,
|
|
544
|
+
const E = W(e, u + (_.pageX - s));
|
|
545
|
+
e.largura = `${E}px`, i.style.width = `${E}px`, p && (p.style.width = `${E}px`);
|
|
546
546
|
}, y = () => {
|
|
547
|
-
|
|
548
|
-
},
|
|
549
|
-
a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener(x,
|
|
547
|
+
k(), g ? d(String(e.largura)) : c == null || c();
|
|
548
|
+
}, k = () => {
|
|
549
|
+
a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener(x, v), window.removeEventListener(f, y), h && window.removeEventListener("pointercancel", y);
|
|
550
550
|
};
|
|
551
|
-
return window.addEventListener(x,
|
|
551
|
+
return window.addEventListener(x, v), window.addEventListener(f, y), h && window.addEventListener("pointercancel", y), k;
|
|
552
552
|
}
|
|
553
|
-
const
|
|
554
|
-
let
|
|
555
|
-
function
|
|
556
|
-
var
|
|
553
|
+
const O = 20;
|
|
554
|
+
let $e = 0;
|
|
555
|
+
function qe(t) {
|
|
556
|
+
var D;
|
|
557
557
|
const {
|
|
558
|
-
evento:
|
|
558
|
+
evento: r,
|
|
559
559
|
coluna: e,
|
|
560
|
-
colIndex:
|
|
561
|
-
thElement:
|
|
560
|
+
colIndex: o,
|
|
561
|
+
thElement: i,
|
|
562
562
|
colgroupElement: a,
|
|
563
563
|
shadow: n,
|
|
564
|
-
onResizeEnd:
|
|
565
|
-
} =
|
|
564
|
+
onResizeEnd: l
|
|
565
|
+
} = t, d = `ui-tabela-dlg-${++$e}`, c = document.createElement("dialog");
|
|
566
566
|
c.className = "ui-tabela__prompt-dialog", c.setAttribute("part", "dialogo"), c.setAttribute("aria-labelledby", `${d}-titulo`);
|
|
567
|
-
const
|
|
568
|
-
|
|
567
|
+
const s = document.createElement("label");
|
|
568
|
+
s.className = "ui-tabela__prompt-title", s.id = `${d}-titulo`, s.htmlFor = `${d}-campo`, s.textContent = `Largura de "${e.rotulo}" (px; vazio = automática)`;
|
|
569
569
|
const u = document.createElement("input");
|
|
570
|
-
u.id = `${d}-campo`, u.type = "number", u.min = String(
|
|
570
|
+
u.id = `${d}-campo`, u.type = "number", u.min = String(O), u.step = "1", u.setAttribute("inputmode", "numeric"), u.placeholder = "auto";
|
|
571
571
|
const p = e.largura ? parseInt(String(e.largura), 10) : NaN;
|
|
572
572
|
u.value = Number.isFinite(p) ? String(p) : "";
|
|
573
573
|
const h = document.createElement("div");
|
|
@@ -577,29 +577,29 @@ function Oe(r) {
|
|
|
577
577
|
const x = document.createElement("button");
|
|
578
578
|
x.type = "button", x.textContent = "Aplicar";
|
|
579
579
|
const f = document.createElement("button");
|
|
580
|
-
f.type = "button", f.textContent = "Cancelar", m.appendChild(f), m.appendChild(x), c.appendChild(
|
|
581
|
-
const g = c.getBoundingClientRect(),
|
|
582
|
-
c.style.left = `${
|
|
583
|
-
let
|
|
580
|
+
f.type = "button", f.textContent = "Cancelar", m.appendChild(f), m.appendChild(x), c.appendChild(s), c.appendChild(u), c.appendChild(h), c.appendChild(m), n.appendChild(c), typeof c.showModal == "function" ? c.showModal() : c.setAttribute("open", ""), c.style.position = "fixed";
|
|
581
|
+
const g = c.getBoundingClientRect(), v = g.width || 240, y = g.height || 140, k = Math.max(8, Math.min(r.clientX || 0, window.innerWidth - v - 8)), w = Math.max(8, Math.min(r.clientY || 0, window.innerHeight - y - 8));
|
|
582
|
+
c.style.left = `${k}px`, c.style.top = `${w}px`;
|
|
583
|
+
let _ = !1;
|
|
584
584
|
const E = () => {
|
|
585
585
|
var C;
|
|
586
|
-
|
|
587
|
-
},
|
|
586
|
+
_ || (_ = !0, c.open && typeof c.close == "function" && c.close(), c.remove(), (C = i.querySelector(".ui-tabela__ordenar, .ui-tabela__resizer")) == null || C.focus());
|
|
587
|
+
}, B = (C) => {
|
|
588
588
|
h.textContent = C, u.setAttribute("aria-invalid", "true"), u.setAttribute("aria-describedby", h.id), u.focus();
|
|
589
589
|
}, N = () => {
|
|
590
|
-
const C = e.largura,
|
|
591
|
-
if (
|
|
592
|
-
e.largura = void 0,
|
|
590
|
+
const C = e.largura, Z = u.value.trim();
|
|
591
|
+
if (Z === "")
|
|
592
|
+
e.largura = void 0, i.style.width = "", a != null && a.children[o] && (a.children[o].style.width = "");
|
|
593
593
|
else {
|
|
594
|
-
const
|
|
595
|
-
if (!Number.isFinite(
|
|
596
|
-
|
|
594
|
+
const H = Number(Z);
|
|
595
|
+
if (!Number.isFinite(H) || H < O) {
|
|
596
|
+
B(`Informe um valor de pelo menos ${O} px, ou deixe vazio para automática.`);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
const
|
|
600
|
-
e.largura = `${
|
|
599
|
+
const $ = Math.round(W({ ...e, larguraMinima: e.larguraMinima ?? O }, H));
|
|
600
|
+
e.largura = `${$}px`, i.style.width = `${$}px`, a != null && a.children[o] && (a.children[o].style.width = `${$}px`);
|
|
601
601
|
}
|
|
602
|
-
E(), e.largura !== C &&
|
|
602
|
+
E(), e.largura !== C && l(e.largura ? String(e.largura) : "auto");
|
|
603
603
|
};
|
|
604
604
|
x.addEventListener("click", (C) => {
|
|
605
605
|
C.stopPropagation(), N();
|
|
@@ -609,15 +609,15 @@ function Oe(r) {
|
|
|
609
609
|
h.textContent = "", u.removeAttribute("aria-invalid"), u.removeAttribute("aria-describedby");
|
|
610
610
|
}), u.addEventListener("keydown", (C) => {
|
|
611
611
|
C.key === "Enter" ? (C.preventDefault(), N()) : C.key === "Escape" && (C.preventDefault(), E());
|
|
612
|
-
}), u.focus(), (
|
|
612
|
+
}), u.focus(), (D = u.select) == null || D.call(u);
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
return
|
|
616
|
-
evento:
|
|
617
|
-
coluna:
|
|
614
|
+
function je(t, r, e, o, i, a) {
|
|
615
|
+
return He({
|
|
616
|
+
evento: t,
|
|
617
|
+
coluna: r,
|
|
618
618
|
colIndex: e,
|
|
619
|
-
thElement:
|
|
620
|
-
resizer:
|
|
619
|
+
thElement: o,
|
|
620
|
+
resizer: i,
|
|
621
621
|
colgroupElement: a.colgroupElement,
|
|
622
622
|
onResizeStart: () => a.onSetIsResizing(!0),
|
|
623
623
|
onResizeCancel: () => {
|
|
@@ -626,7 +626,7 @@ function Ie(r, t, e, i, o, a) {
|
|
|
626
626
|
onResizeEnd: (n) => {
|
|
627
627
|
setTimeout(() => a.onSetIsResizing(!1), 50), a.host.dispatchEvent(
|
|
628
628
|
new CustomEvent("ui-column-resize", {
|
|
629
|
-
detail: { idColuna:
|
|
629
|
+
detail: { idColuna: r.id, largura: n },
|
|
630
630
|
bubbles: !0,
|
|
631
631
|
composed: !0
|
|
632
632
|
})
|
|
@@ -634,18 +634,18 @@ function Ie(r, t, e, i, o, a) {
|
|
|
634
634
|
}
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
|
|
639
|
-
evento:
|
|
640
|
-
coluna:
|
|
637
|
+
function Ue(t, r, e, o, i) {
|
|
638
|
+
t.preventDefault(), t.stopPropagation(), qe({
|
|
639
|
+
evento: t,
|
|
640
|
+
coluna: r,
|
|
641
641
|
colIndex: e,
|
|
642
|
-
thElement:
|
|
643
|
-
colgroupElement:
|
|
644
|
-
shadow:
|
|
642
|
+
thElement: o,
|
|
643
|
+
colgroupElement: i.colgroupElement,
|
|
644
|
+
shadow: i.shadow,
|
|
645
645
|
onResizeEnd: (a) => {
|
|
646
|
-
|
|
646
|
+
i.host.dispatchEvent(
|
|
647
647
|
new CustomEvent("ui-column-resize", {
|
|
648
|
-
detail: { idColuna:
|
|
648
|
+
detail: { idColuna: r.id, largura: a },
|
|
649
649
|
bubbles: !0,
|
|
650
650
|
composed: !0
|
|
651
651
|
})
|
|
@@ -653,214 +653,214 @@ function Pe(r, t, e, i, o) {
|
|
|
653
653
|
}
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function
|
|
657
|
-
const a =
|
|
658
|
-
|
|
656
|
+
function We(t, r, e, o, i) {
|
|
657
|
+
const a = Ve(r, e, o, t);
|
|
658
|
+
i.host.dispatchEvent(
|
|
659
659
|
new CustomEvent("ui-column-resize", {
|
|
660
|
-
detail: { idColuna:
|
|
660
|
+
detail: { idColuna: r.id, largura: a },
|
|
661
661
|
bubbles: !0,
|
|
662
662
|
composed: !0
|
|
663
663
|
})
|
|
664
664
|
);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
theadElement:
|
|
669
|
-
colgroupElement:
|
|
670
|
-
colunas:
|
|
671
|
-
colunaOrdenada:
|
|
672
|
-
direcaoOrdenacao:
|
|
673
|
-
headerListeners:
|
|
674
|
-
formatWidth:
|
|
675
|
-
getAlignmentClass:
|
|
676
|
-
getTextAlign:
|
|
677
|
-
onHeaderClick: (
|
|
678
|
-
onHeaderContextMenu: (
|
|
679
|
-
|
|
680
|
-
host:
|
|
681
|
-
colgroupElement:
|
|
682
|
-
shadow:
|
|
683
|
-
onSetIsResizing:
|
|
666
|
+
function Xe(t) {
|
|
667
|
+
Oe({
|
|
668
|
+
theadElement: t.theadElement,
|
|
669
|
+
colgroupElement: t.colgroupElement,
|
|
670
|
+
colunas: t.colunas,
|
|
671
|
+
colunaOrdenada: t.dadosController.getColunaOrdenada(),
|
|
672
|
+
direcaoOrdenacao: t.dadosController.getDirecaoOrdenacao(),
|
|
673
|
+
headerListeners: t.headerListeners,
|
|
674
|
+
formatWidth: ce,
|
|
675
|
+
getAlignmentClass: ue,
|
|
676
|
+
getTextAlign: pe,
|
|
677
|
+
onHeaderClick: (r) => t.onHeaderClick(r),
|
|
678
|
+
onHeaderContextMenu: (r, e, o, i) => {
|
|
679
|
+
Ue(r, e, o, i, {
|
|
680
|
+
host: t.host,
|
|
681
|
+
colgroupElement: t.colgroupElement,
|
|
682
|
+
shadow: t.shadow,
|
|
683
|
+
onSetIsResizing: t.onSetIsResizing
|
|
684
684
|
});
|
|
685
685
|
},
|
|
686
|
-
onInitColumnResize: (
|
|
687
|
-
const n =
|
|
688
|
-
host:
|
|
689
|
-
colgroupElement:
|
|
690
|
-
shadow:
|
|
691
|
-
onSetIsResizing:
|
|
686
|
+
onInitColumnResize: (r, e, o, i, a) => {
|
|
687
|
+
const n = je(r, e, o, i, a, {
|
|
688
|
+
host: t.host,
|
|
689
|
+
colgroupElement: t.colgroupElement,
|
|
690
|
+
shadow: t.shadow,
|
|
691
|
+
onSetIsResizing: t.onSetIsResizing
|
|
692
692
|
});
|
|
693
|
-
|
|
693
|
+
t.onActiveResizeCleanup(n);
|
|
694
694
|
},
|
|
695
|
-
onResizeTeclado: (
|
|
696
|
-
|
|
697
|
-
host:
|
|
698
|
-
colgroupElement:
|
|
699
|
-
shadow:
|
|
700
|
-
onSetIsResizing:
|
|
695
|
+
onResizeTeclado: (r, e, o, i, a) => {
|
|
696
|
+
We(r, e, i, a, {
|
|
697
|
+
host: t.host,
|
|
698
|
+
colgroupElement: t.colgroupElement,
|
|
699
|
+
shadow: t.shadow,
|
|
700
|
+
onSetIsResizing: t.onSetIsResizing
|
|
701
701
|
});
|
|
702
702
|
},
|
|
703
|
-
onColumnAutoFit: (
|
|
704
|
-
|
|
703
|
+
onColumnAutoFit: (r, e, o) => {
|
|
704
|
+
r.largura = void 0, e.style.width = "", o.style.width = "", t.host.dispatchEvent(
|
|
705
705
|
new CustomEvent("ui-column-resize", {
|
|
706
706
|
bubbles: !0,
|
|
707
707
|
composed: !0,
|
|
708
|
-
detail: { idColuna:
|
|
708
|
+
detail: { idColuna: r.id, largura: "auto" }
|
|
709
709
|
})
|
|
710
710
|
);
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
|
|
716
|
-
tbodyElement:
|
|
717
|
-
tableElement:
|
|
718
|
-
emptyElement:
|
|
719
|
-
containerElement:
|
|
720
|
-
dadosExibicao:
|
|
721
|
-
colunas:
|
|
722
|
-
chaveId:
|
|
723
|
-
virtualizar:
|
|
724
|
-
rowHeight:
|
|
725
|
-
indiceAtivo:
|
|
726
|
-
filtroAtivo:
|
|
727
|
-
textoVazio:
|
|
728
|
-
textoSemResultados:
|
|
729
|
-
isItemSelecionado: (
|
|
730
|
-
onLinhaClique: (
|
|
731
|
-
|
|
714
|
+
function Ye(t) {
|
|
715
|
+
Fe({
|
|
716
|
+
tbodyElement: t.tbodyElement,
|
|
717
|
+
tableElement: t.tableElement,
|
|
718
|
+
emptyElement: t.emptyElement,
|
|
719
|
+
containerElement: t.containerElement,
|
|
720
|
+
dadosExibicao: t.dadosController.getDadosExibicao(),
|
|
721
|
+
colunas: t.colunas,
|
|
722
|
+
chaveId: t.chaveId,
|
|
723
|
+
virtualizar: t.virtualizar,
|
|
724
|
+
rowHeight: t.rowHeight,
|
|
725
|
+
indiceAtivo: t.indiceAtivo,
|
|
726
|
+
filtroAtivo: t.dadosController.temFiltro(),
|
|
727
|
+
textoVazio: t.textoVazio,
|
|
728
|
+
textoSemResultados: t.textoSemResultados,
|
|
729
|
+
isItemSelecionado: (r, e) => t.selecaoController.isItemSelecionado(r, e),
|
|
730
|
+
onLinhaClique: (r, e) => {
|
|
731
|
+
t.selecaoController.setItemSelecionado(r), t.host.dispatchEvent(
|
|
732
732
|
new CustomEvent("ui-linha-clique", {
|
|
733
733
|
bubbles: !0,
|
|
734
734
|
composed: !0,
|
|
735
|
-
detail: { item:
|
|
735
|
+
detail: { item: r, indice: e }
|
|
736
736
|
})
|
|
737
737
|
);
|
|
738
738
|
},
|
|
739
|
-
formatWidth:
|
|
740
|
-
getAlignmentClass:
|
|
741
|
-
getTextAlign:
|
|
739
|
+
formatWidth: ce,
|
|
740
|
+
getAlignmentClass: ue,
|
|
741
|
+
getTextAlign: pe
|
|
742
742
|
});
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Ge(t, r) {
|
|
745
745
|
let e = !1;
|
|
746
|
-
const
|
|
746
|
+
const o = () => {
|
|
747
747
|
e || (window.requestAnimationFrame(() => {
|
|
748
748
|
try {
|
|
749
|
-
|
|
749
|
+
r();
|
|
750
750
|
} finally {
|
|
751
751
|
e = !1;
|
|
752
752
|
}
|
|
753
753
|
}), e = !0);
|
|
754
754
|
};
|
|
755
|
-
return
|
|
756
|
-
}
|
|
757
|
-
function
|
|
758
|
-
return
|
|
759
|
-
}
|
|
760
|
-
function
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const e =
|
|
764
|
-
e !== null &&
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
}
|
|
768
|
-
function
|
|
769
|
-
if (
|
|
770
|
-
|
|
755
|
+
return t.addEventListener("scroll", o), o;
|
|
756
|
+
}
|
|
757
|
+
function Ke(t, r, e, o) {
|
|
758
|
+
return Be(t, r, e, o);
|
|
759
|
+
}
|
|
760
|
+
function he(t) {
|
|
761
|
+
const r = t.host.getAttribute("texto-vazio") || t.host.getAttribute("empty-text");
|
|
762
|
+
r && t.onTextoVazioAlterado(r);
|
|
763
|
+
const e = t.host.getAttribute("virtualizar") || t.host.getAttribute("virtualize");
|
|
764
|
+
e !== null && t.onVirtualizarAlterado(e !== "false"), t.onSrcLido(t.host.getAttribute("src"));
|
|
765
|
+
const o = t.host.hasAttribute("carregando") || t.host.hasAttribute("loading");
|
|
766
|
+
t.onCarregandoAlterado(o), t.loadingElement && (t.loadingElement.style.display = o ? "flex" : "none");
|
|
767
|
+
}
|
|
768
|
+
function Qe(t, r, e) {
|
|
769
|
+
if (he(e), t === "src") {
|
|
770
|
+
r && e.host.isConnected && e.onCarregarSrc(r);
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
|
-
if (
|
|
774
|
-
e.containerElement.style.maxHeight =
|
|
773
|
+
if (t === "max-height" && e.containerElement) {
|
|
774
|
+
e.containerElement.style.maxHeight = r || "";
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
|
-
if ((
|
|
778
|
-
const
|
|
779
|
-
|
|
777
|
+
if ((t === "texto-vazio" || t === "empty-text") && e.emptyElement) {
|
|
778
|
+
const o = e.emptyElement.querySelector(".ui-tabela__empty-text");
|
|
779
|
+
o && r && (o.textContent = r), e.onRenderBody();
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
|
-
if (
|
|
783
|
-
e.loadingElement && (e.loadingElement.style.display =
|
|
782
|
+
if (t === "carregando" || t === "loading") {
|
|
783
|
+
e.loadingElement && (e.loadingElement.style.display = r !== null ? "flex" : "none");
|
|
784
784
|
return;
|
|
785
785
|
}
|
|
786
|
-
if (
|
|
786
|
+
if (t === "densidade" || t === "density") {
|
|
787
787
|
e.onRenderBody();
|
|
788
788
|
return;
|
|
789
789
|
}
|
|
790
790
|
e.onRenderTotal();
|
|
791
791
|
}
|
|
792
|
-
function
|
|
793
|
-
if (
|
|
794
|
-
if (!Number.isInteger(
|
|
795
|
-
const
|
|
796
|
-
switch (
|
|
792
|
+
function Ze(t, r, e, o) {
|
|
793
|
+
if (t === "Enter" || t === " ") return { tipo: "ativar" };
|
|
794
|
+
if (!Number.isInteger(r) || !Number.isInteger(e) || e < 0) return null;
|
|
795
|
+
const i = Math.max(1, Math.floor(Number.isFinite(o) ? o : 1)), a = (n) => Math.min(e, Math.max(0, n));
|
|
796
|
+
switch (t) {
|
|
797
797
|
case "ArrowDown":
|
|
798
|
-
return { tipo: "mover", indice: a(
|
|
798
|
+
return { tipo: "mover", indice: a(r + 1) };
|
|
799
799
|
case "ArrowUp":
|
|
800
|
-
return { tipo: "mover", indice: a(
|
|
800
|
+
return { tipo: "mover", indice: a(r - 1) };
|
|
801
801
|
case "Home":
|
|
802
802
|
return { tipo: "mover", indice: 0 };
|
|
803
803
|
case "End":
|
|
804
804
|
return { tipo: "mover", indice: e };
|
|
805
805
|
case "PageDown":
|
|
806
|
-
return { tipo: "mover", indice: a(
|
|
806
|
+
return { tipo: "mover", indice: a(r + i) };
|
|
807
807
|
case "PageUp":
|
|
808
|
-
return { tipo: "mover", indice: a(
|
|
808
|
+
return { tipo: "mover", indice: a(r - i) };
|
|
809
809
|
default:
|
|
810
810
|
return null;
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
const
|
|
814
|
-
function
|
|
815
|
-
if (!
|
|
816
|
-
if (!
|
|
817
|
-
|
|
813
|
+
const Je = "Não foi possível carregar os dados.", et = "Nenhum resultado para o filtro";
|
|
814
|
+
function tt(t, r, e, o) {
|
|
815
|
+
if (!t) return;
|
|
816
|
+
if (!r) {
|
|
817
|
+
t.style.display = "none";
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
const n =
|
|
823
|
-
n && (n.style.display =
|
|
820
|
+
const i = t.querySelector(".ui-tabela__erro-mensagem"), a = t.querySelector(".ui-tabela__erro-detalhe");
|
|
821
|
+
i && (i.textContent = e || Je), a && (a.textContent = r.erro || "");
|
|
822
|
+
const n = t.querySelector(".ui-tabela__erro-acao");
|
|
823
|
+
n && (n.style.display = o ? "" : "none"), t.style.display = "flex";
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
|
|
825
|
+
function rt(t, r, e, o) {
|
|
826
|
+
t && (t.textContent = e ? r === 0 ? o : `${r} ${r === 1 ? "registro encontrado" : "registros encontrados"}` : "");
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
|
|
828
|
+
function ot({ tabela: t, container: r }, e, o) {
|
|
829
|
+
t && (e ? t.setAttribute("aria-label", e) : t.removeAttribute("aria-label"), t.setAttribute("aria-busy", String(o)), r && (e ? (r.setAttribute("role", "region"), r.setAttribute("aria-label", e)) : (r.removeAttribute("role"), r.removeAttribute("aria-label"))));
|
|
830
830
|
}
|
|
831
|
-
const
|
|
832
|
-
function
|
|
833
|
-
const
|
|
834
|
-
return
|
|
831
|
+
const it = 800;
|
|
832
|
+
function oe(t, r, e) {
|
|
833
|
+
const o = t.getBoundingClientRect(), i = r.getBoundingClientRect(), a = o.top + t.clientTop + e, n = o.top + t.clientTop + t.clientHeight;
|
|
834
|
+
return i.top < a ? i.top - a : i.bottom > n ? Math.min(i.bottom - n, i.top - a) : 0;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
e === "smooth" && typeof
|
|
836
|
+
function ie(t, r, e) {
|
|
837
|
+
e === "smooth" && typeof t.scrollTo == "function" ? t.scrollTo({ top: r, behavior: "smooth" }) : t.scrollTop = r;
|
|
838
838
|
}
|
|
839
|
-
class
|
|
840
|
-
constructor(
|
|
839
|
+
class at {
|
|
840
|
+
constructor(r) {
|
|
841
841
|
b(this, "cancelarCorrecao", null);
|
|
842
|
-
this.p =
|
|
842
|
+
this.p = r;
|
|
843
843
|
}
|
|
844
844
|
alturaCabecalho() {
|
|
845
|
-
var
|
|
846
|
-
return ((
|
|
845
|
+
var r;
|
|
846
|
+
return ((r = this.p.cabecalho()) == null ? void 0 : r.offsetHeight) ?? 0;
|
|
847
847
|
}
|
|
848
848
|
/** Linhas inteiras que cabem na área visível (mínimo 1). */
|
|
849
849
|
linhasPorPagina() {
|
|
850
850
|
var e;
|
|
851
|
-
const
|
|
852
|
-
return Math.max(1, Math.floor(
|
|
851
|
+
const r = (((e = this.p.container()) == null ? void 0 : e.clientHeight) ?? 0) - this.alturaCabecalho();
|
|
852
|
+
return Math.max(1, Math.floor(r / this.p.alturaLinha()));
|
|
853
853
|
}
|
|
854
854
|
/** Foca a linha, renderizando a janela virtual se necessário, e a mantém visível abaixo do cabeçalho fixo. */
|
|
855
|
-
focar(
|
|
856
|
-
const e = this.p.container(),
|
|
857
|
-
if (!e || !
|
|
858
|
-
this.p.aoLinhaAtiva(
|
|
859
|
-
const
|
|
860
|
-
let a =
|
|
861
|
-
if (a || (e.scrollTop = Math.max(0,
|
|
855
|
+
focar(r) {
|
|
856
|
+
const e = this.p.container(), o = this.p.tbody();
|
|
857
|
+
if (!e || !o) return;
|
|
858
|
+
this.p.aoLinhaAtiva(r);
|
|
859
|
+
const i = `tr[data-index="${r}"]`;
|
|
860
|
+
let a = o.querySelector(i);
|
|
861
|
+
if (a || (e.scrollTop = Math.max(0, r * this.p.alturaLinha() - e.clientHeight / 2), this.p.renderizarCorpo(), a = o.querySelector(i)), !a) return;
|
|
862
862
|
a.focus({ preventScroll: !0 });
|
|
863
|
-
const n =
|
|
863
|
+
const n = oe(e, a, this.alturaCabecalho());
|
|
864
864
|
n && (e.scrollTop += n);
|
|
865
865
|
}
|
|
866
866
|
/**
|
|
@@ -869,39 +869,39 @@ class Ze {
|
|
|
869
869
|
* real da linha. No modo suave a correção ocorre ao fim da animação (`scrollend`, com timeout de
|
|
870
870
|
* segurança para navegadores sem o evento ou quando não há rolagem a fazer).
|
|
871
871
|
*/
|
|
872
|
-
posicionar(
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
872
|
+
posicionar(r, e) {
|
|
873
|
+
const o = this.p.container(), i = this.p.tbody();
|
|
874
|
+
if (!o || !i) return !1;
|
|
875
875
|
this.cancelar();
|
|
876
|
-
const a = () =>
|
|
876
|
+
const a = () => i.querySelector(`tr[data-index="${r}"]`), n = (u) => {
|
|
877
877
|
const p = a();
|
|
878
878
|
if (!p) return;
|
|
879
|
-
const h =
|
|
880
|
-
h &&
|
|
879
|
+
const h = oe(o, p, this.alturaCabecalho());
|
|
880
|
+
h && ie(o, o.scrollTop + h, u);
|
|
881
881
|
};
|
|
882
882
|
if (a())
|
|
883
883
|
return n(e), !0;
|
|
884
|
-
const
|
|
885
|
-
|
|
884
|
+
const l = () => {
|
|
885
|
+
o.scrollTop = Math.max(0, r * this.p.alturaLinha()), this.p.renderizarCorpo(), n("auto"), this.p.renderizarCorpo();
|
|
886
886
|
};
|
|
887
887
|
if (e === "auto")
|
|
888
|
-
return
|
|
889
|
-
|
|
888
|
+
return l(), !0;
|
|
889
|
+
ie(o, Math.max(0, r * this.p.alturaLinha()), "smooth");
|
|
890
890
|
let d = !0;
|
|
891
891
|
const c = () => {
|
|
892
|
-
d && (this.cancelar(), this.p.renderizarCorpo(), a() ? n("smooth") :
|
|
893
|
-
},
|
|
894
|
-
return
|
|
895
|
-
d = !1, window.clearTimeout(
|
|
892
|
+
d && (this.cancelar(), this.p.renderizarCorpo(), a() ? n("smooth") : l());
|
|
893
|
+
}, s = window.setTimeout(c, it);
|
|
894
|
+
return o.addEventListener("scrollend", c, { once: !0 }), this.cancelarCorrecao = () => {
|
|
895
|
+
d = !1, window.clearTimeout(s), o.removeEventListener("scrollend", c), this.cancelarCorrecao = null;
|
|
896
896
|
}, !0;
|
|
897
897
|
}
|
|
898
898
|
/** Cancela a correção pendente de uma rolagem suave (nova rolagem, desconexão). */
|
|
899
899
|
cancelar() {
|
|
900
|
-
var
|
|
901
|
-
(
|
|
900
|
+
var r;
|
|
901
|
+
(r = this.cancelarCorrecao) == null || r.call(this);
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
class
|
|
904
|
+
class nt extends de {
|
|
905
905
|
constructor() {
|
|
906
906
|
super();
|
|
907
907
|
b(this, "shadow");
|
|
@@ -926,13 +926,13 @@ class Je extends oe {
|
|
|
926
926
|
b(this, "_erro", null);
|
|
927
927
|
b(this, "_scrollHandler", null);
|
|
928
928
|
b(this, "_activeResizeCleanup", null);
|
|
929
|
-
b(this, "_headerListeners", new
|
|
930
|
-
b(this, "_corpoListeners", new
|
|
929
|
+
b(this, "_headerListeners", new P());
|
|
930
|
+
b(this, "_corpoListeners", new P());
|
|
931
931
|
/** Linha com o foco móvel (navegação por teclado); null = primeira linha visível. */
|
|
932
932
|
b(this, "_indiceAtivo", null);
|
|
933
933
|
/** Altura real das linhas medida no DOM; null = usa a estimativa da densidade. */
|
|
934
934
|
b(this, "_alturaLinhaMedida", null);
|
|
935
|
-
b(this, "rolagem", new
|
|
935
|
+
b(this, "rolagem", new at({
|
|
936
936
|
container: () => this._containerElement,
|
|
937
937
|
tbody: () => this._tbodyElement,
|
|
938
938
|
cabecalho: () => this._theadElement,
|
|
@@ -944,23 +944,23 @@ class Je extends oe {
|
|
|
944
944
|
}));
|
|
945
945
|
b(this, "remotaController");
|
|
946
946
|
b(this, "selecaoController");
|
|
947
|
-
b(this, "dadosController", new
|
|
947
|
+
b(this, "dadosController", new De());
|
|
948
948
|
/** Mantém um único tabindex=0 (foco móvel): Tab entra na tabela pela última linha ativa. */
|
|
949
949
|
b(this, "handleFocoLinha", (e) => {
|
|
950
|
-
const
|
|
951
|
-
|
|
950
|
+
const o = e.target;
|
|
951
|
+
o.parentElement !== this._tbodyElement || !o.hasAttribute("data-index") || this.definirLinhaAtiva(Number(o.getAttribute("data-index")));
|
|
952
952
|
});
|
|
953
953
|
/**
|
|
954
954
|
* Teclado nas linhas: setas, Home/End e PageUp/PageDown movem o foco;
|
|
955
955
|
* Enter/Espaço selecionam a linha (mesmo caminho do clique, emite `ui-linha-clique`).
|
|
956
956
|
*/
|
|
957
957
|
b(this, "handleTecladoCorpo", (e) => {
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
const
|
|
961
|
-
a && (e.preventDefault(), a.tipo === "ativar" ?
|
|
958
|
+
const o = e.target;
|
|
959
|
+
if (o.parentElement !== this._tbodyElement || !o.hasAttribute("data-index")) return;
|
|
960
|
+
const i = this.dadosController.getDadosExibicao().length - 1, a = Ze(e.key, Number(o.getAttribute("data-index")), i, this.rolagem.linhasPorPagina());
|
|
961
|
+
a && (e.preventDefault(), a.tipo === "ativar" ? o.click() : this.rolagem.focar(a.indice));
|
|
962
962
|
});
|
|
963
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new
|
|
963
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new Ce({
|
|
964
964
|
host: this,
|
|
965
965
|
onCarregandoAlterado: (e) => {
|
|
966
966
|
this.carregando = e;
|
|
@@ -970,13 +970,13 @@ class Je extends oe {
|
|
|
970
970
|
},
|
|
971
971
|
getOpcoes: () => this._fetchOpcoes,
|
|
972
972
|
getFetcher: () => this._fetcher
|
|
973
|
-
}), this.selecaoController = new
|
|
973
|
+
}), this.selecaoController = new Se({
|
|
974
974
|
host: this,
|
|
975
975
|
getTbody: () => this._tbodyElement,
|
|
976
976
|
getDadosExibicao: () => this.dadosController.getDadosExibicao(),
|
|
977
977
|
getDadosOriginais: () => this.dadosController.getDadosOriginais(),
|
|
978
978
|
getChaveId: () => this.chaveId,
|
|
979
|
-
onRolarParaIndice: (e,
|
|
979
|
+
onRolarParaIndice: (e, o) => this.rolagem.posicionar(e, o),
|
|
980
980
|
onLinhaAtiva: (e) => this.definirLinhaAtiva(e)
|
|
981
981
|
}), this.addEventListener("ui-fetch-erro", (e) => this.mostrarErro(e.detail)), this.addEventListener("ui-fetch-start", () => this.mostrarErro(null)), this.addEventListener("ui-fetch-sucesso", () => this.mostrarErro(null));
|
|
982
982
|
}
|
|
@@ -989,17 +989,17 @@ class Je extends oe {
|
|
|
989
989
|
disconnectedCallback() {
|
|
990
990
|
this.cleanupEventListeners();
|
|
991
991
|
}
|
|
992
|
-
attributeChangedCallback(e,
|
|
993
|
-
e === "ordenacao-remota" && (this.dadosController.setOrdenacaoRemota(
|
|
992
|
+
attributeChangedCallback(e, o, i) {
|
|
993
|
+
e === "ordenacao-remota" && (this.dadosController.setOrdenacaoRemota(i !== null), this.atualizarContextoSelecao()), (e === "densidade" || e === "density" || e === "altura-linha" || e === "row-height") && (this._alturaLinhaMedida = null), (e === "altura-linha" || e === "row-height") && this.aplicarAlturaLinha(), (e === "chave-id" || e === "id-key") && this.atualizarContextoSelecao(), Qe(e, i, this.obterContextoAtributos()), this.sincronizarAria();
|
|
994
994
|
}
|
|
995
995
|
/** Nome acessível vem do host (`aria-label`); `aria-busy` acompanha o carregamento remoto. */
|
|
996
996
|
sincronizarAria() {
|
|
997
|
-
this._tableElement && (
|
|
997
|
+
this._tableElement && (ot({ tabela: this._tableElement, container: this._containerElement }, this.getAttribute("aria-label"), this._carregando), this.atualizarTextosEstado());
|
|
998
998
|
}
|
|
999
999
|
/** Textos de estado configuráveis por atributo (carregando, sem resultados, erro). */
|
|
1000
1000
|
atualizarTextosEstado() {
|
|
1001
|
-
var
|
|
1002
|
-
const e = (
|
|
1001
|
+
var o;
|
|
1002
|
+
const e = (o = this._loadingElement) == null ? void 0 : o.querySelector(".ui-tabela__loading-texto");
|
|
1003
1003
|
e && (e.textContent = this.getAttribute("texto-carregando") || "Carregando dados..."), this.renderizarErro();
|
|
1004
1004
|
}
|
|
1005
1005
|
/** Mostra (ou oculta, com null) o aviso de erro de carregamento com a ação "Tentar novamente". */
|
|
@@ -1007,11 +1007,11 @@ class Je extends oe {
|
|
|
1007
1007
|
this._erro = e, this.renderizarErro();
|
|
1008
1008
|
}
|
|
1009
1009
|
renderizarErro() {
|
|
1010
|
-
|
|
1010
|
+
tt(this._erroElement, this._erro, this.getAttribute("texto-erro"), !!this._src);
|
|
1011
1011
|
}
|
|
1012
1012
|
/** Anuncia ao leitor de tela o resultado do filtro (a região é limpa sem filtro ativo). */
|
|
1013
1013
|
anunciarResultado() {
|
|
1014
|
-
|
|
1014
|
+
rt(
|
|
1015
1015
|
this._anuncioElement,
|
|
1016
1016
|
this.dadosController.getDadosExibicao().length,
|
|
1017
1017
|
this.dadosController.temFiltro(),
|
|
@@ -1019,10 +1019,10 @@ class Je extends oe {
|
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
_textoSemResultados() {
|
|
1022
|
-
return this.getAttribute("texto-sem-resultados") ||
|
|
1022
|
+
return this.getAttribute("texto-sem-resultados") || et;
|
|
1023
1023
|
}
|
|
1024
1024
|
syncAttributes() {
|
|
1025
|
-
|
|
1025
|
+
he(this.obterContextoAtributos());
|
|
1026
1026
|
}
|
|
1027
1027
|
obterContextoAtributos() {
|
|
1028
1028
|
return {
|
|
@@ -1099,7 +1099,7 @@ class Je extends oe {
|
|
|
1099
1099
|
return this._colunas;
|
|
1100
1100
|
}
|
|
1101
1101
|
set colunas(e) {
|
|
1102
|
-
this._colunas = Array.isArray(e) ? e.filter((
|
|
1102
|
+
this._colunas = Array.isArray(e) ? e.filter((o) => o != null).map((o) => ({ ...o })) : [], this.dadosController.setColunas(this._colunas), this.dadosController.setColunasFiltro(this._colunas.map((o) => o.id)), this._alturaLinhaMedida = null, this.renderTotal();
|
|
1103
1103
|
}
|
|
1104
1104
|
get dados() {
|
|
1105
1105
|
return this.dadosController.getDadosOriginais();
|
|
@@ -1167,16 +1167,16 @@ class Je extends oe {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
handleHeaderClick(e) {
|
|
1169
1169
|
if (!e.ordenavel || this._isResizing) return;
|
|
1170
|
-
const
|
|
1170
|
+
const o = this.dadosController.getColunaOrdenada(), i = this.dadosController.getDirecaoOrdenacao(), a = this.dadosController.alternarOrdenacaoColuna(e);
|
|
1171
1171
|
if (!a) return;
|
|
1172
1172
|
this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
1173
1173
|
const n = new CustomEvent("ui-sort", { detail: a, bubbles: !0, composed: !0, cancelable: !0 });
|
|
1174
|
-
this.dispatchEvent(n), n.defaultPrevented && (this.dadosController.restaurarOrdenacao(
|
|
1174
|
+
this.dispatchEvent(n), n.defaultPrevented && (this.dadosController.restaurarOrdenacao(o, i), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody());
|
|
1175
1175
|
}
|
|
1176
1176
|
/** Altura fixa das linhas em px (`altura-linha`), sobrepõe a densidade; null = vale a densidade. */
|
|
1177
1177
|
get alturaLinha() {
|
|
1178
|
-
const e = this.getAttribute("altura-linha") ?? this.getAttribute("row-height"),
|
|
1179
|
-
return Number.isFinite(
|
|
1178
|
+
const e = this.getAttribute("altura-linha") ?? this.getAttribute("row-height"), o = e === null ? NaN : parseFloat(e);
|
|
1179
|
+
return Number.isFinite(o) && o > 0 ? o : null;
|
|
1180
1180
|
}
|
|
1181
1181
|
set alturaLinha(e) {
|
|
1182
1182
|
e && e > 0 ? this.setAttribute("altura-linha", String(e)) : (this.removeAttribute("altura-linha"), this.removeAttribute("row-height"));
|
|
@@ -1188,7 +1188,7 @@ class Je extends oe {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
/** Altura usada na virtualização: a fixa (`altura-linha`), a medida no DOM ou a estimativa da densidade. */
|
|
1190
1190
|
getRowHeight() {
|
|
1191
|
-
return this.alturaLinha ?? this._alturaLinhaMedida ??
|
|
1191
|
+
return this.alturaLinha ?? this._alturaLinhaMedida ?? te(this.densidade);
|
|
1192
1192
|
}
|
|
1193
1193
|
/**
|
|
1194
1194
|
* Mede a altura real das linhas uma vez por configuração (densidade/colunas): padding, fonte e
|
|
@@ -1199,12 +1199,12 @@ class Je extends oe {
|
|
|
1199
1199
|
if (this._alturaLinhaMedida !== null || !this._tbodyElement) return;
|
|
1200
1200
|
const e = this._tbodyElement.querySelectorAll("tr[data-index]");
|
|
1201
1201
|
if (e.length === 0) return;
|
|
1202
|
-
let
|
|
1202
|
+
let o = 0;
|
|
1203
1203
|
e.forEach((a) => {
|
|
1204
|
-
|
|
1204
|
+
o += a.getBoundingClientRect().height;
|
|
1205
1205
|
});
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1206
|
+
const i = o / e.length;
|
|
1207
|
+
i <= 0 || (this._alturaLinhaMedida = i, Math.abs(i - te(this.densidade)) > 0.5 && this.renderBody());
|
|
1208
1208
|
}
|
|
1209
1209
|
/** Ordenar, filtrar, trocar os dados ou a chave mantém a linha selecionada (se ainda existir). */
|
|
1210
1210
|
atualizarContextoSelecao() {
|
|
@@ -1215,25 +1215,25 @@ class Je extends oe {
|
|
|
1215
1215
|
if (this.shadow) {
|
|
1216
1216
|
if (this._containerElement) {
|
|
1217
1217
|
if (this._containerElement.style.maxHeight = this.getAttribute("max-height") || "", this._emptyElement) {
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1218
|
+
const o = this._emptyElement.querySelector(".ui-tabela__empty-text");
|
|
1219
|
+
o && (o.textContent = this._textoVazio);
|
|
1220
1220
|
}
|
|
1221
1221
|
} else {
|
|
1222
1222
|
this.cleanupEventListeners();
|
|
1223
|
-
const
|
|
1224
|
-
this._containerElement =
|
|
1223
|
+
const o = Ke(this.shadow, this._textoVazio, this.getAttribute("max-height"), this._carregando);
|
|
1224
|
+
this._containerElement = o.containerElement, this._tableElement = o.tableElement, this._colgroupElement = o.colgroupElement, this._theadElement = o.theadElement, this._tbodyElement = o.tbodyElement, this._emptyElement = o.emptyElement, this._loadingElement = o.loadingElement, this._erroElement = o.erroElement, this._anuncioElement = o.anuncioElement, (e = o.erroElement.querySelector(".ui-tabela__erro-acao")) == null || e.addEventListener("click", () => {
|
|
1225
1225
|
this.recarregar();
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
|
-
this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler =
|
|
1228
|
+
this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler = Ge(this._containerElement, () => this.renderBody())), this._tbodyElement && this._corpoListeners.size === 0 && (this._corpoListeners.add(this._tbodyElement, "keydown", this.handleTecladoCorpo), this._corpoListeners.add(this._tbodyElement, "focusin", this.handleFocoLinha)), this.sincronizarAria();
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
definirLinhaAtiva(e) {
|
|
1232
1232
|
this._indiceAtivo = e;
|
|
1233
|
-
const
|
|
1234
|
-
!
|
|
1235
|
-
a !==
|
|
1236
|
-
}),
|
|
1233
|
+
const o = this._tbodyElement, i = o == null ? void 0 : o.querySelector(`tr[data-index="${e}"]`);
|
|
1234
|
+
!o || !i || (o.querySelectorAll('tr[tabindex="0"]').forEach((a) => {
|
|
1235
|
+
a !== i && (a.tabIndex = -1);
|
|
1236
|
+
}), i.tabIndex = 0);
|
|
1237
1237
|
}
|
|
1238
1238
|
obterContextoRenderizador() {
|
|
1239
1239
|
return {
|
|
@@ -1265,102 +1265,102 @@ class Je extends oe {
|
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
1267
|
renderHeader() {
|
|
1268
|
-
|
|
1268
|
+
Xe(this.obterContextoRenderizador());
|
|
1269
1269
|
}
|
|
1270
1270
|
renderBody() {
|
|
1271
|
-
|
|
1271
|
+
Ye(this.obterContextoRenderizador()), this.anunciarResultado(), this.medirAlturaLinha();
|
|
1272
1272
|
}
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Rola até um item e opcionalmente o seleciona. Aceita ID (pela `chave-id`, depois `id`, `_id`,
|
|
1275
1275
|
* `codigo`, `key`), predicado ou índice. Um número é procurado primeiro como ID; use
|
|
1276
1276
|
* `{ porIndice: true }` ou `rolarParaIndice()` para tratá-lo só como índice da linha exibida.
|
|
1277
1277
|
*/
|
|
1278
|
-
rolarPara(e,
|
|
1279
|
-
return this.selecaoController.rolarPara(e,
|
|
1278
|
+
rolarPara(e, o) {
|
|
1279
|
+
return this.selecaoController.rolarPara(e, o);
|
|
1280
1280
|
}
|
|
1281
1281
|
/** Rola até a linha exibida de índice `indice` (posição após ordenação/filtro, base 0). */
|
|
1282
|
-
rolarParaIndice(e,
|
|
1283
|
-
return this.selecaoController.rolarPara(e, { ...
|
|
1282
|
+
rolarParaIndice(e, o) {
|
|
1283
|
+
return this.selecaoController.rolarPara(e, { ...o, porIndice: !0 });
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
|
|
1287
|
-
const
|
|
1288
|
-
function
|
|
1289
|
-
return Math.abs(
|
|
1286
|
+
le("ui-tabela", nt);
|
|
1287
|
+
const L = Math.PI / 180;
|
|
1288
|
+
function M(t) {
|
|
1289
|
+
return Math.abs(t) < 1e-12 ? 0 : Number(t.toPrecision(15));
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1291
|
+
const st = {
|
|
1292
1292
|
sqrt: Math.sqrt,
|
|
1293
1293
|
abs: Math.abs,
|
|
1294
1294
|
round: Math.round,
|
|
1295
1295
|
floor: Math.floor,
|
|
1296
1296
|
ceil: Math.ceil,
|
|
1297
|
-
sin: (
|
|
1298
|
-
cos: (
|
|
1299
|
-
tan: (
|
|
1300
|
-
asin: (
|
|
1301
|
-
acos: (
|
|
1302
|
-
atan: (
|
|
1297
|
+
sin: (t) => M(Math.sin(t * L)),
|
|
1298
|
+
cos: (t) => M(Math.cos(t * L)),
|
|
1299
|
+
tan: (t) => M(Math.tan(t * L)),
|
|
1300
|
+
asin: (t) => M(Math.asin(t) / L),
|
|
1301
|
+
acos: (t) => M(Math.acos(t) / L),
|
|
1302
|
+
atan: (t) => M(Math.atan(t) / L)
|
|
1303
1303
|
};
|
|
1304
|
-
function
|
|
1305
|
-
if (!
|
|
1306
|
-
let
|
|
1307
|
-
if (!
|
|
1308
|
-
|
|
1304
|
+
function ae(t) {
|
|
1305
|
+
if (!t || typeof t != "string") return null;
|
|
1306
|
+
let r = t.trim();
|
|
1307
|
+
if (!r) return null;
|
|
1308
|
+
r = r.replace(/(\d),(\d)/g, "$1.$2").replace(/,/g, "."), r = r.replace(/\bpi\b/gi, String(Math.PI)), r = r.replace(/\be\b/gi, String(Math.E));
|
|
1309
1309
|
let e = 0;
|
|
1310
|
-
function i() {
|
|
1311
|
-
return t[e] || "";
|
|
1312
|
-
}
|
|
1313
1310
|
function o() {
|
|
1314
|
-
return
|
|
1311
|
+
return r[e] || "";
|
|
1312
|
+
}
|
|
1313
|
+
function i() {
|
|
1314
|
+
return r[e++] || "";
|
|
1315
1315
|
}
|
|
1316
1316
|
function a() {
|
|
1317
|
-
for (; e <
|
|
1317
|
+
for (; e < r.length && /\s/.test(r[e]); )
|
|
1318
1318
|
e++;
|
|
1319
1319
|
}
|
|
1320
1320
|
function n() {
|
|
1321
1321
|
a();
|
|
1322
|
-
let
|
|
1323
|
-
for (a(); e <
|
|
1324
|
-
const u =
|
|
1322
|
+
let s = l();
|
|
1323
|
+
for (a(); e < r.length; ) {
|
|
1324
|
+
const u = o();
|
|
1325
1325
|
if (u === "+" || u === "-") {
|
|
1326
|
-
|
|
1327
|
-
const p = e, h =
|
|
1328
|
-
a(),
|
|
1326
|
+
i(), a();
|
|
1327
|
+
const p = e, h = l();
|
|
1328
|
+
a(), r.slice(p, e).includes("%") ? s = u === "+" ? s + s * h : s - s * h : s = u === "+" ? s + h : s - h;
|
|
1329
1329
|
} else
|
|
1330
1330
|
break;
|
|
1331
1331
|
}
|
|
1332
|
-
return
|
|
1332
|
+
return s;
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function l() {
|
|
1335
1335
|
a();
|
|
1336
|
-
let
|
|
1337
|
-
for (a(); e <
|
|
1338
|
-
const u =
|
|
1336
|
+
let s = d();
|
|
1337
|
+
for (a(); e < r.length; ) {
|
|
1338
|
+
const u = o();
|
|
1339
1339
|
if (u === "*" || u === "/" || u === "x" || u === "X") {
|
|
1340
|
-
|
|
1340
|
+
i(), a();
|
|
1341
1341
|
const p = d();
|
|
1342
1342
|
if (u === "/" && p === 0)
|
|
1343
1343
|
throw new Error("Divisão por zero");
|
|
1344
|
-
|
|
1344
|
+
s = u === "/" ? s / p : s * p, a();
|
|
1345
1345
|
} else
|
|
1346
1346
|
break;
|
|
1347
1347
|
}
|
|
1348
|
-
return
|
|
1348
|
+
return s;
|
|
1349
1349
|
}
|
|
1350
1350
|
function d() {
|
|
1351
1351
|
a();
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
|
|
1352
|
+
const s = o();
|
|
1353
|
+
if (s === "+" || s === "-") {
|
|
1354
|
+
i();
|
|
1355
1355
|
const p = d();
|
|
1356
|
-
return
|
|
1356
|
+
return s === "-" ? -p : p;
|
|
1357
1357
|
}
|
|
1358
1358
|
let u = c();
|
|
1359
|
-
if (a(),
|
|
1360
|
-
|
|
1359
|
+
if (a(), o() === "^") {
|
|
1360
|
+
i();
|
|
1361
1361
|
const p = d();
|
|
1362
1362
|
u = Math.pow(u, p);
|
|
1363
|
-
} else if (
|
|
1363
|
+
} else if (r.slice(e, e + 2) === "**") {
|
|
1364
1364
|
e += 2;
|
|
1365
1365
|
const p = d();
|
|
1366
1366
|
u = Math.pow(u, p);
|
|
@@ -1369,227 +1369,287 @@ function ee(r) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
function c() {
|
|
1371
1371
|
a();
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
|
|
1372
|
+
const s = o();
|
|
1373
|
+
if (s === "+" || s === "-") {
|
|
1374
|
+
i();
|
|
1375
1375
|
const h = c();
|
|
1376
|
-
return
|
|
1376
|
+
return s === "-" ? -h : h;
|
|
1377
1377
|
}
|
|
1378
|
-
if (
|
|
1379
|
-
|
|
1378
|
+
if (s === "(") {
|
|
1379
|
+
i();
|
|
1380
1380
|
const h = n();
|
|
1381
|
-
if (a(),
|
|
1382
|
-
return a(),
|
|
1381
|
+
if (a(), i() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1382
|
+
return a(), o() === "%" ? (i(), h / 100) : h;
|
|
1383
1383
|
}
|
|
1384
|
-
const u =
|
|
1384
|
+
const u = r.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);
|
|
1385
1385
|
if (u) {
|
|
1386
|
-
const h =
|
|
1386
|
+
const h = st[u[1].toLowerCase()];
|
|
1387
1387
|
if (!h) throw new Error("Função desconhecida: " + u[1]);
|
|
1388
1388
|
e += u[0].length;
|
|
1389
1389
|
const m = n();
|
|
1390
|
-
if (a(),
|
|
1390
|
+
if (a(), i() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1391
1391
|
const x = h(m);
|
|
1392
|
-
return a(),
|
|
1392
|
+
return a(), o() === "%" ? (i(), x / 100) : x;
|
|
1393
1393
|
}
|
|
1394
|
-
const p =
|
|
1394
|
+
const p = r.slice(e).match(/^([0-9]+(?:\.[0-9]+)?|\.[0-9]+)/);
|
|
1395
1395
|
if (p) {
|
|
1396
1396
|
e += p[0].length;
|
|
1397
1397
|
let h = parseFloat(p[0]);
|
|
1398
|
-
return a(),
|
|
1398
|
+
return a(), o() === "%" && (i(), h = h / 100), h;
|
|
1399
1399
|
}
|
|
1400
|
-
throw new Error("Caractere inválido: " +
|
|
1400
|
+
throw new Error("Caractere inválido: " + s);
|
|
1401
1401
|
}
|
|
1402
1402
|
try {
|
|
1403
|
-
const
|
|
1404
|
-
return a(), e <
|
|
1403
|
+
const s = n();
|
|
1404
|
+
return a(), e < r.length ? null : isFinite(s) ? s : null;
|
|
1405
1405
|
} catch {
|
|
1406
1406
|
return null;
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
|
-
const
|
|
1410
|
-
function
|
|
1411
|
-
if (!
|
|
1412
|
-
const e = String(
|
|
1413
|
-
return Array.from(
|
|
1409
|
+
const lt = '.ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__linha select:not([disabled]), .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__linha .ui-prop__editor-cor-container';
|
|
1410
|
+
function me(t, r) {
|
|
1411
|
+
if (!t) return null;
|
|
1412
|
+
const e = String(r);
|
|
1413
|
+
return Array.from(t.querySelectorAll("[data-prop-id]")).find((o) => o.getAttribute("data-prop-id") === e) ?? null;
|
|
1414
1414
|
}
|
|
1415
|
-
const
|
|
1416
|
-
function
|
|
1417
|
-
|
|
1415
|
+
const be = /* @__PURE__ */ new WeakMap();
|
|
1416
|
+
function z(t, r) {
|
|
1417
|
+
be.set(t, r);
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function ne(t, r, e) {
|
|
1420
1420
|
var a, n;
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1421
|
+
const o = me(t, r), i = (a = o == null ? void 0 : o.querySelector(".ui-prop__col-valor")) == null ? void 0 : a.firstElementChild;
|
|
1422
|
+
i && ((n = be.get(i)) == null || n(e));
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function F(t, r, e = (i, a) => i === String(a), o = (i) => i == null || i === "" ? "—" : String(i)) {
|
|
1425
1425
|
var n;
|
|
1426
|
-
(n =
|
|
1427
|
-
const
|
|
1428
|
-
if (
|
|
1429
|
-
|
|
1426
|
+
(n = t.querySelector("option[data-externa]")) == null || n.remove();
|
|
1427
|
+
const i = Array.from(t.options).find((l) => !l.hasAttribute("data-acao") && e(l.value, r));
|
|
1428
|
+
if (i) {
|
|
1429
|
+
i.selected = !0;
|
|
1430
1430
|
return;
|
|
1431
1431
|
}
|
|
1432
1432
|
const a = document.createElement("option");
|
|
1433
|
-
a.value =
|
|
1433
|
+
a.value = r == null ? "" : String(r), a.textContent = o(r), a.setAttribute("data-externa", ""), a.hidden = !0, t.insertBefore(a, t.firstChild), a.selected = !0;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1435
|
+
function V(t, r) {
|
|
1436
|
+
var o;
|
|
1437
|
+
(o = t.querySelector("option[data-externa]")) == null || o.remove();
|
|
1438
|
+
const e = document.createElement("option");
|
|
1439
|
+
e.value = "", e.textContent = r, e.setAttribute("data-externa", ""), e.setAttribute("data-misto", ""), e.hidden = !0, e.disabled = !0, t.insertBefore(e, t.firstChild), e.selected = !0;
|
|
1440
|
+
}
|
|
1441
|
+
function dt(t, r) {
|
|
1442
|
+
const e = Array.from(t.querySelectorAll(lt)), o = e.indexOf(r);
|
|
1443
|
+
if (o !== -1 && o + 1 < e.length) {
|
|
1444
|
+
const i = e[o + 1];
|
|
1445
|
+
i.focus(), i instanceof HTMLInputElement && i.select();
|
|
1440
1446
|
}
|
|
1441
1447
|
}
|
|
1442
|
-
function
|
|
1448
|
+
function X(t, r) {
|
|
1443
1449
|
var e;
|
|
1444
|
-
|
|
1450
|
+
t.classList.toggle("ui-prop__categoria--aberta", r), (e = t.querySelector(".ui-prop__categoria-header")) == null || e.setAttribute("aria-expanded", String(r));
|
|
1445
1451
|
}
|
|
1446
|
-
function
|
|
1447
|
-
|
|
1452
|
+
function ct(t, r) {
|
|
1453
|
+
r.forEach((e) => e.aberto = !0), t.querySelectorAll(".ui-prop__categoria").forEach((e) => X(e, !0));
|
|
1448
1454
|
}
|
|
1449
|
-
function
|
|
1450
|
-
|
|
1455
|
+
function ut(t, r) {
|
|
1456
|
+
r.forEach((e) => e.aberto = !1), t.querySelectorAll(".ui-prop__categoria").forEach((e) => X(e, !1));
|
|
1451
1457
|
}
|
|
1452
|
-
function
|
|
1453
|
-
const
|
|
1454
|
-
if (
|
|
1455
|
-
|
|
1456
|
-
const a = Array.from(
|
|
1457
|
-
a &&
|
|
1458
|
+
function pt(t, r, e, o) {
|
|
1459
|
+
const i = e.find((a) => a.id === o);
|
|
1460
|
+
if (i) {
|
|
1461
|
+
i.aberto = i.aberto === !1;
|
|
1462
|
+
const a = Array.from(t.querySelectorAll("[data-cat-id]")).find((n) => n.getAttribute("data-cat-id") === o);
|
|
1463
|
+
a && X(a, !!i.aberto), r.dispatchEvent(
|
|
1458
1464
|
new CustomEvent("ui-categoria-toggle", {
|
|
1459
1465
|
bubbles: !0,
|
|
1460
1466
|
composed: !0,
|
|
1461
|
-
detail: { id:
|
|
1467
|
+
detail: { id: o, aberto: i.aberto }
|
|
1462
1468
|
})
|
|
1463
1469
|
);
|
|
1464
1470
|
}
|
|
1465
1471
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1472
|
+
const Y = Symbol.for("ui-tabela-propriedades:misto"), G = "Varia";
|
|
1473
|
+
function A(t) {
|
|
1474
|
+
return t === Y;
|
|
1475
|
+
}
|
|
1476
|
+
function S(t) {
|
|
1477
|
+
var e;
|
|
1478
|
+
let r;
|
|
1479
|
+
try {
|
|
1480
|
+
r = (e = t.obterTextoMisto) == null ? void 0 : e.call(t);
|
|
1481
|
+
} catch {
|
|
1482
|
+
}
|
|
1483
|
+
return typeof r == "string" && r.trim() ? r : G;
|
|
1484
|
+
}
|
|
1485
|
+
function R(t, r) {
|
|
1486
|
+
return t == null && r == null ? !0 : Object.is(t, r);
|
|
1487
|
+
}
|
|
1488
|
+
function j(t) {
|
|
1489
|
+
return t.misto ? Y : t.valor;
|
|
1490
|
+
}
|
|
1491
|
+
function ht(t) {
|
|
1492
|
+
if (!Array.isArray(t) || t.length === 0) return;
|
|
1493
|
+
const r = t[0];
|
|
1494
|
+
for (let e = 1; e < t.length; e++)
|
|
1495
|
+
if (!R(r, t[e])) return Y;
|
|
1496
|
+
return r;
|
|
1497
|
+
}
|
|
1498
|
+
function Ut(t) {
|
|
1499
|
+
if (!Array.isArray(t)) return {};
|
|
1500
|
+
const r = t.filter(
|
|
1501
|
+
(i) => i !== null && typeof i == "object" && !Array.isArray(i)
|
|
1502
|
+
), e = /* @__PURE__ */ new Set();
|
|
1503
|
+
r.forEach((i) => Object.keys(i).forEach((a) => e.add(a)));
|
|
1504
|
+
const o = {};
|
|
1505
|
+
return e.forEach((i) => {
|
|
1506
|
+
o[i] = ht(r.map((a) => i in a ? a[i] : void 0));
|
|
1507
|
+
}), o;
|
|
1508
|
+
}
|
|
1509
|
+
function fe(t, r, e, o) {
|
|
1510
|
+
t.classList.toggle("ui-prop__editor--misto", e), e ? t.placeholder = o : r.placeholder ? t.placeholder = r.placeholder : t.removeAttribute("placeholder");
|
|
1511
|
+
}
|
|
1512
|
+
function mt(t, r) {
|
|
1513
|
+
const e = document.createElement("span"), o = (i) => {
|
|
1514
|
+
if (A(i)) {
|
|
1515
|
+
e.className = "ui-prop__valor-readonly ui-prop__editor--misto", e.textContent = r ? S({ obterTextoMisto: r }) : G;
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
const a = typeof i == "number" || typeof i == "string" && /^-?\d+(\.\d+)?$/.test(i.trim());
|
|
1519
|
+
e.className = `ui-prop__valor-readonly ${a ? "ui-prop__valor-readonly--numero" : ""}`.trim(), e.textContent = i != null ? String(i) : "—";
|
|
1470
1520
|
};
|
|
1471
|
-
return
|
|
1521
|
+
return o(t), z(e, o), e;
|
|
1472
1522
|
}
|
|
1473
|
-
function
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1523
|
+
function bt(t, r, e, o) {
|
|
1524
|
+
const i = document.createElement("label");
|
|
1525
|
+
i.className = "ui-prop__editor-booleano", i.setAttribute("role", "checkbox"), i.tabIndex = 0, i.setAttribute("aria-label", r.rotulo);
|
|
1476
1526
|
const a = document.createElement("div");
|
|
1477
1527
|
a.className = "ui-prop__checkbox-custom";
|
|
1478
1528
|
const n = document.createElement("span");
|
|
1479
1529
|
n.className = "ui-prop__booleano-rotulo";
|
|
1480
|
-
const
|
|
1481
|
-
const
|
|
1482
|
-
a.classList.toggle("ui-prop__checkbox-custom--marcado",
|
|
1530
|
+
const l = (c) => {
|
|
1531
|
+
const s = A(c), u = !s && !!c;
|
|
1532
|
+
i.classList.toggle("ui-prop__editor--misto", s), a.classList.toggle("ui-prop__checkbox-custom--marcado", u), a.classList.toggle("ui-prop__checkbox-custom--misto", s), a.textContent = s ? "–" : u ? "✓" : "", n.textContent = s ? S(o) : u ? "Sim" : "Não", i.setAttribute("aria-checked", s ? "mixed" : String(u));
|
|
1483
1533
|
};
|
|
1484
|
-
|
|
1534
|
+
l(e), z(i, l), i.appendChild(a), i.appendChild(n);
|
|
1485
1535
|
const d = () => {
|
|
1486
|
-
const c =
|
|
1487
|
-
|
|
1536
|
+
const c = o.obterValorAtual(r.id), s = A(c) ? !0 : !c;
|
|
1537
|
+
o.registrarAlteracao(t, r.id, s), l(s);
|
|
1488
1538
|
};
|
|
1489
|
-
return
|
|
1539
|
+
return i.addEventListener("click", (c) => {
|
|
1490
1540
|
c.preventDefault(), d();
|
|
1491
|
-
}),
|
|
1492
|
-
c.key === " " ? (c.preventDefault(), d()) : c.key === "Enter" && (c.preventDefault(),
|
|
1493
|
-
}),
|
|
1494
|
-
}
|
|
1495
|
-
function lt(r, t, e, i) {
|
|
1496
|
-
const o = document.createElement("select");
|
|
1497
|
-
return o.className = "ui-prop__editor-select", o.setAttribute("aria-label", t.rotulo), (t.opcoes || []).forEach((a) => {
|
|
1498
|
-
const n = document.createElement("option");
|
|
1499
|
-
n.value = String(a.id), n.textContent = a.rotulo, o.appendChild(n);
|
|
1500
|
-
}), z(o, e), k(o, (a) => z(o, a)), o.addEventListener("change", () => {
|
|
1501
|
-
const a = (t.opcoes || []).find((n) => String(n.id) === o.value);
|
|
1502
|
-
i.registrarAlteracao(r, t.id, a ? a.id : o.value), z(o, i.obterValorAtual(t.id));
|
|
1503
|
-
}), o.addEventListener("keydown", (a) => {
|
|
1504
|
-
a.key === "Enter" && i.focarProximoEditor(o);
|
|
1505
|
-
}), o;
|
|
1541
|
+
}), i.addEventListener("keydown", (c) => {
|
|
1542
|
+
c.key === " " ? (c.preventDefault(), d()) : c.key === "Enter" && (c.preventDefault(), o.focarProximoEditor(i));
|
|
1543
|
+
}), i;
|
|
1506
1544
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const i = document.createElement("
|
|
1509
|
-
|
|
1510
|
-
|
|
1545
|
+
function ft(t, r, e, o) {
|
|
1546
|
+
const i = document.createElement("select");
|
|
1547
|
+
i.className = "ui-prop__editor-select", i.setAttribute("aria-label", r.rotulo), (r.opcoes || []).forEach((n) => {
|
|
1548
|
+
const l = document.createElement("option");
|
|
1549
|
+
l.value = String(n.id), l.textContent = n.rotulo, i.appendChild(l);
|
|
1550
|
+
});
|
|
1551
|
+
const a = (n) => {
|
|
1552
|
+
i.classList.toggle("ui-prop__editor--misto", A(n)), A(n) ? V(i, S(o)) : F(i, n);
|
|
1553
|
+
};
|
|
1554
|
+
return a(e), z(i, a), i.addEventListener("change", () => {
|
|
1555
|
+
const n = (r.opcoes || []).find((l) => String(l.id) === i.value);
|
|
1556
|
+
o.registrarAlteracao(t, r.id, n ? n.id : i.value), a(o.obterValorAtual(r.id));
|
|
1557
|
+
}), i.addEventListener("keydown", (n) => {
|
|
1558
|
+
n.key === "Enter" && o.focarProximoEditor(i);
|
|
1511
1559
|
}), i;
|
|
1512
1560
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const o = document.createElement("
|
|
1515
|
-
o.type = "
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1561
|
+
function gt(t, r, e) {
|
|
1562
|
+
const o = document.createElement("button");
|
|
1563
|
+
return o.type = "button", o.className = "ui-prop__btn-acao-inline", o.textContent = r.rotuloAcao || "Editar...", o.addEventListener("click", () => {
|
|
1564
|
+
typeof r.onClickAcao == "function" && r.onClickAcao(r), e.despacharEventoAcao(r, t);
|
|
1565
|
+
}), o;
|
|
1566
|
+
}
|
|
1567
|
+
function xt(t, r, e, o) {
|
|
1568
|
+
const i = document.createElement("input");
|
|
1569
|
+
i.type = "text", i.inputMode = "decimal", i.autocomplete = "off", i.spellcheck = !1, i.className = "ui-prop__editor-input ui-prop__editor-input--numero", i.setAttribute("aria-label", r.rotulo), r.placeholder && (i.placeholder = r.placeholder);
|
|
1570
|
+
const a = (d) => {
|
|
1571
|
+
if (d == null || d === "" || A(d)) return "";
|
|
1572
|
+
const c = Number(d);
|
|
1573
|
+
return isNaN(c) ? String(d) : r.casasDecimais !== void 0 ? c.toFixed(r.casasDecimais) : String(c);
|
|
1574
|
+
}, n = (d) => {
|
|
1575
|
+
i.value = a(d), fe(i, r, A(d), S(o));
|
|
1520
1576
|
};
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
}),
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
const s = o.value, d = /[\+\-\*\/\^\%\(\)]/.test(s) && !/^[+-]?[0-9]*\.?[0-9]*$/.test(s.trim());
|
|
1527
|
-
o.classList.toggle("ui-prop__editor-input--calculando", d);
|
|
1577
|
+
n(e), z(i, n), i.addEventListener("focus", () => {
|
|
1578
|
+
i.select();
|
|
1579
|
+
}), i.addEventListener("input", () => {
|
|
1580
|
+
const d = i.value, c = /[\+\-\*\/\^\%\(\)]/.test(d) && !/^[+-]?[0-9]*\.?[0-9]*$/.test(d.trim());
|
|
1581
|
+
i.classList.toggle("ui-prop__editor-input--calculando", c);
|
|
1528
1582
|
});
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
const
|
|
1532
|
-
if (
|
|
1533
|
-
|
|
1583
|
+
const l = () => {
|
|
1584
|
+
i.classList.remove("ui-prop__editor-input--calculando");
|
|
1585
|
+
const d = i.value.trim();
|
|
1586
|
+
if (d === "") {
|
|
1587
|
+
if (A(o.obterValorAtual(r.id))) return;
|
|
1588
|
+
o.registrarAlteracao(t, r.id, null);
|
|
1534
1589
|
return;
|
|
1535
1590
|
}
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1538
|
-
let
|
|
1539
|
-
|
|
1591
|
+
const c = ae(d);
|
|
1592
|
+
if (c !== null && !isNaN(c)) {
|
|
1593
|
+
let s = c;
|
|
1594
|
+
r.casasDecimais !== void 0 && (s = Number(c.toFixed(r.casasDecimais))), o.registrarAlteracao(t, r.id, s), n(s);
|
|
1540
1595
|
} else
|
|
1541
|
-
o.
|
|
1596
|
+
n(o.obterValorAtual(r.id));
|
|
1542
1597
|
};
|
|
1543
|
-
return
|
|
1544
|
-
if (
|
|
1545
|
-
|
|
1546
|
-
else if (
|
|
1547
|
-
|
|
1548
|
-
else if (
|
|
1549
|
-
|
|
1550
|
-
const c =
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
let
|
|
1554
|
-
|
|
1598
|
+
return i.addEventListener("change", l), i.addEventListener("blur", l), i.addEventListener("keydown", (d) => {
|
|
1599
|
+
if (d.key === "Enter")
|
|
1600
|
+
l(), o.focarProximoEditor(i);
|
|
1601
|
+
else if (d.key === "Escape")
|
|
1602
|
+
i.classList.remove("ui-prop__editor-input--calculando"), n(o.obterValorAtual(r.id)), i.blur();
|
|
1603
|
+
else if (d.key === "ArrowUp" || d.key === "ArrowDown") {
|
|
1604
|
+
d.preventDefault();
|
|
1605
|
+
const c = ae(i.value), s = o.obterValorAtual(r.id);
|
|
1606
|
+
if (c === null && A(s)) return;
|
|
1607
|
+
const u = c ?? (Number(s) || 0);
|
|
1608
|
+
let p = r.casasDecimais !== void 0 ? Math.pow(10, -r.casasDecimais) : 1;
|
|
1609
|
+
d.shiftKey ? p *= 10 : d.altKey && r.casasDecimais === void 0 && (p *= 0.1);
|
|
1610
|
+
let h = d.key === "ArrowUp" ? u + p : u - p;
|
|
1611
|
+
r.casasDecimais !== void 0 ? h = Number(h.toFixed(r.casasDecimais)) : h = Math.round(h * 100) / 100, o.registrarAlteracao(t, r.id, h), n(h);
|
|
1555
1612
|
}
|
|
1556
|
-
}),
|
|
1613
|
+
}), i;
|
|
1557
1614
|
}
|
|
1558
|
-
function
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1615
|
+
function _t(t, r, e, o) {
|
|
1616
|
+
const i = document.createElement("input");
|
|
1617
|
+
i.type = "text", i.className = "ui-prop__editor-input", i.setAttribute("aria-label", r.rotulo), r.placeholder && (i.placeholder = r.placeholder);
|
|
1618
|
+
const a = (l) => {
|
|
1619
|
+
const d = A(l);
|
|
1620
|
+
i.value = d || l == null ? "" : String(l), fe(i, r, d, S(o));
|
|
1621
|
+
};
|
|
1622
|
+
a(e), z(i, a), i.addEventListener("focus", () => {
|
|
1623
|
+
i.select();
|
|
1564
1624
|
});
|
|
1565
|
-
const
|
|
1566
|
-
i.registrarAlteracao(
|
|
1625
|
+
const n = () => {
|
|
1626
|
+
i.value === "" && A(o.obterValorAtual(r.id)) || (o.registrarAlteracao(t, r.id, i.value), a(o.obterValorAtual(r.id)));
|
|
1567
1627
|
};
|
|
1568
|
-
return
|
|
1569
|
-
|
|
1570
|
-
}),
|
|
1628
|
+
return i.addEventListener("change", n), i.addEventListener("keydown", (l) => {
|
|
1629
|
+
l.key === "Enter" ? (n(), o.focarProximoEditor(i)) : l.key === "Escape" && (a(o.obterValorAtual(r.id)), i.blur());
|
|
1630
|
+
}), i;
|
|
1571
1631
|
}
|
|
1572
|
-
const
|
|
1573
|
-
function
|
|
1574
|
-
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1632
|
+
const ge = (t, r) => t.toLowerCase() === String(r ?? "").toLowerCase();
|
|
1633
|
+
function K(t, r) {
|
|
1634
|
+
r.forEach((e) => {
|
|
1635
|
+
const o = document.createElement("option");
|
|
1636
|
+
o.value = String(e.id), o.textContent = e.rotulo, t.appendChild(o);
|
|
1577
1637
|
});
|
|
1578
1638
|
}
|
|
1579
|
-
function
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1639
|
+
function vt(t, r, e, o) {
|
|
1640
|
+
const i = document.createElement("div");
|
|
1641
|
+
i.className = "ui-prop__editor-linha-container";
|
|
1582
1642
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1583
1643
|
a.setAttribute("class", "ui-prop__linha-amostra-svg"), a.setAttribute("viewBox", "0 0 44 12");
|
|
1584
1644
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1585
1645
|
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "44"), n.setAttribute("y2", "6");
|
|
1586
|
-
const
|
|
1587
|
-
const u = String(
|
|
1646
|
+
const l = (s) => {
|
|
1647
|
+
const u = String(s || "").toLowerCase();
|
|
1588
1648
|
u.includes("center") || u.includes("eixo") || u.includes("dashdot") || u.includes("traço-ponto") ? n.setAttribute("stroke-dasharray", "8,3,2,3") : u.includes("dash") || u.includes("tracej") || u.includes("hidden") ? n.setAttribute("stroke-dasharray", "6,3") : u.includes("dot") || u.includes("ponto") || u.includes("pontilh") ? n.setAttribute("stroke-dasharray", "2,3") : n.setAttribute("stroke-dasharray", "none");
|
|
1589
1649
|
};
|
|
1590
1650
|
a.appendChild(n);
|
|
1591
1651
|
const d = document.createElement("select");
|
|
1592
|
-
d.className = "ui-prop__linha-select", d.setAttribute("aria-label",
|
|
1652
|
+
d.className = "ui-prop__linha-select", d.setAttribute("aria-label", r.rotulo), K(d, r.opcoes && r.opcoes.length > 0 ? r.opcoes : [
|
|
1593
1653
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1594
1654
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1595
1655
|
{ id: "Continuous", rotulo: "Continuous" },
|
|
@@ -1598,29 +1658,34 @@ function pt(r, t, e, i) {
|
|
|
1598
1658
|
{ id: "Center", rotulo: "Center" },
|
|
1599
1659
|
{ id: "Dotted", rotulo: "Dotted" }
|
|
1600
1660
|
]);
|
|
1601
|
-
const c = (
|
|
1602
|
-
|
|
1661
|
+
const c = (s) => {
|
|
1662
|
+
const u = A(s);
|
|
1663
|
+
if (i.classList.toggle("ui-prop__editor--misto", u), u) {
|
|
1664
|
+
l(""), V(d, S(o));
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
l(s), F(d, s, ge);
|
|
1603
1668
|
};
|
|
1604
|
-
return c(e),
|
|
1605
|
-
|
|
1606
|
-
}), d.addEventListener("keydown", (
|
|
1607
|
-
|
|
1608
|
-
}),
|
|
1669
|
+
return c(e), z(i, c), d.addEventListener("change", () => {
|
|
1670
|
+
o.registrarAlteracao(t, r.id, d.value), c(d.value);
|
|
1671
|
+
}), d.addEventListener("keydown", (s) => {
|
|
1672
|
+
s.key === "Enter" && o.focarProximoEditor(d);
|
|
1673
|
+
}), i.appendChild(a), i.appendChild(d), i;
|
|
1609
1674
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1675
|
+
function Et(t, r, e, o) {
|
|
1676
|
+
const i = document.createElement("div");
|
|
1677
|
+
i.className = "ui-prop__editor-espessura-container";
|
|
1613
1678
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1614
1679
|
a.setAttribute("class", "ui-prop__espessura-amostra-svg"), a.setAttribute("viewBox", "0 0 38 12");
|
|
1615
1680
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1616
1681
|
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "38"), n.setAttribute("y2", "6");
|
|
1617
|
-
const
|
|
1618
|
-
const u = parseFloat(String(
|
|
1682
|
+
const l = (s) => {
|
|
1683
|
+
const u = parseFloat(String(s).replace(/[^0-9.]/g, ""));
|
|
1619
1684
|
return isNaN(u) || u <= 0 ? 1.5 : Math.min(8, Math.max(1, u * 8));
|
|
1620
1685
|
};
|
|
1621
1686
|
a.appendChild(n);
|
|
1622
1687
|
const d = document.createElement("select");
|
|
1623
|
-
d.className = "ui-prop__espessura-select", d.setAttribute("aria-label",
|
|
1688
|
+
d.className = "ui-prop__espessura-select", d.setAttribute("aria-label", r.rotulo), K(d, r.opcoes && r.opcoes.length > 0 ? r.opcoes : [
|
|
1624
1689
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1625
1690
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1626
1691
|
{ id: "0.00 mm", rotulo: "0.00 mm" },
|
|
@@ -1641,16 +1706,17 @@ function ht(r, t, e, i) {
|
|
|
1641
1706
|
{ id: "1.40 mm", rotulo: "1.40 mm" },
|
|
1642
1707
|
{ id: "2.00 mm", rotulo: "2.00 mm" }
|
|
1643
1708
|
]);
|
|
1644
|
-
const c = (
|
|
1645
|
-
|
|
1709
|
+
const c = (s) => {
|
|
1710
|
+
const u = A(s);
|
|
1711
|
+
i.classList.toggle("ui-prop__editor--misto", u), n.setAttribute("stroke-width", String(l(u ? "" : s))), u ? V(d, S(o)) : F(d, s, ge);
|
|
1646
1712
|
};
|
|
1647
|
-
return c(e),
|
|
1648
|
-
|
|
1649
|
-
}), d.addEventListener("keydown", (
|
|
1650
|
-
|
|
1651
|
-
}),
|
|
1713
|
+
return c(e), z(i, c), d.addEventListener("change", () => {
|
|
1714
|
+
o.registrarAlteracao(t, r.id, d.value), c(d.value);
|
|
1715
|
+
}), d.addEventListener("keydown", (s) => {
|
|
1716
|
+
s.key === "Enter" && o.focarProximoEditor(d);
|
|
1717
|
+
}), i.appendChild(a), i.appendChild(d), i;
|
|
1652
1718
|
}
|
|
1653
|
-
const
|
|
1719
|
+
const Q = [
|
|
1654
1720
|
{ nome: "Red", indice: 1, hex: "#ff0000" },
|
|
1655
1721
|
{ nome: "Yellow", indice: 2, hex: "#ffff00" },
|
|
1656
1722
|
{ nome: "Green", indice: 3, hex: "#00ff00" },
|
|
@@ -1658,97 +1724,108 @@ const W = [
|
|
|
1658
1724
|
{ nome: "Blue", indice: 5, hex: "#0000ff" },
|
|
1659
1725
|
{ nome: "Magenta", indice: 6, hex: "#ff00ff" },
|
|
1660
1726
|
{ nome: "White", indice: 7, hex: "#ffffff" }
|
|
1661
|
-
],
|
|
1662
|
-
function
|
|
1663
|
-
const
|
|
1664
|
-
return e ? e.nome.toLowerCase() :
|
|
1727
|
+
], xe = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1728
|
+
function U(t) {
|
|
1729
|
+
const r = String(t ?? "").trim().toLowerCase(), e = Q.find((o) => String(o.indice) === r || o.nome.toLowerCase() === r);
|
|
1730
|
+
return e ? e.nome.toLowerCase() : r;
|
|
1665
1731
|
}
|
|
1666
|
-
function
|
|
1667
|
-
const
|
|
1668
|
-
return e ? e.hex :
|
|
1732
|
+
function yt(t) {
|
|
1733
|
+
const r = U(t), e = Q.find((o) => o.nome.toLowerCase() === r);
|
|
1734
|
+
return e ? e.hex : xe.test(r) ? r : "#ffffff";
|
|
1669
1735
|
}
|
|
1670
|
-
function
|
|
1671
|
-
return
|
|
1736
|
+
function _e(t) {
|
|
1737
|
+
return t.length === 4 ? "#" + t.slice(1).split("").map((r) => r + r).join("") : t;
|
|
1672
1738
|
}
|
|
1673
|
-
function
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1739
|
+
function wt(t, r, e, o) {
|
|
1740
|
+
const i = document.createElement("div");
|
|
1741
|
+
i.className = "ui-prop__editor-cor-cad-container";
|
|
1676
1742
|
const a = document.createElement("div");
|
|
1677
1743
|
a.className = "ui-prop__cor-amostra";
|
|
1678
1744
|
const n = document.createElement("select");
|
|
1679
|
-
n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label",
|
|
1745
|
+
n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label", r.rotulo), K(n, [
|
|
1680
1746
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1681
1747
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1682
|
-
...
|
|
1748
|
+
...Q.map((s) => ({ id: s.nome, rotulo: `${s.nome} (${s.indice})` }))
|
|
1683
1749
|
]);
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1750
|
+
const l = document.createElement("option");
|
|
1751
|
+
l.value = "__escolher", l.textContent = "Selecionar cor...", l.setAttribute("data-acao", ""), n.appendChild(l);
|
|
1686
1752
|
const d = document.createElement("input");
|
|
1687
1753
|
d.type = "color", d.className = "ui-prop__cor-picker-oculto", d.tabIndex = -1;
|
|
1688
|
-
const c = (
|
|
1689
|
-
const u =
|
|
1690
|
-
|
|
1754
|
+
const c = (s) => {
|
|
1755
|
+
const u = A(s);
|
|
1756
|
+
if (i.classList.toggle("ui-prop__editor--misto", u), a.classList.toggle("ui-prop__cor-amostra--misto", u), u) {
|
|
1757
|
+
a.style.backgroundColor = "", d.value = "#ffffff", V(n, S(o));
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
const p = yt(s);
|
|
1761
|
+
a.style.backgroundColor = p, d.value = _e(p), F(
|
|
1691
1762
|
n,
|
|
1692
|
-
|
|
1693
|
-
(
|
|
1694
|
-
(
|
|
1763
|
+
s,
|
|
1764
|
+
(h, m) => U(h) === U(m),
|
|
1765
|
+
(h) => h == null || h === "" ? "—" : String(h)
|
|
1695
1766
|
);
|
|
1696
1767
|
};
|
|
1697
|
-
return c(e),
|
|
1768
|
+
return c(e), z(i, c), d.addEventListener("input", () => {
|
|
1698
1769
|
a.style.backgroundColor = d.value;
|
|
1699
1770
|
}), d.addEventListener("change", () => {
|
|
1700
|
-
|
|
1771
|
+
o.registrarAlteracao(t, r.id, d.value), c(o.obterValorAtual(r.id));
|
|
1701
1772
|
}), n.addEventListener("change", () => {
|
|
1702
1773
|
if (n.value === "__escolher") {
|
|
1703
|
-
c(
|
|
1774
|
+
c(o.obterValorAtual(r.id)), d.click();
|
|
1704
1775
|
return;
|
|
1705
1776
|
}
|
|
1706
|
-
|
|
1707
|
-
}), n.addEventListener("keydown", (
|
|
1708
|
-
|
|
1709
|
-
}),
|
|
1777
|
+
o.registrarAlteracao(t, r.id, n.value), c(o.obterValorAtual(r.id));
|
|
1778
|
+
}), n.addEventListener("keydown", (s) => {
|
|
1779
|
+
s.key === "Enter" && o.focarProximoEditor(n);
|
|
1780
|
+
}), i.appendChild(a), i.appendChild(n), i.appendChild(d), i;
|
|
1710
1781
|
}
|
|
1711
|
-
function
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1782
|
+
function Ct(t, r, e, o) {
|
|
1783
|
+
const i = document.createElement("div");
|
|
1784
|
+
i.className = "ui-prop__editor-cor-container", i.setAttribute("role", "button"), i.tabIndex = 0;
|
|
1714
1785
|
const a = document.createElement("div");
|
|
1715
1786
|
a.className = "ui-prop__cor-amostra";
|
|
1716
1787
|
const n = document.createElement("span");
|
|
1717
1788
|
n.className = "ui-prop__cor-texto";
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1789
|
+
const l = document.createElement("input");
|
|
1790
|
+
l.type = "color", l.className = "ui-prop__cor-picker-oculto", l.tabIndex = -1;
|
|
1720
1791
|
const d = (c) => {
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1792
|
+
const s = A(c);
|
|
1793
|
+
if (i.classList.toggle("ui-prop__editor--misto", s), a.classList.toggle("ui-prop__cor-amostra--misto", s), s) {
|
|
1794
|
+
const p = S(o);
|
|
1795
|
+
a.style.backgroundColor = "", n.textContent = p, l.value = "#ffffff", i.setAttribute("aria-label", `${r.rotulo}: ${p}`);
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
const u = typeof c == "string" && xe.test(c) ? _e(c) : null;
|
|
1799
|
+
a.style.backgroundColor = c || "#ffffff", n.textContent = r.textoAmostra || String(c || "ByLayer"), l.value = u ?? "#ffffff", i.setAttribute("aria-label", `${r.rotulo}: ${c || "ByLayer"}`);
|
|
1723
1800
|
};
|
|
1724
|
-
return d(e),
|
|
1725
|
-
a.style.backgroundColor =
|
|
1726
|
-
}),
|
|
1727
|
-
|
|
1728
|
-
}),
|
|
1729
|
-
c.target !==
|
|
1730
|
-
}),
|
|
1731
|
-
(c.key === " " || c.key === "Enter") && (c.preventDefault(),
|
|
1732
|
-
}),
|
|
1733
|
-
}
|
|
1734
|
-
function
|
|
1735
|
-
return
|
|
1736
|
-
}
|
|
1737
|
-
function
|
|
1738
|
-
if (!
|
|
1739
|
-
if (!
|
|
1740
|
-
|
|
1801
|
+
return d(e), z(i, d), l.addEventListener("input", () => {
|
|
1802
|
+
a.style.backgroundColor = l.value, n.textContent = r.textoAmostra || l.value;
|
|
1803
|
+
}), l.addEventListener("change", () => {
|
|
1804
|
+
o.registrarAlteracao(t, r.id, l.value), d(o.obterValorAtual(r.id));
|
|
1805
|
+
}), i.addEventListener("click", (c) => {
|
|
1806
|
+
c.target !== l && l.click();
|
|
1807
|
+
}), i.addEventListener("keydown", (c) => {
|
|
1808
|
+
(c.key === " " || c.key === "Enter") && (c.preventDefault(), l.click());
|
|
1809
|
+
}), i.appendChild(a), i.appendChild(n), i.appendChild(l), i;
|
|
1810
|
+
}
|
|
1811
|
+
function At(t, r, e, o) {
|
|
1812
|
+
return r.somenteLeitura || r.tipo === "readonly" ? mt(e, o.obterTextoMisto) : r.tipo === "booleano" ? bt(t, r, e, o) : r.tipo === "linha" || r.tipo === "linetype" ? vt(t, r, e, o) : r.tipo === "espessura" || r.tipo === "lineweight" ? Et(t, r, e, o) : r.tipo === "cor-cad" ? wt(t, r, e, o) : r.tipo === "selecao" ? ft(t, r, e, o) : r.tipo === "cor" ? Ct(t, r, e, o) : r.tipo === "acao" ? gt(t, r, o) : r.tipo === "numero" ? xt(t, r, e, o) : _t(t, r, e, o);
|
|
1813
|
+
}
|
|
1814
|
+
function kt(t) {
|
|
1815
|
+
if (!t.tipoContainerElement) return;
|
|
1816
|
+
if (!t.tipos || t.tipos.length === 0) {
|
|
1817
|
+
t.tipoContainerElement.style.display = "none";
|
|
1741
1818
|
return;
|
|
1742
1819
|
}
|
|
1743
|
-
|
|
1744
|
-
const
|
|
1745
|
-
if (
|
|
1820
|
+
t.tipoContainerElement.style.display = "flex", t.tipoContainerElement.innerHTML = "";
|
|
1821
|
+
const r = t.tipos.find((e) => String(e.id) === String(t.tipoSelecionadoId)) || t.tipos[0];
|
|
1822
|
+
if (t.estiloVisual === "revit") {
|
|
1746
1823
|
const e = document.createElement("div");
|
|
1747
1824
|
e.className = "ui-prop__tipo-revit-card";
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1825
|
+
const o = document.createElement("div");
|
|
1826
|
+
o.className = "ui-prop__tipo-miniatura";
|
|
1827
|
+
const i = r.iconeSvg ? we(r.iconeSvg) : null;
|
|
1828
|
+
i ? o.appendChild(i) : o.innerHTML = `
|
|
1752
1829
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1753
1830
|
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
|
1754
1831
|
<path d="M3 9h18M9 21V9"></path>
|
|
@@ -1757,47 +1834,47 @@ function xt(r) {
|
|
|
1757
1834
|
const a = document.createElement("div");
|
|
1758
1835
|
a.className = "ui-prop__tipo-info";
|
|
1759
1836
|
const n = document.createElement("div");
|
|
1760
|
-
n.className = "ui-prop__tipo-nome", n.textContent =
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1837
|
+
n.className = "ui-prop__tipo-nome", n.textContent = r.rotulo;
|
|
1838
|
+
const l = document.createElement("div");
|
|
1839
|
+
l.className = "ui-prop__tipo-subtexto", l.textContent = r.subtipo || "Tipo de Família", a.appendChild(n), a.appendChild(l), e.appendChild(o), e.appendChild(a);
|
|
1763
1840
|
const d = document.createElement("div");
|
|
1764
1841
|
d.className = "ui-prop__tipo-revit-subbarra";
|
|
1765
1842
|
const c = document.createElement("select");
|
|
1766
|
-
c.className = "ui-prop__tipo-select",
|
|
1843
|
+
c.className = "ui-prop__tipo-select", t.tipos.forEach((u) => {
|
|
1767
1844
|
const p = document.createElement("option");
|
|
1768
|
-
p.value = u.id, p.textContent = `${u.rotulo}${u.subtipo ? ` : ${u.subtipo}` : ""}`, String(u.id) === String(
|
|
1845
|
+
p.value = u.id, p.textContent = `${u.rotulo}${u.subtipo ? ` : ${u.subtipo}` : ""}`, String(u.id) === String(t.tipoSelecionadoId) && (p.selected = !0), c.appendChild(p);
|
|
1769
1846
|
}), c.addEventListener("change", () => {
|
|
1770
|
-
|
|
1847
|
+
t.onSelecionarTipo(c.value);
|
|
1771
1848
|
});
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1849
|
+
const s = document.createElement("button");
|
|
1850
|
+
s.type = "button", s.className = "ui-prop__btn-editar-tipo", s.innerHTML = `
|
|
1774
1851
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;">
|
|
1775
1852
|
<rect x="3" y="3" width="12" height="12" rx="1"></rect>
|
|
1776
1853
|
<rect x="9" y="9" width="12" height="12" rx="1"></rect>
|
|
1777
1854
|
</svg>
|
|
1778
1855
|
<span>Editar tipo</span>
|
|
1779
|
-
`,
|
|
1780
|
-
|
|
1781
|
-
}), d.appendChild(c), d.appendChild(
|
|
1856
|
+
`, s.addEventListener("click", () => {
|
|
1857
|
+
t.onEditarTipo(r);
|
|
1858
|
+
}), d.appendChild(c), d.appendChild(s), t.tipoContainerElement.appendChild(e), t.tipoContainerElement.appendChild(d);
|
|
1782
1859
|
} else {
|
|
1783
1860
|
const e = document.createElement("div");
|
|
1784
1861
|
e.className = "ui-prop__tipo-autocad-bar";
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1862
|
+
const o = document.createElement("select");
|
|
1863
|
+
o.className = "ui-prop__tipo-select", t.tipos.forEach((d) => {
|
|
1787
1864
|
const c = document.createElement("option");
|
|
1788
|
-
c.value = d.id, c.textContent = d.rotulo, String(d.id) === String(
|
|
1789
|
-
}),
|
|
1790
|
-
|
|
1865
|
+
c.value = d.id, c.textContent = d.rotulo, String(d.id) === String(t.tipoSelecionadoId) && (c.selected = !0), o.appendChild(c);
|
|
1866
|
+
}), o.addEventListener("change", () => {
|
|
1867
|
+
t.onSelecionarTipo(o.value);
|
|
1791
1868
|
});
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1869
|
+
const i = document.createElement("div");
|
|
1870
|
+
i.className = "ui-prop__tipo-autocad-acoes";
|
|
1794
1871
|
const a = document.createElement("button");
|
|
1795
1872
|
a.type = "button", a.className = "ui-prop__btn-autocad", a.title = "Seleção rápida", a.setAttribute("aria-label", "Seleção rápida"), a.innerHTML = `
|
|
1796
1873
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1797
1874
|
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
|
|
1798
1875
|
</svg>
|
|
1799
1876
|
`, a.addEventListener("click", () => {
|
|
1800
|
-
|
|
1877
|
+
t.onQuickSelect(r);
|
|
1801
1878
|
});
|
|
1802
1879
|
const n = document.createElement("button");
|
|
1803
1880
|
n.type = "button", n.className = "ui-prop__btn-autocad", n.title = "Selecionar objetos", n.setAttribute("aria-label", "Selecionar objetos"), n.innerHTML = `
|
|
@@ -1811,10 +1888,10 @@ function xt(r) {
|
|
|
1811
1888
|
<line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
|
|
1812
1889
|
</svg>
|
|
1813
1890
|
`, n.addEventListener("click", () => {
|
|
1814
|
-
|
|
1891
|
+
t.onSelectObjects(r);
|
|
1815
1892
|
});
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1893
|
+
const l = document.createElement("button");
|
|
1894
|
+
l.type = "button", l.className = "ui-prop__btn-autocad", l.title = "Calculadora rápida", l.setAttribute("aria-label", "Calculadora rápida"), l.innerHTML = `
|
|
1818
1895
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1819
1896
|
<rect x="4" y="2" width="16" height="20" rx="2"></rect>
|
|
1820
1897
|
<line x1="8" y1="6" x2="16" y2="6"></line>
|
|
@@ -1825,55 +1902,55 @@ function xt(r) {
|
|
|
1825
1902
|
<circle cx="12" cy="15" r="1" fill="currentColor"></circle>
|
|
1826
1903
|
<circle cx="16" cy="15" r="1" fill="currentColor"></circle>
|
|
1827
1904
|
</svg>
|
|
1828
|
-
`,
|
|
1829
|
-
|
|
1830
|
-
}),
|
|
1905
|
+
`, l.addEventListener("click", () => {
|
|
1906
|
+
t.onCalculadora(r);
|
|
1907
|
+
}), i.appendChild(a), i.appendChild(n), i.appendChild(l), e.appendChild(o), e.appendChild(i), t.tipoContainerElement.appendChild(e);
|
|
1831
1908
|
}
|
|
1832
1909
|
}
|
|
1833
|
-
function
|
|
1834
|
-
let
|
|
1835
|
-
function e(
|
|
1836
|
-
const a = Math.max(20, Math.min(65,
|
|
1837
|
-
return
|
|
1910
|
+
function zt(t) {
|
|
1911
|
+
let r = 45;
|
|
1912
|
+
function e(i) {
|
|
1913
|
+
const a = Math.max(20, Math.min(65, i));
|
|
1914
|
+
return r = a, t.hostElement.style.setProperty("--ui-prop-rotulo-largura", `${a}%`), t.splitterElement && (t.splitterElement.style.left = `calc(${a}% - 4px)`), a;
|
|
1838
1915
|
}
|
|
1839
|
-
function
|
|
1840
|
-
if (!
|
|
1841
|
-
|
|
1842
|
-
let
|
|
1916
|
+
function o() {
|
|
1917
|
+
if (!t.splitterElement || !t.corpoElement) return;
|
|
1918
|
+
t.splitterListeners.cleanup();
|
|
1919
|
+
let i = !1;
|
|
1843
1920
|
const a = (n) => {
|
|
1844
1921
|
if (n.button !== 0) return;
|
|
1845
|
-
n.preventDefault(), n.stopPropagation(),
|
|
1922
|
+
n.preventDefault(), n.stopPropagation(), i = !0, t.splitterElement.classList.add("ui-prop__splitter--ativo");
|
|
1846
1923
|
try {
|
|
1847
|
-
|
|
1924
|
+
t.splitterElement.setPointerCapture(n.pointerId);
|
|
1848
1925
|
} catch {
|
|
1849
1926
|
}
|
|
1850
|
-
const
|
|
1851
|
-
if (!
|
|
1852
|
-
const u =
|
|
1927
|
+
const l = t.corpoElement.getBoundingClientRect(), d = (s) => {
|
|
1928
|
+
if (!i) return;
|
|
1929
|
+
const u = l.width;
|
|
1853
1930
|
if (u <= 0) return;
|
|
1854
|
-
const p =
|
|
1931
|
+
const p = s.clientX - l.left;
|
|
1855
1932
|
let f = Math.max(80, Math.min(u - 130, p)) / u * 100;
|
|
1856
1933
|
f = Math.max(20, Math.min(65, f)), e(f);
|
|
1857
|
-
}, c = (
|
|
1858
|
-
if (
|
|
1859
|
-
|
|
1934
|
+
}, c = (s) => {
|
|
1935
|
+
if (i) {
|
|
1936
|
+
i = !1, t.splitterElement.classList.remove("ui-prop__splitter--ativo");
|
|
1860
1937
|
try {
|
|
1861
|
-
|
|
1938
|
+
t.splitterElement.hasPointerCapture(s.pointerId) && t.splitterElement.releasePointerCapture(s.pointerId);
|
|
1862
1939
|
} catch {
|
|
1863
1940
|
}
|
|
1864
|
-
|
|
1941
|
+
t.splitterElement.removeEventListener("pointermove", d), t.splitterElement.removeEventListener("pointerup", c), t.splitterElement.removeEventListener("pointercancel", c), t.onLarguraAlterada(r), t.hostElement.dispatchEvent(
|
|
1865
1942
|
new CustomEvent("ui-splitter-resize", {
|
|
1866
1943
|
bubbles: !0,
|
|
1867
1944
|
composed: !0,
|
|
1868
|
-
detail: { larguraPorcentagem:
|
|
1945
|
+
detail: { larguraPorcentagem: r }
|
|
1869
1946
|
})
|
|
1870
1947
|
);
|
|
1871
1948
|
}
|
|
1872
1949
|
};
|
|
1873
|
-
|
|
1950
|
+
t.splitterElement.addEventListener("pointermove", d), t.splitterElement.addEventListener("pointerup", c), t.splitterElement.addEventListener("pointercancel", c);
|
|
1874
1951
|
};
|
|
1875
|
-
|
|
1876
|
-
e(45),
|
|
1952
|
+
t.splitterListeners.add(t.splitterElement, "pointerdown", a), t.splitterListeners.add(t.splitterElement, "dblclick", () => {
|
|
1953
|
+
e(45), t.onLarguraAlterada(45), t.hostElement.dispatchEvent(
|
|
1877
1954
|
new CustomEvent("ui-splitter-resize", {
|
|
1878
1955
|
bubbles: !0,
|
|
1879
1956
|
composed: !0,
|
|
@@ -1883,14 +1960,14 @@ function vt(r) {
|
|
|
1883
1960
|
});
|
|
1884
1961
|
}
|
|
1885
1962
|
return {
|
|
1886
|
-
init:
|
|
1963
|
+
init: o,
|
|
1887
1964
|
definirLarguraRotulo: e
|
|
1888
1965
|
};
|
|
1889
1966
|
}
|
|
1890
|
-
const _t = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:#000;border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:#fff}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:#000!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:#000!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:#000}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:#000;border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}`;
|
|
1891
|
-
function
|
|
1967
|
+
const St = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:#000;border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:#fff}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:#000!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:#000!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:#000}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:#000;border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}.ui-prop__editor--misto,.ui-prop__editor--misto .ui-prop__booleano-rotulo,.ui-prop__editor--misto .ui-prop__cor-texto,.ui-prop__editor--misto select,select.ui-prop__editor--misto{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab))}.ui-prop__editor-input.ui-prop__editor--misto::placeholder{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));opacity:1}.ui-prop__editor--misto option:not([data-misto]),select.ui-prop__editor--misto option:not([data-misto]){font-style:normal;color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor--misto svg{opacity:.35}.ui-prop__checkbox-custom--misto{border-color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));font-style:normal}.ui-prop__cor-amostra--misto{background:linear-gradient(to top right,transparent calc(50% - 1px),var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab)) 50%,transparent calc(50% + 1px))}`;
|
|
1968
|
+
function Lt() {
|
|
1892
1969
|
return `
|
|
1893
|
-
<style>${
|
|
1970
|
+
<style>${St}</style>
|
|
1894
1971
|
<div class="ui-prop__container" id="container">
|
|
1895
1972
|
<!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
|
|
1896
1973
|
<div class="ui-prop__faixa-estreita" id="faixa-estreita" title="Clique para expandir painel">
|
|
@@ -1989,118 +2066,20 @@ function Et() {
|
|
|
1989
2066
|
</div>
|
|
1990
2067
|
`;
|
|
1991
2068
|
}
|
|
1992
|
-
function
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
b(this, "valoresOriginais", {});
|
|
1998
|
-
b(this, "valoresAtuais", {});
|
|
1999
|
-
this.ctx = t;
|
|
2000
|
-
}
|
|
2001
|
-
inicializarCategorias(t) {
|
|
2002
|
-
this.valoresOriginais = {}, this.valoresAtuais = {};
|
|
2003
|
-
const e = /* @__PURE__ */ new Set();
|
|
2004
|
-
t.forEach((i) => {
|
|
2005
|
-
(i.propriedades || []).forEach((o) => {
|
|
2006
|
-
e.has(o.id) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${o.id}". Os valores são indexados por id e serão compartilhados.`), e.add(o.id), this.valoresOriginais[o.id] = o.valor, this.valoresAtuais[o.id] = o.valor;
|
|
2007
|
-
});
|
|
2008
|
-
}), this.ctx.onAtualizarBotoesFooter(!1);
|
|
2009
|
-
}
|
|
2010
|
-
/** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
|
|
2011
|
-
get isDirty() {
|
|
2012
|
-
return Object.keys(this.valoresAtuais).some((t) => this.isModificada(t));
|
|
2013
|
-
}
|
|
2014
|
-
isModificada(t) {
|
|
2015
|
-
return !O(this.valoresAtuais[t], this.valoresOriginais[t]);
|
|
2016
|
-
}
|
|
2017
|
-
getValores() {
|
|
2018
|
-
return { ...this.valoresAtuais };
|
|
2019
|
-
}
|
|
2020
|
-
getValoresOriginais() {
|
|
2021
|
-
return { ...this.valoresOriginais };
|
|
2022
|
-
}
|
|
2023
|
-
setValores(t) {
|
|
2024
|
-
!t || typeof t != "object" || (Object.keys(t).forEach((e) => {
|
|
2025
|
-
this.valoresAtuais[e] = t[e], this.valoresOriginais[e] = t[e];
|
|
2026
|
-
}), this.ctx.onAtualizarBotoesFooter(this.isDirty));
|
|
2027
|
-
}
|
|
2028
|
-
obterValor(t) {
|
|
2029
|
-
return this.valoresAtuais[t];
|
|
2030
|
-
}
|
|
2031
|
-
/** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
|
|
2032
|
-
definirValor(t, e, i = !0) {
|
|
2033
|
-
const o = this.valoresAtuais[t];
|
|
2034
|
-
O(o, e) || (this.valoresAtuais[t] = e, this.aposAlterar(t), this.ctx.onAtualizarCampoVisual(t, e), i && this.emitirAlteracao(t, e, o, this.categoriaDe(t)));
|
|
2035
|
-
}
|
|
2036
|
-
/** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
|
|
2037
|
-
registrarAlteracao(t, e, i) {
|
|
2038
|
-
const o = this.valoresAtuais[e];
|
|
2039
|
-
O(o, i) || (this.valoresAtuais[e] = i, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, i, o, t));
|
|
2040
|
-
}
|
|
2041
|
-
aplicar() {
|
|
2042
|
-
var e;
|
|
2043
|
-
if (!this.isDirty) return;
|
|
2044
|
-
this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
|
|
2045
|
-
const t = (e = this.ctx.hostElement.shadowRoot) == null ? void 0 : e.querySelectorAll(".ui-prop__linha--modificada");
|
|
2046
|
-
t == null || t.forEach((i) => i.classList.remove("ui-prop__linha--modificada")), this.ctx.hostElement.dispatchEvent(
|
|
2047
|
-
new CustomEvent("ui-aplicar", {
|
|
2048
|
-
bubbles: !0,
|
|
2049
|
-
composed: !0,
|
|
2050
|
-
detail: { valores: { ...this.valoresAtuais } }
|
|
2051
|
-
})
|
|
2052
|
-
);
|
|
2053
|
-
}
|
|
2054
|
-
desfazer() {
|
|
2055
|
-
this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
2056
|
-
new CustomEvent("ui-desfazer", {
|
|
2057
|
-
bubbles: !0,
|
|
2058
|
-
composed: !0,
|
|
2059
|
-
detail: { valores: { ...this.valoresAtuais } }
|
|
2060
|
-
})
|
|
2061
|
-
));
|
|
2062
|
-
}
|
|
2063
|
-
/** Marca/desmarca a linha e recalcula os botões do rodapé (voltar ao original limpa o estado). */
|
|
2064
|
-
aposAlterar(t) {
|
|
2065
|
-
const e = de(this.ctx.hostElement.shadowRoot, t);
|
|
2066
|
-
e == null || e.classList.toggle("ui-prop__linha--modificada", this.isModificada(t)), this.ctx.onAtualizarBotoesFooter(this.isDirty);
|
|
2067
|
-
}
|
|
2068
|
-
categoriaDe(t) {
|
|
2069
|
-
var e;
|
|
2070
|
-
for (const i of this.ctx.getCategorias())
|
|
2071
|
-
if ((e = i.propriedades) != null && e.some((o) => o.id === t)) return i.id;
|
|
2072
|
-
return "";
|
|
2073
|
-
}
|
|
2074
|
-
emitirAlteracao(t, e, i, o = "") {
|
|
2075
|
-
this.ctx.hostElement.dispatchEvent(
|
|
2076
|
-
new CustomEvent("ui-propriedade-alterada", {
|
|
2077
|
-
bubbles: !0,
|
|
2078
|
-
composed: !0,
|
|
2079
|
-
detail: {
|
|
2080
|
-
id: t,
|
|
2081
|
-
categoriaId: o,
|
|
2082
|
-
valor: e,
|
|
2083
|
-
valorAnterior: i,
|
|
2084
|
-
todosValores: { ...this.valoresAtuais }
|
|
2085
|
-
}
|
|
2086
|
-
})
|
|
2087
|
-
);
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
function wt(r) {
|
|
2091
|
-
const { listaContainer: t, categorias: e, termoBusca: i, onToggleCategoria: o, linhaCtx: a } = r;
|
|
2092
|
-
if (t.innerHTML = "", !e || e.length === 0) {
|
|
2093
|
-
const s = document.createElement("div");
|
|
2094
|
-
s.className = "ui-prop__vazio", s.textContent = "Nenhuma propriedade disponível.", t.appendChild(s);
|
|
2069
|
+
function Mt(t) {
|
|
2070
|
+
const { listaContainer: r, categorias: e, termoBusca: o, onToggleCategoria: i, linhaCtx: a } = t;
|
|
2071
|
+
if (r.innerHTML = "", !e || e.length === 0) {
|
|
2072
|
+
const l = document.createElement("div");
|
|
2073
|
+
l.className = "ui-prop__vazio", l.textContent = "Nenhuma propriedade disponível.", r.appendChild(l);
|
|
2095
2074
|
return;
|
|
2096
2075
|
}
|
|
2097
2076
|
const n = document.createDocumentFragment();
|
|
2098
|
-
e.forEach((
|
|
2099
|
-
const d = (
|
|
2100
|
-
if (
|
|
2077
|
+
e.forEach((l) => {
|
|
2078
|
+
const d = (l.propriedades || []).filter((g) => o ? g.rotulo.toLowerCase().includes(o) || String(g.id).toLowerCase().includes(o) : !0);
|
|
2079
|
+
if (o && d.length === 0)
|
|
2101
2080
|
return;
|
|
2102
|
-
const c = !!
|
|
2103
|
-
|
|
2081
|
+
const c = !!o || l.aberto !== !1, s = document.createElement("div");
|
|
2082
|
+
s.className = `ui-prop__categoria ${c ? "ui-prop__categoria--aberta" : ""}`, s.setAttribute("data-cat-id", l.id);
|
|
2104
2083
|
const u = document.createElement("div");
|
|
2105
2084
|
u.className = "ui-prop__categoria-header", u.setAttribute("role", "button"), u.tabIndex = 0, u.setAttribute("aria-expanded", String(c));
|
|
2106
2085
|
const p = document.createElement("div");
|
|
@@ -2108,244 +2087,341 @@ function wt(r) {
|
|
|
2108
2087
|
const h = document.createElement("span");
|
|
2109
2088
|
h.className = "ui-prop__categoria-seta", h.textContent = "▶";
|
|
2110
2089
|
const m = document.createElement("span");
|
|
2111
|
-
m.textContent =
|
|
2090
|
+
m.textContent = l.titulo, p.appendChild(h), p.appendChild(m);
|
|
2112
2091
|
const x = document.createElement("span");
|
|
2113
|
-
x.className = "ui-prop__categoria-contador", x.textContent = String(d.length), u.appendChild(p), u.appendChild(x), u.addEventListener("click", () =>
|
|
2114
|
-
(g.key === "Enter" || g.key === " ") && (g.preventDefault(),
|
|
2092
|
+
x.className = "ui-prop__categoria-contador", x.textContent = String(d.length), u.appendChild(p), u.appendChild(x), u.addEventListener("click", () => i(l.id)), u.addEventListener("keydown", (g) => {
|
|
2093
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), i(l.id));
|
|
2115
2094
|
});
|
|
2116
2095
|
const f = document.createElement("div");
|
|
2117
2096
|
f.className = "ui-prop__categoria-conteudo", d.forEach((g) => {
|
|
2118
|
-
const
|
|
2119
|
-
f.appendChild(
|
|
2120
|
-
}),
|
|
2121
|
-
}),
|
|
2097
|
+
const v = Tt(l.id, g, a);
|
|
2098
|
+
f.appendChild(v);
|
|
2099
|
+
}), s.appendChild(u), s.appendChild(f), n.appendChild(s);
|
|
2100
|
+
}), r.appendChild(n);
|
|
2122
2101
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2128
|
-
const
|
|
2102
|
+
function Tt(t, r, e) {
|
|
2103
|
+
const o = document.createElement("div");
|
|
2104
|
+
o.className = "ui-prop__linha", o.setAttribute("data-prop-id", r.id);
|
|
2105
|
+
const i = e.valoresAtuais[r.id] !== void 0 ? e.valoresAtuais[r.id] : j(r), a = r.id in e.valoresOriginais ? e.valoresOriginais[r.id] : j(r);
|
|
2106
|
+
R(i, a) || o.classList.add("ui-prop__linha--modificada"), o.classList.toggle("ui-prop__linha--misto", A(i)), o.addEventListener("dblclick", () => {
|
|
2107
|
+
const s = o.querySelector(
|
|
2129
2108
|
'input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline'
|
|
2130
2109
|
);
|
|
2131
|
-
|
|
2110
|
+
s && (s.focus(), s instanceof HTMLInputElement && s.select());
|
|
2132
2111
|
});
|
|
2133
2112
|
const n = document.createElement("div");
|
|
2134
|
-
n.className = "ui-prop__col-rotulo", n.title =
|
|
2135
|
-
const
|
|
2136
|
-
|
|
2113
|
+
n.className = "ui-prop__col-rotulo", n.title = r.rotulo;
|
|
2114
|
+
const l = document.createElement("span");
|
|
2115
|
+
l.textContent = r.rotulo, n.appendChild(l), r.tipo === "numero" && !r.somenteLeitura && Nt(n, t, r, e);
|
|
2137
2116
|
const d = document.createElement("div");
|
|
2138
2117
|
d.className = "ui-prop__col-valor";
|
|
2139
|
-
const c =
|
|
2140
|
-
if (d.appendChild(c),
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
}
|
|
2144
|
-
return
|
|
2145
|
-
}
|
|
2146
|
-
function
|
|
2147
|
-
|
|
2148
|
-
let
|
|
2149
|
-
|
|
2150
|
-
if (
|
|
2151
|
-
|
|
2152
|
-
const d =
|
|
2118
|
+
const c = At(t, r, i, e.editorCtx);
|
|
2119
|
+
if (d.appendChild(c), r.unidade) {
|
|
2120
|
+
const s = document.createElement("span");
|
|
2121
|
+
s.className = "ui-prop__unidade-sufixo", s.textContent = r.unidade, d.appendChild(s);
|
|
2122
|
+
}
|
|
2123
|
+
return o.appendChild(n), o.appendChild(d), o;
|
|
2124
|
+
}
|
|
2125
|
+
function Nt(t, r, e, o) {
|
|
2126
|
+
t.classList.add("ui-prop__col-rotulo--scrub"), t.title = `${e.rotulo} (Arraste para ajustar, duplo-clique para editar)`;
|
|
2127
|
+
let i = 0, a = 0, n = !1;
|
|
2128
|
+
t.addEventListener("pointerdown", (l) => {
|
|
2129
|
+
if (l.button !== 0 || A(o.editorCtx.obterValorAtual(e.id))) return;
|
|
2130
|
+
i = l.clientX;
|
|
2131
|
+
const d = o.editorCtx.obterValorAtual(e.id);
|
|
2153
2132
|
a = typeof d == "number" ? d : parseFloat(String(d || 0)) || 0, n = !1;
|
|
2154
2133
|
try {
|
|
2155
|
-
|
|
2134
|
+
t.setPointerCapture(l.pointerId);
|
|
2156
2135
|
} catch {
|
|
2157
2136
|
}
|
|
2158
|
-
|
|
2137
|
+
t.classList.add("ui-prop__col-rotulo--arrastando");
|
|
2159
2138
|
const c = (u) => {
|
|
2160
|
-
const p = u.clientX -
|
|
2139
|
+
const p = u.clientX - i;
|
|
2161
2140
|
if (Math.abs(p) > 2 && (n = !0), n) {
|
|
2162
2141
|
let h = 1;
|
|
2163
2142
|
u.shiftKey ? h = 0.1 : (u.ctrlKey || u.metaKey) && (h = 10);
|
|
2164
2143
|
const m = e.casasDecimais !== void 0 ? e.casasDecimais : 2, x = Math.pow(10, -Math.min(m, 2));
|
|
2165
2144
|
let f = a + p * x * h;
|
|
2166
|
-
e.casasDecimais !== void 0 ? f = Number(f.toFixed(e.casasDecimais)) : f = Math.round(f * 100) / 100,
|
|
2145
|
+
e.casasDecimais !== void 0 ? f = Number(f.toFixed(e.casasDecimais)) : f = Math.round(f * 100) / 100, o.editorCtx.registrarAlteracao(r, e.id, f), o.onAtualizarCampoVisual(e.id, f);
|
|
2167
2146
|
}
|
|
2168
|
-
},
|
|
2169
|
-
|
|
2147
|
+
}, s = (u) => {
|
|
2148
|
+
t.classList.remove("ui-prop__col-rotulo--arrastando");
|
|
2170
2149
|
try {
|
|
2171
|
-
|
|
2150
|
+
t.hasPointerCapture(u.pointerId) && t.releasePointerCapture(u.pointerId);
|
|
2172
2151
|
} catch {
|
|
2173
2152
|
}
|
|
2174
|
-
|
|
2153
|
+
t.removeEventListener("pointermove", c), t.removeEventListener("pointerup", s), t.removeEventListener("pointercancel", s);
|
|
2175
2154
|
};
|
|
2176
|
-
|
|
2155
|
+
t.addEventListener("pointermove", c), t.addEventListener("pointerup", s), t.addEventListener("pointercancel", s);
|
|
2177
2156
|
});
|
|
2178
2157
|
}
|
|
2179
|
-
const
|
|
2180
|
-
function
|
|
2181
|
-
var
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2184
|
-
const n =
|
|
2185
|
-
n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height },
|
|
2158
|
+
const se = 300, Dt = 480, I = /* @__PURE__ */ new WeakMap();
|
|
2159
|
+
function Rt(t) {
|
|
2160
|
+
var o, i, a;
|
|
2161
|
+
const r = t.hasAttribute("flutuante"), e = t.style;
|
|
2162
|
+
if (r) {
|
|
2163
|
+
const n = I.get(t) ?? { acoplado: { width: "", height: "" } };
|
|
2164
|
+
n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height }, I.set(t, n), t.removeAttribute("flutuante"), e.left = "", e.top = "", e.right = "", e.bottom = "", e.position = "", e.zIndex = "", e.width = n.acoplado.width, e.height = n.acoplado.height;
|
|
2186
2165
|
} else {
|
|
2187
2166
|
const n = {
|
|
2188
2167
|
acoplado: { width: e.width, height: e.height },
|
|
2189
|
-
flutuante: (
|
|
2168
|
+
flutuante: (o = I.get(t)) == null ? void 0 : o.flutuante
|
|
2190
2169
|
};
|
|
2191
|
-
if (
|
|
2170
|
+
if (I.set(t, n), t.setAttribute("flutuante", ""), e.position = "fixed", (i = n.flutuante) != null && i.left || (a = n.flutuante) != null && a.top)
|
|
2192
2171
|
e.left = n.flutuante.left, e.top = n.flutuante.top, e.width = n.flutuante.width, e.height = n.flutuante.height;
|
|
2193
2172
|
else if (!e.left && !e.top) {
|
|
2194
|
-
const
|
|
2173
|
+
const l = Math.max(
|
|
2195
2174
|
20,
|
|
2196
|
-
(typeof window < "u" ? window.innerWidth : 1024) -
|
|
2175
|
+
(typeof window < "u" ? window.innerWidth : 1024) - se - 30
|
|
2197
2176
|
);
|
|
2198
|
-
e.left = `${
|
|
2177
|
+
e.left = `${l}px`, e.top = "70px", e.width = `${se}px`, e.height = `${Dt}px`;
|
|
2199
2178
|
}
|
|
2200
2179
|
}
|
|
2201
|
-
return !
|
|
2180
|
+
return !r;
|
|
2202
2181
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const
|
|
2205
|
-
if (
|
|
2206
|
-
let a = null, n = 0,
|
|
2207
|
-
const
|
|
2182
|
+
function Bt(t, r, e) {
|
|
2183
|
+
const o = r.getElementById("header");
|
|
2184
|
+
if (o) {
|
|
2185
|
+
let a = null, n = 0, l = 0, d = 0, c = 0;
|
|
2186
|
+
const s = (p) => {
|
|
2208
2187
|
if (a === null) return;
|
|
2209
|
-
const h = p.clientX - n, m = p.clientY -
|
|
2188
|
+
const h = p.clientX - n, m = p.clientY - l;
|
|
2210
2189
|
let x = d + h, f = c + m;
|
|
2211
|
-
const g = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) -
|
|
2212
|
-
x = Math.max(0, Math.min(g, x)), f = Math.max(0, Math.min(
|
|
2190
|
+
const g = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) - t.offsetWidth), v = Math.max(0, (typeof window < "u" ? window.innerHeight : 768) - 30);
|
|
2191
|
+
x = Math.max(0, Math.min(g, x)), f = Math.max(0, Math.min(v, f)), t.style.left = `${x}px`, t.style.top = `${f}px`, t.style.right = "auto", t.style.bottom = "auto";
|
|
2213
2192
|
}, u = (p) => {
|
|
2214
2193
|
if (a !== null) {
|
|
2215
2194
|
try {
|
|
2216
|
-
|
|
2195
|
+
o.releasePointerCapture(p.pointerId);
|
|
2217
2196
|
} catch {
|
|
2218
2197
|
}
|
|
2219
|
-
|
|
2198
|
+
o.removeEventListener("pointermove", s), o.removeEventListener("pointerup", u), o.removeEventListener("pointercancel", u), a = null, t.classList.remove("arrastando"), t.dispatchEvent(new CustomEvent("ui-mover", {
|
|
2220
2199
|
bubbles: !0,
|
|
2221
2200
|
composed: !0,
|
|
2222
|
-
detail: { left:
|
|
2201
|
+
detail: { left: t.style.left, top: t.style.top }
|
|
2223
2202
|
}));
|
|
2224
2203
|
}
|
|
2225
2204
|
};
|
|
2226
|
-
e.add(
|
|
2227
|
-
if (!
|
|
2228
|
-
p.preventDefault(), a = p.pointerId, n = p.clientX,
|
|
2229
|
-
const m =
|
|
2230
|
-
d = m.left, c = m.top,
|
|
2205
|
+
e.add(o, "pointerdown", (p) => {
|
|
2206
|
+
if (!t.hasAttribute("flutuante") || p.target.closest("button, input, select, a") || p.button !== 0) return;
|
|
2207
|
+
p.preventDefault(), a = p.pointerId, n = p.clientX, l = p.clientY;
|
|
2208
|
+
const m = t.getBoundingClientRect();
|
|
2209
|
+
d = m.left, c = m.top, t.classList.add("arrastando");
|
|
2231
2210
|
try {
|
|
2232
|
-
|
|
2211
|
+
o.setPointerCapture(p.pointerId);
|
|
2233
2212
|
} catch {
|
|
2234
2213
|
}
|
|
2235
|
-
|
|
2214
|
+
o.addEventListener("pointermove", s), o.addEventListener("pointerup", u), o.addEventListener("pointercancel", u);
|
|
2236
2215
|
});
|
|
2237
2216
|
}
|
|
2238
|
-
const
|
|
2239
|
-
if (
|
|
2240
|
-
let a = null, n = 0,
|
|
2241
|
-
const
|
|
2217
|
+
const i = r.getElementById("resizer-canto");
|
|
2218
|
+
if (i) {
|
|
2219
|
+
let a = null, n = 0, l = 0, d = 0, c = 0;
|
|
2220
|
+
const s = (p) => {
|
|
2242
2221
|
if (a === null) return;
|
|
2243
|
-
const h = Math.max(200, n + (p.clientX - d)), m = Math.max(180,
|
|
2244
|
-
|
|
2222
|
+
const h = Math.max(200, n + (p.clientX - d)), m = Math.max(180, l + (p.clientY - c));
|
|
2223
|
+
t.style.width = `${h}px`, t.style.height = `${m}px`;
|
|
2245
2224
|
}, u = (p) => {
|
|
2246
2225
|
if (a !== null) {
|
|
2247
2226
|
try {
|
|
2248
|
-
|
|
2227
|
+
i.releasePointerCapture(p.pointerId);
|
|
2249
2228
|
} catch {
|
|
2250
2229
|
}
|
|
2251
|
-
|
|
2230
|
+
i.removeEventListener("pointermove", s), i.removeEventListener("pointerup", u), i.removeEventListener("pointercancel", u), a = null, t.dispatchEvent(new CustomEvent("ui-redimensionar", {
|
|
2252
2231
|
bubbles: !0,
|
|
2253
2232
|
composed: !0,
|
|
2254
|
-
detail: { width:
|
|
2233
|
+
detail: { width: t.style.width, height: t.style.height }
|
|
2255
2234
|
}));
|
|
2256
2235
|
}
|
|
2257
2236
|
};
|
|
2258
|
-
e.add(
|
|
2259
|
-
if (!
|
|
2237
|
+
e.add(i, "pointerdown", (p) => {
|
|
2238
|
+
if (!t.hasAttribute("flutuante") || p.button !== 0) return;
|
|
2260
2239
|
p.preventDefault(), p.stopPropagation(), a = p.pointerId, d = p.clientX, c = p.clientY;
|
|
2261
|
-
const h =
|
|
2262
|
-
n = h.width,
|
|
2240
|
+
const h = t.getBoundingClientRect();
|
|
2241
|
+
n = h.width, l = h.height;
|
|
2263
2242
|
try {
|
|
2264
|
-
|
|
2243
|
+
i.setPointerCapture(p.pointerId);
|
|
2265
2244
|
} catch {
|
|
2266
2245
|
}
|
|
2267
|
-
|
|
2246
|
+
i.addEventListener("pointermove", s), i.addEventListener("pointerup", u), i.addEventListener("pointercancel", u);
|
|
2268
2247
|
});
|
|
2269
2248
|
}
|
|
2270
2249
|
}
|
|
2271
|
-
function
|
|
2272
|
-
return
|
|
2250
|
+
function Ot(t) {
|
|
2251
|
+
return t === "compacta" ? "ultracompacta" : t === "ultracompacta" ? "padrao" : "compacta";
|
|
2273
2252
|
}
|
|
2274
|
-
|
|
2253
|
+
class It {
|
|
2254
|
+
constructor(r) {
|
|
2255
|
+
b(this, "valoresOriginais", {});
|
|
2256
|
+
b(this, "valoresAtuais", {});
|
|
2257
|
+
this.ctx = r;
|
|
2258
|
+
}
|
|
2259
|
+
inicializarCategorias(r) {
|
|
2260
|
+
this.valoresOriginais = {}, this.valoresAtuais = {};
|
|
2261
|
+
const e = /* @__PURE__ */ new Set();
|
|
2262
|
+
r.forEach((o) => {
|
|
2263
|
+
(o.propriedades || []).forEach((i) => {
|
|
2264
|
+
e.has(i.id) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${i.id}". Os valores são indexados por id e serão compartilhados.`), e.add(i.id);
|
|
2265
|
+
const a = j(i);
|
|
2266
|
+
this.valoresOriginais[i.id] = a, this.valoresAtuais[i.id] = a;
|
|
2267
|
+
});
|
|
2268
|
+
}), this.ctx.onAtualizarBotoesFooter(!1);
|
|
2269
|
+
}
|
|
2270
|
+
/** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
|
|
2271
|
+
get isDirty() {
|
|
2272
|
+
return Object.keys(this.valoresAtuais).some((r) => this.isModificada(r));
|
|
2273
|
+
}
|
|
2274
|
+
isModificada(r) {
|
|
2275
|
+
return !R(this.valoresAtuais[r], this.valoresOriginais[r]);
|
|
2276
|
+
}
|
|
2277
|
+
getValores() {
|
|
2278
|
+
return { ...this.valoresAtuais };
|
|
2279
|
+
}
|
|
2280
|
+
getValoresOriginais() {
|
|
2281
|
+
return { ...this.valoresOriginais };
|
|
2282
|
+
}
|
|
2283
|
+
setValores(r) {
|
|
2284
|
+
!r || typeof r != "object" || (Object.keys(r).forEach((e) => {
|
|
2285
|
+
this.valoresAtuais[e] = r[e], this.valoresOriginais[e] = r[e];
|
|
2286
|
+
}), this.ctx.onAtualizarBotoesFooter(this.isDirty));
|
|
2287
|
+
}
|
|
2288
|
+
obterValor(r) {
|
|
2289
|
+
return this.valoresAtuais[r];
|
|
2290
|
+
}
|
|
2291
|
+
/** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
|
|
2292
|
+
definirValor(r, e, o = !0) {
|
|
2293
|
+
const i = this.valoresAtuais[r];
|
|
2294
|
+
R(i, e) || (this.valoresAtuais[r] = e, this.aposAlterar(r), this.ctx.onAtualizarCampoVisual(r, e), o && this.emitirAlteracao(r, e, i, this.categoriaDe(r)));
|
|
2295
|
+
}
|
|
2296
|
+
/** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
|
|
2297
|
+
registrarAlteracao(r, e, o) {
|
|
2298
|
+
const i = this.valoresAtuais[e];
|
|
2299
|
+
R(i, o) || (this.valoresAtuais[e] = o, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, o, i, r));
|
|
2300
|
+
}
|
|
2301
|
+
aplicar() {
|
|
2302
|
+
var e;
|
|
2303
|
+
if (!this.isDirty) return;
|
|
2304
|
+
this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
|
|
2305
|
+
const r = (e = this.ctx.hostElement.shadowRoot) == null ? void 0 : e.querySelectorAll(".ui-prop__linha--modificada");
|
|
2306
|
+
r == null || r.forEach((o) => o.classList.remove("ui-prop__linha--modificada")), this.ctx.hostElement.dispatchEvent(
|
|
2307
|
+
new CustomEvent("ui-aplicar", {
|
|
2308
|
+
bubbles: !0,
|
|
2309
|
+
composed: !0,
|
|
2310
|
+
detail: { valores: { ...this.valoresAtuais } }
|
|
2311
|
+
})
|
|
2312
|
+
);
|
|
2313
|
+
}
|
|
2314
|
+
desfazer() {
|
|
2315
|
+
this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
2316
|
+
new CustomEvent("ui-desfazer", {
|
|
2317
|
+
bubbles: !0,
|
|
2318
|
+
composed: !0,
|
|
2319
|
+
detail: { valores: { ...this.valoresAtuais } }
|
|
2320
|
+
})
|
|
2321
|
+
));
|
|
2322
|
+
}
|
|
2323
|
+
/** Marca/desmarca a linha (modificada e mista) e recalcula os botões do rodapé (voltar ao original limpa o estado). */
|
|
2324
|
+
aposAlterar(r) {
|
|
2325
|
+
const e = me(this.ctx.hostElement.shadowRoot, r);
|
|
2326
|
+
e == null || e.classList.toggle("ui-prop__linha--modificada", this.isModificada(r)), e == null || e.classList.toggle("ui-prop__linha--misto", A(this.valoresAtuais[r])), this.ctx.onAtualizarBotoesFooter(this.isDirty);
|
|
2327
|
+
}
|
|
2328
|
+
categoriaDe(r) {
|
|
2329
|
+
var e;
|
|
2330
|
+
for (const o of this.ctx.getCategorias())
|
|
2331
|
+
if ((e = o.propriedades) != null && e.some((i) => i.id === r)) return o.id;
|
|
2332
|
+
return "";
|
|
2333
|
+
}
|
|
2334
|
+
emitirAlteracao(r, e, o, i = "") {
|
|
2335
|
+
this.ctx.hostElement.dispatchEvent(
|
|
2336
|
+
new CustomEvent("ui-propriedade-alterada", {
|
|
2337
|
+
bubbles: !0,
|
|
2338
|
+
composed: !0,
|
|
2339
|
+
detail: {
|
|
2340
|
+
id: r,
|
|
2341
|
+
categoriaId: i,
|
|
2342
|
+
valor: e,
|
|
2343
|
+
valorAnterior: o,
|
|
2344
|
+
todosValores: { ...this.valoresAtuais }
|
|
2345
|
+
}
|
|
2346
|
+
})
|
|
2347
|
+
);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
function Pt(t) {
|
|
2275
2351
|
const {
|
|
2276
|
-
shadow:
|
|
2352
|
+
shadow: r,
|
|
2277
2353
|
listeners: e,
|
|
2278
|
-
host:
|
|
2279
|
-
onToggleExpandirTodas:
|
|
2354
|
+
host: o,
|
|
2355
|
+
onToggleExpandirTodas: i,
|
|
2280
2356
|
onFiltrar: a,
|
|
2281
2357
|
onAplicar: n,
|
|
2282
|
-
onDesfazer:
|
|
2358
|
+
onDesfazer: l,
|
|
2283
2359
|
onAlternarDensidade: d,
|
|
2284
2360
|
onAlternarFlutuante: c,
|
|
2285
|
-
onAlternarColapsoHorizontal:
|
|
2286
|
-
} =
|
|
2361
|
+
onAlternarColapsoHorizontal: s
|
|
2362
|
+
} = t, u = r.getElementById("btn-flutuante");
|
|
2287
2363
|
u && c && e.add(u, "click", c);
|
|
2288
|
-
const p =
|
|
2289
|
-
p &&
|
|
2290
|
-
const h =
|
|
2291
|
-
h &&
|
|
2292
|
-
const m =
|
|
2293
|
-
m &&
|
|
2294
|
-
|
|
2364
|
+
const p = r.getElementById("btn-colapsar-horizontal");
|
|
2365
|
+
p && s && e.add(p, "click", s);
|
|
2366
|
+
const h = r.getElementById("faixa-estreita");
|
|
2367
|
+
h && s && e.add(h, "click", s);
|
|
2368
|
+
const m = r.getElementById("btn-expandir-faixa");
|
|
2369
|
+
m && s && e.add(m, "click", (_) => {
|
|
2370
|
+
_.stopPropagation(), s();
|
|
2295
2371
|
});
|
|
2296
|
-
const x =
|
|
2372
|
+
const x = r.getElementById("btn-densidade");
|
|
2297
2373
|
x && d && e.add(x, "click", d);
|
|
2298
|
-
const f =
|
|
2299
|
-
f && e.add(f, "click",
|
|
2300
|
-
const g =
|
|
2374
|
+
const f = r.getElementById("btn-expandir-tudo");
|
|
2375
|
+
f && e.add(f, "click", i);
|
|
2376
|
+
const g = r.getElementById("btn-fechar");
|
|
2301
2377
|
g && e.add(g, "click", () => {
|
|
2302
|
-
|
|
2378
|
+
o.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
2303
2379
|
});
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
const
|
|
2307
|
-
a(
|
|
2380
|
+
const v = r.getElementById("filtro-input");
|
|
2381
|
+
v && e.add(v, "input", () => {
|
|
2382
|
+
const _ = (v.value || "").trim().toLowerCase();
|
|
2383
|
+
a(_);
|
|
2308
2384
|
});
|
|
2309
|
-
const y =
|
|
2385
|
+
const y = r.getElementById("btn-aplicar");
|
|
2310
2386
|
y && e.add(y, "click", n);
|
|
2311
|
-
const
|
|
2312
|
-
|
|
2313
|
-
const w =
|
|
2314
|
-
w && e.add(w, "click", (
|
|
2315
|
-
|
|
2387
|
+
const k = r.getElementById("btn-desfazer");
|
|
2388
|
+
k && e.add(k, "click", l);
|
|
2389
|
+
const w = r.getElementById("link-ajuda");
|
|
2390
|
+
w && e.add(w, "click", (_) => {
|
|
2391
|
+
_.preventDefault(), o.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
|
|
2316
2392
|
});
|
|
2317
2393
|
}
|
|
2318
|
-
function
|
|
2319
|
-
const e =
|
|
2320
|
-
e && (e.textContent =
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2324
|
-
if (
|
|
2325
|
-
const c =
|
|
2326
|
-
|
|
2394
|
+
function T(t, r) {
|
|
2395
|
+
const e = t.getElementById("header-titulo-texto");
|
|
2396
|
+
e && (e.textContent = r.getAttribute("titulo") || "Propriedades");
|
|
2397
|
+
const o = t.getElementById("btn-fechar");
|
|
2398
|
+
o && (o.style.display = r.hasAttribute("fechavel") ? "inline-flex" : "none");
|
|
2399
|
+
const i = t.getElementById("btn-flutuante");
|
|
2400
|
+
if (i) {
|
|
2401
|
+
const c = r.hasAttribute("flutuante");
|
|
2402
|
+
i.title = c ? "Acoplar painel (Dock)" : "Desacoplar / Modo flutuante (CAD)", i.classList.toggle("ui-prop__btn-icone--ativo", c);
|
|
2327
2403
|
}
|
|
2328
|
-
const a =
|
|
2404
|
+
const a = t.getElementById("btn-colapsar-horizontal");
|
|
2329
2405
|
if (a) {
|
|
2330
|
-
const c =
|
|
2406
|
+
const c = r.hasAttribute("colapsado");
|
|
2331
2407
|
a.title = c ? "Expandir painel" : "Recolher para coluna estreita", a.classList.toggle("ui-prop__btn-icone--ativo", c);
|
|
2332
2408
|
}
|
|
2333
|
-
const n =
|
|
2409
|
+
const n = t.getElementById("btn-densidade");
|
|
2334
2410
|
if (n) {
|
|
2335
|
-
const c =
|
|
2411
|
+
const c = r.getAttribute("densidade") || "padrão";
|
|
2336
2412
|
n.title = `Compressão vertical: ${c} (clique para alternar)`;
|
|
2337
2413
|
}
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2340
|
-
const d =
|
|
2341
|
-
d && (d.style.display =
|
|
2414
|
+
const l = t.getElementById("filtro-container");
|
|
2415
|
+
l && (l.style.display = r.hasAttribute("filtro") ? "flex" : "none");
|
|
2416
|
+
const d = t.getElementById("footer");
|
|
2417
|
+
d && (d.style.display = r.getAttribute("modo-aplicar") === "manual" ? "flex" : "none");
|
|
2342
2418
|
}
|
|
2343
|
-
class
|
|
2419
|
+
class Ft extends de {
|
|
2344
2420
|
constructor() {
|
|
2345
2421
|
super();
|
|
2346
2422
|
b(this, "shadow");
|
|
2347
|
-
b(this, "listeners", new
|
|
2348
|
-
b(this, "splitterListeners", new
|
|
2423
|
+
b(this, "listeners", new P());
|
|
2424
|
+
b(this, "splitterListeners", new P());
|
|
2349
2425
|
b(this, "controladorSplitter");
|
|
2350
2426
|
b(this, "gerenciadorValores");
|
|
2351
2427
|
b(this, "_categorias", []);
|
|
@@ -2358,16 +2434,16 @@ class Nt extends oe {
|
|
|
2358
2434
|
b(this, "btnAplicarElement");
|
|
2359
2435
|
b(this, "btnDesfazerElement");
|
|
2360
2436
|
b(this, "splitterElement");
|
|
2361
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML =
|
|
2437
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = Lt(), this.tipoContainerElement = this.shadow.getElementById("tipo-container"), this.corpoElement = this.shadow.getElementById("corpo"), this.btnAplicarElement = this.shadow.getElementById("btn-aplicar"), this.btnDesfazerElement = this.shadow.getElementById("btn-desfazer"), this.splitterElement = this.shadow.getElementById("splitter"), this.gerenciadorValores = new It({
|
|
2362
2438
|
hostElement: this,
|
|
2363
2439
|
getCategorias: () => this._categorias,
|
|
2364
2440
|
onAtualizarBotoesFooter: (e) => {
|
|
2365
2441
|
this.btnAplicarElement.disabled = !e, this.btnDesfazerElement.disabled = !e;
|
|
2366
2442
|
},
|
|
2367
|
-
onAtualizarCampoVisual: (e,
|
|
2443
|
+
onAtualizarCampoVisual: (e, o) => ne(this.shadow, e, o),
|
|
2368
2444
|
onRenderCategorias: () => this.renderCategorias(),
|
|
2369
2445
|
isModoManual: () => this.getAttribute("modo-aplicar") === "manual"
|
|
2370
|
-
}), this.controladorSplitter =
|
|
2446
|
+
}), this.controladorSplitter = zt({
|
|
2371
2447
|
hostElement: this,
|
|
2372
2448
|
corpoElement: this.corpoElement,
|
|
2373
2449
|
splitterElement: this.splitterElement,
|
|
@@ -2387,14 +2463,15 @@ class Nt extends oe {
|
|
|
2387
2463
|
"largura-rotulo",
|
|
2388
2464
|
"fechavel",
|
|
2389
2465
|
"colapsado",
|
|
2390
|
-
"flutuante"
|
|
2466
|
+
"flutuante",
|
|
2467
|
+
"texto-misto"
|
|
2391
2468
|
];
|
|
2392
2469
|
}
|
|
2393
2470
|
get larguraRotuloPorcentagem() {
|
|
2394
2471
|
return this._larguraRotuloPorcentagem;
|
|
2395
2472
|
}
|
|
2396
2473
|
connectedCallback() {
|
|
2397
|
-
this.listeners.cleanup(),
|
|
2474
|
+
this.listeners.cleanup(), Pt({
|
|
2398
2475
|
shadow: this.shadow,
|
|
2399
2476
|
listeners: this.listeners,
|
|
2400
2477
|
host: this,
|
|
@@ -2407,7 +2484,7 @@ class Nt extends oe {
|
|
|
2407
2484
|
onAlternarDensidade: () => this.alternarDensidade(),
|
|
2408
2485
|
onAlternarFlutuante: () => this.alternarFlutuante(),
|
|
2409
2486
|
onAlternarColapsoHorizontal: () => this.alternarColapsoHorizontal()
|
|
2410
|
-
}),
|
|
2487
|
+
}), Bt(this, this.shadow, this.listeners), this.controladorSplitter.init(), this.syncState();
|
|
2411
2488
|
}
|
|
2412
2489
|
disconnectedCallback() {
|
|
2413
2490
|
this.listeners.cleanup(), this.splitterListeners.cleanup();
|
|
@@ -2416,26 +2493,29 @@ class Nt extends oe {
|
|
|
2416
2493
|
* Cada atributo atualiza só o que depende dele: redesenhar todas as linhas (ex.: ao trocar o
|
|
2417
2494
|
* `titulo`) tiraria o foco de um campo em edição.
|
|
2418
2495
|
*/
|
|
2419
|
-
attributeChangedCallback(e,
|
|
2420
|
-
if (
|
|
2496
|
+
attributeChangedCallback(e, o, i) {
|
|
2497
|
+
if (o !== i)
|
|
2421
2498
|
switch (e) {
|
|
2422
2499
|
case "largura-rotulo": {
|
|
2423
|
-
const a = parseFloat(
|
|
2500
|
+
const a = parseFloat(i ?? "");
|
|
2424
2501
|
isNaN(a) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(a));
|
|
2425
2502
|
return;
|
|
2426
2503
|
}
|
|
2427
2504
|
case "estilo-visual":
|
|
2428
2505
|
this.renderSeletorTipos();
|
|
2429
2506
|
return;
|
|
2507
|
+
case "texto-misto":
|
|
2508
|
+
this.renderCategorias();
|
|
2509
|
+
return;
|
|
2430
2510
|
case "filtro":
|
|
2431
|
-
if (
|
|
2511
|
+
if (T(this.shadow, this), i === null && this._termoBusca) {
|
|
2432
2512
|
this._termoBusca = "";
|
|
2433
2513
|
const a = this.shadow.getElementById("filtro-input");
|
|
2434
2514
|
a && (a.value = ""), this.renderCategorias();
|
|
2435
2515
|
}
|
|
2436
2516
|
return;
|
|
2437
2517
|
default:
|
|
2438
|
-
|
|
2518
|
+
T(this.shadow, this);
|
|
2439
2519
|
}
|
|
2440
2520
|
}
|
|
2441
2521
|
get categorias() {
|
|
@@ -2444,6 +2524,17 @@ class Nt extends oe {
|
|
|
2444
2524
|
set categorias(e) {
|
|
2445
2525
|
this._categorias = Array.isArray(e) ? e : [], this.gerenciadorValores.inicializarCategorias(this._categorias), this.renderCategorias();
|
|
2446
2526
|
}
|
|
2527
|
+
/**
|
|
2528
|
+
* Texto exibido nas propriedades cujo valor difere entre os objetos selecionados
|
|
2529
|
+
* (`VALOR_MISTO`). Reflete o atributo `texto-misto`; padrão "Varia".
|
|
2530
|
+
*/
|
|
2531
|
+
get textoMisto() {
|
|
2532
|
+
const e = this.getAttribute("texto-misto");
|
|
2533
|
+
return e && e.trim() ? e : G;
|
|
2534
|
+
}
|
|
2535
|
+
set textoMisto(e) {
|
|
2536
|
+
typeof e == "string" && e.trim() ? this.setAttribute("texto-misto", e) : this.removeAttribute("texto-misto");
|
|
2537
|
+
}
|
|
2447
2538
|
get tipos() {
|
|
2448
2539
|
return this._tipos;
|
|
2449
2540
|
}
|
|
@@ -2471,8 +2562,8 @@ class Nt extends oe {
|
|
|
2471
2562
|
obterValor(e) {
|
|
2472
2563
|
return this.gerenciadorValores.obterValor(e);
|
|
2473
2564
|
}
|
|
2474
|
-
definirValor(e,
|
|
2475
|
-
this.gerenciadorValores.definirValor(e,
|
|
2565
|
+
definirValor(e, o, i = !0) {
|
|
2566
|
+
this.gerenciadorValores.definirValor(e, o, i);
|
|
2476
2567
|
}
|
|
2477
2568
|
aplicar() {
|
|
2478
2569
|
this.gerenciadorValores.aplicar();
|
|
@@ -2481,13 +2572,13 @@ class Nt extends oe {
|
|
|
2481
2572
|
this.gerenciadorValores.desfazer();
|
|
2482
2573
|
}
|
|
2483
2574
|
expandirTudo() {
|
|
2484
|
-
|
|
2575
|
+
ct(this.shadow, this._categorias);
|
|
2485
2576
|
}
|
|
2486
2577
|
colapsarTudo() {
|
|
2487
|
-
|
|
2578
|
+
ut(this.shadow, this._categorias);
|
|
2488
2579
|
}
|
|
2489
2580
|
toggleCategoria(e) {
|
|
2490
|
-
|
|
2581
|
+
pt(this.shadow, this, this._categorias, e);
|
|
2491
2582
|
}
|
|
2492
2583
|
get densidade() {
|
|
2493
2584
|
return this.getAttribute("densidade") || "padrao";
|
|
@@ -2496,14 +2587,14 @@ class Nt extends oe {
|
|
|
2496
2587
|
!e || e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e);
|
|
2497
2588
|
}
|
|
2498
2589
|
alternarDensidade() {
|
|
2499
|
-
const e =
|
|
2590
|
+
const e = Ot(this.getAttribute("densidade") || "padrao");
|
|
2500
2591
|
return e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e), this.dispatchEvent(
|
|
2501
2592
|
new CustomEvent("ui-densidade-alterada", {
|
|
2502
2593
|
bubbles: !0,
|
|
2503
2594
|
composed: !0,
|
|
2504
2595
|
detail: { densidade: e }
|
|
2505
2596
|
})
|
|
2506
|
-
),
|
|
2597
|
+
), T(this.shadow, this), e;
|
|
2507
2598
|
}
|
|
2508
2599
|
get flutuante() {
|
|
2509
2600
|
return this.hasAttribute("flutuante");
|
|
@@ -2518,8 +2609,8 @@ class Nt extends oe {
|
|
|
2518
2609
|
!!e !== this.hasAttribute("colapsado") && this.alternarColapsoHorizontal();
|
|
2519
2610
|
}
|
|
2520
2611
|
alternarFlutuante() {
|
|
2521
|
-
const e =
|
|
2522
|
-
return
|
|
2612
|
+
const e = Rt(this);
|
|
2613
|
+
return T(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-flutuante-alterado", {
|
|
2523
2614
|
bubbles: !0,
|
|
2524
2615
|
composed: !0,
|
|
2525
2616
|
detail: {
|
|
@@ -2534,35 +2625,35 @@ class Nt extends oe {
|
|
|
2534
2625
|
alternarColapsoHorizontal() {
|
|
2535
2626
|
const e = this.hasAttribute("colapsado");
|
|
2536
2627
|
e ? this.removeAttribute("colapsado") : this.setAttribute("colapsado", "");
|
|
2537
|
-
const
|
|
2538
|
-
return
|
|
2628
|
+
const o = !e;
|
|
2629
|
+
return T(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-colapso-horizontal", {
|
|
2539
2630
|
bubbles: !0,
|
|
2540
2631
|
composed: !0,
|
|
2541
|
-
detail: { colapsado:
|
|
2542
|
-
})),
|
|
2632
|
+
detail: { colapsado: o }
|
|
2633
|
+
})), o;
|
|
2543
2634
|
}
|
|
2544
2635
|
syncState() {
|
|
2545
|
-
|
|
2636
|
+
T(this.shadow, this);
|
|
2546
2637
|
const e = this.getAttribute("largura-rotulo");
|
|
2547
2638
|
if (e) {
|
|
2548
|
-
const
|
|
2549
|
-
isNaN(
|
|
2639
|
+
const o = parseFloat(e);
|
|
2640
|
+
isNaN(o) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(o));
|
|
2550
2641
|
}
|
|
2551
2642
|
this.renderSeletorTipos(), this.renderCategorias();
|
|
2552
2643
|
}
|
|
2553
2644
|
toggleExpandirTodas() {
|
|
2554
|
-
this._categorias.some((
|
|
2645
|
+
this._categorias.some((o) => o.aberto === !1) ? this.expandirTudo() : this.colapsarTudo();
|
|
2555
2646
|
}
|
|
2556
2647
|
renderSeletorTipos() {
|
|
2557
|
-
|
|
2648
|
+
kt({
|
|
2558
2649
|
tipoContainerElement: this.tipoContainerElement,
|
|
2559
2650
|
tipos: this._tipos,
|
|
2560
2651
|
tipoSelecionadoId: this._tipoSelecionadoId,
|
|
2561
2652
|
estiloVisual: this.getAttribute("estilo-visual") || "autocad",
|
|
2562
2653
|
onSelecionarTipo: (e) => {
|
|
2563
2654
|
this._tipoSelecionadoId = e, this.renderSeletorTipos();
|
|
2564
|
-
const
|
|
2565
|
-
this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo:
|
|
2655
|
+
const o = this._tipos.find((i) => String(i.id) === String(e));
|
|
2656
|
+
this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo: o } }));
|
|
2566
2657
|
},
|
|
2567
2658
|
onEditarTipo: (e) => this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2568
2659
|
onQuickSelect: (e) => this.dispatchEvent(new CustomEvent("ui-quick-select", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
@@ -2572,27 +2663,28 @@ class Nt extends oe {
|
|
|
2572
2663
|
}
|
|
2573
2664
|
renderCategorias() {
|
|
2574
2665
|
const e = this.shadow.getElementById("lista-categorias");
|
|
2575
|
-
e &&
|
|
2666
|
+
e && Mt({
|
|
2576
2667
|
listaContainer: e,
|
|
2577
2668
|
categorias: this._categorias,
|
|
2578
2669
|
termoBusca: this._termoBusca,
|
|
2579
|
-
onToggleCategoria: (
|
|
2670
|
+
onToggleCategoria: (o) => this.toggleCategoria(o),
|
|
2580
2671
|
linhaCtx: {
|
|
2581
2672
|
valoresAtuais: this.gerenciadorValores.getValores(),
|
|
2582
2673
|
valoresOriginais: this.gerenciadorValores.getValoresOriginais(),
|
|
2583
|
-
onAtualizarCampoVisual: (
|
|
2674
|
+
onAtualizarCampoVisual: (o, i) => ne(this.shadow, o, i),
|
|
2584
2675
|
editorCtx: {
|
|
2585
|
-
obterValorAtual: (
|
|
2586
|
-
registrarAlteracao: (
|
|
2587
|
-
this.gerenciadorValores.registrarAlteracao(
|
|
2676
|
+
obterValorAtual: (o) => this.gerenciadorValores.obterValor(o),
|
|
2677
|
+
registrarAlteracao: (o, i, a) => {
|
|
2678
|
+
this.gerenciadorValores.registrarAlteracao(o, i, a);
|
|
2588
2679
|
},
|
|
2589
|
-
focarProximoEditor: (
|
|
2590
|
-
|
|
2680
|
+
focarProximoEditor: (o) => dt(this.shadow, o),
|
|
2681
|
+
obterTextoMisto: () => this.textoMisto,
|
|
2682
|
+
despacharEventoAcao: (o, i) => {
|
|
2591
2683
|
this.dispatchEvent(
|
|
2592
2684
|
new CustomEvent("ui-acao-clique", {
|
|
2593
2685
|
bubbles: !0,
|
|
2594
2686
|
composed: !0,
|
|
2595
|
-
detail: { id:
|
|
2687
|
+
detail: { id: o.id, categoriaId: i, propriedade: o }
|
|
2596
2688
|
})
|
|
2597
2689
|
);
|
|
2598
2690
|
}
|
|
@@ -2601,67 +2693,75 @@ class Nt extends oe {
|
|
|
2601
2693
|
});
|
|
2602
2694
|
}
|
|
2603
2695
|
}
|
|
2604
|
-
|
|
2696
|
+
le("ui-tabela-propriedades", Ft);
|
|
2605
2697
|
export {
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
V,
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
gt as
|
|
2698
|
+
Ke as $,
|
|
2699
|
+
_t as A,
|
|
2700
|
+
At as B,
|
|
2701
|
+
Tt as C,
|
|
2702
|
+
Ye as D,
|
|
2703
|
+
Xe as E,
|
|
2704
|
+
je as F,
|
|
2705
|
+
It as G,
|
|
2706
|
+
We as H,
|
|
2707
|
+
qe as I,
|
|
2708
|
+
ct as J,
|
|
2709
|
+
dt as K,
|
|
2710
|
+
ce as L,
|
|
2711
|
+
ue as M,
|
|
2712
|
+
te as N,
|
|
2713
|
+
pe as O,
|
|
2714
|
+
Ge as P,
|
|
2715
|
+
He as Q,
|
|
2716
|
+
J as R,
|
|
2717
|
+
A as S,
|
|
2718
|
+
G as T,
|
|
2719
|
+
nt as U,
|
|
2720
|
+
Y as V,
|
|
2721
|
+
W,
|
|
2722
|
+
ze as X,
|
|
2723
|
+
V as Y,
|
|
2724
|
+
Be as Z,
|
|
2725
|
+
q as _,
|
|
2726
|
+
De as a,
|
|
2727
|
+
Ot as a0,
|
|
2728
|
+
Ve as a1,
|
|
2729
|
+
z as a2,
|
|
2730
|
+
Mt as a3,
|
|
2731
|
+
Fe as a4,
|
|
2732
|
+
Oe as a5,
|
|
2733
|
+
kt as a6,
|
|
2734
|
+
he as a7,
|
|
2735
|
+
T as a8,
|
|
2736
|
+
F as a9,
|
|
2737
|
+
S as aa,
|
|
2738
|
+
Qe as ab,
|
|
2739
|
+
ht as ac,
|
|
2740
|
+
j as ad,
|
|
2741
|
+
R as ae,
|
|
2742
|
+
Ce as b,
|
|
2743
|
+
Se as c,
|
|
2744
|
+
Ft as d,
|
|
2745
|
+
Ue as e,
|
|
2746
|
+
pt as f,
|
|
2747
|
+
Le as g,
|
|
2748
|
+
Rt as h,
|
|
2749
|
+
Ne as i,
|
|
2750
|
+
ne as j,
|
|
2751
|
+
ae as k,
|
|
2752
|
+
me as l,
|
|
2753
|
+
ut as m,
|
|
2754
|
+
Ut as n,
|
|
2755
|
+
Bt as o,
|
|
2756
|
+
Pt as p,
|
|
2757
|
+
zt as q,
|
|
2758
|
+
gt as r,
|
|
2759
|
+
bt as s,
|
|
2760
|
+
wt as t,
|
|
2761
|
+
Ct as u,
|
|
2762
|
+
vt as v,
|
|
2763
|
+
Et as w,
|
|
2764
|
+
xt as x,
|
|
2765
|
+
mt as y,
|
|
2766
|
+
ft as z
|
|
2667
2767
|
};
|