@thibezer/ui-components-kit 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +760 -739
- package/dist/camadas.cjs +72 -72
- package/dist/camadas.js +700 -667
- package/dist/canvas.cjs +99 -140
- package/dist/canvas.js +5125 -1192
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +4 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +10 -0
- package/dist/components/ui-canvas-cad/cad-estilos-externos.d.ts +16 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +4 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +262 -0
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +32 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +1 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +143 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +1 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +8 -1
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +19 -9
- package/dist/components/ui-tabela/tipos.d.ts +6 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +41 -2
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +0 -5
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +17 -1
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +10 -1
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +3 -1
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +5 -1
- package/dist/core/alvo-digitavel.d.ts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/svg-seguro.d.ts +10 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +12 -10
- package/dist/custom-elements.json +14782 -10666
- package/dist/data.cjs +1 -1
- package/dist/data.js +51 -46
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +1 -1
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +18 -0
- package/dist/gerencigeo-canvas/feature_adapters.d.ts +35 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +45 -0
- package/dist/gerencigeo-canvas/feature_amostra.d.ts +4 -0
- package/dist/gerencigeo-canvas/feature_caixa.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_cluster.d.ts +61 -0
- package/dist/gerencigeo-canvas/feature_cursores.d.ts +17 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +53 -0
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +91 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +62 -0
- package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_hud.d.ts +23 -0
- package/dist/gerencigeo-canvas/feature_indice.d.ts +36 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +16 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +31 -0
- package/dist/gerencigeo-canvas/feature_selecao.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +14 -0
- package/dist/gerencigeo-canvas/feature_snap.d.ts +25 -0
- package/dist/gerencigeo-canvas/feature_types.d.ts +86 -0
- package/dist/gerencigeo-canvas/feature_versoes.d.ts +19 -0
- package/dist/gerencigeo-canvas/index.d.ts +21 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +30 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +11 -3
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +1 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +24 -5
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +89 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +1 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +2 -2
- package/dist/gerencigeo-canvas/types.d.ts +12 -0
- package/dist/gerencigeo-canvas/utils.d.ts +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +111 -106
- package/dist/leaflet-DcO7uRC-.cjs +1 -0
- package/dist/{leaflet-DkaFZYc5.js → leaflet-PPDKB6Dd.js} +37 -37
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -3
- package/dist/seletor-mapa-base.cjs +13 -13
- package/dist/seletor-mapa-base.js +101 -51
- package/dist/svg-seguro-BsbNQqpd.js +50 -0
- package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +41 -36
- package/dist/tipos-elementos.d.ts +17 -4
- package/dist/tipos-vue.d.ts +15 -4
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/{ui-paleta-ferramentas-BIytXQLh.js → ui-paleta-ferramentas-CEZYcN4J.js} +18 -27
- package/dist/{ui-paleta-ferramentas-DqLY51qa.cjs → ui-paleta-ferramentas-Dbj1kBS9.cjs} +6 -6
- package/dist/{ui-switch-DWLgVVnT.js → ui-switch-BcOqOkiV.js} +124 -96
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/{ui-tabela-propriedades-BNcE6VLX.js → ui-tabela-propriedades-Boy7I5yW.js} +1304 -1072
- package/package.json +169 -169
- package/dist/leaflet-Cw6tqYFh.cjs +0 -1
- package/dist/ui-switch-yZIn3IW0.cjs +0 -53
- package/dist/ui-tabela-propriedades-D3pyQvyy.cjs +0 -145
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { L as
|
|
5
|
-
import { a as
|
|
6
|
-
import { d as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var Z = Object.defineProperty;
|
|
2
|
+
var J = (t, i, e) => i in t ? Z(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e;
|
|
3
|
+
var m = (t, i, e) => J(t, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { L as B } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { a as ee } from "./parts-CaoQiCfI.js";
|
|
6
|
+
import { d as q, S as j } from "./ssr-safe-5cWfJP-s.js";
|
|
7
|
+
import { h as te } from "./svg-seguro-BsbNQqpd.js";
|
|
8
|
+
class ie {
|
|
9
|
+
constructor(i) {
|
|
10
|
+
m(this, "autoFetchController", null);
|
|
11
|
+
this.ctx = i;
|
|
12
|
+
}
|
|
13
|
+
async carregar(i) {
|
|
14
|
+
if (!i) return;
|
|
14
15
|
this.autoFetchController && (this.autoFetchController.abort(), this.autoFetchController = null);
|
|
15
16
|
const e = new AbortController();
|
|
16
17
|
this.autoFetchController = e, this.ctx.onCarregandoAlterado(!0), this.ctx.host.dispatchEvent(
|
|
17
18
|
new CustomEvent("ui-fetch-start", {
|
|
18
19
|
bubbles: !0,
|
|
19
20
|
composed: !0,
|
|
20
|
-
detail: { url:
|
|
21
|
+
detail: { url: i }
|
|
21
22
|
})
|
|
22
23
|
);
|
|
23
24
|
try {
|
|
24
|
-
const r = await fetch(
|
|
25
|
+
const r = await fetch(i, { signal: e.signal });
|
|
25
26
|
if (!r.ok)
|
|
26
27
|
throw new Error(`HTTP ${r.status}: ${r.statusText}`);
|
|
27
|
-
const
|
|
28
|
+
const o = await r.json(), a = Array.isArray(o) ? o : o.dados || o.items || o.data || o.rows || [];
|
|
28
29
|
this.autoFetchController === e && (this.ctx.onDadosRecebidos(a), this.ctx.onCarregandoAlterado(!1), this.autoFetchController = null, this.ctx.host.dispatchEvent(
|
|
29
30
|
new CustomEvent("ui-fetch-sucesso", {
|
|
30
31
|
bubbles: !0,
|
|
31
32
|
composed: !0,
|
|
32
|
-
detail: { url:
|
|
33
|
+
detail: { url: i, total: a.length, dados: a }
|
|
33
34
|
})
|
|
34
35
|
));
|
|
35
36
|
} catch (r) {
|
|
@@ -39,7 +40,7 @@ class P {
|
|
|
39
40
|
new CustomEvent("ui-fetch-erro", {
|
|
40
41
|
bubbles: !0,
|
|
41
42
|
composed: !0,
|
|
42
|
-
detail: { url:
|
|
43
|
+
detail: { url: i, erro: r.message || String(r) }
|
|
43
44
|
})
|
|
44
45
|
));
|
|
45
46
|
}
|
|
@@ -48,116 +49,129 @@ class P {
|
|
|
48
49
|
this.autoFetchController && (this.autoFetchController.abort(), this.autoFetchController = null);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
const oe = ["id", "_id", "codigo", "key"];
|
|
53
|
+
function re(t, i) {
|
|
54
|
+
return t != null && (t === i || String(t) === String(i));
|
|
55
|
+
}
|
|
56
|
+
function P(t, i) {
|
|
57
|
+
let e = -1;
|
|
58
|
+
return typeof t == "number" && Number.isInteger(t) ? e = t : typeof t == "string" && /^\d+$/.test(t.trim()) && (e = parseInt(t.trim(), 10)), e >= 0 && e < i ? e : -1;
|
|
59
|
+
}
|
|
60
|
+
function ae(t, i, e = "id", r = !1) {
|
|
52
61
|
if (!t || t.length === 0) return -1;
|
|
53
|
-
if (typeof
|
|
54
|
-
return t.findIndex(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
if (typeof i == "function")
|
|
63
|
+
return t.findIndex(i);
|
|
64
|
+
if (r) return P(i, t.length);
|
|
65
|
+
const o = [e, ...oe.filter((a) => a !== e)];
|
|
66
|
+
for (const a of o) {
|
|
67
|
+
const n = t.findIndex((s) => !!s && typeof s == "object" && re(s[a], i));
|
|
68
|
+
if (n !== -1) return n;
|
|
69
|
+
}
|
|
70
|
+
return P(i, t.length);
|
|
71
|
+
}
|
|
72
|
+
class ne {
|
|
73
|
+
constructor(i) {
|
|
74
|
+
m(this, "itemSelecionado", null);
|
|
75
|
+
m(this, "indiceSelecionado", null);
|
|
76
|
+
this.ctx = i;
|
|
77
|
+
}
|
|
78
|
+
/** Mesmo objeto ou mesmo valor na chave configurada. */
|
|
79
|
+
indiceDoItem(i, e) {
|
|
80
|
+
const r = this.ctx.getChaveId();
|
|
81
|
+
return i.findIndex(
|
|
82
|
+
(o) => o === e || e[r] !== void 0 && (o == null ? void 0 : o[r]) !== void 0 && String(o[r]) === String(e[r])
|
|
83
|
+
);
|
|
73
84
|
}
|
|
74
85
|
getItemSelecionado() {
|
|
75
86
|
return this.itemSelecionado;
|
|
76
87
|
}
|
|
77
|
-
setItemSelecionado(
|
|
78
|
-
this.itemSelecionado =
|
|
88
|
+
setItemSelecionado(i) {
|
|
89
|
+
this.itemSelecionado = i;
|
|
90
|
+
const e = i ? this.indiceDoItem(this.ctx.getDadosExibicao(), i) : -1;
|
|
91
|
+
this.indiceSelecionado = e >= 0 ? e : null, this.atualizarLinhasSelecionadas();
|
|
79
92
|
}
|
|
80
93
|
getIndiceSelecionado() {
|
|
81
94
|
return this.indiceSelecionado;
|
|
82
95
|
}
|
|
83
|
-
setIndiceSelecionado(
|
|
84
|
-
|
|
96
|
+
setIndiceSelecionado(i) {
|
|
97
|
+
const e = this.ctx.getDadosExibicao(), r = i !== null && i >= 0 && i < e.length;
|
|
98
|
+
this.indiceSelecionado = r ? i : null, this.itemSelecionado = r ? e[i] : null, this.atualizarLinhasSelecionadas();
|
|
85
99
|
}
|
|
86
100
|
/**
|
|
87
|
-
* Reaplica
|
|
88
|
-
*
|
|
101
|
+
* Reaplica a seleção após ordenar, filtrar ou trocar os dados.
|
|
102
|
+
* - Item ainda exibido: atualiza o índice (e a referência, se veio um objeto novo com a mesma chave).
|
|
103
|
+
* - Item só escondido pelo filtro: mantém a seleção (sem índice) para reaparecer ao limpar o filtro.
|
|
104
|
+
* - Item removido dos dados: limpa a seleção e emite `ui-selecao-removida`.
|
|
89
105
|
*/
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
106
|
+
reconciliar() {
|
|
107
|
+
const i = this.itemSelecionado;
|
|
108
|
+
if (!i) {
|
|
109
|
+
this.indiceSelecionado = null;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const e = this.ctx.getDadosExibicao(), r = this.indiceDoItem(e, i);
|
|
113
|
+
if (r >= 0) {
|
|
114
|
+
this.itemSelecionado = e[r], this.indiceSelecionado = r;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.indiceSelecionado = null;
|
|
118
|
+
const o = this.ctx.getDadosOriginais(), a = this.indiceDoItem(o, i);
|
|
119
|
+
if (a >= 0) {
|
|
120
|
+
this.itemSelecionado = o[a];
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.itemSelecionado = null, this.ctx.host.dispatchEvent(
|
|
124
|
+
new CustomEvent("ui-selecao-removida", { bubbles: !0, composed: !0, detail: { item: i } })
|
|
93
125
|
);
|
|
94
|
-
r >= 0 && (this.itemSelecionado = this.ctx.dadosExibicao[r], this.indiceSelecionado = r);
|
|
95
126
|
}
|
|
96
127
|
limparSelecao() {
|
|
97
128
|
this.itemSelecionado = null, this.indiceSelecionado = null, this.atualizarLinhasSelecionadas();
|
|
98
129
|
}
|
|
99
|
-
isItemSelecionado(
|
|
130
|
+
isItemSelecionado(i, e) {
|
|
100
131
|
if (this.itemSelecionado) {
|
|
101
|
-
if (this.itemSelecionado ===
|
|
102
|
-
const r = this.ctx.
|
|
103
|
-
if (
|
|
104
|
-
return String(
|
|
105
|
-
if (
|
|
106
|
-
return String(
|
|
132
|
+
if (this.itemSelecionado === i) return !0;
|
|
133
|
+
const r = this.ctx.getChaveId();
|
|
134
|
+
if (i[r] !== void 0 && this.itemSelecionado[r] !== void 0)
|
|
135
|
+
return String(i[r]) === String(this.itemSelecionado[r]);
|
|
136
|
+
if (i.id !== void 0 && this.itemSelecionado.id !== void 0)
|
|
137
|
+
return String(i.id) === String(this.itemSelecionado.id);
|
|
107
138
|
}
|
|
108
139
|
return this.indiceSelecionado !== null && this.indiceSelecionado === e;
|
|
109
140
|
}
|
|
110
141
|
atualizarLinhasSelecionadas() {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
142
|
+
const i = this.ctx.getTbody();
|
|
143
|
+
if (!i) return;
|
|
144
|
+
const e = this.ctx.getDadosExibicao();
|
|
145
|
+
i.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach((o) => {
|
|
146
|
+
const a = o.getAttribute("data-index"), n = a !== null ? parseInt(a, 10) : -1, s = n >= 0 ? e[n] : null, d = s ? this.isItemSelecionado(s, n) : !1;
|
|
147
|
+
o.classList.toggle("ui-tabela__tr--selecionada", d), ee(o, "linha-selecionada", d), d ? (o.setAttribute("data-selecionada", "true"), o.setAttribute("aria-current", "true")) : (o.removeAttribute("data-selecionada"), o.removeAttribute("aria-current"));
|
|
115
148
|
});
|
|
116
149
|
}
|
|
117
|
-
rolarPara(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (r === -1)
|
|
150
|
+
rolarPara(i, e) {
|
|
151
|
+
const r = this.ctx.getDadosExibicao(), o = ae(r, i, this.ctx.getChaveId(), (e == null ? void 0 : e.porIndice) === !0);
|
|
152
|
+
if (o === -1)
|
|
121
153
|
return !1;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
`tr[data-index="${r}"]`
|
|
132
|
-
);
|
|
133
|
-
if (n && !n.classList.contains("ui-tabela__virtual-spacer"))
|
|
134
|
-
return this.ctx.containerElement && (typeof window.happyDOM < "u" || typeof process < "u" && ((p = process.env) == null ? void 0 : p.NODE_ENV) === "test") && (this.ctx.containerElement.scrollTop = r * l), typeof n.scrollIntoView == "function" && n.scrollIntoView({ behavior: a, block: "nearest" }), !0;
|
|
135
|
-
if (this.ctx.containerElement) {
|
|
136
|
-
const c = Math.max(0, r * l);
|
|
137
|
-
if (typeof this.ctx.containerElement.scrollTo == "function")
|
|
138
|
-
try {
|
|
139
|
-
this.ctx.containerElement.scrollTo({
|
|
140
|
-
top: c,
|
|
141
|
-
behavior: a
|
|
142
|
-
});
|
|
143
|
-
} catch {
|
|
144
|
-
this.ctx.containerElement.scrollTop = c;
|
|
145
|
-
}
|
|
146
|
-
else
|
|
147
|
-
this.ctx.containerElement.scrollTop = c;
|
|
148
|
-
return (a === "auto" || typeof window.happyDOM < "u" || typeof process < "u" && ((s = process.env) == null ? void 0 : s.NODE_ENV) === "test") && (this.ctx.containerElement.scrollTop = c, this.ctx.onRenderBody()), !0;
|
|
154
|
+
if (e != null && e.selecionar) {
|
|
155
|
+
const a = r[o];
|
|
156
|
+
this.itemSelecionado = a, this.indiceSelecionado = o, this.atualizarLinhasSelecionadas(), this.ctx.onLinhaAtiva(o), this.ctx.host.dispatchEvent(
|
|
157
|
+
new CustomEvent("ui-linha-selecionada", {
|
|
158
|
+
bubbles: !0,
|
|
159
|
+
composed: !0,
|
|
160
|
+
detail: { item: a, indice: o }
|
|
161
|
+
})
|
|
162
|
+
);
|
|
149
163
|
}
|
|
150
|
-
return
|
|
164
|
+
return this.ctx.onRolarParaIndice(o, (e == null ? void 0 : e.comportamento) || "smooth");
|
|
151
165
|
}
|
|
152
166
|
}
|
|
153
|
-
function
|
|
167
|
+
function se(t, i, e) {
|
|
154
168
|
return t !== e ? {
|
|
155
169
|
idColuna: e,
|
|
156
170
|
direcao: "asc"
|
|
157
|
-
} :
|
|
171
|
+
} : i === "asc" ? {
|
|
158
172
|
idColuna: e,
|
|
159
173
|
direcao: "desc"
|
|
160
|
-
} :
|
|
174
|
+
} : i === "desc" ? {
|
|
161
175
|
idColuna: null,
|
|
162
176
|
direcao: "original"
|
|
163
177
|
} : {
|
|
@@ -165,31 +179,36 @@ function O(t, o, e) {
|
|
|
165
179
|
direcao: "asc"
|
|
166
180
|
};
|
|
167
181
|
}
|
|
168
|
-
function
|
|
169
|
-
if (!
|
|
182
|
+
function le(t, i, e) {
|
|
183
|
+
if (!i || e === "original")
|
|
170
184
|
return [...t];
|
|
171
185
|
const r = e === "asc" ? 1 : -1;
|
|
172
|
-
return [...t].sort((
|
|
173
|
-
const
|
|
174
|
-
return
|
|
186
|
+
return [...t].sort((o, a) => {
|
|
187
|
+
const n = o[i], s = a[i];
|
|
188
|
+
return n === s ? 0 : n == null ? 1 * r : s == null ? -1 * r : typeof n == "number" && typeof s == "number" ? (n - s) * r : String(n).localeCompare(String(s), "pt-BR", {
|
|
175
189
|
numeric: !0,
|
|
176
190
|
sensitivity: "base"
|
|
177
191
|
}) * r;
|
|
178
192
|
});
|
|
179
193
|
}
|
|
180
|
-
class
|
|
194
|
+
class de {
|
|
181
195
|
constructor() {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
196
|
+
m(this, "dadosOriginais", []);
|
|
197
|
+
m(this, "dadosExibicao", []);
|
|
198
|
+
m(this, "colunaOrdenada", null);
|
|
199
|
+
m(this, "direcaoOrdenacao", "original");
|
|
200
|
+
m(this, "ultimoFiltro", "");
|
|
201
|
+
/** Colunas declaradas: o filtro olha só elas (vazio = todos os campos do registro). */
|
|
202
|
+
m(this, "colunasFiltro", []);
|
|
203
|
+
}
|
|
204
|
+
setColunasFiltro(i) {
|
|
205
|
+
this.colunasFiltro = i, this.ultimoFiltro && this.aplicarOrdenacao();
|
|
187
206
|
}
|
|
188
207
|
getDadosOriginais() {
|
|
189
208
|
return this.dadosOriginais;
|
|
190
209
|
}
|
|
191
|
-
setDadosOriginais(
|
|
192
|
-
this.dadosOriginais = Array.isArray(
|
|
210
|
+
setDadosOriginais(i) {
|
|
211
|
+
this.dadosOriginais = Array.isArray(i) ? [...i] : [], this.aplicarOrdenacao();
|
|
193
212
|
}
|
|
194
213
|
getDadosExibicao() {
|
|
195
214
|
return this.dadosExibicao;
|
|
@@ -197,210 +216,208 @@ class q {
|
|
|
197
216
|
getColunaOrdenada() {
|
|
198
217
|
return this.colunaOrdenada;
|
|
199
218
|
}
|
|
200
|
-
setColunaOrdenada(
|
|
201
|
-
this.colunaOrdenada =
|
|
219
|
+
setColunaOrdenada(i) {
|
|
220
|
+
this.colunaOrdenada = i, i ? this.direcaoOrdenacao === "original" && (this.direcaoOrdenacao = "asc") : this.direcaoOrdenacao = "original", this.aplicarOrdenacao();
|
|
202
221
|
}
|
|
203
222
|
getDirecaoOrdenacao() {
|
|
204
223
|
return this.direcaoOrdenacao;
|
|
205
224
|
}
|
|
206
|
-
setDirecaoOrdenacao(
|
|
207
|
-
this.direcaoOrdenacao =
|
|
225
|
+
setDirecaoOrdenacao(i) {
|
|
226
|
+
this.direcaoOrdenacao = i || "original", this.direcaoOrdenacao === "original" && (this.colunaOrdenada = null), this.aplicarOrdenacao();
|
|
208
227
|
}
|
|
209
|
-
alternarOrdenacaoColuna(
|
|
210
|
-
if (!
|
|
211
|
-
const e =
|
|
228
|
+
alternarOrdenacaoColuna(i) {
|
|
229
|
+
if (!i.ordenavel) return null;
|
|
230
|
+
const e = se(this.colunaOrdenada, this.direcaoOrdenacao, i.id);
|
|
212
231
|
return this.colunaOrdenada = e.idColuna, this.direcaoOrdenacao = e.direcao, this.aplicarOrdenacao(), e;
|
|
213
232
|
}
|
|
233
|
+
/** Recalcula a lista exibida: ordenação da coluna e, por cima, o filtro vigente (os dois valem juntos). */
|
|
214
234
|
aplicarOrdenacao() {
|
|
215
|
-
|
|
235
|
+
const i = le(
|
|
216
236
|
this.dadosOriginais,
|
|
217
237
|
this.colunaOrdenada,
|
|
218
238
|
this.direcaoOrdenacao
|
|
219
|
-
);
|
|
239
|
+
), e = this.ultimoFiltro;
|
|
240
|
+
this.dadosExibicao = e ? i.filter((r) => (this.colunasFiltro.length > 0 ? this.colunasFiltro.map((a) => r[a]) : Object.values(r)).some((a) => a != null && (typeof a != "object" || a instanceof Date) && String(a).toLowerCase().includes(e))) : i;
|
|
220
241
|
}
|
|
221
|
-
filtrar(
|
|
222
|
-
|
|
223
|
-
this.aplicarOrdenacao();
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
this.dadosExibicao = this.dadosOriginais.filter((e) => Object.values(e).some((r) => r == null ? !1 : String(r).toLowerCase().includes(this.ultimoFiltro)));
|
|
242
|
+
filtrar(i) {
|
|
243
|
+
this.ultimoFiltro = (i || "").trim().toLowerCase(), this.aplicarOrdenacao();
|
|
227
244
|
}
|
|
228
245
|
}
|
|
229
|
-
const
|
|
230
|
-
function
|
|
246
|
+
const ce = ':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;touch-action:pan-x pan-y;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}.ui-tabela thead{position:sticky;top:0;z-index:10;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, #e1e1e6);font-weight:600;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__resizer{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:20;transition:background-color .15s ease}.ui-tabela__resizer:hover,.ui-tabela__resizer--ativo{background-color:var(--ui-cor-primaria, #00E08A)}: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:90px;display:inline-flex;align-items:center}.ui-tabela__sort-icon,.ui-tabela__header-icon{width:70px;min-width:70px;max-width:70px;display:inline-flex;justify-content:center;align-items:center;transition:transform .2s ease,opacity .2s ease}.ui-tabela th.ui-tabela__th--ordenavel{cursor:pointer}.ui-tabela th.ui-tabela__th--ordenavel:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.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-cor-primaria, #00E08A);outline-offset:-2px}.ui-tabela__sort-arrow{display:inline-block;width:12px;height:12px;vertical-align:middle;shape-rendering:geometricPrecision;transition:transform .2s ease,fill .2s ease;fill:var(--ui-cor-primaria, #00E08A)}.ui-tabela__sort-arrow--desc{transform:rotate(180deg)}.ui-tabela__sort-arrow--inativo{opacity:.3;fill:var(--ui-cor-texto-secundario, #888899)}.ui-tabela td{padding:10px 16px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .06));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.ui-tabela__tr--par{background-color:var(--ui-cor-fundo-card, rgba(255, 255, 255, .02))}.ui-tabela tbody tr:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-tabela tbody tr.ui-tabela__tr--selecionada,.ui-tabela tbody tr[data-selecionada=true]{background-color:var(--ui-cor-linha-selecionada, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 14%, transparent));box-shadow:inset 3px 0 0 var(--ui-cor-primaria, #00E08A)}.ui-tabela tbody tr.ui-tabela__tr--selecionada:hover,.ui-tabela tbody tr[data-selecionada=true]:hover{background-color: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:48px 24px;text-align:center;border:2px dashed var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);margin:16px;color:var(--ui-cor-texto-secundario, #888899);background-color:var(--ui-cor-fundo, #0b0b0d);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, #888899)}.ui-tabela__loading{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#0b0b0db3;-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-primaria, #00E08A);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__context-menu{position:absolute;z-index:var(--ui-z-popover, 1050);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);box-shadow:var(--ui-sombra-md, 0 4px 20px rgba(0, 0, 0, .6));padding:6px;display:flex;flex-direction:column;gap:4px;min-width:200px;font-size:13px;color:var(--ui-cor-texto, #e1e1e6)}.ui-tabela__context-item{padding:8px 12px;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;color:var(--ui-cor-texto, #e1e1e6);display:flex;align-items:center;justify-content:space-between;gap:8px;transition:background-color .15s ease}.ui-tabela__context-item:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-primaria, #00E08A)}.ui-tabela__prompt-dialog{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{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:12px;box-sizing:border-box}.ui-tabela__prompt-actions{display:flex;justify-content:flex-end;gap:8px}.ui-tabela__prompt-actions button{background:var(--ui-cor-borda, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);border:none;padding:6px 12px;border-radius:var(--ui-raio-sm, 4px);cursor:pointer}.ui-tabela__prompt-actions button:last-child{background:var(--ui-cor-primaria, #00E08A);color:#000;font-weight:600}@media (max-width: 640px){.ui-tabela th{padding:8px 10px;font-size:12px}.ui-tabela td{padding:8px 10px;font-size:13px}.ui-tabela__header-text{margin-right:16px}.ui-tabela__sort-icon,.ui-tabela__header-icon{width:24px;min-width:24px;max-width:24px}.ui-tabela__resizer{width:14px}}';
|
|
247
|
+
function $(t) {
|
|
231
248
|
return t == null || t === "" ? "" : typeof t == "number" ? `${t}px` : t;
|
|
232
249
|
}
|
|
233
|
-
function
|
|
250
|
+
function W(t) {
|
|
234
251
|
return t === "centro" || t === "center" ? "ui-tabela--alinhar-centro" : t === "direita" || t === "right" ? "ui-tabela--alinhar-direita" : "ui-tabela--alinhar-esquerda";
|
|
235
252
|
}
|
|
236
|
-
function
|
|
253
|
+
function U(t) {
|
|
237
254
|
return t === "centro" || t === "center" ? "center" : t === "direita" || t === "right" ? "right" : "left";
|
|
238
255
|
}
|
|
239
|
-
function
|
|
256
|
+
function O(t) {
|
|
240
257
|
return t === "compacta" ? 30 : t === "relaxada" ? 56 : 42;
|
|
241
258
|
}
|
|
242
|
-
function
|
|
243
|
-
t.innerHTML = `<style>${
|
|
244
|
-
const
|
|
245
|
-
|
|
259
|
+
function ue(t, i, e, r) {
|
|
260
|
+
t.innerHTML = `<style>${ce}</style>`;
|
|
261
|
+
const o = document.createElement("div");
|
|
262
|
+
o.className = "ui-tabela-container", o.setAttribute("part", "base"), e && (o.style.maxHeight = e);
|
|
246
263
|
const a = document.createElement("div");
|
|
247
264
|
a.className = "ui-tabela__empty", a.setAttribute("part", "vazio"), a.style.display = "none";
|
|
248
|
-
const
|
|
249
|
-
|
|
265
|
+
const n = document.createElement("div");
|
|
266
|
+
n.innerHTML = `
|
|
250
267
|
<svg class="ui-tabela__empty-icon" viewBox="0 0 24 24">
|
|
251
268
|
<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"/>
|
|
252
269
|
</svg>`;
|
|
253
|
-
const
|
|
254
|
-
|
|
270
|
+
const s = document.createElement("span");
|
|
271
|
+
s.className = "ui-tabela__empty-text", s.textContent = i, a.appendChild(n), a.appendChild(s);
|
|
255
272
|
const d = document.createElement("table");
|
|
256
273
|
d.className = "ui-tabela", d.setAttribute("part", "tabela");
|
|
257
|
-
const
|
|
258
|
-
d.appendChild(
|
|
259
|
-
const
|
|
260
|
-
return
|
|
274
|
+
const u = document.createElement("colgroup"), l = document.createElement("thead"), p = document.createElement("tbody");
|
|
275
|
+
d.appendChild(u), d.appendChild(l), d.appendChild(p), o.appendChild(a), o.appendChild(d);
|
|
276
|
+
const c = document.createElement("div");
|
|
277
|
+
return c.className = "ui-tabela__loading", c.setAttribute("part", "carregando"), c.style.display = r ? "flex" : "none", c.innerHTML = `
|
|
261
278
|
<div class="ui-tabela__spinner"></div>
|
|
262
279
|
<span>Carregando dados...</span>
|
|
263
|
-
`,
|
|
264
|
-
containerElement:
|
|
280
|
+
`, o.appendChild(c), t.appendChild(o), {
|
|
281
|
+
containerElement: o,
|
|
265
282
|
tableElement: d,
|
|
266
|
-
theadElement:
|
|
267
|
-
tbodyElement:
|
|
268
|
-
colgroupElement:
|
|
283
|
+
theadElement: l,
|
|
284
|
+
tbodyElement: p,
|
|
285
|
+
colgroupElement: u,
|
|
269
286
|
emptyElement: a,
|
|
270
|
-
loadingElement:
|
|
287
|
+
loadingElement: c
|
|
271
288
|
};
|
|
272
289
|
}
|
|
273
|
-
function
|
|
274
|
-
var a,
|
|
290
|
+
function pe(t) {
|
|
291
|
+
var a, n;
|
|
275
292
|
if (!t.theadElement || !t.colgroupElement) return;
|
|
276
293
|
t.headerListeners.cleanup();
|
|
277
294
|
const e = t.theadElement.getRootNode().activeElement, r = e && t.theadElement.contains(e) ? ((a = e.closest("th")) == null ? void 0 : a.getAttribute("data-coluna")) ?? null : null;
|
|
278
295
|
t.theadElement.innerHTML = "", t.colgroupElement.innerHTML = "";
|
|
279
|
-
const
|
|
280
|
-
if (t.colunas.forEach((
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
const v = t.formatWidth(
|
|
286
|
-
|
|
296
|
+
const o = document.createElement("tr");
|
|
297
|
+
if (t.colunas.forEach((s, d) => {
|
|
298
|
+
const u = document.createElement("col");
|
|
299
|
+
s.largura !== void 0 && (u.style.width = t.formatWidth(s.largura)), t.colgroupElement.appendChild(u);
|
|
300
|
+
const l = document.createElement("th"), p = t.getAlignmentClass(s.alinhamento);
|
|
301
|
+
if (l.className = p, l.setAttribute("part", "celula-cabecalho"), l.scope = "col", l.setAttribute("data-coluna", s.id), l.style.textAlign = t.getTextAlign(s.alinhamento), s.largura !== void 0 && (l.style.width = t.formatWidth(s.largura)), s.larguraMinima !== void 0 && (l.style.minWidth = t.formatWidth(s.larguraMinima)), s.larguraMaxima !== void 0) {
|
|
302
|
+
const v = t.formatWidth(s.larguraMaxima);
|
|
303
|
+
l.style.maxWidth = v, l.style.overflow = "hidden", l.style.textOverflow = "ellipsis", l.style.whiteSpace = "nowrap";
|
|
287
304
|
}
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
const v = () => t.onHeaderClick(
|
|
293
|
-
t.headerListeners.add(
|
|
305
|
+
s.tooltip && (l.title = s.tooltip);
|
|
306
|
+
const c = !!s.ordenavel && t.colunaOrdenada === s.id && t.direcaoOrdenacao !== "original", h = c && t.direcaoOrdenacao === "desc";
|
|
307
|
+
if (s.ordenavel) {
|
|
308
|
+
l.classList.add("ui-tabela__th--ordenavel");
|
|
309
|
+
const v = () => t.onHeaderClick(s);
|
|
310
|
+
t.headerListeners.add(l, "click", v), c && l.setAttribute("aria-sort", h ? "descending" : "ascending");
|
|
294
311
|
}
|
|
295
|
-
const
|
|
296
|
-
t.headerListeners.add(
|
|
312
|
+
const b = (v) => t.onHeaderContextMenu(v, s, d, l);
|
|
313
|
+
t.headerListeners.add(l, "contextmenu", b);
|
|
297
314
|
const x = document.createElement("div");
|
|
298
315
|
x.className = "ui-tabela__header-content";
|
|
299
|
-
const
|
|
300
|
-
|
|
316
|
+
const g = document.createElement("span");
|
|
317
|
+
g.className = "ui-tabela__header-text", g.textContent = s.rotulo, x.appendChild(g);
|
|
301
318
|
const f = document.createElement("span");
|
|
302
|
-
if (f.className = "ui-tabela__sort-icon",
|
|
303
|
-
const v =
|
|
319
|
+
if (f.className = "ui-tabela__sort-icon", s.ordenavel) {
|
|
320
|
+
const v = c ? "" : "ui-tabela__sort-arrow--inativo", A = h ? "ui-tabela__sort-arrow--desc" : "";
|
|
304
321
|
f.setAttribute("aria-hidden", "true"), f.innerHTML = `
|
|
305
|
-
<svg class="ui-tabela__sort-arrow ${v} ${
|
|
322
|
+
<svg class="ui-tabela__sort-arrow ${v} ${A}" viewBox="0 0 24 24">
|
|
306
323
|
<path d="M7 14l5-5 5 5H7z"/>
|
|
307
324
|
</svg>
|
|
308
325
|
`;
|
|
309
326
|
}
|
|
310
|
-
if (x.appendChild(f),
|
|
327
|
+
if (x.appendChild(f), s.ordenavel) {
|
|
311
328
|
const v = document.createElement("button");
|
|
312
|
-
v.type = "button", v.className = "ui-tabela__ordenar", v.setAttribute("part", "ordenar"), v.appendChild(x),
|
|
329
|
+
v.type = "button", v.className = "ui-tabela__ordenar", v.setAttribute("part", "ordenar"), v.appendChild(x), l.appendChild(v);
|
|
313
330
|
} else
|
|
314
|
-
|
|
331
|
+
l.appendChild(x);
|
|
315
332
|
const _ = document.createElement("div");
|
|
316
333
|
_.className = "ui-tabela__resizer", _.title = "Arrastar para redimensionar largura (duplo-clique para auto-ajuste)";
|
|
317
|
-
const E = (v) => t.onInitColumnResize(v,
|
|
334
|
+
const E = (v) => t.onInitColumnResize(v, s, d, l, _);
|
|
318
335
|
t.headerListeners.add(_, "mousedown", E);
|
|
319
|
-
const
|
|
320
|
-
v.stopPropagation(), t.onColumnAutoFit(
|
|
336
|
+
const w = (v) => {
|
|
337
|
+
v.stopPropagation(), t.onColumnAutoFit(s, l, u);
|
|
321
338
|
};
|
|
322
|
-
t.headerListeners.add(_, "dblclick",
|
|
323
|
-
}), t.theadElement.appendChild(
|
|
324
|
-
const
|
|
325
|
-
(
|
|
339
|
+
t.headerListeners.add(_, "dblclick", w), l.appendChild(_), o.appendChild(l);
|
|
340
|
+
}), t.theadElement.appendChild(o), r !== null) {
|
|
341
|
+
const s = Array.from(o.children).find((d) => d.getAttribute("data-coluna") === r);
|
|
342
|
+
(n = s == null ? void 0 : s.querySelector(".ui-tabela__ordenar")) == null || n.focus();
|
|
326
343
|
}
|
|
327
344
|
}
|
|
328
|
-
function
|
|
345
|
+
function he(t) {
|
|
329
346
|
if (!t.tbodyElement || !t.tableElement || !t.emptyElement || !t.containerElement) return;
|
|
330
347
|
if (!t.dadosExibicao || t.dadosExibicao.length === 0) {
|
|
331
348
|
t.emptyElement.style.display = "flex", t.tableElement.style.display = "none";
|
|
332
349
|
return;
|
|
333
350
|
}
|
|
334
351
|
t.emptyElement.style.display = "none", t.tableElement.style.display = "table";
|
|
335
|
-
const
|
|
336
|
-
let
|
|
352
|
+
const i = t.dadosExibicao.length, e = t.rowHeight, r = t.virtualizar && i > 30;
|
|
353
|
+
let o = 0, a = i;
|
|
337
354
|
if (r) {
|
|
338
|
-
const
|
|
339
|
-
|
|
355
|
+
const c = t.containerElement.scrollTop, h = t.containerElement.clientHeight || 400, b = 5;
|
|
356
|
+
o = Math.max(0, Math.floor(c / e) - b), a = Math.min(i, Math.ceil((c + h) / e) + b);
|
|
340
357
|
}
|
|
341
|
-
const
|
|
358
|
+
const s = t.tbodyElement.getRootNode().activeElement, d = s && s.parentElement === t.tbodyElement ? s.getAttribute("data-index") : null, u = t.indiceAtivo ?? null, l = u !== null && u >= o && u < a ? u : o;
|
|
342
359
|
t.tbodyElement.innerHTML = "";
|
|
343
|
-
const
|
|
344
|
-
if (r &&
|
|
345
|
-
const
|
|
346
|
-
|
|
360
|
+
const p = document.createDocumentFragment();
|
|
361
|
+
if (r && o > 0) {
|
|
362
|
+
const c = document.createElement("tr");
|
|
363
|
+
c.className = "ui-tabela__virtual-spacer", c.style.height = `${o * e}px`;
|
|
347
364
|
const h = document.createElement("td");
|
|
348
|
-
h.colSpan = t.colunas.length || 1,
|
|
365
|
+
h.colSpan = t.colunas.length || 1, c.appendChild(h), p.appendChild(c);
|
|
349
366
|
}
|
|
350
|
-
for (let
|
|
351
|
-
const h = t.dadosExibicao[
|
|
352
|
-
|
|
367
|
+
for (let c = o; c < a; c++) {
|
|
368
|
+
const h = t.dadosExibicao[c], b = document.createElement("tr");
|
|
369
|
+
b.setAttribute("data-index", String(c)), b.setAttribute("part", "linha"), b.tabIndex = c === l ? 0 : -1, c % 2 === 1 && b.classList.add("ui-tabela__tr--par");
|
|
353
370
|
const x = t.chaveId;
|
|
354
|
-
h[x] !== void 0 ?
|
|
355
|
-
const f =
|
|
356
|
-
f && f.closest("button, input, select, textarea, a, [data-prevent-select]") || t.onLinhaClique(h,
|
|
357
|
-
}), t.colunas.forEach((
|
|
358
|
-
const f = document.createElement("td"), _ = t.getAlignmentClass(
|
|
359
|
-
if (f.className = _, f.setAttribute("part", "celula"), f.style.textAlign = t.getTextAlign(
|
|
360
|
-
const v = t.formatWidth(
|
|
371
|
+
h[x] !== void 0 ? b.setAttribute("data-id", String(h[x])) : h.id !== void 0 ? b.setAttribute("data-id", String(h.id)) : h._id !== void 0 && b.setAttribute("data-id", String(h._id)), t.isItemSelecionado(h, c) && (b.classList.add("ui-tabela__tr--selecionada"), b.setAttribute("part", "linha linha-selecionada"), b.setAttribute("aria-current", "true"), b.setAttribute("data-selecionada", "true")), b.addEventListener("click", (g) => {
|
|
372
|
+
const f = g.target;
|
|
373
|
+
f && f.closest("button, input, select, textarea, a, [data-prevent-select]") || t.onLinhaClique(h, c);
|
|
374
|
+
}), t.colunas.forEach((g) => {
|
|
375
|
+
const f = document.createElement("td"), _ = t.getAlignmentClass(g.alinhamento);
|
|
376
|
+
if (f.className = _, f.setAttribute("part", "celula"), f.style.textAlign = t.getTextAlign(g.alinhamento), g.larguraMaxima !== void 0) {
|
|
377
|
+
const v = t.formatWidth(g.larguraMaxima);
|
|
361
378
|
f.style.maxWidth = v, f.style.overflow = "hidden", f.style.textOverflow = "ellipsis", f.style.whiteSpace = "nowrap";
|
|
362
379
|
}
|
|
363
380
|
const E = document.createElement("div");
|
|
364
|
-
E.className = "ui-tabela__cell-content",
|
|
365
|
-
const
|
|
366
|
-
if (typeof
|
|
367
|
-
const v =
|
|
381
|
+
E.className = "ui-tabela__cell-content", g.larguraMaxima !== void 0 && E.classList.add("ui-tabela__cell-truncate");
|
|
382
|
+
const w = h[g.id];
|
|
383
|
+
if (typeof g.render == "function") {
|
|
384
|
+
const v = g.render(w, h, c);
|
|
368
385
|
v instanceof Node ? E.appendChild(v) : E.textContent = String(v ?? "");
|
|
369
|
-
} else if (
|
|
370
|
-
E.appendChild(
|
|
386
|
+
} else if (w instanceof Node)
|
|
387
|
+
E.appendChild(w);
|
|
371
388
|
else {
|
|
372
|
-
const v =
|
|
373
|
-
E.textContent = v,
|
|
389
|
+
const v = w != null ? String(w) : "";
|
|
390
|
+
E.textContent = v, g.larguraMaxima !== void 0 && !g.tooltip && (f.title = v);
|
|
374
391
|
}
|
|
375
|
-
f.appendChild(E),
|
|
376
|
-
}),
|
|
392
|
+
f.appendChild(E), b.appendChild(f);
|
|
393
|
+
}), p.appendChild(b);
|
|
377
394
|
}
|
|
378
|
-
if (r && a <
|
|
379
|
-
const
|
|
380
|
-
|
|
395
|
+
if (r && a < i) {
|
|
396
|
+
const c = document.createElement("tr");
|
|
397
|
+
c.className = "ui-tabela__virtual-spacer", c.style.height = `${(i - a) * e}px`;
|
|
381
398
|
const h = document.createElement("td");
|
|
382
|
-
h.colSpan = t.colunas.length || 1,
|
|
399
|
+
h.colSpan = t.colunas.length || 1, c.appendChild(h), p.appendChild(c);
|
|
383
400
|
}
|
|
384
|
-
if (t.tbodyElement.appendChild(
|
|
385
|
-
const
|
|
386
|
-
|
|
401
|
+
if (t.tbodyElement.appendChild(p), d !== null) {
|
|
402
|
+
const c = t.tbodyElement.querySelector(`tr[data-index="${d}"]`);
|
|
403
|
+
c == null || c.focus({ preventScroll: !0 });
|
|
387
404
|
}
|
|
388
405
|
}
|
|
389
|
-
function
|
|
406
|
+
function me(t) {
|
|
390
407
|
const {
|
|
391
|
-
evento:
|
|
408
|
+
evento: i,
|
|
392
409
|
coluna: e,
|
|
393
410
|
colIndex: r,
|
|
394
|
-
thElement:
|
|
411
|
+
thElement: o,
|
|
395
412
|
resizer: a,
|
|
396
|
-
colgroupElement:
|
|
397
|
-
onResizeStart:
|
|
413
|
+
colgroupElement: n,
|
|
414
|
+
onResizeStart: s,
|
|
398
415
|
onResizeEnd: d
|
|
399
416
|
} = t;
|
|
400
|
-
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
let f =
|
|
417
|
+
i.stopPropagation(), i.preventDefault(), s(), a.classList.add("ui-tabela__resizer--ativo");
|
|
418
|
+
const u = i.pageX, l = o.offsetWidth, p = n == null ? void 0 : n.children[r], c = (x) => {
|
|
419
|
+
const g = x.pageX - u;
|
|
420
|
+
let f = l + g;
|
|
404
421
|
if (e.larguraMinima !== void 0) {
|
|
405
422
|
const _ = typeof e.larguraMinima == "number" ? e.larguraMinima : parseInt(e.larguraMinima, 10);
|
|
406
423
|
isNaN(_) || (f = Math.max(_, f));
|
|
@@ -410,68 +427,68 @@ function Y(t) {
|
|
|
410
427
|
const _ = typeof e.larguraMaxima == "number" ? e.larguraMaxima : parseInt(e.larguraMaxima, 10);
|
|
411
428
|
isNaN(_) || (f = Math.min(_, f));
|
|
412
429
|
}
|
|
413
|
-
e.largura = `${f}px`,
|
|
430
|
+
e.largura = `${f}px`, o.style.width = `${f}px`, p && (p.style.width = `${f}px`);
|
|
414
431
|
}, h = () => {
|
|
415
|
-
|
|
416
|
-
},
|
|
417
|
-
a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener("mousemove",
|
|
432
|
+
b(), d(String(e.largura));
|
|
433
|
+
}, b = () => {
|
|
434
|
+
a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", h);
|
|
418
435
|
};
|
|
419
|
-
return window.addEventListener("mousemove",
|
|
436
|
+
return window.addEventListener("mousemove", c), window.addEventListener("mouseup", h), b;
|
|
420
437
|
}
|
|
421
|
-
function
|
|
438
|
+
function ge(t) {
|
|
422
439
|
const {
|
|
423
|
-
evento:
|
|
440
|
+
evento: i,
|
|
424
441
|
coluna: e,
|
|
425
442
|
colIndex: r,
|
|
426
|
-
thElement:
|
|
443
|
+
thElement: o,
|
|
427
444
|
colgroupElement: a,
|
|
428
|
-
shadow:
|
|
429
|
-
onResizeEnd:
|
|
445
|
+
shadow: n,
|
|
446
|
+
onResizeEnd: s
|
|
430
447
|
} = t, d = document.createElement("dialog");
|
|
431
|
-
d.className = "ui-tabela__prompt-dialog", d.style.position = "fixed", d.style.left = `${
|
|
432
|
-
const p = document.createElement("div");
|
|
433
|
-
p.className = "ui-tabela__prompt-title", p.textContent = `Largura para "${e.rotulo}" (px ou auto):`;
|
|
434
|
-
const s = document.createElement("input");
|
|
435
|
-
s.type = "text";
|
|
436
|
-
const c = e.largura ? String(e.largura).replace("px", "") : "auto";
|
|
437
|
-
s.value = c;
|
|
448
|
+
d.className = "ui-tabela__prompt-dialog", d.style.position = "fixed", d.style.left = `${i.clientX}px`, d.style.top = `${i.clientY}px`;
|
|
438
449
|
const u = document.createElement("div");
|
|
439
|
-
u.className = "ui-tabela__prompt-
|
|
450
|
+
u.className = "ui-tabela__prompt-title", u.textContent = `Largura para "${e.rotulo}" (px ou auto):`;
|
|
451
|
+
const l = document.createElement("input");
|
|
452
|
+
l.type = "text";
|
|
453
|
+
const p = e.largura ? String(e.largura).replace("px", "") : "auto";
|
|
454
|
+
l.value = p;
|
|
455
|
+
const c = document.createElement("div");
|
|
456
|
+
c.className = "ui-tabela__prompt-actions";
|
|
440
457
|
const h = document.createElement("button");
|
|
441
458
|
h.textContent = "Aplicar";
|
|
442
|
-
const
|
|
443
|
-
|
|
459
|
+
const b = document.createElement("button");
|
|
460
|
+
b.textContent = "Cancelar", c.appendChild(b), c.appendChild(h), d.appendChild(u), d.appendChild(l), d.appendChild(c), n.appendChild(d), d.showModal();
|
|
444
461
|
const x = () => {
|
|
445
|
-
const f =
|
|
462
|
+
const f = l.value.trim().toLowerCase();
|
|
446
463
|
if (f === "" || f === "auto")
|
|
447
|
-
e.largura = void 0,
|
|
464
|
+
e.largura = void 0, o.style.width = "", a != null && a.children[r] && (a.children[r].style.width = "");
|
|
448
465
|
else {
|
|
449
466
|
const _ = parseInt(f, 10);
|
|
450
|
-
!isNaN(_) && _ > 20 && (e.largura = `${_}px`,
|
|
467
|
+
!isNaN(_) && _ > 20 && (e.largura = `${_}px`, o.style.width = `${_}px`, a != null && a.children[r] && (a.children[r].style.width = `${_}px`));
|
|
451
468
|
}
|
|
452
|
-
d.close(), d.remove(),
|
|
469
|
+
d.close(), d.remove(), s(e.largura ? String(e.largura) : "auto");
|
|
453
470
|
};
|
|
454
|
-
h.addEventListener("click", (
|
|
455
|
-
|
|
456
|
-
}),
|
|
457
|
-
|
|
458
|
-
}),
|
|
459
|
-
|
|
460
|
-
}), setTimeout(() =>
|
|
461
|
-
}
|
|
462
|
-
function
|
|
463
|
-
return
|
|
471
|
+
h.addEventListener("click", (g) => {
|
|
472
|
+
g.stopPropagation(), x();
|
|
473
|
+
}), b.addEventListener("click", (g) => {
|
|
474
|
+
g.stopPropagation(), d.close(), d.remove();
|
|
475
|
+
}), l.addEventListener("keydown", (g) => {
|
|
476
|
+
g.key === "Enter" ? (g.preventDefault(), x()) : g.key === "Escape" && (g.preventDefault(), d.close(), d.remove());
|
|
477
|
+
}), setTimeout(() => l.focus(), 10);
|
|
478
|
+
}
|
|
479
|
+
function be(t, i, e, r, o, a) {
|
|
480
|
+
return me({
|
|
464
481
|
evento: t,
|
|
465
|
-
coluna:
|
|
482
|
+
coluna: i,
|
|
466
483
|
colIndex: e,
|
|
467
484
|
thElement: r,
|
|
468
|
-
resizer:
|
|
485
|
+
resizer: o,
|
|
469
486
|
colgroupElement: a.colgroupElement,
|
|
470
487
|
onResizeStart: () => a.onSetIsResizing(!0),
|
|
471
|
-
onResizeEnd: (
|
|
488
|
+
onResizeEnd: (n) => {
|
|
472
489
|
setTimeout(() => a.onSetIsResizing(!1), 50), a.host.dispatchEvent(
|
|
473
490
|
new CustomEvent("ui-column-resize", {
|
|
474
|
-
detail: { idColuna:
|
|
491
|
+
detail: { idColuna: i.id, largura: n },
|
|
475
492
|
bubbles: !0,
|
|
476
493
|
composed: !0
|
|
477
494
|
})
|
|
@@ -479,18 +496,18 @@ function K(t, o, e, r, i, a) {
|
|
|
479
496
|
}
|
|
480
497
|
});
|
|
481
498
|
}
|
|
482
|
-
function
|
|
483
|
-
t.preventDefault(), t.stopPropagation(),
|
|
499
|
+
function fe(t, i, e, r, o) {
|
|
500
|
+
t.preventDefault(), t.stopPropagation(), ge({
|
|
484
501
|
evento: t,
|
|
485
|
-
coluna:
|
|
502
|
+
coluna: i,
|
|
486
503
|
colIndex: e,
|
|
487
504
|
thElement: r,
|
|
488
|
-
colgroupElement:
|
|
489
|
-
shadow:
|
|
505
|
+
colgroupElement: o.colgroupElement,
|
|
506
|
+
shadow: o.shadow,
|
|
490
507
|
onResizeEnd: (a) => {
|
|
491
|
-
|
|
508
|
+
o.host.dispatchEvent(
|
|
492
509
|
new CustomEvent("ui-column-resize", {
|
|
493
|
-
detail: { idColuna:
|
|
510
|
+
detail: { idColuna: i.id, largura: a },
|
|
494
511
|
bubbles: !0,
|
|
495
512
|
composed: !0
|
|
496
513
|
})
|
|
@@ -498,48 +515,48 @@ function Q(t, o, e, r, i) {
|
|
|
498
515
|
}
|
|
499
516
|
});
|
|
500
517
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
518
|
+
function xe(t) {
|
|
519
|
+
pe({
|
|
503
520
|
theadElement: t.theadElement,
|
|
504
521
|
colgroupElement: t.colgroupElement,
|
|
505
522
|
colunas: t.colunas,
|
|
506
523
|
colunaOrdenada: t.dadosController.getColunaOrdenada(),
|
|
507
524
|
direcaoOrdenacao: t.dadosController.getDirecaoOrdenacao(),
|
|
508
525
|
headerListeners: t.headerListeners,
|
|
509
|
-
formatWidth:
|
|
510
|
-
getAlignmentClass:
|
|
511
|
-
getTextAlign:
|
|
512
|
-
onHeaderClick: (
|
|
513
|
-
onHeaderContextMenu: (
|
|
514
|
-
|
|
526
|
+
formatWidth: $,
|
|
527
|
+
getAlignmentClass: W,
|
|
528
|
+
getTextAlign: U,
|
|
529
|
+
onHeaderClick: (i) => t.onHeaderClick(i),
|
|
530
|
+
onHeaderContextMenu: (i, e, r, o) => {
|
|
531
|
+
fe(i, e, r, o, {
|
|
515
532
|
host: t.host,
|
|
516
533
|
colgroupElement: t.colgroupElement,
|
|
517
534
|
shadow: t.shadow,
|
|
518
535
|
onSetIsResizing: t.onSetIsResizing
|
|
519
536
|
});
|
|
520
537
|
},
|
|
521
|
-
onInitColumnResize: (
|
|
522
|
-
const
|
|
538
|
+
onInitColumnResize: (i, e, r, o, a) => {
|
|
539
|
+
const n = be(i, e, r, o, a, {
|
|
523
540
|
host: t.host,
|
|
524
541
|
colgroupElement: t.colgroupElement,
|
|
525
542
|
shadow: t.shadow,
|
|
526
543
|
onSetIsResizing: t.onSetIsResizing
|
|
527
544
|
});
|
|
528
|
-
t.onActiveResizeCleanup(
|
|
545
|
+
t.onActiveResizeCleanup(n);
|
|
529
546
|
},
|
|
530
|
-
onColumnAutoFit: (
|
|
531
|
-
|
|
547
|
+
onColumnAutoFit: (i, e, r) => {
|
|
548
|
+
i.largura = void 0, e.style.width = "", r.style.width = "", t.host.dispatchEvent(
|
|
532
549
|
new CustomEvent("ui-column-resize", {
|
|
533
550
|
bubbles: !0,
|
|
534
551
|
composed: !0,
|
|
535
|
-
detail: { idColuna:
|
|
552
|
+
detail: { idColuna: i.id, largura: "auto" }
|
|
536
553
|
})
|
|
537
554
|
);
|
|
538
555
|
}
|
|
539
556
|
});
|
|
540
557
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
558
|
+
function ve(t) {
|
|
559
|
+
he({
|
|
543
560
|
tbodyElement: t.tbodyElement,
|
|
544
561
|
tableElement: t.tableElement,
|
|
545
562
|
emptyElement: t.emptyElement,
|
|
@@ -550,55 +567,57 @@ function J(t) {
|
|
|
550
567
|
virtualizar: t.virtualizar,
|
|
551
568
|
rowHeight: t.rowHeight,
|
|
552
569
|
indiceAtivo: t.indiceAtivo,
|
|
553
|
-
isItemSelecionado: (
|
|
554
|
-
onLinhaClique: (
|
|
555
|
-
t.selecaoController.setItemSelecionado(
|
|
570
|
+
isItemSelecionado: (i, e) => t.selecaoController.isItemSelecionado(i, e),
|
|
571
|
+
onLinhaClique: (i, e) => {
|
|
572
|
+
t.selecaoController.setItemSelecionado(i), t.host.dispatchEvent(
|
|
556
573
|
new CustomEvent("ui-linha-clique", {
|
|
557
574
|
bubbles: !0,
|
|
558
575
|
composed: !0,
|
|
559
|
-
detail: { item:
|
|
576
|
+
detail: { item: i, indice: e }
|
|
560
577
|
})
|
|
561
578
|
);
|
|
562
579
|
},
|
|
563
|
-
formatWidth:
|
|
564
|
-
getAlignmentClass:
|
|
565
|
-
getTextAlign:
|
|
580
|
+
formatWidth: $,
|
|
581
|
+
getAlignmentClass: W,
|
|
582
|
+
getTextAlign: U
|
|
566
583
|
});
|
|
567
584
|
}
|
|
568
|
-
function
|
|
585
|
+
function _e(t, i) {
|
|
569
586
|
let e = !1;
|
|
570
587
|
const r = () => {
|
|
571
588
|
e || (window.requestAnimationFrame(() => {
|
|
572
|
-
|
|
589
|
+
i(), e = !1;
|
|
573
590
|
}), e = !0);
|
|
574
591
|
};
|
|
575
592
|
return t.addEventListener("scroll", r), r;
|
|
576
593
|
}
|
|
577
|
-
function
|
|
578
|
-
return
|
|
594
|
+
function Ee(t, i, e, r) {
|
|
595
|
+
return ue(t, i, e, r);
|
|
579
596
|
}
|
|
580
|
-
function
|
|
581
|
-
const
|
|
582
|
-
|
|
597
|
+
function X(t) {
|
|
598
|
+
const i = t.host.getAttribute("texto-vazio") || t.host.getAttribute("empty-text");
|
|
599
|
+
i && t.onTextoVazioAlterado(i);
|
|
583
600
|
const e = t.host.getAttribute("virtualizar") || t.host.getAttribute("virtualize");
|
|
584
|
-
e !== null && t.onVirtualizarAlterado(e !== "false");
|
|
585
|
-
const r = t.host.
|
|
586
|
-
r && t.
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
601
|
+
e !== null && t.onVirtualizarAlterado(e !== "false"), t.onSrcLido(t.host.getAttribute("src"));
|
|
602
|
+
const r = t.host.hasAttribute("carregando") || t.host.hasAttribute("loading");
|
|
603
|
+
t.onCarregandoAlterado(r), t.loadingElement && (t.loadingElement.style.display = r ? "flex" : "none");
|
|
604
|
+
}
|
|
605
|
+
function we(t, i, e) {
|
|
606
|
+
if (X(e), t === "src") {
|
|
607
|
+
i && e.host.isConnected && e.onCarregarSrc(i);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (t === "max-height" && e.containerElement) {
|
|
611
|
+
e.containerElement.style.maxHeight = i || "";
|
|
593
612
|
return;
|
|
594
613
|
}
|
|
595
614
|
if ((t === "texto-vazio" || t === "empty-text") && e.emptyElement) {
|
|
596
615
|
const r = e.emptyElement.querySelector(".ui-tabela__empty-text");
|
|
597
|
-
r &&
|
|
616
|
+
r && i && (r.textContent = i), e.onRenderBody();
|
|
598
617
|
return;
|
|
599
618
|
}
|
|
600
619
|
if (t === "carregando" || t === "loading") {
|
|
601
|
-
e.loadingElement && (e.loadingElement.style.display =
|
|
620
|
+
e.loadingElement && (e.loadingElement.style.display = i !== null ? "flex" : "none");
|
|
602
621
|
return;
|
|
603
622
|
}
|
|
604
623
|
if (t === "densidade" || t === "density") {
|
|
@@ -607,66 +626,68 @@ function oe(t, o, e) {
|
|
|
607
626
|
}
|
|
608
627
|
e.onRenderTotal();
|
|
609
628
|
}
|
|
610
|
-
class
|
|
629
|
+
class ye extends j {
|
|
611
630
|
constructor() {
|
|
612
631
|
super();
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
632
|
+
m(this, "shadow");
|
|
633
|
+
m(this, "_colunas", []);
|
|
634
|
+
m(this, "_textoVazio", "Nenhum registro encontrado");
|
|
635
|
+
m(this, "_virtualizar", !0);
|
|
636
|
+
m(this, "_isResizing", !1);
|
|
637
|
+
m(this, "_carregando", !1);
|
|
638
|
+
m(this, "_src", null);
|
|
639
|
+
m(this, "_containerElement", null);
|
|
640
|
+
m(this, "_tableElement", null);
|
|
641
|
+
m(this, "_theadElement", null);
|
|
642
|
+
m(this, "_tbodyElement", null);
|
|
643
|
+
m(this, "_colgroupElement", null);
|
|
644
|
+
m(this, "_emptyElement", null);
|
|
645
|
+
m(this, "_loadingElement", null);
|
|
646
|
+
m(this, "_scrollHandler", null);
|
|
647
|
+
m(this, "_activeResizeCleanup", null);
|
|
648
|
+
m(this, "_headerListeners", new B());
|
|
649
|
+
m(this, "_corpoListeners", new B());
|
|
631
650
|
/** Linha com o foco móvel (navegação por teclado); null = primeira linha visível. */
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
651
|
+
m(this, "_indiceAtivo", null);
|
|
652
|
+
/** Altura real das linhas medida no DOM; null = usa a estimativa da densidade. */
|
|
653
|
+
m(this, "_alturaLinhaMedida", null);
|
|
654
|
+
/** Cancela a correção pendente de uma rolagem suave anterior. */
|
|
655
|
+
m(this, "_cancelarCorrecaoRolagem", null);
|
|
656
|
+
m(this, "remotaController");
|
|
657
|
+
m(this, "selecaoController");
|
|
658
|
+
m(this, "dadosController", new de());
|
|
636
659
|
/** Mantém um único tabindex=0 (foco móvel): Tab entra na tabela pela última linha ativa. */
|
|
637
|
-
|
|
660
|
+
m(this, "handleFocoLinha", (e) => {
|
|
638
661
|
const r = e.target;
|
|
639
|
-
r.parentElement !== this._tbodyElement || !r.hasAttribute("data-index") ||
|
|
640
|
-
i !== r && (i.tabIndex = -1);
|
|
641
|
-
}), r.tabIndex = 0);
|
|
662
|
+
r.parentElement !== this._tbodyElement || !r.hasAttribute("data-index") || this.definirLinhaAtiva(Number(r.getAttribute("data-index")));
|
|
642
663
|
});
|
|
643
664
|
/**
|
|
644
665
|
* Teclado nas linhas: setas, Home/End e PageUp/PageDown movem o foco;
|
|
645
666
|
* Enter/Espaço selecionam a linha (mesmo caminho do clique, emite `ui-linha-clique`).
|
|
646
667
|
*/
|
|
647
|
-
|
|
668
|
+
m(this, "handleTecladoCorpo", (e) => {
|
|
648
669
|
const r = e.target;
|
|
649
670
|
if (r.parentElement !== this._tbodyElement || !r.hasAttribute("data-index")) return;
|
|
650
|
-
const
|
|
651
|
-
let
|
|
671
|
+
const o = Number(r.getAttribute("data-index")), a = this.dadosController.getDadosExibicao().length - 1;
|
|
672
|
+
let n;
|
|
652
673
|
switch (e.key) {
|
|
653
674
|
case "ArrowDown":
|
|
654
|
-
|
|
675
|
+
n = Math.min(a, o + 1);
|
|
655
676
|
break;
|
|
656
677
|
case "ArrowUp":
|
|
657
|
-
|
|
678
|
+
n = Math.max(0, o - 1);
|
|
658
679
|
break;
|
|
659
680
|
case "Home":
|
|
660
|
-
|
|
681
|
+
n = 0;
|
|
661
682
|
break;
|
|
662
683
|
case "End":
|
|
663
|
-
|
|
684
|
+
n = a;
|
|
664
685
|
break;
|
|
665
686
|
case "PageDown":
|
|
666
|
-
|
|
687
|
+
n = Math.min(a, o + this.linhasPorPagina());
|
|
667
688
|
break;
|
|
668
689
|
case "PageUp":
|
|
669
|
-
|
|
690
|
+
n = Math.max(0, o - this.linhasPorPagina());
|
|
670
691
|
break;
|
|
671
692
|
case "Enter":
|
|
672
693
|
case " ":
|
|
@@ -675,9 +696,9 @@ class re extends M {
|
|
|
675
696
|
default:
|
|
676
697
|
return;
|
|
677
698
|
}
|
|
678
|
-
e.preventDefault(), this.focarLinha(
|
|
699
|
+
e.preventDefault(), this.focarLinha(n);
|
|
679
700
|
});
|
|
680
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new
|
|
701
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new ie({
|
|
681
702
|
host: this,
|
|
682
703
|
onCarregandoAlterado: (e) => {
|
|
683
704
|
this.carregando = e;
|
|
@@ -685,27 +706,27 @@ class re extends M {
|
|
|
685
706
|
onDadosRecebidos: (e) => {
|
|
686
707
|
this.dados = e;
|
|
687
708
|
}
|
|
688
|
-
}), this.selecaoController = new
|
|
709
|
+
}), this.selecaoController = new ne({
|
|
689
710
|
host: this,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
711
|
+
getTbody: () => this._tbodyElement,
|
|
712
|
+
getDadosExibicao: () => this.dadosController.getDadosExibicao(),
|
|
713
|
+
getDadosOriginais: () => this.dadosController.getDadosOriginais(),
|
|
714
|
+
getChaveId: () => this.chaveId,
|
|
715
|
+
onRolarParaIndice: (e, r) => this.posicionarLinha(e, r),
|
|
716
|
+
onLinhaAtiva: (e) => this.definirLinhaAtiva(e)
|
|
696
717
|
});
|
|
697
718
|
}
|
|
698
719
|
static get observedAttributes() {
|
|
699
|
-
return ["texto-vazio", "empty-text", "max-height", "densidade", "density", "virtualizar", "virtualize", "src", "carregando", "loading", "chave-id", "id-key", "aria-label"];
|
|
720
|
+
return ["texto-vazio", "empty-text", "max-height", "densidade", "density", "altura-linha", "row-height", "virtualizar", "virtualize", "src", "carregando", "loading", "chave-id", "id-key", "aria-label"];
|
|
700
721
|
}
|
|
701
722
|
connectedCallback() {
|
|
702
|
-
this.syncAttributes(), !this.hasAttribute("densidade") && !this.hasAttribute("density") && this.setAttribute("densidade", "normal"), this.renderTotal(), this._src && this.remotaController.carregar(this._src);
|
|
723
|
+
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);
|
|
703
724
|
}
|
|
704
725
|
disconnectedCallback() {
|
|
705
726
|
this.cleanupEventListeners();
|
|
706
727
|
}
|
|
707
|
-
attributeChangedCallback(e, r,
|
|
708
|
-
|
|
728
|
+
attributeChangedCallback(e, r, o) {
|
|
729
|
+
(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(), we(e, o, this.obterContextoAtributos()), this.sincronizarAria();
|
|
709
730
|
}
|
|
710
731
|
/** Nome acessível vem do host (`aria-label`); `aria-busy` acompanha o carregamento remoto. */
|
|
711
732
|
sincronizarAria() {
|
|
@@ -714,7 +735,7 @@ class re extends M {
|
|
|
714
735
|
e ? this._tableElement.setAttribute("aria-label", e) : this._tableElement.removeAttribute("aria-label"), this._tableElement.setAttribute("aria-busy", String(this._carregando));
|
|
715
736
|
}
|
|
716
737
|
syncAttributes() {
|
|
717
|
-
|
|
738
|
+
X(this.obterContextoAtributos());
|
|
718
739
|
}
|
|
719
740
|
obterContextoAtributos() {
|
|
720
741
|
return {
|
|
@@ -728,8 +749,11 @@ class re extends M {
|
|
|
728
749
|
onVirtualizarAlterado: (e) => {
|
|
729
750
|
this._virtualizar = e;
|
|
730
751
|
},
|
|
752
|
+
onSrcLido: (e) => {
|
|
753
|
+
this._src = e;
|
|
754
|
+
},
|
|
731
755
|
onCarregarSrc: (e) => {
|
|
732
|
-
this.
|
|
756
|
+
this.remotaController.carregar(e);
|
|
733
757
|
},
|
|
734
758
|
onCarregandoAlterado: (e) => {
|
|
735
759
|
this._carregando = e;
|
|
@@ -742,7 +766,7 @@ class re extends M {
|
|
|
742
766
|
return this._src;
|
|
743
767
|
}
|
|
744
768
|
set src(e) {
|
|
745
|
-
this._src = e, e ?
|
|
769
|
+
this._src = e, e ? this.setAttribute("src", e) : this.removeAttribute("src");
|
|
746
770
|
}
|
|
747
771
|
get carregando() {
|
|
748
772
|
return this._carregando;
|
|
@@ -754,19 +778,20 @@ class re extends M {
|
|
|
754
778
|
await this.remotaController.carregar(e || this._src || "");
|
|
755
779
|
}
|
|
756
780
|
async recarregar() {
|
|
757
|
-
this._src ? await this.remotaController.carregar(this._src) : (this.dadosController.aplicarOrdenacao(), this.renderBody());
|
|
781
|
+
this._src ? await this.remotaController.carregar(this._src) : (this.dadosController.aplicarOrdenacao(), this.atualizarContextoSelecao(), this.renderBody());
|
|
758
782
|
}
|
|
759
783
|
filtrar(e) {
|
|
760
784
|
this.dadosController.filtrar(e), this.atualizarContextoSelecao(), this.renderBody();
|
|
761
785
|
}
|
|
762
786
|
cleanupEventListeners() {
|
|
763
|
-
|
|
787
|
+
var e;
|
|
788
|
+
this._containerElement && this._scrollHandler && (this._containerElement.removeEventListener("scroll", this._scrollHandler), this._scrollHandler = null), this._activeResizeCleanup && (this._activeResizeCleanup(), this._activeResizeCleanup = null), (e = this._cancelarCorrecaoRolagem) == null || e.call(this), this.remotaController.abortar(), this._headerListeners.cleanup(), this._corpoListeners.cleanup();
|
|
764
789
|
}
|
|
765
790
|
get colunas() {
|
|
766
791
|
return this._colunas;
|
|
767
792
|
}
|
|
768
793
|
set colunas(e) {
|
|
769
|
-
this._colunas = Array.isArray(e) ? e : [], this.renderTotal();
|
|
794
|
+
this._colunas = Array.isArray(e) ? e : [], this.dadosController.setColunasFiltro(this._colunas.map((r) => r.id)), this._alturaLinhaMedida = null, this.renderTotal();
|
|
770
795
|
}
|
|
771
796
|
get dados() {
|
|
772
797
|
return this.dadosController.getDadosOriginais();
|
|
@@ -818,13 +843,13 @@ class re extends M {
|
|
|
818
843
|
return this.dadosController.getColunaOrdenada();
|
|
819
844
|
}
|
|
820
845
|
set colunaOrdenada(e) {
|
|
821
|
-
this.dadosController.setColunaOrdenada(e), this.renderHeader(), this.renderBody();
|
|
846
|
+
this.dadosController.setColunaOrdenada(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
822
847
|
}
|
|
823
848
|
get direcaoOrdenacao() {
|
|
824
849
|
return this.dadosController.getDirecaoOrdenacao();
|
|
825
850
|
}
|
|
826
851
|
set direcaoOrdenacao(e) {
|
|
827
|
-
this.dadosController.setDirecaoOrdenacao(e), this.renderHeader(), this.renderBody();
|
|
852
|
+
this.dadosController.setDirecaoOrdenacao(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
|
|
828
853
|
}
|
|
829
854
|
get textoVazio() {
|
|
830
855
|
return this._textoVazio;
|
|
@@ -837,21 +862,42 @@ class re extends M {
|
|
|
837
862
|
const r = this.dadosController.alternarOrdenacaoColuna(e);
|
|
838
863
|
r && (this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody(), this.dispatchEvent(new CustomEvent("ui-sort", { detail: r, bubbles: !0, composed: !0 })));
|
|
839
864
|
}
|
|
865
|
+
/** Altura fixa das linhas em px (`altura-linha`), sobrepõe a densidade; null = vale a densidade. */
|
|
866
|
+
get alturaLinha() {
|
|
867
|
+
const e = this.getAttribute("altura-linha") ?? this.getAttribute("row-height"), r = e === null ? NaN : parseFloat(e);
|
|
868
|
+
return Number.isFinite(r) && r > 0 ? r : null;
|
|
869
|
+
}
|
|
870
|
+
set alturaLinha(e) {
|
|
871
|
+
e && e > 0 ? this.setAttribute("altura-linha", String(e)) : (this.removeAttribute("altura-linha"), this.removeAttribute("row-height"));
|
|
872
|
+
}
|
|
873
|
+
/** Publica a altura fixa como variável CSS (usada pelo estilo `:host([altura-linha])`). */
|
|
874
|
+
aplicarAlturaLinha() {
|
|
875
|
+
const e = this.alturaLinha;
|
|
876
|
+
e ? this.style.setProperty("--ui-tabela-altura-linha", `${e}px`) : this.style.removeProperty("--ui-tabela-altura-linha"), this.renderBody();
|
|
877
|
+
}
|
|
878
|
+
/** Altura usada na virtualização: a fixa (`altura-linha`), a medida no DOM ou a estimativa da densidade. */
|
|
840
879
|
getRowHeight() {
|
|
841
|
-
return
|
|
880
|
+
return this.alturaLinha ?? this._alturaLinhaMedida ?? O(this.densidade);
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Mede a altura real das linhas uma vez por configuração (densidade/colunas): padding, fonte e
|
|
884
|
+
* renderizadores customizados mudam a altura, e a estimativa fixa desalinharia a janela virtual.
|
|
885
|
+
* Não remede a cada rolagem para os espaçadores não "pularem" com linhas de alturas diferentes.
|
|
886
|
+
*/
|
|
887
|
+
medirAlturaLinha() {
|
|
888
|
+
if (this._alturaLinhaMedida !== null || !this._tbodyElement) return;
|
|
889
|
+
const e = this._tbodyElement.querySelectorAll("tr[data-index]");
|
|
890
|
+
if (e.length === 0) return;
|
|
891
|
+
let r = 0;
|
|
892
|
+
e.forEach((a) => {
|
|
893
|
+
r += a.getBoundingClientRect().height;
|
|
894
|
+
});
|
|
895
|
+
const o = r / e.length;
|
|
896
|
+
o <= 0 || (this._alturaLinhaMedida = o, Math.abs(o - O(this.densidade)) > 0.5 && this.renderBody());
|
|
842
897
|
}
|
|
898
|
+
/** Ordenar, filtrar, trocar os dados ou a chave mantém a linha selecionada (se ainda existir). */
|
|
843
899
|
atualizarContextoSelecao() {
|
|
844
|
-
|
|
845
|
-
const e = ((r = this.selecaoController) == null ? void 0 : r.getItemSelecionado()) ?? null;
|
|
846
|
-
this.selecaoController = new A({
|
|
847
|
-
host: this,
|
|
848
|
-
tbodyElement: this._tbodyElement,
|
|
849
|
-
containerElement: this._containerElement,
|
|
850
|
-
dadosExibicao: this.dadosController.getDadosExibicao(),
|
|
851
|
-
chaveId: this.chaveId,
|
|
852
|
-
getRowHeight: () => this.getRowHeight(),
|
|
853
|
-
onRenderBody: () => this.renderBody()
|
|
854
|
-
}), e && this.selecaoController.restaurarSelecao(e), this._indiceAtivo = this.selecaoController.getIndiceSelecionado();
|
|
900
|
+
this.selecaoController.reconciliar(), this._indiceAtivo = this.selecaoController.getIndiceSelecionado();
|
|
855
901
|
}
|
|
856
902
|
renderTotal() {
|
|
857
903
|
if (this.shadow) {
|
|
@@ -862,29 +908,83 @@ class re extends M {
|
|
|
862
908
|
}
|
|
863
909
|
} else {
|
|
864
910
|
this.cleanupEventListeners();
|
|
865
|
-
const e =
|
|
866
|
-
this._containerElement = e.containerElement, this._tableElement = e.tableElement, this._colgroupElement = e.colgroupElement, this._theadElement = e.theadElement, this._tbodyElement = e.tbodyElement, this._emptyElement = e.emptyElement, this._loadingElement = e.loadingElement
|
|
911
|
+
const e = Ee(this.shadow, this._textoVazio, this.getAttribute("max-height"), this._carregando);
|
|
912
|
+
this._containerElement = e.containerElement, this._tableElement = e.tableElement, this._colgroupElement = e.colgroupElement, this._theadElement = e.theadElement, this._tbodyElement = e.tbodyElement, this._emptyElement = e.emptyElement, this._loadingElement = e.loadingElement;
|
|
867
913
|
}
|
|
868
|
-
this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler =
|
|
914
|
+
this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler = _e(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();
|
|
869
915
|
}
|
|
870
916
|
}
|
|
917
|
+
definirLinhaAtiva(e) {
|
|
918
|
+
this._indiceAtivo = e;
|
|
919
|
+
const r = this._tbodyElement, o = r == null ? void 0 : r.querySelector(`tr[data-index="${e}"]`);
|
|
920
|
+
!r || !o || (r.querySelectorAll('tr[tabindex="0"]').forEach((a) => {
|
|
921
|
+
a !== o && (a.tabIndex = -1);
|
|
922
|
+
}), o.tabIndex = 0);
|
|
923
|
+
}
|
|
871
924
|
linhasPorPagina() {
|
|
872
|
-
var r,
|
|
873
|
-
const e = (((r = this._containerElement) == null ? void 0 : r.clientHeight) ?? 0) - (((
|
|
925
|
+
var r, o;
|
|
926
|
+
const e = (((r = this._containerElement) == null ? void 0 : r.clientHeight) ?? 0) - (((o = this._theadElement) == null ? void 0 : o.offsetHeight) ?? 0);
|
|
874
927
|
return Math.max(1, Math.floor(e / this.getRowHeight()));
|
|
875
928
|
}
|
|
876
929
|
/** Foca a linha, renderizando a janela virtual se necessário, e a mantém visível abaixo do cabeçalho fixo. */
|
|
877
930
|
focarLinha(e) {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
if (!r || !i) return;
|
|
931
|
+
const r = this._containerElement, o = this._tbodyElement;
|
|
932
|
+
if (!r || !o) return;
|
|
881
933
|
this._indiceAtivo = e;
|
|
882
934
|
const a = `tr[data-index="${e}"]`;
|
|
883
|
-
let
|
|
884
|
-
if (
|
|
885
|
-
|
|
886
|
-
const
|
|
887
|
-
|
|
935
|
+
let n = o.querySelector(a);
|
|
936
|
+
if (n || (r.scrollTop = Math.max(0, e * this.getRowHeight() - r.clientHeight / 2), this.renderBody(), n = o.querySelector(a)), !n) return;
|
|
937
|
+
n.focus({ preventScroll: !0 });
|
|
938
|
+
const s = this.deslocamentoAteLinha(n);
|
|
939
|
+
s && (r.scrollTop += s);
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Quanto o container precisa rolar para a linha ficar inteira na área útil: abaixo do cabeçalho
|
|
943
|
+
* fixo e acima da barra de rolagem horizontal. 0 = já visível. Linha maior que a área alinha pelo topo.
|
|
944
|
+
*/
|
|
945
|
+
deslocamentoAteLinha(e) {
|
|
946
|
+
var d;
|
|
947
|
+
const r = this._containerElement, o = r.getBoundingClientRect(), a = e.getBoundingClientRect(), n = o.top + r.clientTop + (((d = this._theadElement) == null ? void 0 : d.offsetHeight) ?? 0), s = o.top + r.clientTop + r.clientHeight;
|
|
948
|
+
return a.top < n ? a.top - n : a.bottom > s ? Math.min(a.bottom - s, a.top - n) : 0;
|
|
949
|
+
}
|
|
950
|
+
/** Rola só o container da tabela (nunca a página, ao contrário de `scrollIntoView`). */
|
|
951
|
+
rolarContainer(e, r) {
|
|
952
|
+
const o = this._containerElement;
|
|
953
|
+
r === "smooth" && typeof o.scrollTo == "function" ? o.scrollTo({ top: e, behavior: "smooth" }) : o.scrollTop = e;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Posiciona a linha exibida `indice` na área visível.
|
|
957
|
+
* Fora da janela virtual, rola até a posição estimada, renderiza a janela e corrige pela posição
|
|
958
|
+
* real da linha. No modo suave a correção ocorre ao fim da animação (`scrollend`, com timeout de
|
|
959
|
+
* segurança para navegadores sem o evento ou quando não há rolagem a fazer).
|
|
960
|
+
*/
|
|
961
|
+
posicionarLinha(e, r) {
|
|
962
|
+
var c;
|
|
963
|
+
const o = this._containerElement, a = this._tbodyElement;
|
|
964
|
+
if (!o || !a) return !1;
|
|
965
|
+
(c = this._cancelarCorrecaoRolagem) == null || c.call(this);
|
|
966
|
+
const n = () => a.querySelector(`tr[data-index="${e}"]`), s = (h) => {
|
|
967
|
+
const b = n();
|
|
968
|
+
if (!b) return;
|
|
969
|
+
const x = this.deslocamentoAteLinha(b);
|
|
970
|
+
x && this.rolarContainer(o.scrollTop + x, h);
|
|
971
|
+
};
|
|
972
|
+
if (n())
|
|
973
|
+
return s(r), !0;
|
|
974
|
+
const d = () => {
|
|
975
|
+
o.scrollTop = Math.max(0, e * this.getRowHeight()), this.renderBody(), s("auto"), this.renderBody();
|
|
976
|
+
};
|
|
977
|
+
if (r === "auto")
|
|
978
|
+
return d(), !0;
|
|
979
|
+
this.rolarContainer(Math.max(0, e * this.getRowHeight()), "smooth");
|
|
980
|
+
let u = !0;
|
|
981
|
+
const l = () => {
|
|
982
|
+
var h;
|
|
983
|
+
u && ((h = this._cancelarCorrecaoRolagem) == null || h.call(this), this.renderBody(), n() ? s("smooth") : d());
|
|
984
|
+
}, p = window.setTimeout(l, 800);
|
|
985
|
+
return o.addEventListener("scrollend", l, { once: !0 }), this._cancelarCorrecaoRolagem = () => {
|
|
986
|
+
u = !1, window.clearTimeout(p), o.removeEventListener("scrollend", l), this._cancelarCorrecaoRolagem = null;
|
|
987
|
+
}, !0;
|
|
888
988
|
}
|
|
889
989
|
obterContextoRenderizador() {
|
|
890
990
|
return {
|
|
@@ -914,243 +1014,331 @@ class re extends M {
|
|
|
914
1014
|
};
|
|
915
1015
|
}
|
|
916
1016
|
renderHeader() {
|
|
917
|
-
|
|
1017
|
+
xe(this.obterContextoRenderizador());
|
|
918
1018
|
}
|
|
919
1019
|
renderBody() {
|
|
920
|
-
|
|
1020
|
+
ve(this.obterContextoRenderizador()), this.medirAlturaLinha();
|
|
921
1021
|
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Rola até um item e opcionalmente o seleciona. Aceita ID (pela `chave-id`, depois `id`, `_id`,
|
|
1024
|
+
* `codigo`, `key`), predicado ou índice. Um número é procurado primeiro como ID; use
|
|
1025
|
+
* `{ porIndice: true }` ou `rolarParaIndice()` para tratá-lo só como índice da linha exibida.
|
|
1026
|
+
*/
|
|
922
1027
|
rolarPara(e, r) {
|
|
923
1028
|
return this.selecaoController.rolarPara(e, r);
|
|
924
1029
|
}
|
|
1030
|
+
/** Rola até a linha exibida de índice `indice` (posição após ordenação/filtro, base 0). */
|
|
1031
|
+
rolarParaIndice(e, r) {
|
|
1032
|
+
return this.selecaoController.rolarPara(e, { ...r, porIndice: !0 });
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
q("ui-tabela", ye);
|
|
1036
|
+
const k = Math.PI / 180;
|
|
1037
|
+
function z(t) {
|
|
1038
|
+
return Math.abs(t) < 1e-12 ? 0 : Number(t.toPrecision(15));
|
|
925
1039
|
}
|
|
926
|
-
|
|
927
|
-
|
|
1040
|
+
const Ce = {
|
|
1041
|
+
sqrt: Math.sqrt,
|
|
1042
|
+
abs: Math.abs,
|
|
1043
|
+
round: Math.round,
|
|
1044
|
+
floor: Math.floor,
|
|
1045
|
+
ceil: Math.ceil,
|
|
1046
|
+
sin: (t) => z(Math.sin(t * k)),
|
|
1047
|
+
cos: (t) => z(Math.cos(t * k)),
|
|
1048
|
+
tan: (t) => z(Math.tan(t * k)),
|
|
1049
|
+
asin: (t) => z(Math.asin(t) / k),
|
|
1050
|
+
acos: (t) => z(Math.acos(t) / k),
|
|
1051
|
+
atan: (t) => z(Math.atan(t) / k)
|
|
1052
|
+
};
|
|
1053
|
+
function F(t) {
|
|
928
1054
|
if (!t || typeof t != "string") return null;
|
|
929
|
-
let
|
|
930
|
-
if (!
|
|
931
|
-
|
|
1055
|
+
let i = t.trim();
|
|
1056
|
+
if (!i) return null;
|
|
1057
|
+
i = i.replace(/(\d),(\d)/g, "$1.$2").replace(/,/g, "."), i = i.replace(/\bpi\b/gi, String(Math.PI)), i = i.replace(/\be\b/gi, String(Math.E));
|
|
932
1058
|
let e = 0;
|
|
933
1059
|
function r() {
|
|
934
|
-
return
|
|
1060
|
+
return i[e] || "";
|
|
935
1061
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
1062
|
+
function o() {
|
|
1063
|
+
return i[e++] || "";
|
|
938
1064
|
}
|
|
939
1065
|
function a() {
|
|
940
|
-
for (; e <
|
|
1066
|
+
for (; e < i.length && /\s/.test(i[e]); )
|
|
941
1067
|
e++;
|
|
942
1068
|
}
|
|
943
|
-
function
|
|
1069
|
+
function n() {
|
|
944
1070
|
a();
|
|
945
|
-
let
|
|
946
|
-
for (a(); e <
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
a(),
|
|
1071
|
+
let l = s();
|
|
1072
|
+
for (a(); e < i.length; ) {
|
|
1073
|
+
const p = r();
|
|
1074
|
+
if (p === "+" || p === "-") {
|
|
1075
|
+
o(), a();
|
|
1076
|
+
const c = e, h = s();
|
|
1077
|
+
a(), i.slice(c, e).includes("%") ? l = p === "+" ? l + l * h : l - l * h : l = p === "+" ? l + h : l - h;
|
|
952
1078
|
} else
|
|
953
1079
|
break;
|
|
954
1080
|
}
|
|
955
|
-
return
|
|
1081
|
+
return l;
|
|
956
1082
|
}
|
|
957
|
-
function
|
|
1083
|
+
function s() {
|
|
958
1084
|
a();
|
|
959
|
-
let
|
|
960
|
-
for (a(); e <
|
|
961
|
-
const
|
|
962
|
-
if (
|
|
963
|
-
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
1085
|
+
let l = d();
|
|
1086
|
+
for (a(); e < i.length; ) {
|
|
1087
|
+
const p = r();
|
|
1088
|
+
if (p === "*" || p === "/" || p === "x" || p === "X") {
|
|
1089
|
+
o(), a();
|
|
1090
|
+
const c = d();
|
|
1091
|
+
if (p === "/" && c === 0)
|
|
966
1092
|
throw new Error("Divisão por zero");
|
|
967
|
-
|
|
1093
|
+
l = p === "/" ? l / c : l * c, a();
|
|
968
1094
|
} else
|
|
969
1095
|
break;
|
|
970
1096
|
}
|
|
971
|
-
return
|
|
1097
|
+
return l;
|
|
972
1098
|
}
|
|
973
1099
|
function d() {
|
|
974
1100
|
a();
|
|
975
|
-
|
|
1101
|
+
const l = r();
|
|
1102
|
+
if (l === "+" || l === "-") {
|
|
1103
|
+
o();
|
|
1104
|
+
const c = d();
|
|
1105
|
+
return l === "-" ? -c : c;
|
|
1106
|
+
}
|
|
1107
|
+
let p = u();
|
|
976
1108
|
if (a(), r() === "^") {
|
|
977
|
-
|
|
1109
|
+
o();
|
|
978
1110
|
const c = d();
|
|
979
|
-
|
|
980
|
-
} else if (
|
|
1111
|
+
p = Math.pow(p, c);
|
|
1112
|
+
} else if (i.slice(e, e + 2) === "**") {
|
|
981
1113
|
e += 2;
|
|
982
1114
|
const c = d();
|
|
983
|
-
|
|
1115
|
+
p = Math.pow(p, c);
|
|
984
1116
|
}
|
|
985
|
-
return
|
|
1117
|
+
return p;
|
|
986
1118
|
}
|
|
987
|
-
function
|
|
1119
|
+
function u() {
|
|
988
1120
|
a();
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
991
|
-
|
|
992
|
-
const h =
|
|
993
|
-
return
|
|
1121
|
+
const l = r();
|
|
1122
|
+
if (l === "+" || l === "-") {
|
|
1123
|
+
o();
|
|
1124
|
+
const h = u();
|
|
1125
|
+
return l === "-" ? -h : h;
|
|
994
1126
|
}
|
|
995
|
-
if (
|
|
996
|
-
|
|
997
|
-
const h =
|
|
998
|
-
|
|
1127
|
+
if (l === "(") {
|
|
1128
|
+
o();
|
|
1129
|
+
const h = n();
|
|
1130
|
+
if (a(), o() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1131
|
+
return a(), r() === "%" ? (o(), h / 100) : h;
|
|
999
1132
|
}
|
|
1000
|
-
const
|
|
1133
|
+
const p = i.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);
|
|
1134
|
+
if (p) {
|
|
1135
|
+
const h = Ce[p[1].toLowerCase()];
|
|
1136
|
+
if (!h) throw new Error("Função desconhecida: " + p[1]);
|
|
1137
|
+
e += p[0].length;
|
|
1138
|
+
const b = n();
|
|
1139
|
+
if (a(), o() !== ")") throw new Error("Parêntese sem fechamento");
|
|
1140
|
+
const x = h(b);
|
|
1141
|
+
return a(), r() === "%" ? (o(), x / 100) : x;
|
|
1142
|
+
}
|
|
1143
|
+
const c = i.slice(e).match(/^([0-9]+(?:\.[0-9]+)?|\.[0-9]+)/);
|
|
1001
1144
|
if (c) {
|
|
1002
|
-
const h = c[1].toLowerCase();
|
|
1003
1145
|
e += c[0].length;
|
|
1004
|
-
|
|
1005
|
-
a(), r() === "
|
|
1006
|
-
let x = m;
|
|
1007
|
-
switch (h) {
|
|
1008
|
-
case "sqrt":
|
|
1009
|
-
x = Math.sqrt(m);
|
|
1010
|
-
break;
|
|
1011
|
-
case "abs":
|
|
1012
|
-
x = Math.abs(m);
|
|
1013
|
-
break;
|
|
1014
|
-
case "round":
|
|
1015
|
-
x = Math.round(m);
|
|
1016
|
-
break;
|
|
1017
|
-
case "floor":
|
|
1018
|
-
x = Math.floor(m);
|
|
1019
|
-
break;
|
|
1020
|
-
case "ceil":
|
|
1021
|
-
x = Math.ceil(m);
|
|
1022
|
-
break;
|
|
1023
|
-
case "sin":
|
|
1024
|
-
x = Math.sin(m);
|
|
1025
|
-
break;
|
|
1026
|
-
case "cos":
|
|
1027
|
-
x = Math.cos(m);
|
|
1028
|
-
break;
|
|
1029
|
-
case "tan":
|
|
1030
|
-
x = Math.tan(m);
|
|
1031
|
-
break;
|
|
1032
|
-
}
|
|
1033
|
-
return a(), r() === "%" ? (i(), x / 100) : x;
|
|
1146
|
+
let h = parseFloat(c[0]);
|
|
1147
|
+
return a(), r() === "%" && (o(), h = h / 100), h;
|
|
1034
1148
|
}
|
|
1035
|
-
|
|
1036
|
-
if (u) {
|
|
1037
|
-
e += u[0].length;
|
|
1038
|
-
let h = parseFloat(u[0]);
|
|
1039
|
-
return a(), r() === "%" && (i(), h = h / 100), h;
|
|
1040
|
-
}
|
|
1041
|
-
throw new Error("Caractere inválido: " + s);
|
|
1149
|
+
throw new Error("Caractere inválido: " + l);
|
|
1042
1150
|
}
|
|
1043
1151
|
try {
|
|
1044
|
-
const
|
|
1045
|
-
return a(), e <
|
|
1152
|
+
const l = n();
|
|
1153
|
+
return a(), e < i.length ? null : isFinite(l) ? l : null;
|
|
1046
1154
|
} catch {
|
|
1047
1155
|
return null;
|
|
1048
1156
|
}
|
|
1049
1157
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1158
|
+
const Ae = '.ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__linha select:not([disabled]), .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__linha .ui-prop__editor-cor-container';
|
|
1159
|
+
function Y(t, i) {
|
|
1160
|
+
if (!t) return null;
|
|
1161
|
+
const e = String(i);
|
|
1162
|
+
return Array.from(t.querySelectorAll("[data-prop-id]")).find((r) => r.getAttribute("data-prop-id") === e) ?? null;
|
|
1163
|
+
}
|
|
1164
|
+
const G = /* @__PURE__ */ new WeakMap();
|
|
1165
|
+
function y(t, i) {
|
|
1166
|
+
G.set(t, i);
|
|
1167
|
+
}
|
|
1168
|
+
function H(t, i, e) {
|
|
1169
|
+
var a, n;
|
|
1170
|
+
const r = Y(t, i), o = (a = r == null ? void 0 : r.querySelector(".ui-prop__col-valor")) == null ? void 0 : a.firstElementChild;
|
|
1171
|
+
o && ((n = G.get(o)) == null || n(e));
|
|
1172
|
+
}
|
|
1173
|
+
function C(t, i, e = (o, a) => o === String(a), r = (o) => o == null || o === "" ? "—" : String(o)) {
|
|
1174
|
+
var n;
|
|
1175
|
+
(n = t.querySelector("option[data-externa]")) == null || n.remove();
|
|
1176
|
+
const o = Array.from(t.options).find((s) => !s.hasAttribute("data-acao") && e(s.value, i));
|
|
1177
|
+
if (o) {
|
|
1178
|
+
o.selected = !0;
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
const a = document.createElement("option");
|
|
1182
|
+
a.value = i == null ? "" : String(i), a.textContent = r(i), a.setAttribute("data-externa", ""), a.hidden = !0, t.insertBefore(a, t.firstChild), a.selected = !0;
|
|
1183
|
+
}
|
|
1184
|
+
function ke(t, i) {
|
|
1185
|
+
const e = Array.from(t.querySelectorAll(Ae)), r = e.indexOf(i);
|
|
1186
|
+
if (r !== -1 && r + 1 < e.length) {
|
|
1187
|
+
const o = e[r + 1];
|
|
1188
|
+
o.focus(), o instanceof HTMLInputElement && o.select();
|
|
1189
|
+
}
|
|
1053
1190
|
}
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1191
|
+
function N(t, i) {
|
|
1192
|
+
var e;
|
|
1193
|
+
t.classList.toggle("ui-prop__categoria--aberta", i), (e = t.querySelector(".ui-prop__categoria-header")) == null || e.setAttribute("aria-expanded", String(i));
|
|
1194
|
+
}
|
|
1195
|
+
function ze(t, i) {
|
|
1196
|
+
i.forEach((e) => e.aberto = !0), t.querySelectorAll(".ui-prop__categoria").forEach((e) => N(e, !0));
|
|
1197
|
+
}
|
|
1198
|
+
function Se(t, i) {
|
|
1199
|
+
i.forEach((e) => e.aberto = !1), t.querySelectorAll(".ui-prop__categoria").forEach((e) => N(e, !1));
|
|
1200
|
+
}
|
|
1201
|
+
function Le(t, i, e, r) {
|
|
1202
|
+
const o = e.find((a) => a.id === r);
|
|
1203
|
+
if (o) {
|
|
1204
|
+
o.aberto = o.aberto === !1;
|
|
1205
|
+
const a = Array.from(t.querySelectorAll("[data-cat-id]")).find((n) => n.getAttribute("data-cat-id") === r);
|
|
1206
|
+
a && N(a, !!o.aberto), i.dispatchEvent(
|
|
1207
|
+
new CustomEvent("ui-categoria-toggle", {
|
|
1208
|
+
bubbles: !0,
|
|
1209
|
+
composed: !0,
|
|
1210
|
+
detail: { id: r, aberto: o.aberto }
|
|
1211
|
+
})
|
|
1212
|
+
);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
function Me(t) {
|
|
1216
|
+
const i = document.createElement("span"), e = (r) => {
|
|
1217
|
+
const o = typeof r == "number" || typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim());
|
|
1218
|
+
i.className = `ui-prop__valor-readonly ${o ? "ui-prop__valor-readonly--numero" : ""}`.trim(), i.textContent = r != null ? String(r) : "—";
|
|
1219
|
+
};
|
|
1220
|
+
return e(t), y(i, e), i;
|
|
1221
|
+
}
|
|
1222
|
+
function Be(t, i, e, r) {
|
|
1223
|
+
const o = document.createElement("label");
|
|
1224
|
+
o.className = "ui-prop__editor-booleano", o.setAttribute("role", "checkbox"), o.tabIndex = 0, o.setAttribute("aria-label", i.rotulo);
|
|
1225
|
+
const a = document.createElement("div");
|
|
1226
|
+
a.className = "ui-prop__checkbox-custom";
|
|
1059
1227
|
const n = document.createElement("span");
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1228
|
+
n.className = "ui-prop__booleano-rotulo";
|
|
1229
|
+
const s = (u) => {
|
|
1230
|
+
const l = !!u;
|
|
1231
|
+
a.classList.toggle("ui-prop__checkbox-custom--marcado", l), a.textContent = l ? "✓" : "", n.textContent = l ? "Sim" : "Não", o.setAttribute("aria-checked", String(l));
|
|
1232
|
+
};
|
|
1233
|
+
s(e), y(o, s), o.appendChild(a), o.appendChild(n);
|
|
1234
|
+
const d = () => {
|
|
1235
|
+
const u = !r.obterValorAtual(i.id);
|
|
1236
|
+
r.registrarAlteracao(t, i.id, u), s(u);
|
|
1237
|
+
};
|
|
1238
|
+
return o.addEventListener("click", (u) => {
|
|
1239
|
+
u.preventDefault(), d();
|
|
1240
|
+
}), o.addEventListener("keydown", (u) => {
|
|
1241
|
+
u.key === " " ? (u.preventDefault(), d()) : u.key === "Enter" && (u.preventDefault(), r.focarProximoEditor(o));
|
|
1242
|
+
}), o;
|
|
1243
|
+
}
|
|
1244
|
+
function De(t, i, e, r) {
|
|
1245
|
+
const o = document.createElement("select");
|
|
1246
|
+
return o.className = "ui-prop__editor-select", o.setAttribute("aria-label", i.rotulo), (i.opcoes || []).forEach((a) => {
|
|
1247
|
+
const n = document.createElement("option");
|
|
1248
|
+
n.value = String(a.id), n.textContent = a.rotulo, o.appendChild(n);
|
|
1249
|
+
}), C(o, e), y(o, (a) => C(o, a)), o.addEventListener("change", () => {
|
|
1250
|
+
const a = (i.opcoes || []).find((n) => String(n.id) === o.value);
|
|
1251
|
+
r.registrarAlteracao(t, i.id, a ? a.id : o.value), C(o, r.obterValorAtual(i.id));
|
|
1252
|
+
}), o.addEventListener("keydown", (a) => {
|
|
1253
|
+
a.key === "Enter" && r.focarProximoEditor(o);
|
|
1254
|
+
}), o;
|
|
1255
|
+
}
|
|
1256
|
+
function Te(t, i, e) {
|
|
1078
1257
|
const r = document.createElement("button");
|
|
1079
|
-
return r.type = "button", r.className = "ui-prop__btn-acao-inline", r.textContent =
|
|
1080
|
-
typeof
|
|
1081
|
-
}), r.addEventListener("keydown", (i) => {
|
|
1082
|
-
i.key === "Enter" && r.click();
|
|
1258
|
+
return r.type = "button", r.className = "ui-prop__btn-acao-inline", r.textContent = i.rotuloAcao || "Editar...", r.addEventListener("click", () => {
|
|
1259
|
+
typeof i.onClickAcao == "function" && i.onClickAcao(i), e.despacharEventoAcao(i, t);
|
|
1083
1260
|
}), r;
|
|
1084
1261
|
}
|
|
1085
|
-
function
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1088
|
-
const a = (
|
|
1089
|
-
if (
|
|
1090
|
-
const d = Number(
|
|
1091
|
-
return isNaN(d) ? String(
|
|
1262
|
+
function Ne(t, i, e, r) {
|
|
1263
|
+
const o = document.createElement("input");
|
|
1264
|
+
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", i.rotulo), i.placeholder && (o.placeholder = i.placeholder);
|
|
1265
|
+
const a = (s) => {
|
|
1266
|
+
if (s == null || s === "") return "";
|
|
1267
|
+
const d = Number(s);
|
|
1268
|
+
return isNaN(d) ? String(s) : i.casasDecimais !== void 0 ? d.toFixed(i.casasDecimais) : String(d);
|
|
1092
1269
|
};
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}),
|
|
1096
|
-
|
|
1097
|
-
|
|
1270
|
+
o.value = a(e), y(o, (s) => {
|
|
1271
|
+
o.value = a(s);
|
|
1272
|
+
}), o.addEventListener("focus", () => {
|
|
1273
|
+
o.select();
|
|
1274
|
+
}), o.addEventListener("input", () => {
|
|
1275
|
+
const s = o.value, d = /[\+\-\*\/\^\%\(\)]/.test(s) && !/^[+-]?[0-9]*\.?[0-9]*$/.test(s.trim());
|
|
1276
|
+
o.classList.toggle("ui-prop__editor-input--calculando", d);
|
|
1098
1277
|
});
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
const
|
|
1102
|
-
if (
|
|
1103
|
-
r.registrarAlteracao(t,
|
|
1278
|
+
const n = () => {
|
|
1279
|
+
o.classList.remove("ui-prop__editor-input--calculando");
|
|
1280
|
+
const s = o.value.trim();
|
|
1281
|
+
if (s === "") {
|
|
1282
|
+
r.registrarAlteracao(t, i.id, null);
|
|
1104
1283
|
return;
|
|
1105
1284
|
}
|
|
1106
|
-
const d =
|
|
1285
|
+
const d = F(s);
|
|
1107
1286
|
if (d !== null && !isNaN(d)) {
|
|
1108
|
-
let
|
|
1109
|
-
|
|
1287
|
+
let u = d;
|
|
1288
|
+
i.casasDecimais !== void 0 && (u = Number(d.toFixed(i.casasDecimais))), o.value = a(u), r.registrarAlteracao(t, i.id, u);
|
|
1110
1289
|
} else
|
|
1111
|
-
|
|
1290
|
+
o.value = a(r.obterValorAtual(i.id));
|
|
1112
1291
|
};
|
|
1113
|
-
return
|
|
1114
|
-
if (
|
|
1115
|
-
|
|
1116
|
-
else if (
|
|
1117
|
-
|
|
1118
|
-
else if (
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
let
|
|
1122
|
-
|
|
1123
|
-
let
|
|
1124
|
-
|
|
1292
|
+
return o.addEventListener("change", n), o.addEventListener("blur", n), o.addEventListener("keydown", (s) => {
|
|
1293
|
+
if (s.key === "Enter")
|
|
1294
|
+
n(), r.focarProximoEditor(o);
|
|
1295
|
+
else if (s.key === "Escape")
|
|
1296
|
+
o.classList.remove("ui-prop__editor-input--calculando"), o.value = a(r.obterValorAtual(i.id)), o.blur();
|
|
1297
|
+
else if (s.key === "ArrowUp" || s.key === "ArrowDown") {
|
|
1298
|
+
s.preventDefault();
|
|
1299
|
+
const u = F(o.value) ?? (Number(r.obterValorAtual(i.id)) || 0);
|
|
1300
|
+
let l = i.casasDecimais !== void 0 ? Math.pow(10, -i.casasDecimais) : 1;
|
|
1301
|
+
s.shiftKey ? l *= 10 : s.altKey && i.casasDecimais === void 0 && (l *= 0.1);
|
|
1302
|
+
let p = s.key === "ArrowUp" ? u + l : u - l;
|
|
1303
|
+
i.casasDecimais !== void 0 ? p = Number(p.toFixed(i.casasDecimais)) : p = Math.round(p * 100) / 100, o.value = a(p), r.registrarAlteracao(t, i.id, p);
|
|
1125
1304
|
}
|
|
1126
|
-
}),
|
|
1305
|
+
}), o;
|
|
1127
1306
|
}
|
|
1128
|
-
function
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
|
|
1307
|
+
function Ie(t, i, e, r) {
|
|
1308
|
+
const o = document.createElement("input");
|
|
1309
|
+
o.type = "text", o.className = "ui-prop__editor-input", o.setAttribute("aria-label", i.rotulo), i.placeholder && (o.placeholder = i.placeholder), o.value = e != null ? String(e) : "", y(o, (n) => {
|
|
1310
|
+
o.value = n != null ? String(n) : "";
|
|
1311
|
+
}), o.addEventListener("focus", () => {
|
|
1312
|
+
o.select();
|
|
1132
1313
|
});
|
|
1133
1314
|
const a = () => {
|
|
1134
|
-
|
|
1315
|
+
r.registrarAlteracao(t, i.id, o.value);
|
|
1135
1316
|
};
|
|
1136
|
-
return
|
|
1137
|
-
|
|
1138
|
-
}),
|
|
1317
|
+
return o.addEventListener("change", a), o.addEventListener("keydown", (n) => {
|
|
1318
|
+
n.key === "Enter" ? (a(), r.focarProximoEditor(o)) : n.key === "Escape" && (o.value = String(r.obterValorAtual(i.id) ?? ""), o.blur());
|
|
1319
|
+
}), o;
|
|
1139
1320
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
i.
|
|
1321
|
+
const D = (t, i) => t.toLowerCase() === String(i ?? "").toLowerCase();
|
|
1322
|
+
function I(t, i) {
|
|
1323
|
+
i.forEach((e) => {
|
|
1324
|
+
const r = document.createElement("option");
|
|
1325
|
+
r.value = String(e.id), r.textContent = e.rotulo, t.appendChild(r);
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
function Re(t, i, e, r) {
|
|
1329
|
+
const o = document.createElement("div");
|
|
1330
|
+
o.className = "ui-prop__editor-linha-container";
|
|
1143
1331
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1144
1332
|
a.setAttribute("class", "ui-prop__linha-amostra-svg"), a.setAttribute("viewBox", "0 0 44 12");
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
const
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1333
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1334
|
+
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "44"), n.setAttribute("y2", "6");
|
|
1335
|
+
const s = (l) => {
|
|
1336
|
+
const p = String(l || "").toLowerCase();
|
|
1337
|
+
p.includes("center") || p.includes("eixo") || p.includes("dashdot") || p.includes("traço-ponto") ? n.setAttribute("stroke-dasharray", "8,3,2,3") : p.includes("dash") || p.includes("tracej") || p.includes("hidden") ? n.setAttribute("stroke-dasharray", "6,3") : p.includes("dot") || p.includes("ponto") || p.includes("pontilh") ? n.setAttribute("stroke-dasharray", "2,3") : n.setAttribute("stroke-dasharray", "none");
|
|
1150
1338
|
};
|
|
1151
|
-
|
|
1339
|
+
a.appendChild(n);
|
|
1152
1340
|
const d = document.createElement("select");
|
|
1153
|
-
|
|
1341
|
+
d.className = "ui-prop__linha-select", d.setAttribute("aria-label", i.rotulo), I(d, i.opcoes && i.opcoes.length > 0 ? i.opcoes : [
|
|
1154
1342
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1155
1343
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1156
1344
|
{ id: "Continuous", rotulo: "Continuous" },
|
|
@@ -1158,29 +1346,30 @@ function ue(t, o, e, r) {
|
|
|
1158
1346
|
{ id: "Hidden", rotulo: "Hidden" },
|
|
1159
1347
|
{ id: "Center", rotulo: "Center" },
|
|
1160
1348
|
{ id: "Dotted", rotulo: "Dotted" }
|
|
1161
|
-
])
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1349
|
+
]);
|
|
1350
|
+
const u = (l) => {
|
|
1351
|
+
s(l), C(d, l, D);
|
|
1352
|
+
};
|
|
1353
|
+
return u(e), y(o, u), d.addEventListener("change", () => {
|
|
1354
|
+
s(d.value), r.registrarAlteracao(t, i.id, d.value), C(d, d.value, D);
|
|
1355
|
+
}), d.addEventListener("keydown", (l) => {
|
|
1356
|
+
l.key === "Enter" && r.focarProximoEditor(d);
|
|
1357
|
+
}), o.appendChild(a), o.appendChild(d), o;
|
|
1358
|
+
}
|
|
1359
|
+
function Pe(t, i, e, r) {
|
|
1360
|
+
const o = document.createElement("div");
|
|
1361
|
+
o.className = "ui-prop__editor-espessura-container";
|
|
1173
1362
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1174
1363
|
a.setAttribute("class", "ui-prop__espessura-amostra-svg"), a.setAttribute("viewBox", "0 0 38 12");
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
const
|
|
1178
|
-
const
|
|
1179
|
-
return isNaN(
|
|
1364
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
1365
|
+
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "38"), n.setAttribute("y2", "6");
|
|
1366
|
+
const s = (l) => {
|
|
1367
|
+
const p = parseFloat(String(l).replace(/[^0-9.]/g, ""));
|
|
1368
|
+
return isNaN(p) || p <= 0 ? 1.5 : Math.min(8, Math.max(1, p * 8));
|
|
1180
1369
|
};
|
|
1181
|
-
|
|
1370
|
+
a.appendChild(n);
|
|
1182
1371
|
const d = document.createElement("select");
|
|
1183
|
-
|
|
1372
|
+
d.className = "ui-prop__espessura-select", d.setAttribute("aria-label", i.rotulo), I(d, i.opcoes && i.opcoes.length > 0 ? i.opcoes : [
|
|
1184
1373
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1185
1374
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1186
1375
|
{ id: "0.00 mm", rotulo: "0.00 mm" },
|
|
@@ -1200,134 +1389,167 @@ function pe(t, o, e, r) {
|
|
|
1200
1389
|
{ id: "1.00 mm", rotulo: "1.00 mm" },
|
|
1201
1390
|
{ id: "1.40 mm", rotulo: "1.40 mm" },
|
|
1202
1391
|
{ id: "2.00 mm", rotulo: "2.00 mm" }
|
|
1203
|
-
])
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1392
|
+
]);
|
|
1393
|
+
const u = (l) => {
|
|
1394
|
+
n.setAttribute("stroke-width", String(s(l))), C(d, l, D);
|
|
1395
|
+
};
|
|
1396
|
+
return u(e), y(o, u), d.addEventListener("change", () => {
|
|
1397
|
+
n.setAttribute("stroke-width", String(s(d.value))), r.registrarAlteracao(t, i.id, d.value), C(d, d.value, D);
|
|
1398
|
+
}), d.addEventListener("keydown", (l) => {
|
|
1399
|
+
l.key === "Enter" && r.focarProximoEditor(d);
|
|
1400
|
+
}), o.appendChild(a), o.appendChild(d), o;
|
|
1401
|
+
}
|
|
1402
|
+
const R = [
|
|
1403
|
+
{ nome: "Red", indice: 1, hex: "#ff0000" },
|
|
1404
|
+
{ nome: "Yellow", indice: 2, hex: "#ffff00" },
|
|
1405
|
+
{ nome: "Green", indice: 3, hex: "#00ff00" },
|
|
1406
|
+
{ nome: "Cyan", indice: 4, hex: "#00ffff" },
|
|
1407
|
+
{ nome: "Blue", indice: 5, hex: "#0000ff" },
|
|
1408
|
+
{ nome: "Magenta", indice: 6, hex: "#ff00ff" },
|
|
1409
|
+
{ nome: "White", indice: 7, hex: "#ffffff" }
|
|
1410
|
+
], K = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1411
|
+
function T(t) {
|
|
1412
|
+
const i = String(t ?? "").trim().toLowerCase(), e = R.find((r) => String(r.indice) === i || r.nome.toLowerCase() === i);
|
|
1413
|
+
return e ? e.nome.toLowerCase() : i;
|
|
1414
|
+
}
|
|
1415
|
+
function Oe(t) {
|
|
1416
|
+
const i = T(t), e = R.find((r) => r.nome.toLowerCase() === i);
|
|
1417
|
+
return e ? e.hex : K.test(i) ? i : "#ffffff";
|
|
1418
|
+
}
|
|
1419
|
+
function Q(t) {
|
|
1420
|
+
return t.length === 4 ? "#" + t.slice(1).split("").map((i) => i + i).join("") : t;
|
|
1421
|
+
}
|
|
1422
|
+
function Fe(t, i, e, r) {
|
|
1423
|
+
const o = document.createElement("div");
|
|
1424
|
+
o.className = "ui-prop__editor-cor-cad-container";
|
|
1215
1425
|
const a = document.createElement("div");
|
|
1216
1426
|
a.className = "ui-prop__cor-amostra";
|
|
1217
|
-
const l = (s) => {
|
|
1218
|
-
const c = String(s).toLowerCase();
|
|
1219
|
-
return c === "red" || c === "1" ? "#ff0000" : c === "yellow" || c === "2" ? "#ffff00" : c === "green" || c === "3" ? "#00ff00" : c === "cyan" || c === "4" ? "#00ffff" : c === "blue" || c === "5" ? "#0000ff" : c === "magenta" || c === "6" ? "#ff00ff" : c === "white" || c === "7" || c === "bylayer" || c === "byblock" ? "#ffffff" : c.startsWith("#") ? c : "#ffffff";
|
|
1220
|
-
};
|
|
1221
|
-
a.style.backgroundColor = l(e);
|
|
1222
1427
|
const n = document.createElement("select");
|
|
1223
|
-
n.className = "ui-prop__cor-cad-select", [
|
|
1428
|
+
n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label", i.rotulo), I(n, [
|
|
1224
1429
|
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
1225
1430
|
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
1226
|
-
{ id:
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1431
|
+
...R.map((l) => ({ id: l.nome, rotulo: `${l.nome} (${l.indice})` }))
|
|
1432
|
+
]);
|
|
1433
|
+
const s = document.createElement("option");
|
|
1434
|
+
s.value = "__escolher", s.textContent = "Selecionar cor...", s.setAttribute("data-acao", ""), n.appendChild(s);
|
|
1435
|
+
const d = document.createElement("input");
|
|
1436
|
+
d.type = "color", d.className = "ui-prop__cor-picker-oculto", d.tabIndex = -1;
|
|
1437
|
+
const u = (l) => {
|
|
1438
|
+
const p = Oe(l);
|
|
1439
|
+
a.style.backgroundColor = p, d.value = Q(p), C(
|
|
1440
|
+
n,
|
|
1441
|
+
l,
|
|
1442
|
+
(c, h) => T(c) === T(h),
|
|
1443
|
+
(c) => c == null || c === "" ? "—" : String(c)
|
|
1444
|
+
);
|
|
1445
|
+
};
|
|
1446
|
+
return u(e), y(o, u), d.addEventListener("input", () => {
|
|
1447
|
+
a.style.backgroundColor = d.value;
|
|
1448
|
+
}), d.addEventListener("change", () => {
|
|
1449
|
+
r.registrarAlteracao(t, i.id, d.value), u(r.obterValorAtual(i.id));
|
|
1242
1450
|
}), n.addEventListener("change", () => {
|
|
1243
|
-
n.value === "
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1451
|
+
if (n.value === "__escolher") {
|
|
1452
|
+
u(r.obterValorAtual(i.id)), d.click();
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
r.registrarAlteracao(t, i.id, n.value), u(r.obterValorAtual(i.id));
|
|
1456
|
+
}), n.addEventListener("keydown", (l) => {
|
|
1457
|
+
l.key === "Enter" && r.focarProximoEditor(n);
|
|
1458
|
+
}), o.appendChild(a), o.appendChild(n), o.appendChild(d), o;
|
|
1459
|
+
}
|
|
1460
|
+
function He(t, i, e, r) {
|
|
1461
|
+
const o = document.createElement("div");
|
|
1462
|
+
o.className = "ui-prop__editor-cor-container", o.setAttribute("role", "button"), o.tabIndex = 0;
|
|
1251
1463
|
const a = document.createElement("div");
|
|
1252
|
-
a.className = "ui-prop__cor-amostra"
|
|
1253
|
-
const
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1464
|
+
a.className = "ui-prop__cor-amostra";
|
|
1465
|
+
const n = document.createElement("span");
|
|
1466
|
+
n.className = "ui-prop__cor-texto";
|
|
1467
|
+
const s = document.createElement("input");
|
|
1468
|
+
s.type = "color", s.className = "ui-prop__cor-picker-oculto", s.tabIndex = -1;
|
|
1469
|
+
const d = (u) => {
|
|
1470
|
+
const l = typeof u == "string" && K.test(u) ? Q(u) : null;
|
|
1471
|
+
a.style.backgroundColor = u || "#ffffff", n.textContent = i.textoAmostra || String(u || "ByLayer"), s.value = l ?? "#ffffff", o.setAttribute("aria-label", `${i.rotulo}: ${u || "ByLayer"}`);
|
|
1472
|
+
};
|
|
1473
|
+
return d(e), y(o, d), s.addEventListener("input", () => {
|
|
1474
|
+
a.style.backgroundColor = s.value, n.textContent = i.textoAmostra || s.value;
|
|
1475
|
+
}), s.addEventListener("change", () => {
|
|
1476
|
+
r.registrarAlteracao(t, i.id, s.value), d(r.obterValorAtual(i.id));
|
|
1477
|
+
}), o.addEventListener("click", (u) => {
|
|
1478
|
+
u.target !== s && s.click();
|
|
1479
|
+
}), o.addEventListener("keydown", (u) => {
|
|
1480
|
+
(u.key === " " || u.key === "Enter") && (u.preventDefault(), s.click());
|
|
1481
|
+
}), o.appendChild(a), o.appendChild(n), o.appendChild(s), o;
|
|
1482
|
+
}
|
|
1483
|
+
function Ve(t, i, e, r) {
|
|
1484
|
+
return i.somenteLeitura || i.tipo === "readonly" ? Me(e) : i.tipo === "booleano" ? Be(t, i, e, r) : i.tipo === "linha" || i.tipo === "linetype" ? Re(t, i, e, r) : i.tipo === "espessura" || i.tipo === "lineweight" ? Pe(t, i, e, r) : i.tipo === "cor-cad" ? Fe(t, i, e, r) : i.tipo === "selecao" ? De(t, i, e, r) : i.tipo === "cor" ? He(t, i, e, r) : i.tipo === "acao" ? Te(t, i, r) : i.tipo === "numero" ? Ne(t, i, e, r) : Ie(t, i, e, r);
|
|
1485
|
+
}
|
|
1486
|
+
function qe(t) {
|
|
1267
1487
|
if (!t.tipoContainerElement) return;
|
|
1268
1488
|
if (!t.tipos || t.tipos.length === 0) {
|
|
1269
1489
|
t.tipoContainerElement.style.display = "none";
|
|
1270
1490
|
return;
|
|
1271
1491
|
}
|
|
1272
1492
|
t.tipoContainerElement.style.display = "flex", t.tipoContainerElement.innerHTML = "";
|
|
1273
|
-
const
|
|
1493
|
+
const i = t.tipos.find((e) => String(e.id) === String(t.tipoSelecionadoId)) || t.tipos[0];
|
|
1274
1494
|
if (t.estiloVisual === "revit") {
|
|
1275
1495
|
const e = document.createElement("div");
|
|
1276
1496
|
e.className = "ui-prop__tipo-revit-card";
|
|
1277
1497
|
const r = document.createElement("div");
|
|
1278
|
-
r.className = "ui-prop__tipo-miniatura"
|
|
1498
|
+
r.className = "ui-prop__tipo-miniatura";
|
|
1499
|
+
const o = i.iconeSvg ? te(i.iconeSvg) : null;
|
|
1500
|
+
o ? r.appendChild(o) : r.innerHTML = `
|
|
1279
1501
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1280
1502
|
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
|
1281
1503
|
<path d="M3 9h18M9 21V9"></path>
|
|
1282
1504
|
</svg>
|
|
1283
1505
|
`;
|
|
1284
|
-
const i = document.createElement("div");
|
|
1285
|
-
i.className = "ui-prop__tipo-info";
|
|
1286
1506
|
const a = document.createElement("div");
|
|
1287
|
-
a.className = "ui-prop__tipo-
|
|
1288
|
-
const l = document.createElement("div");
|
|
1289
|
-
l.className = "ui-prop__tipo-subtexto", l.textContent = o.subtipo || "Tipo de Família", i.appendChild(a), i.appendChild(l), e.appendChild(r), e.appendChild(i);
|
|
1507
|
+
a.className = "ui-prop__tipo-info";
|
|
1290
1508
|
const n = document.createElement("div");
|
|
1291
|
-
n.className = "ui-prop__tipo-
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1509
|
+
n.className = "ui-prop__tipo-nome", n.textContent = i.rotulo;
|
|
1510
|
+
const s = document.createElement("div");
|
|
1511
|
+
s.className = "ui-prop__tipo-subtexto", s.textContent = i.subtipo || "Tipo de Família", a.appendChild(n), a.appendChild(s), e.appendChild(r), e.appendChild(a);
|
|
1512
|
+
const d = document.createElement("div");
|
|
1513
|
+
d.className = "ui-prop__tipo-revit-subbarra";
|
|
1514
|
+
const u = document.createElement("select");
|
|
1515
|
+
u.className = "ui-prop__tipo-select", t.tipos.forEach((p) => {
|
|
1294
1516
|
const c = document.createElement("option");
|
|
1295
|
-
c.value =
|
|
1296
|
-
}),
|
|
1297
|
-
t.onSelecionarTipo(
|
|
1517
|
+
c.value = p.id, c.textContent = `${p.rotulo}${p.subtipo ? ` : ${p.subtipo}` : ""}`, String(p.id) === String(t.tipoSelecionadoId) && (c.selected = !0), u.appendChild(c);
|
|
1518
|
+
}), u.addEventListener("change", () => {
|
|
1519
|
+
t.onSelecionarTipo(u.value);
|
|
1298
1520
|
});
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1521
|
+
const l = document.createElement("button");
|
|
1522
|
+
l.type = "button", l.className = "ui-prop__btn-editar-tipo", l.innerHTML = `
|
|
1301
1523
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;">
|
|
1302
1524
|
<rect x="3" y="3" width="12" height="12" rx="1"></rect>
|
|
1303
1525
|
<rect x="9" y="9" width="12" height="12" rx="1"></rect>
|
|
1304
1526
|
</svg>
|
|
1305
1527
|
<span>Editar tipo</span>
|
|
1306
|
-
`,
|
|
1307
|
-
t.onEditarTipo(
|
|
1308
|
-
}),
|
|
1528
|
+
`, l.addEventListener("click", () => {
|
|
1529
|
+
t.onEditarTipo(i);
|
|
1530
|
+
}), d.appendChild(u), d.appendChild(l), t.tipoContainerElement.appendChild(e), t.tipoContainerElement.appendChild(d);
|
|
1309
1531
|
} else {
|
|
1310
1532
|
const e = document.createElement("div");
|
|
1311
1533
|
e.className = "ui-prop__tipo-autocad-bar";
|
|
1312
1534
|
const r = document.createElement("select");
|
|
1313
1535
|
r.className = "ui-prop__tipo-select", t.tipos.forEach((d) => {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1536
|
+
const u = document.createElement("option");
|
|
1537
|
+
u.value = d.id, u.textContent = d.rotulo, String(d.id) === String(t.tipoSelecionadoId) && (u.selected = !0), r.appendChild(u);
|
|
1316
1538
|
}), r.addEventListener("change", () => {
|
|
1317
1539
|
t.onSelecionarTipo(r.value);
|
|
1318
1540
|
});
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1541
|
+
const o = document.createElement("div");
|
|
1542
|
+
o.className = "ui-prop__tipo-autocad-acoes";
|
|
1321
1543
|
const a = document.createElement("button");
|
|
1322
1544
|
a.type = "button", a.className = "ui-prop__btn-autocad", a.title = "Seleção rápida", a.setAttribute("aria-label", "Seleção rápida"), a.innerHTML = `
|
|
1323
1545
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1324
1546
|
<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>
|
|
1325
1547
|
</svg>
|
|
1326
1548
|
`, a.addEventListener("click", () => {
|
|
1327
|
-
t.onQuickSelect(
|
|
1549
|
+
t.onQuickSelect(i);
|
|
1328
1550
|
});
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1551
|
+
const n = document.createElement("button");
|
|
1552
|
+
n.type = "button", n.className = "ui-prop__btn-autocad", n.title = "Selecionar objetos", n.setAttribute("aria-label", "Selecionar objetos"), n.innerHTML = `
|
|
1331
1553
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1332
1554
|
<circle cx="12" cy="12" r="7"></circle>
|
|
1333
1555
|
<line x1="12" y1="2" x2="12" y2="7"></line>
|
|
@@ -1337,11 +1559,11 @@ function be(t) {
|
|
|
1337
1559
|
<line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
|
|
1338
1560
|
<line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
|
|
1339
1561
|
</svg>
|
|
1340
|
-
`,
|
|
1341
|
-
t.onSelectObjects(
|
|
1562
|
+
`, n.addEventListener("click", () => {
|
|
1563
|
+
t.onSelectObjects(i);
|
|
1342
1564
|
});
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1565
|
+
const s = document.createElement("button");
|
|
1566
|
+
s.type = "button", s.className = "ui-prop__btn-autocad", s.title = "Calculadora rápida", s.setAttribute("aria-label", "Calculadora rápida"), s.innerHTML = `
|
|
1345
1567
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1346
1568
|
<rect x="4" y="2" width="16" height="20" rx="2"></rect>
|
|
1347
1569
|
<line x1="8" y1="6" x2="16" y2="6"></line>
|
|
@@ -1352,52 +1574,52 @@ function be(t) {
|
|
|
1352
1574
|
<circle cx="12" cy="15" r="1" fill="currentColor"></circle>
|
|
1353
1575
|
<circle cx="16" cy="15" r="1" fill="currentColor"></circle>
|
|
1354
1576
|
</svg>
|
|
1355
|
-
`,
|
|
1356
|
-
t.onCalculadora(
|
|
1357
|
-
}),
|
|
1577
|
+
`, s.addEventListener("click", () => {
|
|
1578
|
+
t.onCalculadora(i);
|
|
1579
|
+
}), o.appendChild(a), o.appendChild(n), o.appendChild(s), e.appendChild(r), e.appendChild(o), t.tipoContainerElement.appendChild(e);
|
|
1358
1580
|
}
|
|
1359
1581
|
}
|
|
1360
|
-
function
|
|
1361
|
-
let
|
|
1362
|
-
function e(
|
|
1363
|
-
const a = Math.max(20, Math.min(65,
|
|
1364
|
-
return
|
|
1582
|
+
function je(t) {
|
|
1583
|
+
let i = 45;
|
|
1584
|
+
function e(o) {
|
|
1585
|
+
const a = Math.max(20, Math.min(65, o));
|
|
1586
|
+
return i = a, t.hostElement.style.setProperty("--ui-prop-rotulo-largura", `${a}%`), t.splitterElement && (t.splitterElement.style.left = `calc(${a}% - 4px)`), a;
|
|
1365
1587
|
}
|
|
1366
1588
|
function r() {
|
|
1367
1589
|
if (!t.splitterElement || !t.corpoElement) return;
|
|
1368
1590
|
t.splitterListeners.cleanup();
|
|
1369
|
-
let
|
|
1370
|
-
const a = (
|
|
1371
|
-
if (
|
|
1372
|
-
|
|
1591
|
+
let o = !1;
|
|
1592
|
+
const a = (n) => {
|
|
1593
|
+
if (n.button !== 0) return;
|
|
1594
|
+
n.preventDefault(), n.stopPropagation(), o = !0, t.splitterElement.classList.add("ui-prop__splitter--ativo");
|
|
1373
1595
|
try {
|
|
1374
|
-
t.splitterElement.setPointerCapture(
|
|
1596
|
+
t.splitterElement.setPointerCapture(n.pointerId);
|
|
1375
1597
|
} catch {
|
|
1376
1598
|
}
|
|
1377
|
-
const
|
|
1378
|
-
if (!
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1381
|
-
const
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1384
|
-
},
|
|
1385
|
-
if (
|
|
1386
|
-
|
|
1599
|
+
const s = t.corpoElement.getBoundingClientRect(), d = (l) => {
|
|
1600
|
+
if (!o) return;
|
|
1601
|
+
const p = s.width;
|
|
1602
|
+
if (p <= 0) return;
|
|
1603
|
+
const c = l.clientX - s.left;
|
|
1604
|
+
let g = Math.max(80, Math.min(p - 130, c)) / p * 100;
|
|
1605
|
+
g = Math.max(20, Math.min(65, g)), e(g);
|
|
1606
|
+
}, u = (l) => {
|
|
1607
|
+
if (o) {
|
|
1608
|
+
o = !1, t.splitterElement.classList.remove("ui-prop__splitter--ativo");
|
|
1387
1609
|
try {
|
|
1388
|
-
t.splitterElement.hasPointerCapture(
|
|
1610
|
+
t.splitterElement.hasPointerCapture(l.pointerId) && t.splitterElement.releasePointerCapture(l.pointerId);
|
|
1389
1611
|
} catch {
|
|
1390
1612
|
}
|
|
1391
|
-
t.splitterElement.removeEventListener("pointermove", d), t.splitterElement.removeEventListener("pointerup",
|
|
1613
|
+
t.splitterElement.removeEventListener("pointermove", d), t.splitterElement.removeEventListener("pointerup", u), t.splitterElement.removeEventListener("pointercancel", u), t.onLarguraAlterada(i), t.hostElement.dispatchEvent(
|
|
1392
1614
|
new CustomEvent("ui-splitter-resize", {
|
|
1393
1615
|
bubbles: !0,
|
|
1394
1616
|
composed: !0,
|
|
1395
|
-
detail: { larguraPorcentagem:
|
|
1617
|
+
detail: { larguraPorcentagem: i }
|
|
1396
1618
|
})
|
|
1397
1619
|
);
|
|
1398
1620
|
}
|
|
1399
1621
|
};
|
|
1400
|
-
t.splitterElement.addEventListener("pointermove", d), t.splitterElement.addEventListener("pointerup",
|
|
1622
|
+
t.splitterElement.addEventListener("pointermove", d), t.splitterElement.addEventListener("pointerup", u), t.splitterElement.addEventListener("pointercancel", u);
|
|
1401
1623
|
};
|
|
1402
1624
|
t.splitterListeners.add(t.splitterElement, "pointerdown", a), t.splitterListeners.add(t.splitterElement, "dblclick", () => {
|
|
1403
1625
|
e(45), t.onLarguraAlterada(45), t.hostElement.dispatchEvent(
|
|
@@ -1414,10 +1636,10 @@ function fe(t) {
|
|
|
1414
1636
|
definirLarguraRotulo: e
|
|
1415
1637
|
};
|
|
1416
1638
|
}
|
|
1417
|
-
const xe = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:#000;border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:#fff}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:#000!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:#000!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:#000}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:#000;border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}`;
|
|
1418
|
-
function
|
|
1639
|
+
const $e = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:#000;border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:#fff}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:#000!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:#000!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:#000}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:#000;border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}`;
|
|
1640
|
+
function We() {
|
|
1419
1641
|
return `
|
|
1420
|
-
<style>${
|
|
1642
|
+
<style>${$e}</style>
|
|
1421
1643
|
<div class="ui-prop__container" id="container">
|
|
1422
1644
|
<!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
|
|
1423
1645
|
<div class="ui-prop__faixa-estreita" id="faixa-estreita" title="Clique para expandir painel">
|
|
@@ -1504,7 +1726,7 @@ function ve() {
|
|
|
1504
1726
|
|
|
1505
1727
|
<!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
|
|
1506
1728
|
<footer class="ui-prop__footer" id="footer" style="display: none;">
|
|
1507
|
-
<a class="ui-prop__link-ajuda" id="link-ajuda">Ajuda de propriedades</a>
|
|
1729
|
+
<a class="ui-prop__link-ajuda" id="link-ajuda" href="#" role="button">Ajuda de propriedades</a>
|
|
1508
1730
|
<div class="ui-prop__footer-botoes">
|
|
1509
1731
|
<button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" disabled>Desfazer</button>
|
|
1510
1732
|
<button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" disabled>Aplicar</button>
|
|
@@ -1516,398 +1738,385 @@ function ve() {
|
|
|
1516
1738
|
</div>
|
|
1517
1739
|
`;
|
|
1518
1740
|
}
|
|
1519
|
-
function
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1741
|
+
function M(t, i) {
|
|
1742
|
+
return t == null && i == null ? !0 : Object.is(t, i);
|
|
1743
|
+
}
|
|
1744
|
+
class Ue {
|
|
1745
|
+
constructor(i) {
|
|
1746
|
+
m(this, "valoresOriginais", {});
|
|
1747
|
+
m(this, "valoresAtuais", {});
|
|
1748
|
+
this.ctx = i;
|
|
1749
|
+
}
|
|
1750
|
+
inicializarCategorias(i) {
|
|
1751
|
+
this.valoresOriginais = {}, this.valoresAtuais = {};
|
|
1752
|
+
const e = /* @__PURE__ */ new Set();
|
|
1753
|
+
i.forEach((r) => {
|
|
1754
|
+
(r.propriedades || []).forEach((o) => {
|
|
1755
|
+
e.has(o.id) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${o.id}". Os valores são indexados por id e serão compartilhados.`), e.add(o.id), this.valoresOriginais[o.id] = o.valor, this.valoresAtuais[o.id] = o.valor;
|
|
1756
|
+
});
|
|
1757
|
+
}), this.ctx.onAtualizarBotoesFooter(!1);
|
|
1758
|
+
}
|
|
1759
|
+
/** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
|
|
1760
|
+
get isDirty() {
|
|
1761
|
+
return Object.keys(this.valoresAtuais).some((i) => this.isModificada(i));
|
|
1762
|
+
}
|
|
1763
|
+
isModificada(i) {
|
|
1764
|
+
return !M(this.valoresAtuais[i], this.valoresOriginais[i]);
|
|
1765
|
+
}
|
|
1766
|
+
getValores() {
|
|
1767
|
+
return { ...this.valoresAtuais };
|
|
1768
|
+
}
|
|
1769
|
+
getValoresOriginais() {
|
|
1770
|
+
return { ...this.valoresOriginais };
|
|
1771
|
+
}
|
|
1772
|
+
setValores(i) {
|
|
1773
|
+
!i || typeof i != "object" || (Object.keys(i).forEach((e) => {
|
|
1774
|
+
this.valoresAtuais[e] = i[e], this.valoresOriginais[e] = i[e];
|
|
1775
|
+
}), this.ctx.onAtualizarBotoesFooter(this.isDirty));
|
|
1776
|
+
}
|
|
1777
|
+
obterValor(i) {
|
|
1778
|
+
return this.valoresAtuais[i];
|
|
1779
|
+
}
|
|
1780
|
+
/** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
|
|
1781
|
+
definirValor(i, e, r = !0) {
|
|
1782
|
+
const o = this.valoresAtuais[i];
|
|
1783
|
+
M(o, e) || (this.valoresAtuais[i] = e, this.aposAlterar(i), this.ctx.onAtualizarCampoVisual(i, e), r && this.emitirAlteracao(i, e, o, this.categoriaDe(i)));
|
|
1784
|
+
}
|
|
1785
|
+
/** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
|
|
1786
|
+
registrarAlteracao(i, e, r) {
|
|
1787
|
+
const o = this.valoresAtuais[e];
|
|
1788
|
+
M(o, r) || (this.valoresAtuais[e] = r, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, r, o, i));
|
|
1789
|
+
}
|
|
1790
|
+
aplicar() {
|
|
1791
|
+
var e;
|
|
1792
|
+
if (!this.isDirty) return;
|
|
1793
|
+
this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
|
|
1794
|
+
const i = (e = this.ctx.hostElement.shadowRoot) == null ? void 0 : e.querySelectorAll(".ui-prop__linha--modificada");
|
|
1795
|
+
i == null || i.forEach((r) => r.classList.remove("ui-prop__linha--modificada")), this.ctx.hostElement.dispatchEvent(
|
|
1796
|
+
new CustomEvent("ui-aplicar", {
|
|
1797
|
+
bubbles: !0,
|
|
1798
|
+
composed: !0,
|
|
1799
|
+
detail: { valores: { ...this.valoresAtuais } }
|
|
1800
|
+
})
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1803
|
+
desfazer() {
|
|
1804
|
+
this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
1805
|
+
new CustomEvent("ui-desfazer", {
|
|
1806
|
+
bubbles: !0,
|
|
1807
|
+
composed: !0,
|
|
1808
|
+
detail: { valores: { ...this.valoresAtuais } }
|
|
1809
|
+
})
|
|
1810
|
+
));
|
|
1811
|
+
}
|
|
1812
|
+
/** Marca/desmarca a linha e recalcula os botões do rodapé (voltar ao original limpa o estado). */
|
|
1813
|
+
aposAlterar(i) {
|
|
1814
|
+
const e = Y(this.ctx.hostElement.shadowRoot, i);
|
|
1815
|
+
e == null || e.classList.toggle("ui-prop__linha--modificada", this.isModificada(i)), this.ctx.onAtualizarBotoesFooter(this.isDirty);
|
|
1816
|
+
}
|
|
1817
|
+
categoriaDe(i) {
|
|
1818
|
+
var e;
|
|
1819
|
+
for (const r of this.ctx.getCategorias())
|
|
1820
|
+
if ((e = r.propriedades) != null && e.some((o) => o.id === i)) return r.id;
|
|
1821
|
+
return "";
|
|
1822
|
+
}
|
|
1823
|
+
emitirAlteracao(i, e, r, o = "") {
|
|
1824
|
+
this.ctx.hostElement.dispatchEvent(
|
|
1825
|
+
new CustomEvent("ui-propriedade-alterada", {
|
|
1826
|
+
bubbles: !0,
|
|
1827
|
+
composed: !0,
|
|
1828
|
+
detail: {
|
|
1829
|
+
id: i,
|
|
1830
|
+
categoriaId: o,
|
|
1831
|
+
valor: e,
|
|
1832
|
+
valorAnterior: r,
|
|
1833
|
+
todosValores: { ...this.valoresAtuais }
|
|
1834
|
+
}
|
|
1835
|
+
})
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
function Xe(t) {
|
|
1840
|
+
const { listaContainer: i, categorias: e, termoBusca: r, onToggleCategoria: o, linhaCtx: a } = t;
|
|
1841
|
+
if (i.innerHTML = "", !e || e.length === 0) {
|
|
1842
|
+
const s = document.createElement("div");
|
|
1843
|
+
s.className = "ui-prop__vazio", s.textContent = "Nenhuma propriedade disponível.", i.appendChild(s);
|
|
1524
1844
|
return;
|
|
1525
1845
|
}
|
|
1526
|
-
const
|
|
1527
|
-
e.forEach((
|
|
1528
|
-
const d = (
|
|
1846
|
+
const n = document.createDocumentFragment();
|
|
1847
|
+
e.forEach((s) => {
|
|
1848
|
+
const d = (s.propriedades || []).filter((f) => r ? f.rotulo.toLowerCase().includes(r) || String(f.id).toLowerCase().includes(r) : !0);
|
|
1529
1849
|
if (r && d.length === 0)
|
|
1530
1850
|
return;
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1851
|
+
const u = !!r || s.aberto !== !1, l = document.createElement("div");
|
|
1852
|
+
l.className = `ui-prop__categoria ${u ? "ui-prop__categoria--aberta" : ""}`, l.setAttribute("data-cat-id", s.id);
|
|
1853
|
+
const p = document.createElement("div");
|
|
1854
|
+
p.className = "ui-prop__categoria-header", p.setAttribute("role", "button"), p.tabIndex = 0, p.setAttribute("aria-expanded", String(u));
|
|
1533
1855
|
const c = document.createElement("div");
|
|
1534
|
-
c.className = "ui-prop__categoria-
|
|
1535
|
-
const u = document.createElement("div");
|
|
1536
|
-
u.className = "ui-prop__categoria-titulo-bloco";
|
|
1856
|
+
c.className = "ui-prop__categoria-titulo-bloco";
|
|
1537
1857
|
const h = document.createElement("span");
|
|
1538
1858
|
h.className = "ui-prop__categoria-seta", h.textContent = "▶";
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1859
|
+
const b = document.createElement("span");
|
|
1860
|
+
b.textContent = s.titulo, c.appendChild(h), c.appendChild(b);
|
|
1541
1861
|
const x = document.createElement("span");
|
|
1542
|
-
x.className = "ui-prop__categoria-contador", x.textContent = String(d.length),
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1862
|
+
x.className = "ui-prop__categoria-contador", x.textContent = String(d.length), p.appendChild(c), p.appendChild(x), p.addEventListener("click", () => o(s.id)), p.addEventListener("keydown", (f) => {
|
|
1863
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), o(s.id));
|
|
1864
|
+
});
|
|
1865
|
+
const g = document.createElement("div");
|
|
1866
|
+
g.className = "ui-prop__categoria-conteudo", d.forEach((f) => {
|
|
1867
|
+
const _ = Ye(s.id, f, a);
|
|
1868
|
+
g.appendChild(_);
|
|
1869
|
+
}), l.appendChild(p), l.appendChild(g), n.appendChild(l);
|
|
1870
|
+
}), i.appendChild(n);
|
|
1871
|
+
}
|
|
1872
|
+
function Ye(t, i, e) {
|
|
1551
1873
|
const r = document.createElement("div");
|
|
1552
|
-
r.className = "ui-prop__linha", r.setAttribute("data-prop-id",
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
const
|
|
1874
|
+
r.className = "ui-prop__linha", r.setAttribute("data-prop-id", i.id);
|
|
1875
|
+
const o = e.valoresAtuais[i.id] !== void 0 ? e.valoresAtuais[i.id] : i.valor, a = i.id in e.valoresOriginais ? e.valoresOriginais[i.id] : i.valor;
|
|
1876
|
+
M(o, a) || r.classList.add("ui-prop__linha--modificada"), r.addEventListener("dblclick", () => {
|
|
1877
|
+
const l = r.querySelector(
|
|
1556
1878
|
'input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline'
|
|
1557
1879
|
);
|
|
1558
|
-
|
|
1880
|
+
l && (l.focus(), l instanceof HTMLInputElement && l.select());
|
|
1559
1881
|
});
|
|
1560
|
-
const
|
|
1561
|
-
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1882
|
+
const n = document.createElement("div");
|
|
1883
|
+
n.className = "ui-prop__col-rotulo", n.title = i.rotulo;
|
|
1884
|
+
const s = document.createElement("span");
|
|
1885
|
+
s.textContent = i.rotulo, n.appendChild(s), i.tipo === "numero" && !i.somenteLeitura && Ge(n, t, i, e);
|
|
1564
1886
|
const d = document.createElement("div");
|
|
1565
1887
|
d.className = "ui-prop__col-valor";
|
|
1566
|
-
const
|
|
1567
|
-
if (d.appendChild(
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1888
|
+
const u = Ve(t, i, o, e.editorCtx);
|
|
1889
|
+
if (d.appendChild(u), i.unidade) {
|
|
1890
|
+
const l = document.createElement("span");
|
|
1891
|
+
l.className = "ui-prop__unidade-sufixo", l.textContent = i.unidade, d.appendChild(l);
|
|
1570
1892
|
}
|
|
1571
|
-
return r.appendChild(
|
|
1893
|
+
return r.appendChild(n), r.appendChild(d), r;
|
|
1572
1894
|
}
|
|
1573
|
-
function
|
|
1895
|
+
function Ge(t, i, e, r) {
|
|
1574
1896
|
t.classList.add("ui-prop__col-rotulo--scrub"), t.title = `${e.rotulo} (Arraste para ajustar, duplo-clique para editar)`;
|
|
1575
|
-
let
|
|
1576
|
-
t.addEventListener("pointerdown", (
|
|
1577
|
-
if (
|
|
1578
|
-
|
|
1579
|
-
const d = r.
|
|
1580
|
-
a = typeof d == "number" ? d : parseFloat(String(d || 0)) || 0,
|
|
1897
|
+
let o = 0, a = 0, n = !1;
|
|
1898
|
+
t.addEventListener("pointerdown", (s) => {
|
|
1899
|
+
if (s.button !== 0) return;
|
|
1900
|
+
o = s.clientX;
|
|
1901
|
+
const d = r.editorCtx.obterValorAtual(e.id);
|
|
1902
|
+
a = typeof d == "number" ? d : parseFloat(String(d || 0)) || 0, n = !1;
|
|
1581
1903
|
try {
|
|
1582
|
-
t.setPointerCapture(
|
|
1904
|
+
t.setPointerCapture(s.pointerId);
|
|
1583
1905
|
} catch {
|
|
1584
1906
|
}
|
|
1585
1907
|
t.classList.add("ui-prop__col-rotulo--arrastando");
|
|
1586
|
-
const
|
|
1587
|
-
const
|
|
1588
|
-
if (Math.abs(
|
|
1908
|
+
const u = (p) => {
|
|
1909
|
+
const c = p.clientX - o;
|
|
1910
|
+
if (Math.abs(c) > 2 && (n = !0), n) {
|
|
1589
1911
|
let h = 1;
|
|
1590
|
-
|
|
1591
|
-
const
|
|
1592
|
-
let
|
|
1593
|
-
e.casasDecimais !== void 0 ?
|
|
1912
|
+
p.shiftKey ? h = 0.1 : (p.ctrlKey || p.metaKey) && (h = 10);
|
|
1913
|
+
const b = e.casasDecimais !== void 0 ? e.casasDecimais : 2, x = Math.pow(10, -Math.min(b, 2));
|
|
1914
|
+
let g = a + c * x * h;
|
|
1915
|
+
e.casasDecimais !== void 0 ? g = Number(g.toFixed(e.casasDecimais)) : g = Math.round(g * 100) / 100, r.editorCtx.registrarAlteracao(i, e.id, g), r.onAtualizarCampoVisual(e.id, g);
|
|
1594
1916
|
}
|
|
1595
|
-
},
|
|
1917
|
+
}, l = (p) => {
|
|
1596
1918
|
t.classList.remove("ui-prop__col-rotulo--arrastando");
|
|
1597
1919
|
try {
|
|
1598
|
-
t.hasPointerCapture(
|
|
1920
|
+
t.hasPointerCapture(p.pointerId) && t.releasePointerCapture(p.pointerId);
|
|
1599
1921
|
} catch {
|
|
1600
1922
|
}
|
|
1601
|
-
t.removeEventListener("pointermove",
|
|
1923
|
+
t.removeEventListener("pointermove", u), t.removeEventListener("pointerup", l), t.removeEventListener("pointercancel", l);
|
|
1602
1924
|
};
|
|
1603
|
-
t.addEventListener("pointermove",
|
|
1925
|
+
t.addEventListener("pointermove", u), t.addEventListener("pointerup", l), t.addEventListener("pointercancel", l);
|
|
1604
1926
|
});
|
|
1605
1927
|
}
|
|
1606
|
-
const
|
|
1607
|
-
function
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1928
|
+
const V = 300, Ke = 480, L = /* @__PURE__ */ new WeakMap();
|
|
1929
|
+
function Qe(t) {
|
|
1930
|
+
var r, o, a;
|
|
1931
|
+
const i = t.hasAttribute("flutuante"), e = t.style;
|
|
1932
|
+
if (i) {
|
|
1933
|
+
const n = L.get(t) ?? { acoplado: { width: "", height: "" } };
|
|
1934
|
+
n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height }, L.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;
|
|
1935
|
+
} else {
|
|
1936
|
+
const n = {
|
|
1937
|
+
acoplado: { width: e.width, height: e.height },
|
|
1938
|
+
flutuante: (r = L.get(t)) == null ? void 0 : r.flutuante
|
|
1939
|
+
};
|
|
1940
|
+
if (L.set(t, n), t.setAttribute("flutuante", ""), e.position = "fixed", (o = n.flutuante) != null && o.left || (a = n.flutuante) != null && a.top)
|
|
1941
|
+
e.left = n.flutuante.left, e.top = n.flutuante.top, e.width = n.flutuante.width, e.height = n.flutuante.height;
|
|
1942
|
+
else if (!e.left && !e.top) {
|
|
1943
|
+
const s = Math.max(
|
|
1944
|
+
20,
|
|
1945
|
+
(typeof window < "u" ? window.innerWidth : 1024) - V - 30
|
|
1946
|
+
);
|
|
1947
|
+
e.left = `${s}px`, e.top = "70px", e.width = `${V}px`, e.height = `${Ke}px`;
|
|
1948
|
+
}
|
|
1617
1949
|
}
|
|
1618
|
-
return !
|
|
1950
|
+
return !i;
|
|
1619
1951
|
}
|
|
1620
|
-
function
|
|
1621
|
-
const r =
|
|
1952
|
+
function Ze(t, i, e) {
|
|
1953
|
+
const r = i.getElementById("header");
|
|
1622
1954
|
if (r) {
|
|
1623
|
-
let a = null,
|
|
1624
|
-
const
|
|
1955
|
+
let a = null, n = 0, s = 0, d = 0, u = 0;
|
|
1956
|
+
const l = (c) => {
|
|
1625
1957
|
if (a === null) return;
|
|
1626
|
-
const h =
|
|
1627
|
-
let x = d + h,
|
|
1958
|
+
const h = c.clientX - n, b = c.clientY - s;
|
|
1959
|
+
let x = d + h, g = u + b;
|
|
1628
1960
|
const f = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) - t.offsetWidth), _ = Math.max(0, (typeof window < "u" ? window.innerHeight : 768) - 30);
|
|
1629
|
-
x = Math.max(0, Math.min(f, x)),
|
|
1630
|
-
},
|
|
1961
|
+
x = Math.max(0, Math.min(f, x)), g = Math.max(0, Math.min(_, g)), t.style.left = `${x}px`, t.style.top = `${g}px`, t.style.right = "auto", t.style.bottom = "auto";
|
|
1962
|
+
}, p = (c) => {
|
|
1631
1963
|
if (a !== null) {
|
|
1632
1964
|
try {
|
|
1633
|
-
r.releasePointerCapture(
|
|
1965
|
+
r.releasePointerCapture(c.pointerId);
|
|
1634
1966
|
} catch {
|
|
1635
1967
|
}
|
|
1636
|
-
r.removeEventListener("pointermove",
|
|
1968
|
+
r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", p), r.removeEventListener("pointercancel", p), a = null, t.classList.remove("arrastando"), t.dispatchEvent(new CustomEvent("ui-mover", {
|
|
1637
1969
|
bubbles: !0,
|
|
1638
1970
|
composed: !0,
|
|
1639
1971
|
detail: { left: t.style.left, top: t.style.top }
|
|
1640
1972
|
}));
|
|
1641
1973
|
}
|
|
1642
1974
|
};
|
|
1643
|
-
e.add(r, "pointerdown", (
|
|
1644
|
-
if (!t.hasAttribute("flutuante") ||
|
|
1645
|
-
|
|
1646
|
-
const
|
|
1647
|
-
d =
|
|
1975
|
+
e.add(r, "pointerdown", (c) => {
|
|
1976
|
+
if (!t.hasAttribute("flutuante") || c.target.closest("button, input, select, a") || c.button !== 0) return;
|
|
1977
|
+
c.preventDefault(), a = c.pointerId, n = c.clientX, s = c.clientY;
|
|
1978
|
+
const b = t.getBoundingClientRect();
|
|
1979
|
+
d = b.left, u = b.top, t.classList.add("arrastando");
|
|
1648
1980
|
try {
|
|
1649
|
-
r.setPointerCapture(
|
|
1981
|
+
r.setPointerCapture(c.pointerId);
|
|
1650
1982
|
} catch {
|
|
1651
1983
|
}
|
|
1652
|
-
r.addEventListener("pointermove",
|
|
1984
|
+
r.addEventListener("pointermove", l), r.addEventListener("pointerup", p), r.addEventListener("pointercancel", p);
|
|
1653
1985
|
});
|
|
1654
1986
|
}
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
1657
|
-
let a = null,
|
|
1658
|
-
const
|
|
1987
|
+
const o = i.getElementById("resizer-canto");
|
|
1988
|
+
if (o) {
|
|
1989
|
+
let a = null, n = 0, s = 0, d = 0, u = 0;
|
|
1990
|
+
const l = (c) => {
|
|
1659
1991
|
if (a === null) return;
|
|
1660
|
-
const h = Math.max(200,
|
|
1661
|
-
t.style.width = `${h}px`, t.style.height = `${
|
|
1662
|
-
},
|
|
1992
|
+
const h = Math.max(200, n + (c.clientX - d)), b = Math.max(180, s + (c.clientY - u));
|
|
1993
|
+
t.style.width = `${h}px`, t.style.height = `${b}px`;
|
|
1994
|
+
}, p = (c) => {
|
|
1663
1995
|
if (a !== null) {
|
|
1664
1996
|
try {
|
|
1665
|
-
|
|
1997
|
+
o.releasePointerCapture(c.pointerId);
|
|
1666
1998
|
} catch {
|
|
1667
1999
|
}
|
|
1668
|
-
|
|
2000
|
+
o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", p), o.removeEventListener("pointercancel", p), a = null, t.dispatchEvent(new CustomEvent("ui-redimensionar", {
|
|
1669
2001
|
bubbles: !0,
|
|
1670
2002
|
composed: !0,
|
|
1671
2003
|
detail: { width: t.style.width, height: t.style.height }
|
|
1672
2004
|
}));
|
|
1673
2005
|
}
|
|
1674
2006
|
};
|
|
1675
|
-
e.add(
|
|
1676
|
-
if (!t.hasAttribute("flutuante") ||
|
|
1677
|
-
|
|
2007
|
+
e.add(o, "pointerdown", (c) => {
|
|
2008
|
+
if (!t.hasAttribute("flutuante") || c.button !== 0) return;
|
|
2009
|
+
c.preventDefault(), c.stopPropagation(), a = c.pointerId, d = c.clientX, u = c.clientY;
|
|
1678
2010
|
const h = t.getBoundingClientRect();
|
|
1679
|
-
|
|
2011
|
+
n = h.width, s = h.height;
|
|
1680
2012
|
try {
|
|
1681
|
-
|
|
2013
|
+
o.setPointerCapture(c.pointerId);
|
|
1682
2014
|
} catch {
|
|
1683
2015
|
}
|
|
1684
|
-
|
|
2016
|
+
o.addEventListener("pointermove", l), o.addEventListener("pointerup", p), o.addEventListener("pointercancel", p);
|
|
1685
2017
|
});
|
|
1686
2018
|
}
|
|
1687
2019
|
}
|
|
1688
|
-
function
|
|
2020
|
+
function Je(t) {
|
|
1689
2021
|
return t === "compacta" ? "ultracompacta" : t === "ultracompacta" ? "padrao" : "compacta";
|
|
1690
2022
|
}
|
|
1691
|
-
|
|
1692
|
-
constructor(o) {
|
|
1693
|
-
g(this, "valoresOriginais", {});
|
|
1694
|
-
g(this, "valoresAtuais", {});
|
|
1695
|
-
g(this, "dirty", !1);
|
|
1696
|
-
this.ctx = o;
|
|
1697
|
-
}
|
|
1698
|
-
inicializarCategorias(o) {
|
|
1699
|
-
this.valoresOriginais = {}, this.valoresAtuais = {}, this.dirty = !1, o.forEach((e) => {
|
|
1700
|
-
(e.propriedades || []).forEach((r) => {
|
|
1701
|
-
this.valoresOriginais[r.id] = r.valor, this.valoresAtuais[r.id] = r.valor;
|
|
1702
|
-
});
|
|
1703
|
-
}), this.ctx.onAtualizarBotoesFooter(this.dirty);
|
|
1704
|
-
}
|
|
1705
|
-
get isDirty() {
|
|
1706
|
-
return this.dirty;
|
|
1707
|
-
}
|
|
1708
|
-
getValores() {
|
|
1709
|
-
return { ...this.valoresAtuais };
|
|
1710
|
-
}
|
|
1711
|
-
setValores(o) {
|
|
1712
|
-
!o || typeof o != "object" || (Object.keys(o).forEach((e) => {
|
|
1713
|
-
this.valoresAtuais[e] = o[e], this.valoresOriginais[e] = o[e];
|
|
1714
|
-
}), this.dirty = !1, this.ctx.onAtualizarBotoesFooter(this.dirty));
|
|
1715
|
-
}
|
|
1716
|
-
obterValor(o) {
|
|
1717
|
-
return this.valoresAtuais[o];
|
|
1718
|
-
}
|
|
1719
|
-
definirValor(o, e, r = !0) {
|
|
1720
|
-
var a;
|
|
1721
|
-
const i = this.valoresAtuais[o];
|
|
1722
|
-
if (this.valoresAtuais[o] = e, this.dirty = !0, this.ctx.onAtualizarBotoesFooter(this.dirty), this.ctx.onAtualizarCampoVisual(o, e), r) {
|
|
1723
|
-
let l = "";
|
|
1724
|
-
for (const n of this.ctx.getCategorias())
|
|
1725
|
-
if ((a = n.propriedades) != null && a.some((d) => d.id === o)) {
|
|
1726
|
-
l = n.id;
|
|
1727
|
-
break;
|
|
1728
|
-
}
|
|
1729
|
-
this.emitirAlteracao(o, e, i, l);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
registrarAlteracao(o, e, r) {
|
|
1733
|
-
var l;
|
|
1734
|
-
const i = this.valoresAtuais[e];
|
|
1735
|
-
this.valoresAtuais[e] = r, this.dirty = !0, this.ctx.onAtualizarBotoesFooter(this.dirty);
|
|
1736
|
-
const a = (l = this.ctx.hostElement.shadowRoot) == null ? void 0 : l.querySelector(`[data-prop-id="${e}"]`);
|
|
1737
|
-
a && a.classList.add("ui-prop__linha--modificada"), this.ctx.isModoManual() || this.emitirAlteracao(e, r, i, o);
|
|
1738
|
-
}
|
|
1739
|
-
aplicar() {
|
|
1740
|
-
var e;
|
|
1741
|
-
if (!this.dirty) return;
|
|
1742
|
-
this.valoresOriginais = { ...this.valoresAtuais }, this.dirty = !1, this.ctx.onAtualizarBotoesFooter(this.dirty);
|
|
1743
|
-
const o = (e = this.ctx.hostElement.shadowRoot) == null ? void 0 : e.querySelectorAll(".ui-prop__linha--modificada");
|
|
1744
|
-
o == null || o.forEach((r) => r.classList.remove("ui-prop__linha--modificada")), this.ctx.hostElement.dispatchEvent(
|
|
1745
|
-
new CustomEvent("ui-aplicar", {
|
|
1746
|
-
bubbles: !0,
|
|
1747
|
-
composed: !0,
|
|
1748
|
-
detail: { valores: { ...this.valoresAtuais } }
|
|
1749
|
-
})
|
|
1750
|
-
);
|
|
1751
|
-
}
|
|
1752
|
-
desfazer() {
|
|
1753
|
-
this.dirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.dirty = !1, this.ctx.onAtualizarBotoesFooter(this.dirty), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
1754
|
-
new CustomEvent("ui-desfazer", {
|
|
1755
|
-
bubbles: !0,
|
|
1756
|
-
composed: !0,
|
|
1757
|
-
detail: { valores: { ...this.valoresAtuais } }
|
|
1758
|
-
})
|
|
1759
|
-
));
|
|
1760
|
-
}
|
|
1761
|
-
emitirAlteracao(o, e, r, i = "") {
|
|
1762
|
-
this.ctx.hostElement.dispatchEvent(
|
|
1763
|
-
new CustomEvent("ui-propriedade-alterada", {
|
|
1764
|
-
bubbles: !0,
|
|
1765
|
-
composed: !0,
|
|
1766
|
-
detail: {
|
|
1767
|
-
id: o,
|
|
1768
|
-
categoriaId: i,
|
|
1769
|
-
valor: e,
|
|
1770
|
-
valorAnterior: r,
|
|
1771
|
-
todosValores: { ...this.valoresAtuais }
|
|
1772
|
-
}
|
|
1773
|
-
})
|
|
1774
|
-
);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
function Se(t) {
|
|
2023
|
+
function et(t) {
|
|
1778
2024
|
const {
|
|
1779
|
-
shadow:
|
|
2025
|
+
shadow: i,
|
|
1780
2026
|
listeners: e,
|
|
1781
2027
|
host: r,
|
|
1782
|
-
onToggleExpandirTodas:
|
|
2028
|
+
onToggleExpandirTodas: o,
|
|
1783
2029
|
onFiltrar: a,
|
|
1784
|
-
onAplicar:
|
|
1785
|
-
onDesfazer:
|
|
2030
|
+
onAplicar: n,
|
|
2031
|
+
onDesfazer: s,
|
|
1786
2032
|
onAlternarDensidade: d,
|
|
1787
|
-
onAlternarFlutuante:
|
|
1788
|
-
onAlternarColapsoHorizontal:
|
|
1789
|
-
} = t,
|
|
1790
|
-
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
const h =
|
|
1794
|
-
h &&
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1797
|
-
|
|
2033
|
+
onAlternarFlutuante: u,
|
|
2034
|
+
onAlternarColapsoHorizontal: l
|
|
2035
|
+
} = t, p = i.getElementById("btn-flutuante");
|
|
2036
|
+
p && u && e.add(p, "click", u);
|
|
2037
|
+
const c = i.getElementById("btn-colapsar-horizontal");
|
|
2038
|
+
c && l && e.add(c, "click", l);
|
|
2039
|
+
const h = i.getElementById("faixa-estreita");
|
|
2040
|
+
h && l && e.add(h, "click", l);
|
|
2041
|
+
const b = i.getElementById("btn-expandir-faixa");
|
|
2042
|
+
b && l && e.add(b, "click", (A) => {
|
|
2043
|
+
A.stopPropagation(), l();
|
|
1798
2044
|
});
|
|
1799
|
-
const x =
|
|
2045
|
+
const x = i.getElementById("btn-densidade");
|
|
1800
2046
|
x && d && e.add(x, "click", d);
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
const f =
|
|
2047
|
+
const g = i.getElementById("btn-expandir-tudo");
|
|
2048
|
+
g && e.add(g, "click", o);
|
|
2049
|
+
const f = i.getElementById("btn-fechar");
|
|
1804
2050
|
f && e.add(f, "click", () => {
|
|
1805
2051
|
r.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
1806
2052
|
});
|
|
1807
|
-
const _ =
|
|
2053
|
+
const _ = i.getElementById("filtro-input");
|
|
1808
2054
|
_ && e.add(_, "input", () => {
|
|
1809
|
-
const
|
|
1810
|
-
a(
|
|
2055
|
+
const A = (_.value || "").trim().toLowerCase();
|
|
2056
|
+
a(A);
|
|
1811
2057
|
});
|
|
1812
|
-
const E =
|
|
1813
|
-
E && e.add(E, "click",
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1816
|
-
const v =
|
|
1817
|
-
v && e.add(v, "click", () => {
|
|
1818
|
-
r.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
|
|
2058
|
+
const E = i.getElementById("btn-aplicar");
|
|
2059
|
+
E && e.add(E, "click", n);
|
|
2060
|
+
const w = i.getElementById("btn-desfazer");
|
|
2061
|
+
w && e.add(w, "click", s);
|
|
2062
|
+
const v = i.getElementById("link-ajuda");
|
|
2063
|
+
v && e.add(v, "click", (A) => {
|
|
2064
|
+
A.preventDefault(), r.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
|
|
1819
2065
|
});
|
|
1820
2066
|
}
|
|
1821
|
-
function
|
|
2067
|
+
function S(t, i) {
|
|
1822
2068
|
const e = t.getElementById("header-titulo-texto");
|
|
1823
|
-
e && (e.textContent =
|
|
2069
|
+
e && (e.textContent = i.getAttribute("titulo") || "Propriedades");
|
|
1824
2070
|
const r = t.getElementById("btn-fechar");
|
|
1825
|
-
r && (r.style.display =
|
|
1826
|
-
const
|
|
1827
|
-
if (
|
|
1828
|
-
const
|
|
1829
|
-
|
|
2071
|
+
r && (r.style.display = i.hasAttribute("fechavel") ? "inline-flex" : "none");
|
|
2072
|
+
const o = t.getElementById("btn-flutuante");
|
|
2073
|
+
if (o) {
|
|
2074
|
+
const u = i.hasAttribute("flutuante");
|
|
2075
|
+
o.title = u ? "Acoplar painel (Dock)" : "Desacoplar / Modo flutuante (CAD)", o.classList.toggle("ui-prop__btn-icone--ativo", u);
|
|
1830
2076
|
}
|
|
1831
2077
|
const a = t.getElementById("btn-colapsar-horizontal");
|
|
1832
2078
|
if (a) {
|
|
1833
|
-
const
|
|
1834
|
-
a.title =
|
|
2079
|
+
const u = i.hasAttribute("colapsado");
|
|
2080
|
+
a.title = u ? "Expandir painel" : "Recolher para coluna estreita", a.classList.toggle("ui-prop__btn-icone--ativo", u);
|
|
1835
2081
|
}
|
|
1836
|
-
const
|
|
1837
|
-
if (
|
|
1838
|
-
const
|
|
1839
|
-
|
|
2082
|
+
const n = t.getElementById("btn-densidade");
|
|
2083
|
+
if (n) {
|
|
2084
|
+
const u = i.getAttribute("densidade") || "padrão";
|
|
2085
|
+
n.title = `Compressão vertical: ${u} (clique para alternar)`;
|
|
1840
2086
|
}
|
|
1841
|
-
const
|
|
1842
|
-
|
|
2087
|
+
const s = t.getElementById("filtro-container");
|
|
2088
|
+
s && (s.style.display = i.hasAttribute("filtro") ? "flex" : "none");
|
|
1843
2089
|
const d = t.getElementById("footer");
|
|
1844
|
-
d && (d.style.display =
|
|
1845
|
-
}
|
|
1846
|
-
function Le(t, o) {
|
|
1847
|
-
const e = Array.from(
|
|
1848
|
-
t.querySelectorAll(
|
|
1849
|
-
'.ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__linha select:not([disabled]), .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled])'
|
|
1850
|
-
)
|
|
1851
|
-
), r = e.indexOf(o);
|
|
1852
|
-
if (r !== -1 && r + 1 < e.length) {
|
|
1853
|
-
const i = e[r + 1];
|
|
1854
|
-
i.focus(), i instanceof HTMLInputElement && i.select();
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
function S(t, o, e) {
|
|
1858
|
-
const r = t.querySelector(`[data-prop-id="${o}"]`);
|
|
1859
|
-
if (!r) return;
|
|
1860
|
-
const i = r.querySelector('input:not([type="color"]):not(.ui-prop__cor-picker-oculto)');
|
|
1861
|
-
i && (i.value = String(e ?? ""));
|
|
2090
|
+
d && (d.style.display = i.getAttribute("modo-aplicar") === "manual" ? "flex" : "none");
|
|
1862
2091
|
}
|
|
1863
|
-
|
|
1864
|
-
o.forEach((r) => r.aberto = !0), t.querySelectorAll(".ui-prop__categoria").forEach((r) => r.classList.add("ui-prop__categoria--aberta"));
|
|
1865
|
-
}
|
|
1866
|
-
function Be(t, o) {
|
|
1867
|
-
o.forEach((r) => r.aberto = !1), t.querySelectorAll(".ui-prop__categoria").forEach((r) => r.classList.remove("ui-prop__categoria--aberta"));
|
|
1868
|
-
}
|
|
1869
|
-
function Ne(t, o, e, r) {
|
|
1870
|
-
const i = e.find((a) => a.id === r);
|
|
1871
|
-
if (i) {
|
|
1872
|
-
i.aberto = i.aberto === !1;
|
|
1873
|
-
const a = t.querySelector(`[data-cat-id="${r}"]`);
|
|
1874
|
-
a && a.classList.toggle("ui-prop__categoria--aberta", !!i.aberto), o.dispatchEvent(
|
|
1875
|
-
new CustomEvent("ui-categoria-toggle", {
|
|
1876
|
-
bubbles: !0,
|
|
1877
|
-
composed: !0,
|
|
1878
|
-
detail: { id: r, aberto: i.aberto }
|
|
1879
|
-
})
|
|
1880
|
-
);
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
class Te extends M {
|
|
2092
|
+
class tt extends j {
|
|
1884
2093
|
constructor() {
|
|
1885
2094
|
super();
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML =
|
|
2095
|
+
m(this, "shadow");
|
|
2096
|
+
m(this, "listeners", new B());
|
|
2097
|
+
m(this, "splitterListeners", new B());
|
|
2098
|
+
m(this, "controladorSplitter");
|
|
2099
|
+
m(this, "gerenciadorValores");
|
|
2100
|
+
m(this, "_categorias", []);
|
|
2101
|
+
m(this, "_tipos", []);
|
|
2102
|
+
m(this, "_tipoSelecionadoId", "");
|
|
2103
|
+
m(this, "_termoBusca", "");
|
|
2104
|
+
m(this, "_larguraRotuloPorcentagem", 45);
|
|
2105
|
+
m(this, "tipoContainerElement");
|
|
2106
|
+
m(this, "corpoElement");
|
|
2107
|
+
m(this, "btnAplicarElement");
|
|
2108
|
+
m(this, "btnDesfazerElement");
|
|
2109
|
+
m(this, "splitterElement");
|
|
2110
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = We(), 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 Ue({
|
|
1902
2111
|
hostElement: this,
|
|
1903
2112
|
getCategorias: () => this._categorias,
|
|
1904
2113
|
onAtualizarBotoesFooter: (e) => {
|
|
1905
2114
|
this.btnAplicarElement.disabled = !e, this.btnDesfazerElement.disabled = !e;
|
|
1906
2115
|
},
|
|
1907
|
-
onAtualizarCampoVisual: (e, r) =>
|
|
2116
|
+
onAtualizarCampoVisual: (e, r) => H(this.shadow, e, r),
|
|
1908
2117
|
onRenderCategorias: () => this.renderCategorias(),
|
|
1909
2118
|
isModoManual: () => this.getAttribute("modo-aplicar") === "manual"
|
|
1910
|
-
}), this.controladorSplitter =
|
|
2119
|
+
}), this.controladorSplitter = je({
|
|
1911
2120
|
hostElement: this,
|
|
1912
2121
|
corpoElement: this.corpoElement,
|
|
1913
2122
|
splitterElement: this.splitterElement,
|
|
@@ -1934,7 +2143,7 @@ class Te extends M {
|
|
|
1934
2143
|
return this._larguraRotuloPorcentagem;
|
|
1935
2144
|
}
|
|
1936
2145
|
connectedCallback() {
|
|
1937
|
-
this.listeners.cleanup(),
|
|
2146
|
+
this.listeners.cleanup(), et({
|
|
1938
2147
|
shadow: this.shadow,
|
|
1939
2148
|
listeners: this.listeners,
|
|
1940
2149
|
host: this,
|
|
@@ -1947,17 +2156,36 @@ class Te extends M {
|
|
|
1947
2156
|
onAlternarDensidade: () => this.alternarDensidade(),
|
|
1948
2157
|
onAlternarFlutuante: () => this.alternarFlutuante(),
|
|
1949
2158
|
onAlternarColapsoHorizontal: () => this.alternarColapsoHorizontal()
|
|
1950
|
-
}),
|
|
2159
|
+
}), Ze(this, this.shadow, this.listeners), this.controladorSplitter.init(), this.syncState();
|
|
1951
2160
|
}
|
|
1952
2161
|
disconnectedCallback() {
|
|
1953
2162
|
this.listeners.cleanup(), this.splitterListeners.cleanup();
|
|
1954
2163
|
}
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2164
|
+
/**
|
|
2165
|
+
* Cada atributo atualiza só o que depende dele: redesenhar todas as linhas (ex.: ao trocar o
|
|
2166
|
+
* `titulo`) tiraria o foco de um campo em edição.
|
|
2167
|
+
*/
|
|
2168
|
+
attributeChangedCallback(e, r, o) {
|
|
2169
|
+
if (r !== o)
|
|
2170
|
+
switch (e) {
|
|
2171
|
+
case "largura-rotulo": {
|
|
2172
|
+
const a = parseFloat(o ?? "");
|
|
2173
|
+
isNaN(a) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(a));
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
case "estilo-visual":
|
|
2177
|
+
this.renderSeletorTipos();
|
|
2178
|
+
return;
|
|
2179
|
+
case "filtro":
|
|
2180
|
+
if (S(this.shadow, this), o === null && this._termoBusca) {
|
|
2181
|
+
this._termoBusca = "";
|
|
2182
|
+
const a = this.shadow.getElementById("filtro-input");
|
|
2183
|
+
a && (a.value = ""), this.renderCategorias();
|
|
2184
|
+
}
|
|
2185
|
+
return;
|
|
2186
|
+
default:
|
|
2187
|
+
S(this.shadow, this);
|
|
2188
|
+
}
|
|
1961
2189
|
}
|
|
1962
2190
|
get categorias() {
|
|
1963
2191
|
return this._categorias;
|
|
@@ -1992,8 +2220,8 @@ class Te extends M {
|
|
|
1992
2220
|
obterValor(e) {
|
|
1993
2221
|
return this.gerenciadorValores.obterValor(e);
|
|
1994
2222
|
}
|
|
1995
|
-
definirValor(e, r,
|
|
1996
|
-
this.gerenciadorValores.definirValor(e, r,
|
|
2223
|
+
definirValor(e, r, o = !0) {
|
|
2224
|
+
this.gerenciadorValores.definirValor(e, r, o);
|
|
1997
2225
|
}
|
|
1998
2226
|
aplicar() {
|
|
1999
2227
|
this.gerenciadorValores.aplicar();
|
|
@@ -2002,13 +2230,13 @@ class Te extends M {
|
|
|
2002
2230
|
this.gerenciadorValores.desfazer();
|
|
2003
2231
|
}
|
|
2004
2232
|
expandirTudo() {
|
|
2005
|
-
|
|
2233
|
+
ze(this.shadow, this._categorias);
|
|
2006
2234
|
}
|
|
2007
2235
|
colapsarTudo() {
|
|
2008
|
-
|
|
2236
|
+
Se(this.shadow, this._categorias);
|
|
2009
2237
|
}
|
|
2010
2238
|
toggleCategoria(e) {
|
|
2011
|
-
|
|
2239
|
+
Le(this.shadow, this, this._categorias, e);
|
|
2012
2240
|
}
|
|
2013
2241
|
get densidade() {
|
|
2014
2242
|
return this.getAttribute("densidade") || "padrao";
|
|
@@ -2017,14 +2245,14 @@ class Te extends M {
|
|
|
2017
2245
|
!e || e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e);
|
|
2018
2246
|
}
|
|
2019
2247
|
alternarDensidade() {
|
|
2020
|
-
const e =
|
|
2248
|
+
const e = Je(this.getAttribute("densidade") || "padrao");
|
|
2021
2249
|
return e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e), this.dispatchEvent(
|
|
2022
2250
|
new CustomEvent("ui-densidade-alterada", {
|
|
2023
2251
|
bubbles: !0,
|
|
2024
2252
|
composed: !0,
|
|
2025
2253
|
detail: { densidade: e }
|
|
2026
2254
|
})
|
|
2027
|
-
),
|
|
2255
|
+
), S(this.shadow, this), e;
|
|
2028
2256
|
}
|
|
2029
2257
|
get flutuante() {
|
|
2030
2258
|
return this.hasAttribute("flutuante");
|
|
@@ -2039,8 +2267,8 @@ class Te extends M {
|
|
|
2039
2267
|
!!e !== this.hasAttribute("colapsado") && this.alternarColapsoHorizontal();
|
|
2040
2268
|
}
|
|
2041
2269
|
alternarFlutuante() {
|
|
2042
|
-
const e =
|
|
2043
|
-
return
|
|
2270
|
+
const e = Qe(this);
|
|
2271
|
+
return S(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-flutuante-alterado", {
|
|
2044
2272
|
bubbles: !0,
|
|
2045
2273
|
composed: !0,
|
|
2046
2274
|
detail: {
|
|
@@ -2056,14 +2284,14 @@ class Te extends M {
|
|
|
2056
2284
|
const e = this.hasAttribute("colapsado");
|
|
2057
2285
|
e ? this.removeAttribute("colapsado") : this.setAttribute("colapsado", "");
|
|
2058
2286
|
const r = !e;
|
|
2059
|
-
return
|
|
2287
|
+
return S(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-colapso-horizontal", {
|
|
2060
2288
|
bubbles: !0,
|
|
2061
2289
|
composed: !0,
|
|
2062
2290
|
detail: { colapsado: r }
|
|
2063
2291
|
})), r;
|
|
2064
2292
|
}
|
|
2065
2293
|
syncState() {
|
|
2066
|
-
|
|
2294
|
+
S(this.shadow, this);
|
|
2067
2295
|
const e = this.getAttribute("largura-rotulo");
|
|
2068
2296
|
if (e) {
|
|
2069
2297
|
const r = parseFloat(e);
|
|
@@ -2075,14 +2303,14 @@ class Te extends M {
|
|
|
2075
2303
|
this._categorias.some((r) => r.aberto === !1) ? this.expandirTudo() : this.colapsarTudo();
|
|
2076
2304
|
}
|
|
2077
2305
|
renderSeletorTipos() {
|
|
2078
|
-
|
|
2306
|
+
qe({
|
|
2079
2307
|
tipoContainerElement: this.tipoContainerElement,
|
|
2080
2308
|
tipos: this._tipos,
|
|
2081
2309
|
tipoSelecionadoId: this._tipoSelecionadoId,
|
|
2082
2310
|
estiloVisual: this.getAttribute("estilo-visual") || "autocad",
|
|
2083
2311
|
onSelecionarTipo: (e) => {
|
|
2084
2312
|
this._tipoSelecionadoId = e, this.renderSeletorTipos();
|
|
2085
|
-
const r = this._tipos.find((
|
|
2313
|
+
const r = this._tipos.find((o) => String(o.id) === String(e));
|
|
2086
2314
|
this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo: r } }));
|
|
2087
2315
|
},
|
|
2088
2316
|
onEditarTipo: (e) => this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
@@ -2093,28 +2321,27 @@ class Te extends M {
|
|
|
2093
2321
|
}
|
|
2094
2322
|
renderCategorias() {
|
|
2095
2323
|
const e = this.shadow.getElementById("lista-categorias");
|
|
2096
|
-
e &&
|
|
2324
|
+
e && Xe({
|
|
2097
2325
|
listaContainer: e,
|
|
2098
2326
|
categorias: this._categorias,
|
|
2099
2327
|
termoBusca: this._termoBusca,
|
|
2100
2328
|
onToggleCategoria: (r) => this.toggleCategoria(r),
|
|
2101
2329
|
linhaCtx: {
|
|
2102
2330
|
valoresAtuais: this.gerenciadorValores.getValores(),
|
|
2103
|
-
valoresOriginais:
|
|
2104
|
-
|
|
2105
|
-
onAtualizarCampoVisual: (r, i) => S(this.shadow, r, i),
|
|
2331
|
+
valoresOriginais: this.gerenciadorValores.getValoresOriginais(),
|
|
2332
|
+
onAtualizarCampoVisual: (r, o) => H(this.shadow, r, o),
|
|
2106
2333
|
editorCtx: {
|
|
2107
2334
|
obterValorAtual: (r) => this.gerenciadorValores.obterValor(r),
|
|
2108
|
-
registrarAlteracao: (r,
|
|
2109
|
-
this.gerenciadorValores.registrarAlteracao(r,
|
|
2335
|
+
registrarAlteracao: (r, o, a) => {
|
|
2336
|
+
this.gerenciadorValores.registrarAlteracao(r, o, a);
|
|
2110
2337
|
},
|
|
2111
|
-
focarProximoEditor: (r) =>
|
|
2112
|
-
despacharEventoAcao: (r,
|
|
2338
|
+
focarProximoEditor: (r) => ke(this.shadow, r),
|
|
2339
|
+
despacharEventoAcao: (r, o) => {
|
|
2113
2340
|
this.dispatchEvent(
|
|
2114
2341
|
new CustomEvent("ui-acao-clique", {
|
|
2115
2342
|
bubbles: !0,
|
|
2116
2343
|
composed: !0,
|
|
2117
|
-
detail: { id: r.id, categoriaId:
|
|
2344
|
+
detail: { id: r.id, categoriaId: o, propriedade: r }
|
|
2118
2345
|
})
|
|
2119
2346
|
);
|
|
2120
2347
|
}
|
|
@@ -2123,58 +2350,63 @@ class Te extends M {
|
|
|
2123
2350
|
});
|
|
2124
2351
|
}
|
|
2125
2352
|
}
|
|
2126
|
-
|
|
2353
|
+
q("ui-tabela-propriedades", tt);
|
|
2127
2354
|
export {
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
ze as
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
$ as
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2355
|
+
S as $,
|
|
2356
|
+
Ye as A,
|
|
2357
|
+
ve as B,
|
|
2358
|
+
xe as C,
|
|
2359
|
+
be as D,
|
|
2360
|
+
ge as E,
|
|
2361
|
+
ze as F,
|
|
2362
|
+
Ue as G,
|
|
2363
|
+
ke as H,
|
|
2364
|
+
$ as I,
|
|
2365
|
+
W as J,
|
|
2366
|
+
O as K,
|
|
2367
|
+
U as L,
|
|
2368
|
+
_e as M,
|
|
2369
|
+
me as N,
|
|
2370
|
+
P as O,
|
|
2371
|
+
ae as P,
|
|
2372
|
+
ue as Q,
|
|
2373
|
+
Ee as R,
|
|
2374
|
+
Je as S,
|
|
2375
|
+
de as T,
|
|
2376
|
+
ye as U,
|
|
2377
|
+
y as V,
|
|
2378
|
+
Xe as W,
|
|
2379
|
+
he as X,
|
|
2380
|
+
pe as Y,
|
|
2381
|
+
qe as Z,
|
|
2382
|
+
X as _,
|
|
2383
|
+
ie as a,
|
|
2384
|
+
C as a0,
|
|
2385
|
+
we as a1,
|
|
2386
|
+
M as a2,
|
|
2387
|
+
ne as b,
|
|
2388
|
+
tt as c,
|
|
2389
|
+
fe as d,
|
|
2390
|
+
Le as e,
|
|
2391
|
+
se as f,
|
|
2392
|
+
Qe as g,
|
|
2393
|
+
le as h,
|
|
2394
|
+
H as i,
|
|
2395
|
+
F as j,
|
|
2396
|
+
Y as k,
|
|
2397
|
+
Se as l,
|
|
2398
|
+
Ze as m,
|
|
2399
|
+
et as n,
|
|
2400
|
+
je as o,
|
|
2401
|
+
Te as p,
|
|
2402
|
+
Be as q,
|
|
2403
|
+
Fe as r,
|
|
2404
|
+
He as s,
|
|
2405
|
+
Re as t,
|
|
2406
|
+
Pe as u,
|
|
2407
|
+
Ne as v,
|
|
2408
|
+
Me as w,
|
|
2409
|
+
De as x,
|
|
2410
|
+
Ie as y,
|
|
2411
|
+
Ve as z
|
|
2180
2412
|
};
|