@thibezer/ui-components-kit 2.17.1 → 2.17.3

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