@thibezer/ui-components-kit 2.17.1 → 2.17.3
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 +15 -0
- package/dist/camadas.cjs +80 -83
- package/dist/camadas.js +1131 -869
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-atualizacao-incremental.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-colecao.d.ts +1 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-drop-ops.d.ts +34 -0
- package/dist/components/ui-camadas/camadas-lembranca.d.ts +2 -1
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +3 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +1 -0
- package/dist/custom-elements.json +4531 -4079
- package/dist/tipos-elementos.d.ts +3 -0
- package/dist/tipos-vue.d.ts +3 -0
- package/package.json +1 -1
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +0 -3
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +0 -6
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +0 -6
- package/dist/leaflet-DcO7uRC-.cjs +0 -1
- package/dist/leaflet-PPDKB6Dd.js +0 -69
- package/dist/motor-BCWqlv3e.cjs +0 -1
- package/dist/motor-CXjQjVba.js +0 -1386
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-1UU8vT-b.js +0 -198
- package/dist/ui-badge-B5J_c5P5.js +0 -197
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-badge-CKKKPdt8.cjs +0 -28
- package/dist/ui-badge-DC4y6Dik.cjs +0 -28
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-bU_bf6SU.js +0 -166
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-botao-xTbH5mpH.cjs +0 -12
- package/dist/ui-campo-texto-19tIrmBK.js +0 -377
- package/dist/ui-campo-texto-CH8mzX61.cjs +0 -16
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-DVU_sWV1.cjs +0 -16
- package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
- package/dist/ui-campo-texto-W5M0gNE4.js +0 -377
- package/dist/ui-card-0wu4rjEX.cjs +0 -20
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-BYyYxxY1.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- package/dist/ui-card-CojoGXaT.js +0 -144
- package/dist/ui-card-DRtpOo3l.js +0 -143
- package/dist/ui-controle-cores-B4R6ct4I.js +0 -291
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-Bq_XUrIQ.cjs +0 -32
- package/dist/ui-controle-cores-BtA6yzu3.js +0 -291
- package/dist/ui-controle-cores-C8um-If9.cjs +0 -32
- package/dist/ui-controle-cores-CHMKGemo.cjs +0 -141
- package/dist/ui-controle-cores-C_cVXxCn.js +0 -291
- package/dist/ui-controle-cores-CuDFS8Y8.cjs +0 -32
- package/dist/ui-controle-cores-Dog7ERYv.js +0 -697
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-linha-BxhEBn27.js +0 -749
- package/dist/ui-linha-C306zxWG.cjs +0 -19
- package/dist/ui-linha-C_azWkcG.js +0 -517
- package/dist/ui-linha-CcalUBDw.cjs +0 -38
- package/dist/ui-linha-DAz6DBcl.cjs +0 -38
- package/dist/ui-linha-DkxwMhD-.js +0 -749
- package/dist/ui-modal-4nU-tXjO.cjs +0 -18
- package/dist/ui-modal-BkYvNP0G.js +0 -214
- package/dist/ui-modal-BwB9fksp.js +0 -214
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-modal-DBOtSTbR.js +0 -238
- package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +0 -1233
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +0 -1173
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-DyF5YLsV.js +0 -418
- package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-seletor-cor-C4U2eqxY.cjs +0 -82
- package/dist/ui-seletor-cor-D2_C6Aor.js +0 -391
- package/dist/ui-seletor-cor-DPKqf5wb.cjs +0 -82
- package/dist/ui-seletor-cor-FYtRccnK.js +0 -396
- package/dist/ui-skeleton-B2Rgrv8o.js +0 -648
- package/dist/ui-skeleton-DEHwpDqa.js +0 -648
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-DiOxTBZK.cjs +0 -52
- package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
- package/dist/ui-skeleton-W9uwIceA.js +0 -585
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-skeleton-sIphhOSx.cjs +0 -52
- package/dist/ui-switch-BL-x_-SM.js +0 -1202
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-C0i_3QXu.cjs +0 -66
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-switch-DAIgOhqr.cjs +0 -66
- package/dist/ui-switch-_F8yubdX.js +0 -1203
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +0 -3202
- package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +0 -142
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +0 -141
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-BoYXzP5Z.js +0 -3191
- package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +0 -141
- package/dist/ui-tabela-propriedades-C5YYnod1.js +0 -3053
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +0 -142
- package/dist/ui-tabela-propriedades-CyPyKXtB.js +0 -3013
- package/dist/ui-tabela-propriedades-DWOKznMN.cjs +0 -142
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- package/dist/ui-tabela-propriedades-DqvPilK_.cjs +0 -142
- package/dist/ui-tabela-propriedades-DuaC4sFX.js +0 -2767
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -1,3053 +0,0 @@
|
|
|
1
|
-
var ke = Object.defineProperty;
|
|
2
|
-
var ze = (t, r, e) => r in t ? ke(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
-
var v = (t, r, e) => ze(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
-
import { L as F } from "./listener-bag-DQgv7OON.js";
|
|
5
|
-
import { a as D } from "./parts-CaoQiCfI.js";
|
|
6
|
-
import { d as V, S as fe } from "./ssr-safe-5cWfJP-s.js";
|
|
7
|
-
import { h as Se } from "./svg-seguro-ChVJ2L2z.js";
|
|
8
|
-
class Le {
|
|
9
|
-
constructor(r) {
|
|
10
|
-
v(this, "autoFetchController", null);
|
|
11
|
-
v(this, "emVoo", null);
|
|
12
|
-
this.ctx = r;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Busca os dados. Resolve `true` em sucesso e `false` em falha, cancelamento ou requisição
|
|
16
|
-
* substituída (nunca rejeita; o motivo da falha vai no evento `ui-fetch-erro`).
|
|
17
|
-
* Uma chamada com a mesma URL de uma requisição em andamento reaproveita essa requisição.
|
|
18
|
-
*/
|
|
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
|
-
this.cancelarEmVoo();
|
|
23
|
-
const e = new AbortController();
|
|
24
|
-
this.autoFetchController = e;
|
|
25
|
-
const i = this.executar(r, e);
|
|
26
|
-
return this.emVoo = { url: r, promessa: i }, i;
|
|
27
|
-
}
|
|
28
|
-
emitir(r, e) {
|
|
29
|
-
this.ctx.host.dispatchEvent(new CustomEvent(r, { bubbles: !0, composed: !0, detail: e }));
|
|
30
|
-
}
|
|
31
|
-
erro(r, e, i, o) {
|
|
32
|
-
const a = e instanceof Error ? e.message : String(e);
|
|
33
|
-
console.error("[ui-tabela] Erro ao carregar dados remotos:", e);
|
|
34
|
-
const n = { url: r, erro: a, origem: i };
|
|
35
|
-
o !== void 0 && (n.status = o), this.emitir("ui-fetch-erro", n);
|
|
36
|
-
}
|
|
37
|
-
async executar(r, e) {
|
|
38
|
-
var l, d, u, c;
|
|
39
|
-
const i = () => this.autoFetchController === e, o = () => {
|
|
40
|
-
this.autoFetchController === e && (this.autoFetchController = null, this.emVoo = null);
|
|
41
|
-
};
|
|
42
|
-
this.ctx.onCarregandoAlterado(!0), this.emitir("ui-fetch-start", { url: r });
|
|
43
|
-
let a = "rede", n;
|
|
44
|
-
try {
|
|
45
|
-
const p = { ...((d = (l = this.ctx).getOpcoes) == null ? void 0 : d.call(l)) ?? {}, signal: e.signal }, h = await (((c = (u = this.ctx).getFetcher) == null ? void 0 : c.call(u)) ?? ((b, E) => fetch(b, E)))(r, p);
|
|
46
|
-
if (!h.ok)
|
|
47
|
-
throw a = "http", n = h.status, new Error(`HTTP ${h.status}: ${h.statusText}`);
|
|
48
|
-
a = "json";
|
|
49
|
-
const m = await h.json(), g = 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(g) ? g : [];
|
|
50
|
-
return i() ? (a = "render", this.ctx.onDadosRecebidos(f), o(), this.ctx.onCarregandoAlterado(!1), this.emitir("ui-fetch-sucesso", { url: r, total: f.length, dados: f }), !0) : !1;
|
|
51
|
-
} catch (p) {
|
|
52
|
-
return (p == null ? void 0 : p.name) === "AbortError" ? (i() && (o(), this.ctx.onCarregandoAlterado(!1)), this.emitir("ui-fetch-cancelado", { url: r }), !1) : (i() && (o(), this.ctx.onCarregandoAlterado(!1), this.erro(r, p, a, n)), !1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/** Cancela a requisição em andamento (se houver) e libera o indicador de carregamento. */
|
|
56
|
-
abortar() {
|
|
57
|
-
this.autoFetchController && (this.cancelarEmVoo(), this.ctx.onCarregandoAlterado(!1));
|
|
58
|
-
}
|
|
59
|
-
cancelarEmVoo() {
|
|
60
|
-
if (this.autoFetchController) {
|
|
61
|
-
const r = this.autoFetchController;
|
|
62
|
-
this.autoFetchController = null, this.emVoo = null, r.abort();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const Me = ["id", "_id", "codigo", "key"];
|
|
67
|
-
function Ne(t, r) {
|
|
68
|
-
return t != null && (t === r || String(t) === String(r));
|
|
69
|
-
}
|
|
70
|
-
function ne(t, r) {
|
|
71
|
-
let e = -1;
|
|
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 Re(t, r, e = "id", i = !1) {
|
|
75
|
-
if (!t || t.length === 0) return -1;
|
|
76
|
-
if (typeof r == "function")
|
|
77
|
-
return t.findIndex(r);
|
|
78
|
-
if (i) return ne(r, t.length);
|
|
79
|
-
const o = [e, ...Me.filter((a) => a !== e)];
|
|
80
|
-
for (const a of o) {
|
|
81
|
-
const n = t.findIndex((l) => !!l && typeof l == "object" && Ne(l[a], r));
|
|
82
|
-
if (n !== -1) return n;
|
|
83
|
-
}
|
|
84
|
-
return ne(r, t.length);
|
|
85
|
-
}
|
|
86
|
-
class Te {
|
|
87
|
-
constructor(r) {
|
|
88
|
-
v(this, "itemSelecionado", null);
|
|
89
|
-
v(this, "indiceSelecionado", null);
|
|
90
|
-
this.ctx = r;
|
|
91
|
-
}
|
|
92
|
-
/** Mesmo objeto ou mesmo valor na chave configurada. */
|
|
93
|
-
indiceDoItem(r, e) {
|
|
94
|
-
const i = this.ctx.getChaveId(), o = r.indexOf(e);
|
|
95
|
-
return o >= 0 ? o : e[i] == null ? -1 : r.findIndex((a) => (a == null ? void 0 : a[i]) != null && String(a[i]) === String(e[i]));
|
|
96
|
-
}
|
|
97
|
-
getItemSelecionado() {
|
|
98
|
-
return this.itemSelecionado;
|
|
99
|
-
}
|
|
100
|
-
setItemSelecionado(r) {
|
|
101
|
-
this.itemSelecionado = r;
|
|
102
|
-
const e = r ? this.indiceDoItem(this.ctx.getDadosExibicao(), r) : -1;
|
|
103
|
-
this.indiceSelecionado = e >= 0 ? e : null, this.atualizarLinhasSelecionadas();
|
|
104
|
-
}
|
|
105
|
-
getIndiceSelecionado() {
|
|
106
|
-
return this.indiceSelecionado;
|
|
107
|
-
}
|
|
108
|
-
setIndiceSelecionado(r) {
|
|
109
|
-
const e = this.ctx.getDadosExibicao(), i = r !== null && r >= 0 && r < e.length;
|
|
110
|
-
this.indiceSelecionado = i ? r : null, this.itemSelecionado = i ? e[r] : null, this.atualizarLinhasSelecionadas();
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Reaplica a seleção após ordenar, filtrar ou trocar os dados.
|
|
114
|
-
* - Item ainda exibido: atualiza o índice (e a referência, se veio um objeto novo com a mesma chave).
|
|
115
|
-
* - Item só escondido pelo filtro: mantém a seleção (sem índice) para reaparecer ao limpar o filtro.
|
|
116
|
-
* - Item removido dos dados: limpa a seleção e emite `ui-selecao-removida`.
|
|
117
|
-
*/
|
|
118
|
-
reconciliar() {
|
|
119
|
-
const r = this.itemSelecionado;
|
|
120
|
-
if (!r) {
|
|
121
|
-
this.indiceSelecionado = null;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const e = this.ctx.getDadosExibicao(), i = this.indiceDoItem(e, r);
|
|
125
|
-
if (i >= 0) {
|
|
126
|
-
this.indiceSelecionado = i, this.substituirReferencia(r, e[i]);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
this.indiceSelecionado = null;
|
|
130
|
-
const o = this.ctx.getDadosOriginais(), a = this.indiceDoItem(o, r);
|
|
131
|
-
if (a >= 0) {
|
|
132
|
-
this.substituirReferencia(r, o[a]);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
this.itemSelecionado = null, this.ctx.host.dispatchEvent(
|
|
136
|
-
new CustomEvent("ui-selecao-removida", { bubbles: !0, composed: !0, detail: { item: r } })
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
/** Mesmo registro com outro objeto (dados recarregados): atualiza a referência e avisa. */
|
|
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
|
-
);
|
|
144
|
-
}
|
|
145
|
-
limparSelecao() {
|
|
146
|
-
this.itemSelecionado = null, this.indiceSelecionado = null, this.atualizarLinhasSelecionadas();
|
|
147
|
-
}
|
|
148
|
-
isItemSelecionado(r, e) {
|
|
149
|
-
if (this.itemSelecionado) {
|
|
150
|
-
if (this.itemSelecionado === r) return !0;
|
|
151
|
-
const i = this.ctx.getChaveId();
|
|
152
|
-
if (r[i] != null && this.itemSelecionado[i] != null)
|
|
153
|
-
return String(r[i]) === String(this.itemSelecionado[i]);
|
|
154
|
-
if (r.id != null && this.itemSelecionado.id != null)
|
|
155
|
-
return String(r.id) === String(this.itemSelecionado.id);
|
|
156
|
-
}
|
|
157
|
-
return this.indiceSelecionado !== null && this.indiceSelecionado === e;
|
|
158
|
-
}
|
|
159
|
-
atualizarLinhasSelecionadas() {
|
|
160
|
-
const r = this.ctx.getTbody();
|
|
161
|
-
if (!r) return;
|
|
162
|
-
const e = this.ctx.getDadosExibicao();
|
|
163
|
-
r.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach((o) => {
|
|
164
|
-
const a = o.getAttribute("data-index"), n = a !== null ? parseInt(a, 10) : -1, l = n >= 0 ? e[n] : null, d = l ? this.isItemSelecionado(l, n) : !1;
|
|
165
|
-
o.classList.toggle("ui-tabela__tr--selecionada", d), D(o, "linha-selecionada", d), d ? (o.setAttribute("data-selecionada", "true"), o.setAttribute("aria-current", "true"), o.setAttribute("aria-selected", "true")) : (o.removeAttribute("data-selecionada"), o.removeAttribute("aria-current"), o.setAttribute("aria-selected", "false"));
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
rolarPara(r, e) {
|
|
169
|
-
const i = this.ctx.getDadosExibicao(), o = Re(i, r, this.ctx.getChaveId(), (e == null ? void 0 : e.porIndice) === !0);
|
|
170
|
-
if (o === -1)
|
|
171
|
-
return !1;
|
|
172
|
-
if (e != null && e.selecionar) {
|
|
173
|
-
const a = i[o];
|
|
174
|
-
this.itemSelecionado = a, this.indiceSelecionado = o, this.atualizarLinhasSelecionadas(), this.ctx.onLinhaAtiva(o), this.ctx.host.dispatchEvent(
|
|
175
|
-
new CustomEvent("ui-linha-selecionada", {
|
|
176
|
-
bubbles: !0,
|
|
177
|
-
composed: !0,
|
|
178
|
-
detail: { item: a, indice: o }
|
|
179
|
-
})
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
return this.ctx.onRolarParaIndice(o, (e == null ? void 0 : e.comportamento) || "smooth");
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function De(t, r, e) {
|
|
186
|
-
return t !== e ? {
|
|
187
|
-
idColuna: e,
|
|
188
|
-
direcao: "asc"
|
|
189
|
-
} : r === "asc" ? {
|
|
190
|
-
idColuna: e,
|
|
191
|
-
direcao: "desc"
|
|
192
|
-
} : r === "desc" ? {
|
|
193
|
-
idColuna: null,
|
|
194
|
-
direcao: "original"
|
|
195
|
-
} : {
|
|
196
|
-
idColuna: e,
|
|
197
|
-
direcao: "asc"
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
const Be = new Intl.Collator("pt-BR", { numeric: !0, sensitivity: "base" });
|
|
201
|
-
function se(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 Oe(t, r, e) {
|
|
208
|
-
if (e === "data" || !e && (t instanceof Date || r instanceof Date)) {
|
|
209
|
-
const i = se(t), o = se(r);
|
|
210
|
-
if (!Number.isNaN(i) && !Number.isNaN(o)) return i - o;
|
|
211
|
-
} else if (e === "numero" || !e && typeof t == "number" && typeof r == "number") {
|
|
212
|
-
const i = Number(t), o = Number(r);
|
|
213
|
-
if (!Number.isNaN(i) && !Number.isNaN(o)) return i - o;
|
|
214
|
-
} else if (e === "booleano" || !e && typeof t == "boolean" && typeof r == "boolean")
|
|
215
|
-
return +!!t - +!!r;
|
|
216
|
-
return Be.compare(String(t), String(r));
|
|
217
|
-
}
|
|
218
|
-
function Ie(t, r, e, i) {
|
|
219
|
-
if (!r || e === "original")
|
|
220
|
-
return [...t];
|
|
221
|
-
const o = e === "desc" ? -1 : 1;
|
|
222
|
-
return [...t].sort((a, n) => {
|
|
223
|
-
const l = a[r], d = n[r], u = l == null, c = d == null;
|
|
224
|
-
return u || c ? u === c ? 0 : u ? 1 : -1 : i != null && i.comparador ? i.comparador(l, d, a, n) * o : l === d ? 0 : Oe(l, d, i == null ? void 0 : i.tipo) * o;
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
function W(t) {
|
|
228
|
-
return t.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
229
|
-
}
|
|
230
|
-
class Pe {
|
|
231
|
-
constructor() {
|
|
232
|
-
v(this, "dadosOriginais", []);
|
|
233
|
-
v(this, "dadosExibicao", []);
|
|
234
|
-
v(this, "colunaOrdenada", null);
|
|
235
|
-
v(this, "direcaoOrdenacao", "original");
|
|
236
|
-
v(this, "ultimoFiltro", "");
|
|
237
|
-
/** Colunas declaradas: o filtro olha só elas (vazio = todos os campos do registro). */
|
|
238
|
-
v(this, "colunasFiltro", []);
|
|
239
|
-
v(this, "colunas", []);
|
|
240
|
-
/** Ordenação feita pelo servidor: a tabela guarda coluna/direção (indicador) mas não reordena os dados. */
|
|
241
|
-
v(this, "ordenacaoRemota", !1);
|
|
242
|
-
}
|
|
243
|
-
setColunas(r) {
|
|
244
|
-
this.colunas = r, this.colunaOrdenada && this.aplicarOrdenacao();
|
|
245
|
-
}
|
|
246
|
-
setOrdenacaoRemota(r) {
|
|
247
|
-
this.ordenacaoRemota !== r && (this.ordenacaoRemota = r, this.aplicarOrdenacao());
|
|
248
|
-
}
|
|
249
|
-
/** Restaura coluna/direção (ex.: `ui-sort` cancelado) e recalcula. */
|
|
250
|
-
restaurarOrdenacao(r, e) {
|
|
251
|
-
this.colunaOrdenada = r, this.direcaoOrdenacao = e, this.aplicarOrdenacao();
|
|
252
|
-
}
|
|
253
|
-
setColunasFiltro(r) {
|
|
254
|
-
this.colunasFiltro = r, this.ultimoFiltro && this.aplicarOrdenacao();
|
|
255
|
-
}
|
|
256
|
-
getDadosOriginais() {
|
|
257
|
-
return this.dadosOriginais;
|
|
258
|
-
}
|
|
259
|
-
setDadosOriginais(r) {
|
|
260
|
-
this.dadosOriginais = Array.isArray(r) ? r.filter((e) => e != null) : [], this.aplicarOrdenacao();
|
|
261
|
-
}
|
|
262
|
-
getDadosExibicao() {
|
|
263
|
-
return this.dadosExibicao;
|
|
264
|
-
}
|
|
265
|
-
getColunaOrdenada() {
|
|
266
|
-
return this.colunaOrdenada;
|
|
267
|
-
}
|
|
268
|
-
setColunaOrdenada(r) {
|
|
269
|
-
this.colunaOrdenada = r, r ? this.direcaoOrdenacao === "original" && (this.direcaoOrdenacao = "asc") : this.direcaoOrdenacao = "original", this.aplicarOrdenacao();
|
|
270
|
-
}
|
|
271
|
-
getDirecaoOrdenacao() {
|
|
272
|
-
return this.direcaoOrdenacao;
|
|
273
|
-
}
|
|
274
|
-
setDirecaoOrdenacao(r) {
|
|
275
|
-
this.direcaoOrdenacao = r || "original", this.direcaoOrdenacao === "original" && (this.colunaOrdenada = null), this.aplicarOrdenacao();
|
|
276
|
-
}
|
|
277
|
-
alternarOrdenacaoColuna(r) {
|
|
278
|
-
if (!r.ordenavel) return null;
|
|
279
|
-
const e = De(this.colunaOrdenada, this.direcaoOrdenacao, r.id);
|
|
280
|
-
return this.colunaOrdenada = e.idColuna, this.direcaoOrdenacao = e.direcao, this.aplicarOrdenacao(), e;
|
|
281
|
-
}
|
|
282
|
-
/** Recalcula a lista exibida: filtro vigente e, sobre o resultado, a ordenação da coluna (valem juntos). */
|
|
283
|
-
aplicarOrdenacao() {
|
|
284
|
-
const r = this.ultimoFiltro, e = r ? this.dadosOriginais.filter((o) => this.casaFiltro(o, r)) : this.dadosOriginais, i = this.colunaOrdenada ? this.colunas.find((o) => o.id === this.colunaOrdenada) : null;
|
|
285
|
-
this.dadosExibicao = this.ordenacaoRemota ? [...e] : Ie(e, this.colunaOrdenada, this.direcaoOrdenacao, i);
|
|
286
|
-
}
|
|
287
|
-
casaFiltro(r, e) {
|
|
288
|
-
return (this.colunasFiltro.length > 0 ? this.colunasFiltro : Object.keys(r)).some((o) => {
|
|
289
|
-
const a = r[o], n = this.colunas.find((d) => d.id === o);
|
|
290
|
-
if (n != null && n.textoFiltro)
|
|
291
|
-
try {
|
|
292
|
-
if (W(String(n.textoFiltro(a, r) ?? "")).includes(e)) return !0;
|
|
293
|
-
} catch {
|
|
294
|
-
}
|
|
295
|
-
if (a == null || typeof a == "object" && !(a instanceof Date)) return !1;
|
|
296
|
-
const l = a instanceof Date ? `${a.toISOString()} ${a.toLocaleDateString("pt-BR")}` : String(a);
|
|
297
|
-
return W(l).includes(e);
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
/** Há um filtro de texto aplicado (o vazio vira "sem resultados"). */
|
|
301
|
-
temFiltro() {
|
|
302
|
-
return this.ultimoFiltro !== "";
|
|
303
|
-
}
|
|
304
|
-
filtrar(r) {
|
|
305
|
-
this.ultimoFiltro = W((r || "").trim()), this.aplicarOrdenacao();
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
const Fe = ':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 be(t) {
|
|
310
|
-
return t == null || t === "" ? "" : typeof t == "number" ? `${t}px` : t;
|
|
311
|
-
}
|
|
312
|
-
function ge(t) {
|
|
313
|
-
return t === "centro" || t === "center" ? "ui-tabela--alinhar-centro" : t === "direita" || t === "right" ? "ui-tabela--alinhar-direita" : "ui-tabela--alinhar-esquerda";
|
|
314
|
-
}
|
|
315
|
-
function ve(t) {
|
|
316
|
-
return t === "centro" || t === "center" ? "center" : t === "direita" || t === "right" ? "right" : "left";
|
|
317
|
-
}
|
|
318
|
-
function le(t) {
|
|
319
|
-
return t === "compacta" ? 30 : t === "relaxada" ? 56 : 42;
|
|
320
|
-
}
|
|
321
|
-
function Ve(t, r, e, i) {
|
|
322
|
-
t.innerHTML = `<style>${Fe}</style>`;
|
|
323
|
-
const o = document.createElement("div");
|
|
324
|
-
o.className = "ui-tabela-container", o.setAttribute("part", "base"), e && (o.style.maxHeight = e);
|
|
325
|
-
const a = document.createElement("div");
|
|
326
|
-
a.className = "ui-tabela__empty", a.setAttribute("part", "vazio"), a.style.display = "none", a.setAttribute("role", "status");
|
|
327
|
-
const n = document.createElement("div");
|
|
328
|
-
n.innerHTML = `
|
|
329
|
-
<svg class="ui-tabela__empty-icon" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
|
|
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
|
-
</svg>`;
|
|
332
|
-
const l = document.createElement("span");
|
|
333
|
-
l.className = "ui-tabela__empty-text", l.textContent = r, a.appendChild(n), a.appendChild(l);
|
|
334
|
-
const d = document.createElement("table");
|
|
335
|
-
d.className = "ui-tabela", d.setAttribute("part", "tabela"), d.setAttribute("role", "grid");
|
|
336
|
-
const u = document.createElement("colgroup"), c = document.createElement("thead"), p = document.createElement("tbody");
|
|
337
|
-
d.appendChild(u), d.appendChild(c), d.appendChild(p);
|
|
338
|
-
const s = document.createElement("div");
|
|
339
|
-
s.className = "ui-tabela__erro", s.setAttribute("part", "erro"), s.setAttribute("role", "alert"), s.style.display = "none";
|
|
340
|
-
const h = document.createElement("div");
|
|
341
|
-
h.className = "ui-tabela__erro-texto";
|
|
342
|
-
const m = document.createElement("span");
|
|
343
|
-
m.className = "ui-tabela__erro-mensagem";
|
|
344
|
-
const g = document.createElement("span");
|
|
345
|
-
g.className = "ui-tabela__erro-detalhe", h.appendChild(m), h.appendChild(g);
|
|
346
|
-
const f = document.createElement("button");
|
|
347
|
-
f.type = "button", f.className = "ui-tabela__erro-acao", f.setAttribute("part", "erro-acao"), f.textContent = "Tentar novamente", s.appendChild(h), s.appendChild(f);
|
|
348
|
-
const b = document.createElement("div");
|
|
349
|
-
b.className = "ui-tabela__sr", b.setAttribute("role", "status"), b.setAttribute("aria-live", "polite"), o.appendChild(s), o.appendChild(d), o.appendChild(a), o.appendChild(b);
|
|
350
|
-
const E = document.createElement("div");
|
|
351
|
-
return E.className = "ui-tabela__loading", E.setAttribute("part", "carregando"), E.setAttribute("role", "status"), E.setAttribute("aria-live", "polite"), E.style.display = i ? "flex" : "none", E.innerHTML = `
|
|
352
|
-
<div class="ui-tabela__spinner" aria-hidden="true"></div>
|
|
353
|
-
<span class="ui-tabela__loading-texto">Carregando dados...</span>
|
|
354
|
-
`, o.appendChild(E), t.appendChild(o), {
|
|
355
|
-
containerElement: o,
|
|
356
|
-
tableElement: d,
|
|
357
|
-
theadElement: c,
|
|
358
|
-
tbodyElement: p,
|
|
359
|
-
colgroupElement: u,
|
|
360
|
-
emptyElement: a,
|
|
361
|
-
loadingElement: E,
|
|
362
|
-
erroElement: s,
|
|
363
|
-
anuncioElement: b
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
function He(t) {
|
|
367
|
-
var a, n;
|
|
368
|
-
if (!t.theadElement || !t.colgroupElement) return;
|
|
369
|
-
t.headerListeners.cleanup();
|
|
370
|
-
const e = t.theadElement.getRootNode().activeElement, i = 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 o = document.createElement("tr");
|
|
373
|
-
if (o.setAttribute("aria-rowindex", "1"), t.colunas.forEach((l, d) => {
|
|
374
|
-
const u = document.createElement("col");
|
|
375
|
-
l.largura !== void 0 && (u.style.width = t.formatWidth(l.largura)), t.colgroupElement.appendChild(u);
|
|
376
|
-
const c = document.createElement("th"), p = t.getAlignmentClass(l.alinhamento);
|
|
377
|
-
if (c.className = p, c.setAttribute("part", "celula-cabecalho"), c.scope = "col", c.setAttribute("data-coluna", l.id), c.style.textAlign = t.getTextAlign(l.alinhamento), l.largura !== void 0 && (c.style.width = t.formatWidth(l.largura)), l.larguraMinima !== void 0 && (c.style.minWidth = t.formatWidth(l.larguraMinima)), l.larguraMaxima !== void 0) {
|
|
378
|
-
const y = t.formatWidth(l.larguraMaxima);
|
|
379
|
-
c.style.maxWidth = y, c.style.overflow = "hidden", c.style.textOverflow = "ellipsis", c.style.whiteSpace = "nowrap";
|
|
380
|
-
}
|
|
381
|
-
l.tooltip && (c.title = l.tooltip);
|
|
382
|
-
const s = !!l.ordenavel && t.colunaOrdenada === l.id && t.direcaoOrdenacao !== "original", h = s && t.direcaoOrdenacao === "desc";
|
|
383
|
-
if (l.ordenavel) {
|
|
384
|
-
c.classList.add("ui-tabela__th--ordenavel");
|
|
385
|
-
const y = () => t.onHeaderClick(l);
|
|
386
|
-
t.headerListeners.add(c, "click", y), c.setAttribute("aria-sort", s ? h ? "descending" : "ascending" : "none");
|
|
387
|
-
}
|
|
388
|
-
const m = (y) => t.onHeaderContextMenu(y, l, d, c);
|
|
389
|
-
t.headerListeners.add(c, "contextmenu", m);
|
|
390
|
-
const g = document.createElement("div");
|
|
391
|
-
g.className = "ui-tabela__header-content";
|
|
392
|
-
const f = document.createElement("span");
|
|
393
|
-
if (f.className = "ui-tabela__header-text", f.textContent = l.rotulo, g.appendChild(f), l.ordenavel) {
|
|
394
|
-
const y = document.createElement("span");
|
|
395
|
-
y.className = "ui-tabela__sort-icon";
|
|
396
|
-
const _ = s ? h ? "ui-tabela__sort-arrow--desc" : "ui-tabela__sort-arrow--asc" : "ui-tabela__sort-arrow--inativo";
|
|
397
|
-
y.setAttribute("aria-hidden", "true"), y.innerHTML = `<svg class="ui-tabela__sort-arrow ${_}" 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>`, g.appendChild(y);
|
|
398
|
-
}
|
|
399
|
-
if (l.ordenavel) {
|
|
400
|
-
const y = document.createElement("button");
|
|
401
|
-
y.type = "button", y.className = "ui-tabela__ordenar", y.setAttribute("part", "ordenar"), y.appendChild(g), c.appendChild(y);
|
|
402
|
-
} else
|
|
403
|
-
c.appendChild(g);
|
|
404
|
-
const b = document.createElement("div");
|
|
405
|
-
b.className = "ui-tabela__resizer", b.setAttribute("part", "redimensionador"), b.title = "Arrastar para redimensionar largura (duplo-clique para auto-ajuste)", b.tabIndex = 0, b.setAttribute("role", "separator"), b.setAttribute("aria-orientation", "vertical"), b.setAttribute("aria-label", `Redimensionar coluna ${l.rotulo}`);
|
|
406
|
-
const E = (y) => t.onInitColumnResize(y, l, d, c, b);
|
|
407
|
-
t.headerListeners.add(b, "mousedown", E);
|
|
408
|
-
const x = (y) => {
|
|
409
|
-
const _ = y;
|
|
410
|
-
_.pointerType === "mouse" || !_.pointerType || t.onInitColumnResize(_, l, d, c, b);
|
|
411
|
-
};
|
|
412
|
-
t.headerListeners.add(b, "pointerdown", x);
|
|
413
|
-
const w = (y) => {
|
|
414
|
-
var A, L;
|
|
415
|
-
const _ = y, k = _.shiftKey ? 50 : 10;
|
|
416
|
-
if (_.key === "ArrowRight")
|
|
417
|
-
_.preventDefault(), (A = t.onResizeTeclado) == null || A.call(t, k, l, d, c, u);
|
|
418
|
-
else if (_.key === "ArrowLeft")
|
|
419
|
-
_.preventDefault(), (L = t.onResizeTeclado) == null || L.call(t, -k, l, d, c, u);
|
|
420
|
-
else if (_.key === "Enter" || _.key === "F2") {
|
|
421
|
-
_.preventDefault();
|
|
422
|
-
const z = c.getBoundingClientRect();
|
|
423
|
-
t.onHeaderContextMenu(new MouseEvent("contextmenu", { clientX: z.left, clientY: z.bottom }), l, d, c);
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
t.headerListeners.add(b, "keydown", w);
|
|
427
|
-
const C = (y) => {
|
|
428
|
-
y.stopPropagation(), t.onColumnAutoFit(l, c, u);
|
|
429
|
-
};
|
|
430
|
-
t.headerListeners.add(b, "dblclick", C), t.headerListeners.add(b, "click", (y) => y.stopPropagation()), c.appendChild(b), o.appendChild(c);
|
|
431
|
-
}), t.theadElement.appendChild(o), i !== null) {
|
|
432
|
-
const l = Array.from(o.children).find((d) => d.getAttribute("data-coluna") === i);
|
|
433
|
-
(n = l == null ? void 0 : l.querySelector(".ui-tabela__ordenar")) == null || n.focus();
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
const qe = 'button, input, select, textarea, a, summary, [role="button"], [data-prevent-select]';
|
|
437
|
-
function $e(t, r) {
|
|
438
|
-
for (const e of t.composedPath()) {
|
|
439
|
-
if (e === r) return !1;
|
|
440
|
-
if (e instanceof Element && e.matches(qe)) return !0;
|
|
441
|
-
}
|
|
442
|
-
return !1;
|
|
443
|
-
}
|
|
444
|
-
function je(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 s = t.emptyElement.querySelector(".ui-tabela__empty-text"), h = t.filtroAtivo ? t.textoSemResultados : t.textoVazio;
|
|
449
|
-
s && h !== void 0 && (s.textContent = h);
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
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, i = t.virtualizar && r > 30;
|
|
454
|
-
let o = 0, a = r;
|
|
455
|
-
if (i) {
|
|
456
|
-
const s = t.containerElement.scrollTop, h = t.containerElement.clientHeight || 400, m = 5;
|
|
457
|
-
o = Math.max(0, Math.floor(s / e) - m), a = Math.min(r, Math.ceil((s + h) / e) + m);
|
|
458
|
-
}
|
|
459
|
-
const l = t.tbodyElement.getRootNode().activeElement, d = l && l.parentElement === t.tbodyElement ? l.getAttribute("data-index") : null, u = t.indiceAtivo ?? null, c = u !== null && u >= o && u < a ? u : o;
|
|
460
|
-
t.tbodyElement.innerHTML = "";
|
|
461
|
-
const p = document.createDocumentFragment();
|
|
462
|
-
if (i && o > 0) {
|
|
463
|
-
const s = document.createElement("tr");
|
|
464
|
-
s.className = "ui-tabela__virtual-spacer", s.setAttribute("aria-hidden", "true"), s.style.height = `${o * e}px`;
|
|
465
|
-
const h = document.createElement("td");
|
|
466
|
-
h.colSpan = t.colunas.length || 1, s.appendChild(h), p.appendChild(s);
|
|
467
|
-
}
|
|
468
|
-
for (let s = o; s < a; s++) {
|
|
469
|
-
const h = t.dadosExibicao[s], m = document.createElement("tr");
|
|
470
|
-
m.setAttribute("data-index", String(s)), m.setAttribute("part", "linha"), m.setAttribute("aria-rowindex", String(s + 2)), m.setAttribute("aria-selected", "false"), m.tabIndex = s === c ? 0 : -1, s % 2 === 1 && m.classList.add("ui-tabela__tr--par");
|
|
471
|
-
const g = t.chaveId;
|
|
472
|
-
h[g] !== void 0 ? m.setAttribute("data-id", String(h[g])) : 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, s) && (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
|
-
$e(f, m) || t.onLinhaClique(h, s);
|
|
474
|
-
}), t.colunas.forEach((f) => {
|
|
475
|
-
const b = document.createElement("td"), E = t.getAlignmentClass(f.alinhamento);
|
|
476
|
-
if (b.className = E, b.setAttribute("part", "celula"), b.style.textAlign = t.getTextAlign(f.alinhamento), f.larguraMaxima !== void 0) {
|
|
477
|
-
const C = t.formatWidth(f.larguraMaxima);
|
|
478
|
-
b.style.maxWidth = C, b.style.overflow = "hidden", b.style.textOverflow = "ellipsis", b.style.whiteSpace = "nowrap";
|
|
479
|
-
}
|
|
480
|
-
const x = document.createElement("div");
|
|
481
|
-
x.className = "ui-tabela__cell-content", f.larguraMaxima !== void 0 && x.classList.add("ui-tabela__cell-truncate");
|
|
482
|
-
const w = h[f.id];
|
|
483
|
-
if (typeof f.render == "function")
|
|
484
|
-
try {
|
|
485
|
-
const C = f.render(w, h, s);
|
|
486
|
-
C instanceof Node ? x.appendChild(C) : x.textContent = String(C ?? "");
|
|
487
|
-
} catch (C) {
|
|
488
|
-
console.error(`[ui-tabela] Erro no render da coluna "${f.id}" (linha ${s}):`, C), x.textContent = "";
|
|
489
|
-
}
|
|
490
|
-
else if (w instanceof Node)
|
|
491
|
-
x.appendChild(w);
|
|
492
|
-
else {
|
|
493
|
-
const C = w != null ? String(w) : "";
|
|
494
|
-
x.textContent = C, f.larguraMaxima !== void 0 && !f.tooltip && (b.title = C);
|
|
495
|
-
}
|
|
496
|
-
b.appendChild(x), m.appendChild(b);
|
|
497
|
-
}), p.appendChild(m);
|
|
498
|
-
}
|
|
499
|
-
if (i && a < r) {
|
|
500
|
-
const s = document.createElement("tr");
|
|
501
|
-
s.className = "ui-tabela__virtual-spacer", s.setAttribute("aria-hidden", "true"), s.style.height = `${(r - a) * e}px`;
|
|
502
|
-
const h = document.createElement("td");
|
|
503
|
-
h.colSpan = t.colunas.length || 1, s.appendChild(h), p.appendChild(s);
|
|
504
|
-
}
|
|
505
|
-
if (t.tbodyElement.appendChild(p), d !== null) {
|
|
506
|
-
const s = t.tbodyElement.querySelector(`tr[data-index="${d}"]`);
|
|
507
|
-
s == null || s.focus({ preventScroll: !0 });
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
function de(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
|
-
}
|
|
515
|
-
function G(t, r) {
|
|
516
|
-
const e = de(t.larguraMinima);
|
|
517
|
-
let i = Math.max(e ?? 60, r);
|
|
518
|
-
const o = de(t.larguraMaxima);
|
|
519
|
-
return o !== null && (i = Math.min(o, i)), i;
|
|
520
|
-
}
|
|
521
|
-
function Ue(t, r, e, i) {
|
|
522
|
-
const o = G(t, r.offsetWidth + i);
|
|
523
|
-
return t.largura = `${o}px`, r.style.width = `${o}px`, e && (e.style.width = `${o}px`), `${o}px`;
|
|
524
|
-
}
|
|
525
|
-
function We(t) {
|
|
526
|
-
const {
|
|
527
|
-
evento: r,
|
|
528
|
-
coluna: e,
|
|
529
|
-
colIndex: i,
|
|
530
|
-
thElement: o,
|
|
531
|
-
resizer: a,
|
|
532
|
-
colgroupElement: n,
|
|
533
|
-
onResizeStart: l,
|
|
534
|
-
onResizeEnd: d,
|
|
535
|
-
onResizeCancel: u
|
|
536
|
-
} = t;
|
|
537
|
-
r.stopPropagation(), r.preventDefault(), l(), a.classList.add("ui-tabela__resizer--ativo");
|
|
538
|
-
const c = r.pageX, p = o.offsetWidth, s = n == null ? void 0 : n.children[i], h = r.type === "pointerdown", m = h ? r.pointerId : null, g = h ? "pointermove" : "mousemove", f = h ? "pointerup" : "mouseup";
|
|
539
|
-
let b = !1;
|
|
540
|
-
const E = (C) => {
|
|
541
|
-
const y = C;
|
|
542
|
-
if (m !== null && y.pointerId !== m) return;
|
|
543
|
-
b = !0;
|
|
544
|
-
const _ = G(e, p + (y.pageX - c));
|
|
545
|
-
e.largura = `${_}px`, o.style.width = `${_}px`, s && (s.style.width = `${_}px`);
|
|
546
|
-
}, x = () => {
|
|
547
|
-
w(), b ? d(String(e.largura)) : u == null || u();
|
|
548
|
-
}, w = () => {
|
|
549
|
-
a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener(g, E), window.removeEventListener(f, x), h && window.removeEventListener("pointercancel", x);
|
|
550
|
-
};
|
|
551
|
-
return window.addEventListener(g, E), window.addEventListener(f, x), h && window.addEventListener("pointercancel", x), w;
|
|
552
|
-
}
|
|
553
|
-
const I = 20;
|
|
554
|
-
let Xe = 0;
|
|
555
|
-
function Ke(t) {
|
|
556
|
-
var L;
|
|
557
|
-
const {
|
|
558
|
-
evento: r,
|
|
559
|
-
coluna: e,
|
|
560
|
-
colIndex: i,
|
|
561
|
-
thElement: o,
|
|
562
|
-
colgroupElement: a,
|
|
563
|
-
shadow: n,
|
|
564
|
-
onResizeEnd: l
|
|
565
|
-
} = t, d = `ui-tabela-dlg-${++Xe}`, u = document.createElement("dialog");
|
|
566
|
-
u.className = "ui-tabela__prompt-dialog", u.setAttribute("part", "dialogo"), u.setAttribute("aria-labelledby", `${d}-titulo`);
|
|
567
|
-
const c = document.createElement("label");
|
|
568
|
-
c.className = "ui-tabela__prompt-title", c.id = `${d}-titulo`, c.htmlFor = `${d}-campo`, c.textContent = `Largura de "${e.rotulo}" (px; vazio = automática)`;
|
|
569
|
-
const p = document.createElement("input");
|
|
570
|
-
p.id = `${d}-campo`, p.type = "number", p.min = String(I), p.step = "1", p.setAttribute("inputmode", "numeric"), p.placeholder = "auto";
|
|
571
|
-
const s = e.largura ? parseInt(String(e.largura), 10) : NaN;
|
|
572
|
-
p.value = Number.isFinite(s) ? String(s) : "";
|
|
573
|
-
const h = document.createElement("div");
|
|
574
|
-
h.className = "ui-tabela__prompt-erro", h.id = `${d}-erro`, h.setAttribute("role", "alert");
|
|
575
|
-
const m = document.createElement("div");
|
|
576
|
-
m.className = "ui-tabela__prompt-actions";
|
|
577
|
-
const g = document.createElement("button");
|
|
578
|
-
g.type = "button", g.textContent = "Aplicar";
|
|
579
|
-
const f = document.createElement("button");
|
|
580
|
-
f.type = "button", f.textContent = "Cancelar", m.appendChild(f), m.appendChild(g), u.appendChild(c), u.appendChild(p), u.appendChild(h), u.appendChild(m), n.appendChild(u), typeof u.showModal == "function" ? u.showModal() : u.setAttribute("open", ""), u.style.position = "fixed";
|
|
581
|
-
const b = u.getBoundingClientRect(), E = b.width || 240, x = b.height || 140, w = Math.max(8, Math.min(r.clientX || 0, window.innerWidth - E - 8)), C = Math.max(8, Math.min(r.clientY || 0, window.innerHeight - x - 8));
|
|
582
|
-
u.style.left = `${w}px`, u.style.top = `${C}px`;
|
|
583
|
-
let y = !1;
|
|
584
|
-
const _ = () => {
|
|
585
|
-
var z;
|
|
586
|
-
y || (y = !0, u.open && typeof u.close == "function" && u.close(), u.remove(), (z = o.querySelector(".ui-tabela__ordenar, .ui-tabela__resizer")) == null || z.focus());
|
|
587
|
-
}, k = (z) => {
|
|
588
|
-
h.textContent = z, p.setAttribute("aria-invalid", "true"), p.setAttribute("aria-describedby", h.id), p.focus();
|
|
589
|
-
}, A = () => {
|
|
590
|
-
const z = e.largura, ae = p.value.trim();
|
|
591
|
-
if (ae === "")
|
|
592
|
-
e.largura = void 0, o.style.width = "", a != null && a.children[i] && (a.children[i].style.width = "");
|
|
593
|
-
else {
|
|
594
|
-
const j = Number(ae);
|
|
595
|
-
if (!Number.isFinite(j) || j < I) {
|
|
596
|
-
k(`Informe um valor de pelo menos ${I} px, ou deixe vazio para automática.`);
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
const U = Math.round(G({ ...e, larguraMinima: e.larguraMinima ?? I }, j));
|
|
600
|
-
e.largura = `${U}px`, o.style.width = `${U}px`, a != null && a.children[i] && (a.children[i].style.width = `${U}px`);
|
|
601
|
-
}
|
|
602
|
-
_(), e.largura !== z && l(e.largura ? String(e.largura) : "auto");
|
|
603
|
-
};
|
|
604
|
-
g.addEventListener("click", (z) => {
|
|
605
|
-
z.stopPropagation(), A();
|
|
606
|
-
}), f.addEventListener("click", (z) => {
|
|
607
|
-
z.stopPropagation(), _();
|
|
608
|
-
}), u.addEventListener("close", _), p.addEventListener("input", () => {
|
|
609
|
-
h.textContent = "", p.removeAttribute("aria-invalid"), p.removeAttribute("aria-describedby");
|
|
610
|
-
}), p.addEventListener("keydown", (z) => {
|
|
611
|
-
z.key === "Enter" ? (z.preventDefault(), A()) : z.key === "Escape" && (z.preventDefault(), _());
|
|
612
|
-
}), p.focus(), (L = p.select) == null || L.call(p);
|
|
613
|
-
}
|
|
614
|
-
function Ye(t, r, e, i, o, a) {
|
|
615
|
-
return We({
|
|
616
|
-
evento: t,
|
|
617
|
-
coluna: r,
|
|
618
|
-
colIndex: e,
|
|
619
|
-
thElement: i,
|
|
620
|
-
resizer: o,
|
|
621
|
-
colgroupElement: a.colgroupElement,
|
|
622
|
-
onResizeStart: () => a.onSetIsResizing(!0),
|
|
623
|
-
onResizeCancel: () => {
|
|
624
|
-
setTimeout(() => a.onSetIsResizing(!1), 50);
|
|
625
|
-
},
|
|
626
|
-
onResizeEnd: (n) => {
|
|
627
|
-
setTimeout(() => a.onSetIsResizing(!1), 50), a.host.dispatchEvent(
|
|
628
|
-
new CustomEvent("ui-column-resize", {
|
|
629
|
-
detail: { idColuna: r.id, largura: n },
|
|
630
|
-
bubbles: !0,
|
|
631
|
-
composed: !0
|
|
632
|
-
})
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
function Ge(t, r, e, i, o) {
|
|
638
|
-
t.preventDefault(), t.stopPropagation(), Ke({
|
|
639
|
-
evento: t,
|
|
640
|
-
coluna: r,
|
|
641
|
-
colIndex: e,
|
|
642
|
-
thElement: i,
|
|
643
|
-
colgroupElement: o.colgroupElement,
|
|
644
|
-
shadow: o.shadow,
|
|
645
|
-
onResizeEnd: (a) => {
|
|
646
|
-
o.host.dispatchEvent(
|
|
647
|
-
new CustomEvent("ui-column-resize", {
|
|
648
|
-
detail: { idColuna: r.id, largura: a },
|
|
649
|
-
bubbles: !0,
|
|
650
|
-
composed: !0
|
|
651
|
-
})
|
|
652
|
-
);
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
function Qe(t, r, e, i, o) {
|
|
657
|
-
const a = Ue(r, e, i, t);
|
|
658
|
-
o.host.dispatchEvent(
|
|
659
|
-
new CustomEvent("ui-column-resize", {
|
|
660
|
-
detail: { idColuna: r.id, largura: a },
|
|
661
|
-
bubbles: !0,
|
|
662
|
-
composed: !0
|
|
663
|
-
})
|
|
664
|
-
);
|
|
665
|
-
}
|
|
666
|
-
function Ze(t) {
|
|
667
|
-
He({
|
|
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: be,
|
|
675
|
-
getAlignmentClass: ge,
|
|
676
|
-
getTextAlign: ve,
|
|
677
|
-
onHeaderClick: (r) => t.onHeaderClick(r),
|
|
678
|
-
onHeaderContextMenu: (r, e, i, o) => {
|
|
679
|
-
Ge(r, e, i, o, {
|
|
680
|
-
host: t.host,
|
|
681
|
-
colgroupElement: t.colgroupElement,
|
|
682
|
-
shadow: t.shadow,
|
|
683
|
-
onSetIsResizing: t.onSetIsResizing
|
|
684
|
-
});
|
|
685
|
-
},
|
|
686
|
-
onInitColumnResize: (r, e, i, o, a) => {
|
|
687
|
-
const n = Ye(r, e, i, o, a, {
|
|
688
|
-
host: t.host,
|
|
689
|
-
colgroupElement: t.colgroupElement,
|
|
690
|
-
shadow: t.shadow,
|
|
691
|
-
onSetIsResizing: t.onSetIsResizing
|
|
692
|
-
});
|
|
693
|
-
t.onActiveResizeCleanup(n);
|
|
694
|
-
},
|
|
695
|
-
onResizeTeclado: (r, e, i, o, a) => {
|
|
696
|
-
Qe(r, e, o, a, {
|
|
697
|
-
host: t.host,
|
|
698
|
-
colgroupElement: t.colgroupElement,
|
|
699
|
-
shadow: t.shadow,
|
|
700
|
-
onSetIsResizing: t.onSetIsResizing
|
|
701
|
-
});
|
|
702
|
-
},
|
|
703
|
-
onColumnAutoFit: (r, e, i) => {
|
|
704
|
-
r.largura = void 0, e.style.width = "", i.style.width = "", t.host.dispatchEvent(
|
|
705
|
-
new CustomEvent("ui-column-resize", {
|
|
706
|
-
bubbles: !0,
|
|
707
|
-
composed: !0,
|
|
708
|
-
detail: { idColuna: r.id, largura: "auto" }
|
|
709
|
-
})
|
|
710
|
-
);
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
function Je(t) {
|
|
715
|
-
je({
|
|
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
|
-
new CustomEvent("ui-linha-clique", {
|
|
733
|
-
bubbles: !0,
|
|
734
|
-
composed: !0,
|
|
735
|
-
detail: { item: r, indice: e }
|
|
736
|
-
})
|
|
737
|
-
);
|
|
738
|
-
},
|
|
739
|
-
formatWidth: be,
|
|
740
|
-
getAlignmentClass: ge,
|
|
741
|
-
getTextAlign: ve
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
function et(t, r) {
|
|
745
|
-
let e = !1;
|
|
746
|
-
const i = () => {
|
|
747
|
-
e || (window.requestAnimationFrame(() => {
|
|
748
|
-
try {
|
|
749
|
-
r();
|
|
750
|
-
} finally {
|
|
751
|
-
e = !1;
|
|
752
|
-
}
|
|
753
|
-
}), e = !0);
|
|
754
|
-
};
|
|
755
|
-
return t.addEventListener("scroll", i), i;
|
|
756
|
-
}
|
|
757
|
-
function tt(t, r, e, i) {
|
|
758
|
-
return Ve(t, r, e, i);
|
|
759
|
-
}
|
|
760
|
-
function _e(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 i = t.host.hasAttribute("carregando") || t.host.hasAttribute("loading");
|
|
766
|
-
t.onCarregandoAlterado(i), t.loadingElement && (t.loadingElement.style.display = i ? "flex" : "none");
|
|
767
|
-
}
|
|
768
|
-
function rt(t, r, e) {
|
|
769
|
-
if (_e(e), t === "src") {
|
|
770
|
-
r && e.host.isConnected && e.onCarregarSrc(r);
|
|
771
|
-
return;
|
|
772
|
-
}
|
|
773
|
-
if (t === "max-height" && e.containerElement) {
|
|
774
|
-
e.containerElement.style.maxHeight = r || "";
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
if ((t === "texto-vazio" || t === "empty-text") && e.emptyElement) {
|
|
778
|
-
const i = e.emptyElement.querySelector(".ui-tabela__empty-text");
|
|
779
|
-
i && r && (i.textContent = r), e.onRenderBody();
|
|
780
|
-
return;
|
|
781
|
-
}
|
|
782
|
-
if (t === "carregando" || t === "loading") {
|
|
783
|
-
e.loadingElement && (e.loadingElement.style.display = r !== null ? "flex" : "none");
|
|
784
|
-
return;
|
|
785
|
-
}
|
|
786
|
-
if (t === "densidade" || t === "density") {
|
|
787
|
-
e.onRenderBody();
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
|
-
e.onRenderTotal();
|
|
791
|
-
}
|
|
792
|
-
function it(t, r, e, i) {
|
|
793
|
-
if (t === "Enter" || t === " ") return { tipo: "ativar" };
|
|
794
|
-
if (!Number.isInteger(r) || !Number.isInteger(e) || e < 0) return null;
|
|
795
|
-
const o = Math.max(1, Math.floor(Number.isFinite(i) ? i : 1)), a = (n) => Math.min(e, Math.max(0, n));
|
|
796
|
-
switch (t) {
|
|
797
|
-
case "ArrowDown":
|
|
798
|
-
return { tipo: "mover", indice: a(r + 1) };
|
|
799
|
-
case "ArrowUp":
|
|
800
|
-
return { tipo: "mover", indice: a(r - 1) };
|
|
801
|
-
case "Home":
|
|
802
|
-
return { tipo: "mover", indice: 0 };
|
|
803
|
-
case "End":
|
|
804
|
-
return { tipo: "mover", indice: e };
|
|
805
|
-
case "PageDown":
|
|
806
|
-
return { tipo: "mover", indice: a(r + o) };
|
|
807
|
-
case "PageUp":
|
|
808
|
-
return { tipo: "mover", indice: a(r - o) };
|
|
809
|
-
default:
|
|
810
|
-
return null;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
const ot = "Não foi possível carregar os dados.", at = "Nenhum resultado para o filtro";
|
|
814
|
-
function nt(t, r, e, i) {
|
|
815
|
-
if (!t) return;
|
|
816
|
-
if (!r) {
|
|
817
|
-
t.style.display = "none";
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
const o = t.querySelector(".ui-tabela__erro-mensagem"), a = t.querySelector(".ui-tabela__erro-detalhe");
|
|
821
|
-
o && (o.textContent = e || ot), a && (a.textContent = r.erro || "");
|
|
822
|
-
const n = t.querySelector(".ui-tabela__erro-acao");
|
|
823
|
-
n && (n.style.display = i ? "" : "none"), t.style.display = "flex";
|
|
824
|
-
}
|
|
825
|
-
function st(t, r, e, i) {
|
|
826
|
-
t && (t.textContent = e ? r === 0 ? i : `${r} ${r === 1 ? "registro encontrado" : "registros encontrados"}` : "");
|
|
827
|
-
}
|
|
828
|
-
function lt({ tabela: t, container: r }, e, i) {
|
|
829
|
-
t && (e ? t.setAttribute("aria-label", e) : t.removeAttribute("aria-label"), t.setAttribute("aria-busy", String(i)), r && (e ? (r.setAttribute("role", "region"), r.setAttribute("aria-label", e)) : (r.removeAttribute("role"), r.removeAttribute("aria-label"))));
|
|
830
|
-
}
|
|
831
|
-
const dt = 800;
|
|
832
|
-
function ce(t, r, e) {
|
|
833
|
-
const i = t.getBoundingClientRect(), o = r.getBoundingClientRect(), a = i.top + t.clientTop + e, n = i.top + t.clientTop + t.clientHeight;
|
|
834
|
-
return o.top < a ? o.top - a : o.bottom > n ? Math.min(o.bottom - n, o.top - a) : 0;
|
|
835
|
-
}
|
|
836
|
-
function ue(t, r, e) {
|
|
837
|
-
e === "smooth" && typeof t.scrollTo == "function" ? t.scrollTo({ top: r, behavior: "smooth" }) : t.scrollTop = r;
|
|
838
|
-
}
|
|
839
|
-
class ct {
|
|
840
|
-
constructor(r) {
|
|
841
|
-
v(this, "cancelarCorrecao", null);
|
|
842
|
-
this.p = r;
|
|
843
|
-
}
|
|
844
|
-
alturaCabecalho() {
|
|
845
|
-
var r;
|
|
846
|
-
return ((r = this.p.cabecalho()) == null ? void 0 : r.offsetHeight) ?? 0;
|
|
847
|
-
}
|
|
848
|
-
/** Linhas inteiras que cabem na área visível (mínimo 1). */
|
|
849
|
-
linhasPorPagina() {
|
|
850
|
-
var e;
|
|
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
|
-
}
|
|
854
|
-
/** Foca a linha, renderizando a janela virtual se necessário, e a mantém visível abaixo do cabeçalho fixo. */
|
|
855
|
-
focar(r) {
|
|
856
|
-
const e = this.p.container(), i = this.p.tbody();
|
|
857
|
-
if (!e || !i) return;
|
|
858
|
-
this.p.aoLinhaAtiva(r);
|
|
859
|
-
const o = `tr[data-index="${r}"]`;
|
|
860
|
-
let a = i.querySelector(o);
|
|
861
|
-
if (a || (e.scrollTop = Math.max(0, r * this.p.alturaLinha() - e.clientHeight / 2), this.p.renderizarCorpo(), a = i.querySelector(o)), !a) return;
|
|
862
|
-
a.focus({ preventScroll: !0 });
|
|
863
|
-
const n = ce(e, a, this.alturaCabecalho());
|
|
864
|
-
n && (e.scrollTop += n);
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Posiciona a linha exibida `indice` na área visível.
|
|
868
|
-
* Fora da janela virtual, rola até a posição estimada, renderiza a janela e corrige pela posição
|
|
869
|
-
* real da linha. No modo suave a correção ocorre ao fim da animação (`scrollend`, com timeout de
|
|
870
|
-
* segurança para navegadores sem o evento ou quando não há rolagem a fazer).
|
|
871
|
-
*/
|
|
872
|
-
posicionar(r, e) {
|
|
873
|
-
const i = this.p.container(), o = this.p.tbody();
|
|
874
|
-
if (!i || !o) return !1;
|
|
875
|
-
this.cancelar();
|
|
876
|
-
const a = () => o.querySelector(`tr[data-index="${r}"]`), n = (p) => {
|
|
877
|
-
const s = a();
|
|
878
|
-
if (!s) return;
|
|
879
|
-
const h = ce(i, s, this.alturaCabecalho());
|
|
880
|
-
h && ue(i, i.scrollTop + h, p);
|
|
881
|
-
};
|
|
882
|
-
if (a())
|
|
883
|
-
return n(e), !0;
|
|
884
|
-
const l = () => {
|
|
885
|
-
i.scrollTop = Math.max(0, r * this.p.alturaLinha()), this.p.renderizarCorpo(), n("auto"), this.p.renderizarCorpo();
|
|
886
|
-
};
|
|
887
|
-
if (e === "auto")
|
|
888
|
-
return l(), !0;
|
|
889
|
-
ue(i, Math.max(0, r * this.p.alturaLinha()), "smooth");
|
|
890
|
-
let d = !0;
|
|
891
|
-
const u = () => {
|
|
892
|
-
d && (this.cancelar(), this.p.renderizarCorpo(), a() ? n("smooth") : l());
|
|
893
|
-
}, c = window.setTimeout(u, dt);
|
|
894
|
-
return i.addEventListener("scrollend", u, { once: !0 }), this.cancelarCorrecao = () => {
|
|
895
|
-
d = !1, window.clearTimeout(c), i.removeEventListener("scrollend", u), this.cancelarCorrecao = null;
|
|
896
|
-
}, !0;
|
|
897
|
-
}
|
|
898
|
-
/** Cancela a correção pendente de uma rolagem suave (nova rolagem, desconexão). */
|
|
899
|
-
cancelar() {
|
|
900
|
-
var r;
|
|
901
|
-
(r = this.cancelarCorrecao) == null || r.call(this);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
class ut extends fe {
|
|
905
|
-
constructor() {
|
|
906
|
-
super();
|
|
907
|
-
v(this, "shadow");
|
|
908
|
-
v(this, "_colunas", []);
|
|
909
|
-
v(this, "_textoVazio", "Nenhum registro encontrado");
|
|
910
|
-
v(this, "_virtualizar", !0);
|
|
911
|
-
v(this, "_isResizing", !1);
|
|
912
|
-
v(this, "_carregando", !1);
|
|
913
|
-
v(this, "_src", null);
|
|
914
|
-
v(this, "_fetchOpcoes", null);
|
|
915
|
-
v(this, "_fetcher", null);
|
|
916
|
-
v(this, "_containerElement", null);
|
|
917
|
-
v(this, "_tableElement", null);
|
|
918
|
-
v(this, "_theadElement", null);
|
|
919
|
-
v(this, "_tbodyElement", null);
|
|
920
|
-
v(this, "_colgroupElement", null);
|
|
921
|
-
v(this, "_emptyElement", null);
|
|
922
|
-
v(this, "_loadingElement", null);
|
|
923
|
-
v(this, "_erroElement", null);
|
|
924
|
-
v(this, "_anuncioElement", null);
|
|
925
|
-
/** Último erro de carregamento remoto (null = sem erro). */
|
|
926
|
-
v(this, "_erro", null);
|
|
927
|
-
v(this, "_scrollHandler", null);
|
|
928
|
-
v(this, "_activeResizeCleanup", null);
|
|
929
|
-
v(this, "_headerListeners", new F());
|
|
930
|
-
v(this, "_corpoListeners", new F());
|
|
931
|
-
/** Linha com o foco móvel (navegação por teclado); null = primeira linha visível. */
|
|
932
|
-
v(this, "_indiceAtivo", null);
|
|
933
|
-
/** Altura real das linhas medida no DOM; null = usa a estimativa da densidade. */
|
|
934
|
-
v(this, "_alturaLinhaMedida", null);
|
|
935
|
-
v(this, "rolagem", new ct({
|
|
936
|
-
container: () => this._containerElement,
|
|
937
|
-
tbody: () => this._tbodyElement,
|
|
938
|
-
cabecalho: () => this._theadElement,
|
|
939
|
-
alturaLinha: () => this.getRowHeight(),
|
|
940
|
-
renderizarCorpo: () => this.renderBody(),
|
|
941
|
-
aoLinhaAtiva: (e) => {
|
|
942
|
-
this._indiceAtivo = e;
|
|
943
|
-
}
|
|
944
|
-
}));
|
|
945
|
-
v(this, "remotaController");
|
|
946
|
-
v(this, "selecaoController");
|
|
947
|
-
v(this, "dadosController", new Pe());
|
|
948
|
-
/** Mantém um único tabindex=0 (foco móvel): Tab entra na tabela pela última linha ativa. */
|
|
949
|
-
v(this, "handleFocoLinha", (e) => {
|
|
950
|
-
const i = e.target;
|
|
951
|
-
i.parentElement !== this._tbodyElement || !i.hasAttribute("data-index") || this.definirLinhaAtiva(Number(i.getAttribute("data-index")));
|
|
952
|
-
});
|
|
953
|
-
/**
|
|
954
|
-
* Teclado nas linhas: setas, Home/End e PageUp/PageDown movem o foco;
|
|
955
|
-
* Enter/Espaço selecionam a linha (mesmo caminho do clique, emite `ui-linha-clique`).
|
|
956
|
-
*/
|
|
957
|
-
v(this, "handleTecladoCorpo", (e) => {
|
|
958
|
-
const i = e.target;
|
|
959
|
-
if (i.parentElement !== this._tbodyElement || !i.hasAttribute("data-index")) return;
|
|
960
|
-
const o = this.dadosController.getDadosExibicao().length - 1, a = it(e.key, Number(i.getAttribute("data-index")), o, this.rolagem.linhasPorPagina());
|
|
961
|
-
a && (e.preventDefault(), a.tipo === "ativar" ? i.click() : this.rolagem.focar(a.indice));
|
|
962
|
-
});
|
|
963
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new Le({
|
|
964
|
-
host: this,
|
|
965
|
-
onCarregandoAlterado: (e) => {
|
|
966
|
-
this.carregando = e;
|
|
967
|
-
},
|
|
968
|
-
onDadosRecebidos: (e) => {
|
|
969
|
-
this.dados = e;
|
|
970
|
-
},
|
|
971
|
-
getOpcoes: () => this._fetchOpcoes,
|
|
972
|
-
getFetcher: () => this._fetcher
|
|
973
|
-
}), this.selecaoController = new Te({
|
|
974
|
-
host: this,
|
|
975
|
-
getTbody: () => this._tbodyElement,
|
|
976
|
-
getDadosExibicao: () => this.dadosController.getDadosExibicao(),
|
|
977
|
-
getDadosOriginais: () => this.dadosController.getDadosOriginais(),
|
|
978
|
-
getChaveId: () => this.chaveId,
|
|
979
|
-
onRolarParaIndice: (e, i) => this.rolagem.posicionar(e, i),
|
|
980
|
-
onLinhaAtiva: (e) => this.definirLinhaAtiva(e)
|
|
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
|
-
}
|
|
983
|
-
static get observedAttributes() {
|
|
984
|
-
return ["texto-vazio", "empty-text", "max-height", "densidade", "density", "altura-linha", "row-height", "virtualizar", "virtualize", "src", "carregando", "loading", "chave-id", "id-key", "aria-label", "ordenacao-remota", "texto-erro", "texto-sem-resultados", "texto-carregando"];
|
|
985
|
-
}
|
|
986
|
-
connectedCallback() {
|
|
987
|
-
this.syncAttributes(), this.alturaLinha && this.style.setProperty("--ui-tabela-altura-linha", `${this.alturaLinha}px`), !this.hasAttribute("densidade") && !this.hasAttribute("density") && this.setAttribute("densidade", "normal"), this.renderTotal(), this._src && this.remotaController.carregar(this._src);
|
|
988
|
-
}
|
|
989
|
-
disconnectedCallback() {
|
|
990
|
-
this.cleanupEventListeners();
|
|
991
|
-
}
|
|
992
|
-
attributeChangedCallback(e, i, o) {
|
|
993
|
-
e === "ordenacao-remota" && (this.dadosController.setOrdenacaoRemota(o !== 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(), rt(e, o, this.obterContextoAtributos()), this.sincronizarAria();
|
|
994
|
-
}
|
|
995
|
-
/** Nome acessível vem do host (`aria-label`); `aria-busy` acompanha o carregamento remoto. */
|
|
996
|
-
sincronizarAria() {
|
|
997
|
-
this._tableElement && (lt({ tabela: this._tableElement, container: this._containerElement }, this.getAttribute("aria-label"), this._carregando), this.atualizarTextosEstado());
|
|
998
|
-
}
|
|
999
|
-
/** Textos de estado configuráveis por atributo (carregando, sem resultados, erro). */
|
|
1000
|
-
atualizarTextosEstado() {
|
|
1001
|
-
var i;
|
|
1002
|
-
const e = (i = this._loadingElement) == null ? void 0 : i.querySelector(".ui-tabela__loading-texto");
|
|
1003
|
-
e && (e.textContent = this.getAttribute("texto-carregando") || "Carregando dados..."), this.renderizarErro();
|
|
1004
|
-
}
|
|
1005
|
-
/** Mostra (ou oculta, com null) o aviso de erro de carregamento com a ação "Tentar novamente". */
|
|
1006
|
-
mostrarErro(e) {
|
|
1007
|
-
this._erro = e, this.renderizarErro();
|
|
1008
|
-
}
|
|
1009
|
-
renderizarErro() {
|
|
1010
|
-
nt(this._erroElement, this._erro, this.getAttribute("texto-erro"), !!this._src);
|
|
1011
|
-
}
|
|
1012
|
-
/** Anuncia ao leitor de tela o resultado do filtro (a região é limpa sem filtro ativo). */
|
|
1013
|
-
anunciarResultado() {
|
|
1014
|
-
st(
|
|
1015
|
-
this._anuncioElement,
|
|
1016
|
-
this.dadosController.getDadosExibicao().length,
|
|
1017
|
-
this.dadosController.temFiltro(),
|
|
1018
|
-
this._textoSemResultados()
|
|
1019
|
-
);
|
|
1020
|
-
}
|
|
1021
|
-
_textoSemResultados() {
|
|
1022
|
-
return this.getAttribute("texto-sem-resultados") || at;
|
|
1023
|
-
}
|
|
1024
|
-
syncAttributes() {
|
|
1025
|
-
_e(this.obterContextoAtributos());
|
|
1026
|
-
}
|
|
1027
|
-
obterContextoAtributos() {
|
|
1028
|
-
return {
|
|
1029
|
-
host: this,
|
|
1030
|
-
containerElement: this._containerElement,
|
|
1031
|
-
emptyElement: this._emptyElement,
|
|
1032
|
-
loadingElement: this._loadingElement,
|
|
1033
|
-
onTextoVazioAlterado: (e) => {
|
|
1034
|
-
this._textoVazio = e;
|
|
1035
|
-
},
|
|
1036
|
-
onVirtualizarAlterado: (e) => {
|
|
1037
|
-
this._virtualizar = e;
|
|
1038
|
-
},
|
|
1039
|
-
onSrcLido: (e) => {
|
|
1040
|
-
this._src = e;
|
|
1041
|
-
},
|
|
1042
|
-
onCarregarSrc: (e) => {
|
|
1043
|
-
this.remotaController.carregar(e);
|
|
1044
|
-
},
|
|
1045
|
-
onCarregandoAlterado: (e) => {
|
|
1046
|
-
this._carregando = e;
|
|
1047
|
-
},
|
|
1048
|
-
onRenderBody: () => this.renderBody(),
|
|
1049
|
-
onRenderTotal: () => this.renderTotal()
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
get src() {
|
|
1053
|
-
return this._src;
|
|
1054
|
-
}
|
|
1055
|
-
set src(e) {
|
|
1056
|
-
this._src = e, e ? this.setAttribute("src", e) : this.removeAttribute("src");
|
|
1057
|
-
}
|
|
1058
|
-
get carregando() {
|
|
1059
|
-
return this._carregando;
|
|
1060
|
-
}
|
|
1061
|
-
set carregando(e) {
|
|
1062
|
-
this._carregando = !!e, this._carregando ? this.setAttribute("carregando", "") : (this.removeAttribute("carregando"), this.removeAttribute("loading")), this._loadingElement && (this._loadingElement.style.display = this._carregando ? "flex" : "none"), this.sincronizarAria();
|
|
1063
|
-
}
|
|
1064
|
-
/** Opções do `fetch` do modo remoto (headers, credentials, method, body...); o `signal` é da tabela. */
|
|
1065
|
-
get fetchOpcoes() {
|
|
1066
|
-
return this._fetchOpcoes;
|
|
1067
|
-
}
|
|
1068
|
-
set fetchOpcoes(e) {
|
|
1069
|
-
this._fetchOpcoes = e ?? null;
|
|
1070
|
-
}
|
|
1071
|
-
/** Função de busca alternativa ao `fetch` (autenticação, renovação de token, mocks). */
|
|
1072
|
-
get fetcher() {
|
|
1073
|
-
return this._fetcher;
|
|
1074
|
-
}
|
|
1075
|
-
set fetcher(e) {
|
|
1076
|
-
this._fetcher = typeof e == "function" ? e : null;
|
|
1077
|
-
}
|
|
1078
|
-
/** Ordenação feita pelo servidor: o clique no cabeçalho atualiza o indicador e emite `ui-sort`, mas não reordena. */
|
|
1079
|
-
get ordenacaoRemota() {
|
|
1080
|
-
return this.hasAttribute("ordenacao-remota");
|
|
1081
|
-
}
|
|
1082
|
-
set ordenacaoRemota(e) {
|
|
1083
|
-
this.toggleAttribute("ordenacao-remota", !!e);
|
|
1084
|
-
}
|
|
1085
|
-
/** Busca a URL (guardada como `src`, para `recarregar()`). Resolve `true` em sucesso; falhas vão em `ui-fetch-erro`. */
|
|
1086
|
-
async carregarDoEndpoint(e) {
|
|
1087
|
-
return e && e !== this._src && (this.src = e), this.remotaController.carregar(e || this._src || "");
|
|
1088
|
-
}
|
|
1089
|
-
async recarregar() {
|
|
1090
|
-
return this._src ? this.remotaController.carregar(this._src) : (this.dadosController.aplicarOrdenacao(), this.atualizarContextoSelecao(), this.renderBody(), !0);
|
|
1091
|
-
}
|
|
1092
|
-
filtrar(e) {
|
|
1093
|
-
this.dadosController.filtrar(e), this.atualizarContextoSelecao(), this.renderBody();
|
|
1094
|
-
}
|
|
1095
|
-
cleanupEventListeners() {
|
|
1096
|
-
this._containerElement && this._scrollHandler && (this._containerElement.removeEventListener("scroll", this._scrollHandler), this._scrollHandler = null), this._activeResizeCleanup && (this._activeResizeCleanup(), this._activeResizeCleanup = null, this._isResizing = !1), this.rolagem.cancelar(), this.remotaController.abortar(), this._headerListeners.cleanup(), this._corpoListeners.cleanup();
|
|
1097
|
-
}
|
|
1098
|
-
get colunas() {
|
|
1099
|
-
return this._colunas;
|
|
1100
|
-
}
|
|
1101
|
-
set colunas(e) {
|
|
1102
|
-
this._colunas = Array.isArray(e) ? e.filter((i) => i != null).map((i) => ({ ...i })) : [], this.dadosController.setColunas(this._colunas), this.dadosController.setColunasFiltro(this._colunas.map((i) => i.id)), this._alturaLinhaMedida = null, this.renderTotal();
|
|
1103
|
-
}
|
|
1104
|
-
get dados() {
|
|
1105
|
-
return this.dadosController.getDadosOriginais();
|
|
1106
|
-
}
|
|
1107
|
-
set dados(e) {
|
|
1108
|
-
this.dadosController.setDadosOriginais(e), this.atualizarContextoSelecao(), this.renderBody();
|
|
1109
|
-
}
|
|
1110
|
-
get itens() {
|
|
1111
|
-
return this.dados;
|
|
1112
|
-
}
|
|
1113
|
-
set itens(e) {
|
|
1114
|
-
this.dados = e;
|
|
1115
|
-
}
|
|
1116
|
-
get chaveId() {
|
|
1117
|
-
return this.getAttribute("chave-id") || this.getAttribute("id-key") || "id";
|
|
1118
|
-
}
|
|
1119
|
-
set chaveId(e) {
|
|
1120
|
-
e ? this.setAttribute("chave-id", e) : (this.removeAttribute("chave-id"), this.removeAttribute("id-key")), this.atualizarContextoSelecao();
|
|
1121
|
-
}
|
|
1122
|
-
get itemSelecionado() {
|
|
1123
|
-
return this.selecaoController.getItemSelecionado();
|
|
1124
|
-
}
|
|
1125
|
-
set itemSelecionado(e) {
|
|
1126
|
-
this.selecaoController.setItemSelecionado(e);
|
|
1127
|
-
}
|
|
1128
|
-
get indiceSelecionado() {
|
|
1129
|
-
return this.selecaoController.getIndiceSelecionado();
|
|
1130
|
-
}
|
|
1131
|
-
set indiceSelecionado(e) {
|
|
1132
|
-
this.selecaoController.setIndiceSelecionado(e);
|
|
1133
|
-
}
|
|
1134
|
-
limparSelecao() {
|
|
1135
|
-
this.selecaoController.limparSelecao();
|
|
1136
|
-
}
|
|
1137
|
-
get densidade() {
|
|
1138
|
-
const e = this.getAttribute("densidade") || this.getAttribute("density");
|
|
1139
|
-
return e === "compacta" || e === "compact" ? "compacta" : e === "relaxada" || e === "relaxed" ? "relaxada" : "normal";
|
|
1140
|
-
}
|
|
1141
|
-
set densidade(e) {
|
|
1142
|
-
e ? this.setAttribute("densidade", e) : (this.removeAttribute("densidade"), this.removeAttribute("density")), this.renderBody();
|
|
1143
|
-
}
|
|
1144
|
-
get virtualizar() {
|
|
1145
|
-
return this._virtualizar;
|
|
1146
|
-
}
|
|
1147
|
-
set virtualizar(e) {
|
|
1148
|
-
this._virtualizar = !!e, e ? this.setAttribute("virtualizar", "true") : this.removeAttribute("virtualizar"), this.renderTotal();
|
|
1149
|
-
}
|
|
1150
|
-
get colunaOrdenada() {
|
|
1151
|
-
return this.dadosController.getColunaOrdenada();
|
|
1152
|
-
}
|
|
1153
|
-
set colunaOrdenada(e) {
|
|
1154
|
-
this.dadosController.setColunaOrdenada(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
1155
|
-
}
|
|
1156
|
-
get direcaoOrdenacao() {
|
|
1157
|
-
return this.dadosController.getDirecaoOrdenacao();
|
|
1158
|
-
}
|
|
1159
|
-
set direcaoOrdenacao(e) {
|
|
1160
|
-
this.dadosController.setDirecaoOrdenacao(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
1161
|
-
}
|
|
1162
|
-
get textoVazio() {
|
|
1163
|
-
return this._textoVazio;
|
|
1164
|
-
}
|
|
1165
|
-
set textoVazio(e) {
|
|
1166
|
-
this._textoVazio = e || "Nenhum registro encontrado", this.renderTotal();
|
|
1167
|
-
}
|
|
1168
|
-
handleHeaderClick(e) {
|
|
1169
|
-
if (!e.ordenavel || this._isResizing) return;
|
|
1170
|
-
const i = this.dadosController.getColunaOrdenada(), o = this.dadosController.getDirecaoOrdenacao(), a = this.dadosController.alternarOrdenacaoColuna(e);
|
|
1171
|
-
if (!a) return;
|
|
1172
|
-
this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
1173
|
-
const n = new CustomEvent("ui-sort", { detail: a, bubbles: !0, composed: !0, cancelable: !0 });
|
|
1174
|
-
this.dispatchEvent(n), n.defaultPrevented && (this.dadosController.restaurarOrdenacao(i, o), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody());
|
|
1175
|
-
}
|
|
1176
|
-
/** Altura fixa das linhas em px (`altura-linha`), sobrepõe a densidade; null = vale a densidade. */
|
|
1177
|
-
get alturaLinha() {
|
|
1178
|
-
const e = this.getAttribute("altura-linha") ?? this.getAttribute("row-height"), i = e === null ? NaN : parseFloat(e);
|
|
1179
|
-
return Number.isFinite(i) && i > 0 ? i : null;
|
|
1180
|
-
}
|
|
1181
|
-
set alturaLinha(e) {
|
|
1182
|
-
e && e > 0 ? this.setAttribute("altura-linha", String(e)) : (this.removeAttribute("altura-linha"), this.removeAttribute("row-height"));
|
|
1183
|
-
}
|
|
1184
|
-
/** Publica a altura fixa como variável CSS (usada pelo estilo `:host([altura-linha])`). */
|
|
1185
|
-
aplicarAlturaLinha() {
|
|
1186
|
-
const e = this.alturaLinha;
|
|
1187
|
-
e ? this.style.setProperty("--ui-tabela-altura-linha", `${e}px`) : this.style.removeProperty("--ui-tabela-altura-linha"), this.renderBody();
|
|
1188
|
-
}
|
|
1189
|
-
/** Altura usada na virtualização: a fixa (`altura-linha`), a medida no DOM ou a estimativa da densidade. */
|
|
1190
|
-
getRowHeight() {
|
|
1191
|
-
return this.alturaLinha ?? this._alturaLinhaMedida ?? le(this.densidade);
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Mede a altura real das linhas uma vez por configuração (densidade/colunas): padding, fonte e
|
|
1195
|
-
* renderizadores customizados mudam a altura, e a estimativa fixa desalinharia a janela virtual.
|
|
1196
|
-
* Não remede a cada rolagem para os espaçadores não "pularem" com linhas de alturas diferentes.
|
|
1197
|
-
*/
|
|
1198
|
-
medirAlturaLinha() {
|
|
1199
|
-
if (this._alturaLinhaMedida !== null || !this._tbodyElement) return;
|
|
1200
|
-
const e = this._tbodyElement.querySelectorAll("tr[data-index]");
|
|
1201
|
-
if (e.length === 0) return;
|
|
1202
|
-
let i = 0;
|
|
1203
|
-
e.forEach((a) => {
|
|
1204
|
-
i += a.getBoundingClientRect().height;
|
|
1205
|
-
});
|
|
1206
|
-
const o = i / e.length;
|
|
1207
|
-
o <= 0 || (this._alturaLinhaMedida = o, Math.abs(o - le(this.densidade)) > 0.5 && this.renderBody());
|
|
1208
|
-
}
|
|
1209
|
-
/** Ordenar, filtrar, trocar os dados ou a chave mantém a linha selecionada (se ainda existir). */
|
|
1210
|
-
atualizarContextoSelecao() {
|
|
1211
|
-
this.selecaoController.reconciliar(), this._indiceAtivo = this.selecaoController.getIndiceSelecionado();
|
|
1212
|
-
}
|
|
1213
|
-
renderTotal() {
|
|
1214
|
-
var e;
|
|
1215
|
-
if (this.shadow) {
|
|
1216
|
-
if (this._containerElement) {
|
|
1217
|
-
if (this._containerElement.style.maxHeight = this.getAttribute("max-height") || "", this._emptyElement) {
|
|
1218
|
-
const i = this._emptyElement.querySelector(".ui-tabela__empty-text");
|
|
1219
|
-
i && (i.textContent = this._textoVazio);
|
|
1220
|
-
}
|
|
1221
|
-
} else {
|
|
1222
|
-
this.cleanupEventListeners();
|
|
1223
|
-
const i = tt(this.shadow, this._textoVazio, this.getAttribute("max-height"), this._carregando);
|
|
1224
|
-
this._containerElement = i.containerElement, this._tableElement = i.tableElement, this._colgroupElement = i.colgroupElement, this._theadElement = i.theadElement, this._tbodyElement = i.tbodyElement, this._emptyElement = i.emptyElement, this._loadingElement = i.loadingElement, this._erroElement = i.erroElement, this._anuncioElement = i.anuncioElement, (e = i.erroElement.querySelector(".ui-tabela__erro-acao")) == null || e.addEventListener("click", () => {
|
|
1225
|
-
this.recarregar();
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler = et(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
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
definirLinhaAtiva(e) {
|
|
1232
|
-
this._indiceAtivo = e;
|
|
1233
|
-
const i = this._tbodyElement, o = i == null ? void 0 : i.querySelector(`tr[data-index="${e}"]`);
|
|
1234
|
-
!i || !o || (i.querySelectorAll('tr[tabindex="0"]').forEach((a) => {
|
|
1235
|
-
a !== o && (a.tabIndex = -1);
|
|
1236
|
-
}), o.tabIndex = 0);
|
|
1237
|
-
}
|
|
1238
|
-
obterContextoRenderizador() {
|
|
1239
|
-
return {
|
|
1240
|
-
host: this,
|
|
1241
|
-
shadow: this.shadow,
|
|
1242
|
-
theadElement: this._theadElement,
|
|
1243
|
-
colgroupElement: this._colgroupElement,
|
|
1244
|
-
tbodyElement: this._tbodyElement,
|
|
1245
|
-
tableElement: this._tableElement,
|
|
1246
|
-
emptyElement: this._emptyElement,
|
|
1247
|
-
containerElement: this._containerElement,
|
|
1248
|
-
colunas: this._colunas,
|
|
1249
|
-
dadosController: this.dadosController,
|
|
1250
|
-
selecaoController: this.selecaoController,
|
|
1251
|
-
chaveId: this.chaveId,
|
|
1252
|
-
virtualizar: this._virtualizar,
|
|
1253
|
-
rowHeight: this.getRowHeight(),
|
|
1254
|
-
indiceAtivo: this._indiceAtivo,
|
|
1255
|
-
textoVazio: this._textoVazio,
|
|
1256
|
-
textoSemResultados: this._textoSemResultados(),
|
|
1257
|
-
headerListeners: this._headerListeners,
|
|
1258
|
-
onSetIsResizing: (e) => {
|
|
1259
|
-
this._isResizing = e;
|
|
1260
|
-
},
|
|
1261
|
-
onActiveResizeCleanup: (e) => {
|
|
1262
|
-
this._activeResizeCleanup = e;
|
|
1263
|
-
},
|
|
1264
|
-
onHeaderClick: (e) => this.handleHeaderClick(e)
|
|
1265
|
-
};
|
|
1266
|
-
}
|
|
1267
|
-
renderHeader() {
|
|
1268
|
-
Ze(this.obterContextoRenderizador());
|
|
1269
|
-
}
|
|
1270
|
-
renderBody() {
|
|
1271
|
-
Je(this.obterContextoRenderizador()), this.anunciarResultado(), this.medirAlturaLinha();
|
|
1272
|
-
}
|
|
1273
|
-
/**
|
|
1274
|
-
* Rola até um item e opcionalmente o seleciona. Aceita ID (pela `chave-id`, depois `id`, `_id`,
|
|
1275
|
-
* `codigo`, `key`), predicado ou índice. Um número é procurado primeiro como ID; use
|
|
1276
|
-
* `{ porIndice: true }` ou `rolarParaIndice()` para tratá-lo só como índice da linha exibida.
|
|
1277
|
-
*/
|
|
1278
|
-
rolarPara(e, i) {
|
|
1279
|
-
return this.selecaoController.rolarPara(e, i);
|
|
1280
|
-
}
|
|
1281
|
-
/** Rola até a linha exibida de índice `indice` (posição após ordenação/filtro, base 0). */
|
|
1282
|
-
rolarParaIndice(e, i) {
|
|
1283
|
-
return this.selecaoController.rolarPara(e, { ...i, porIndice: !0 });
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
V("ui-tabela", ut);
|
|
1287
|
-
const M = Math.PI / 180, pe = 64;
|
|
1288
|
-
function N(t) {
|
|
1289
|
-
return Math.abs(t) < 1e-12 ? 0 : Number(t.toPrecision(15));
|
|
1290
|
-
}
|
|
1291
|
-
const pt = {
|
|
1292
|
-
sqrt: Math.sqrt,
|
|
1293
|
-
abs: Math.abs,
|
|
1294
|
-
round: Math.round,
|
|
1295
|
-
floor: Math.floor,
|
|
1296
|
-
ceil: Math.ceil,
|
|
1297
|
-
trunc: Math.trunc,
|
|
1298
|
-
sign: Math.sign,
|
|
1299
|
-
log: Math.log10,
|
|
1300
|
-
ln: Math.log,
|
|
1301
|
-
deg: (t) => N(t / M),
|
|
1302
|
-
rad: (t) => N(t * M),
|
|
1303
|
-
sin: (t) => N(Math.sin(t * M)),
|
|
1304
|
-
cos: (t) => N(Math.cos(t * M)),
|
|
1305
|
-
tan: (t) => N(Math.tan(t * M)),
|
|
1306
|
-
asin: (t) => N(Math.asin(t) / M),
|
|
1307
|
-
acos: (t) => N(Math.acos(t) / M),
|
|
1308
|
-
atan: (t) => N(Math.atan(t) / M)
|
|
1309
|
-
}, ht = {
|
|
1310
|
-
min: (t) => t.length > 0 ? Math.min(...t) : NaN,
|
|
1311
|
-
max: (t) => t.length > 0 ? Math.max(...t) : NaN,
|
|
1312
|
-
pow: (t) => t.length === 2 ? Math.pow(t[0], t[1]) : NaN,
|
|
1313
|
-
hypot: (t) => t.length >= 2 ? Math.hypot(...t) : NaN,
|
|
1314
|
-
atan2: (t) => t.length === 2 ? N(Math.atan2(t[0], t[1]) / M) : NaN,
|
|
1315
|
-
mod: (t) => t.length === 2 && t[1] !== 0 ? t[0] % t[1] : NaN
|
|
1316
|
-
};
|
|
1317
|
-
function mt(t) {
|
|
1318
|
-
if (!t || typeof t != "string") return null;
|
|
1319
|
-
let r = t.trim();
|
|
1320
|
-
if (r.startsWith("=") && (r = r.slice(1).trim()), !r) return null;
|
|
1321
|
-
r = r.replace(/(\d),(\d)/g, "$1.$2");
|
|
1322
|
-
let e = 0, i = 0, o = !1;
|
|
1323
|
-
function a() {
|
|
1324
|
-
return r[e] || "";
|
|
1325
|
-
}
|
|
1326
|
-
function n() {
|
|
1327
|
-
return r[e++] || "";
|
|
1328
|
-
}
|
|
1329
|
-
function l() {
|
|
1330
|
-
for (; e < r.length && /\s/.test(r[e]); )
|
|
1331
|
-
e++;
|
|
1332
|
-
}
|
|
1333
|
-
function d() {
|
|
1334
|
-
if (++i > pe)
|
|
1335
|
-
throw new Error("Profundidade máxima excedida");
|
|
1336
|
-
try {
|
|
1337
|
-
l();
|
|
1338
|
-
let s = u();
|
|
1339
|
-
for (l(); e < r.length; ) {
|
|
1340
|
-
const h = a();
|
|
1341
|
-
if (h === "+" || h === "-") {
|
|
1342
|
-
n(), l();
|
|
1343
|
-
const m = u(), g = o;
|
|
1344
|
-
l(), g ? s = h === "+" ? s + s * m : s - s * m : s = h === "+" ? s + m : s - m, o = !1;
|
|
1345
|
-
} else
|
|
1346
|
-
break;
|
|
1347
|
-
}
|
|
1348
|
-
return s;
|
|
1349
|
-
} finally {
|
|
1350
|
-
i--;
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
function u() {
|
|
1354
|
-
l();
|
|
1355
|
-
let s = c(), h = o;
|
|
1356
|
-
for (l(); e < r.length; ) {
|
|
1357
|
-
const m = a();
|
|
1358
|
-
if (m === "*" || m === "/" || m === "x" || m === "X") {
|
|
1359
|
-
n(), l();
|
|
1360
|
-
const g = c();
|
|
1361
|
-
if (h = !1, m === "/" && g === 0)
|
|
1362
|
-
throw new Error("Divisão por zero");
|
|
1363
|
-
s = m === "/" ? s / g : s * g, l();
|
|
1364
|
-
} else
|
|
1365
|
-
break;
|
|
1366
|
-
}
|
|
1367
|
-
return o = h, s;
|
|
1368
|
-
}
|
|
1369
|
-
function c() {
|
|
1370
|
-
if (++i > pe)
|
|
1371
|
-
throw new Error("Profundidade máxima excedida");
|
|
1372
|
-
try {
|
|
1373
|
-
l();
|
|
1374
|
-
const s = a();
|
|
1375
|
-
if (s === "+" || s === "-") {
|
|
1376
|
-
n();
|
|
1377
|
-
const g = c();
|
|
1378
|
-
return s === "-" ? -g : g;
|
|
1379
|
-
}
|
|
1380
|
-
let h = p();
|
|
1381
|
-
const m = o;
|
|
1382
|
-
if (l(), a() === "^") {
|
|
1383
|
-
n();
|
|
1384
|
-
const g = c();
|
|
1385
|
-
h = Math.pow(h, g), o = !1;
|
|
1386
|
-
} else if (r.slice(e, e + 2) === "**") {
|
|
1387
|
-
e += 2;
|
|
1388
|
-
const g = c();
|
|
1389
|
-
h = Math.pow(h, g), o = !1;
|
|
1390
|
-
} else
|
|
1391
|
-
o = m;
|
|
1392
|
-
return h;
|
|
1393
|
-
} finally {
|
|
1394
|
-
i--;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
function p() {
|
|
1398
|
-
l(), o = !1;
|
|
1399
|
-
const s = a();
|
|
1400
|
-
if (s === "+" || s === "-") {
|
|
1401
|
-
n();
|
|
1402
|
-
const f = p();
|
|
1403
|
-
return s === "-" ? -f : f;
|
|
1404
|
-
}
|
|
1405
|
-
if (s === "(") {
|
|
1406
|
-
n();
|
|
1407
|
-
const f = d();
|
|
1408
|
-
if (l(), n() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1409
|
-
return l(), a() === "%" ? (n(), o = !0, f / 100) : (o = !1, f);
|
|
1410
|
-
}
|
|
1411
|
-
const h = r.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);
|
|
1412
|
-
if (h) {
|
|
1413
|
-
const f = h[1].toLowerCase(), b = pt[f], E = ht[f];
|
|
1414
|
-
if (!b && !E)
|
|
1415
|
-
throw new Error("Função desconhecida: " + h[1]);
|
|
1416
|
-
e += h[0].length;
|
|
1417
|
-
const x = [d()];
|
|
1418
|
-
for (l(); a() === ";" || a() === ","; )
|
|
1419
|
-
n(), l(), x.push(d()), l();
|
|
1420
|
-
if (n() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1421
|
-
const w = E ? E(x) : x.length === 1 && b ? b(x[0]) : NaN;
|
|
1422
|
-
if (isNaN(w)) throw new Error("Resultado inválido de função");
|
|
1423
|
-
return l(), a() === "%" ? (n(), o = !0, w / 100) : (o = !1, w);
|
|
1424
|
-
}
|
|
1425
|
-
const m = r.slice(e).match(/^(pi|π|e)\b/i);
|
|
1426
|
-
if (m) {
|
|
1427
|
-
e += m[0].length;
|
|
1428
|
-
let b = m[1].toLowerCase() === "e" ? Math.E : Math.PI;
|
|
1429
|
-
return l(), a() === "%" && (n(), o = !0, b = b / 100), b;
|
|
1430
|
-
}
|
|
1431
|
-
const g = r.slice(e).match(/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|,[0-9]+)(?:[eE][+-]?[0-9]+)?/);
|
|
1432
|
-
if (g) {
|
|
1433
|
-
e += g[0].length;
|
|
1434
|
-
let f = parseFloat(g[0].replace(",", "."));
|
|
1435
|
-
return l(), a() === "%" && (n(), o = !0, f = f / 100), f;
|
|
1436
|
-
}
|
|
1437
|
-
throw new Error("Caractere inválido: " + s);
|
|
1438
|
-
}
|
|
1439
|
-
try {
|
|
1440
|
-
const s = d();
|
|
1441
|
-
return l(), e < r.length ? null : typeof s == "number" && isFinite(s) ? s : null;
|
|
1442
|
-
} catch {
|
|
1443
|
-
return null;
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
const Q = '.ui-prop__categoria--aberta .ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__categoria--aberta .ui-prop__linha select:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-cor-container';
|
|
1447
|
-
function xe(t, r) {
|
|
1448
|
-
if (!t) return null;
|
|
1449
|
-
const e = String(r);
|
|
1450
|
-
return Array.from(t.querySelectorAll("[data-prop-id]")).find((i) => i.getAttribute("data-prop-id") === e) ?? null;
|
|
1451
|
-
}
|
|
1452
|
-
const ye = /* @__PURE__ */ new WeakMap();
|
|
1453
|
-
function R(t, r) {
|
|
1454
|
-
ye.set(t, r);
|
|
1455
|
-
}
|
|
1456
|
-
function he(t, r, e) {
|
|
1457
|
-
var a, n;
|
|
1458
|
-
const i = xe(t, r), o = (a = i == null ? void 0 : i.querySelector(".ui-prop__col-valor")) == null ? void 0 : a.firstElementChild;
|
|
1459
|
-
o && ((n = ye.get(o)) == null || n(e));
|
|
1460
|
-
}
|
|
1461
|
-
function H(t, r, e = (o, a) => o === String(a), i = (o) => o == null || o === "" ? "—" : String(o)) {
|
|
1462
|
-
var n;
|
|
1463
|
-
(n = t.querySelector("option[data-externa]")) == null || n.remove();
|
|
1464
|
-
const o = Array.from(t.options).find((l) => !l.hasAttribute("data-acao") && e(l.value, r));
|
|
1465
|
-
if (o) {
|
|
1466
|
-
o.selected = !0;
|
|
1467
|
-
return;
|
|
1468
|
-
}
|
|
1469
|
-
const a = document.createElement("option");
|
|
1470
|
-
a.value = r == null ? "" : String(r), a.textContent = i(r), a.setAttribute("data-externa", ""), a.hidden = !0, t.insertBefore(a, t.firstChild), a.selected = !0;
|
|
1471
|
-
}
|
|
1472
|
-
function q(t, r) {
|
|
1473
|
-
var i;
|
|
1474
|
-
(i = t.querySelector("option[data-externa]")) == null || i.remove();
|
|
1475
|
-
const e = document.createElement("option");
|
|
1476
|
-
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;
|
|
1477
|
-
}
|
|
1478
|
-
function ft(t, r) {
|
|
1479
|
-
const e = Array.from(t.querySelectorAll(Q)), i = e.indexOf(r);
|
|
1480
|
-
if (i !== -1 && i + 1 < e.length) {
|
|
1481
|
-
const o = e[i + 1];
|
|
1482
|
-
o.focus(), o instanceof HTMLInputElement && o.select();
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
function bt(t, r) {
|
|
1486
|
-
const e = Array.from(t.querySelectorAll(Q)), i = e.indexOf(r);
|
|
1487
|
-
if (i > 0) {
|
|
1488
|
-
const o = e[i - 1];
|
|
1489
|
-
o.focus(), o instanceof HTMLInputElement && o.select();
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
function gt(t) {
|
|
1493
|
-
const r = t.querySelector(Q);
|
|
1494
|
-
r && (r.focus(), r instanceof HTMLInputElement && r.select());
|
|
1495
|
-
}
|
|
1496
|
-
function Z(t, r) {
|
|
1497
|
-
var e;
|
|
1498
|
-
t.classList.toggle("ui-prop__categoria--aberta", r), D(t, "categoria-aberta", r), (e = t.querySelector(".ui-prop__categoria-header")) == null || e.setAttribute("aria-expanded", String(r));
|
|
1499
|
-
}
|
|
1500
|
-
function vt(t, r) {
|
|
1501
|
-
r.forEach((e) => {
|
|
1502
|
-
!e || typeof e != "object" || (e.aberto = !0, "aberta" in e && (e.aberta = !0));
|
|
1503
|
-
}), t.querySelectorAll(".ui-prop__categoria").forEach((e) => Z(e, !0));
|
|
1504
|
-
}
|
|
1505
|
-
function _t(t, r) {
|
|
1506
|
-
r.forEach((e) => {
|
|
1507
|
-
!e || typeof e != "object" || (e.aberto = !1, "aberta" in e && (e.aberta = !1));
|
|
1508
|
-
}), t.querySelectorAll(".ui-prop__categoria").forEach((e) => Z(e, !1));
|
|
1509
|
-
}
|
|
1510
|
-
function xt(t, r, e, i) {
|
|
1511
|
-
const o = e.find((a) => a && String(a.id) === String(i));
|
|
1512
|
-
if (o) {
|
|
1513
|
-
const a = Array.from(t.querySelectorAll("[data-cat-id]")).find((d) => d.getAttribute("data-cat-id") === String(i)), l = !(a ? a.classList.contains("ui-prop__categoria--aberta") : o.aberto !== void 0 ? o.aberto !== !1 : o.aberta !== !1);
|
|
1514
|
-
o.aberto = l, "aberta" in o && (o.aberta = l), a && Z(a, l), r.dispatchEvent(
|
|
1515
|
-
new CustomEvent("ui-categoria-toggle", {
|
|
1516
|
-
bubbles: !0,
|
|
1517
|
-
composed: !0,
|
|
1518
|
-
detail: { id: i, aberto: l }
|
|
1519
|
-
})
|
|
1520
|
-
);
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
const J = Symbol.for("ui-tabela-propriedades:misto"), ee = "Varia";
|
|
1524
|
-
function S(t) {
|
|
1525
|
-
return t === J;
|
|
1526
|
-
}
|
|
1527
|
-
function T(t) {
|
|
1528
|
-
var e;
|
|
1529
|
-
let r;
|
|
1530
|
-
try {
|
|
1531
|
-
r = (e = t.obterTextoMisto) == null ? void 0 : e.call(t);
|
|
1532
|
-
} catch {
|
|
1533
|
-
}
|
|
1534
|
-
return typeof r == "string" && r.trim() ? r : ee;
|
|
1535
|
-
}
|
|
1536
|
-
function O(t, r) {
|
|
1537
|
-
return t == null && r == null ? !0 : Object.is(t, r);
|
|
1538
|
-
}
|
|
1539
|
-
function K(t) {
|
|
1540
|
-
return t.misto ? J : t.valor;
|
|
1541
|
-
}
|
|
1542
|
-
function yt(t) {
|
|
1543
|
-
if (!Array.isArray(t) || t.length === 0) return;
|
|
1544
|
-
const r = t[0];
|
|
1545
|
-
for (let e = 1; e < t.length; e++)
|
|
1546
|
-
if (!O(r, t[e])) return J;
|
|
1547
|
-
return r;
|
|
1548
|
-
}
|
|
1549
|
-
function tr(t) {
|
|
1550
|
-
if (!Array.isArray(t)) return {};
|
|
1551
|
-
const r = t.filter(
|
|
1552
|
-
(o) => o !== null && typeof o == "object" && !Array.isArray(o)
|
|
1553
|
-
), e = /* @__PURE__ */ new Set();
|
|
1554
|
-
r.forEach((o) => Object.keys(o).forEach((a) => e.add(a)));
|
|
1555
|
-
const i = {};
|
|
1556
|
-
return e.forEach((o) => {
|
|
1557
|
-
i[o] = yt(r.map((a) => o in a ? a[o] : void 0));
|
|
1558
|
-
}), i;
|
|
1559
|
-
}
|
|
1560
|
-
function $(t) {
|
|
1561
|
-
if (typeof t.casasDecimais == "number" && t.casasDecimais >= 0) return t.casasDecimais;
|
|
1562
|
-
if (typeof t.precisao == "number" && t.precisao >= 0) return t.precisao;
|
|
1563
|
-
}
|
|
1564
|
-
function Et(t, r) {
|
|
1565
|
-
return typeof t.passo == "number" && t.passo > 0 ? t.passo : typeof t.step == "number" && t.step > 0 ? t.step : r !== void 0 ? Math.pow(10, -r) : 1;
|
|
1566
|
-
}
|
|
1567
|
-
function te(t, r) {
|
|
1568
|
-
let e = t;
|
|
1569
|
-
return typeof r.min == "number" && Number.isFinite(r.min) && (e = Math.max(r.min, e)), typeof r.max == "number" && Number.isFinite(r.max) && (e = Math.min(r.max, e)), e;
|
|
1570
|
-
}
|
|
1571
|
-
function X(t, r) {
|
|
1572
|
-
if (typeof t != "string") return null;
|
|
1573
|
-
let e = t.trim();
|
|
1574
|
-
const i = typeof r.unidade == "string" ? r.unidade.trim() : "";
|
|
1575
|
-
if (i && e.length > i.length && e.toLowerCase().endsWith(i.toLowerCase()) && (e = e.slice(0, e.length - i.length).trim()), !e) return null;
|
|
1576
|
-
const o = mt(e);
|
|
1577
|
-
if (o === null || !Number.isFinite(o)) return null;
|
|
1578
|
-
const a = $(r), n = te(o, r);
|
|
1579
|
-
return Number(a !== void 0 ? n.toFixed(a) : n.toPrecision(15));
|
|
1580
|
-
}
|
|
1581
|
-
function Ee(t, r, e, i) {
|
|
1582
|
-
t.classList.toggle("ui-prop__editor--misto", e), e ? t.placeholder = i : r.placeholder ? t.placeholder = r.placeholder : t.removeAttribute("placeholder");
|
|
1583
|
-
}
|
|
1584
|
-
function wt(t, r, e) {
|
|
1585
|
-
const i = document.createElement("span"), o = e ? $(e) : void 0, a = (n) => {
|
|
1586
|
-
if (S(n)) {
|
|
1587
|
-
i.className = "ui-prop__valor-readonly ui-prop__editor--misto", i.textContent = r ? T({ obterTextoMisto: r }) : ee;
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
if (n == null) {
|
|
1591
|
-
i.className = "ui-prop__valor-readonly", i.textContent = "—";
|
|
1592
|
-
return;
|
|
1593
|
-
}
|
|
1594
|
-
if ((e == null ? void 0 : e.tipo) === "booleano" && typeof n == "boolean") {
|
|
1595
|
-
i.className = "ui-prop__valor-readonly", i.textContent = n ? "Sim" : "Não";
|
|
1596
|
-
return;
|
|
1597
|
-
}
|
|
1598
|
-
if (e != null && e.opcoes && e.opcoes.length > 0) {
|
|
1599
|
-
const d = e.opcoes.find((u) => u && String(u.id) === String(n));
|
|
1600
|
-
if (d) {
|
|
1601
|
-
i.className = "ui-prop__valor-readonly", i.textContent = d.rotulo;
|
|
1602
|
-
return;
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
const l = typeof n == "number" || typeof n == "string" && /^-?\d+(\.\d+)?$/.test(n.trim());
|
|
1606
|
-
if (i.className = `ui-prop__valor-readonly ${l ? "ui-prop__valor-readonly--numero" : ""}`.trim(), l && o !== void 0) {
|
|
1607
|
-
const d = Number(n);
|
|
1608
|
-
i.textContent = Number.isFinite(d) ? d.toFixed(o) : String(n);
|
|
1609
|
-
} else
|
|
1610
|
-
i.textContent = String(n);
|
|
1611
|
-
};
|
|
1612
|
-
return a(t), R(i, a), i;
|
|
1613
|
-
}
|
|
1614
|
-
function At(t, r, e, i) {
|
|
1615
|
-
const o = document.createElement("label");
|
|
1616
|
-
o.className = "ui-prop__editor-booleano", o.setAttribute("role", "checkbox"), o.tabIndex = 0, o.setAttribute("aria-label", String(r.rotulo ?? r.id));
|
|
1617
|
-
const a = document.createElement("div");
|
|
1618
|
-
a.className = "ui-prop__checkbox-custom";
|
|
1619
|
-
const n = document.createElement("span");
|
|
1620
|
-
n.className = "ui-prop__booleano-rotulo";
|
|
1621
|
-
const l = (u) => {
|
|
1622
|
-
const c = S(u), p = !c && !!u;
|
|
1623
|
-
o.classList.toggle("ui-prop__editor--misto", c), a.classList.toggle("ui-prop__checkbox-custom--marcado", p), a.classList.toggle("ui-prop__checkbox-custom--misto", c), a.textContent = c ? "–" : p ? "✓" : "", n.textContent = c ? T(i) : p ? "Sim" : "Não", o.setAttribute("aria-checked", c ? "mixed" : String(p));
|
|
1624
|
-
};
|
|
1625
|
-
l(e), R(o, l), o.appendChild(a), o.appendChild(n);
|
|
1626
|
-
const d = () => {
|
|
1627
|
-
const u = i.obterValorAtual(r.id), c = S(u) ? !0 : !u;
|
|
1628
|
-
i.registrarAlteracao(t, r.id, c), l(c);
|
|
1629
|
-
};
|
|
1630
|
-
return o.addEventListener("click", (u) => {
|
|
1631
|
-
u.preventDefault(), d();
|
|
1632
|
-
}), o.addEventListener("keydown", (u) => {
|
|
1633
|
-
u.key === " " ? (u.preventDefault(), d()) : u.key === "Enter" && (u.preventDefault(), u.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o));
|
|
1634
|
-
}), o;
|
|
1635
|
-
}
|
|
1636
|
-
function Ct(t, r, e, i) {
|
|
1637
|
-
const o = document.createElement("select");
|
|
1638
|
-
o.className = "ui-prop__editor-select", o.setAttribute("aria-label", String(r.rotulo ?? r.id)), (Array.isArray(r.opcoes) ? r.opcoes : []).forEach((n) => {
|
|
1639
|
-
if (!n || typeof n != "object") return;
|
|
1640
|
-
const l = document.createElement("option");
|
|
1641
|
-
l.value = String(n.id), l.textContent = String(n.rotulo ?? n.id), o.appendChild(l);
|
|
1642
|
-
});
|
|
1643
|
-
const a = (n) => {
|
|
1644
|
-
o.classList.toggle("ui-prop__editor--misto", S(n)), S(n) ? q(o, T(i)) : H(o, n);
|
|
1645
|
-
};
|
|
1646
|
-
return a(e), R(o, a), o.addEventListener("change", () => {
|
|
1647
|
-
const n = (r.opcoes || []).find((l) => l && String(l.id) === o.value);
|
|
1648
|
-
i.registrarAlteracao(t, r.id, n ? n.id : o.value), a(i.obterValorAtual(r.id));
|
|
1649
|
-
}), o.addEventListener("keydown", (n) => {
|
|
1650
|
-
n.key === "Enter" && (n.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o));
|
|
1651
|
-
}), o;
|
|
1652
|
-
}
|
|
1653
|
-
function kt(t, r, e) {
|
|
1654
|
-
const i = document.createElement("button");
|
|
1655
|
-
return i.type = "button", i.className = "ui-prop__btn-acao-inline", i.textContent = r.rotuloAcao || "Editar...", i.addEventListener("click", () => {
|
|
1656
|
-
typeof r.onClickAcao == "function" && r.onClickAcao(r), e.despacharEventoAcao(r, t);
|
|
1657
|
-
}), i;
|
|
1658
|
-
}
|
|
1659
|
-
function zt(t, r, e, i) {
|
|
1660
|
-
const o = document.createElement("input");
|
|
1661
|
-
o.type = "text", o.inputMode = "decimal", o.autocomplete = "off", o.spellcheck = !1, o.className = "ui-prop__editor-input ui-prop__editor-input--numero", o.setAttribute("aria-label", String(r.rotulo ?? r.id)), r.placeholder && (o.placeholder = r.placeholder);
|
|
1662
|
-
const a = $(r), n = (s) => {
|
|
1663
|
-
if (s == null || s === "" || S(s)) return "";
|
|
1664
|
-
const h = Number(s);
|
|
1665
|
-
return isNaN(h) ? String(s) : a !== void 0 ? h.toFixed(a) : String(h);
|
|
1666
|
-
}, l = (s) => {
|
|
1667
|
-
o.value = n(s), Ee(o, r, S(s), T(i));
|
|
1668
|
-
};
|
|
1669
|
-
l(e), R(o, l);
|
|
1670
|
-
let d = null;
|
|
1671
|
-
const u = () => {
|
|
1672
|
-
o.classList.remove("ui-prop__editor-input--calculando"), o.title = "", d && (d.hidden = !0);
|
|
1673
|
-
}, c = (s) => {
|
|
1674
|
-
if (!d) {
|
|
1675
|
-
if (!o.parentElement) return;
|
|
1676
|
-
d = document.createElement("span"), d.className = "ui-prop__previa-calculo", d.setAttribute("aria-hidden", "true"), o.parentElement.appendChild(d);
|
|
1677
|
-
}
|
|
1678
|
-
d.textContent = s, d.hidden = !1;
|
|
1679
|
-
};
|
|
1680
|
-
o.addEventListener("focus", () => {
|
|
1681
|
-
o.classList.remove("ui-prop__editor-input--invalido"), o.select();
|
|
1682
|
-
}), o.addEventListener("animationend", () => o.classList.remove("ui-prop__editor-input--invalido")), o.addEventListener("input", () => {
|
|
1683
|
-
o.classList.remove("ui-prop__editor-input--invalido");
|
|
1684
|
-
const s = o.value.trim(), m = !/^[+-]?[0-9]*[.,]?[0-9]*$/.test(s) && (s.startsWith("=") || /[\+\-\*\/\^\%\(\);]|^[a-zA-Z_π]/.test(s));
|
|
1685
|
-
if (o.classList.toggle("ui-prop__editor-input--calculando", m), m) {
|
|
1686
|
-
const g = X(s, r), f = g !== null ? `= ${n(g)}` : "= ?";
|
|
1687
|
-
o.title = g !== null ? f : "", c(f);
|
|
1688
|
-
} else
|
|
1689
|
-
u();
|
|
1690
|
-
});
|
|
1691
|
-
const p = () => {
|
|
1692
|
-
u();
|
|
1693
|
-
const s = o.value.trim(), h = i.obterValorAtual(r.id);
|
|
1694
|
-
if (s === n(h)) return;
|
|
1695
|
-
if (s === "") {
|
|
1696
|
-
if (S(h)) return;
|
|
1697
|
-
i.registrarAlteracao(t, r.id, null);
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
const m = X(s, r);
|
|
1701
|
-
m !== null ? (i.registrarAlteracao(t, r.id, m), l(i.obterValorAtual(r.id))) : (l(h), o.classList.add("ui-prop__editor-input--invalido"));
|
|
1702
|
-
};
|
|
1703
|
-
return o.addEventListener("change", p), o.addEventListener("blur", p), o.addEventListener("keydown", (s) => {
|
|
1704
|
-
if (s.key === "Enter")
|
|
1705
|
-
p(), s.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o);
|
|
1706
|
-
else if (s.key === "Escape")
|
|
1707
|
-
s.preventDefault(), s.stopPropagation(), u(), l(i.obterValorAtual(r.id)), o.blur();
|
|
1708
|
-
else if (s.key === "ArrowUp" || s.key === "ArrowDown") {
|
|
1709
|
-
s.preventDefault(), u();
|
|
1710
|
-
const h = X(o.value, r), m = i.obterValorAtual(r.id);
|
|
1711
|
-
if (h === null && S(m)) return;
|
|
1712
|
-
const g = h ?? (Number(m) || 0);
|
|
1713
|
-
let f = Et(r, a);
|
|
1714
|
-
s.shiftKey ? f *= 10 : s.altKey && a === void 0 && (f *= 0.1);
|
|
1715
|
-
let b = s.key === "ArrowUp" ? g + f : g - f;
|
|
1716
|
-
b = te(b, r), a !== void 0 ? b = Number(b.toFixed(a)) : b = Math.round(b * 1e4) / 1e4, i.registrarAlteracao(t, r.id, b), l(b);
|
|
1717
|
-
}
|
|
1718
|
-
}), o;
|
|
1719
|
-
}
|
|
1720
|
-
function St(t, r, e, i) {
|
|
1721
|
-
const o = document.createElement("input");
|
|
1722
|
-
o.type = "text", o.className = "ui-prop__editor-input", o.setAttribute("aria-label", String(r.rotulo ?? r.id)), r.placeholder && (o.placeholder = r.placeholder);
|
|
1723
|
-
const a = (l) => {
|
|
1724
|
-
const d = S(l);
|
|
1725
|
-
o.value = d || l == null ? "" : String(l), Ee(o, r, d, T(i));
|
|
1726
|
-
};
|
|
1727
|
-
a(e), R(o, a), o.addEventListener("focus", () => {
|
|
1728
|
-
o.select();
|
|
1729
|
-
});
|
|
1730
|
-
const n = () => {
|
|
1731
|
-
o.value === "" && S(i.obterValorAtual(r.id)) || (i.registrarAlteracao(t, r.id, o.value), a(i.obterValorAtual(r.id)));
|
|
1732
|
-
};
|
|
1733
|
-
return o.addEventListener("change", n), o.addEventListener("blur", n), o.addEventListener("keydown", (l) => {
|
|
1734
|
-
l.key === "Enter" ? (n(), l.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o)) : l.key === "Escape" && (l.preventDefault(), l.stopPropagation(), a(i.obterValorAtual(r.id)), o.blur());
|
|
1735
|
-
}), o;
|
|
1736
|
-
}
|
|
1737
|
-
const we = (t, r) => t.toLowerCase() === String(r ?? "").toLowerCase();
|
|
1738
|
-
function re(t, r) {
|
|
1739
|
-
(Array.isArray(r) ? r : []).forEach((e) => {
|
|
1740
|
-
if (!e || typeof e != "object") return;
|
|
1741
|
-
const i = document.createElement("option");
|
|
1742
|
-
i.value = String(e.id), i.textContent = String(e.rotulo ?? e.id), t.appendChild(i);
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
function Lt(t, r, e, i) {
|
|
1746
|
-
const o = document.createElement("div");
|
|
1747
|
-
o.className = "ui-prop__editor-linha-container";
|
|
1748
|
-
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1749
|
-
a.setAttribute("class", "ui-prop__linha-amostra-svg"), a.setAttribute("viewBox", "0 0 44 12"), a.setAttribute("aria-hidden", "true");
|
|
1750
|
-
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1751
|
-
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "44"), n.setAttribute("y2", "6");
|
|
1752
|
-
const l = (p) => {
|
|
1753
|
-
const s = String(p || "").toLowerCase();
|
|
1754
|
-
s.includes("center") || s.includes("eixo") || s.includes("dashdot") || s.includes("traço-ponto") ? n.setAttribute("stroke-dasharray", "8,3,2,3") : s.includes("dash") || s.includes("tracej") || s.includes("hidden") ? n.setAttribute("stroke-dasharray", "6,3") : s.includes("dot") || s.includes("ponto") || s.includes("pontilh") ? n.setAttribute("stroke-dasharray", "2,3") : n.setAttribute("stroke-dasharray", "none");
|
|
1755
|
-
};
|
|
1756
|
-
a.appendChild(n);
|
|
1757
|
-
const d = document.createElement("select");
|
|
1758
|
-
d.className = "ui-prop__linha-select", d.setAttribute("aria-label", String(r.rotulo ?? r.id));
|
|
1759
|
-
const u = r.opcoes && r.opcoes.length > 0 ? r.opcoes : [
|
|
1760
|
-
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1761
|
-
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1762
|
-
{ id: "Continuous", rotulo: "Continuous" },
|
|
1763
|
-
{ id: "Dashed", rotulo: "Dashed" },
|
|
1764
|
-
{ id: "Hidden", rotulo: "Hidden" },
|
|
1765
|
-
{ id: "Center", rotulo: "Center" },
|
|
1766
|
-
{ id: "Dotted", rotulo: "Dotted" }
|
|
1767
|
-
];
|
|
1768
|
-
re(d, u);
|
|
1769
|
-
const c = (p) => {
|
|
1770
|
-
const s = S(p);
|
|
1771
|
-
if (o.classList.toggle("ui-prop__editor--misto", s), s) {
|
|
1772
|
-
l(""), q(d, T(i));
|
|
1773
|
-
return;
|
|
1774
|
-
}
|
|
1775
|
-
l(p), H(d, p, we);
|
|
1776
|
-
};
|
|
1777
|
-
return c(e), R(o, c), d.addEventListener("change", () => {
|
|
1778
|
-
const p = u.find((s) => s && String(s.id) === d.value);
|
|
1779
|
-
i.registrarAlteracao(t, r.id, p ? p.id : d.value), c(i.obterValorAtual(r.id));
|
|
1780
|
-
}), d.addEventListener("keydown", (p) => {
|
|
1781
|
-
p.key === "Enter" && (p.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(d) : i.focarProximoEditor(d));
|
|
1782
|
-
}), o.appendChild(a), o.appendChild(d), o;
|
|
1783
|
-
}
|
|
1784
|
-
function Mt(t, r, e, i) {
|
|
1785
|
-
const o = document.createElement("div");
|
|
1786
|
-
o.className = "ui-prop__editor-espessura-container";
|
|
1787
|
-
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1788
|
-
a.setAttribute("class", "ui-prop__espessura-amostra-svg"), a.setAttribute("viewBox", "0 0 38 12"), a.setAttribute("aria-hidden", "true");
|
|
1789
|
-
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1790
|
-
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "38"), n.setAttribute("y2", "6");
|
|
1791
|
-
const l = (p) => {
|
|
1792
|
-
const s = parseFloat(String(p).replace(/[^0-9.]/g, ""));
|
|
1793
|
-
return isNaN(s) || s <= 0 ? 1.5 : Math.min(8, Math.max(1, s * 8));
|
|
1794
|
-
};
|
|
1795
|
-
a.appendChild(n);
|
|
1796
|
-
const d = document.createElement("select");
|
|
1797
|
-
d.className = "ui-prop__espessura-select", d.setAttribute("aria-label", String(r.rotulo ?? r.id));
|
|
1798
|
-
const u = r.opcoes && r.opcoes.length > 0 ? r.opcoes : [
|
|
1799
|
-
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1800
|
-
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1801
|
-
{ id: "0.00 mm", rotulo: "0.00 mm" },
|
|
1802
|
-
{ id: "0.05 mm", rotulo: "0.05 mm" },
|
|
1803
|
-
{ id: "0.09 mm", rotulo: "0.09 mm" },
|
|
1804
|
-
{ id: "0.13 mm", rotulo: "0.13 mm" },
|
|
1805
|
-
{ id: "0.15 mm", rotulo: "0.15 mm" },
|
|
1806
|
-
{ id: "0.18 mm", rotulo: "0.18 mm" },
|
|
1807
|
-
{ id: "0.20 mm", rotulo: "0.20 mm" },
|
|
1808
|
-
{ id: "0.25 mm", rotulo: "0.25 mm" },
|
|
1809
|
-
{ id: "0.30 mm", rotulo: "0.30 mm" },
|
|
1810
|
-
{ id: "0.35 mm", rotulo: "0.35 mm" },
|
|
1811
|
-
{ id: "0.40 mm", rotulo: "0.40 mm" },
|
|
1812
|
-
{ id: "0.50 mm", rotulo: "0.50 mm" },
|
|
1813
|
-
{ id: "0.60 mm", rotulo: "0.60 mm" },
|
|
1814
|
-
{ id: "0.70 mm", rotulo: "0.70 mm" },
|
|
1815
|
-
{ id: "1.00 mm", rotulo: "1.00 mm" },
|
|
1816
|
-
{ id: "1.40 mm", rotulo: "1.40 mm" },
|
|
1817
|
-
{ id: "2.00 mm", rotulo: "2.00 mm" }
|
|
1818
|
-
];
|
|
1819
|
-
re(d, u);
|
|
1820
|
-
const c = (p) => {
|
|
1821
|
-
const s = S(p);
|
|
1822
|
-
o.classList.toggle("ui-prop__editor--misto", s), n.setAttribute("stroke-width", String(l(s ? "" : p))), s ? q(d, T(i)) : H(d, p, we);
|
|
1823
|
-
};
|
|
1824
|
-
return c(e), R(o, c), d.addEventListener("change", () => {
|
|
1825
|
-
const p = u.find((s) => s && String(s.id) === d.value);
|
|
1826
|
-
i.registrarAlteracao(t, r.id, p ? p.id : d.value), c(i.obterValorAtual(r.id));
|
|
1827
|
-
}), d.addEventListener("keydown", (p) => {
|
|
1828
|
-
p.key === "Enter" && (p.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(d) : i.focarProximoEditor(d));
|
|
1829
|
-
}), o.appendChild(a), o.appendChild(d), o;
|
|
1830
|
-
}
|
|
1831
|
-
const ie = [
|
|
1832
|
-
{ nome: "Red", indice: 1, hex: "#ff0000" },
|
|
1833
|
-
{ nome: "Yellow", indice: 2, hex: "#ffff00" },
|
|
1834
|
-
{ nome: "Green", indice: 3, hex: "#00ff00" },
|
|
1835
|
-
{ nome: "Cyan", indice: 4, hex: "#00ffff" },
|
|
1836
|
-
{ nome: "Blue", indice: 5, hex: "#0000ff" },
|
|
1837
|
-
{ nome: "Magenta", indice: 6, hex: "#ff00ff" },
|
|
1838
|
-
{ nome: "White", indice: 7, hex: "#ffffff" }
|
|
1839
|
-
], Ae = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1840
|
-
function Y(t) {
|
|
1841
|
-
const r = String(t ?? "").trim().toLowerCase(), e = ie.find((i) => String(i.indice) === r || i.nome.toLowerCase() === r);
|
|
1842
|
-
return e ? e.nome.toLowerCase() : r;
|
|
1843
|
-
}
|
|
1844
|
-
function Nt(t) {
|
|
1845
|
-
const r = Y(t), e = ie.find((i) => i.nome.toLowerCase() === r);
|
|
1846
|
-
return e ? e.hex : Ae.test(r) ? r : "#ffffff";
|
|
1847
|
-
}
|
|
1848
|
-
function Ce(t) {
|
|
1849
|
-
return t.length === 4 ? "#" + t.slice(1).split("").map((r) => r + r).join("") : t;
|
|
1850
|
-
}
|
|
1851
|
-
function Rt(t, r, e, i) {
|
|
1852
|
-
const o = document.createElement("div");
|
|
1853
|
-
o.className = "ui-prop__editor-cor-cad-container";
|
|
1854
|
-
const a = document.createElement("div");
|
|
1855
|
-
a.className = "ui-prop__cor-amostra";
|
|
1856
|
-
const n = document.createElement("select");
|
|
1857
|
-
n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label", String(r.rotulo ?? r.id)), re(n, [
|
|
1858
|
-
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1859
|
-
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1860
|
-
...ie.map((c) => ({ id: c.nome, rotulo: `${c.nome} (${c.indice})` }))
|
|
1861
|
-
]);
|
|
1862
|
-
const l = document.createElement("option");
|
|
1863
|
-
l.value = "__escolher", l.textContent = "Selecionar cor...", l.setAttribute("data-acao", ""), n.appendChild(l);
|
|
1864
|
-
const d = document.createElement("input");
|
|
1865
|
-
d.type = "color", d.className = "ui-prop__cor-picker-oculto", d.tabIndex = -1, d.setAttribute("aria-hidden", "true");
|
|
1866
|
-
const u = (c) => {
|
|
1867
|
-
const p = S(c);
|
|
1868
|
-
if (o.classList.toggle("ui-prop__editor--misto", p), a.classList.toggle("ui-prop__cor-amostra--misto", p), p) {
|
|
1869
|
-
a.style.backgroundColor = "", d.value = "#ffffff", q(n, T(i));
|
|
1870
|
-
return;
|
|
1871
|
-
}
|
|
1872
|
-
const s = Nt(c);
|
|
1873
|
-
a.style.backgroundColor = s, d.value = Ce(s), H(
|
|
1874
|
-
n,
|
|
1875
|
-
c,
|
|
1876
|
-
(h, m) => Y(h) === Y(m),
|
|
1877
|
-
(h) => h == null || h === "" ? "—" : String(h)
|
|
1878
|
-
);
|
|
1879
|
-
};
|
|
1880
|
-
return u(e), R(o, u), d.addEventListener("input", () => {
|
|
1881
|
-
a.style.backgroundColor = d.value;
|
|
1882
|
-
}), d.addEventListener("change", () => {
|
|
1883
|
-
i.registrarAlteracao(t, r.id, d.value), u(i.obterValorAtual(r.id));
|
|
1884
|
-
}), n.addEventListener("change", () => {
|
|
1885
|
-
if (n.value === "__escolher") {
|
|
1886
|
-
u(i.obterValorAtual(r.id)), d.click();
|
|
1887
|
-
return;
|
|
1888
|
-
}
|
|
1889
|
-
i.registrarAlteracao(t, r.id, n.value), u(i.obterValorAtual(r.id));
|
|
1890
|
-
}), n.addEventListener("keydown", (c) => {
|
|
1891
|
-
c.key === "Enter" && (c.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(n) : i.focarProximoEditor(n));
|
|
1892
|
-
}), o.appendChild(a), o.appendChild(n), o.appendChild(d), o;
|
|
1893
|
-
}
|
|
1894
|
-
function Tt(t, r, e, i) {
|
|
1895
|
-
const o = document.createElement("div");
|
|
1896
|
-
o.className = "ui-prop__editor-cor-container", o.setAttribute("role", "button"), o.tabIndex = 0;
|
|
1897
|
-
const a = document.createElement("div");
|
|
1898
|
-
a.className = "ui-prop__cor-amostra";
|
|
1899
|
-
const n = document.createElement("span");
|
|
1900
|
-
n.className = "ui-prop__cor-texto";
|
|
1901
|
-
const l = document.createElement("input");
|
|
1902
|
-
l.type = "color", l.className = "ui-prop__cor-picker-oculto", l.tabIndex = -1, l.setAttribute("aria-hidden", "true");
|
|
1903
|
-
const d = (u) => {
|
|
1904
|
-
const c = S(u);
|
|
1905
|
-
if (o.classList.toggle("ui-prop__editor--misto", c), a.classList.toggle("ui-prop__cor-amostra--misto", c), c) {
|
|
1906
|
-
const s = T(i);
|
|
1907
|
-
a.style.backgroundColor = "", n.textContent = s, l.value = "#ffffff", o.setAttribute("aria-label", `${r.rotulo ?? r.id}: ${s}`);
|
|
1908
|
-
return;
|
|
1909
|
-
}
|
|
1910
|
-
const p = typeof u == "string" && Ae.test(u) ? Ce(u) : null;
|
|
1911
|
-
a.style.backgroundColor = u || "#ffffff", n.textContent = r.textoAmostra || String(u || "ByLayer"), l.value = p ?? "#ffffff", o.setAttribute("aria-label", `${r.rotulo ?? r.id}: ${u || "ByLayer"}`);
|
|
1912
|
-
};
|
|
1913
|
-
return d(e), R(o, d), l.addEventListener("input", () => {
|
|
1914
|
-
a.style.backgroundColor = l.value, n.textContent = r.textoAmostra || l.value;
|
|
1915
|
-
}), l.addEventListener("change", () => {
|
|
1916
|
-
i.registrarAlteracao(t, r.id, l.value), d(i.obterValorAtual(r.id));
|
|
1917
|
-
}), o.addEventListener("click", (u) => {
|
|
1918
|
-
u.target !== l && l.click();
|
|
1919
|
-
}), o.addEventListener("keydown", (u) => {
|
|
1920
|
-
(u.key === " " || u.key === "Enter") && (u.preventDefault(), l.click());
|
|
1921
|
-
}), o.appendChild(a), o.appendChild(n), o.appendChild(l), o;
|
|
1922
|
-
}
|
|
1923
|
-
function Dt(t, r, e, i) {
|
|
1924
|
-
let o;
|
|
1925
|
-
return r.somenteLeitura || r.tipo === "readonly" ? o = wt(e, i.obterTextoMisto, r) : r.tipo === "booleano" ? o = At(t, r, e, i) : r.tipo === "linha" || r.tipo === "linetype" ? o = Lt(t, r, e, i) : r.tipo === "espessura" || r.tipo === "lineweight" ? o = Mt(t, r, e, i) : r.tipo === "cor-cad" ? o = Rt(t, r, e, i) : r.tipo === "selecao" ? o = Ct(t, r, e, i) : r.tipo === "cor" ? o = Tt(t, r, e, i) : r.tipo === "acao" ? o = kt(t, r, i) : r.tipo === "numero" ? o = zt(t, r, e, i) : o = St(t, r, e, i), o.setAttribute("part", "editor"), r.dica && o.setAttribute("aria-description", r.dica), o;
|
|
1926
|
-
}
|
|
1927
|
-
function Bt(t) {
|
|
1928
|
-
if (!t.tipoContainerElement) return;
|
|
1929
|
-
const r = (Array.isArray(t.tipos) ? t.tipos : []).filter(
|
|
1930
|
-
(i) => !!(i && typeof i == "object" && i.id !== void 0 && i.id !== null)
|
|
1931
|
-
);
|
|
1932
|
-
if (r.length === 0) {
|
|
1933
|
-
t.tipoContainerElement.style.display = "none", t.tipoContainerElement.innerHTML = "";
|
|
1934
|
-
return;
|
|
1935
|
-
}
|
|
1936
|
-
t.tipoContainerElement.style.display = "flex", t.tipoContainerElement.innerHTML = "";
|
|
1937
|
-
const e = r.find((i) => String(i.id) === String(t.tipoSelecionadoId)) || r[0];
|
|
1938
|
-
if (t.estiloVisual === "revit") {
|
|
1939
|
-
const i = document.createElement("div");
|
|
1940
|
-
i.className = "ui-prop__tipo-revit-card", i.title = "Editar tipo de família", i.addEventListener("click", () => t.onEditarTipo(e));
|
|
1941
|
-
const o = document.createElement("div");
|
|
1942
|
-
o.className = "ui-prop__tipo-miniatura";
|
|
1943
|
-
const a = e.iconeSvg ? Se(e.iconeSvg) : null;
|
|
1944
|
-
a ? o.appendChild(a) : o.innerHTML = `
|
|
1945
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1946
|
-
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
|
1947
|
-
<path d="M3 9h18M9 21V9"></path>
|
|
1948
|
-
</svg>
|
|
1949
|
-
`;
|
|
1950
|
-
const n = document.createElement("div");
|
|
1951
|
-
n.className = "ui-prop__tipo-info";
|
|
1952
|
-
const l = document.createElement("div");
|
|
1953
|
-
l.className = "ui-prop__tipo-nome", l.textContent = String(e.rotulo ?? e.id);
|
|
1954
|
-
const d = document.createElement("div");
|
|
1955
|
-
d.className = "ui-prop__tipo-subtexto", d.textContent = e.subtipo || "Tipo de Família", n.appendChild(l), n.appendChild(d), i.appendChild(o), i.appendChild(n);
|
|
1956
|
-
const u = document.createElement("div");
|
|
1957
|
-
u.className = "ui-prop__tipo-revit-subbarra";
|
|
1958
|
-
const c = document.createElement("select");
|
|
1959
|
-
c.className = "ui-prop__tipo-select", c.setAttribute("aria-label", "Selecionar tipo de família"), r.forEach((s) => {
|
|
1960
|
-
const h = document.createElement("option");
|
|
1961
|
-
h.value = String(s.id), h.textContent = `${s.rotulo ?? s.id}${s.subtipo ? ` : ${s.subtipo}` : ""}`, String(s.id) === String(e.id) && (h.selected = !0), c.appendChild(h);
|
|
1962
|
-
}), c.addEventListener("change", () => {
|
|
1963
|
-
t.onSelecionarTipo(c.value);
|
|
1964
|
-
});
|
|
1965
|
-
const p = document.createElement("button");
|
|
1966
|
-
p.type = "button", p.className = "ui-prop__btn-editar-tipo", p.innerHTML = `
|
|
1967
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;" aria-hidden="true">
|
|
1968
|
-
<rect x="3" y="3" width="12" height="12" rx="1"></rect>
|
|
1969
|
-
<rect x="9" y="9" width="12" height="12" rx="1"></rect>
|
|
1970
|
-
</svg>
|
|
1971
|
-
<span>Editar tipo</span>
|
|
1972
|
-
`, p.addEventListener("click", () => {
|
|
1973
|
-
t.onEditarTipo(e);
|
|
1974
|
-
}), u.appendChild(c), u.appendChild(p), t.tipoContainerElement.appendChild(i), t.tipoContainerElement.appendChild(u);
|
|
1975
|
-
} else {
|
|
1976
|
-
const i = document.createElement("div");
|
|
1977
|
-
i.className = "ui-prop__tipo-autocad-bar";
|
|
1978
|
-
const o = document.createElement("select");
|
|
1979
|
-
o.className = "ui-prop__tipo-select", o.setAttribute("aria-label", "Selecionar tipo de objeto"), r.forEach((u) => {
|
|
1980
|
-
const c = document.createElement("option");
|
|
1981
|
-
c.value = String(u.id), c.textContent = String(u.rotulo ?? u.id), String(u.id) === String(e.id) && (c.selected = !0), o.appendChild(c);
|
|
1982
|
-
}), o.addEventListener("change", () => {
|
|
1983
|
-
t.onSelecionarTipo(o.value);
|
|
1984
|
-
});
|
|
1985
|
-
const a = document.createElement("div");
|
|
1986
|
-
a.className = "ui-prop__tipo-autocad-acoes";
|
|
1987
|
-
const n = document.createElement("button");
|
|
1988
|
-
n.type = "button", n.className = "ui-prop__btn-autocad", n.title = "Seleção rápida", n.setAttribute("aria-label", "Seleção rápida"), n.innerHTML = `
|
|
1989
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1990
|
-
<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>
|
|
1991
|
-
</svg>
|
|
1992
|
-
`, n.addEventListener("click", () => {
|
|
1993
|
-
t.onQuickSelect(e);
|
|
1994
|
-
});
|
|
1995
|
-
const l = document.createElement("button");
|
|
1996
|
-
l.type = "button", l.className = "ui-prop__btn-autocad", l.title = "Selecionar objetos", l.setAttribute("aria-label", "Selecionar objetos"), l.innerHTML = `
|
|
1997
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1998
|
-
<circle cx="12" cy="12" r="7"></circle>
|
|
1999
|
-
<line x1="12" y1="2" x2="12" y2="7"></line>
|
|
2000
|
-
<line x1="12" y1="17" x2="12" y2="22"></line>
|
|
2001
|
-
<line x1="2" y1="12" x2="7" y2="12"></line>
|
|
2002
|
-
<line x1="17" y1="12" x2="22" y2="12"></line>
|
|
2003
|
-
<line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
|
|
2004
|
-
<line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
|
|
2005
|
-
</svg>
|
|
2006
|
-
`, l.addEventListener("click", () => {
|
|
2007
|
-
t.onSelectObjects(e);
|
|
2008
|
-
});
|
|
2009
|
-
const d = document.createElement("button");
|
|
2010
|
-
d.type = "button", d.className = "ui-prop__btn-autocad", d.title = "Calculadora rápida", d.setAttribute("aria-label", "Calculadora rápida"), d.innerHTML = `
|
|
2011
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
2012
|
-
<rect x="4" y="2" width="16" height="20" rx="2"></rect>
|
|
2013
|
-
<line x1="8" y1="6" x2="16" y2="6"></line>
|
|
2014
|
-
<circle cx="8" cy="11" r="1" fill="currentColor"></circle>
|
|
2015
|
-
<circle cx="12" cy="11" r="1" fill="currentColor"></circle>
|
|
2016
|
-
<circle cx="16" cy="11" r="1" fill="currentColor"></circle>
|
|
2017
|
-
<circle cx="8" cy="15" r="1" fill="currentColor"></circle>
|
|
2018
|
-
<circle cx="12" cy="15" r="1" fill="currentColor"></circle>
|
|
2019
|
-
<circle cx="16" cy="15" r="1" fill="currentColor"></circle>
|
|
2020
|
-
</svg>
|
|
2021
|
-
`, d.addEventListener("click", () => {
|
|
2022
|
-
t.onCalculadora(e);
|
|
2023
|
-
}), a.appendChild(n), a.appendChild(l), a.appendChild(d), i.appendChild(o), i.appendChild(a), t.tipoContainerElement.appendChild(i);
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
function Ot(t) {
|
|
2027
|
-
let r = 45;
|
|
2028
|
-
function e(a) {
|
|
2029
|
-
if (!Number.isFinite(a)) return r;
|
|
2030
|
-
const n = Math.max(20, Math.min(65, a));
|
|
2031
|
-
return r = n, t.hostElement.style.setProperty("--ui-prop-rotulo-largura", `${n}%`), t.splitterElement && (t.splitterElement.style.left = `calc(${n}% - 4px)`, t.splitterElement.setAttribute("aria-valuenow", String(Math.round(n)))), n;
|
|
2032
|
-
}
|
|
2033
|
-
function i(a) {
|
|
2034
|
-
t.onLarguraAlterada(a), t.hostElement.dispatchEvent(
|
|
2035
|
-
new CustomEvent("ui-splitter-resize", {
|
|
2036
|
-
bubbles: !0,
|
|
2037
|
-
composed: !0,
|
|
2038
|
-
detail: { larguraPorcentagem: a }
|
|
2039
|
-
})
|
|
2040
|
-
);
|
|
2041
|
-
}
|
|
2042
|
-
function o() {
|
|
2043
|
-
if (!t.splitterElement || !t.corpoElement) return;
|
|
2044
|
-
t.splitterListeners.cleanup();
|
|
2045
|
-
let a = !1;
|
|
2046
|
-
const n = (l) => {
|
|
2047
|
-
if (l.button !== 0) return;
|
|
2048
|
-
l.preventDefault(), l.stopPropagation(), a = !0, t.splitterElement.classList.add("ui-prop__splitter--ativo");
|
|
2049
|
-
try {
|
|
2050
|
-
t.splitterElement.setPointerCapture(l.pointerId);
|
|
2051
|
-
} catch {
|
|
2052
|
-
}
|
|
2053
|
-
const d = t.corpoElement.getBoundingClientRect(), u = (p) => {
|
|
2054
|
-
if (!a) return;
|
|
2055
|
-
const s = d.width;
|
|
2056
|
-
if (s <= 0) return;
|
|
2057
|
-
const h = p.clientX - d.left;
|
|
2058
|
-
let b = Math.max(80, Math.min(s - 130, h)) / s * 100;
|
|
2059
|
-
b = Math.max(20, Math.min(65, b)), e(b);
|
|
2060
|
-
}, c = (p) => {
|
|
2061
|
-
if (a) {
|
|
2062
|
-
a = !1, t.splitterElement.classList.remove("ui-prop__splitter--ativo");
|
|
2063
|
-
try {
|
|
2064
|
-
t.splitterElement.hasPointerCapture(p.pointerId) && t.splitterElement.releasePointerCapture(p.pointerId);
|
|
2065
|
-
} catch {
|
|
2066
|
-
}
|
|
2067
|
-
t.splitterElement.removeEventListener("pointermove", u), t.splitterElement.removeEventListener("pointerup", c), t.splitterElement.removeEventListener("pointercancel", c), i(r);
|
|
2068
|
-
}
|
|
2069
|
-
};
|
|
2070
|
-
t.splitterElement.addEventListener("pointermove", u), t.splitterElement.addEventListener("pointerup", c), t.splitterElement.addEventListener("pointercancel", c);
|
|
2071
|
-
};
|
|
2072
|
-
t.splitterListeners.add(t.splitterElement, "pointerdown", n), t.splitterListeners.add(t.splitterElement, "dblclick", () => {
|
|
2073
|
-
const l = e(45);
|
|
2074
|
-
i(l);
|
|
2075
|
-
}), t.splitterListeners.add(t.splitterElement, "keydown", (l) => {
|
|
2076
|
-
const d = l.shiftKey ? 5 : 2;
|
|
2077
|
-
let u = null;
|
|
2078
|
-
if (l.key === "ArrowLeft" ? u = r - d : l.key === "ArrowRight" ? u = r + d : l.key === "Home" ? u = 20 : l.key === "End" ? u = 65 : l.key === "Enter" && (u = 45), u !== null) {
|
|
2079
|
-
l.preventDefault(), l.stopPropagation();
|
|
2080
|
-
const c = e(u);
|
|
2081
|
-
i(c);
|
|
2082
|
-
}
|
|
2083
|
-
});
|
|
2084
|
-
}
|
|
2085
|
-
return {
|
|
2086
|
-
init: o,
|
|
2087
|
-
definirLarguraRotulo: e
|
|
2088
|
-
};
|
|
2089
|
-
}
|
|
2090
|
-
const It = `: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:var(--ui-cor-texto-sobre-primaria, #000000);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:var(--ui-cor-texto, #ffffff)}.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-limpar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;font-size:11px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:2px}.ui-prop__filtro-limpar:hover{color:var(--ui-cor-texto, #ffffff);background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.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:focus-visible{outline:1.5px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1.5px}.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:var(--ui-cor-texto-sobre-primaria, #000000)!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:var(--ui-cor-texto-sobre-primaria, #000000)!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:focus-visible{outline:none}.ui-prop__splitter:focus-visible: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:var(--ui-cor-texto-sobre-primaria, #000000)}.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:var(--ui-cor-texto-sobre-primaria, #000000);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))}.ui-prop__linha--modificada .ui-prop__col-rotulo{box-shadow:inset 2px 0 0 var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-reverter{display:none;margin-left:auto;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:var(--ui-raio-sm, 3px);background:transparent;color:var(--ui-cor-destaque, #00E08A);font-size:11px;line-height:1;cursor:pointer}.ui-prop__linha--modificada .ui-prop__btn-reverter{display:inline-flex}.ui-prop__btn-reverter:hover{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__btn-reverter:focus-visible{outline:1px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1px}.ui-prop__previa-calculo{position:absolute;left:6px;top:50%;transform:translateY(-50%);pointer-events:none;font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #9696a6);white-space:nowrap}.ui-prop__previa-calculo[hidden]{display:none}.ui-prop__editor-input--invalido{animation:ui-prop-invalido .6s ease}.ui-prop__col-valor:has(.ui-prop__editor-input--invalido){box-shadow:inset 0 0 0 1px var(--ui-cor-texto-erro, #ff5555)}@keyframes ui-prop-invalido{0%,60%{color:var(--ui-cor-texto-erro, #ff5555)}to{color:inherit}}@media (prefers-reduced-motion: reduce){.ui-prop__editor-input--invalido{animation-duration:.01ms}}`;
|
|
2091
|
-
function Pt() {
|
|
2092
|
-
return `
|
|
2093
|
-
<style>${It}</style>
|
|
2094
|
-
<div class="ui-prop__container" id="container" part="base">
|
|
2095
|
-
<!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
|
|
2096
|
-
<div class="ui-prop__faixa-estreita" id="faixa-estreita" part="faixa-estreita" title="Clique para expandir painel">
|
|
2097
|
-
<span class="ui-prop__faixa-icone" aria-hidden="true">
|
|
2098
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
2099
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
2100
|
-
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
2101
|
-
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
2102
|
-
</svg>
|
|
2103
|
-
</span>
|
|
2104
|
-
<button type="button" class="ui-prop__faixa-btn-expandir" id="btn-expandir-faixa" title="Expandir painel de propriedades" aria-label="Expandir painel de propriedades">
|
|
2105
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
2106
|
-
<polyline points="9 18 15 12 9 6"></polyline>
|
|
2107
|
-
<line x1="5" y1="5" x2="5" y2="19"></line>
|
|
2108
|
-
</svg>
|
|
2109
|
-
</button>
|
|
2110
|
-
<span class="ui-prop__faixa-texto">PROPRIEDADES</span>
|
|
2111
|
-
</div>
|
|
2112
|
-
|
|
2113
|
-
<!-- 1. Header Superior -->
|
|
2114
|
-
<header class="ui-prop__header" id="header" part="cabecalho">
|
|
2115
|
-
<div class="ui-prop__header-titulo">
|
|
2116
|
-
<span class="ui-prop__header-icone" aria-hidden="true">
|
|
2117
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
2118
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
2119
|
-
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
2120
|
-
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
2121
|
-
</svg>
|
|
2122
|
-
</span>
|
|
2123
|
-
<span id="header-titulo-texto" part="titulo">Propriedades</span>
|
|
2124
|
-
</div>
|
|
2125
|
-
<div class="ui-prop__header-acoes" part="acoes-cabecalho">
|
|
2126
|
-
<button type="button" class="ui-prop__btn-icone" id="btn-flutuante" title="Desacoplar / Modo flutuante (CAD)" aria-label="Modo flutuante">
|
|
2127
|
-
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
2128
|
-
<rect x="3" y="3" width="14" height="14" rx="2"></rect>
|
|
2129
|
-
<polyline points="15 3 21 3 21 9"></polyline>
|
|
2130
|
-
<line x1="10" y1="14" x2="21" y2="3"></line>
|
|
2131
|
-
</svg>
|
|
2132
|
-
</button>
|
|
2133
|
-
<button type="button" class="ui-prop__btn-icone" id="btn-colapsar-horizontal" title="Recolher para coluna estreita" aria-label="Recolher para coluna estreita">
|
|
2134
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
2135
|
-
<polyline points="11 17 6 12 11 7"></polyline>
|
|
2136
|
-
<line x1="18" y1="5" x2="18" y2="19"></line>
|
|
2137
|
-
</svg>
|
|
2138
|
-
</button>
|
|
2139
|
-
<button type="button" class="ui-prop__btn-icone" id="btn-densidade" title="Alternar compressão vertical" aria-label="Alternar densidade vertical">
|
|
2140
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
2141
|
-
<polyline points="4 7 12 11 20 7"></polyline>
|
|
2142
|
-
<polyline points="4 17 12 13 20 17"></polyline>
|
|
2143
|
-
<line x1="4" y1="12" x2="20" y2="12"></line>
|
|
2144
|
-
</svg>
|
|
2145
|
-
</button>
|
|
2146
|
-
<button type="button" class="ui-prop__btn-icone" id="btn-expandir-tudo" title="Expandir/Recolher Tudo" aria-label="Expandir ou recolher tudo">
|
|
2147
|
-
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
2148
|
-
<polyline points="7 13 12 18 17 13"></polyline>
|
|
2149
|
-
<polyline points="7 6 12 11 17 6"></polyline>
|
|
2150
|
-
</svg>
|
|
2151
|
-
</button>
|
|
2152
|
-
<button type="button" class="ui-prop__btn-icone" id="btn-fechar" title="Fechar" aria-label="Fechar" style="display: none;">
|
|
2153
|
-
✕
|
|
2154
|
-
</button>
|
|
2155
|
-
</div>
|
|
2156
|
-
</header>
|
|
2157
|
-
|
|
2158
|
-
<!-- 2. Seletor de Tipo (AutoCAD / Revit) -->
|
|
2159
|
-
<div class="ui-prop__tipo-seletor-container" id="tipo-container" part="seletor-tipo" style="display: none;"></div>
|
|
2160
|
-
|
|
2161
|
-
<!-- 3. Busca Rápida de Propriedades -->
|
|
2162
|
-
<div class="ui-prop__filtro-container" id="filtro-container" part="filtro" style="display: none;">
|
|
2163
|
-
<svg class="ui-prop__filtro-icone" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
2164
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
2165
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
2166
|
-
</svg>
|
|
2167
|
-
<input type="text" class="ui-prop__filtro-input" id="filtro-input" part="filtro-input" placeholder="Filtrar propriedades..." aria-label="Filtrar propriedades" autocomplete="off" spellcheck="false" />
|
|
2168
|
-
<button type="button" class="ui-prop__filtro-limpar" id="btn-limpar-filtro" title="Limpar filtro (Esc)" aria-label="Limpar filtro" style="display: none;">✕</button>
|
|
2169
|
-
</div>
|
|
2170
|
-
|
|
2171
|
-
<!-- 4. Corpo Rolável com Grade de Categorias -->
|
|
2172
|
-
<div class="ui-prop__corpo-wrapper" id="corpo-wrapper">
|
|
2173
|
-
<div class="ui-prop__splitter" id="splitter" part="splitter" role="separator" tabindex="0" aria-orientation="vertical" aria-valuemin="20" aria-valuemax="65" aria-valuenow="45" aria-label="Redimensionar coluna de rótulos" title="Arraste para redimensionar colunas (duplo-clique reseta para 45%)"></div>
|
|
2174
|
-
<div class="ui-prop__corpo" id="corpo" part="corpo">
|
|
2175
|
-
<div class="ui-prop__lista-categorias" id="lista-categorias" part="lista-categorias"></div>
|
|
2176
|
-
</div>
|
|
2177
|
-
</div>
|
|
2178
|
-
|
|
2179
|
-
<!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
|
|
2180
|
-
<footer class="ui-prop__footer" id="footer" part="rodape" style="display: none;">
|
|
2181
|
-
<a class="ui-prop__link-ajuda" id="link-ajuda" part="ajuda" href="#" role="button">Ajuda de propriedades</a>
|
|
2182
|
-
<div class="ui-prop__footer-botoes">
|
|
2183
|
-
<button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" part="desfazer" disabled>Desfazer</button>
|
|
2184
|
-
<button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" part="aplicar" disabled>Aplicar</button>
|
|
2185
|
-
</div>
|
|
2186
|
-
</footer>
|
|
2187
|
-
|
|
2188
|
-
<!-- 6. Grip para redimensionar no modo flutuante -->
|
|
2189
|
-
<div class="ui-prop__resizer-canto" id="resizer-canto" title="Redimensionar"></div>
|
|
2190
|
-
</div>
|
|
2191
|
-
`;
|
|
2192
|
-
}
|
|
2193
|
-
function Ft(t) {
|
|
2194
|
-
const { listaContainer: r, categorias: e, termoBusca: i, onToggleCategoria: o, linhaCtx: a } = t;
|
|
2195
|
-
r.innerHTML = "";
|
|
2196
|
-
const n = (Array.isArray(e) ? e : []).filter(
|
|
2197
|
-
(c) => !!(c && typeof c == "object")
|
|
2198
|
-
);
|
|
2199
|
-
if (n.length === 0) {
|
|
2200
|
-
const c = document.createElement("div");
|
|
2201
|
-
c.className = "ui-prop__vazio", c.setAttribute("part", "vazio"), c.textContent = "Nenhuma propriedade disponível.", r.appendChild(c);
|
|
2202
|
-
return;
|
|
2203
|
-
}
|
|
2204
|
-
const l = document.createDocumentFragment(), d = (i || "").trim().toLowerCase();
|
|
2205
|
-
let u = 0;
|
|
2206
|
-
if (n.forEach((c) => {
|
|
2207
|
-
const p = String(c.titulo ?? c.id ?? "").toLowerCase(), s = !!d && p.includes(d), h = (Array.isArray(c.propriedades) ? c.propriedades : []).filter((_) => {
|
|
2208
|
-
if (!_ || typeof _ != "object" || _.id === void 0 || _.id === null) return !1;
|
|
2209
|
-
if (!d || s) return !0;
|
|
2210
|
-
const k = String(_.rotulo ?? "").toLowerCase(), A = String(_.id).toLowerCase(), L = String(a.valoresAtuais[_.id] ?? "").toLowerCase();
|
|
2211
|
-
return k.includes(d) || A.includes(d) || L.includes(d);
|
|
2212
|
-
});
|
|
2213
|
-
if (d && h.length === 0)
|
|
2214
|
-
return;
|
|
2215
|
-
u += h.length;
|
|
2216
|
-
const m = c.aberto !== void 0 ? c.aberto !== !1 : c.aberta !== !1, g = !!d || m, f = document.createElement("div");
|
|
2217
|
-
f.className = `ui-prop__categoria ${g ? "ui-prop__categoria--aberta" : ""}`, f.setAttribute("data-cat-id", String(c.id)), f.setAttribute("part", "categoria"), D(f, "categoria-aberta", g);
|
|
2218
|
-
const b = document.createElement("div");
|
|
2219
|
-
b.className = "ui-prop__categoria-header", b.setAttribute("part", "categoria-cabecalho"), b.setAttribute("role", "button"), b.tabIndex = 0, b.setAttribute("aria-expanded", String(g));
|
|
2220
|
-
const E = document.createElement("div");
|
|
2221
|
-
E.className = "ui-prop__categoria-titulo-bloco";
|
|
2222
|
-
const x = document.createElement("span");
|
|
2223
|
-
x.className = "ui-prop__categoria-seta", x.setAttribute("aria-hidden", "true"), x.textContent = "▶";
|
|
2224
|
-
const w = document.createElement("span");
|
|
2225
|
-
w.textContent = String(c.titulo ?? c.id), E.appendChild(x), E.appendChild(w);
|
|
2226
|
-
const C = document.createElement("span");
|
|
2227
|
-
C.className = "ui-prop__categoria-contador", C.textContent = String(h.length), b.appendChild(E), b.appendChild(C), b.addEventListener("click", () => o(String(c.id))), b.addEventListener("keydown", (_) => {
|
|
2228
|
-
if (_.key === "Enter" || _.key === " ")
|
|
2229
|
-
_.preventDefault(), o(String(c.id));
|
|
2230
|
-
else if (_.key === "ArrowRight")
|
|
2231
|
-
f.classList.contains("ui-prop__categoria--aberta") || (_.preventDefault(), o(String(c.id)));
|
|
2232
|
-
else if (_.key === "ArrowLeft")
|
|
2233
|
-
f.classList.contains("ui-prop__categoria--aberta") && (_.preventDefault(), o(String(c.id)));
|
|
2234
|
-
else if (_.key === "ArrowDown" || _.key === "ArrowUp") {
|
|
2235
|
-
const k = Array.from(r.querySelectorAll(".ui-prop__categoria-header")), A = k.indexOf(b);
|
|
2236
|
-
if (A !== -1) {
|
|
2237
|
-
const L = _.key === "ArrowDown" ? A + 1 : A - 1;
|
|
2238
|
-
L >= 0 && L < k.length && (_.preventDefault(), k[L].focus());
|
|
2239
|
-
}
|
|
2240
|
-
} else if (_.key === "Home") {
|
|
2241
|
-
const k = r.querySelector(".ui-prop__categoria-header");
|
|
2242
|
-
k && (_.preventDefault(), k.focus());
|
|
2243
|
-
} else if (_.key === "End") {
|
|
2244
|
-
const k = r.querySelectorAll(".ui-prop__categoria-header");
|
|
2245
|
-
k.length > 0 && (_.preventDefault(), k[k.length - 1].focus());
|
|
2246
|
-
}
|
|
2247
|
-
});
|
|
2248
|
-
const y = document.createElement("div");
|
|
2249
|
-
y.className = "ui-prop__categoria-conteudo", y.setAttribute("part", "categoria-conteudo"), h.forEach((_) => {
|
|
2250
|
-
const k = Vt(String(c.id), _, a);
|
|
2251
|
-
y.appendChild(k);
|
|
2252
|
-
}), f.appendChild(b), f.appendChild(y), l.appendChild(f);
|
|
2253
|
-
}), d && u === 0) {
|
|
2254
|
-
const c = document.createElement("div");
|
|
2255
|
-
c.className = "ui-prop__vazio", c.setAttribute("part", "vazio"), c.textContent = `Nenhuma propriedade encontrada para "${i}".`, r.appendChild(c);
|
|
2256
|
-
return;
|
|
2257
|
-
}
|
|
2258
|
-
r.appendChild(l);
|
|
2259
|
-
}
|
|
2260
|
-
function Vt(t, r, e) {
|
|
2261
|
-
const i = document.createElement("div");
|
|
2262
|
-
i.className = "ui-prop__linha", i.setAttribute("data-prop-id", String(r.id)), i.setAttribute("part", "linha");
|
|
2263
|
-
const o = e.valoresAtuais[r.id] !== void 0 ? e.valoresAtuais[r.id] : K(r), a = r.id in e.valoresOriginais ? e.valoresOriginais[r.id] : K(r), n = !O(o, a), l = S(o);
|
|
2264
|
-
n && (i.classList.add("ui-prop__linha--modificada"), D(i, "linha-modificada", !0)), l && (i.classList.add("ui-prop__linha--misto"), D(i, "linha-mista", !0)), i.addEventListener("dblclick", () => {
|
|
2265
|
-
const m = i.querySelector(
|
|
2266
|
-
'input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline'
|
|
2267
|
-
);
|
|
2268
|
-
m && (m.focus(), m instanceof HTMLInputElement && m.select());
|
|
2269
|
-
});
|
|
2270
|
-
const d = document.createElement("div");
|
|
2271
|
-
d.className = "ui-prop__col-rotulo", d.setAttribute("part", "rotulo");
|
|
2272
|
-
const u = String(r.rotulo ?? r.id);
|
|
2273
|
-
d.title = r.dica ? `${u} — ${r.dica}` : u;
|
|
2274
|
-
const c = document.createElement("span");
|
|
2275
|
-
if (c.textContent = u, d.appendChild(c), !r.somenteLeitura && r.tipo !== "readonly" && r.tipo !== "acao" && e.onRedefinir) {
|
|
2276
|
-
const m = e.onRedefinir, g = document.createElement("button");
|
|
2277
|
-
g.type = "button", g.className = "ui-prop__btn-reverter", g.title = "Restaurar valor original", g.setAttribute("aria-label", `Restaurar valor original de ${u}`), g.setAttribute("part", "restaurar"), g.textContent = "↺", g.addEventListener("click", (f) => {
|
|
2278
|
-
f.stopPropagation(), m(String(r.id));
|
|
2279
|
-
}), g.addEventListener("dblclick", (f) => f.stopPropagation()), d.appendChild(g);
|
|
2280
|
-
}
|
|
2281
|
-
r.tipo === "numero" && !r.somenteLeitura && Ht(d, t, r, e);
|
|
2282
|
-
const s = document.createElement("div");
|
|
2283
|
-
s.className = "ui-prop__col-valor", s.setAttribute("part", "valor");
|
|
2284
|
-
const h = Dt(t, r, o, e.editorCtx);
|
|
2285
|
-
if (s.appendChild(h), r.unidade) {
|
|
2286
|
-
const m = document.createElement("span");
|
|
2287
|
-
m.className = "ui-prop__unidade-sufixo", m.setAttribute("part", "unidade"), m.textContent = r.unidade, s.appendChild(m);
|
|
2288
|
-
}
|
|
2289
|
-
return i.appendChild(d), i.appendChild(s), i;
|
|
2290
|
-
}
|
|
2291
|
-
function Ht(t, r, e, i) {
|
|
2292
|
-
t.classList.add("ui-prop__col-rotulo--scrub");
|
|
2293
|
-
const o = String(e.rotulo ?? e.id), a = e.dica ? `${o} — ${e.dica}` : o;
|
|
2294
|
-
t.title = `${a} (Arraste para ajustar, duplo-clique para editar)`;
|
|
2295
|
-
let n = 0, l = 0, d = !1;
|
|
2296
|
-
t.addEventListener("pointerdown", (u) => {
|
|
2297
|
-
var h, m;
|
|
2298
|
-
if (u.button !== 0 || (m = (h = u.target) == null ? void 0 : h.closest) != null && m.call(h, ".ui-prop__btn-reverter") || S(i.editorCtx.obterValorAtual(e.id))) return;
|
|
2299
|
-
n = u.clientX;
|
|
2300
|
-
const c = i.editorCtx.obterValorAtual(e.id);
|
|
2301
|
-
l = typeof c == "number" ? c : parseFloat(String(c || 0)) || 0, d = !1;
|
|
2302
|
-
try {
|
|
2303
|
-
t.setPointerCapture(u.pointerId);
|
|
2304
|
-
} catch {
|
|
2305
|
-
}
|
|
2306
|
-
t.classList.add("ui-prop__col-rotulo--arrastando");
|
|
2307
|
-
const p = (g) => {
|
|
2308
|
-
const f = g.clientX - n;
|
|
2309
|
-
if (Math.abs(f) > 2 && (d = !0), d) {
|
|
2310
|
-
let b = 1;
|
|
2311
|
-
g.shiftKey ? b = 0.1 : (g.ctrlKey || g.metaKey) && (b = 10);
|
|
2312
|
-
const E = $(e), x = typeof e.passo == "number" && e.passo > 0 ? e.passo * 0.01 : typeof e.step == "number" && e.step > 0 ? e.step * 0.01 : Math.pow(10, -Math.min(E !== void 0 ? E : 2, 2));
|
|
2313
|
-
let w = l + f * x * b;
|
|
2314
|
-
w = te(w, e), E !== void 0 ? w = Number(w.toFixed(E)) : w = Math.round(w * 100) / 100, i.editorCtx.registrarAlteracao(r, e.id, w), i.onAtualizarCampoVisual(e.id, w);
|
|
2315
|
-
}
|
|
2316
|
-
}, s = (g) => {
|
|
2317
|
-
t.classList.remove("ui-prop__col-rotulo--arrastando");
|
|
2318
|
-
try {
|
|
2319
|
-
t.hasPointerCapture(g.pointerId) && t.releasePointerCapture(g.pointerId);
|
|
2320
|
-
} catch {
|
|
2321
|
-
}
|
|
2322
|
-
t.removeEventListener("pointermove", p), t.removeEventListener("pointerup", s), t.removeEventListener("pointercancel", s);
|
|
2323
|
-
};
|
|
2324
|
-
t.addEventListener("pointermove", p), t.addEventListener("pointerup", s), t.addEventListener("pointercancel", s);
|
|
2325
|
-
});
|
|
2326
|
-
}
|
|
2327
|
-
const me = 300, qt = 480, P = /* @__PURE__ */ new WeakMap();
|
|
2328
|
-
function $t(t) {
|
|
2329
|
-
var i, o, a;
|
|
2330
|
-
const r = t.hasAttribute("flutuante"), e = t.style;
|
|
2331
|
-
if (r) {
|
|
2332
|
-
const n = P.get(t) ?? { acoplado: { width: "", height: "" } };
|
|
2333
|
-
n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height }, P.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;
|
|
2334
|
-
} else {
|
|
2335
|
-
const n = {
|
|
2336
|
-
acoplado: { width: e.width, height: e.height },
|
|
2337
|
-
flutuante: (i = P.get(t)) == null ? void 0 : i.flutuante
|
|
2338
|
-
};
|
|
2339
|
-
if (P.set(t, n), t.setAttribute("flutuante", ""), e.position = "fixed", (o = n.flutuante) != null && o.left || (a = n.flutuante) != null && a.top)
|
|
2340
|
-
e.left = n.flutuante.left, e.top = n.flutuante.top, e.width = n.flutuante.width, e.height = n.flutuante.height;
|
|
2341
|
-
else if (!e.left && !e.top) {
|
|
2342
|
-
const l = Math.max(
|
|
2343
|
-
20,
|
|
2344
|
-
(typeof window < "u" ? window.innerWidth : 1024) - me - 30
|
|
2345
|
-
);
|
|
2346
|
-
e.left = `${l}px`, e.top = "70px", e.width = `${me}px`, e.height = `${qt}px`;
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
return !r;
|
|
2350
|
-
}
|
|
2351
|
-
function jt(t, r, e) {
|
|
2352
|
-
const i = r.getElementById("header");
|
|
2353
|
-
if (i) {
|
|
2354
|
-
let a = null, n = 0, l = 0, d = 0, u = 0;
|
|
2355
|
-
const c = (s) => {
|
|
2356
|
-
if (a === null) return;
|
|
2357
|
-
const h = s.clientX - n, m = s.clientY - l;
|
|
2358
|
-
let g = d + h, f = u + m;
|
|
2359
|
-
const b = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) - t.offsetWidth), E = Math.max(0, (typeof window < "u" ? window.innerHeight : 768) - 30);
|
|
2360
|
-
g = Math.max(0, Math.min(b, g)), f = Math.max(0, Math.min(E, f)), t.style.left = `${g}px`, t.style.top = `${f}px`, t.style.right = "auto", t.style.bottom = "auto";
|
|
2361
|
-
}, p = (s) => {
|
|
2362
|
-
if (a !== null) {
|
|
2363
|
-
try {
|
|
2364
|
-
i.releasePointerCapture(s.pointerId);
|
|
2365
|
-
} catch {
|
|
2366
|
-
}
|
|
2367
|
-
i.removeEventListener("pointermove", c), i.removeEventListener("pointerup", p), i.removeEventListener("pointercancel", p), a = null, t.classList.remove("arrastando"), t.dispatchEvent(new CustomEvent("ui-mover", {
|
|
2368
|
-
bubbles: !0,
|
|
2369
|
-
composed: !0,
|
|
2370
|
-
detail: { left: t.style.left, top: t.style.top }
|
|
2371
|
-
}));
|
|
2372
|
-
}
|
|
2373
|
-
};
|
|
2374
|
-
e.add(i, "pointerdown", (s) => {
|
|
2375
|
-
if (!t.hasAttribute("flutuante") || s.target.closest("button, input, select, a") || s.button !== 0) return;
|
|
2376
|
-
s.preventDefault(), a = s.pointerId, n = s.clientX, l = s.clientY;
|
|
2377
|
-
const m = t.getBoundingClientRect();
|
|
2378
|
-
d = m.left, u = m.top, t.classList.add("arrastando");
|
|
2379
|
-
try {
|
|
2380
|
-
i.setPointerCapture(s.pointerId);
|
|
2381
|
-
} catch {
|
|
2382
|
-
}
|
|
2383
|
-
i.addEventListener("pointermove", c), i.addEventListener("pointerup", p), i.addEventListener("pointercancel", p);
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
|
-
const o = r.getElementById("resizer-canto");
|
|
2387
|
-
if (o) {
|
|
2388
|
-
let a = null, n = 0, l = 0, d = 0, u = 0;
|
|
2389
|
-
const c = (s) => {
|
|
2390
|
-
if (a === null) return;
|
|
2391
|
-
const h = Math.max(200, n + (s.clientX - d)), m = Math.max(180, l + (s.clientY - u));
|
|
2392
|
-
t.style.width = `${h}px`, t.style.height = `${m}px`;
|
|
2393
|
-
}, p = (s) => {
|
|
2394
|
-
if (a !== null) {
|
|
2395
|
-
try {
|
|
2396
|
-
o.releasePointerCapture(s.pointerId);
|
|
2397
|
-
} catch {
|
|
2398
|
-
}
|
|
2399
|
-
o.removeEventListener("pointermove", c), o.removeEventListener("pointerup", p), o.removeEventListener("pointercancel", p), a = null, t.dispatchEvent(new CustomEvent("ui-redimensionar", {
|
|
2400
|
-
bubbles: !0,
|
|
2401
|
-
composed: !0,
|
|
2402
|
-
detail: { width: t.style.width, height: t.style.height }
|
|
2403
|
-
}));
|
|
2404
|
-
}
|
|
2405
|
-
};
|
|
2406
|
-
e.add(o, "pointerdown", (s) => {
|
|
2407
|
-
if (!t.hasAttribute("flutuante") || s.button !== 0) return;
|
|
2408
|
-
s.preventDefault(), s.stopPropagation(), a = s.pointerId, d = s.clientX, u = s.clientY;
|
|
2409
|
-
const h = t.getBoundingClientRect();
|
|
2410
|
-
n = h.width, l = h.height;
|
|
2411
|
-
try {
|
|
2412
|
-
o.setPointerCapture(s.pointerId);
|
|
2413
|
-
} catch {
|
|
2414
|
-
}
|
|
2415
|
-
o.addEventListener("pointermove", c), o.addEventListener("pointerup", p), o.addEventListener("pointercancel", p);
|
|
2416
|
-
});
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
function Ut(t) {
|
|
2420
|
-
return t === "compacta" ? "ultracompacta" : t === "ultracompacta" ? "padrao" : "compacta";
|
|
2421
|
-
}
|
|
2422
|
-
class Wt {
|
|
2423
|
-
constructor(r) {
|
|
2424
|
-
v(this, "valoresOriginais", {});
|
|
2425
|
-
v(this, "valoresAtuais", {});
|
|
2426
|
-
this.ctx = r;
|
|
2427
|
-
}
|
|
2428
|
-
inicializarCategorias(r) {
|
|
2429
|
-
this.valoresOriginais = {}, this.valoresAtuais = {};
|
|
2430
|
-
const e = /* @__PURE__ */ new Set();
|
|
2431
|
-
(Array.isArray(r) ? r : []).forEach((i) => {
|
|
2432
|
-
!i || typeof i != "object" || (Array.isArray(i.propriedades) ? i.propriedades : []).forEach((o) => {
|
|
2433
|
-
if (!o || typeof o != "object" || o.id === void 0 || o.id === null) return;
|
|
2434
|
-
const a = String(o.id);
|
|
2435
|
-
e.has(a) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${a}". Os valores são indexados por id e serão compartilhados.`), e.add(a);
|
|
2436
|
-
const n = K(o);
|
|
2437
|
-
this.valoresOriginais[a] = n, this.valoresAtuais[a] = n;
|
|
2438
|
-
});
|
|
2439
|
-
}), this.ctx.onAtualizarBotoesFooter(!1);
|
|
2440
|
-
}
|
|
2441
|
-
/** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
|
|
2442
|
-
get isDirty() {
|
|
2443
|
-
return Object.keys(this.valoresAtuais).some((r) => this.isModificada(r));
|
|
2444
|
-
}
|
|
2445
|
-
isModificada(r) {
|
|
2446
|
-
return !O(this.valoresAtuais[r], this.valoresOriginais[r]);
|
|
2447
|
-
}
|
|
2448
|
-
getValores() {
|
|
2449
|
-
return { ...this.valoresAtuais };
|
|
2450
|
-
}
|
|
2451
|
-
getValoresOriginais() {
|
|
2452
|
-
return { ...this.valoresOriginais };
|
|
2453
|
-
}
|
|
2454
|
-
setValores(r) {
|
|
2455
|
-
!r || typeof r != "object" || (Object.keys(r).forEach((e) => {
|
|
2456
|
-
this.valoresAtuais[e] = r[e], this.valoresOriginais[e] = r[e];
|
|
2457
|
-
}), this.ctx.onAtualizarBotoesFooter(this.isDirty));
|
|
2458
|
-
}
|
|
2459
|
-
obterValor(r) {
|
|
2460
|
-
return this.valoresAtuais[r];
|
|
2461
|
-
}
|
|
2462
|
-
obterValorOriginal(r) {
|
|
2463
|
-
return this.valoresOriginais[r];
|
|
2464
|
-
}
|
|
2465
|
-
/** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
|
|
2466
|
-
definirValor(r, e, i = !0) {
|
|
2467
|
-
const o = this.valoresAtuais[r];
|
|
2468
|
-
O(o, e) || (this.valoresAtuais[r] = e, this.aposAlterar(r), this.ctx.onAtualizarCampoVisual(r, e), i && this.emitirAlteracao(r, e, o, this.categoriaDe(r)));
|
|
2469
|
-
}
|
|
2470
|
-
/**
|
|
2471
|
-
* Restaura uma propriedade individual ao seu valor original (antes da edição).
|
|
2472
|
-
* Devolve `false` se não havia o que restaurar.
|
|
2473
|
-
*/
|
|
2474
|
-
redefinirValor(r, e = !0) {
|
|
2475
|
-
if (!(r in this.valoresOriginais) || !this.isModificada(r)) return !1;
|
|
2476
|
-
const i = this.valoresOriginais[r];
|
|
2477
|
-
return this.definirValor(r, i, e && !this.ctx.isModoManual()), !0;
|
|
2478
|
-
}
|
|
2479
|
-
/** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
|
|
2480
|
-
registrarAlteracao(r, e, i) {
|
|
2481
|
-
const o = this.valoresAtuais[e];
|
|
2482
|
-
O(o, i) || (this.valoresAtuais[e] = i, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, i, o, r));
|
|
2483
|
-
}
|
|
2484
|
-
aplicar() {
|
|
2485
|
-
var i;
|
|
2486
|
-
if (!this.isDirty) return;
|
|
2487
|
-
const r = {};
|
|
2488
|
-
Object.keys(this.valoresAtuais).forEach((o) => {
|
|
2489
|
-
this.isModificada(o) && (r[o] = this.valoresAtuais[o]);
|
|
2490
|
-
}), this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
|
|
2491
|
-
const e = (i = this.ctx.hostElement.shadowRoot) == null ? void 0 : i.querySelectorAll(".ui-prop__linha--modificada");
|
|
2492
|
-
e == null || e.forEach((o) => {
|
|
2493
|
-
o.classList.remove("ui-prop__linha--modificada"), D(o, "linha-modificada", !1);
|
|
2494
|
-
}), this.ctx.hostElement.dispatchEvent(
|
|
2495
|
-
new CustomEvent("ui-aplicar", {
|
|
2496
|
-
bubbles: !0,
|
|
2497
|
-
composed: !0,
|
|
2498
|
-
detail: { valores: { ...this.valoresAtuais }, alterados: r }
|
|
2499
|
-
})
|
|
2500
|
-
);
|
|
2501
|
-
}
|
|
2502
|
-
desfazer() {
|
|
2503
|
-
this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
2504
|
-
new CustomEvent("ui-desfazer", {
|
|
2505
|
-
bubbles: !0,
|
|
2506
|
-
composed: !0,
|
|
2507
|
-
detail: { valores: { ...this.valoresAtuais } }
|
|
2508
|
-
})
|
|
2509
|
-
));
|
|
2510
|
-
}
|
|
2511
|
-
/** Marca/desmarca a linha (modificada e mista) e recalcula os botões do rodapé (voltar ao original limpa o estado). */
|
|
2512
|
-
aposAlterar(r) {
|
|
2513
|
-
const e = xe(this.ctx.hostElement.shadowRoot, r);
|
|
2514
|
-
if (e) {
|
|
2515
|
-
const i = this.isModificada(r), o = S(this.valoresAtuais[r]);
|
|
2516
|
-
e.classList.toggle("ui-prop__linha--modificada", i), e.classList.toggle("ui-prop__linha--misto", o), D(e, "linha-modificada", i), D(e, "linha-mista", o);
|
|
2517
|
-
}
|
|
2518
|
-
this.ctx.onAtualizarBotoesFooter(this.isDirty);
|
|
2519
|
-
}
|
|
2520
|
-
categoriaDe(r) {
|
|
2521
|
-
for (const e of this.ctx.getCategorias())
|
|
2522
|
-
if (e && Array.isArray(e.propriedades) && e.propriedades.some((i) => i && String(i.id) === String(r)))
|
|
2523
|
-
return e.id;
|
|
2524
|
-
return "";
|
|
2525
|
-
}
|
|
2526
|
-
emitirAlteracao(r, e, i, o = "") {
|
|
2527
|
-
this.ctx.hostElement.dispatchEvent(
|
|
2528
|
-
new CustomEvent("ui-propriedade-alterada", {
|
|
2529
|
-
bubbles: !0,
|
|
2530
|
-
composed: !0,
|
|
2531
|
-
detail: {
|
|
2532
|
-
id: r,
|
|
2533
|
-
categoriaId: o,
|
|
2534
|
-
valor: e,
|
|
2535
|
-
valorAnterior: i,
|
|
2536
|
-
todosValores: { ...this.valoresAtuais }
|
|
2537
|
-
}
|
|
2538
|
-
})
|
|
2539
|
-
);
|
|
2540
|
-
}
|
|
2541
|
-
}
|
|
2542
|
-
function Xt(t) {
|
|
2543
|
-
const {
|
|
2544
|
-
shadow: r,
|
|
2545
|
-
listeners: e,
|
|
2546
|
-
host: i,
|
|
2547
|
-
onToggleExpandirTodas: o,
|
|
2548
|
-
onFiltrar: a,
|
|
2549
|
-
onAplicar: n,
|
|
2550
|
-
onDesfazer: l,
|
|
2551
|
-
onAlternarDensidade: d,
|
|
2552
|
-
onAlternarFlutuante: u,
|
|
2553
|
-
onAlternarColapsoHorizontal: c,
|
|
2554
|
-
onFocarPrimeiroEditor: p
|
|
2555
|
-
} = t, s = r.getElementById("btn-flutuante");
|
|
2556
|
-
s && u && e.add(s, "click", u);
|
|
2557
|
-
const h = r.getElementById("btn-colapsar-horizontal");
|
|
2558
|
-
h && c && e.add(h, "click", c);
|
|
2559
|
-
const m = r.getElementById("faixa-estreita");
|
|
2560
|
-
m && c && e.add(m, "click", c);
|
|
2561
|
-
const g = r.getElementById("btn-expandir-faixa");
|
|
2562
|
-
g && c && e.add(g, "click", (A) => {
|
|
2563
|
-
A.stopPropagation(), c();
|
|
2564
|
-
});
|
|
2565
|
-
const f = r.getElementById("btn-densidade");
|
|
2566
|
-
f && d && e.add(f, "click", d);
|
|
2567
|
-
const b = r.getElementById("btn-expandir-tudo");
|
|
2568
|
-
b && e.add(b, "click", o);
|
|
2569
|
-
const E = r.getElementById("btn-fechar");
|
|
2570
|
-
E && e.add(E, "click", () => {
|
|
2571
|
-
i.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
2572
|
-
});
|
|
2573
|
-
const x = r.getElementById("filtro-input"), w = r.getElementById("btn-limpar-filtro"), C = () => {
|
|
2574
|
-
w && x && (w.style.display = x.value ? "inline-flex" : "none");
|
|
2575
|
-
};
|
|
2576
|
-
x && (e.add(x, "input", () => {
|
|
2577
|
-
C();
|
|
2578
|
-
const A = (x.value || "").trim().toLowerCase();
|
|
2579
|
-
a(A);
|
|
2580
|
-
}), e.add(x, "keydown", (A) => {
|
|
2581
|
-
A.key === "Escape" ? x.value ? (A.preventDefault(), A.stopPropagation(), x.value = "", C(), a("")) : x.blur() : (A.key === "Enter" || A.key === "ArrowDown") && p && (A.preventDefault(), p());
|
|
2582
|
-
})), w && x && e.add(w, "click", () => {
|
|
2583
|
-
x.value = "", C(), a(""), x.focus();
|
|
2584
|
-
});
|
|
2585
|
-
const y = r.getElementById("btn-aplicar");
|
|
2586
|
-
y && e.add(y, "click", n);
|
|
2587
|
-
const _ = r.getElementById("btn-desfazer");
|
|
2588
|
-
_ && e.add(_, "click", l);
|
|
2589
|
-
const k = r.getElementById("link-ajuda");
|
|
2590
|
-
k && e.add(k, "click", (A) => {
|
|
2591
|
-
A.preventDefault(), i.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
|
|
2592
|
-
}), e.add(r, "keydown", (A) => {
|
|
2593
|
-
const L = A;
|
|
2594
|
-
(L.ctrlKey || L.metaKey) && L.key === "Enter" && i.getAttribute("modo-aplicar") === "manual" && (L.preventDefault(), n());
|
|
2595
|
-
});
|
|
2596
|
-
}
|
|
2597
|
-
function B(t, r) {
|
|
2598
|
-
const e = t.getElementById("header-titulo-texto");
|
|
2599
|
-
e && (e.textContent = r.getAttribute("titulo") || "Propriedades");
|
|
2600
|
-
const i = t.getElementById("btn-fechar");
|
|
2601
|
-
i && (i.style.display = r.hasAttribute("fechavel") ? "inline-flex" : "none");
|
|
2602
|
-
const o = t.getElementById("btn-flutuante");
|
|
2603
|
-
if (o) {
|
|
2604
|
-
const p = r.hasAttribute("flutuante");
|
|
2605
|
-
o.title = p ? "Acoplar painel (Dock)" : "Desacoplar / Modo flutuante (CAD)", o.setAttribute("aria-pressed", String(p)), o.classList.toggle("ui-prop__btn-icone--ativo", p);
|
|
2606
|
-
}
|
|
2607
|
-
const a = t.getElementById("btn-colapsar-horizontal");
|
|
2608
|
-
if (a) {
|
|
2609
|
-
const p = r.hasAttribute("colapsado");
|
|
2610
|
-
a.title = p ? "Expandir painel" : "Recolher para coluna estreita", a.setAttribute("aria-pressed", String(p)), a.classList.toggle("ui-prop__btn-icone--ativo", p);
|
|
2611
|
-
}
|
|
2612
|
-
const n = t.getElementById("btn-densidade");
|
|
2613
|
-
if (n) {
|
|
2614
|
-
const p = r.getAttribute("densidade") || "padrão";
|
|
2615
|
-
n.title = `Compressão vertical: ${p} (clique para alternar)`;
|
|
2616
|
-
}
|
|
2617
|
-
const l = t.getElementById("filtro-container");
|
|
2618
|
-
l && (l.style.display = r.hasAttribute("filtro") ? "flex" : "none");
|
|
2619
|
-
const d = t.getElementById("filtro-input"), u = t.getElementById("btn-limpar-filtro");
|
|
2620
|
-
u && d && (u.style.display = d.value ? "inline-flex" : "none");
|
|
2621
|
-
const c = t.getElementById("footer");
|
|
2622
|
-
c && (c.style.display = r.getAttribute("modo-aplicar") === "manual" ? "flex" : "none");
|
|
2623
|
-
}
|
|
2624
|
-
class oe extends fe {
|
|
2625
|
-
constructor() {
|
|
2626
|
-
super();
|
|
2627
|
-
v(this, "shadow");
|
|
2628
|
-
v(this, "listeners", new F());
|
|
2629
|
-
v(this, "splitterListeners", new F());
|
|
2630
|
-
v(this, "controladorSplitter");
|
|
2631
|
-
v(this, "gerenciadorValores");
|
|
2632
|
-
v(this, "_categorias", []);
|
|
2633
|
-
v(this, "_tipos", []);
|
|
2634
|
-
v(this, "_tipoSelecionadoId", "");
|
|
2635
|
-
v(this, "_termoBusca", "");
|
|
2636
|
-
v(this, "_larguraRotuloPorcentagem", 45);
|
|
2637
|
-
v(this, "_sincronizandoFlutuante", !1);
|
|
2638
|
-
v(this, "tipoContainerElement");
|
|
2639
|
-
v(this, "corpoElement");
|
|
2640
|
-
v(this, "btnAplicarElement");
|
|
2641
|
-
v(this, "btnDesfazerElement");
|
|
2642
|
-
v(this, "splitterElement");
|
|
2643
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = Pt(), 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 Wt({
|
|
2644
|
-
hostElement: this,
|
|
2645
|
-
getCategorias: () => this._categorias,
|
|
2646
|
-
onAtualizarBotoesFooter: (e) => {
|
|
2647
|
-
this.btnAplicarElement.disabled = !e, this.btnDesfazerElement.disabled = !e;
|
|
2648
|
-
},
|
|
2649
|
-
onAtualizarCampoVisual: (e, i) => he(this.shadow, e, i),
|
|
2650
|
-
onRenderCategorias: () => this.renderCategorias(),
|
|
2651
|
-
isModoManual: () => this.getAttribute("modo-aplicar") === "manual"
|
|
2652
|
-
}), this.controladorSplitter = Ot({
|
|
2653
|
-
hostElement: this,
|
|
2654
|
-
corpoElement: this.corpoElement,
|
|
2655
|
-
splitterElement: this.splitterElement,
|
|
2656
|
-
splitterListeners: this.splitterListeners,
|
|
2657
|
-
onLarguraAlterada: (e) => {
|
|
2658
|
-
this._larguraRotuloPorcentagem = e;
|
|
2659
|
-
}
|
|
2660
|
-
});
|
|
2661
|
-
}
|
|
2662
|
-
static get observedAttributes() {
|
|
2663
|
-
return [
|
|
2664
|
-
"titulo",
|
|
2665
|
-
"estilo-visual",
|
|
2666
|
-
"modo-aplicar",
|
|
2667
|
-
"filtro",
|
|
2668
|
-
"densidade",
|
|
2669
|
-
"largura-rotulo",
|
|
2670
|
-
"fechavel",
|
|
2671
|
-
"colapsado",
|
|
2672
|
-
"flutuante",
|
|
2673
|
-
"texto-misto"
|
|
2674
|
-
];
|
|
2675
|
-
}
|
|
2676
|
-
get larguraRotuloPorcentagem() {
|
|
2677
|
-
return this._larguraRotuloPorcentagem;
|
|
2678
|
-
}
|
|
2679
|
-
connectedCallback() {
|
|
2680
|
-
this.listeners.cleanup(), Xt({
|
|
2681
|
-
shadow: this.shadow,
|
|
2682
|
-
listeners: this.listeners,
|
|
2683
|
-
host: this,
|
|
2684
|
-
onToggleExpandirTodas: () => this.toggleExpandirTodas(),
|
|
2685
|
-
onFiltrar: (e) => {
|
|
2686
|
-
this._termoBusca = e, this.renderCategorias();
|
|
2687
|
-
},
|
|
2688
|
-
onAplicar: () => this.aplicar(),
|
|
2689
|
-
onDesfazer: () => this.desfazer(),
|
|
2690
|
-
onAlternarDensidade: () => this.alternarDensidade(),
|
|
2691
|
-
onAlternarFlutuante: () => this.alternarFlutuante(),
|
|
2692
|
-
onAlternarColapsoHorizontal: () => this.alternarColapsoHorizontal(),
|
|
2693
|
-
onFocarPrimeiroEditor: () => gt(this.shadow)
|
|
2694
|
-
}), jt(this, this.shadow, this.listeners), this.controladorSplitter.init(), this.syncState();
|
|
2695
|
-
}
|
|
2696
|
-
disconnectedCallback() {
|
|
2697
|
-
this.listeners.cleanup(), this.splitterListeners.cleanup();
|
|
2698
|
-
}
|
|
2699
|
-
/**
|
|
2700
|
-
* Cada atributo atualiza só o que depende dele: redesenhar todas as linhas (ex.: ao trocar o
|
|
2701
|
-
* `titulo`) tiraria o foco de um campo em edição.
|
|
2702
|
-
*/
|
|
2703
|
-
attributeChangedCallback(e, i, o) {
|
|
2704
|
-
if (i !== o)
|
|
2705
|
-
switch (e) {
|
|
2706
|
-
case "largura-rotulo": {
|
|
2707
|
-
const a = parseFloat(o ?? "");
|
|
2708
|
-
isNaN(a) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(a));
|
|
2709
|
-
return;
|
|
2710
|
-
}
|
|
2711
|
-
case "estilo-visual":
|
|
2712
|
-
this.renderSeletorTipos();
|
|
2713
|
-
return;
|
|
2714
|
-
case "texto-misto":
|
|
2715
|
-
this.renderCategorias();
|
|
2716
|
-
return;
|
|
2717
|
-
case "filtro":
|
|
2718
|
-
if (B(this.shadow, this), o === null && this._termoBusca) {
|
|
2719
|
-
this._termoBusca = "";
|
|
2720
|
-
const a = this.shadow.getElementById("filtro-input");
|
|
2721
|
-
a && (a.value = ""), this.renderCategorias();
|
|
2722
|
-
}
|
|
2723
|
-
return;
|
|
2724
|
-
case "flutuante":
|
|
2725
|
-
this._sincronizandoFlutuante || B(this.shadow, this);
|
|
2726
|
-
return;
|
|
2727
|
-
default:
|
|
2728
|
-
B(this.shadow, this);
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
// --- Propriedades Públicas Espelhadas (Getters e Setters Tipados) ---
|
|
2732
|
-
get titulo() {
|
|
2733
|
-
return this.getAttribute("titulo") || "Propriedades";
|
|
2734
|
-
}
|
|
2735
|
-
set titulo(e) {
|
|
2736
|
-
e ? this.setAttribute("titulo", e) : this.removeAttribute("titulo");
|
|
2737
|
-
}
|
|
2738
|
-
get estiloVisual() {
|
|
2739
|
-
return this.getAttribute("estilo-visual") || "autocad";
|
|
2740
|
-
}
|
|
2741
|
-
set estiloVisual(e) {
|
|
2742
|
-
e && e !== "autocad" ? this.setAttribute("estilo-visual", e) : this.removeAttribute("estilo-visual");
|
|
2743
|
-
}
|
|
2744
|
-
get modoAplicar() {
|
|
2745
|
-
return this.getAttribute("modo-aplicar") || "imediato";
|
|
2746
|
-
}
|
|
2747
|
-
set modoAplicar(e) {
|
|
2748
|
-
e === "manual" ? this.setAttribute("modo-aplicar", "manual") : this.removeAttribute("modo-aplicar");
|
|
2749
|
-
}
|
|
2750
|
-
get filtro() {
|
|
2751
|
-
return this.hasAttribute("filtro");
|
|
2752
|
-
}
|
|
2753
|
-
set filtro(e) {
|
|
2754
|
-
e ? this.setAttribute("filtro", "") : this.removeAttribute("filtro");
|
|
2755
|
-
}
|
|
2756
|
-
get termoBusca() {
|
|
2757
|
-
return this._termoBusca;
|
|
2758
|
-
}
|
|
2759
|
-
set termoBusca(e) {
|
|
2760
|
-
this._termoBusca = (e || "").trim().toLowerCase();
|
|
2761
|
-
const i = this.shadow.getElementById("filtro-input");
|
|
2762
|
-
i && (i.value = e || ""), this.renderCategorias();
|
|
2763
|
-
}
|
|
2764
|
-
get larguraRotulo() {
|
|
2765
|
-
return this._larguraRotuloPorcentagem;
|
|
2766
|
-
}
|
|
2767
|
-
set larguraRotulo(e) {
|
|
2768
|
-
const i = typeof e == "number" ? e : parseFloat(String(e));
|
|
2769
|
-
isNaN(i) || this.setAttribute("largura-rotulo", String(i));
|
|
2770
|
-
}
|
|
2771
|
-
get fechavel() {
|
|
2772
|
-
return this.hasAttribute("fechavel");
|
|
2773
|
-
}
|
|
2774
|
-
set fechavel(e) {
|
|
2775
|
-
e ? this.setAttribute("fechavel", "") : this.removeAttribute("fechavel");
|
|
2776
|
-
}
|
|
2777
|
-
get categorias() {
|
|
2778
|
-
return this._categorias;
|
|
2779
|
-
}
|
|
2780
|
-
set categorias(e) {
|
|
2781
|
-
this._categorias = Array.isArray(e) ? e : [], this.gerenciadorValores.inicializarCategorias(this._categorias), this.renderCategorias();
|
|
2782
|
-
}
|
|
2783
|
-
/**
|
|
2784
|
-
* Texto exibido nas propriedades cujo valor difere entre os objetos selecionados
|
|
2785
|
-
* (`VALOR_MISTO`). Reflete o atributo `texto-misto`; padrão "Varia".
|
|
2786
|
-
*/
|
|
2787
|
-
get textoMisto() {
|
|
2788
|
-
const e = this.getAttribute("texto-misto");
|
|
2789
|
-
return e && e.trim() ? e : ee;
|
|
2790
|
-
}
|
|
2791
|
-
set textoMisto(e) {
|
|
2792
|
-
typeof e == "string" && e.trim() ? this.setAttribute("texto-misto", e) : this.removeAttribute("texto-misto");
|
|
2793
|
-
}
|
|
2794
|
-
get tipos() {
|
|
2795
|
-
return this._tipos;
|
|
2796
|
-
}
|
|
2797
|
-
set tipos(e) {
|
|
2798
|
-
this._tipos = Array.isArray(e) ? e : [], this.renderSeletorTipos();
|
|
2799
|
-
}
|
|
2800
|
-
/** Id do tipo exibido no seletor: sem seleção válida, o seletor mostra (e devolve) o primeiro. */
|
|
2801
|
-
get tipoSelecionado() {
|
|
2802
|
-
const e = this._tipos.filter((o) => o && o.id !== null && o.id !== void 0);
|
|
2803
|
-
return !e.some((o) => String(o.id) === this._tipoSelecionadoId) && e.length > 0 ? String(e[0].id) : this._tipoSelecionadoId;
|
|
2804
|
-
}
|
|
2805
|
-
set tipoSelecionado(e) {
|
|
2806
|
-
this._tipoSelecionadoId = String(e ?? ""), this.renderSeletorTipos();
|
|
2807
|
-
}
|
|
2808
|
-
get valores() {
|
|
2809
|
-
return this.gerenciadorValores.getValores();
|
|
2810
|
-
}
|
|
2811
|
-
set valores(e) {
|
|
2812
|
-
this.gerenciadorValores.setValores(e), this.renderCategorias();
|
|
2813
|
-
}
|
|
2814
|
-
get isDirty() {
|
|
2815
|
-
return this.gerenciadorValores.isDirty;
|
|
2816
|
-
}
|
|
2817
|
-
get dirty() {
|
|
2818
|
-
return this.gerenciadorValores.isDirty;
|
|
2819
|
-
}
|
|
2820
|
-
obterValor(e) {
|
|
2821
|
-
return this.gerenciadorValores.obterValor(e);
|
|
2822
|
-
}
|
|
2823
|
-
definirValor(e, i, o = !0) {
|
|
2824
|
-
this.gerenciadorValores.definirValor(e, i, o);
|
|
2825
|
-
}
|
|
2826
|
-
/**
|
|
2827
|
-
* Volta uma propriedade ao valor do último carregar/aplicar (o mesmo que o botão ↺ da linha).
|
|
2828
|
-
* Fora do modo manual emite `ui-propriedade-alterada`. Devolve `false` se não havia o que restaurar.
|
|
2829
|
-
*/
|
|
2830
|
-
redefinirValor(e, i = !0) {
|
|
2831
|
-
return this.gerenciadorValores.redefinirValor(e, i);
|
|
2832
|
-
}
|
|
2833
|
-
aplicar() {
|
|
2834
|
-
this.gerenciadorValores.aplicar();
|
|
2835
|
-
}
|
|
2836
|
-
desfazer() {
|
|
2837
|
-
this.gerenciadorValores.desfazer();
|
|
2838
|
-
}
|
|
2839
|
-
expandirTudo() {
|
|
2840
|
-
vt(this.shadow, this._categorias);
|
|
2841
|
-
}
|
|
2842
|
-
colapsarTudo() {
|
|
2843
|
-
_t(this.shadow, this._categorias);
|
|
2844
|
-
}
|
|
2845
|
-
toggleCategoria(e) {
|
|
2846
|
-
xt(this.shadow, this, this._categorias, e);
|
|
2847
|
-
}
|
|
2848
|
-
get densidade() {
|
|
2849
|
-
return this.getAttribute("densidade") || "padrao";
|
|
2850
|
-
}
|
|
2851
|
-
set densidade(e) {
|
|
2852
|
-
!e || e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e);
|
|
2853
|
-
}
|
|
2854
|
-
alternarDensidade() {
|
|
2855
|
-
const e = Ut(this.getAttribute("densidade") || "padrao");
|
|
2856
|
-
return e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e), this.dispatchEvent(
|
|
2857
|
-
new CustomEvent("ui-densidade-alterada", {
|
|
2858
|
-
bubbles: !0,
|
|
2859
|
-
composed: !0,
|
|
2860
|
-
detail: { densidade: e }
|
|
2861
|
-
})
|
|
2862
|
-
), B(this.shadow, this), e;
|
|
2863
|
-
}
|
|
2864
|
-
get flutuante() {
|
|
2865
|
-
return this.hasAttribute("flutuante");
|
|
2866
|
-
}
|
|
2867
|
-
set flutuante(e) {
|
|
2868
|
-
!!e !== this.hasAttribute("flutuante") && this.alternarFlutuante();
|
|
2869
|
-
}
|
|
2870
|
-
get colapsado() {
|
|
2871
|
-
return this.hasAttribute("colapsado");
|
|
2872
|
-
}
|
|
2873
|
-
set colapsado(e) {
|
|
2874
|
-
!!e !== this.hasAttribute("colapsado") && this.alternarColapsoHorizontal();
|
|
2875
|
-
}
|
|
2876
|
-
alternarFlutuante() {
|
|
2877
|
-
this._sincronizandoFlutuante = !0;
|
|
2878
|
-
try {
|
|
2879
|
-
const e = $t(this);
|
|
2880
|
-
return B(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-flutuante-alterado", {
|
|
2881
|
-
bubbles: !0,
|
|
2882
|
-
composed: !0,
|
|
2883
|
-
detail: {
|
|
2884
|
-
flutuante: e,
|
|
2885
|
-
left: this.style.left,
|
|
2886
|
-
top: this.style.top,
|
|
2887
|
-
width: this.style.width,
|
|
2888
|
-
height: this.style.height
|
|
2889
|
-
}
|
|
2890
|
-
})), e;
|
|
2891
|
-
} finally {
|
|
2892
|
-
this._sincronizandoFlutuante = !1;
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
alternarColapsoHorizontal() {
|
|
2896
|
-
const e = this.hasAttribute("colapsado");
|
|
2897
|
-
e ? this.removeAttribute("colapsado") : this.setAttribute("colapsado", "");
|
|
2898
|
-
const i = !e;
|
|
2899
|
-
return B(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-colapso-horizontal", {
|
|
2900
|
-
bubbles: !0,
|
|
2901
|
-
composed: !0,
|
|
2902
|
-
detail: { colapsado: i }
|
|
2903
|
-
})), i;
|
|
2904
|
-
}
|
|
2905
|
-
syncState() {
|
|
2906
|
-
B(this.shadow, this);
|
|
2907
|
-
const e = this.getAttribute("largura-rotulo");
|
|
2908
|
-
if (e) {
|
|
2909
|
-
const i = parseFloat(e);
|
|
2910
|
-
isNaN(i) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(i));
|
|
2911
|
-
}
|
|
2912
|
-
this.renderSeletorTipos(), this.renderCategorias();
|
|
2913
|
-
}
|
|
2914
|
-
toggleExpandirTodas() {
|
|
2915
|
-
this._categorias.some((i) => i.aberto !== void 0 ? i.aberto === !1 : i.aberta === !1) ? this.expandirTudo() : this.colapsarTudo();
|
|
2916
|
-
}
|
|
2917
|
-
renderSeletorTipos() {
|
|
2918
|
-
Bt({
|
|
2919
|
-
tipoContainerElement: this.tipoContainerElement,
|
|
2920
|
-
tipos: this._tipos,
|
|
2921
|
-
tipoSelecionadoId: this._tipoSelecionadoId,
|
|
2922
|
-
estiloVisual: this.getAttribute("estilo-visual") || "autocad",
|
|
2923
|
-
onSelecionarTipo: (e) => {
|
|
2924
|
-
this._tipoSelecionadoId = e, this.renderSeletorTipos();
|
|
2925
|
-
const i = this._tipos.find((o) => o && String(o.id) === String(e));
|
|
2926
|
-
this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo: i } }));
|
|
2927
|
-
},
|
|
2928
|
-
onEditarTipo: (e) => this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2929
|
-
onQuickSelect: (e) => this.dispatchEvent(new CustomEvent("ui-quick-select", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2930
|
-
onSelectObjects: (e) => this.dispatchEvent(new CustomEvent("ui-selecionar-objetos", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2931
|
-
onCalculadora: (e) => this.dispatchEvent(new CustomEvent("ui-calculadora", { bubbles: !0, composed: !0, detail: { tipo: e } }))
|
|
2932
|
-
});
|
|
2933
|
-
}
|
|
2934
|
-
renderCategorias() {
|
|
2935
|
-
const e = this.shadow.getElementById("lista-categorias");
|
|
2936
|
-
e && Ft({
|
|
2937
|
-
listaContainer: e,
|
|
2938
|
-
categorias: this._categorias,
|
|
2939
|
-
termoBusca: this._termoBusca,
|
|
2940
|
-
onToggleCategoria: (i) => this.toggleCategoria(i),
|
|
2941
|
-
linhaCtx: {
|
|
2942
|
-
valoresAtuais: this.gerenciadorValores.getValores(),
|
|
2943
|
-
valoresOriginais: this.gerenciadorValores.getValoresOriginais(),
|
|
2944
|
-
onAtualizarCampoVisual: (i, o) => he(this.shadow, i, o),
|
|
2945
|
-
onRedefinir: (i) => this.redefinirValor(i),
|
|
2946
|
-
editorCtx: {
|
|
2947
|
-
obterValorAtual: (i) => this.gerenciadorValores.obterValor(i),
|
|
2948
|
-
registrarAlteracao: (i, o, a) => {
|
|
2949
|
-
this.gerenciadorValores.registrarAlteracao(i, o, a);
|
|
2950
|
-
},
|
|
2951
|
-
focarProximoEditor: (i) => ft(this.shadow, i),
|
|
2952
|
-
focarEditorAnterior: (i) => bt(this.shadow, i),
|
|
2953
|
-
obterTextoMisto: () => this.textoMisto,
|
|
2954
|
-
despacharEventoAcao: (i, o) => {
|
|
2955
|
-
this.dispatchEvent(
|
|
2956
|
-
new CustomEvent("ui-acao-clique", {
|
|
2957
|
-
bubbles: !0,
|
|
2958
|
-
composed: !0,
|
|
2959
|
-
detail: { id: i.id, categoriaId: o, propriedade: i }
|
|
2960
|
-
})
|
|
2961
|
-
);
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
});
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
class Kt extends oe {
|
|
2969
|
-
}
|
|
2970
|
-
class Yt extends oe {
|
|
2971
|
-
}
|
|
2972
|
-
V("ui-tabela-propriedades", oe);
|
|
2973
|
-
V("ui-painel-propriedades", Kt);
|
|
2974
|
-
V("ui-propriedades", Yt);
|
|
2975
|
-
export {
|
|
2976
|
-
S as $,
|
|
2977
|
-
zt as A,
|
|
2978
|
-
wt as B,
|
|
2979
|
-
Ct as C,
|
|
2980
|
-
St as D,
|
|
2981
|
-
Dt as E,
|
|
2982
|
-
Vt as F,
|
|
2983
|
-
Wt as G,
|
|
2984
|
-
Je as H,
|
|
2985
|
-
Ze as I,
|
|
2986
|
-
Ye as J,
|
|
2987
|
-
Qe as K,
|
|
2988
|
-
Ke as L,
|
|
2989
|
-
vt as M,
|
|
2990
|
-
bt as N,
|
|
2991
|
-
gt as O,
|
|
2992
|
-
ft as P,
|
|
2993
|
-
be as Q,
|
|
2994
|
-
ge as R,
|
|
2995
|
-
le as S,
|
|
2996
|
-
ee as T,
|
|
2997
|
-
Kt as U,
|
|
2998
|
-
J as V,
|
|
2999
|
-
ve as W,
|
|
3000
|
-
et as X,
|
|
3001
|
-
We as Y,
|
|
3002
|
-
X as Z,
|
|
3003
|
-
ne as _,
|
|
3004
|
-
Pe as a,
|
|
3005
|
-
G as a0,
|
|
3006
|
-
Re as a1,
|
|
3007
|
-
q as a2,
|
|
3008
|
-
Ve as a3,
|
|
3009
|
-
W as a4,
|
|
3010
|
-
$ as a5,
|
|
3011
|
-
Et as a6,
|
|
3012
|
-
tt as a7,
|
|
3013
|
-
Ut as a8,
|
|
3014
|
-
Ue as a9,
|
|
3015
|
-
R as aa,
|
|
3016
|
-
Ft as ab,
|
|
3017
|
-
je as ac,
|
|
3018
|
-
He as ad,
|
|
3019
|
-
Bt as ae,
|
|
3020
|
-
_e as af,
|
|
3021
|
-
B as ag,
|
|
3022
|
-
H as ah,
|
|
3023
|
-
T as ai,
|
|
3024
|
-
rt as aj,
|
|
3025
|
-
yt as ak,
|
|
3026
|
-
K as al,
|
|
3027
|
-
O as am,
|
|
3028
|
-
Le as b,
|
|
3029
|
-
Te as c,
|
|
3030
|
-
Yt as d,
|
|
3031
|
-
ut as e,
|
|
3032
|
-
oe as f,
|
|
3033
|
-
Ge as g,
|
|
3034
|
-
xt as h,
|
|
3035
|
-
De as i,
|
|
3036
|
-
$t as j,
|
|
3037
|
-
te as k,
|
|
3038
|
-
Ie as l,
|
|
3039
|
-
he as m,
|
|
3040
|
-
mt as n,
|
|
3041
|
-
xe as o,
|
|
3042
|
-
_t as p,
|
|
3043
|
-
tr as q,
|
|
3044
|
-
jt as r,
|
|
3045
|
-
Xt as s,
|
|
3046
|
-
Ot as t,
|
|
3047
|
-
kt as u,
|
|
3048
|
-
At as v,
|
|
3049
|
-
Rt as w,
|
|
3050
|
-
Tt as x,
|
|
3051
|
-
Lt as y,
|
|
3052
|
-
Mt as z
|
|
3053
|
-
};
|