@thibezer/ui-components-kit 2.22.0 → 2.24.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 +88 -0
- package/README.md +822 -820
- package/dist/camadas.cjs +1 -311
- package/dist/camadas.js +148 -3248
- package/dist/canvas.cjs +24 -24
- package/dist/canvas.js +90 -88
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-calendario/calendario-datas.d.ts +28 -0
- package/dist/components/ui-calendario/calendario-teclado.d.ts +6 -0
- package/dist/components/ui-calendario/calendario-template.d.ts +14 -0
- package/dist/components/ui-calendario/index.d.ts +1 -0
- package/dist/components/ui-calendario/tipos.d.ts +43 -0
- package/dist/components/ui-calendario/ui-calendario.d.ts +81 -0
- package/dist/components/ui-canvas-prancha/index.d.ts +3 -1
- package/dist/components/ui-canvas-prancha/prancha-atributos-sync.d.ts +10 -1
- package/dist/components/ui-canvas-prancha/prancha-controlador.d.ts +7 -0
- package/dist/components/ui-canvas-prancha/prancha-documento.d.ts +6 -0
- package/dist/components/ui-canvas-prancha/prancha-paineis.d.ts +29 -0
- package/dist/components/ui-canvas-prancha/prancha-painel-camadas.d.ts +10 -1
- package/dist/components/ui-canvas-prancha/prancha-painel-propriedades.d.ts +18 -0
- package/dist/components/ui-canvas-prancha/prancha-pintura.d.ts +7 -0
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +2 -0
- package/dist/components/ui-canvas-prancha/prancha-vista.d.ts +2 -0
- package/dist/components/ui-canvas-prancha/tipos.d.ts +18 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +43 -6
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha.d.ts +13 -5
- package/dist/components/ui-card/ui-card.d.ts +5 -0
- package/dist/components/ui-editor-prancha/editor-tipos.d.ts +12 -0
- package/dist/components/ui-editor-prancha/index.d.ts +2 -0
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +60 -0
- package/dist/custom-elements.json +34861 -32534
- package/dist/data.cjs +1 -1
- package/dist/data.js +99 -98
- package/dist/feature_caixa-2Sxv3tGa.js +824 -0
- package/dist/feature_caixa-4M4MkFH7.cjs +1 -0
- package/dist/feature_desenho-BH-E1Q9Q.cjs +1 -0
- package/dist/feature_desenho-BVHivWIB.js +222 -0
- package/dist/feature_historico-BAIYk1Me.cjs +3 -0
- package/dist/feature_historico-C4h9y5fu.js +3039 -0
- package/dist/geometria-px-DUs5FgLE.js +639 -0
- package/dist/gerencigeo-canvas/prancha/ajuste_caixa.d.ts +32 -0
- package/dist/gerencigeo-canvas/prancha/aparencia_lote.d.ts +49 -0
- package/dist/gerencigeo-canvas/prancha/elemento_predefinicoes.d.ts +36 -3
- package/dist/gerencigeo-canvas/prancha/envelope_visual.d.ts +12 -0
- package/dist/gerencigeo-canvas/prancha/index.d.ts +5 -0
- package/dist/gerencigeo-canvas/prancha/pintura_canvas.d.ts +43 -3
- package/dist/gerencigeo-canvas/prancha/pintura_contexto.d.ts +54 -0
- package/dist/gerencigeo-canvas/prancha/pintura_gradiente_faixas.d.ts +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +245 -242
- package/dist/motor.js +15 -15
- package/dist/prancha-nucleo.cjs +1 -0
- package/dist/prancha-nucleo.d.ts +3 -0
- package/dist/prancha-nucleo.js +302 -0
- package/dist/prancha.cjs +1 -1
- package/dist/prancha.d.ts +3 -0
- package/dist/prancha.js +228 -197
- package/dist/register.cjs +1 -1
- package/dist/register.js +8 -6
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +90 -89
- package/dist/tipos-elementos.d.ts +56 -1
- package/dist/tipos-react.d.ts +4 -0
- package/dist/tipos-vue.d.ts +56 -1
- package/dist/ui-camadas-DoHPnbQm.js +3133 -0
- package/dist/ui-camadas-Vx7wYD4D.cjs +311 -0
- package/dist/ui-card-7IEYbCN0.js +150 -0
- package/dist/ui-card-Bx8EyzYY.cjs +20 -0
- package/dist/ui-editor-prancha-CIngI6yI.js +2886 -0
- package/dist/ui-editor-prancha-DorSe6sC.cjs +31 -0
- package/dist/ui-linha-B4mBRm1x.cjs +61 -0
- package/dist/ui-linha-DTEIIww4.js +1167 -0
- package/dist/ui-tabela-CXxqbwXv.cjs +7 -0
- package/dist/ui-tabela-Cd0vOwnT.js +1459 -0
- package/dist/ui-tabela-propriedades-D96Djx-q.cjs +136 -0
- package/dist/ui-tabela-propriedades-ahQhQauu.js +2329 -0
- package/package.json +6 -1
|
@@ -0,0 +1,2329 @@
|
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var ke = (r, t, e) => t in r ? Ce(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var w = (r, t, e) => ke(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { L as ue } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { h as ze } from "./svg-seguro-ChVJ2L2z.js";
|
|
6
|
+
import { a as R } from "./parts-CaoQiCfI.js";
|
|
7
|
+
import { d as te, S as Se } from "./ssr-safe-5cWfJP-s.js";
|
|
8
|
+
import { A as Le, a as pe, e as Me } from "./degrade-gDa5sW__.js";
|
|
9
|
+
const k = Object.freeze({
|
|
10
|
+
vazio: "Nenhuma propriedade disponível.",
|
|
11
|
+
vazioBusca: 'Nenhuma propriedade encontrada para "{termo}".',
|
|
12
|
+
sim: "Sim",
|
|
13
|
+
nao: "Não",
|
|
14
|
+
editarAcao: "Editar...",
|
|
15
|
+
selecionarCor: "Selecionar cor...",
|
|
16
|
+
editarTipo: "Editar tipo",
|
|
17
|
+
tipoFamilia: "Tipo de Família",
|
|
18
|
+
restaurarValor: "Restaurar valor original",
|
|
19
|
+
filtroPlaceholder: "Filtrar propriedades...",
|
|
20
|
+
aplicar: "Aplicar",
|
|
21
|
+
desfazer: "Desfazer",
|
|
22
|
+
ajuda: "Ajuda de propriedades"
|
|
23
|
+
});
|
|
24
|
+
function $(r, t) {
|
|
25
|
+
const e = r == null ? void 0 : r.obterTexto;
|
|
26
|
+
if (typeof e == "function")
|
|
27
|
+
try {
|
|
28
|
+
const i = e.call(r, t);
|
|
29
|
+
if (typeof i == "string" && i) return i;
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
return k[t];
|
|
33
|
+
}
|
|
34
|
+
const M = Math.PI / 180, he = 64;
|
|
35
|
+
function B(r) {
|
|
36
|
+
return Math.abs(r) < 1e-12 ? 0 : Number(r.toPrecision(15));
|
|
37
|
+
}
|
|
38
|
+
const Be = {
|
|
39
|
+
sqrt: Math.sqrt,
|
|
40
|
+
abs: Math.abs,
|
|
41
|
+
round: Math.round,
|
|
42
|
+
floor: Math.floor,
|
|
43
|
+
ceil: Math.ceil,
|
|
44
|
+
trunc: Math.trunc,
|
|
45
|
+
sign: Math.sign,
|
|
46
|
+
log: Math.log10,
|
|
47
|
+
ln: Math.log,
|
|
48
|
+
deg: (r) => B(r / M),
|
|
49
|
+
rad: (r) => B(r * M),
|
|
50
|
+
sin: (r) => B(Math.sin(r * M)),
|
|
51
|
+
cos: (r) => B(Math.cos(r * M)),
|
|
52
|
+
tan: (r) => B(Math.tan(r * M)),
|
|
53
|
+
asin: (r) => B(Math.asin(r) / M),
|
|
54
|
+
acos: (r) => B(Math.acos(r) / M),
|
|
55
|
+
atan: (r) => B(Math.atan(r) / M)
|
|
56
|
+
}, Ne = {
|
|
57
|
+
min: (r) => r.length > 0 ? Math.min(...r) : NaN,
|
|
58
|
+
max: (r) => r.length > 0 ? Math.max(...r) : NaN,
|
|
59
|
+
pow: (r) => r.length === 2 ? Math.pow(r[0], r[1]) : NaN,
|
|
60
|
+
hypot: (r) => r.length >= 2 ? Math.hypot(...r) : NaN,
|
|
61
|
+
atan2: (r) => r.length === 2 ? B(Math.atan2(r[0], r[1]) / M) : NaN,
|
|
62
|
+
mod: (r) => r.length === 2 && r[1] !== 0 ? r[0] % r[1] : NaN
|
|
63
|
+
};
|
|
64
|
+
function Pe(r) {
|
|
65
|
+
if (!r || typeof r != "string") return null;
|
|
66
|
+
let t = r.trim();
|
|
67
|
+
if (t.startsWith("=") && (t = t.slice(1).trim()), !t) return null;
|
|
68
|
+
t = t.replace(/(\d),(\d)/g, "$1.$2");
|
|
69
|
+
let e = 0, i = 0, o = !1;
|
|
70
|
+
function a() {
|
|
71
|
+
return t[e] || "";
|
|
72
|
+
}
|
|
73
|
+
function n() {
|
|
74
|
+
return t[e++] || "";
|
|
75
|
+
}
|
|
76
|
+
function s() {
|
|
77
|
+
for (; e < t.length && /\s/.test(t[e]); )
|
|
78
|
+
e++;
|
|
79
|
+
}
|
|
80
|
+
function u() {
|
|
81
|
+
if (s(), !(e >= t.length) && n() !== ")")
|
|
82
|
+
throw new Error("Parêntese sem fechamento");
|
|
83
|
+
}
|
|
84
|
+
function l() {
|
|
85
|
+
if (++i > he)
|
|
86
|
+
throw new Error("Profundidade máxima excedida");
|
|
87
|
+
try {
|
|
88
|
+
s();
|
|
89
|
+
let c = m();
|
|
90
|
+
for (s(); e < t.length; ) {
|
|
91
|
+
const h = a();
|
|
92
|
+
if (h === "+" || h === "-") {
|
|
93
|
+
n(), s();
|
|
94
|
+
const f = m(), g = o;
|
|
95
|
+
s(), g ? c = h === "+" ? c + c * f : c - c * f : c = h === "+" ? c + f : c - f, o = !1;
|
|
96
|
+
} else
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
return c;
|
|
100
|
+
} finally {
|
|
101
|
+
i--;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function m() {
|
|
105
|
+
s();
|
|
106
|
+
let c = d(), h = o;
|
|
107
|
+
for (s(); e < t.length; ) {
|
|
108
|
+
const f = a();
|
|
109
|
+
if (f === "*" || f === "/" || f === "x" || f === "X") {
|
|
110
|
+
n(), s();
|
|
111
|
+
const g = d();
|
|
112
|
+
if (h = !1, f === "/" && g === 0)
|
|
113
|
+
throw new Error("Divisão por zero");
|
|
114
|
+
c = f === "/" ? c / g : c * g, s();
|
|
115
|
+
} else
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
return o = h, c;
|
|
119
|
+
}
|
|
120
|
+
function d() {
|
|
121
|
+
if (++i > he)
|
|
122
|
+
throw new Error("Profundidade máxima excedida");
|
|
123
|
+
try {
|
|
124
|
+
s();
|
|
125
|
+
const c = a();
|
|
126
|
+
if (c === "+" || c === "-") {
|
|
127
|
+
n();
|
|
128
|
+
const g = d();
|
|
129
|
+
return c === "-" ? -g : g;
|
|
130
|
+
}
|
|
131
|
+
let h = p();
|
|
132
|
+
const f = o;
|
|
133
|
+
if (s(), a() === "^") {
|
|
134
|
+
n();
|
|
135
|
+
const g = d();
|
|
136
|
+
h = Math.pow(h, g), o = !1;
|
|
137
|
+
} else if (t.slice(e, e + 2) === "**") {
|
|
138
|
+
e += 2;
|
|
139
|
+
const g = d();
|
|
140
|
+
h = Math.pow(h, g), o = !1;
|
|
141
|
+
} else
|
|
142
|
+
o = f;
|
|
143
|
+
return h;
|
|
144
|
+
} finally {
|
|
145
|
+
i--;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function p() {
|
|
149
|
+
s(), o = !1;
|
|
150
|
+
const c = a();
|
|
151
|
+
if (c === "+" || c === "-") {
|
|
152
|
+
n();
|
|
153
|
+
const b = p();
|
|
154
|
+
return c === "-" ? -b : b;
|
|
155
|
+
}
|
|
156
|
+
if (c === "(") {
|
|
157
|
+
n();
|
|
158
|
+
const b = l();
|
|
159
|
+
return u(), s(), a() === "%" ? (n(), o = !0, b / 100) : (o = !1, b);
|
|
160
|
+
}
|
|
161
|
+
const h = t.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);
|
|
162
|
+
if (h) {
|
|
163
|
+
const b = h[1].toLowerCase(), v = Be[b], x = Ne[b];
|
|
164
|
+
if (!v && !x)
|
|
165
|
+
throw new Error("Função desconhecida: " + h[1]);
|
|
166
|
+
e += h[0].length;
|
|
167
|
+
const E = [l()];
|
|
168
|
+
for (; ; ) {
|
|
169
|
+
s();
|
|
170
|
+
const z = a();
|
|
171
|
+
if (z === ";" || z === ",")
|
|
172
|
+
n(), s(), E.push(l());
|
|
173
|
+
else if (z !== "" && /[0-9.(a-zA-Zπ]/.test(z))
|
|
174
|
+
E.push(l());
|
|
175
|
+
else
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
u();
|
|
179
|
+
const S = x ? x(E) : E.length === 1 && v ? v(E[0]) : NaN;
|
|
180
|
+
if (isNaN(S)) throw new Error("Resultado inválido de função");
|
|
181
|
+
return s(), a() === "%" ? (n(), o = !0, S / 100) : (o = !1, S);
|
|
182
|
+
}
|
|
183
|
+
const f = t.slice(e).match(/^(pi|π|e)\b/i);
|
|
184
|
+
if (f) {
|
|
185
|
+
e += f[0].length;
|
|
186
|
+
let v = f[1].toLowerCase() === "e" ? Math.E : Math.PI;
|
|
187
|
+
return s(), a() === "%" && (n(), o = !0, v = v / 100), v;
|
|
188
|
+
}
|
|
189
|
+
const g = t.slice(e).match(/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|,[0-9]+)(?:[eE][+-]?[0-9]+)?/);
|
|
190
|
+
if (g) {
|
|
191
|
+
e += g[0].length;
|
|
192
|
+
let b = parseFloat(g[0].replace(",", "."));
|
|
193
|
+
return s(), a() === "%" && (n(), o = !0, b = b / 100), b;
|
|
194
|
+
}
|
|
195
|
+
throw new Error("Caractere inválido: " + c);
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const c = l();
|
|
199
|
+
return s(), e < t.length ? null : typeof c == "number" && isFinite(c) ? c : null;
|
|
200
|
+
} catch {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const De = Object.freeze([
|
|
205
|
+
{ nome: "abs", tipo: "funcao", assinatura: "(x)", descricao: "Valor absoluto (sem sinal). Ex.: abs(-5) = 5" },
|
|
206
|
+
{ nome: "acos", tipo: "funcao", assinatura: "(x)", descricao: "Arco-cosseno; o resultado é em graus. Ex.: acos(0.5) = 60" },
|
|
207
|
+
{ nome: "asin", tipo: "funcao", assinatura: "(x)", descricao: "Arco-seno; o resultado é em graus. Ex.: asin(0.5) = 30" },
|
|
208
|
+
{ nome: "atan", tipo: "funcao", assinatura: "(x)", descricao: "Arco-tangente; o resultado é em graus. Ex.: atan(1) = 45" },
|
|
209
|
+
{ nome: "atan2", tipo: "funcao", assinatura: "(y; x)", descricao: "Ângulo em graus do ponto (x, y). Ex.: atan2(1; 1) = 45" },
|
|
210
|
+
{ nome: "ceil", tipo: "funcao", assinatura: "(x)", descricao: "Arredonda para cima. Ex.: ceil(2.1) = 3" },
|
|
211
|
+
{ nome: "cos", tipo: "funcao", assinatura: "(x)", descricao: "Cosseno, com x em graus. Ex.: cos(60) = 0.5" },
|
|
212
|
+
{ nome: "deg", tipo: "funcao", assinatura: "(x)", descricao: "Converte radianos em graus. Ex.: deg(pi) = 180" },
|
|
213
|
+
{ nome: "e", tipo: "constante", assinatura: "", descricao: "Número de Euler, 2,71828…" },
|
|
214
|
+
{ nome: "floor", tipo: "funcao", assinatura: "(x)", descricao: "Arredonda para baixo. Ex.: floor(2.9) = 2" },
|
|
215
|
+
{ nome: "hypot", tipo: "funcao", assinatura: "(a; b; …)", descricao: "Hipotenusa: raiz da soma dos quadrados. Ex.: hypot(3; 4) = 5" },
|
|
216
|
+
{ nome: "ln", tipo: "funcao", assinatura: "(x)", descricao: "Logaritmo natural (base e). Ex.: ln(e) = 1" },
|
|
217
|
+
{ nome: "log", tipo: "funcao", assinatura: "(x)", descricao: "Logaritmo na base 10. Ex.: log(100) = 2" },
|
|
218
|
+
{ nome: "max", tipo: "funcao", assinatura: "(a; b; …)", descricao: "Maior dos valores. Ex.: max(3; 1; 2) = 3" },
|
|
219
|
+
{ nome: "min", tipo: "funcao", assinatura: "(a; b; …)", descricao: "Menor dos valores. Ex.: min(3; 1; 2) = 1" },
|
|
220
|
+
{ nome: "mod", tipo: "funcao", assinatura: "(a; b)", descricao: "Resto da divisão de a por b. Ex.: mod(10; 3) = 1" },
|
|
221
|
+
{ nome: "pi", tipo: "constante", assinatura: "", descricao: "Constante π = 3,14159…" },
|
|
222
|
+
{ nome: "pow", tipo: "funcao", assinatura: "(base; expoente)", descricao: "Potência. Ex.: pow(2; 3) = 8 (o mesmo que 2^3)" },
|
|
223
|
+
{ nome: "rad", tipo: "funcao", assinatura: "(x)", descricao: "Converte graus em radianos. Ex.: rad(180) = 3.14159…" },
|
|
224
|
+
{ nome: "round", tipo: "funcao", assinatura: "(x)", descricao: "Arredonda para o inteiro mais próximo. Ex.: round(2.5) = 3" },
|
|
225
|
+
{ nome: "sign", tipo: "funcao", assinatura: "(x)", descricao: "Sinal do número: -1, 0 ou 1. Ex.: sign(-7) = -1" },
|
|
226
|
+
{ nome: "sin", tipo: "funcao", assinatura: "(x)", descricao: "Seno, com x em graus. Ex.: sin(30) = 0.5" },
|
|
227
|
+
{ nome: "sqrt", tipo: "funcao", assinatura: "(x)", descricao: "Raiz quadrada. Ex.: sqrt(16) = 4" },
|
|
228
|
+
{ nome: "tan", tipo: "funcao", assinatura: "(x)", descricao: "Tangente, com x em graus. Ex.: tan(45) = 1" },
|
|
229
|
+
{ nome: "trunc", tipo: "funcao", assinatura: "(x)", descricao: "Remove a parte decimal. Ex.: trunc(-2.9) = -2" }
|
|
230
|
+
]);
|
|
231
|
+
function Te(r, t) {
|
|
232
|
+
if (typeof r != "string" || !Number.isFinite(t)) return null;
|
|
233
|
+
const e = Math.max(0, Math.min(r.length, Math.floor(t))), i = r.slice(0, e), o = /[a-zA-Z_]+$/.exec(i);
|
|
234
|
+
if (!o) return null;
|
|
235
|
+
const a = e - o[0].length;
|
|
236
|
+
if (a > 0 && /[0-9.,]/.test(r[a - 1])) return null;
|
|
237
|
+
const n = r.slice(e);
|
|
238
|
+
if (/^[a-zA-Z0-9_]/.test(n)) return null;
|
|
239
|
+
const s = o[0].toLowerCase(), u = De.filter((l) => !(!l.nome.startsWith(s) || l.nome === s && (l.tipo === "constante" || n.startsWith("("))));
|
|
240
|
+
return u.length > 0 ? { entradas: u, inicio: a, fim: e } : null;
|
|
241
|
+
}
|
|
242
|
+
function Ve(r, t, e) {
|
|
243
|
+
const i = e.nome + (e.tipo === "funcao" ? "(" : "");
|
|
244
|
+
return {
|
|
245
|
+
texto: r.slice(0, t.inicio) + i + r.slice(t.fim),
|
|
246
|
+
cursor: t.inicio + i.length
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
let je = 0;
|
|
250
|
+
function fe(r) {
|
|
251
|
+
var e;
|
|
252
|
+
const t = r.getRootNode();
|
|
253
|
+
return ((e = t.getElementById) == null ? void 0 : e.call(t, "container")) ?? null;
|
|
254
|
+
}
|
|
255
|
+
function Oe(r) {
|
|
256
|
+
const t = `ui-prop-ac-${++je}`;
|
|
257
|
+
let e = null, i = null, o = [], a = null, n = 0;
|
|
258
|
+
r.setAttribute("role", "combobox"), r.setAttribute("aria-autocomplete", "list"), r.setAttribute("aria-expanded", "false");
|
|
259
|
+
const s = (c) => {
|
|
260
|
+
var h, f;
|
|
261
|
+
!a || o.length === 0 || (n = (c + o.length) % o.length, o.forEach((g, b) => {
|
|
262
|
+
const v = b === n;
|
|
263
|
+
g.classList.toggle("ui-prop__ac-item--ativo", v), g.setAttribute("aria-selected", String(v));
|
|
264
|
+
}), r.setAttribute("aria-activedescendant", o[n].id), i && (i.textContent = a.entradas[n].descricao), (f = (h = o[n]).scrollIntoView) == null || f.call(h, { block: "nearest" }));
|
|
265
|
+
}, u = () => {
|
|
266
|
+
const c = fe(r);
|
|
267
|
+
if (!e || !c) return;
|
|
268
|
+
const h = c.getBoundingClientRect(), f = r.getBoundingClientRect(), g = Math.max(f.width, 190), b = Math.max(0, Math.min(f.right - h.left - g, h.width - g));
|
|
269
|
+
e.style.minWidth = `${g}px`, e.style.left = `${b}px`;
|
|
270
|
+
const v = e.offsetHeight || 0, x = f.bottom - h.top;
|
|
271
|
+
v && x + v > h.height && f.top - h.top - v > 0 ? e.style.top = `${f.top - h.top - v}px` : e.style.top = `${x}px`;
|
|
272
|
+
}, l = () => {
|
|
273
|
+
e && e.remove(), e = null, i = null, o = [], a = null, n = 0, r.setAttribute("aria-expanded", "false"), r.removeAttribute("aria-controls"), r.removeAttribute("aria-activedescendant");
|
|
274
|
+
}, m = (c) => {
|
|
275
|
+
if (!a) return;
|
|
276
|
+
const h = a.entradas[c];
|
|
277
|
+
if (!h) return;
|
|
278
|
+
const f = Ve(r.value, a, h);
|
|
279
|
+
l(), r.value = f.texto;
|
|
280
|
+
try {
|
|
281
|
+
r.setSelectionRange(f.cursor, f.cursor);
|
|
282
|
+
} catch {
|
|
283
|
+
}
|
|
284
|
+
r.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
285
|
+
}, d = (c) => {
|
|
286
|
+
const h = fe(r);
|
|
287
|
+
if (!h) return;
|
|
288
|
+
e || (e = document.createElement("div"), e.id = t, e.className = "ui-prop__ac", e.setAttribute("part", "autocomplete"), e.setAttribute("role", "listbox"), e.addEventListener("mousedown", (g) => g.preventDefault()), h.appendChild(e));
|
|
289
|
+
const f = e;
|
|
290
|
+
f.textContent = "", o = c.entradas.map((g, b) => {
|
|
291
|
+
const v = document.createElement("div");
|
|
292
|
+
v.id = `${t}-${b}`, v.className = "ui-prop__ac-item", v.setAttribute("part", "autocomplete-item"), v.setAttribute("role", "option");
|
|
293
|
+
const x = document.createElement("span");
|
|
294
|
+
x.className = "ui-prop__ac-nome", x.textContent = g.nome;
|
|
295
|
+
const E = document.createElement("span");
|
|
296
|
+
return E.className = "ui-prop__ac-assinatura", E.textContent = g.assinatura, v.append(x, E), v.addEventListener("mouseenter", () => s(b)), v.addEventListener("click", () => m(b)), f.appendChild(v), v;
|
|
297
|
+
}), i = document.createElement("div"), i.className = "ui-prop__ac-dica", i.setAttribute("part", "autocomplete-dica"), i.setAttribute("aria-live", "polite"), f.appendChild(i), a = c, r.setAttribute("aria-expanded", "true"), r.setAttribute("aria-controls", t), s(0), u();
|
|
298
|
+
}, p = () => {
|
|
299
|
+
const c = Te(r.value, r.selectionStart ?? r.value.length);
|
|
300
|
+
c ? d(c) : l();
|
|
301
|
+
};
|
|
302
|
+
return r.addEventListener("input", p), r.addEventListener("click", p), r.addEventListener("keyup", (c) => {
|
|
303
|
+
(c.key === "ArrowLeft" || c.key === "ArrowRight" || c.key === "Home" || c.key === "End") && p();
|
|
304
|
+
}), r.addEventListener("blur", l), {
|
|
305
|
+
aberto: () => e !== null,
|
|
306
|
+
fechar: l,
|
|
307
|
+
tratarTecla: (c) => {
|
|
308
|
+
if (!e) return !1;
|
|
309
|
+
switch (c.key) {
|
|
310
|
+
case "ArrowDown":
|
|
311
|
+
return c.preventDefault(), s(n + 1), !0;
|
|
312
|
+
case "ArrowUp":
|
|
313
|
+
return c.preventDefault(), s(n - 1), !0;
|
|
314
|
+
case "Enter":
|
|
315
|
+
case "Tab":
|
|
316
|
+
return c.preventDefault(), m(n), !0;
|
|
317
|
+
case "Escape":
|
|
318
|
+
return c.preventDefault(), c.stopPropagation(), l(), !0;
|
|
319
|
+
default:
|
|
320
|
+
return !1;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
const Re = "ui_tabela_propriedades_estado_", K = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
326
|
+
function me(r) {
|
|
327
|
+
return !!r && typeof r == "object" && !Array.isArray(r);
|
|
328
|
+
}
|
|
329
|
+
function re() {
|
|
330
|
+
if (typeof window > "u") return null;
|
|
331
|
+
try {
|
|
332
|
+
return typeof localStorage < "u" ? localStorage : null;
|
|
333
|
+
} catch {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function H(r, t) {
|
|
338
|
+
const e = typeof r == "string" ? r.trim() : "", i = typeof t == "string" ? t.trim() : "";
|
|
339
|
+
return `${Re}${e || i || "default"}`;
|
|
340
|
+
}
|
|
341
|
+
function Fe(r) {
|
|
342
|
+
if (!me(r)) return null;
|
|
343
|
+
const t = {};
|
|
344
|
+
if (me(r.categorias))
|
|
345
|
+
for (const [o, a] of Object.entries(r.categorias))
|
|
346
|
+
!o || K.has(o) || typeof a == "boolean" && (t[o] = a);
|
|
347
|
+
const e = typeof r.versao == "number" && Number.isFinite(r.versao) ? r.versao : 1, i = typeof r.ultimaAtualizacao == "number" && Number.isFinite(r.ultimaAtualizacao) ? r.ultimaAtualizacao : void 0;
|
|
348
|
+
return i !== void 0 ? { versao: e, categorias: t, ultimaAtualizacao: i } : { versao: e, categorias: t };
|
|
349
|
+
}
|
|
350
|
+
function Ie(r) {
|
|
351
|
+
const t = re();
|
|
352
|
+
if (!t) return null;
|
|
353
|
+
try {
|
|
354
|
+
const e = t.getItem(r);
|
|
355
|
+
return e ? Fe(JSON.parse(e)) : null;
|
|
356
|
+
} catch (e) {
|
|
357
|
+
return console.warn(
|
|
358
|
+
`[ui-tabela-propriedades] Não foi possível carregar o estado persistido (${r}):`,
|
|
359
|
+
e
|
|
360
|
+
), null;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function qe(r, t) {
|
|
364
|
+
const e = re();
|
|
365
|
+
if (e)
|
|
366
|
+
try {
|
|
367
|
+
e.setItem(r, JSON.stringify(t));
|
|
368
|
+
} catch (i) {
|
|
369
|
+
console.warn(
|
|
370
|
+
`[ui-tabela-propriedades] Não foi possível salvar o estado persistido (${r}):`,
|
|
371
|
+
i
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function $e(r) {
|
|
376
|
+
const t = re();
|
|
377
|
+
if (t)
|
|
378
|
+
try {
|
|
379
|
+
t.removeItem(r);
|
|
380
|
+
} catch {
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
function N(r) {
|
|
384
|
+
if (!r || typeof r != "object") return null;
|
|
385
|
+
const t = r.id;
|
|
386
|
+
if (t == null) return null;
|
|
387
|
+
const e = String(t);
|
|
388
|
+
return !e || K.has(e) ? null : e;
|
|
389
|
+
}
|
|
390
|
+
function Q(r) {
|
|
391
|
+
return r.aberto !== void 0 ? r.aberto !== !1 : r.aberta !== !1;
|
|
392
|
+
}
|
|
393
|
+
function I(r, t) {
|
|
394
|
+
if (!(!r || typeof r != "object" || Object.isFrozen(r)))
|
|
395
|
+
try {
|
|
396
|
+
r.aberto = t, "aberta" in r && (r.aberta = t);
|
|
397
|
+
} catch {
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
class He {
|
|
401
|
+
constructor(t) {
|
|
402
|
+
w(this, "preferencias", /* @__PURE__ */ new Map());
|
|
403
|
+
w(this, "origensAberto", /* @__PURE__ */ new Map());
|
|
404
|
+
/** Padrão original por objeto: reatribuir o mesmo objeto não grava como padrão o estado já alterado. */
|
|
405
|
+
w(this, "origemPorObjeto", /* @__PURE__ */ new WeakMap());
|
|
406
|
+
w(this, "ultimaChaveCarregada", null);
|
|
407
|
+
this.getContexto = t;
|
|
408
|
+
}
|
|
409
|
+
chaveAtual() {
|
|
410
|
+
const t = this.getContexto();
|
|
411
|
+
return H(t.storageKey, t.id);
|
|
412
|
+
}
|
|
413
|
+
/** Carrega preferências do storage. Quando `substituirExistentes` é falso, preserva alterações feitas antes da conexão. */
|
|
414
|
+
carregarDoStorage(t = !1) {
|
|
415
|
+
const e = this.getContexto(), i = H(e.storageKey, e.id);
|
|
416
|
+
if (t && this.preferencias.clear(), this.ultimaChaveCarregada = i, !e.persistir) return !1;
|
|
417
|
+
const o = Ie(i);
|
|
418
|
+
if (!o) return !1;
|
|
419
|
+
for (const [a, n] of Object.entries(o.categorias))
|
|
420
|
+
(t || !this.preferencias.has(a)) && this.preferencias.set(a, n);
|
|
421
|
+
return !0;
|
|
422
|
+
}
|
|
423
|
+
/** Recarrega o estado se `id` ou `storage-key` tiver mudado após a conexão. */
|
|
424
|
+
sincronizarSeChaveMudou() {
|
|
425
|
+
const t = this.getContexto();
|
|
426
|
+
if (!t.conectado || !t.persistir) return !1;
|
|
427
|
+
const e = H(t.storageKey, t.id);
|
|
428
|
+
return this.ultimaChaveCarregada === null ? this.carregarDoStorage(!1) : e !== this.ultimaChaveCarregada ? this.carregarDoStorage(!0) : !1;
|
|
429
|
+
}
|
|
430
|
+
/** Registra os padrões originais enviados pela aplicação para permitir restauração via `limpar()`. */
|
|
431
|
+
registrarOrigens(t) {
|
|
432
|
+
if (this.origensAberto.clear(), !!Array.isArray(t))
|
|
433
|
+
for (const e of t) {
|
|
434
|
+
const i = N(e);
|
|
435
|
+
if (i !== null) {
|
|
436
|
+
let o = this.origemPorObjeto.get(e);
|
|
437
|
+
o === void 0 && (o = Q(e), this.origemPorObjeto.set(e, o)), this.origensAberto.set(i, o);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/** Aplica sobre os objetos mutáveis de `categorias` as preferências lembradas para cada `id`. */
|
|
442
|
+
aplicarEmCategorias(t) {
|
|
443
|
+
if (Array.isArray(t))
|
|
444
|
+
for (const e of t) {
|
|
445
|
+
const i = N(e);
|
|
446
|
+
i !== null && this.preferencias.has(i) && I(e, this.preferencias.get(i));
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/** Restaura nos objetos mutáveis os valores iniciais enviados pela aplicação. */
|
|
450
|
+
restaurarOrigensEmCategorias(t) {
|
|
451
|
+
if (Array.isArray(t))
|
|
452
|
+
for (const e of t) {
|
|
453
|
+
const i = N(e);
|
|
454
|
+
i !== null && this.origensAberto.has(i) && I(e, this.origensAberto.get(i));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/** Estado efetivo da categoria considerando preferência lembrada e padrão da própria categoria. */
|
|
458
|
+
estaAberta(t) {
|
|
459
|
+
if (!t || typeof t != "object") return !0;
|
|
460
|
+
const e = N(t);
|
|
461
|
+
return e !== null && this.preferencias.has(e) ? this.preferencias.get(e) : Q(t);
|
|
462
|
+
}
|
|
463
|
+
registrar(t, e, i = !0) {
|
|
464
|
+
!t || K.has(t) || (this.preferencias.set(t, !!e), i && this.salvar());
|
|
465
|
+
}
|
|
466
|
+
registrarVarias(t, e = !0) {
|
|
467
|
+
let i = !1;
|
|
468
|
+
for (const [o, a] of t)
|
|
469
|
+
!o || K.has(o) || (this.preferencias.set(o, !!a), i = !0);
|
|
470
|
+
i && e && this.salvar();
|
|
471
|
+
}
|
|
472
|
+
salvar() {
|
|
473
|
+
const t = this.getContexto();
|
|
474
|
+
if (!t.persistir || !t.conectado) return;
|
|
475
|
+
const e = H(t.storageKey, t.id);
|
|
476
|
+
if (this.ultimaChaveCarregada = e, this.preferencias.size === 0) return;
|
|
477
|
+
const i = {};
|
|
478
|
+
for (const [o, a] of this.preferencias.entries())
|
|
479
|
+
i[o] = a;
|
|
480
|
+
qe(e, {
|
|
481
|
+
versao: 1,
|
|
482
|
+
categorias: i,
|
|
483
|
+
ultimaAtualizacao: Date.now()
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
limpar(t) {
|
|
487
|
+
this.preferencias.clear(), t && this.restaurarOrigensEmCategorias(t), $e(this.chaveAtual());
|
|
488
|
+
}
|
|
489
|
+
obterEstado(t) {
|
|
490
|
+
const e = {};
|
|
491
|
+
for (const [i, o] of this.preferencias.entries())
|
|
492
|
+
e[i] = o;
|
|
493
|
+
if (Array.isArray(t))
|
|
494
|
+
for (const i of t) {
|
|
495
|
+
const o = N(i);
|
|
496
|
+
o !== null && !(o in e) && (e[o] = this.estaAberta(i));
|
|
497
|
+
}
|
|
498
|
+
return e;
|
|
499
|
+
}
|
|
500
|
+
montarDetalheEvento(t) {
|
|
501
|
+
const e = this.obterEstado(t), i = [], o = [];
|
|
502
|
+
for (const [a, n] of Object.entries(e))
|
|
503
|
+
n ? i.push(a) : o.push(a);
|
|
504
|
+
return { estado: e, abertas: i, fechadas: o };
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const ie = '.ui-prop__categoria--aberta .ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__categoria--aberta .ui-prop__linha select:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-cor-container';
|
|
508
|
+
function xe(r, t) {
|
|
509
|
+
if (!r) return null;
|
|
510
|
+
const e = String(t);
|
|
511
|
+
return Array.from(r.querySelectorAll("[data-prop-id]")).find((i) => i.getAttribute("data-prop-id") === e) ?? null;
|
|
512
|
+
}
|
|
513
|
+
const _e = /* @__PURE__ */ new WeakMap();
|
|
514
|
+
function P(r, t) {
|
|
515
|
+
_e.set(r, t);
|
|
516
|
+
}
|
|
517
|
+
function ge(r, t, e) {
|
|
518
|
+
var a, n;
|
|
519
|
+
const i = xe(r, t), o = (a = i == null ? void 0 : i.querySelector(".ui-prop__col-valor")) == null ? void 0 : a.firstElementChild;
|
|
520
|
+
o && ((n = _e.get(o)) == null || n(e));
|
|
521
|
+
}
|
|
522
|
+
function X(r, t, e = (o, a) => o === String(a), i = (o) => o == null || o === "" ? "—" : String(o)) {
|
|
523
|
+
var n;
|
|
524
|
+
(n = r.querySelector("option[data-externa]")) == null || n.remove();
|
|
525
|
+
const o = Array.from(r.options).find((s) => !s.hasAttribute("data-acao") && e(s.value, t));
|
|
526
|
+
if (o) {
|
|
527
|
+
o.selected = !0;
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const a = document.createElement("option");
|
|
531
|
+
a.value = t == null ? "" : String(t), a.textContent = i(t), a.setAttribute("data-externa", ""), a.hidden = !0, r.insertBefore(a, r.firstChild), a.selected = !0;
|
|
532
|
+
}
|
|
533
|
+
function W(r, t) {
|
|
534
|
+
var i;
|
|
535
|
+
(i = r.querySelector("option[data-externa]")) == null || i.remove();
|
|
536
|
+
const e = document.createElement("option");
|
|
537
|
+
e.value = "", e.textContent = t, e.setAttribute("data-externa", ""), e.setAttribute("data-misto", ""), e.hidden = !0, e.disabled = !0, r.insertBefore(e, r.firstChild), e.selected = !0;
|
|
538
|
+
}
|
|
539
|
+
function Ke(r, t) {
|
|
540
|
+
const e = Array.from(r.querySelectorAll(ie)), i = e.indexOf(t);
|
|
541
|
+
if (i !== -1 && i + 1 < e.length) {
|
|
542
|
+
const o = e[i + 1];
|
|
543
|
+
o.focus(), o instanceof HTMLInputElement && o.select();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function Ue(r, t) {
|
|
547
|
+
const e = Array.from(r.querySelectorAll(ie)), i = e.indexOf(t);
|
|
548
|
+
if (i > 0) {
|
|
549
|
+
const o = e[i - 1];
|
|
550
|
+
o.focus(), o instanceof HTMLInputElement && o.select();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function Xe(r) {
|
|
554
|
+
const t = r.querySelector(ie);
|
|
555
|
+
t && (t.focus(), t instanceof HTMLInputElement && t.select());
|
|
556
|
+
}
|
|
557
|
+
function G(r, t) {
|
|
558
|
+
var e;
|
|
559
|
+
r.classList.toggle("ui-prop__categoria--aberta", t), R(r, "categoria-aberta", t), (e = r.querySelector(".ui-prop__categoria-header")) == null || e.setAttribute("aria-expanded", String(t));
|
|
560
|
+
}
|
|
561
|
+
function We(r, t, e) {
|
|
562
|
+
const i = /* @__PURE__ */ new Map();
|
|
563
|
+
r.querySelectorAll(".ui-prop__categoria[data-cat-id]").forEach((o) => {
|
|
564
|
+
const a = o.getAttribute("data-cat-id");
|
|
565
|
+
a !== null && i.set(a, o);
|
|
566
|
+
}), (Array.isArray(t) ? t : []).forEach((o) => {
|
|
567
|
+
const a = N(o);
|
|
568
|
+
if (a === null) return;
|
|
569
|
+
const n = e(o), s = i.get(a);
|
|
570
|
+
s && G(s, n);
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function Ge(r, t) {
|
|
574
|
+
(Array.isArray(t) ? t : []).forEach((e) => {
|
|
575
|
+
I(e, !0);
|
|
576
|
+
}), r.querySelectorAll(".ui-prop__categoria").forEach((e) => G(e, !0));
|
|
577
|
+
}
|
|
578
|
+
function Ye(r, t) {
|
|
579
|
+
(Array.isArray(t) ? t : []).forEach((e) => {
|
|
580
|
+
I(e, !1);
|
|
581
|
+
}), r.querySelectorAll(".ui-prop__categoria").forEach((e) => G(e, !1));
|
|
582
|
+
}
|
|
583
|
+
function Ze(r, t, e, i, o) {
|
|
584
|
+
const a = (Array.isArray(e) ? e : []).find(
|
|
585
|
+
(l) => l && typeof l == "object" && String(l.id) === String(i)
|
|
586
|
+
);
|
|
587
|
+
if (!a) return;
|
|
588
|
+
const n = Array.from(r.querySelectorAll("[data-cat-id]")).find((l) => l.getAttribute("data-cat-id") === String(i)), u = !(o !== void 0 ? o : n ? n.classList.contains("ui-prop__categoria--aberta") : Q(a));
|
|
589
|
+
return I(a, u), n && G(n, u), t.dispatchEvent(
|
|
590
|
+
new CustomEvent("ui-categoria-toggle", {
|
|
591
|
+
bubbles: !0,
|
|
592
|
+
composed: !0,
|
|
593
|
+
detail: { id: i, aberto: u }
|
|
594
|
+
})
|
|
595
|
+
), u;
|
|
596
|
+
}
|
|
597
|
+
const oe = Symbol.for("ui-tabela-propriedades:misto"), ae = "Varia";
|
|
598
|
+
function A(r) {
|
|
599
|
+
return r === oe;
|
|
600
|
+
}
|
|
601
|
+
function D(r) {
|
|
602
|
+
var e;
|
|
603
|
+
let t;
|
|
604
|
+
try {
|
|
605
|
+
t = (e = r.obterTextoMisto) == null ? void 0 : e.call(r);
|
|
606
|
+
} catch {
|
|
607
|
+
}
|
|
608
|
+
return typeof t == "string" && t.trim() ? t : ae;
|
|
609
|
+
}
|
|
610
|
+
function V(r, t) {
|
|
611
|
+
return r == null && t == null ? !0 : r === t || Object.is(r, t);
|
|
612
|
+
}
|
|
613
|
+
function J(r) {
|
|
614
|
+
return r.misto ? oe : r.valor;
|
|
615
|
+
}
|
|
616
|
+
function Qe(r) {
|
|
617
|
+
if (!Array.isArray(r) || r.length === 0) return;
|
|
618
|
+
const t = r[0];
|
|
619
|
+
for (let e = 1; e < r.length; e++)
|
|
620
|
+
if (!V(t, r[e])) return oe;
|
|
621
|
+
return t;
|
|
622
|
+
}
|
|
623
|
+
function Pt(r) {
|
|
624
|
+
if (!Array.isArray(r)) return {};
|
|
625
|
+
const t = r.filter(
|
|
626
|
+
(o) => o !== null && typeof o == "object" && !Array.isArray(o)
|
|
627
|
+
), e = /* @__PURE__ */ new Set();
|
|
628
|
+
t.forEach((o) => Object.keys(o).forEach((a) => e.add(a)));
|
|
629
|
+
const i = {};
|
|
630
|
+
return e.forEach((o) => {
|
|
631
|
+
i[o] = Qe(t.map((a) => o in a ? a[o] : void 0));
|
|
632
|
+
}), i;
|
|
633
|
+
}
|
|
634
|
+
function Y(r) {
|
|
635
|
+
if (typeof r.casasDecimais == "number" && r.casasDecimais >= 0) return r.casasDecimais;
|
|
636
|
+
if (typeof r.precisao == "number" && r.precisao >= 0) return r.precisao;
|
|
637
|
+
}
|
|
638
|
+
function Je(r, t) {
|
|
639
|
+
return typeof r.passo == "number" && r.passo > 0 ? r.passo : typeof r.step == "number" && r.step > 0 ? r.step : t !== void 0 ? Math.pow(10, -t) : 1;
|
|
640
|
+
}
|
|
641
|
+
function ne(r, t) {
|
|
642
|
+
let e = r;
|
|
643
|
+
return typeof t.min == "number" && Number.isFinite(t.min) && (e = Math.max(t.min, e)), typeof t.max == "number" && Number.isFinite(t.max) && (e = Math.min(t.max, e)), e;
|
|
644
|
+
}
|
|
645
|
+
function Z(r, t) {
|
|
646
|
+
if (typeof r != "string") return null;
|
|
647
|
+
let e = r.trim();
|
|
648
|
+
const i = typeof t.unidade == "string" ? t.unidade.trim() : "";
|
|
649
|
+
if (i && e.length > i.length && e.toLowerCase().endsWith(i.toLowerCase()) && (e = e.slice(0, e.length - i.length).trim()), !e) return null;
|
|
650
|
+
const o = Pe(e);
|
|
651
|
+
if (o === null || !Number.isFinite(o)) return null;
|
|
652
|
+
const a = Y(t), n = ne(o, t);
|
|
653
|
+
return Number(a !== void 0 ? n.toFixed(a) : n.toPrecision(15));
|
|
654
|
+
}
|
|
655
|
+
function ye(r, t, e, i) {
|
|
656
|
+
r.classList.toggle("ui-prop__editor--misto", e), e ? r.placeholder = i : t.placeholder ? r.placeholder = t.placeholder : r.removeAttribute("placeholder");
|
|
657
|
+
}
|
|
658
|
+
function et(r, t, e, i) {
|
|
659
|
+
const o = document.createElement("span"), a = e ? Y(e) : void 0, n = (s) => {
|
|
660
|
+
if (A(s)) {
|
|
661
|
+
o.className = "ui-prop__valor-readonly ui-prop__editor--misto", o.textContent = t ? D({ obterTextoMisto: t }) : ae;
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
if (s == null) {
|
|
665
|
+
o.className = "ui-prop__valor-readonly", o.textContent = "—";
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
if ((e == null ? void 0 : e.tipo) === "booleano" && typeof s == "boolean") {
|
|
669
|
+
o.className = "ui-prop__valor-readonly", o.textContent = s ? (i == null ? void 0 : i("sim")) || k.sim : (i == null ? void 0 : i("nao")) || k.nao;
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
if (e != null && e.opcoes && e.opcoes.length > 0) {
|
|
673
|
+
const l = e.opcoes.find((m) => m && String(m.id) === String(s));
|
|
674
|
+
if (l) {
|
|
675
|
+
o.className = "ui-prop__valor-readonly", o.textContent = l.rotulo;
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
const u = typeof s == "number" || typeof s == "string" && /^-?\d+(\.\d+)?$/.test(s.trim());
|
|
680
|
+
if (o.className = `ui-prop__valor-readonly ${u ? "ui-prop__valor-readonly--numero" : ""}`.trim(), u && a !== void 0) {
|
|
681
|
+
const l = Number(s);
|
|
682
|
+
o.textContent = Number.isFinite(l) ? l.toFixed(a) : String(s);
|
|
683
|
+
} else
|
|
684
|
+
o.textContent = String(s);
|
|
685
|
+
};
|
|
686
|
+
return n(r), P(o, n), o;
|
|
687
|
+
}
|
|
688
|
+
function tt(r, t, e, i) {
|
|
689
|
+
const o = document.createElement("label");
|
|
690
|
+
o.className = "ui-prop__editor-booleano", o.setAttribute("role", "checkbox"), o.tabIndex = 0, o.setAttribute("aria-label", String(t.rotulo ?? t.id));
|
|
691
|
+
const a = document.createElement("div");
|
|
692
|
+
a.className = "ui-prop__checkbox-custom";
|
|
693
|
+
const n = document.createElement("span");
|
|
694
|
+
n.className = "ui-prop__booleano-rotulo";
|
|
695
|
+
const s = (l) => {
|
|
696
|
+
var p, c;
|
|
697
|
+
const m = A(l), d = !m && !!l;
|
|
698
|
+
o.classList.toggle("ui-prop__editor--misto", m), a.classList.toggle("ui-prop__checkbox-custom--marcado", d), a.classList.toggle("ui-prop__checkbox-custom--misto", m), a.textContent = m ? "–" : d ? "✓" : "", n.textContent = m ? D(i) : d ? ((p = i.obterTexto) == null ? void 0 : p.call(i, "sim")) || k.sim : ((c = i.obterTexto) == null ? void 0 : c.call(i, "nao")) || k.nao, o.setAttribute("aria-checked", m ? "mixed" : String(d));
|
|
699
|
+
};
|
|
700
|
+
s(e), P(o, s), o.appendChild(a), o.appendChild(n);
|
|
701
|
+
const u = () => {
|
|
702
|
+
const l = i.obterValorAtual(t.id), m = A(l) ? !0 : !l;
|
|
703
|
+
i.registrarAlteracao(r, t.id, m), s(m);
|
|
704
|
+
};
|
|
705
|
+
return o.addEventListener("click", (l) => {
|
|
706
|
+
l.preventDefault(), u();
|
|
707
|
+
}), o.addEventListener("keydown", (l) => {
|
|
708
|
+
l.key === " " ? (l.preventDefault(), u()) : l.key === "Enter" && (l.preventDefault(), l.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o));
|
|
709
|
+
}), o;
|
|
710
|
+
}
|
|
711
|
+
function rt(r, t, e, i) {
|
|
712
|
+
const o = document.createElement("select");
|
|
713
|
+
o.className = "ui-prop__editor-select", o.setAttribute("aria-label", String(t.rotulo ?? t.id)), (Array.isArray(t.opcoes) ? t.opcoes : []).forEach((n) => {
|
|
714
|
+
if (!n || typeof n != "object") return;
|
|
715
|
+
const s = document.createElement("option");
|
|
716
|
+
s.value = String(n.id), s.textContent = String(n.rotulo ?? n.id), o.appendChild(s);
|
|
717
|
+
});
|
|
718
|
+
const a = (n) => {
|
|
719
|
+
o.classList.toggle("ui-prop__editor--misto", A(n)), A(n) ? W(o, D(i)) : X(o, n);
|
|
720
|
+
};
|
|
721
|
+
return a(e), P(o, a), o.addEventListener("change", () => {
|
|
722
|
+
const n = (t.opcoes || []).find((s) => s && String(s.id) === o.value);
|
|
723
|
+
i.registrarAlteracao(r, t.id, n ? n.id : o.value), a(i.obterValorAtual(t.id));
|
|
724
|
+
}), o.addEventListener("keydown", (n) => {
|
|
725
|
+
n.key === "Enter" && (n.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o));
|
|
726
|
+
}), o;
|
|
727
|
+
}
|
|
728
|
+
function it(r, t, e) {
|
|
729
|
+
var o;
|
|
730
|
+
const i = document.createElement("button");
|
|
731
|
+
return i.type = "button", i.className = "ui-prop__btn-acao-inline", i.textContent = t.rotuloAcao || ((o = e.obterTexto) == null ? void 0 : o.call(e, "editarAcao")) || k.editarAcao, i.addEventListener("click", () => {
|
|
732
|
+
typeof t.onClickAcao == "function" && t.onClickAcao(t), e.despacharEventoAcao(t, r);
|
|
733
|
+
}), i;
|
|
734
|
+
}
|
|
735
|
+
function ot(r, t, e, i) {
|
|
736
|
+
const o = document.createElement("input");
|
|
737
|
+
o.type = "text", o.inputMode = "decimal", o.autocomplete = "off", o.spellcheck = !1, o.className = "ui-prop__editor-input ui-prop__editor-input--numero", o.setAttribute("aria-label", String(t.rotulo ?? t.id)), t.placeholder && (o.placeholder = t.placeholder);
|
|
738
|
+
const a = Y(t), n = (c) => {
|
|
739
|
+
if (c == null || c === "" || A(c)) return "";
|
|
740
|
+
const h = Number(c);
|
|
741
|
+
return isNaN(h) ? String(c) : a !== void 0 ? h.toFixed(a) : String(h);
|
|
742
|
+
}, s = (c) => {
|
|
743
|
+
o.value = n(c), ye(o, t, A(c), D(i));
|
|
744
|
+
};
|
|
745
|
+
s(e), P(o, s);
|
|
746
|
+
let u = null;
|
|
747
|
+
const l = () => {
|
|
748
|
+
o.classList.remove("ui-prop__editor-input--calculando"), o.title = "", u && (u.hidden = !0);
|
|
749
|
+
}, m = (c) => {
|
|
750
|
+
if (!u) {
|
|
751
|
+
if (!o.parentElement) return;
|
|
752
|
+
u = document.createElement("span"), u.className = "ui-prop__previa-calculo", u.setAttribute("aria-hidden", "true"), o.parentElement.appendChild(u);
|
|
753
|
+
}
|
|
754
|
+
u.textContent = c, u.hidden = !1;
|
|
755
|
+
}, d = Oe(o);
|
|
756
|
+
o.addEventListener("focus", () => {
|
|
757
|
+
o.classList.remove("ui-prop__editor-input--invalido"), o.select();
|
|
758
|
+
}), o.addEventListener("animationend", () => o.classList.remove("ui-prop__editor-input--invalido")), o.addEventListener("input", () => {
|
|
759
|
+
o.classList.remove("ui-prop__editor-input--invalido");
|
|
760
|
+
const c = o.value.trim(), f = !/^[+-]?[0-9]*[.,]?[0-9]*$/.test(c) && (c.startsWith("=") || /[\+\-\*\/\^\%\(\);]|^[a-zA-Z_π]/.test(c));
|
|
761
|
+
if (o.classList.toggle("ui-prop__editor-input--calculando", f), f) {
|
|
762
|
+
const g = Z(c, t), b = g !== null ? `= ${n(g)}` : "= ?";
|
|
763
|
+
o.title = g !== null ? b : "", m(b);
|
|
764
|
+
} else
|
|
765
|
+
l();
|
|
766
|
+
});
|
|
767
|
+
const p = () => {
|
|
768
|
+
l();
|
|
769
|
+
const c = o.value.trim(), h = i.obterValorAtual(t.id);
|
|
770
|
+
if (c === n(h)) return;
|
|
771
|
+
if (c === "") {
|
|
772
|
+
if (A(h)) return;
|
|
773
|
+
i.registrarAlteracao(r, t.id, null);
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
const f = Z(c, t);
|
|
777
|
+
f !== null ? (i.registrarAlteracao(r, t.id, f), s(i.obterValorAtual(t.id))) : (s(h), o.classList.add("ui-prop__editor-input--invalido"));
|
|
778
|
+
};
|
|
779
|
+
return o.addEventListener("change", p), o.addEventListener("blur", p), o.addEventListener("keydown", (c) => {
|
|
780
|
+
if (!d.tratarTecla(c)) {
|
|
781
|
+
if (c.key === "Enter")
|
|
782
|
+
p(), c.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o);
|
|
783
|
+
else if (c.key === "Escape")
|
|
784
|
+
c.preventDefault(), c.stopPropagation(), l(), s(i.obterValorAtual(t.id)), o.blur();
|
|
785
|
+
else if (c.key === "ArrowUp" || c.key === "ArrowDown") {
|
|
786
|
+
c.preventDefault(), l();
|
|
787
|
+
const h = Z(o.value, t), f = i.obterValorAtual(t.id);
|
|
788
|
+
if (h === null && A(f)) return;
|
|
789
|
+
const g = h ?? (Number(f) || 0);
|
|
790
|
+
let b = Je(t, a);
|
|
791
|
+
c.shiftKey ? b *= 10 : c.altKey && a === void 0 && (b *= 0.1);
|
|
792
|
+
let v = c.key === "ArrowUp" ? g + b : g - b;
|
|
793
|
+
v = ne(v, t), a !== void 0 ? v = Number(v.toFixed(a)) : v = Math.round(v * 1e4) / 1e4, i.registrarAlteracao(r, t.id, v), s(v);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}), o;
|
|
797
|
+
}
|
|
798
|
+
function at(r, t, e, i) {
|
|
799
|
+
const o = document.createElement("input");
|
|
800
|
+
o.type = "text", o.className = "ui-prop__editor-input", o.setAttribute("aria-label", String(t.rotulo ?? t.id)), t.placeholder && (o.placeholder = t.placeholder);
|
|
801
|
+
const a = (s) => {
|
|
802
|
+
const u = A(s);
|
|
803
|
+
o.value = u || s == null ? "" : String(s), ye(o, t, u, D(i));
|
|
804
|
+
};
|
|
805
|
+
a(e), P(o, a), o.addEventListener("focus", () => {
|
|
806
|
+
o.select();
|
|
807
|
+
});
|
|
808
|
+
const n = () => {
|
|
809
|
+
o.value === "" && A(i.obterValorAtual(t.id)) || (i.registrarAlteracao(r, t.id, o.value), a(i.obterValorAtual(t.id)));
|
|
810
|
+
};
|
|
811
|
+
return o.addEventListener("change", n), o.addEventListener("blur", n), o.addEventListener("keydown", (s) => {
|
|
812
|
+
s.key === "Enter" ? (n(), s.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(o) : i.focarProximoEditor(o)) : s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), a(i.obterValorAtual(t.id)), o.blur());
|
|
813
|
+
}), o;
|
|
814
|
+
}
|
|
815
|
+
const Ee = (r, t) => r.toLowerCase() === String(t ?? "").toLowerCase();
|
|
816
|
+
function se(r, t) {
|
|
817
|
+
(Array.isArray(t) ? t : []).forEach((e) => {
|
|
818
|
+
if (!e || typeof e != "object") return;
|
|
819
|
+
const i = document.createElement("option");
|
|
820
|
+
i.value = String(e.id), i.textContent = String(e.rotulo ?? e.id), r.appendChild(i);
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
function nt(r, t, e, i) {
|
|
824
|
+
const o = document.createElement("div");
|
|
825
|
+
o.className = "ui-prop__editor-linha-container";
|
|
826
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
827
|
+
a.setAttribute("class", "ui-prop__linha-amostra-svg"), a.setAttribute("viewBox", "0 0 44 12"), a.setAttribute("aria-hidden", "true");
|
|
828
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
829
|
+
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "44"), n.setAttribute("y2", "6");
|
|
830
|
+
const s = (d) => {
|
|
831
|
+
const p = String(d || "").toLowerCase();
|
|
832
|
+
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");
|
|
833
|
+
};
|
|
834
|
+
a.appendChild(n);
|
|
835
|
+
const u = document.createElement("select");
|
|
836
|
+
u.className = "ui-prop__linha-select", u.setAttribute("aria-label", String(t.rotulo ?? t.id));
|
|
837
|
+
const l = t.opcoes && t.opcoes.length > 0 ? t.opcoes : [
|
|
838
|
+
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
839
|
+
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
840
|
+
{ id: "Continuous", rotulo: "Continuous" },
|
|
841
|
+
{ id: "Dashed", rotulo: "Dashed" },
|
|
842
|
+
{ id: "Hidden", rotulo: "Hidden" },
|
|
843
|
+
{ id: "Center", rotulo: "Center" },
|
|
844
|
+
{ id: "Dotted", rotulo: "Dotted" }
|
|
845
|
+
];
|
|
846
|
+
se(u, l);
|
|
847
|
+
const m = (d) => {
|
|
848
|
+
const p = A(d);
|
|
849
|
+
if (o.classList.toggle("ui-prop__editor--misto", p), p) {
|
|
850
|
+
s(""), W(u, D(i));
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
s(d), X(u, d, Ee);
|
|
854
|
+
};
|
|
855
|
+
return m(e), P(o, m), u.addEventListener("change", () => {
|
|
856
|
+
const d = l.find((p) => p && String(p.id) === u.value);
|
|
857
|
+
i.registrarAlteracao(r, t.id, d ? d.id : u.value), m(i.obterValorAtual(t.id));
|
|
858
|
+
}), u.addEventListener("keydown", (d) => {
|
|
859
|
+
d.key === "Enter" && (d.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(u) : i.focarProximoEditor(u));
|
|
860
|
+
}), o.appendChild(a), o.appendChild(u), o;
|
|
861
|
+
}
|
|
862
|
+
function st(r, t, e, i) {
|
|
863
|
+
const o = document.createElement("div");
|
|
864
|
+
o.className = "ui-prop__editor-espessura-container";
|
|
865
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
866
|
+
a.setAttribute("class", "ui-prop__espessura-amostra-svg"), a.setAttribute("viewBox", "0 0 38 12"), a.setAttribute("aria-hidden", "true");
|
|
867
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
868
|
+
n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "38"), n.setAttribute("y2", "6");
|
|
869
|
+
const s = (d) => {
|
|
870
|
+
const p = parseFloat(String(d).replace(/[^0-9.]/g, ""));
|
|
871
|
+
return isNaN(p) || p <= 0 ? 1.5 : Math.min(8, Math.max(1, p * 8));
|
|
872
|
+
};
|
|
873
|
+
a.appendChild(n);
|
|
874
|
+
const u = document.createElement("select");
|
|
875
|
+
u.className = "ui-prop__espessura-select", u.setAttribute("aria-label", String(t.rotulo ?? t.id));
|
|
876
|
+
const l = t.opcoes && t.opcoes.length > 0 ? t.opcoes : [
|
|
877
|
+
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
878
|
+
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
879
|
+
{ id: "0.00 mm", rotulo: "0.00 mm" },
|
|
880
|
+
{ id: "0.05 mm", rotulo: "0.05 mm" },
|
|
881
|
+
{ id: "0.09 mm", rotulo: "0.09 mm" },
|
|
882
|
+
{ id: "0.13 mm", rotulo: "0.13 mm" },
|
|
883
|
+
{ id: "0.15 mm", rotulo: "0.15 mm" },
|
|
884
|
+
{ id: "0.18 mm", rotulo: "0.18 mm" },
|
|
885
|
+
{ id: "0.20 mm", rotulo: "0.20 mm" },
|
|
886
|
+
{ id: "0.25 mm", rotulo: "0.25 mm" },
|
|
887
|
+
{ id: "0.30 mm", rotulo: "0.30 mm" },
|
|
888
|
+
{ id: "0.35 mm", rotulo: "0.35 mm" },
|
|
889
|
+
{ id: "0.40 mm", rotulo: "0.40 mm" },
|
|
890
|
+
{ id: "0.50 mm", rotulo: "0.50 mm" },
|
|
891
|
+
{ id: "0.60 mm", rotulo: "0.60 mm" },
|
|
892
|
+
{ id: "0.70 mm", rotulo: "0.70 mm" },
|
|
893
|
+
{ id: "1.00 mm", rotulo: "1.00 mm" },
|
|
894
|
+
{ id: "1.40 mm", rotulo: "1.40 mm" },
|
|
895
|
+
{ id: "2.00 mm", rotulo: "2.00 mm" }
|
|
896
|
+
];
|
|
897
|
+
se(u, l);
|
|
898
|
+
const m = (d) => {
|
|
899
|
+
const p = A(d);
|
|
900
|
+
o.classList.toggle("ui-prop__editor--misto", p), n.setAttribute("stroke-width", String(s(p ? "" : d))), p ? W(u, D(i)) : X(u, d, Ee);
|
|
901
|
+
};
|
|
902
|
+
return m(e), P(o, m), u.addEventListener("change", () => {
|
|
903
|
+
const d = l.find((p) => p && String(p.id) === u.value);
|
|
904
|
+
i.registrarAlteracao(r, t.id, d ? d.id : u.value), m(i.obterValorAtual(t.id));
|
|
905
|
+
}), u.addEventListener("keydown", (d) => {
|
|
906
|
+
d.key === "Enter" && (d.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(u) : i.focarProximoEditor(u));
|
|
907
|
+
}), o.appendChild(a), o.appendChild(u), o;
|
|
908
|
+
}
|
|
909
|
+
const le = [
|
|
910
|
+
{ nome: "Red", indice: 1, hex: "#ff0000" },
|
|
911
|
+
{ nome: "Yellow", indice: 2, hex: "#ffff00" },
|
|
912
|
+
{ nome: "Green", indice: 3, hex: "#00ff00" },
|
|
913
|
+
{ nome: "Cyan", indice: 4, hex: "#00ffff" },
|
|
914
|
+
{ nome: "Blue", indice: 5, hex: "#0000ff" },
|
|
915
|
+
{ nome: "Magenta", indice: 6, hex: "#ff00ff" },
|
|
916
|
+
{ nome: "White", indice: 7, hex: "#ffffff" }
|
|
917
|
+
], ce = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
918
|
+
function ee(r) {
|
|
919
|
+
const t = String(r ?? "").trim().toLowerCase(), e = le.find((i) => String(i.indice) === t || i.nome.toLowerCase() === t);
|
|
920
|
+
return e ? e.nome.toLowerCase() : t;
|
|
921
|
+
}
|
|
922
|
+
function lt(r) {
|
|
923
|
+
const t = ee(r), e = le.find((i) => i.nome.toLowerCase() === t);
|
|
924
|
+
return e ? e.hex : ce.test(t) ? t : "#ffffff";
|
|
925
|
+
}
|
|
926
|
+
function de(r) {
|
|
927
|
+
return r.length === 4 ? "#" + r.slice(1).split("").map((t) => t + t).join("") : r;
|
|
928
|
+
}
|
|
929
|
+
function ct(r, t, e, i) {
|
|
930
|
+
var m;
|
|
931
|
+
const o = document.createElement("div");
|
|
932
|
+
o.className = "ui-prop__editor-cor-cad-container";
|
|
933
|
+
const a = document.createElement("div");
|
|
934
|
+
a.className = "ui-prop__cor-amostra";
|
|
935
|
+
const n = document.createElement("select");
|
|
936
|
+
n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label", String(t.rotulo ?? t.id)), se(n, [
|
|
937
|
+
{ id: "ByLayer", rotulo: "ByLayer" },
|
|
938
|
+
{ id: "ByBlock", rotulo: "ByBlock" },
|
|
939
|
+
...le.map((d) => ({ id: d.nome, rotulo: `${d.nome} (${d.indice})` }))
|
|
940
|
+
]);
|
|
941
|
+
const s = document.createElement("option");
|
|
942
|
+
s.value = "__escolher", s.textContent = ((m = i.obterTexto) == null ? void 0 : m.call(i, "selecionarCor")) || k.selecionarCor, s.setAttribute("data-acao", ""), n.appendChild(s);
|
|
943
|
+
const u = document.createElement("input");
|
|
944
|
+
u.type = "color", u.className = "ui-prop__cor-picker-oculto", u.tabIndex = -1, u.setAttribute("aria-hidden", "true");
|
|
945
|
+
const l = (d) => {
|
|
946
|
+
const p = A(d);
|
|
947
|
+
if (o.classList.toggle("ui-prop__editor--misto", p), a.classList.toggle("ui-prop__cor-amostra--misto", p), p) {
|
|
948
|
+
a.style.backgroundColor = "", u.value = "#ffffff", W(n, D(i));
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
const c = lt(d);
|
|
952
|
+
a.style.backgroundColor = c, u.value = de(c), X(
|
|
953
|
+
n,
|
|
954
|
+
d,
|
|
955
|
+
(h, f) => ee(h) === ee(f),
|
|
956
|
+
(h) => h == null || h === "" ? "—" : String(h)
|
|
957
|
+
);
|
|
958
|
+
};
|
|
959
|
+
return l(e), P(o, l), u.addEventListener("input", () => {
|
|
960
|
+
a.style.backgroundColor = u.value;
|
|
961
|
+
}), u.addEventListener("change", () => {
|
|
962
|
+
i.registrarAlteracao(r, t.id, u.value), l(i.obterValorAtual(t.id));
|
|
963
|
+
}), n.addEventListener("change", () => {
|
|
964
|
+
if (n.value === "__escolher") {
|
|
965
|
+
l(i.obterValorAtual(t.id)), u.click();
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
i.registrarAlteracao(r, t.id, n.value), l(i.obterValorAtual(t.id));
|
|
969
|
+
}), n.addEventListener("keydown", (d) => {
|
|
970
|
+
d.key === "Enter" && (d.shiftKey && i.focarEditorAnterior ? i.focarEditorAnterior(n) : i.focarProximoEditor(n));
|
|
971
|
+
}), o.appendChild(a), o.appendChild(n), o.appendChild(u), o;
|
|
972
|
+
}
|
|
973
|
+
function dt(r) {
|
|
974
|
+
try {
|
|
975
|
+
const t = document.createElement("canvas").getContext("2d");
|
|
976
|
+
if (!t) return null;
|
|
977
|
+
t.fillStyle = "#000001", t.fillStyle = r;
|
|
978
|
+
const e = String(t.fillStyle);
|
|
979
|
+
return e === "#000001" && r.toLowerCase() !== "#000001" ? null : ce.test(e) ? de(e) : null;
|
|
980
|
+
} catch {
|
|
981
|
+
return null;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
function ut(r, t, e, i) {
|
|
985
|
+
const o = document.createElement("div");
|
|
986
|
+
o.className = "ui-prop__editor-cor-container", o.setAttribute("role", "button"), o.tabIndex = 0;
|
|
987
|
+
const a = document.createElement("div");
|
|
988
|
+
a.className = "ui-prop__cor-amostra";
|
|
989
|
+
const n = document.createElement("span");
|
|
990
|
+
n.className = "ui-prop__cor-texto";
|
|
991
|
+
const s = document.createElement("input");
|
|
992
|
+
s.type = "color", s.className = "ui-prop__cor-picker-oculto", s.tabIndex = -1, s.setAttribute("aria-hidden", "true");
|
|
993
|
+
const u = (l) => {
|
|
994
|
+
const m = A(l);
|
|
995
|
+
if (o.classList.toggle("ui-prop__editor--misto", m), a.classList.toggle("ui-prop__cor-amostra--misto", m), m) {
|
|
996
|
+
const p = D(i);
|
|
997
|
+
a.style.backgroundColor = "", n.textContent = p, s.value = "#ffffff", o.setAttribute("aria-label", `${t.rotulo ?? t.id}: ${p}`);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const d = typeof l == "string" ? ce.test(l) ? de(l) : l.trim() ? dt(l.trim()) : null : null;
|
|
1001
|
+
a.style.backgroundColor = l || "#ffffff", n.textContent = t.textoAmostra || String(l || "ByLayer"), s.value = d ?? "#ffffff", o.setAttribute("aria-label", `${t.rotulo ?? t.id}: ${l || "ByLayer"}`);
|
|
1002
|
+
};
|
|
1003
|
+
return u(e), P(o, u), s.addEventListener("input", () => {
|
|
1004
|
+
a.style.backgroundColor = s.value, n.textContent = t.textoAmostra || s.value;
|
|
1005
|
+
}), s.addEventListener("change", () => {
|
|
1006
|
+
i.registrarAlteracao(r, t.id, s.value), u(i.obterValorAtual(t.id));
|
|
1007
|
+
}), o.addEventListener("click", (l) => {
|
|
1008
|
+
l.target !== s && s.click();
|
|
1009
|
+
}), o.addEventListener("keydown", (l) => {
|
|
1010
|
+
(l.key === " " || l.key === "Enter") && (l.preventDefault(), s.click());
|
|
1011
|
+
}), o.appendChild(a), o.appendChild(n), o.appendChild(s), o;
|
|
1012
|
+
}
|
|
1013
|
+
function pt(r, t, e, i) {
|
|
1014
|
+
let o;
|
|
1015
|
+
return t.somenteLeitura || t.tipo === "readonly" ? o = et(e, i.obterTextoMisto, t, i.obterTexto) : t.tipo === "booleano" ? o = tt(r, t, e, i) : t.tipo === "linha" || t.tipo === "linetype" ? o = nt(r, t, e, i) : t.tipo === "espessura" || t.tipo === "lineweight" ? o = st(r, t, e, i) : t.tipo === "cor-cad" ? o = ct(r, t, e, i) : t.tipo === "selecao" ? o = rt(r, t, e, i) : t.tipo === "cor" ? o = ut(r, t, e, i) : t.tipo === "acao" ? o = it(r, t, i) : t.tipo === "numero" ? o = ot(r, t, e, i) : o = at(r, t, e, i), o.setAttribute("part", "editor"), t.dica && o.setAttribute("aria-description", t.dica), o;
|
|
1016
|
+
}
|
|
1017
|
+
function ht(r) {
|
|
1018
|
+
if (!r.tipoContainerElement) return;
|
|
1019
|
+
const t = (Array.isArray(r.tipos) ? r.tipos : []).filter(
|
|
1020
|
+
(o) => !!(o && typeof o == "object" && o.id !== void 0 && o.id !== null)
|
|
1021
|
+
);
|
|
1022
|
+
if (t.length === 0) {
|
|
1023
|
+
r.tipoContainerElement.style.display = "none", r.tipoContainerElement.innerHTML = "";
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
r.tipoContainerElement.style.display = "flex", r.tipoContainerElement.innerHTML = "";
|
|
1027
|
+
const e = (o) => {
|
|
1028
|
+
var a;
|
|
1029
|
+
return ((a = r.obterTexto) == null ? void 0 : a.call(r, o)) || k[o];
|
|
1030
|
+
}, i = t.find((o) => String(o.id) === String(r.tipoSelecionadoId)) || t[0];
|
|
1031
|
+
if (r.estiloVisual === "revit") {
|
|
1032
|
+
const o = document.createElement("div");
|
|
1033
|
+
o.className = "ui-prop__tipo-revit-card", o.title = "Editar tipo de família", o.addEventListener("click", () => r.onEditarTipo(i));
|
|
1034
|
+
const a = document.createElement("div");
|
|
1035
|
+
a.className = "ui-prop__tipo-miniatura";
|
|
1036
|
+
const n = i.iconeSvg ? ze(i.iconeSvg) : null;
|
|
1037
|
+
n ? a.appendChild(n) : a.innerHTML = `
|
|
1038
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1039
|
+
<rect x="3" y="3" width="18" height="18" rx="2"></rect>
|
|
1040
|
+
<path d="M3 9h18M9 21V9"></path>
|
|
1041
|
+
</svg>
|
|
1042
|
+
`;
|
|
1043
|
+
const s = document.createElement("div");
|
|
1044
|
+
s.className = "ui-prop__tipo-info";
|
|
1045
|
+
const u = document.createElement("div");
|
|
1046
|
+
u.className = "ui-prop__tipo-nome", u.textContent = String(i.rotulo ?? i.id);
|
|
1047
|
+
const l = document.createElement("div");
|
|
1048
|
+
l.className = "ui-prop__tipo-subtexto", l.textContent = i.subtipo || e("tipoFamilia"), s.appendChild(u), s.appendChild(l), o.appendChild(a), o.appendChild(s);
|
|
1049
|
+
const m = document.createElement("div");
|
|
1050
|
+
m.className = "ui-prop__tipo-revit-subbarra";
|
|
1051
|
+
const d = document.createElement("select");
|
|
1052
|
+
d.className = "ui-prop__tipo-select", d.setAttribute("aria-label", "Selecionar tipo de família"), t.forEach((h) => {
|
|
1053
|
+
const f = document.createElement("option");
|
|
1054
|
+
f.value = String(h.id), f.textContent = `${h.rotulo ?? h.id}${h.subtipo ? ` : ${h.subtipo}` : ""}`, String(h.id) === String(i.id) && (f.selected = !0), d.appendChild(f);
|
|
1055
|
+
}), d.addEventListener("change", () => {
|
|
1056
|
+
r.onSelecionarTipo(d.value);
|
|
1057
|
+
});
|
|
1058
|
+
const p = document.createElement("button");
|
|
1059
|
+
p.type = "button", p.className = "ui-prop__btn-editar-tipo", p.innerHTML = `
|
|
1060
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;" aria-hidden="true">
|
|
1061
|
+
<rect x="3" y="3" width="12" height="12" rx="1"></rect>
|
|
1062
|
+
<rect x="9" y="9" width="12" height="12" rx="1"></rect>
|
|
1063
|
+
</svg>
|
|
1064
|
+
<span></span>
|
|
1065
|
+
`;
|
|
1066
|
+
const c = p.querySelector("span");
|
|
1067
|
+
c && (c.textContent = e("editarTipo")), p.addEventListener("click", () => {
|
|
1068
|
+
r.onEditarTipo(i);
|
|
1069
|
+
}), m.appendChild(d), m.appendChild(p), r.tipoContainerElement.appendChild(o), r.tipoContainerElement.appendChild(m);
|
|
1070
|
+
} else {
|
|
1071
|
+
const o = document.createElement("div");
|
|
1072
|
+
o.className = "ui-prop__tipo-autocad-bar";
|
|
1073
|
+
const a = document.createElement("select");
|
|
1074
|
+
a.className = "ui-prop__tipo-select", a.setAttribute("aria-label", "Selecionar tipo de objeto"), t.forEach((m) => {
|
|
1075
|
+
const d = document.createElement("option");
|
|
1076
|
+
d.value = String(m.id), d.textContent = String(m.rotulo ?? m.id), String(m.id) === String(i.id) && (d.selected = !0), a.appendChild(d);
|
|
1077
|
+
}), a.addEventListener("change", () => {
|
|
1078
|
+
r.onSelecionarTipo(a.value);
|
|
1079
|
+
});
|
|
1080
|
+
const n = document.createElement("div");
|
|
1081
|
+
n.className = "ui-prop__tipo-autocad-acoes";
|
|
1082
|
+
const s = document.createElement("button");
|
|
1083
|
+
s.type = "button", s.className = "ui-prop__btn-autocad", s.title = "Seleção rápida", s.setAttribute("aria-label", "Seleção rápida"), s.innerHTML = `
|
|
1084
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1085
|
+
<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>
|
|
1086
|
+
</svg>
|
|
1087
|
+
`, s.addEventListener("click", () => {
|
|
1088
|
+
r.onQuickSelect(i);
|
|
1089
|
+
});
|
|
1090
|
+
const u = document.createElement("button");
|
|
1091
|
+
u.type = "button", u.className = "ui-prop__btn-autocad", u.title = "Selecionar objetos", u.setAttribute("aria-label", "Selecionar objetos"), u.innerHTML = `
|
|
1092
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1093
|
+
<circle cx="12" cy="12" r="7"></circle>
|
|
1094
|
+
<line x1="12" y1="2" x2="12" y2="7"></line>
|
|
1095
|
+
<line x1="12" y1="17" x2="12" y2="22"></line>
|
|
1096
|
+
<line x1="2" y1="12" x2="7" y2="12"></line>
|
|
1097
|
+
<line x1="17" y1="12" x2="22" y2="12"></line>
|
|
1098
|
+
<line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
|
|
1099
|
+
<line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
|
|
1100
|
+
</svg>
|
|
1101
|
+
`, u.addEventListener("click", () => {
|
|
1102
|
+
r.onSelectObjects(i);
|
|
1103
|
+
});
|
|
1104
|
+
const l = document.createElement("button");
|
|
1105
|
+
l.type = "button", l.className = "ui-prop__btn-autocad", l.title = "Calculadora rápida", l.setAttribute("aria-label", "Calculadora rápida"), l.innerHTML = `
|
|
1106
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1107
|
+
<rect x="4" y="2" width="16" height="20" rx="2"></rect>
|
|
1108
|
+
<line x1="8" y1="6" x2="16" y2="6"></line>
|
|
1109
|
+
<circle cx="8" cy="11" r="1" fill="currentColor"></circle>
|
|
1110
|
+
<circle cx="12" cy="11" r="1" fill="currentColor"></circle>
|
|
1111
|
+
<circle cx="16" cy="11" r="1" fill="currentColor"></circle>
|
|
1112
|
+
<circle cx="8" cy="15" r="1" fill="currentColor"></circle>
|
|
1113
|
+
<circle cx="12" cy="15" r="1" fill="currentColor"></circle>
|
|
1114
|
+
<circle cx="16" cy="15" r="1" fill="currentColor"></circle>
|
|
1115
|
+
</svg>
|
|
1116
|
+
`, l.addEventListener("click", () => {
|
|
1117
|
+
r.onCalculadora(i);
|
|
1118
|
+
}), n.appendChild(s), n.appendChild(u), n.appendChild(l), o.appendChild(a), o.appendChild(n), r.tipoContainerElement.appendChild(o);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
function ft(r) {
|
|
1122
|
+
let t = 45;
|
|
1123
|
+
function e(a) {
|
|
1124
|
+
if (!Number.isFinite(a)) return t;
|
|
1125
|
+
const n = Math.max(20, Math.min(65, a));
|
|
1126
|
+
return t = n, r.hostElement.style.setProperty("--ui-prop-rotulo-largura", `${n}%`), r.splitterElement && (r.splitterElement.style.left = `calc(${n}% - 4px)`, r.splitterElement.setAttribute("aria-valuenow", String(Math.round(n)))), n;
|
|
1127
|
+
}
|
|
1128
|
+
function i(a) {
|
|
1129
|
+
r.onLarguraAlterada(a), r.hostElement.dispatchEvent(
|
|
1130
|
+
new CustomEvent("ui-splitter-resize", {
|
|
1131
|
+
bubbles: !0,
|
|
1132
|
+
composed: !0,
|
|
1133
|
+
detail: { larguraPorcentagem: a }
|
|
1134
|
+
})
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
function o() {
|
|
1138
|
+
if (!r.splitterElement || !r.corpoElement) return;
|
|
1139
|
+
r.splitterListeners.cleanup();
|
|
1140
|
+
let a = !1;
|
|
1141
|
+
const n = (s) => {
|
|
1142
|
+
if (s.button !== 0) return;
|
|
1143
|
+
s.preventDefault(), s.stopPropagation(), a = !0, r.splitterElement.classList.add("ui-prop__splitter--ativo");
|
|
1144
|
+
try {
|
|
1145
|
+
r.splitterElement.setPointerCapture(s.pointerId);
|
|
1146
|
+
} catch {
|
|
1147
|
+
}
|
|
1148
|
+
const u = r.corpoElement.getBoundingClientRect(), l = (d) => {
|
|
1149
|
+
if (!a) return;
|
|
1150
|
+
const p = u.width;
|
|
1151
|
+
if (p <= 0) return;
|
|
1152
|
+
const c = d.clientX - u.left;
|
|
1153
|
+
let b = Math.max(80, Math.min(p - 130, c)) / p * 100;
|
|
1154
|
+
b = Math.max(20, Math.min(65, b)), e(b);
|
|
1155
|
+
}, m = (d) => {
|
|
1156
|
+
if (a) {
|
|
1157
|
+
a = !1, r.splitterElement.classList.remove("ui-prop__splitter--ativo");
|
|
1158
|
+
try {
|
|
1159
|
+
r.splitterElement.hasPointerCapture(d.pointerId) && r.splitterElement.releasePointerCapture(d.pointerId);
|
|
1160
|
+
} catch {
|
|
1161
|
+
}
|
|
1162
|
+
r.splitterElement.removeEventListener("pointermove", l), r.splitterElement.removeEventListener("pointerup", m), r.splitterElement.removeEventListener("pointercancel", m), i(t);
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
r.splitterElement.addEventListener("pointermove", l), r.splitterElement.addEventListener("pointerup", m), r.splitterElement.addEventListener("pointercancel", m);
|
|
1166
|
+
};
|
|
1167
|
+
r.splitterListeners.add(r.splitterElement, "pointerdown", n), r.splitterListeners.add(r.splitterElement, "dblclick", () => {
|
|
1168
|
+
const s = e(45);
|
|
1169
|
+
i(s);
|
|
1170
|
+
}), r.splitterListeners.add(r.splitterElement, "keydown", (s) => {
|
|
1171
|
+
const u = s.shiftKey ? 5 : 2;
|
|
1172
|
+
let l = null;
|
|
1173
|
+
if (s.key === "ArrowLeft" ? l = t - u : s.key === "ArrowRight" ? l = t + u : s.key === "Home" ? l = 20 : s.key === "End" ? l = 65 : s.key === "Enter" && (l = 45), l !== null) {
|
|
1174
|
+
s.preventDefault(), s.stopPropagation();
|
|
1175
|
+
const m = e(l);
|
|
1176
|
+
i(m);
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
return {
|
|
1181
|
+
init: o,
|
|
1182
|
+
definirLarguraRotulo: e
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
const mt = `: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:var(--ui-degrade-interno, var(--ui-prop-fundo, var(--ui-fundo-superficie, 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:var(--ui-prop-fonte-compacta, 10.5px)}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:var(--ui-prop-fonte-ultracompacta, 10px)}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:var(--ui-prop-fonte-relaxada, 12px)}:host([colapsado]){width:var(--ui-prop-largura-colapsada, 32px)!important;min-width:var(--ui-prop-largura-colapsada, 32px)!important;max-width:var(--ui-prop-largura-colapsada, 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:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-prop-flutuante-z, var(--ui-z-docked-bar, 600));box-shadow:var(--ui-prop-flutuante-sombra, 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 rgba(0, 0, 0, .5));border-radius:var(--ui-prop-flutuante-raio, 6px);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);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-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;position:relative;box-sizing:border-box;background:var(--ui-degrade-interno, var(--ui-prop-container-fundo, transparent))}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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: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:var(--ui-prop-secao-fundo, 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:var(--ui-prop-card-fundo, var(--ui-fundo-card, 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: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;--_chevron: 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");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:var(--_chevron) right 4px center / 8px 5px no-repeat,transparent;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:var(--_chevron) right 4px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:var(--ui-cor-texto, #ffffff)}.ui-prop__tipo-select:focus{background:var(--_chevron) right 4px center / 8px 5px no-repeat,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: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: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: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-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background:var(--ui-prop-filtro-fundo, var(--ui-cor-fundo, #0b0b0d));border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-limpar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;font-size:11px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:2px}.ui-prop__filtro-limpar:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background:var(--ui-prop-secao-fundo, 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:var(--ui-prop-categoria-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #18181d)));cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:focus-visible{outline:1.5px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1.5px}.ui-prop__categoria-header:hover{background: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:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background: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-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-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:var(--ui-cor-texto-sobre-primaria, #000000)!important;background:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:var(--ui-cor-texto-sobre-primaria, #000000)!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter:focus-visible{outline:none}.ui-prop__splitter:focus-visible:after{background: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-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: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-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-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);--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background: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;--_chevron: 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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background: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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background: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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background: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-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:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background: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-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:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background:color-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:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}.ui-prop__editor--misto,.ui-prop__editor--misto .ui-prop__booleano-rotulo,.ui-prop__editor--misto .ui-prop__cor-texto,.ui-prop__editor--misto select,select.ui-prop__editor--misto{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab))}.ui-prop__editor-input.ui-prop__editor--misto::placeholder{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));opacity:1}.ui-prop__editor--misto option:not([data-misto]),select.ui-prop__editor--misto option:not([data-misto]){font-style:normal;color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor--misto svg{opacity:.35}.ui-prop__checkbox-custom--misto{border-color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));font-style:normal}.ui-prop__cor-amostra--misto{background:linear-gradient(to top right,transparent calc(50% - 1px),var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab)) 50%,transparent calc(50% + 1px))}.ui-prop__linha--modificada .ui-prop__col-rotulo{box-shadow:inset 2px 0 0 var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-reverter{display:none;margin-left:auto;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:var(--ui-raio-sm, 3px);background:transparent;color:var(--ui-cor-destaque, #00E08A);font-size:11px;line-height:1;cursor:pointer}.ui-prop__linha--modificada .ui-prop__btn-reverter{display:inline-flex}.ui-prop__btn-reverter:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__btn-reverter:focus-visible{outline:1px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1px}.ui-prop__previa-calculo{position:absolute;left:6px;top:50%;transform:translateY(-50%);pointer-events:none;font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #9696a6);white-space:nowrap}.ui-prop__previa-calculo[hidden]{display:none}.ui-prop__editor-input--invalido{animation:ui-prop-invalido .6s ease}.ui-prop__col-valor:has(.ui-prop__editor-input--invalido){box-shadow:inset 0 0 0 1px var(--ui-cor-texto-erro, #ff5555)}@keyframes ui-prop-invalido{0%,60%{color:var(--ui-cor-texto-erro, #ff5555)}to{color:inherit}}@media (prefers-reduced-motion: reduce){.ui-prop__editor-input--invalido{animation-duration:.01ms}}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),:host([degrade]:not([degrade="false"])),:host([gradiente]:not([gradiente="false"])),:host([gradient]:not([gradient="false"])),.ui-prop__container[data-degrade]:not([data-degrade=false]){--ui-prop-fundo: var(--ui-gradiente-superficie);--ui-prop-container-fundo: var(--ui-gradiente-superficie);--ui-prop-elevado-fundo: var(--ui-gradiente-elevado);--ui-prop-card-fundo: var(--ui-gradiente-card);--ui-prop-secao-fundo: transparent;--ui-prop-filtro-fundo: color-mix(in srgb, var(--ui-cor-fundo, #0b0b0d) 72%, transparent);--ui-prop-categoria-fundo: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent)}.ui-prop__ac{position:absolute;z-index:5;max-width:100%;box-sizing:border-box;background:var(--ui-prop-ac-fundo, var(--ui-cor-fundo-elevado, #1a1a1e));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-destaque, #00E08A);border-radius:var(--ui-raio-borda, 4px);box-shadow:var(--ui-sombra-md, 0 6px 18px rgba(0, 0, 0, .5));font-size:11px;overflow:hidden}.ui-prop__ac-item{display:flex;gap:6px;align-items:baseline;padding:3px 8px;cursor:pointer;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)}.ui-prop__ac-item--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 22%,transparent)}.ui-prop__ac-nome{font-weight:600;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__ac-assinatura{color:var(--ui-cor-texto-secundario, #9696a6)}.ui-prop__ac-dica{padding:4px 8px;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));color:var(--ui-cor-texto-secundario, #9696a6);font-size:10px;line-height:1.3;white-space:normal;-webkit-user-select:none;user-select:none}`;
|
|
1186
|
+
function gt() {
|
|
1187
|
+
return `
|
|
1188
|
+
<style>${mt}</style>
|
|
1189
|
+
<div class="ui-prop__container" id="container" part="base">
|
|
1190
|
+
<!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
|
|
1191
|
+
<div class="ui-prop__faixa-estreita" id="faixa-estreita" part="faixa-estreita" title="Clique para expandir painel">
|
|
1192
|
+
<span class="ui-prop__faixa-icone" aria-hidden="true">
|
|
1193
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
1194
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
1195
|
+
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
1196
|
+
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
1197
|
+
</svg>
|
|
1198
|
+
</span>
|
|
1199
|
+
<button type="button" class="ui-prop__faixa-btn-expandir" id="btn-expandir-faixa" title="Expandir painel de propriedades" aria-label="Expandir painel de propriedades">
|
|
1200
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
1201
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
1202
|
+
<line x1="5" y1="5" x2="5" y2="19"></line>
|
|
1203
|
+
</svg>
|
|
1204
|
+
</button>
|
|
1205
|
+
<span class="ui-prop__faixa-texto">PROPRIEDADES</span>
|
|
1206
|
+
</div>
|
|
1207
|
+
|
|
1208
|
+
<!-- 1. Header Superior -->
|
|
1209
|
+
<header class="ui-prop__header" id="header" part="cabecalho">
|
|
1210
|
+
<div class="ui-prop__header-titulo">
|
|
1211
|
+
<span class="ui-prop__header-icone" aria-hidden="true">
|
|
1212
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
1213
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
1214
|
+
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
1215
|
+
<line x1="9" y1="21" x2="9" y2="9"></line>
|
|
1216
|
+
</svg>
|
|
1217
|
+
</span>
|
|
1218
|
+
<span id="header-titulo-texto" part="titulo">Propriedades</span>
|
|
1219
|
+
</div>
|
|
1220
|
+
<div class="ui-prop__header-acoes" part="acoes-cabecalho">
|
|
1221
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-flutuante" title="Desacoplar / Modo flutuante (CAD)" aria-label="Modo flutuante">
|
|
1222
|
+
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
1223
|
+
<rect x="3" y="3" width="14" height="14" rx="2"></rect>
|
|
1224
|
+
<polyline points="15 3 21 3 21 9"></polyline>
|
|
1225
|
+
<line x1="10" y1="14" x2="21" y2="3"></line>
|
|
1226
|
+
</svg>
|
|
1227
|
+
</button>
|
|
1228
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-colapsar-horizontal" title="Recolher para coluna estreita" aria-label="Recolher para coluna estreita">
|
|
1229
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
1230
|
+
<polyline points="11 17 6 12 11 7"></polyline>
|
|
1231
|
+
<line x1="18" y1="5" x2="18" y2="19"></line>
|
|
1232
|
+
</svg>
|
|
1233
|
+
</button>
|
|
1234
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-densidade" title="Alternar compressão vertical" aria-label="Alternar densidade vertical">
|
|
1235
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
1236
|
+
<polyline points="4 7 12 11 20 7"></polyline>
|
|
1237
|
+
<polyline points="4 17 12 13 20 17"></polyline>
|
|
1238
|
+
<line x1="4" y1="12" x2="20" y2="12"></line>
|
|
1239
|
+
</svg>
|
|
1240
|
+
</button>
|
|
1241
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-expandir-tudo" title="Expandir/Recolher Tudo" aria-label="Expandir ou recolher tudo">
|
|
1242
|
+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1243
|
+
<polyline points="7 13 12 18 17 13"></polyline>
|
|
1244
|
+
<polyline points="7 6 12 11 17 6"></polyline>
|
|
1245
|
+
</svg>
|
|
1246
|
+
</button>
|
|
1247
|
+
<button type="button" class="ui-prop__btn-icone" id="btn-fechar" title="Fechar" aria-label="Fechar" style="display: none;">
|
|
1248
|
+
✕
|
|
1249
|
+
</button>
|
|
1250
|
+
</div>
|
|
1251
|
+
</header>
|
|
1252
|
+
|
|
1253
|
+
<!-- 2. Seletor de Tipo (AutoCAD / Revit) -->
|
|
1254
|
+
<div class="ui-prop__tipo-seletor-container" id="tipo-container" part="seletor-tipo" style="display: none;"></div>
|
|
1255
|
+
|
|
1256
|
+
<!-- 3. Busca Rápida de Propriedades -->
|
|
1257
|
+
<div class="ui-prop__filtro-container" id="filtro-container" part="filtro" style="display: none;">
|
|
1258
|
+
<svg class="ui-prop__filtro-icone" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
1259
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
1260
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
1261
|
+
</svg>
|
|
1262
|
+
<input type="text" class="ui-prop__filtro-input" id="filtro-input" part="filtro-input" placeholder="Filtrar propriedades..." aria-label="Filtrar propriedades" autocomplete="off" spellcheck="false" />
|
|
1263
|
+
<button type="button" class="ui-prop__filtro-limpar" id="btn-limpar-filtro" title="Limpar filtro (Esc)" aria-label="Limpar filtro" style="display: none;">✕</button>
|
|
1264
|
+
</div>
|
|
1265
|
+
|
|
1266
|
+
<!-- 4. Corpo Rolável com Grade de Categorias -->
|
|
1267
|
+
<div class="ui-prop__corpo-wrapper" id="corpo-wrapper">
|
|
1268
|
+
<div class="ui-prop__splitter" id="splitter" part="splitter" role="separator" tabindex="0" aria-orientation="vertical" aria-valuemin="20" aria-valuemax="65" aria-valuenow="45" aria-label="Redimensionar coluna de rótulos" title="Arraste para redimensionar colunas (duplo-clique reseta para 45%)"></div>
|
|
1269
|
+
<div class="ui-prop__corpo" id="corpo" part="corpo">
|
|
1270
|
+
<div class="ui-prop__lista-categorias" id="lista-categorias" part="lista-categorias"></div>
|
|
1271
|
+
</div>
|
|
1272
|
+
</div>
|
|
1273
|
+
|
|
1274
|
+
<!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
|
|
1275
|
+
<footer class="ui-prop__footer" id="footer" part="rodape" style="display: none;">
|
|
1276
|
+
<a class="ui-prop__link-ajuda" id="link-ajuda" part="ajuda" href="#" role="button">Ajuda de propriedades</a>
|
|
1277
|
+
<div class="ui-prop__footer-botoes">
|
|
1278
|
+
<button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" part="desfazer" disabled>Desfazer</button>
|
|
1279
|
+
<button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" part="aplicar" disabled>Aplicar</button>
|
|
1280
|
+
</div>
|
|
1281
|
+
</footer>
|
|
1282
|
+
|
|
1283
|
+
<!-- 6. Grip para redimensionar no modo flutuante -->
|
|
1284
|
+
<div class="ui-prop__resizer-canto" id="resizer-canto" title="Redimensionar"></div>
|
|
1285
|
+
</div>
|
|
1286
|
+
`;
|
|
1287
|
+
}
|
|
1288
|
+
function bt(r) {
|
|
1289
|
+
const { listaContainer: t, categorias: e, termoBusca: i, onToggleCategoria: o, linhaCtx: a } = r, n = (d) => {
|
|
1290
|
+
var p;
|
|
1291
|
+
return ((p = r.obterTexto) == null ? void 0 : p.call(r, d)) || k[d];
|
|
1292
|
+
};
|
|
1293
|
+
t.innerHTML = "";
|
|
1294
|
+
const s = (Array.isArray(e) ? e : []).filter(
|
|
1295
|
+
(d) => !!(d && typeof d == "object")
|
|
1296
|
+
);
|
|
1297
|
+
if (s.length === 0) {
|
|
1298
|
+
const d = document.createElement("div");
|
|
1299
|
+
d.className = "ui-prop__vazio", d.setAttribute("part", "vazio"), d.textContent = n("vazio"), t.appendChild(d);
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
const u = document.createDocumentFragment(), l = (i || "").trim().toLowerCase();
|
|
1303
|
+
let m = 0;
|
|
1304
|
+
if (s.forEach((d) => {
|
|
1305
|
+
const p = String(d.titulo ?? d.id ?? "").toLowerCase(), c = !!l && p.includes(l), h = (Array.isArray(d.propriedades) ? d.propriedades : []).filter((y) => {
|
|
1306
|
+
if (!y || typeof y != "object" || y.id === void 0 || y.id === null) return !1;
|
|
1307
|
+
if (!l || c) return !0;
|
|
1308
|
+
const _ = String(y.rotulo ?? "").toLowerCase(), C = String(y.id).toLowerCase(), F = a.valoresAtuais[y.id], Ae = A(F) ? "" : String(F ?? "").toLowerCase();
|
|
1309
|
+
return _.includes(l) || C.includes(l) || Ae.includes(l);
|
|
1310
|
+
});
|
|
1311
|
+
if (l && h.length === 0)
|
|
1312
|
+
return;
|
|
1313
|
+
m += h.length;
|
|
1314
|
+
const f = r.obterCategoriaAberta ? r.obterCategoriaAberta(d) : d.aberto !== void 0 ? d.aberto !== !1 : d.aberta !== !1, g = !!l || f, b = document.createElement("div");
|
|
1315
|
+
b.className = `ui-prop__categoria ${g ? "ui-prop__categoria--aberta" : ""}`, b.setAttribute("data-cat-id", String(d.id)), b.setAttribute("part", "categoria"), R(b, "categoria-aberta", g);
|
|
1316
|
+
const v = document.createElement("div");
|
|
1317
|
+
v.className = "ui-prop__categoria-header", v.setAttribute("part", "categoria-cabecalho"), v.setAttribute("role", "button"), v.tabIndex = 0, v.setAttribute("aria-expanded", String(g));
|
|
1318
|
+
const x = document.createElement("div");
|
|
1319
|
+
x.className = "ui-prop__categoria-titulo-bloco";
|
|
1320
|
+
const E = document.createElement("span");
|
|
1321
|
+
E.className = "ui-prop__categoria-seta", E.setAttribute("aria-hidden", "true"), E.textContent = "▶";
|
|
1322
|
+
const S = document.createElement("span");
|
|
1323
|
+
S.textContent = String(d.titulo ?? d.id), x.appendChild(E), x.appendChild(S);
|
|
1324
|
+
const z = document.createElement("span");
|
|
1325
|
+
z.className = "ui-prop__categoria-contador", z.textContent = String(h.length), v.appendChild(x), v.appendChild(z), v.addEventListener("click", () => o(String(d.id))), v.addEventListener("keydown", (y) => {
|
|
1326
|
+
if (y.key === "Enter" || y.key === " ")
|
|
1327
|
+
y.preventDefault(), o(String(d.id));
|
|
1328
|
+
else if (y.key === "ArrowRight")
|
|
1329
|
+
b.classList.contains("ui-prop__categoria--aberta") || (y.preventDefault(), o(String(d.id)));
|
|
1330
|
+
else if (y.key === "ArrowLeft")
|
|
1331
|
+
b.classList.contains("ui-prop__categoria--aberta") && (y.preventDefault(), o(String(d.id)));
|
|
1332
|
+
else if (y.key === "ArrowDown" || y.key === "ArrowUp") {
|
|
1333
|
+
const _ = Array.from(t.querySelectorAll(".ui-prop__categoria-header")), C = _.indexOf(v);
|
|
1334
|
+
if (C !== -1) {
|
|
1335
|
+
const F = y.key === "ArrowDown" ? C + 1 : C - 1;
|
|
1336
|
+
F >= 0 && F < _.length && (y.preventDefault(), _[F].focus());
|
|
1337
|
+
}
|
|
1338
|
+
} else if (y.key === "Home") {
|
|
1339
|
+
const _ = t.querySelector(".ui-prop__categoria-header");
|
|
1340
|
+
_ && (y.preventDefault(), _.focus());
|
|
1341
|
+
} else if (y.key === "End") {
|
|
1342
|
+
const _ = t.querySelectorAll(".ui-prop__categoria-header");
|
|
1343
|
+
_.length > 0 && (y.preventDefault(), _[_.length - 1].focus());
|
|
1344
|
+
}
|
|
1345
|
+
});
|
|
1346
|
+
const T = document.createElement("div");
|
|
1347
|
+
T.className = "ui-prop__categoria-conteudo", T.setAttribute("part", "categoria-conteudo"), h.forEach((y) => {
|
|
1348
|
+
const _ = vt(String(d.id), y, a);
|
|
1349
|
+
T.appendChild(_);
|
|
1350
|
+
}), b.appendChild(v), b.appendChild(T), u.appendChild(b);
|
|
1351
|
+
}), l && m === 0) {
|
|
1352
|
+
const d = document.createElement("div");
|
|
1353
|
+
d.className = "ui-prop__vazio", d.setAttribute("part", "vazio"), d.textContent = n("vazioBusca").split("{termo}").join(i), t.appendChild(d);
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
t.appendChild(u);
|
|
1357
|
+
}
|
|
1358
|
+
function vt(r, t, e) {
|
|
1359
|
+
var h, f;
|
|
1360
|
+
const i = document.createElement("div");
|
|
1361
|
+
i.className = "ui-prop__linha", i.setAttribute("data-prop-id", String(t.id)), i.setAttribute("part", "linha");
|
|
1362
|
+
const o = e.valoresAtuais[t.id] !== void 0 ? e.valoresAtuais[t.id] : J(t), a = t.id in e.valoresOriginais ? e.valoresOriginais[t.id] : J(t), n = !V(o, a), s = A(o);
|
|
1363
|
+
n && (i.classList.add("ui-prop__linha--modificada"), R(i, "linha-modificada", !0)), s && (i.classList.add("ui-prop__linha--misto"), R(i, "linha-mista", !0)), i.addEventListener("dblclick", () => {
|
|
1364
|
+
const g = i.querySelector(
|
|
1365
|
+
'input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline'
|
|
1366
|
+
);
|
|
1367
|
+
g && (g.focus(), g instanceof HTMLInputElement && g.select());
|
|
1368
|
+
});
|
|
1369
|
+
const u = document.createElement("div");
|
|
1370
|
+
u.className = "ui-prop__col-rotulo", u.setAttribute("part", "rotulo");
|
|
1371
|
+
const l = String(t.rotulo ?? t.id);
|
|
1372
|
+
u.title = t.dica ? `${l} — ${t.dica}` : l;
|
|
1373
|
+
const m = document.createElement("span");
|
|
1374
|
+
if (m.textContent = l, u.appendChild(m), !t.somenteLeitura && t.tipo !== "readonly" && t.tipo !== "acao" && e.onRedefinir) {
|
|
1375
|
+
const g = e.onRedefinir, b = document.createElement("button");
|
|
1376
|
+
b.type = "button", b.className = "ui-prop__btn-reverter";
|
|
1377
|
+
const v = ((f = (h = e.editorCtx).obterTexto) == null ? void 0 : f.call(h, "restaurarValor")) || k.restaurarValor;
|
|
1378
|
+
b.title = v, b.setAttribute("aria-label", `${v}: ${l}`), b.setAttribute("part", "restaurar"), b.textContent = "↺", b.addEventListener("click", (x) => {
|
|
1379
|
+
x.stopPropagation(), g(String(t.id));
|
|
1380
|
+
}), b.addEventListener("dblclick", (x) => x.stopPropagation()), u.appendChild(b);
|
|
1381
|
+
}
|
|
1382
|
+
t.tipo === "numero" && !t.somenteLeitura && xt(u, r, t, e);
|
|
1383
|
+
const p = document.createElement("div");
|
|
1384
|
+
p.className = "ui-prop__col-valor", p.setAttribute("part", "valor");
|
|
1385
|
+
const c = pt(r, t, o, e.editorCtx);
|
|
1386
|
+
if (p.appendChild(c), t.unidade) {
|
|
1387
|
+
const g = document.createElement("span");
|
|
1388
|
+
g.className = "ui-prop__unidade-sufixo", g.setAttribute("part", "unidade"), g.textContent = t.unidade, p.appendChild(g);
|
|
1389
|
+
}
|
|
1390
|
+
return i.appendChild(u), i.appendChild(p), i;
|
|
1391
|
+
}
|
|
1392
|
+
function xt(r, t, e, i) {
|
|
1393
|
+
r.classList.add("ui-prop__col-rotulo--scrub");
|
|
1394
|
+
const o = String(e.rotulo ?? e.id), a = e.dica ? `${o} — ${e.dica}` : o;
|
|
1395
|
+
r.title = `${a} (Arraste para ajustar, duplo-clique para editar)`;
|
|
1396
|
+
let n = 0, s = 0, u = !1;
|
|
1397
|
+
r.addEventListener("pointerdown", (l) => {
|
|
1398
|
+
var c, h;
|
|
1399
|
+
if (l.button !== 0 || (h = (c = l.target) == null ? void 0 : c.closest) != null && h.call(c, ".ui-prop__btn-reverter") || A(i.editorCtx.obterValorAtual(e.id))) return;
|
|
1400
|
+
n = l.clientX;
|
|
1401
|
+
const m = i.editorCtx.obterValorAtual(e.id);
|
|
1402
|
+
s = typeof m == "number" ? m : parseFloat(String(m || 0)) || 0, u = !1;
|
|
1403
|
+
try {
|
|
1404
|
+
r.setPointerCapture(l.pointerId);
|
|
1405
|
+
} catch {
|
|
1406
|
+
}
|
|
1407
|
+
r.classList.add("ui-prop__col-rotulo--arrastando");
|
|
1408
|
+
const d = (f) => {
|
|
1409
|
+
const g = f.clientX - n;
|
|
1410
|
+
if (Math.abs(g) > 2 && (u = !0), u) {
|
|
1411
|
+
let b = 1;
|
|
1412
|
+
f.shiftKey ? b = 0.1 : (f.ctrlKey || f.metaKey) && (b = 10);
|
|
1413
|
+
const v = Y(e), x = typeof e.passo == "number" && e.passo > 0 ? e.passo * 0.01 : typeof e.step == "number" && e.step > 0 ? e.step * 0.01 : Math.pow(10, -Math.min(v !== void 0 ? v : 2, 2));
|
|
1414
|
+
let E = s + g * x * b;
|
|
1415
|
+
E = ne(E, e), v !== void 0 ? E = Number(E.toFixed(v)) : E = Math.round(E * 100) / 100, i.editorCtx.registrarAlteracao(t, e.id, E), i.onAtualizarCampoVisual(e.id, E);
|
|
1416
|
+
}
|
|
1417
|
+
}, p = (f) => {
|
|
1418
|
+
r.classList.remove("ui-prop__col-rotulo--arrastando");
|
|
1419
|
+
try {
|
|
1420
|
+
r.hasPointerCapture(f.pointerId) && r.releasePointerCapture(f.pointerId);
|
|
1421
|
+
} catch {
|
|
1422
|
+
}
|
|
1423
|
+
r.removeEventListener("pointermove", d), r.removeEventListener("pointerup", p), r.removeEventListener("pointercancel", p);
|
|
1424
|
+
};
|
|
1425
|
+
r.addEventListener("pointermove", d), r.addEventListener("pointerup", p), r.addEventListener("pointercancel", p);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
const U = 300, we = 480, O = /* @__PURE__ */ new WeakMap();
|
|
1429
|
+
function _t(r) {
|
|
1430
|
+
var i, o, a;
|
|
1431
|
+
const t = r.hasAttribute("flutuante"), e = r.style;
|
|
1432
|
+
if (t) {
|
|
1433
|
+
const n = O.get(r) ?? { acoplado: { width: "", height: "" } };
|
|
1434
|
+
n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height }, O.set(r, n), r.removeAttribute("flutuante"), e.left = "", e.top = "", e.right = "", e.bottom = "", e.position = "", e.zIndex = "", e.width = n.acoplado.width, e.height = n.acoplado.height;
|
|
1435
|
+
} else {
|
|
1436
|
+
const n = {
|
|
1437
|
+
acoplado: { width: e.width, height: e.height },
|
|
1438
|
+
flutuante: (i = O.get(r)) == null ? void 0 : i.flutuante
|
|
1439
|
+
};
|
|
1440
|
+
if (O.set(r, n), r.setAttribute("flutuante", ""), e.position = "fixed", (o = n.flutuante) != null && o.left || (a = n.flutuante) != null && a.top)
|
|
1441
|
+
e.left = n.flutuante.left, e.top = n.flutuante.top, e.width = n.flutuante.width, e.height = n.flutuante.height;
|
|
1442
|
+
else if (!e.left && !e.top) {
|
|
1443
|
+
const s = Math.max(
|
|
1444
|
+
20,
|
|
1445
|
+
(typeof window < "u" ? window.innerWidth : 1024) - U - 30
|
|
1446
|
+
);
|
|
1447
|
+
e.left = `${s}px`, e.top = "70px", e.width = `${U}px`, e.height = `${we}px`;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
return !t;
|
|
1451
|
+
}
|
|
1452
|
+
function be(r) {
|
|
1453
|
+
var e;
|
|
1454
|
+
const t = r.style;
|
|
1455
|
+
if (!r.hasAttribute("flutuante")) {
|
|
1456
|
+
if (t.position === "fixed") {
|
|
1457
|
+
const i = O.get(r);
|
|
1458
|
+
t.left = "", t.top = "", t.right = "", t.bottom = "", t.position = "", t.zIndex = "", t.width = (i == null ? void 0 : i.acoplado.width) ?? "", t.height = (i == null ? void 0 : i.acoplado.height) ?? "";
|
|
1459
|
+
}
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
if (t.position !== "fixed" && (O.set(r, {
|
|
1463
|
+
acoplado: { width: t.width, height: t.height },
|
|
1464
|
+
flutuante: (e = O.get(r)) == null ? void 0 : e.flutuante
|
|
1465
|
+
}), t.position = "fixed"), !t.left && !t.top) {
|
|
1466
|
+
const i = Math.max(
|
|
1467
|
+
20,
|
|
1468
|
+
(typeof window < "u" ? window.innerWidth : 1024) - U - 30
|
|
1469
|
+
);
|
|
1470
|
+
t.left = `${i}px`, t.top = "70px", t.width || (t.width = `${U}px`), t.height || (t.height = `${we}px`);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
function yt(r, t, e) {
|
|
1474
|
+
const i = t.getElementById("header");
|
|
1475
|
+
if (i) {
|
|
1476
|
+
let a = null, n = 0, s = 0, u = 0, l = 0;
|
|
1477
|
+
const m = (p) => {
|
|
1478
|
+
if (a === null) return;
|
|
1479
|
+
const c = p.clientX - n, h = p.clientY - s;
|
|
1480
|
+
let f = u + c, g = l + h;
|
|
1481
|
+
const b = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) - r.offsetWidth), v = Math.max(0, (typeof window < "u" ? window.innerHeight : 768) - 30);
|
|
1482
|
+
f = Math.max(0, Math.min(b, f)), g = Math.max(0, Math.min(v, g)), r.style.left = `${f}px`, r.style.top = `${g}px`, r.style.right = "auto", r.style.bottom = "auto";
|
|
1483
|
+
}, d = (p) => {
|
|
1484
|
+
if (a !== null) {
|
|
1485
|
+
try {
|
|
1486
|
+
i.releasePointerCapture(p.pointerId);
|
|
1487
|
+
} catch {
|
|
1488
|
+
}
|
|
1489
|
+
i.removeEventListener("pointermove", m), i.removeEventListener("pointerup", d), i.removeEventListener("pointercancel", d), a = null, r.classList.remove("arrastando"), r.dispatchEvent(new CustomEvent("ui-mover", {
|
|
1490
|
+
bubbles: !0,
|
|
1491
|
+
composed: !0,
|
|
1492
|
+
detail: { left: r.style.left, top: r.style.top }
|
|
1493
|
+
}));
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
e.add(i, "pointerdown", (p) => {
|
|
1497
|
+
if (!r.hasAttribute("flutuante") || p.target.closest("button, input, select, a") || p.button !== 0) return;
|
|
1498
|
+
p.preventDefault(), a = p.pointerId, n = p.clientX, s = p.clientY;
|
|
1499
|
+
const h = r.getBoundingClientRect();
|
|
1500
|
+
u = h.left, l = h.top, r.classList.add("arrastando");
|
|
1501
|
+
try {
|
|
1502
|
+
i.setPointerCapture(p.pointerId);
|
|
1503
|
+
} catch {
|
|
1504
|
+
}
|
|
1505
|
+
i.addEventListener("pointermove", m), i.addEventListener("pointerup", d), i.addEventListener("pointercancel", d);
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
const o = t.getElementById("resizer-canto");
|
|
1509
|
+
if (o) {
|
|
1510
|
+
let a = null, n = 0, s = 0, u = 0, l = 0;
|
|
1511
|
+
const m = (p) => {
|
|
1512
|
+
if (a === null) return;
|
|
1513
|
+
const c = Math.max(200, n + (p.clientX - u)), h = Math.max(180, s + (p.clientY - l));
|
|
1514
|
+
r.style.width = `${c}px`, r.style.height = `${h}px`;
|
|
1515
|
+
}, d = (p) => {
|
|
1516
|
+
if (a !== null) {
|
|
1517
|
+
try {
|
|
1518
|
+
o.releasePointerCapture(p.pointerId);
|
|
1519
|
+
} catch {
|
|
1520
|
+
}
|
|
1521
|
+
o.removeEventListener("pointermove", m), o.removeEventListener("pointerup", d), o.removeEventListener("pointercancel", d), a = null, r.dispatchEvent(new CustomEvent("ui-redimensionar", {
|
|
1522
|
+
bubbles: !0,
|
|
1523
|
+
composed: !0,
|
|
1524
|
+
detail: { width: r.style.width, height: r.style.height }
|
|
1525
|
+
}));
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
e.add(o, "pointerdown", (p) => {
|
|
1529
|
+
if (!r.hasAttribute("flutuante") || p.button !== 0) return;
|
|
1530
|
+
p.preventDefault(), p.stopPropagation(), a = p.pointerId, u = p.clientX, l = p.clientY;
|
|
1531
|
+
const c = r.getBoundingClientRect();
|
|
1532
|
+
n = c.width, s = c.height;
|
|
1533
|
+
try {
|
|
1534
|
+
o.setPointerCapture(p.pointerId);
|
|
1535
|
+
} catch {
|
|
1536
|
+
}
|
|
1537
|
+
o.addEventListener("pointermove", m), o.addEventListener("pointerup", d), o.addEventListener("pointercancel", d);
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
function Et(r) {
|
|
1542
|
+
return r === "compacta" ? "ultracompacta" : r === "ultracompacta" ? "padrao" : "compacta";
|
|
1543
|
+
}
|
|
1544
|
+
const ve = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
1545
|
+
class wt {
|
|
1546
|
+
constructor(t) {
|
|
1547
|
+
w(this, "valoresOriginais", {});
|
|
1548
|
+
w(this, "valoresAtuais", {});
|
|
1549
|
+
this.ctx = t;
|
|
1550
|
+
}
|
|
1551
|
+
inicializarCategorias(t) {
|
|
1552
|
+
this.valoresOriginais = {}, this.valoresAtuais = {};
|
|
1553
|
+
const e = /* @__PURE__ */ new Set();
|
|
1554
|
+
(Array.isArray(t) ? t : []).forEach((i) => {
|
|
1555
|
+
!i || typeof i != "object" || (Array.isArray(i.propriedades) ? i.propriedades : []).forEach((o) => {
|
|
1556
|
+
if (!o || typeof o != "object" || o.id === void 0 || o.id === null) return;
|
|
1557
|
+
const a = String(o.id);
|
|
1558
|
+
if (ve.has(a)) return;
|
|
1559
|
+
e.has(a) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${a}". Os valores são indexados por id e serão compartilhados.`), e.add(a);
|
|
1560
|
+
const n = J(o);
|
|
1561
|
+
this.valoresOriginais[a] = n, this.valoresAtuais[a] = n;
|
|
1562
|
+
});
|
|
1563
|
+
}), this.ctx.onAtualizarBotoesFooter(!1);
|
|
1564
|
+
}
|
|
1565
|
+
/** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
|
|
1566
|
+
get isDirty() {
|
|
1567
|
+
return Object.keys(this.valoresAtuais).some((t) => this.isModificada(t));
|
|
1568
|
+
}
|
|
1569
|
+
isModificada(t) {
|
|
1570
|
+
return !V(this.valoresAtuais[t], this.valoresOriginais[t]);
|
|
1571
|
+
}
|
|
1572
|
+
getValores() {
|
|
1573
|
+
return { ...this.valoresAtuais };
|
|
1574
|
+
}
|
|
1575
|
+
getValoresOriginais() {
|
|
1576
|
+
return { ...this.valoresOriginais };
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Carrega valores (viram também os originais). Chaves de protótipo são ignoradas.
|
|
1580
|
+
* Devolve os ids cujo valor realmente mudou, para a tela atualizar só esses campos.
|
|
1581
|
+
*/
|
|
1582
|
+
setValores(t) {
|
|
1583
|
+
if (!t || typeof t != "object") return [];
|
|
1584
|
+
const e = [];
|
|
1585
|
+
return Object.keys(t).forEach((i) => {
|
|
1586
|
+
if (ve.has(i)) return;
|
|
1587
|
+
const o = t[i], a = !V(this.valoresAtuais[i], o) || !V(this.valoresOriginais[i], o);
|
|
1588
|
+
this.valoresAtuais[i] = o, this.valoresOriginais[i] = o, a && e.push(i);
|
|
1589
|
+
}), e.forEach((i) => {
|
|
1590
|
+
this.aposAlterar(i), this.ctx.onAtualizarCampoVisual(i, this.valoresAtuais[i]);
|
|
1591
|
+
}), this.ctx.onAtualizarBotoesFooter(this.isDirty), e;
|
|
1592
|
+
}
|
|
1593
|
+
obterValor(t) {
|
|
1594
|
+
return this.valoresAtuais[t];
|
|
1595
|
+
}
|
|
1596
|
+
obterValorOriginal(t) {
|
|
1597
|
+
return this.valoresOriginais[t];
|
|
1598
|
+
}
|
|
1599
|
+
/** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
|
|
1600
|
+
definirValor(t, e, i = !0) {
|
|
1601
|
+
if (!Object.prototype.hasOwnProperty.call(this.valoresOriginais, t)) return;
|
|
1602
|
+
const o = this.valoresAtuais[t];
|
|
1603
|
+
V(o, e) || (this.valoresAtuais[t] = e, this.aposAlterar(t), this.ctx.onAtualizarCampoVisual(t, e), i && this.emitirAlteracao(t, e, o, this.categoriaDe(t)));
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Restaura uma propriedade individual ao seu valor original (antes da edição).
|
|
1607
|
+
* Devolve `false` se não havia o que restaurar.
|
|
1608
|
+
*/
|
|
1609
|
+
redefinirValor(t, e = !0) {
|
|
1610
|
+
if (!(t in this.valoresOriginais) || !this.isModificada(t)) return !1;
|
|
1611
|
+
const i = this.valoresOriginais[t];
|
|
1612
|
+
return this.definirValor(t, i, e && !this.ctx.isModoManual()), !0;
|
|
1613
|
+
}
|
|
1614
|
+
/** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
|
|
1615
|
+
registrarAlteracao(t, e, i) {
|
|
1616
|
+
const o = this.valoresAtuais[e];
|
|
1617
|
+
V(o, i) || (this.valoresAtuais[e] = i, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, i, o, t));
|
|
1618
|
+
}
|
|
1619
|
+
aplicar() {
|
|
1620
|
+
var i;
|
|
1621
|
+
if (!this.isDirty) return;
|
|
1622
|
+
const t = {};
|
|
1623
|
+
Object.keys(this.valoresAtuais).forEach((o) => {
|
|
1624
|
+
this.isModificada(o) && (t[o] = this.valoresAtuais[o]);
|
|
1625
|
+
}), this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
|
|
1626
|
+
const e = (i = this.ctx.hostElement.shadowRoot) == null ? void 0 : i.querySelectorAll(".ui-prop__linha--modificada");
|
|
1627
|
+
e == null || e.forEach((o) => {
|
|
1628
|
+
o.classList.remove("ui-prop__linha--modificada"), R(o, "linha-modificada", !1);
|
|
1629
|
+
}), this.ctx.hostElement.dispatchEvent(
|
|
1630
|
+
new CustomEvent("ui-aplicar", {
|
|
1631
|
+
bubbles: !0,
|
|
1632
|
+
composed: !0,
|
|
1633
|
+
detail: { valores: { ...this.valoresAtuais }, alterados: t }
|
|
1634
|
+
})
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
desfazer() {
|
|
1638
|
+
this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
|
|
1639
|
+
new CustomEvent("ui-desfazer", {
|
|
1640
|
+
bubbles: !0,
|
|
1641
|
+
composed: !0,
|
|
1642
|
+
detail: { valores: { ...this.valoresAtuais } }
|
|
1643
|
+
})
|
|
1644
|
+
));
|
|
1645
|
+
}
|
|
1646
|
+
/** Marca/desmarca a linha (modificada e mista) e recalcula os botões do rodapé (voltar ao original limpa o estado). */
|
|
1647
|
+
aposAlterar(t) {
|
|
1648
|
+
const e = xe(this.ctx.hostElement.shadowRoot, t);
|
|
1649
|
+
if (e) {
|
|
1650
|
+
const i = this.isModificada(t), o = A(this.valoresAtuais[t]);
|
|
1651
|
+
e.classList.toggle("ui-prop__linha--modificada", i), e.classList.toggle("ui-prop__linha--misto", o), R(e, "linha-modificada", i), R(e, "linha-mista", o);
|
|
1652
|
+
}
|
|
1653
|
+
this.ctx.onAtualizarBotoesFooter(this.isDirty);
|
|
1654
|
+
}
|
|
1655
|
+
categoriaDe(t) {
|
|
1656
|
+
for (const e of this.ctx.getCategorias())
|
|
1657
|
+
if (e && Array.isArray(e.propriedades) && e.propriedades.some((i) => i && String(i.id) === String(t)))
|
|
1658
|
+
return e.id;
|
|
1659
|
+
return "";
|
|
1660
|
+
}
|
|
1661
|
+
emitirAlteracao(t, e, i, o = "") {
|
|
1662
|
+
this.ctx.hostElement.dispatchEvent(
|
|
1663
|
+
new CustomEvent("ui-propriedade-alterada", {
|
|
1664
|
+
bubbles: !0,
|
|
1665
|
+
composed: !0,
|
|
1666
|
+
detail: {
|
|
1667
|
+
id: t,
|
|
1668
|
+
categoriaId: o,
|
|
1669
|
+
valor: e,
|
|
1670
|
+
valorAnterior: i,
|
|
1671
|
+
todosValores: { ...this.valoresAtuais }
|
|
1672
|
+
}
|
|
1673
|
+
})
|
|
1674
|
+
);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
function At(r) {
|
|
1678
|
+
const {
|
|
1679
|
+
shadow: t,
|
|
1680
|
+
listeners: e,
|
|
1681
|
+
host: i,
|
|
1682
|
+
onToggleExpandirTodas: o,
|
|
1683
|
+
onFiltrar: a,
|
|
1684
|
+
onAplicar: n,
|
|
1685
|
+
onDesfazer: s,
|
|
1686
|
+
onAlternarDensidade: u,
|
|
1687
|
+
onAlternarFlutuante: l,
|
|
1688
|
+
onAlternarColapsoHorizontal: m,
|
|
1689
|
+
onFocarPrimeiroEditor: d
|
|
1690
|
+
} = r, p = t.getElementById("btn-flutuante");
|
|
1691
|
+
p && l && e.add(p, "click", l);
|
|
1692
|
+
const c = t.getElementById("btn-colapsar-horizontal");
|
|
1693
|
+
c && m && e.add(c, "click", m);
|
|
1694
|
+
const h = t.getElementById("faixa-estreita");
|
|
1695
|
+
h && m && e.add(h, "click", m);
|
|
1696
|
+
const f = t.getElementById("btn-expandir-faixa");
|
|
1697
|
+
f && m && e.add(f, "click", (_) => {
|
|
1698
|
+
_.stopPropagation(), m();
|
|
1699
|
+
});
|
|
1700
|
+
const g = t.getElementById("btn-densidade");
|
|
1701
|
+
g && u && e.add(g, "click", u);
|
|
1702
|
+
const b = t.getElementById("btn-expandir-tudo");
|
|
1703
|
+
b && e.add(b, "click", o);
|
|
1704
|
+
const v = t.getElementById("btn-fechar");
|
|
1705
|
+
v && e.add(v, "click", () => {
|
|
1706
|
+
i.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
|
|
1707
|
+
});
|
|
1708
|
+
const x = t.getElementById("filtro-input"), E = t.getElementById("btn-limpar-filtro"), S = () => {
|
|
1709
|
+
E && x && (E.style.display = x.value ? "inline-flex" : "none");
|
|
1710
|
+
};
|
|
1711
|
+
x && (e.add(x, "input", () => {
|
|
1712
|
+
S();
|
|
1713
|
+
const _ = (x.value || "").trim().toLowerCase();
|
|
1714
|
+
a(_);
|
|
1715
|
+
}), e.add(x, "keydown", (_) => {
|
|
1716
|
+
_.key === "Escape" ? x.value ? (_.preventDefault(), _.stopPropagation(), x.value = "", S(), a("")) : x.blur() : (_.key === "Enter" || _.key === "ArrowDown") && d && (_.preventDefault(), d());
|
|
1717
|
+
})), E && x && e.add(E, "click", () => {
|
|
1718
|
+
x.value = "", S(), a(""), x.focus();
|
|
1719
|
+
});
|
|
1720
|
+
const z = t.getElementById("btn-aplicar");
|
|
1721
|
+
z && e.add(z, "click", n);
|
|
1722
|
+
const T = t.getElementById("btn-desfazer");
|
|
1723
|
+
T && e.add(T, "click", s);
|
|
1724
|
+
const y = t.getElementById("link-ajuda");
|
|
1725
|
+
if (y) {
|
|
1726
|
+
const _ = (C) => {
|
|
1727
|
+
C.preventDefault(), i.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
|
|
1728
|
+
};
|
|
1729
|
+
e.add(y, "click", _), e.add(y, "keydown", (C) => {
|
|
1730
|
+
C.key === " " && _(C);
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
e.add(t, "keydown", (_) => {
|
|
1734
|
+
const C = _;
|
|
1735
|
+
(C.ctrlKey || C.metaKey) && C.key === "Enter" && i.getAttribute("modo-aplicar") === "manual" && (C.preventDefault(), n());
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
function L(r, t) {
|
|
1739
|
+
const e = r.getElementById("header-titulo-texto");
|
|
1740
|
+
e && (e.textContent = t.getAttribute("titulo") || "Propriedades");
|
|
1741
|
+
const i = r.getElementById("btn-fechar");
|
|
1742
|
+
i && (i.style.display = t.hasAttribute("fechavel") ? "inline-flex" : "none");
|
|
1743
|
+
const o = r.getElementById("btn-flutuante");
|
|
1744
|
+
if (o) {
|
|
1745
|
+
const f = t.hasAttribute("flutuante");
|
|
1746
|
+
o.title = f ? "Acoplar painel (Dock)" : "Desacoplar / Modo flutuante (CAD)", o.setAttribute("aria-pressed", String(f)), o.classList.toggle("ui-prop__btn-icone--ativo", f);
|
|
1747
|
+
}
|
|
1748
|
+
const a = r.getElementById("btn-colapsar-horizontal");
|
|
1749
|
+
if (a) {
|
|
1750
|
+
const f = t.hasAttribute("colapsado");
|
|
1751
|
+
a.title = f ? "Expandir painel" : "Recolher para coluna estreita", a.setAttribute("aria-pressed", String(f)), a.classList.toggle("ui-prop__btn-icone--ativo", f);
|
|
1752
|
+
}
|
|
1753
|
+
const n = r.getElementById("btn-densidade");
|
|
1754
|
+
if (n) {
|
|
1755
|
+
const f = t.getAttribute("densidade") || "padrão";
|
|
1756
|
+
n.title = `Compressão vertical: ${f} (clique para alternar)`;
|
|
1757
|
+
}
|
|
1758
|
+
const s = r.getElementById("filtro-container");
|
|
1759
|
+
s && (s.style.display = t.hasAttribute("filtro") ? "flex" : "none");
|
|
1760
|
+
const u = r.getElementById("filtro-input"), l = r.getElementById("btn-limpar-filtro");
|
|
1761
|
+
l && u && (l.style.display = u.value ? "inline-flex" : "none");
|
|
1762
|
+
const m = r.getElementById("filtro-input");
|
|
1763
|
+
m && (m.placeholder = $(t, "filtroPlaceholder"));
|
|
1764
|
+
const d = r.getElementById("btn-aplicar");
|
|
1765
|
+
d && (d.textContent = $(t, "aplicar"));
|
|
1766
|
+
const p = r.getElementById("btn-desfazer");
|
|
1767
|
+
p && (p.textContent = $(t, "desfazer"));
|
|
1768
|
+
const c = r.getElementById("link-ajuda");
|
|
1769
|
+
c && (c.textContent = $(t, "ajuda"));
|
|
1770
|
+
const h = r.getElementById("footer");
|
|
1771
|
+
h && (h.style.display = t.getAttribute("modo-aplicar") === "manual" ? "flex" : "none");
|
|
1772
|
+
}
|
|
1773
|
+
const j = class j extends Se {
|
|
1774
|
+
constructor() {
|
|
1775
|
+
super();
|
|
1776
|
+
w(this, "shadow");
|
|
1777
|
+
w(this, "listeners", new ue());
|
|
1778
|
+
w(this, "splitterListeners", new ue());
|
|
1779
|
+
w(this, "controladorSplitter");
|
|
1780
|
+
w(this, "gerenciadorValores");
|
|
1781
|
+
w(this, "_conectado", !1);
|
|
1782
|
+
w(this, "lembranca", new He(() => ({
|
|
1783
|
+
persistir: this.persistir,
|
|
1784
|
+
conectado: this._conectado,
|
|
1785
|
+
storageKey: this.storageKey,
|
|
1786
|
+
id: this.id
|
|
1787
|
+
})));
|
|
1788
|
+
w(this, "_categorias", []);
|
|
1789
|
+
w(this, "_tipos", []);
|
|
1790
|
+
w(this, "_tipoSelecionadoId", "");
|
|
1791
|
+
w(this, "_termoBusca", "");
|
|
1792
|
+
w(this, "_larguraRotuloPorcentagem", 45);
|
|
1793
|
+
w(this, "_sincronizandoFlutuante", !1);
|
|
1794
|
+
w(this, "_textos", {});
|
|
1795
|
+
w(this, "tipoContainerElement");
|
|
1796
|
+
w(this, "corpoElement");
|
|
1797
|
+
w(this, "btnAplicarElement");
|
|
1798
|
+
w(this, "btnDesfazerElement");
|
|
1799
|
+
w(this, "splitterElement");
|
|
1800
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = gt(), this.tipoContainerElement = this.shadow.getElementById("tipo-container"), this.corpoElement = this.shadow.getElementById("corpo"), this.btnAplicarElement = this.shadow.getElementById("btn-aplicar"), this.btnDesfazerElement = this.shadow.getElementById("btn-desfazer"), this.splitterElement = this.shadow.getElementById("splitter"), this.gerenciadorValores = new wt({
|
|
1801
|
+
hostElement: this,
|
|
1802
|
+
getCategorias: () => this._categorias,
|
|
1803
|
+
onAtualizarBotoesFooter: (e) => {
|
|
1804
|
+
this.btnAplicarElement.disabled = !e, this.btnDesfazerElement.disabled = !e;
|
|
1805
|
+
},
|
|
1806
|
+
onAtualizarCampoVisual: (e, i) => ge(this.shadow, e, i),
|
|
1807
|
+
onRenderCategorias: () => this.renderCategorias(),
|
|
1808
|
+
isModoManual: () => this.getAttribute("modo-aplicar") === "manual"
|
|
1809
|
+
}), this.controladorSplitter = ft({
|
|
1810
|
+
hostElement: this,
|
|
1811
|
+
corpoElement: this.corpoElement,
|
|
1812
|
+
splitterElement: this.splitterElement,
|
|
1813
|
+
splitterListeners: this.splitterListeners,
|
|
1814
|
+
onLarguraAlterada: (e) => {
|
|
1815
|
+
this._larguraRotuloPorcentagem = e;
|
|
1816
|
+
}
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
static get observedAttributes() {
|
|
1820
|
+
return [
|
|
1821
|
+
"titulo",
|
|
1822
|
+
"estilo-visual",
|
|
1823
|
+
"modo-aplicar",
|
|
1824
|
+
"filtro",
|
|
1825
|
+
"densidade",
|
|
1826
|
+
"largura-rotulo",
|
|
1827
|
+
"fechavel",
|
|
1828
|
+
"colapsado",
|
|
1829
|
+
"flutuante",
|
|
1830
|
+
"texto-misto",
|
|
1831
|
+
"persistir",
|
|
1832
|
+
"storage-key",
|
|
1833
|
+
...Le
|
|
1834
|
+
];
|
|
1835
|
+
}
|
|
1836
|
+
get larguraRotuloPorcentagem() {
|
|
1837
|
+
return this._larguraRotuloPorcentagem;
|
|
1838
|
+
}
|
|
1839
|
+
connectedCallback() {
|
|
1840
|
+
this.listeners.cleanup(), this._conectado = !0, this.atualizarRegistroChavePadrao(), this.persistir && (this.lembranca.sincronizarSeChaveMudou(), this.lembranca.restaurarOrigensEmCategorias(this._categorias), this.lembranca.aplicarEmCategorias(this._categorias)), At({
|
|
1841
|
+
shadow: this.shadow,
|
|
1842
|
+
listeners: this.listeners,
|
|
1843
|
+
host: this,
|
|
1844
|
+
onToggleExpandirTodas: () => this.toggleExpandirTodas(),
|
|
1845
|
+
onFiltrar: (e) => {
|
|
1846
|
+
this._termoBusca = e, this.renderCategorias();
|
|
1847
|
+
},
|
|
1848
|
+
onAplicar: () => this.aplicar(),
|
|
1849
|
+
onDesfazer: () => this.desfazer(),
|
|
1850
|
+
onAlternarDensidade: () => this.alternarDensidade(),
|
|
1851
|
+
onAlternarFlutuante: () => this.alternarFlutuante(),
|
|
1852
|
+
onAlternarColapsoHorizontal: () => this.alternarColapsoHorizontal(),
|
|
1853
|
+
onFocarPrimeiroEditor: () => Xe(this.shadow)
|
|
1854
|
+
}), this.hasAttribute("flutuante") && be(this), yt(this, this.shadow, this.listeners), this.controladorSplitter.init(), pe(this, this.shadow.getElementById("container")), this.syncState();
|
|
1855
|
+
}
|
|
1856
|
+
disconnectedCallback() {
|
|
1857
|
+
this._conectado = !1, this.atualizarRegistroChavePadrao(), this.listeners.cleanup(), this.splitterListeners.cleanup(), this.shadow.querySelectorAll(".ui-prop__ac").forEach((e) => e.remove());
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* Cada atributo atualiza só o que depende dele: redesenhar todas as linhas (ex.: ao trocar o
|
|
1861
|
+
* `titulo`) tiraria o foco de um campo em edição.
|
|
1862
|
+
*/
|
|
1863
|
+
attributeChangedCallback(e, i, o) {
|
|
1864
|
+
if (i !== o) {
|
|
1865
|
+
if (Me(e)) {
|
|
1866
|
+
pe(this, this.shadow.getElementById("container"));
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
switch (e) {
|
|
1870
|
+
case "largura-rotulo": {
|
|
1871
|
+
const a = parseFloat(o ?? "");
|
|
1872
|
+
isNaN(a) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(a));
|
|
1873
|
+
return;
|
|
1874
|
+
}
|
|
1875
|
+
case "estilo-visual":
|
|
1876
|
+
this.renderSeletorTipos();
|
|
1877
|
+
return;
|
|
1878
|
+
case "texto-misto":
|
|
1879
|
+
this.renderCategorias();
|
|
1880
|
+
return;
|
|
1881
|
+
case "filtro":
|
|
1882
|
+
if (L(this.shadow, this), o === null && this._termoBusca) {
|
|
1883
|
+
this._termoBusca = "";
|
|
1884
|
+
const a = this.shadow.getElementById("filtro-input");
|
|
1885
|
+
a && (a.value = ""), this.renderCategorias();
|
|
1886
|
+
}
|
|
1887
|
+
return;
|
|
1888
|
+
case "flutuante":
|
|
1889
|
+
this._sincronizandoFlutuante || (this._conectado && be(this), L(this.shadow, this));
|
|
1890
|
+
return;
|
|
1891
|
+
case "modo-aplicar":
|
|
1892
|
+
o !== "manual" && this.gerenciadorValores.isDirty && this.aplicar(), L(this.shadow, this);
|
|
1893
|
+
return;
|
|
1894
|
+
case "persistir":
|
|
1895
|
+
this.atualizarRegistroChavePadrao(), this._conectado && this.persistir && (this.lembranca.sincronizarSeChaveMudou(), this.lembranca.restaurarOrigensEmCategorias(this._categorias), this.lembranca.aplicarEmCategorias(this._categorias), this.atualizarVisaoCategorias());
|
|
1896
|
+
return;
|
|
1897
|
+
case "storage-key":
|
|
1898
|
+
this.atualizarRegistroChavePadrao(), this._conectado && this.persistir && (this.lembranca.carregarDoStorage(!0), this.lembranca.restaurarOrigensEmCategorias(this._categorias), this.lembranca.aplicarEmCategorias(this._categorias), this.atualizarVisaoCategorias());
|
|
1899
|
+
return;
|
|
1900
|
+
default:
|
|
1901
|
+
L(this.shadow, this);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
// --- Propriedades Públicas Espelhadas (Getters e Setters Tipados) ---
|
|
1906
|
+
get titulo() {
|
|
1907
|
+
return this.getAttribute("titulo") || "Propriedades";
|
|
1908
|
+
}
|
|
1909
|
+
set titulo(e) {
|
|
1910
|
+
e ? this.setAttribute("titulo", e) : this.removeAttribute("titulo");
|
|
1911
|
+
}
|
|
1912
|
+
get estiloVisual() {
|
|
1913
|
+
return this.getAttribute("estilo-visual") || "autocad";
|
|
1914
|
+
}
|
|
1915
|
+
set estiloVisual(e) {
|
|
1916
|
+
e && e !== "autocad" ? this.setAttribute("estilo-visual", e) : this.removeAttribute("estilo-visual");
|
|
1917
|
+
}
|
|
1918
|
+
get modoAplicar() {
|
|
1919
|
+
return this.getAttribute("modo-aplicar") || "imediato";
|
|
1920
|
+
}
|
|
1921
|
+
set modoAplicar(e) {
|
|
1922
|
+
e === "manual" ? this.setAttribute("modo-aplicar", "manual") : this.removeAttribute("modo-aplicar");
|
|
1923
|
+
}
|
|
1924
|
+
get filtro() {
|
|
1925
|
+
return this.hasAttribute("filtro");
|
|
1926
|
+
}
|
|
1927
|
+
set filtro(e) {
|
|
1928
|
+
e ? this.setAttribute("filtro", "") : this.removeAttribute("filtro");
|
|
1929
|
+
}
|
|
1930
|
+
get termoBusca() {
|
|
1931
|
+
return this._termoBusca;
|
|
1932
|
+
}
|
|
1933
|
+
set termoBusca(e) {
|
|
1934
|
+
this._termoBusca = (e || "").trim().toLowerCase();
|
|
1935
|
+
const i = this.shadow.getElementById("filtro-input");
|
|
1936
|
+
i && (i.value = e || ""), this.renderCategorias();
|
|
1937
|
+
}
|
|
1938
|
+
get larguraRotulo() {
|
|
1939
|
+
return this._larguraRotuloPorcentagem;
|
|
1940
|
+
}
|
|
1941
|
+
set larguraRotulo(e) {
|
|
1942
|
+
const i = typeof e == "number" ? e : parseFloat(String(e));
|
|
1943
|
+
isNaN(i) || this.setAttribute("largura-rotulo", String(i));
|
|
1944
|
+
}
|
|
1945
|
+
get fechavel() {
|
|
1946
|
+
return this.hasAttribute("fechavel");
|
|
1947
|
+
}
|
|
1948
|
+
set fechavel(e) {
|
|
1949
|
+
e ? this.setAttribute("fechavel", "") : this.removeAttribute("fechavel");
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Habilita a persistência das abas/categorias abertas no `localStorage`.
|
|
1953
|
+
* Ativo por padrão (`true`); defina `persistir="false"` para manter apenas em memória.
|
|
1954
|
+
*/
|
|
1955
|
+
get persistir() {
|
|
1956
|
+
return this.getAttribute("persistir") !== "false";
|
|
1957
|
+
}
|
|
1958
|
+
set persistir(e) {
|
|
1959
|
+
e === !1 ? this.setAttribute("persistir", "false") : this.removeAttribute("persistir");
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* Chave customizada de armazenamento no `localStorage` (`storage-key`).
|
|
1963
|
+
* Quando omitida, usa o atributo `id` do componente ou `'default'`.
|
|
1964
|
+
*/
|
|
1965
|
+
get storageKey() {
|
|
1966
|
+
return this.getAttribute("storage-key");
|
|
1967
|
+
}
|
|
1968
|
+
set storageKey(e) {
|
|
1969
|
+
e && e.trim() ? this.setAttribute("storage-key", e.trim()) : this.removeAttribute("storage-key");
|
|
1970
|
+
}
|
|
1971
|
+
get categorias() {
|
|
1972
|
+
return this._categorias;
|
|
1973
|
+
}
|
|
1974
|
+
set categorias(e) {
|
|
1975
|
+
this._categorias = Array.isArray(e) ? e : [], this.gerenciadorValores.inicializarCategorias(this._categorias), this.lembranca.registrarOrigens(this._categorias), this._conectado && this.persistir && this.lembranca.sincronizarSeChaveMudou(), this.lembranca.aplicarEmCategorias(this._categorias), this.renderCategorias();
|
|
1976
|
+
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Texto exibido nas propriedades cujo valor difere entre os objetos selecionados
|
|
1979
|
+
* (`VALOR_MISTO`). Reflete o atributo `texto-misto`; padrão "Varia".
|
|
1980
|
+
*/
|
|
1981
|
+
get textoMisto() {
|
|
1982
|
+
const e = this.getAttribute("texto-misto");
|
|
1983
|
+
return e && e.trim() ? e : ae;
|
|
1984
|
+
}
|
|
1985
|
+
set textoMisto(e) {
|
|
1986
|
+
typeof e == "string" && e.trim() ? this.setAttribute("texto-misto", e) : this.removeAttribute("texto-misto");
|
|
1987
|
+
}
|
|
1988
|
+
/** Textos fixos do painel (tradução/personalização). Chaves omitidas usam o padrão em português. */
|
|
1989
|
+
get textos() {
|
|
1990
|
+
return { ...k, ...this._textos };
|
|
1991
|
+
}
|
|
1992
|
+
set textos(e) {
|
|
1993
|
+
const i = {};
|
|
1994
|
+
e && typeof e == "object" && Object.keys(k).forEach((o) => {
|
|
1995
|
+
const a = e[o];
|
|
1996
|
+
typeof a == "string" && a.trim() && (i[o] = a);
|
|
1997
|
+
}), this._textos = i, L(this.shadow, this), this.renderSeletorTipos(), this.renderCategorias();
|
|
1998
|
+
}
|
|
1999
|
+
/** Texto personalizado de uma chave (ou o padrão). */
|
|
2000
|
+
obterTexto(e) {
|
|
2001
|
+
return this._textos[e] || k[e];
|
|
2002
|
+
}
|
|
2003
|
+
get tipos() {
|
|
2004
|
+
return this._tipos;
|
|
2005
|
+
}
|
|
2006
|
+
set tipos(e) {
|
|
2007
|
+
this._tipos = Array.isArray(e) ? e : [], this.renderSeletorTipos();
|
|
2008
|
+
}
|
|
2009
|
+
/** Id do tipo exibido no seletor: sem seleção válida, o seletor mostra (e devolve) o primeiro. */
|
|
2010
|
+
get tipoSelecionado() {
|
|
2011
|
+
const e = this._tipos.filter((o) => o && o.id !== null && o.id !== void 0);
|
|
2012
|
+
return !e.some((o) => String(o.id) === this._tipoSelecionadoId) && e.length > 0 ? String(e[0].id) : this._tipoSelecionadoId;
|
|
2013
|
+
}
|
|
2014
|
+
set tipoSelecionado(e) {
|
|
2015
|
+
this._tipoSelecionadoId = String(e ?? ""), this.renderSeletorTipos();
|
|
2016
|
+
}
|
|
2017
|
+
get valores() {
|
|
2018
|
+
return this.gerenciadorValores.getValores();
|
|
2019
|
+
}
|
|
2020
|
+
set valores(e) {
|
|
2021
|
+
this.gerenciadorValores.setValores(e), this._termoBusca && this.renderCategorias();
|
|
2022
|
+
}
|
|
2023
|
+
get isDirty() {
|
|
2024
|
+
return this.gerenciadorValores.isDirty;
|
|
2025
|
+
}
|
|
2026
|
+
get dirty() {
|
|
2027
|
+
return this.gerenciadorValores.isDirty;
|
|
2028
|
+
}
|
|
2029
|
+
obterValor(e) {
|
|
2030
|
+
return this.gerenciadorValores.obterValor(e);
|
|
2031
|
+
}
|
|
2032
|
+
definirValor(e, i, o = !0) {
|
|
2033
|
+
this.gerenciadorValores.definirValor(e, i, o);
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Volta uma propriedade ao valor do último carregar/aplicar (o mesmo que o botão ↺ da linha).
|
|
2037
|
+
* Fora do modo manual emite `ui-propriedade-alterada`. Devolve `false` se não havia o que restaurar.
|
|
2038
|
+
*/
|
|
2039
|
+
redefinirValor(e, i = !0) {
|
|
2040
|
+
return this.gerenciadorValores.redefinirValor(e, i);
|
|
2041
|
+
}
|
|
2042
|
+
aplicar() {
|
|
2043
|
+
this.gerenciadorValores.aplicar();
|
|
2044
|
+
}
|
|
2045
|
+
desfazer() {
|
|
2046
|
+
this.gerenciadorValores.desfazer();
|
|
2047
|
+
}
|
|
2048
|
+
expandirTudo() {
|
|
2049
|
+
const e = [];
|
|
2050
|
+
for (const i of this._categorias) {
|
|
2051
|
+
const o = N(i);
|
|
2052
|
+
o !== null && e.push([o, !0]);
|
|
2053
|
+
}
|
|
2054
|
+
this.lembranca.registrarVarias(e), Ge(this.shadow, this._categorias), e.length > 0 && this.emitirEstadoCategorias();
|
|
2055
|
+
}
|
|
2056
|
+
colapsarTudo() {
|
|
2057
|
+
const e = [];
|
|
2058
|
+
for (const i of this._categorias) {
|
|
2059
|
+
const o = N(i);
|
|
2060
|
+
o !== null && e.push([o, !1]);
|
|
2061
|
+
}
|
|
2062
|
+
this.lembranca.registrarVarias(e), Ye(this.shadow, this._categorias), e.length > 0 && this.emitirEstadoCategorias();
|
|
2063
|
+
}
|
|
2064
|
+
toggleCategoria(e) {
|
|
2065
|
+
const i = this._categorias.find((n) => N(n) === e);
|
|
2066
|
+
if (!i) return;
|
|
2067
|
+
const o = this._termoBusca ? void 0 : this.lembranca.estaAberta(i), a = Ze(this.shadow, this, this._categorias, e, o);
|
|
2068
|
+
typeof a == "boolean" && (this.lembranca.registrar(e, a), this.emitirEstadoCategorias());
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Retorna a chave completa de armazenamento utilizada por esta instância no `localStorage`.
|
|
2072
|
+
*/
|
|
2073
|
+
obterChaveStorageAtual() {
|
|
2074
|
+
return this.lembranca.chaveAtual();
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Retorna um mapa `{ categoriaId: aberto }` refletindo as abas atualmente lembradas e visíveis.
|
|
2078
|
+
*/
|
|
2079
|
+
obterEstadoCategorias() {
|
|
2080
|
+
return this.lembranca.obterEstado(this._categorias);
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Define programaticamente o estado aberto/fechado de um conjunto de categorias.
|
|
2084
|
+
*/
|
|
2085
|
+
definirEstadoCategorias(e, i) {
|
|
2086
|
+
if (!e || typeof e != "object") return;
|
|
2087
|
+
const o = [];
|
|
2088
|
+
for (const [a, n] of Object.entries(e))
|
|
2089
|
+
typeof n == "boolean" && o.push([a, n]);
|
|
2090
|
+
o.length !== 0 && (this.lembranca.registrarVarias(o, (i == null ? void 0 : i.persistir) !== !1), this.lembranca.aplicarEmCategorias(this._categorias), this.atualizarVisaoCategorias(), i != null && i.emitirEvento && this.emitirEstadoCategorias());
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Remove as preferências lembradas em memória e no `localStorage`, restaurando o padrão das categorias.
|
|
2094
|
+
*/
|
|
2095
|
+
limparEstadoCategorias() {
|
|
2096
|
+
this.lembranca.limpar(this._categorias), this.atualizarVisaoCategorias();
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Alias compatível com `<ui-camadas>` para limpar a memória persistida das categorias.
|
|
2100
|
+
*/
|
|
2101
|
+
limparLembranca() {
|
|
2102
|
+
this.limparEstadoCategorias();
|
|
2103
|
+
}
|
|
2104
|
+
get densidade() {
|
|
2105
|
+
return this.getAttribute("densidade") || "padrao";
|
|
2106
|
+
}
|
|
2107
|
+
set densidade(e) {
|
|
2108
|
+
!e || e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e);
|
|
2109
|
+
}
|
|
2110
|
+
alternarDensidade() {
|
|
2111
|
+
const e = Et(this.getAttribute("densidade") || "padrao");
|
|
2112
|
+
return e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e), this.dispatchEvent(
|
|
2113
|
+
new CustomEvent("ui-densidade-alterada", {
|
|
2114
|
+
bubbles: !0,
|
|
2115
|
+
composed: !0,
|
|
2116
|
+
detail: { densidade: e }
|
|
2117
|
+
})
|
|
2118
|
+
), L(this.shadow, this), e;
|
|
2119
|
+
}
|
|
2120
|
+
get flutuante() {
|
|
2121
|
+
return this.hasAttribute("flutuante");
|
|
2122
|
+
}
|
|
2123
|
+
set flutuante(e) {
|
|
2124
|
+
!!e !== this.hasAttribute("flutuante") && this.alternarFlutuante();
|
|
2125
|
+
}
|
|
2126
|
+
get colapsado() {
|
|
2127
|
+
return this.hasAttribute("colapsado");
|
|
2128
|
+
}
|
|
2129
|
+
set colapsado(e) {
|
|
2130
|
+
!!e !== this.hasAttribute("colapsado") && this.alternarColapsoHorizontal();
|
|
2131
|
+
}
|
|
2132
|
+
alternarFlutuante() {
|
|
2133
|
+
this._sincronizandoFlutuante = !0;
|
|
2134
|
+
try {
|
|
2135
|
+
const e = _t(this);
|
|
2136
|
+
return L(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-flutuante-alterado", {
|
|
2137
|
+
bubbles: !0,
|
|
2138
|
+
composed: !0,
|
|
2139
|
+
detail: {
|
|
2140
|
+
flutuante: e,
|
|
2141
|
+
left: this.style.left,
|
|
2142
|
+
top: this.style.top,
|
|
2143
|
+
width: this.style.width,
|
|
2144
|
+
height: this.style.height
|
|
2145
|
+
}
|
|
2146
|
+
})), e;
|
|
2147
|
+
} finally {
|
|
2148
|
+
this._sincronizandoFlutuante = !1;
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
alternarColapsoHorizontal() {
|
|
2152
|
+
const e = this.hasAttribute("colapsado");
|
|
2153
|
+
e ? this.removeAttribute("colapsado") : this.setAttribute("colapsado", "");
|
|
2154
|
+
const i = !e;
|
|
2155
|
+
return L(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-colapso-horizontal", {
|
|
2156
|
+
bubbles: !0,
|
|
2157
|
+
composed: !0,
|
|
2158
|
+
detail: { colapsado: i }
|
|
2159
|
+
})), i;
|
|
2160
|
+
}
|
|
2161
|
+
syncState() {
|
|
2162
|
+
L(this.shadow, this);
|
|
2163
|
+
const e = this.getAttribute("largura-rotulo");
|
|
2164
|
+
if (e) {
|
|
2165
|
+
const i = parseFloat(e);
|
|
2166
|
+
isNaN(i) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(i));
|
|
2167
|
+
}
|
|
2168
|
+
this.renderSeletorTipos(), this.renderCategorias();
|
|
2169
|
+
}
|
|
2170
|
+
toggleExpandirTodas() {
|
|
2171
|
+
this._categorias.some(
|
|
2172
|
+
(i) => !!(i && typeof i == "object") && !this.lembranca.estaAberta(i)
|
|
2173
|
+
) ? this.expandirTudo() : this.colapsarTudo();
|
|
2174
|
+
}
|
|
2175
|
+
atualizarRegistroChavePadrao() {
|
|
2176
|
+
var i, o;
|
|
2177
|
+
if (this._conectado && this.persistir && !((i = this.getAttribute("storage-key")) != null && i.trim()) && !((o = this.id) != null && o.trim())) {
|
|
2178
|
+
const a = j.instanciasChavePadrao.has(this);
|
|
2179
|
+
j.instanciasChavePadrao.add(this), !a && j.instanciasChavePadrao.size > 1 && console.warn(
|
|
2180
|
+
'[ui-tabela-propriedades] Múltiplos painéis persistentes conectados sem "id" ou "storage-key". Todos compartilharão a mesma chave de armazenamento.'
|
|
2181
|
+
);
|
|
2182
|
+
} else
|
|
2183
|
+
j.instanciasChavePadrao.delete(this);
|
|
2184
|
+
}
|
|
2185
|
+
atualizarVisaoCategorias() {
|
|
2186
|
+
const e = this.shadow.querySelectorAll(".ui-prop__categoria").length > 0;
|
|
2187
|
+
if (!this._termoBusca && e) {
|
|
2188
|
+
We(this.shadow, this._categorias, (i) => this.lembranca.estaAberta(i));
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
this.renderCategorias();
|
|
2192
|
+
}
|
|
2193
|
+
emitirEstadoCategorias() {
|
|
2194
|
+
const e = this.lembranca.montarDetalheEvento(this._categorias);
|
|
2195
|
+
this.dispatchEvent(
|
|
2196
|
+
new CustomEvent("ui-categorias-estado", {
|
|
2197
|
+
bubbles: !0,
|
|
2198
|
+
composed: !0,
|
|
2199
|
+
detail: e
|
|
2200
|
+
})
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
renderSeletorTipos() {
|
|
2204
|
+
ht({
|
|
2205
|
+
tipoContainerElement: this.tipoContainerElement,
|
|
2206
|
+
tipos: this._tipos,
|
|
2207
|
+
tipoSelecionadoId: this._tipoSelecionadoId,
|
|
2208
|
+
estiloVisual: this.getAttribute("estilo-visual") || "autocad",
|
|
2209
|
+
onSelecionarTipo: (e) => {
|
|
2210
|
+
this._tipoSelecionadoId = e, this.renderSeletorTipos();
|
|
2211
|
+
const i = this._tipos.find((o) => o && String(o.id) === String(e));
|
|
2212
|
+
this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo: i } }));
|
|
2213
|
+
},
|
|
2214
|
+
onEditarTipo: (e) => this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2215
|
+
onQuickSelect: (e) => this.dispatchEvent(new CustomEvent("ui-quick-select", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2216
|
+
onSelectObjects: (e) => this.dispatchEvent(new CustomEvent("ui-selecionar-objetos", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2217
|
+
onCalculadora: (e) => this.dispatchEvent(new CustomEvent("ui-calculadora", { bubbles: !0, composed: !0, detail: { tipo: e } })),
|
|
2218
|
+
obterTexto: (e) => this.obterTexto(e)
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
renderCategorias() {
|
|
2222
|
+
const e = this.shadow.getElementById("lista-categorias");
|
|
2223
|
+
e && (this.shadow.querySelectorAll(".ui-prop__ac").forEach((i) => i.remove()), bt({
|
|
2224
|
+
listaContainer: e,
|
|
2225
|
+
categorias: this._categorias,
|
|
2226
|
+
termoBusca: this._termoBusca,
|
|
2227
|
+
obterTexto: (i) => this.obterTexto(i),
|
|
2228
|
+
onToggleCategoria: (i) => this.toggleCategoria(i),
|
|
2229
|
+
obterCategoriaAberta: (i) => this.lembranca.estaAberta(i),
|
|
2230
|
+
linhaCtx: {
|
|
2231
|
+
valoresAtuais: this.gerenciadorValores.getValores(),
|
|
2232
|
+
valoresOriginais: this.gerenciadorValores.getValoresOriginais(),
|
|
2233
|
+
onAtualizarCampoVisual: (i, o) => ge(this.shadow, i, o),
|
|
2234
|
+
onRedefinir: (i) => this.redefinirValor(i),
|
|
2235
|
+
editorCtx: {
|
|
2236
|
+
obterValorAtual: (i) => this.gerenciadorValores.obterValor(i),
|
|
2237
|
+
registrarAlteracao: (i, o, a) => {
|
|
2238
|
+
this.gerenciadorValores.registrarAlteracao(i, o, a);
|
|
2239
|
+
},
|
|
2240
|
+
focarProximoEditor: (i) => Ke(this.shadow, i),
|
|
2241
|
+
focarEditorAnterior: (i) => Ue(this.shadow, i),
|
|
2242
|
+
obterTextoMisto: () => this.textoMisto,
|
|
2243
|
+
obterTexto: (i) => this.obterTexto(i),
|
|
2244
|
+
despacharEventoAcao: (i, o) => {
|
|
2245
|
+
this.dispatchEvent(
|
|
2246
|
+
new CustomEvent("ui-acao-clique", {
|
|
2247
|
+
bubbles: !0,
|
|
2248
|
+
composed: !0,
|
|
2249
|
+
detail: { id: i.id, categoriaId: o, propriedade: i }
|
|
2250
|
+
})
|
|
2251
|
+
);
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}));
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
w(j, "instanciasChavePadrao", /* @__PURE__ */ new Set());
|
|
2259
|
+
let q = j;
|
|
2260
|
+
class Ct extends q {
|
|
2261
|
+
}
|
|
2262
|
+
class kt extends q {
|
|
2263
|
+
}
|
|
2264
|
+
te("ui-tabela-propriedades", q);
|
|
2265
|
+
te("ui-painel-propriedades", Ct);
|
|
2266
|
+
te("ui-propriedades", kt);
|
|
2267
|
+
export {
|
|
2268
|
+
be as $,
|
|
2269
|
+
pt as A,
|
|
2270
|
+
vt as B,
|
|
2271
|
+
Ge as C,
|
|
2272
|
+
Ue as D,
|
|
2273
|
+
Xe as E,
|
|
2274
|
+
Ke as F,
|
|
2275
|
+
wt as G,
|
|
2276
|
+
H,
|
|
2277
|
+
N as I,
|
|
2278
|
+
Z as J,
|
|
2279
|
+
A as K,
|
|
2280
|
+
He as L,
|
|
2281
|
+
$e as M,
|
|
2282
|
+
W as N,
|
|
2283
|
+
Fe as O,
|
|
2284
|
+
Y as P,
|
|
2285
|
+
Je as Q,
|
|
2286
|
+
Et as R,
|
|
2287
|
+
P as S,
|
|
2288
|
+
k as T,
|
|
2289
|
+
Ct as U,
|
|
2290
|
+
oe as V,
|
|
2291
|
+
bt as W,
|
|
2292
|
+
ht as X,
|
|
2293
|
+
qe as Y,
|
|
2294
|
+
I as Z,
|
|
2295
|
+
We as _,
|
|
2296
|
+
ae as a,
|
|
2297
|
+
L as a0,
|
|
2298
|
+
X as a1,
|
|
2299
|
+
$ as a2,
|
|
2300
|
+
D as a3,
|
|
2301
|
+
Qe as a4,
|
|
2302
|
+
J as a5,
|
|
2303
|
+
V as a6,
|
|
2304
|
+
kt as b,
|
|
2305
|
+
q as c,
|
|
2306
|
+
Q as d,
|
|
2307
|
+
Ze as e,
|
|
2308
|
+
_t as f,
|
|
2309
|
+
ne as g,
|
|
2310
|
+
ge as h,
|
|
2311
|
+
Pe as i,
|
|
2312
|
+
xe as j,
|
|
2313
|
+
Ie as k,
|
|
2314
|
+
Ye as l,
|
|
2315
|
+
Pt as m,
|
|
2316
|
+
yt as n,
|
|
2317
|
+
At as o,
|
|
2318
|
+
ft as p,
|
|
2319
|
+
it as q,
|
|
2320
|
+
tt as r,
|
|
2321
|
+
ct as s,
|
|
2322
|
+
ut as t,
|
|
2323
|
+
nt as u,
|
|
2324
|
+
st as v,
|
|
2325
|
+
ot as w,
|
|
2326
|
+
et as x,
|
|
2327
|
+
rt as y,
|
|
2328
|
+
at as z
|
|
2329
|
+
};
|